nexuscli.api package¶
Subpackages¶
- nexuscli.api.blobstore package
- nexuscli.api.cleanup_policy package
- nexuscli.api.repository package
- Subpackages
- nexuscli.api.repository.base_models package
- Submodules
- nexuscli.api.repository.base_models.base_repository module
- nexuscli.api.repository.base_models.group_repository module
- nexuscli.api.repository.base_models.hosted_repository module
- nexuscli.api.repository.base_models.proxy_repository module
- nexuscli.api.repository.base_models.repository module
- nexuscli.api.repository.base_models.util module
- Module contents
- nexuscli.api.repository.recipes package
- Submodules
- nexuscli.api.repository.recipes.apt module
- nexuscli.api.repository.recipes.bower module
- nexuscli.api.repository.recipes.docker module
- nexuscli.api.repository.recipes.maven module
- nexuscli.api.repository.recipes.npm module
- nexuscli.api.repository.recipes.nuget module
- nexuscli.api.repository.recipes.pypi module
- nexuscli.api.repository.recipes.raw module
- nexuscli.api.repository.recipes.rubygems module
- nexuscli.api.repository.recipes.validations module
- nexuscli.api.repository.recipes.yum module
- Module contents
- nexuscli.api.repository.base_models package
- Submodules
- nexuscli.api.repository.collection module
- nexuscli.api.repository.model module
- Module contents
- Subpackages
- nexuscli.api.script package
- nexuscli.api.security package
- nexuscli.api.task package
Submodules¶
nexuscli.api.base_collection module¶
-
class
nexuscli.api.base_collection.
BaseCollection
(nexus_http: nexuscli.nexus_http.NexusHttp = None)¶ Bases:
object
A base collection class that contains a Nexus 3 client.
- Parameters
nexus_http – the NexusHttp instance that will be used to perform requests against the Nexus
You must provide this at instantiation if you want to call any methods that (service.) –
connectivity to Nexus. (require) –
-
property
list
¶ Cached version of
raw_list()
. Usereset()
to refresh.
-
raw_list
() → List[dict]¶
-
reset
() → None¶ Clears the cached collection and causes the next call to
list()
to reload the response from the Nexus server.
-
run_script
(script_name: str, data: Union[str, dict] = '')¶ Runs an existing script on the Nexus 3 service.
- Parameters
script_name – name of script to be run.
data – parameters to be passed to the script, via HTTP POST. If the script being run requires a certain format or encoding, you need to prepare it yourself. Typically this is json.dumps(data).
- Returns
the content returned by the script, if any.
- Return type
- Raises
exception.NexusClientAPIError – if the Nexus service fails to run the script; i.e.: any HTTP code other than 200.
-
script_dependencies
() → List[str]¶ This method returns any scripts that the collection class depends on. These will be installed by the NexusClient instance, if not already present on the server.
nexuscli.api.base_model module¶
-
class
nexuscli.api.base_model.
BaseModel
(nexus_http: Optional[nexuscli.nexus_http.NexusHttp] = None, **kwargs)¶ Bases:
object
Base class for Nexus 3 server objects.
- Parameters
nexus_http – the NexusHttp client instance that will be used to perform operations against
Nexus 3 service. You must provide this at instantiation if you plan on calling any (the) –
that require connectivity to Nexus. (methods) –
-
property
configuration
¶ The model representation as a transformed python dict suitable for converting to JSON and passing-through to the Nexus 3 API.
nexuscli.api.util module¶
-
nexuscli.api.util.
script_for_version
(script_name: str, server_version: semver.VersionInfo, versions: List[semver.VersionInfo]) → str¶ Determine if a certain nexus server version requires a different version of the given groovy script.
- Parameters
script_name – original name of the script.
server_version – VersionInfo for the Nexus server.
versions – list of VersionInfo. Each element represents an existing groovy script that must be used with server_version or greater.
- Returns
the version-specific name of script_name.
-
nexuscli.api.util.
validate_response
(response: requests.models.Response, accepted_codes: Union[int, List[int]], exc_class: Type[Exception] = <class 'nexuscli.exception.NexusClientAPIError'>) → None¶ Ensure that
response.status_code
is one ofaccepted_codes
, otherwise raise exceptionexc_class
using the response content as the error message.
-
nexuscli.api.util.
with_min_version
(min_version: str) → Callable[[F], F]¶ Verifies that the nexus_client instance has version greater or equal to min_version
nexuscli.api.validations module¶
-
nexuscli.api.validations.
ensure_known
(target: str, value: str, known: Iterable) → None¶ Validate whether the a target argument is known and supported. The
target
is only used to provide a friendlier message to the user. The givenvalue
is checked againstknown
andsupported
.- Parameters
target – name of the target, as known to the end-user.
value – value of the target key.
known – known possible values for the target.
- Raises
ValueError – if given value is not in
known
.