nexuscli.api.repository package

Submodules

nexuscli.api.repository.collection module

class nexuscli.api.repository.collection.RepositoryCollection(*args, **kwargs)

Bases: nexuscli.api.base_collection.BaseCollection

A class to manage Nexus 3 repositories.

create(repository)

Creates a Nexus repository with the given format and type.

Parameters

repository (Repository) – the instance containing the settings for the repository to be created.

Raises

NexusClientCreateRepositoryError – error creating repository.

delete(name)

Delete a repository.

Parameters

name (str) – name of the repository to be deleted.

get_by_name(name: str) → nexuscli.api.repository.base_models.repository.Repository

Get a Nexus 3 repository by its name.

Parameters

name (str) – name of the repository wanted

Return type

nexuscli.api.repository.model.Repository

Raises

exception.NexusClientInvalidRepository – when a repository with the given name isn’t found.

get_raw_by_name(name: str) → dict

Return the raw dict for the repository called name. Remember to refresh() to get the latest from the server.

Parameters

name (str) – name of the repository wanted

Return type

dict

Raises

exception.NexusClientInvalidRepository – when a repository with the given name isn’t found.

new(repo_type, **kwargs)

Creates a Repository instance object

raw_list()

A raw representation of the Nexus repositories.

Returns

for the format, see List Repositories.

Return type

dict

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.

set_health_check(name: str, enable: bool = False) → None

Set the health check status on a Nexus 3 repository.

Parameters
  • name – name of the repository wanted

  • enable – whether to enable of disable the health check

Return type

nexuscli.api.repository.model.Repository

Raises

exception.NexusClientInvalidRepository – when a repository with the given name isn’t found.

nexuscli.api.repository.collection.get_classes_by_type(repo_types: Union[str, list]) → List[Type[nexuscli.api.repository.base_models.repository.Repository]]
nexuscli.api.repository.collection.get_repository_class(raw_configuration: dict) → Type[nexuscli.api.repository.base_models.repository.Repository]

Given a raw repository configuration, returns its corresponding class.

Parameters

raw_configuration (dict) – configuration as returned by the SCRIPT_NAME_GET groovy script.

Returns

repository class

nexuscli.api.repository.collection.get_repository_classes() → List[Type[nexuscli.api.repository.base_models.repository.Repository]]
nexuscli.api.repository.collection.get_supported_recipes() → List[str]

nexuscli.api.repository.model module

Module contents