You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::CodeArtifact::Client

Inherits:
Seahorse::Client::Base show all
Defined in:
(unknown)

Overview

An API client for CodeArtifact. To construct a client, you need to configure a :region and :credentials.

codeartifact = Aws::CodeArtifact::Client.new(
  region: region_name,
  credentials: credentials,
  # ...
)

See #initialize for a full list of supported configuration options.

Region

You can configure a default region in the following locations:

  • ENV['AWS_REGION']
  • Aws.config[:region]

Go here for a list of supported regions.

Credentials

Default credentials are loaded automatically from the following locations:

  • ENV['AWS_ACCESS_KEY_ID'] and ENV['AWS_SECRET_ACCESS_KEY']
  • Aws.config[:credentials]
  • The shared credentials ini file at ~/.aws/credentials (more information)
  • From an instance profile when running on EC2

You can also construct a credentials object from one of the following classes:

Alternatively, you configure credentials with :access_key_id and :secret_access_key:

# load credentials from disk
creds = YAML.load(File.read('/path/to/secrets'))

Aws::CodeArtifact::Client.new(
  access_key_id: creds['access_key_id'],
  secret_access_key: creds['secret_access_key']
)

Always load your credentials from outside your application. Avoid configuring credentials statically and never commit them to source control.

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

Constructor collapse

API Operations collapse

Instance Method Summary collapse

Methods inherited from Seahorse::Client::Base

add_plugin, api, #build_request, clear_plugins, define, new, #operation, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(options = {}) ⇒ Aws::CodeArtifact::Client

Constructs an API client.

Options Hash (options):

  • :access_key_id (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :active_endpoint_cache (Boolean)

    When set to true, a thread polling for endpoints will be running in the background every 60 secs (default). Defaults to false. See Plugins::EndpointDiscovery for more details.

  • :convert_params (Boolean) — default: true

    When true, an attempt is made to coerce request parameters into the required types. See Plugins::ParamConverter for more details.

  • :credentials (required, Credentials)

    Your AWS credentials. The following locations will be searched in order for credentials:

    • :access_key_id, :secret_access_key, and :session_token options
    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
    • HOME/.aws/credentials shared credentials file
    • EC2 instance profile credentials See Plugins::RequestSigner for more details.
  • :disable_host_prefix_injection (Boolean)

    Set to true to disable SDK automatically adding host prefix to default service endpoint when available. See Plugins::EndpointPattern for more details.

  • :endpoint (String)

    A default endpoint is constructed from the :region. See Plugins::RegionalEndpoint for more details.

  • :endpoint_cache_max_entries (Integer)

    Used for the maximum size limit of the LRU cache storing endpoints data for endpoint discovery enabled operations. Defaults to 1000. See Plugins::EndpointDiscovery for more details.

  • :endpoint_cache_max_threads (Integer)

    Used for the maximum threads in use for polling endpoints to be cached, defaults to 10. See Plugins::EndpointDiscovery for more details.

  • :endpoint_cache_poll_interval (Integer)

    When :endpoint_discovery and :active_endpoint_cache is enabled, Use this option to config the time interval in seconds for making requests fetching endpoints information. Defaults to 60 sec. See Plugins::EndpointDiscovery for more details.

  • :endpoint_discovery (Boolean)

    When set to true, endpoint discovery will be enabled for operations when available. Defaults to false. See Plugins::EndpointDiscovery for more details.

  • :http_continue_timeout (Float) — default: 1

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_idle_timeout (Integer) — default: 5

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_open_timeout (Integer) — default: 15

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_proxy (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_read_timeout (Integer) — default: 60

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_wire_trace (Boolean) — default: false

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :log_level (Symbol) — default: :info

    The log level to send messages to the logger at. See Plugins::Logging for more details.

  • :log_formatter (Logging::LogFormatter)

    The log formatter. Defaults to Seahorse::Client::Logging::Formatter.default. See Plugins::Logging for more details.

  • :logger (Logger) — default: nil

    The Logger instance to send log messages to. If this option is not set, logging will be disabled. See Plugins::Logging for more details.

  • :profile (String)

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, 'default' is used. See Plugins::RequestSigner for more details.

  • :raise_response_errors (Boolean) — default: true

    When true, response errors are raised. See Seahorse::Client::Plugins::RaiseResponseErrors for more details.

  • :region (required, String)

    The AWS region to connect to. The region is used to construct the client endpoint. Defaults to ENV['AWS_REGION']. Also checks AMAZON_REGION and AWS_DEFAULT_REGION. See Plugins::RegionalEndpoint for more details.

  • :retry_limit (Integer) — default: 3

    The maximum number of times to retry failed requests. Only ~ 500 level server errors and certain ~ 400 level client errors are retried. Generally, these are throttling errors, data checksum errors, networking errors, timeout errors and auth errors from expired credentials. See Plugins::RetryErrors for more details.

  • :secret_access_key (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :session_token (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :ssl_ca_bundle (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_directory (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_store (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_verify_peer (Boolean) — default: true

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :stub_responses (Boolean) — default: false

    Causes the client to return stubbed responses. By default fake responses are generated and returned. You can specify the response data to return or errors to raise by calling Aws::ClientStubs#stub_responses. See Aws::ClientStubs for more information.

    Please note When response stubbing is enabled, no HTTP requests are made, and retries are disabled. See Plugins::StubResponses for more details.

  • :validate_params (Boolean) — default: true

    When true, request parameters are validated before sending the request. See Plugins::ParamValidator for more details.

Instance Method Details

#associate_external_connection(options = {}) ⇒ Types::AssociateExternalConnectionResult

Adds an existing external connection to a repository. One external connection is allowed per repository.

A repository can have one or more upstream repositories, or an external connection.

Examples:

Request syntax with placeholder values


resp = client.associate_external_connection({
  domain: "DomainName", # required
  domain_owner: "AccountId",
  repository: "RepositoryName", # required
  external_connection: "ExternalConnectionName", # required
})

Response structure


resp.repository.name #=> String
resp.repository. #=> String
resp.repository.domain_name #=> String
resp.repository.domain_owner #=> String
resp.repository.arn #=> String
resp.repository.description #=> String
resp.repository.upstreams #=> Array
resp.repository.upstreams[0].repository_name #=> String
resp.repository.external_connections #=> Array
resp.repository.external_connections[0].external_connection_name #=> String
resp.repository.external_connections[0].package_format #=> String, one of "npm", "pypi", "maven"
resp.repository.external_connections[0].status #=> String, one of "Available"

Options Hash (options):

  • :domain (required, String)

    The name of the domain that contains the repository.

  • :domain_owner (String)

    The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

  • :repository (required, String)

    The name of the repository to which the external connection is added.

  • :external_connection (required, String)

    The name of the external connection to add to the repository. The following values are supported:

    • public:npmjs - for the npm public repository.

    • public:pypi - for the Python Package Index.

    • public:maven-central - for Maven Central.

    • public:maven-googleandroid - for the Google Android repository.

    • public:maven-gradleplugins - for the Gradle plugins repository.

    • public:maven-commonsware - for the CommonsWare Android repository.

Returns:

See Also:

#copy_package_versions(options = {}) ⇒ Types::CopyPackageVersionsResult

Copies package versions from one repository to another repository in the same domain.

You must specify versions or versionRevisions. You cannot specify both.

Examples:

Request syntax with placeholder values


resp = client.copy_package_versions({
  domain: "DomainName", # required
  domain_owner: "AccountId",
  source_repository: "RepositoryName", # required
  destination_repository: "RepositoryName", # required
  format: "npm", # required, accepts npm, pypi, maven
  namespace: "PackageNamespace",
  package: "PackageName", # required
  versions: ["PackageVersion"],
  version_revisions: {
    "PackageVersion" => "PackageVersionRevision",
  },
  allow_overwrite: false,
  include_from_upstream: false,
})

Response structure


resp.successful_versions #=> Hash
resp.successful_versions["PackageVersion"].revision #=> String
resp.successful_versions["PackageVersion"].status #=> String, one of "Published", "Unfinished", "Unlisted", "Archived", "Disposed", "Deleted"
resp.failed_versions #=> Hash
resp.failed_versions["PackageVersion"].error_code #=> String, one of "ALREADY_EXISTS", "MISMATCHED_REVISION", "MISMATCHED_STATUS", "NOT_ALLOWED", "NOT_FOUND", "SKIPPED"
resp.failed_versions["PackageVersion"].error_message #=> String

Options Hash (options):

  • :domain (required, String)

    The name of the domain that contains the source and destination repositories.

  • :domain_owner (String)

    The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

  • :source_repository (required, String)

    The name of the repository that contains the package versions to copy.

  • :destination_repository (required, String)

    The name of the repository into which package versions are copied.

  • :format (required, String)

    The format of the package that is copied. The valid package types are:

    • npm: A Node Package Manager (npm) package.

    • pypi: A Python Package Index (PyPI) package.

    • maven: A Maven package that contains compiled code in a distributable format, such as a JAR file.

  • :namespace (String)

    The namespace of the package. The package component that specifies its namespace depends on its type. For example:

    • The namespace of a Maven package is its groupId.

    • The namespace of an npm package is its scope.

    • A Python package does not contain a corresponding component, so Python packages do not have a namespace.

  • :package (required, String)

    The name of the package that is copied.

  • :versions (Array<String>)

    The versions of the package to copy.

    You must specify versions or versionRevisions. You cannot specify both.

  • :version_revisions (Hash<String,String>)

    A list of key-value pairs. The keys are package versions and the values are package version revisions. A CopyPackageVersion operation succeeds if the specified versions in the source repository match the specified package version revision.

    You must specify versions or versionRevisions. You cannot specify both.

  • :allow_overwrite (Boolean)

    Set to true to overwrite a package version that already exists in the destination repository. If set to false and the package version already exists in the destination repository, the package version is returned in the failedVersions field of the response with an ALREADY_EXISTS error code.

  • :include_from_upstream (Boolean)

    Set to true to copy packages from repositories that are upstream from the source repository to the destination repository. The default setting is false. For more information, see Working with upstream repositories.

Returns:

See Also:

#create_domain(options = {}) ⇒ Types::CreateDomainResult

Creates a domain. CodeArtifact domains make it easier to manage multiple repositories across an organization. You can use a domain to apply permissions across many repositories owned by different AWS accounts. An asset is stored only once in a domain, even if it's in multiple repositories.

Although you can have multiple domains, we recommend a single production domain that contains all published artifacts so that your development teams can find and share packages. You can use a second pre-production domain to test changes to the production domain configuration.

Examples:

Request syntax with placeholder values


resp = client.create_domain({
  domain: "DomainName", # required
  encryption_key: "Arn",
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue", # required
    },
  ],
})

Response structure


resp.domain.name #=> String
resp.domain.owner #=> String
resp.domain.arn #=> String
resp.domain.status #=> String, one of "Active", "Deleted"
resp.domain.created_time #=> Time
resp.domain.encryption_key #=> String
resp.domain.repository_count #=> Integer
resp.domain.asset_size_bytes #=> Integer
resp.domain.s3_bucket_arn #=> String

Options Hash (options):

  • :domain (required, String)

    The name of the domain to create. All domain names in an AWS Region that are in the same AWS account must be unique. The domain name is used as the prefix in DNS hostnames. Do not use sensitive information in a domain name because it is publicly discoverable.

  • :encryption_key (String)

    The encryption key for the domain. This is used to encrypt content stored in a domain. An encryption key can be a key ID, a key Amazon Resource Name (ARN), a key alias, or a key alias ARN. To specify an encryptionKey, your IAM role must have kms:DescribeKey and kms:CreateGrant permissions on the encryption key that is used. For more information, see DescribeKey in the AWS Key Management Service API Reference and AWS KMS API Permissions Reference in the AWS Key Management Service Developer Guide.

    CodeArtifact supports only symmetric CMKs. Do not associate an asymmetric CMK with your domain. For more information, see Using symmetric and asymmetric keys in the AWS Key Management Service Developer Guide.

  • :tags (Array<Types::Tag>)

    One or more tag key-value pairs for the domain.

Returns:

See Also:

#create_repository(options = {}) ⇒ Types::CreateRepositoryResult

Creates a repository.

Examples:

Request syntax with placeholder values


resp = client.create_repository({
  domain: "DomainName", # required
  domain_owner: "AccountId",
  repository: "RepositoryName", # required
  description: "Description",
  upstreams: [
    {
      repository_name: "RepositoryName", # required
    },
  ],
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue", # required
    },
  ],
})

Response structure


resp.repository.name #=> String
resp.repository. #=> String
resp.repository.domain_name #=> String
resp.repository.domain_owner #=> String
resp.repository.arn #=> String
resp.repository.description #=> String
resp.repository.upstreams #=> Array
resp.repository.upstreams[0].repository_name #=> String
resp.repository.external_connections #=> Array
resp.repository.external_connections[0].external_connection_name #=> String
resp.repository.external_connections[0].package_format #=> String, one of "npm", "pypi", "maven"
resp.repository.external_connections[0].status #=> String, one of "Available"

Options Hash (options):

  • :domain (required, String)

    The domain that contains the created repository.

  • :domain_owner (String)

    The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

  • :repository (required, String)

    The name of the repository to create.

  • :description (String)

    A description of the created repository.

  • :upstreams (Array<Types::UpstreamRepository>)

    A list of upstream repositories to associate with the repository. The order of the upstream repositories in the list determines their priority order when AWS CodeArtifact looks for a requested package version. For more information, see Working with upstream repositories.

  • :tags (Array<Types::Tag>)

    One or more tag key-value pairs for the repository.

Returns:

See Also:

#delete_domain(options = {}) ⇒ Types::DeleteDomainResult

Deletes a domain. You cannot delete a domain that contains repositories. If you want to delete a domain with repositories, first delete its repositories.

Examples:

Request syntax with placeholder values


resp = client.delete_domain({
  domain: "DomainName", # required
  domain_owner: "AccountId",
})

Response structure


resp.domain.name #=> String
resp.domain.owner #=> String
resp.domain.arn #=> String
resp.domain.status #=> String, one of "Active", "Deleted"
resp.domain.created_time #=> Time
resp.domain.encryption_key #=> String
resp.domain.repository_count #=> Integer
resp.domain.asset_size_bytes #=> Integer
resp.domain.s3_bucket_arn #=> String

Options Hash (options):

  • :domain (required, String)

    The name of the domain to delete.

  • :domain_owner (String)

    The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

Returns:

See Also:

#delete_domain_permissions_policy(options = {}) ⇒ Types::DeleteDomainPermissionsPolicyResult

Deletes the resource policy set on a domain.

Examples:

Request syntax with placeholder values


resp = client.delete_domain_permissions_policy({
  domain: "DomainName", # required
  domain_owner: "AccountId",
  policy_revision: "PolicyRevision",
})

Response structure


resp.policy.resource_arn #=> String
resp.policy.revision #=> String
resp.policy.document #=> String

Options Hash (options):

  • :domain (required, String)

    The name of the domain associated with the resource policy to be deleted.

  • :domain_owner (String)

    The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

  • :policy_revision (String)

    The current revision of the resource policy to be deleted. This revision is used for optimistic locking, which prevents others from overwriting your changes to the domain\'s resource policy.

Returns:

See Also:

#delete_package_versions(options = {}) ⇒ Types::DeletePackageVersionsResult

Deletes one or more versions of a package. A deleted package version cannot be restored in your repository. If you want to remove a package version from your repository and be able to restore it later, set its status to Archived. Archived packages cannot be downloaded from a repository and don't show up with list package APIs (for example, ListackageVersions ), but you can restore them using UpdatePackageVersionsStatus .

Examples:

Request syntax with placeholder values


resp = client.delete_package_versions({
  domain: "DomainName", # required
  domain_owner: "AccountId",
  repository: "RepositoryName", # required
  format: "npm", # required, accepts npm, pypi, maven
  namespace: "PackageNamespace",
  package: "PackageName", # required
  versions: ["PackageVersion"], # required
  expected_status: "Published", # accepts Published, Unfinished, Unlisted, Archived, Disposed, Deleted
})

Response structure


resp.successful_versions #=> Hash
resp.successful_versions["PackageVersion"].revision #=> String
resp.successful_versions["PackageVersion"].status #=> String, one of "Published", "Unfinished", "Unlisted", "Archived", "Disposed", "Deleted"
resp.failed_versions #=> Hash
resp.failed_versions["PackageVersion"].error_code #=> String, one of "ALREADY_EXISTS", "MISMATCHED_REVISION", "MISMATCHED_STATUS", "NOT_ALLOWED", "NOT_FOUND", "SKIPPED"
resp.failed_versions["PackageVersion"].error_message #=> String

Options Hash (options):

  • :domain (required, String)

    The name of the domain that contains the package to delete.

  • :domain_owner (String)

    The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

  • :repository (required, String)

    The name of the repository that contains the package versions to delete.

  • :format (required, String)

    The format of the package versions to delete. The valid values are:

    • npm

    • pypi

    • maven

  • :namespace (String)

    The namespace of the package. The package component that specifies its namespace depends on its type. For example:

    • The namespace of a Maven package is its groupId.

    • The namespace of an npm package is its scope.

    • A Python package does not contain a corresponding component, so Python packages do not have a namespace.

  • :package (required, String)

    The name of the package with the versions to delete.

  • :versions (required, Array<String>)

    An array of strings that specify the versions of the package to delete.

  • :expected_status (String)

    The expected status of the package version to delete. Valid values are:

    • Published

    • Unfinished

    • Unlisted

    • Archived

    • Disposed

Returns:

See Also:

#delete_repository(options = {}) ⇒ Types::DeleteRepositoryResult

Deletes a repository.

Examples:

Request syntax with placeholder values


resp = client.delete_repository({
  domain: "DomainName", # required
  domain_owner: "AccountId",
  repository: "RepositoryName", # required
})

Response structure


resp.repository.name #=> String
resp.repository. #=> String
resp.repository.domain_name #=> String
resp.repository.domain_owner #=> String
resp.repository.arn #=> String
resp.repository.description #=> String
resp.repository.upstreams #=> Array
resp.repository.upstreams[0].repository_name #=> String
resp.repository.external_connections #=> Array
resp.repository.external_connections[0].external_connection_name #=> String
resp.repository.external_connections[0].package_format #=> String, one of "npm", "pypi", "maven"
resp.repository.external_connections[0].status #=> String, one of "Available"

Options Hash (options):

  • :domain (required, String)

    The name of the domain that contains the repository to delete.

  • :domain_owner (String)

    The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

  • :repository (required, String)

    The name of the repository to delete.

Returns:

See Also:

#delete_repository_permissions_policy(options = {}) ⇒ Types::DeleteRepositoryPermissionsPolicyResult

Deletes the resource policy that is set on a repository. After a resource policy is deleted, the permissions allowed and denied by the deleted policy are removed. The effect of deleting a resource policy might not be immediate.

Use DeleteRepositoryPermissionsPolicy with caution. After a policy is deleted, AWS users, roles, and accounts lose permissions to perform the repository actions granted by the deleted policy.

Examples:

Request syntax with placeholder values


resp = client.delete_repository_permissions_policy({
  domain: "DomainName", # required
  domain_owner: "AccountId",
  repository: "RepositoryName", # required
  policy_revision: "PolicyRevision",
})

Response structure


resp.policy.resource_arn #=> String
resp.policy.revision #=> String
resp.policy.document #=> String

Options Hash (options):

  • :domain (required, String)

    The name of the domain that contains the repository associated with the resource policy to be deleted.

  • :domain_owner (String)

    The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

  • :repository (required, String)

    The name of the repository that is associated with the resource policy to be deleted

  • :policy_revision (String)

    The revision of the repository\'s resource policy to be deleted. This revision is used for optimistic locking, which prevents others from accidentally overwriting your changes to the repository\'s resource policy.

Returns:

See Also:

#describe_domain(options = {}) ⇒ Types::DescribeDomainResult

Returns a DomainDescription object that contains information about the requested domain.

Examples:

Request syntax with placeholder values


resp = client.describe_domain({
  domain: "DomainName", # required
  domain_owner: "AccountId",
})

Response structure


resp.domain.name #=> String
resp.domain.owner #=> String
resp.domain.arn #=> String
resp.domain.status #=> String, one of "Active", "Deleted"
resp.domain.created_time #=> Time
resp.domain.encryption_key #=> String
resp.domain.repository_count #=> Integer
resp.domain.asset_size_bytes #=> Integer
resp.domain.s3_bucket_arn #=> String

Options Hash (options):

  • :domain (required, String)

    A string that specifies the name of the requested domain.

  • :domain_owner (String)

    The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

Returns:

See Also:

#describe_package_version(options = {}) ⇒ Types::DescribePackageVersionResult

Returns a PackageVersionDescription object that contains information about the requested package version.

Examples:

Request syntax with placeholder values


resp = client.describe_package_version({
  domain: "DomainName", # required
  domain_owner: "AccountId",
  repository: "RepositoryName", # required
  format: "npm", # required, accepts npm, pypi, maven
  namespace: "PackageNamespace",
  package: "PackageName", # required
  package_version: "PackageVersion", # required
})

Response structure


resp.package_version.format #=> String, one of "npm", "pypi", "maven"
resp.package_version.namespace #=> String
resp.package_version.package_name #=> String
resp.package_version.display_name #=> String
resp.package_version.version #=> String
resp.package_version.summary #=> String
resp.package_version.home_page #=> String
resp.package_version.source_code_repository #=> String
resp.package_version.published_time #=> Time
resp.package_version.licenses #=> Array
resp.package_version.licenses[0].name #=> String
resp.package_version.licenses[0].url #=> String
resp.package_version.revision #=> String
resp.package_version.status #=> String, one of "Published", "Unfinished", "Unlisted", "Archived", "Disposed", "Deleted"

Options Hash (options):

  • :domain (required, String)

    The name of the domain that contains the repository that contains the package version.

  • :domain_owner (String)

    The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

  • :repository (required, String)

    The name of the repository that contains the package version.

  • :format (required, String)

    A format that specifies the type of the requested package version. The valid values are:

    • npm

    • pypi

    • maven

  • :namespace (String)

    The namespace of the package. The package component that specifies its namespace depends on its type. For example:

    • The namespace of a Maven package is its groupId.

    • The namespace of an npm package is its scope.

    • A Python package does not contain a corresponding component, so Python packages do not have a namespace.

  • :package (required, String)

    The name of the requested package version.

  • :package_version (required, String)

    A string that contains the package version (for example, 3.5.2).

Returns:

See Also:

#describe_repository(options = {}) ⇒ Types::DescribeRepositoryResult

Returns a RepositoryDescription object that contains detailed information about the requested repository.

Examples:

Request syntax with placeholder values


resp = client.describe_repository({
  domain: "DomainName", # required
  domain_owner: "AccountId",
  repository: "RepositoryName", # required
})

Response structure


resp.repository.name #=> String
resp.repository. #=> String
resp.repository.domain_name #=> String
resp.repository.domain_owner #=> String
resp.repository.arn #=> String
resp.repository.description #=> String
resp.repository.upstreams #=> Array
resp.repository.upstreams[0].repository_name #=> String
resp.repository.external_connections #=> Array
resp.repository.external_connections[0].external_connection_name #=> String
resp.repository.external_connections[0].package_format #=> String, one of "npm", "pypi", "maven"
resp.repository.external_connections[0].status #=> String, one of "Available"

Options Hash (options):

  • :domain (required, String)

    The name of the domain that contains the repository to describe.

  • :domain_owner (String)

    The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

  • :repository (required, String)

    A string that specifies the name of the requested repository.

Returns:

See Also:

#disassociate_external_connection(options = {}) ⇒ Types::DisassociateExternalConnectionResult

Removes an existing external connection from a repository.

Examples:

Request syntax with placeholder values


resp = client.disassociate_external_connection({
  domain: "DomainName", # required
  domain_owner: "AccountId",
  repository: "RepositoryName", # required
  external_connection: "ExternalConnectionName", # required
})

Response structure


resp.repository.name #=> String
resp.repository. #=> String
resp.repository.domain_name #=> String
resp.repository.domain_owner #=> String
resp.repository.arn #=> String
resp.repository.description #=> String
resp.repository.upstreams #=> Array
resp.repository.upstreams[0].repository_name #=> String
resp.repository.external_connections #=> Array
resp.repository.external_connections[0].external_connection_name #=> String
resp.repository.external_connections[0].package_format #=> String, one of "npm", "pypi", "maven"
resp.repository.external_connections[0].status #=> String, one of "Available"

Options Hash (options):

  • :domain (required, String)

    The name of the domain that contains the repository from which to remove the external repository.

  • :domain_owner (String)

    The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

  • :repository (required, String)

    The name of the repository from which the external connection will be removed.

  • :external_connection (required, String)

    The name of the external connection to be removed from the repository.

Returns:

See Also:

#dispose_package_versions(options = {}) ⇒ Types::DisposePackageVersionsResult

Deletes the assets in package versions and sets the package versions' status to Disposed. A disposed package version cannot be restored in your repository because its assets are deleted.

To view all disposed package versions in a repository, use ListPackageVersions and set the status parameter to Disposed.

To view information about a disposed package version, use DescribePackageVersion ..

Examples:

Request syntax with placeholder values


resp = client.dispose_package_versions({
  domain: "DomainName", # required
  domain_owner: "AccountId",
  repository: "RepositoryName", # required
  format: "npm", # required, accepts npm, pypi, maven
  namespace: "PackageNamespace",
  package: "PackageName", # required
  versions: ["PackageVersion"], # required
  version_revisions: {
    "PackageVersion" => "PackageVersionRevision",
  },
  expected_status: "Published", # accepts Published, Unfinished, Unlisted, Archived, Disposed, Deleted
})

Response structure


resp.successful_versions #=> Hash
resp.successful_versions["PackageVersion"].revision #=> String
resp.successful_versions["PackageVersion"].status #=> String, one of "Published", "Unfinished", "Unlisted", "Archived", "Disposed", "Deleted"
resp.failed_versions #=> Hash
resp.failed_versions["PackageVersion"].error_code #=> String, one of "ALREADY_EXISTS", "MISMATCHED_REVISION", "MISMATCHED_STATUS", "NOT_ALLOWED", "NOT_FOUND", "SKIPPED"
resp.failed_versions["PackageVersion"].error_message #=> String

Options Hash (options):

  • :domain (required, String)

    The name of the domain that contains the repository you want to dispose.

  • :domain_owner (String)

    The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

  • :repository (required, String)

    The name of the repository that contains the package versions you want to dispose.

  • :format (required, String)

    A format that specifies the type of package versions you want to dispose. The valid values are:

    • npm

    • pypi

    • maven

  • :namespace (String)

    The namespace of the package. The package component that specifies its namespace depends on its type. For example:

    • The namespace of a Maven package is its groupId.

    • The namespace of an npm package is its scope.

    • A Python package does not contain a corresponding component, so Python packages do not have a namespace.

  • :package (required, String)

    The name of the package with the versions you want to dispose.

  • :versions (required, Array<String>)

    The versions of the package you want to dispose.

  • :version_revisions (Hash<String,String>)

    The revisions of the package versions you want to dispose.

  • :expected_status (String)

    The expected status of the package version to dispose. Valid values are:

    • Published

    • Unfinished

    • Unlisted

    • Archived

    • Disposed

Returns:

See Also:

#get_authorization_token(options = {}) ⇒ Types::GetAuthorizationTokenResult

Generates a temporary authorization token for accessing repositories in the domain. This API requires the codeartifact:GetAuthorizationToken and sts:GetServiceBearerToken permissions. For more information about authorization tokens, see AWS CodeArtifact authentication and tokens.

CodeArtifact authorization tokens are valid for a period of 12 hours when created with the login command. You can call login periodically to refresh the token. When you create an authorization token with the GetAuthorizationToken API, you can set a custom authorization period, up to a maximum of 12 hours, with the durationSeconds parameter.

The authorization period begins after login or GetAuthorizationToken is called. If login or GetAuthorizationToken is called while assuming a role, the token lifetime is independent of the maximum session duration of the role. For example, if you call sts assume-role and specify a session duration of 15 minutes, then generate a CodeArtifact authorization token, the token will be valid for the full authorization period even though this is longer than the 15-minute session duration.

See Using IAM Roles for more information on controlling session duration.

Examples:

Request syntax with placeholder values


resp = client.get_authorization_token({
  domain: "DomainName", # required
  domain_owner: "AccountId",
  duration_seconds: 1,
})

Response structure


resp.authorization_token #=> String
resp.expiration #=> Time

Options Hash (options):

  • :domain (required, String)

    The name of the domain that is in scope for the generated authorization token.

  • :domain_owner (String)

    The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

  • :duration_seconds (Integer)

    The time, in seconds, that the generated authorization token is valid. Valid values are 0 and any number between 900 (15 minutes) and 43200 (12 hours). A value of 0 will set the expiration of the authorization token to the same expiration of the user\'s role\'s temporary credentials.

Returns:

See Also:

#get_domain_permissions_policy(options = {}) ⇒ Types::GetDomainPermissionsPolicyResult

Returns the resource policy attached to the specified domain.

The policy is a resource-based policy, not an identity-based policy. For more information, see Identity-based policies and resource-based policies in the AWS Identity and Access Management User Guide.

Examples:

Request syntax with placeholder values


resp = client.get_domain_permissions_policy({
  domain: "DomainName", # required
  domain_owner: "AccountId",
})

Response structure


resp.policy.resource_arn #=> String
resp.policy.revision #=> String
resp.policy.document #=> String

Options Hash (options):

  • :domain (required, String)

    The name of the domain to which the resource policy is attached.

  • :domain_owner (String)

    The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

Returns:

See Also:

#get_package_version_asset(options = {}) ⇒ Types::GetPackageVersionAssetResult

Returns an asset (or file) that is in a package. For example, for a Maven package version, use GetPackageVersionAsset to download a JAR file, a POM file, or any other assets in the package version.

Examples:

Request syntax with placeholder values


resp = client.get_package_version_asset({
  response_target: "/path/to/file", # where to write response data, file path, or IO object
  domain: "DomainName", # required
  domain_owner: "AccountId",
  repository: "RepositoryName", # required
  format: "npm", # required, accepts npm, pypi, maven
  namespace: "PackageNamespace",
  package: "PackageName", # required
  package_version: "PackageVersion", # required
  asset: "AssetName", # required
  package_version_revision: "PackageVersionRevision",
})

Response structure


resp.asset #=> IO
resp.asset_name #=> String
resp.package_version #=> String
resp.package_version_revision #=> String

Options Hash (options):

  • :response_target (IO, String)

    Specifies where to stream response data. You can provide the path where a file will be created on disk, or you can provide an IO object. If omitted, the response data will be loaded into memory and written to a StringIO object.

  • :domain (required, String)

    The domain that contains the repository that contains the package version with the requested asset.

  • :domain_owner (String)

    The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

  • :repository (required, String)

    The repository that contains the package version with the requested asset.

  • :format (required, String)

    A format that specifies the type of the package version with the requested asset file. The valid values are:

    • npm

    • pypi

    • maven

  • :namespace (String)

    The namespace of the package. The package component that specifies its namespace depends on its type. For example:

    • The namespace of a Maven package is its groupId.

    • The namespace of an npm package is its scope.

    • A Python package does not contain a corresponding component, so Python packages do not have a namespace.

  • :package (required, String)

    The name of the package that contains the requested asset.

  • :package_version (required, String)

    A string that contains the package version (for example, 3.5.2).

  • :asset (required, String)

    The name of the requested asset.

  • :package_version_revision (String)

    The name of the package version revision that contains the requested asset.

Returns:

See Also:

#get_package_version_readme(options = {}) ⇒ Types::GetPackageVersionReadmeResult

Gets the readme file or descriptive text for a package version. For packages that do not contain a readme file, CodeArtifact extracts a description from a metadata file. For example, from the <description> element in the pom.xml file of a Maven package.

The returned text might contain formatting. For example, it might contain formatting for Markdown or reStructuredText.

Examples:

Request syntax with placeholder values


resp = client.get_package_version_readme({
  domain: "DomainName", # required
  domain_owner: "AccountId",
  repository: "RepositoryName", # required
  format: "npm", # required, accepts npm, pypi, maven
  namespace: "PackageNamespace",
  package: "PackageName", # required
  package_version: "PackageVersion", # required
})

Response structure


resp.format #=> String, one of "npm", "pypi", "maven"
resp.namespace #=> String
resp.package #=> String
resp.version #=> String
resp.version_revision #=> String
resp.readme #=> String

Options Hash (options):

  • :domain (required, String)

    The name of the domain that contains the repository that contains the package version with the requested readme file.

  • :domain_owner (String)

    The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

  • :repository (required, String)

    The repository that contains the package with the requested readme file.

  • :format (required, String)

    A format that specifies the type of the package version with the requested readme file. The valid values are:

    • npm

    • pypi

    • maven

  • :namespace (String)

    The namespace of the package. The package component that specifies its namespace depends on its type. For example:

    • The namespace of a Maven package is its groupId.

    • The namespace of an npm package is its scope.

    • A Python package does not contain a corresponding component, so Python packages do not have a namespace.

  • :package (required, String)

    The name of the package version that contains the requested readme file.

  • :package_version (required, String)

    A string that contains the package version (for example, 3.5.2).

Returns:

See Also:

#get_repository_endpoint(options = {}) ⇒ Types::GetRepositoryEndpointResult

Returns the endpoint of a repository for a specific package format. A repository has one endpoint for each package format:

  • npm

  • pypi

  • maven

Examples:

Request syntax with placeholder values


resp = client.get_repository_endpoint({
  domain: "DomainName", # required
  domain_owner: "AccountId",
  repository: "RepositoryName", # required
  format: "npm", # required, accepts npm, pypi, maven
})

Response structure


resp.repository_endpoint #=> String

Options Hash (options):

  • :domain (required, String)

    The name of the domain that contains the repository.

  • :domain_owner (String)

    The 12-digit account number of the AWS account that owns the domain that contains the repository. It does not include dashes or spaces.

  • :repository (required, String)

    The name of the repository.

  • :format (required, String)

    Returns which endpoint of a repository to return. A repository has one endpoint for each package format:

    • npm

    • pypi

    • maven

Returns:

See Also:

#get_repository_permissions_policy(options = {}) ⇒ Types::GetRepositoryPermissionsPolicyResult

Returns the resource policy that is set on a repository.

Examples:

Request syntax with placeholder values


resp = client.get_repository_permissions_policy({
  domain: "DomainName", # required
  domain_owner: "AccountId",
  repository: "RepositoryName", # required
})

Response structure


resp.policy.resource_arn #=> String
resp.policy.revision #=> String
resp.policy.document #=> String

Options Hash (options):

  • :domain (required, String)

    The name of the domain containing the repository whose associated resource policy is to be retrieved.

  • :domain_owner (String)

    The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

  • :repository (required, String)

    The name of the repository whose associated resource policy is to be retrieved.

Returns:

See Also:

#list_domains(options = {}) ⇒ Types::ListDomainsResult

Returns a list of DomainSummary objects for all domains owned by the AWS account that makes this call. Each returned DomainSummary object contains information about a domain.

Examples:

Request syntax with placeholder values


resp = client.list_domains({
  max_results: 1,
  next_token: "PaginationToken",
})

Response structure


resp.domains #=> Array
resp.domains[0].name #=> String
resp.domains[0].owner #=> String
resp.domains[0].arn #=> String
resp.domains[0].status #=> String, one of "Active", "Deleted"
resp.domains[0].created_time #=> Time
resp.domains[0].encryption_key #=> String
resp.next_token #=> String

Options Hash (options):

  • :max_results (Integer)

    The maximum number of results to return per page.

  • :next_token (String)

    The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

Returns:

See Also:

#list_package_version_assets(options = {}) ⇒ Types::ListPackageVersionAssetsResult

Returns a list of AssetSummary objects for assets in a package version.

Examples:

Request syntax with placeholder values


resp = client.list_package_version_assets({
  domain: "DomainName", # required
  domain_owner: "AccountId",
  repository: "RepositoryName", # required
  format: "npm", # required, accepts npm, pypi, maven
  namespace: "PackageNamespace",
  package: "PackageName", # required
  package_version: "PackageVersion", # required
  max_results: 1,
  next_token: "PaginationToken",
})

Response structure


resp.format #=> String, one of "npm", "pypi", "maven"
resp.namespace #=> String
resp.package #=> String
resp.version #=> String
resp.version_revision #=> String
resp.next_token #=> String
resp.assets #=> Array
resp.assets[0].name #=> String
resp.assets[0].size #=> Integer
resp.assets[0].hashes #=> Hash
resp.assets[0].hashes["HashAlgorithm"] #=> String

Options Hash (options):

  • :domain (required, String)

    The name of the domain that contains the repository associated with the package version assets.

  • :domain_owner (String)

    The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

  • :repository (required, String)

    The name of the repository that contains the package that contains the returned package version assets.

  • :format (required, String)

    The format of the package that contains the returned package version assets. The valid package types are:

    • npm: A Node Package Manager (npm) package.

    • pypi: A Python Package Index (PyPI) package.

    • maven: A Maven package that contains compiled code in a distributable format, such as a JAR file.

  • :namespace (String)

    The namespace of the package. The package component that specifies its namespace depends on its type. For example:

    • The namespace of a Maven package is its groupId.

    • The namespace of an npm package is its scope.

    • A Python package does not contain a corresponding component, so Python packages do not have a namespace.

  • :package (required, String)

    The name of the package that contains the returned package version assets.

  • :package_version (required, String)

    A string that contains the package version (for example, 3.5.2).

  • :max_results (Integer)

    The maximum number of results to return per page.

  • :next_token (String)

    The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

Returns:

See Also:

#list_package_version_dependencies(options = {}) ⇒ Types::ListPackageVersionDependenciesResult

Returns the direct dependencies for a package version. The dependencies are returned as PackageDependency objects. CodeArtifact extracts the dependencies for a package version from the metadata file for the package format (for example, the package.json file for npm packages and the pom.xml file for Maven). Any package version dependencies that are not listed in the configuration file are not returned.

Examples:

Request syntax with placeholder values


resp = client.list_package_version_dependencies({
  domain: "DomainName", # required
  domain_owner: "AccountId",
  repository: "RepositoryName", # required
  format: "npm", # required, accepts npm, pypi, maven
  namespace: "PackageNamespace",
  package: "PackageName", # required
  package_version: "PackageVersion", # required
  next_token: "PaginationToken",
})

Response structure


resp.format #=> String, one of "npm", "pypi", "maven"
resp.namespace #=> String
resp.package #=> String
resp.version #=> String
resp.version_revision #=> String
resp.next_token #=> String
resp.dependencies #=> Array
resp.dependencies[0].namespace #=> String
resp.dependencies[0].package #=> String
resp.dependencies[0].dependency_type #=> String
resp.dependencies[0].version_requirement #=> String

Options Hash (options):

  • :domain (required, String)

    The domain that contains the repository that contains the requested package version dependencies.

  • :domain_owner (String)

    The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

  • :repository (required, String)

    The name of the repository that contains the requested package version.

  • :format (required, String)

    The format of the package with the requested dependencies. The valid package types are:

    • npm: A Node Package Manager (npm) package.

    • pypi: A Python Package Index (PyPI) package.

    • maven: A Maven package that contains compiled code in a distributable format, such as a JAR file.

  • :namespace (String)

    The namespace of the package. The package component that specifies its namespace depends on its type. For example:

    • The namespace of a Maven package is its groupId.

    • The namespace of an npm package is its scope.

    • A Python package does not contain a corresponding component, so Python packages do not have a namespace.

  • :package (required, String)

    The name of the package versions\' package.

  • :package_version (required, String)

    A string that contains the package version (for example, 3.5.2).

  • :next_token (String)

    The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

Returns:

See Also:

#list_package_versions(options = {}) ⇒ Types::ListPackageVersionsResult

Returns a list of PackageVersionSummary objects for package versions in a repository that match the request parameters.

Examples:

Request syntax with placeholder values


resp = client.list_package_versions({
  domain: "DomainName", # required
  domain_owner: "AccountId",
  repository: "RepositoryName", # required
  format: "npm", # required, accepts npm, pypi, maven
  namespace: "PackageNamespace",
  package: "PackageName", # required
  status: "Published", # accepts Published, Unfinished, Unlisted, Archived, Disposed, Deleted
  sort_by: "PUBLISHED_TIME", # accepts PUBLISHED_TIME
  max_results: 1,
  next_token: "PaginationToken",
})

Response structure


resp.default_display_version #=> String
resp.format #=> String, one of "npm", "pypi", "maven"
resp.namespace #=> String
resp.package #=> String
resp.versions #=> Array
resp.versions[0].version #=> String
resp.versions[0].revision #=> String
resp.versions[0].status #=> String, one of "Published", "Unfinished", "Unlisted", "Archived", "Disposed", "Deleted"
resp.next_token #=> String

Options Hash (options):

  • :domain (required, String)

    The name of the domain that contains the repository that contains the returned package versions.

  • :domain_owner (String)

    The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

  • :repository (required, String)

    The name of the repository that contains the package.

  • :format (required, String)

    The format of the returned packages. The valid package types are:

    • npm: A Node Package Manager (npm) package.

    • pypi: A Python Package Index (PyPI) package.

    • maven: A Maven package that contains compiled code in a distributable format, such as a JAR file.

  • :namespace (String)

    The namespace of the package. The package component that specifies its namespace depends on its type. For example:

    • The namespace of a Maven package is its groupId.

    • The namespace of an npm package is its scope.

    • A Python package does not contain a corresponding component, so Python packages do not have a namespace.

  • :package (required, String)

    The name of the package for which you want to return a list of package versions.

  • :status (String)

    A string that specifies the status of the package versions to include in the returned list. It can be one of the following:

    • Published

    • Unfinished

    • Unlisted

    • Archived

    • Disposed

  • :sort_by (String)

    How to sort the returned list of package versions.

  • :max_results (Integer)

    The maximum number of results to return per page.

  • :next_token (String)

    The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

Returns:

See Also:

#list_packages(options = {}) ⇒ Types::ListPackagesResult

Returns a list of PackageSummary objects for packages in a repository that match the request parameters.

Examples:

Request syntax with placeholder values


resp = client.list_packages({
  domain: "DomainName", # required
  domain_owner: "AccountId",
  repository: "RepositoryName", # required
  format: "npm", # accepts npm, pypi, maven
  namespace: "PackageNamespace",
  package_prefix: "PackageName",
  max_results: 1,
  next_token: "PaginationToken",
})

Response structure


resp.packages #=> Array
resp.packages[0].format #=> String, one of "npm", "pypi", "maven"
resp.packages[0].namespace #=> String
resp.packages[0].package #=> String
resp.next_token #=> String

Options Hash (options):

  • :domain (required, String)

    The domain that contains the repository that contains the requested list of packages.

  • :domain_owner (String)

    The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

  • :repository (required, String)

    The name of the repository from which packages are to be listed.

  • :format (String)

    The format of the packages. The valid package types are:

    • npm: A Node Package Manager (npm) package.

    • pypi: A Python Package Index (PyPI) package.

    • maven: A Maven package that contains compiled code in a distributable format, such as a JAR file.

  • :namespace (String)

    The namespace of the package. The package component that specifies its namespace depends on its type. For example:

    • The namespace of a Maven package is its groupId.

    • The namespace of an npm package is its scope.

    • A Python package does not contain a corresponding component, so Python packages do not have a namespace.

  • :package_prefix (String)

    A prefix used to filter returned repositories. Only repositories with names that start with repositoryPrefix are returned.

  • :max_results (Integer)

    The maximum number of results to return per page.

  • :next_token (String)

    The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

Returns:

See Also:

#list_repositories(options = {}) ⇒ Types::ListRepositoriesResult

Returns a list of RepositorySummary objects. Each RepositorySummary contains information about a repository in the specified AWS account and that matches the input parameters.

Examples:

Request syntax with placeholder values


resp = client.list_repositories({
  repository_prefix: "RepositoryName",
  max_results: 1,
  next_token: "PaginationToken",
})

Response structure


resp.repositories #=> Array
resp.repositories[0].name #=> String
resp.repositories[0]. #=> String
resp.repositories[0].domain_name #=> String
resp.repositories[0].domain_owner #=> String
resp.repositories[0].arn #=> String
resp.repositories[0].description #=> String
resp.next_token #=> String

Options Hash (options):

  • :repository_prefix (String)

    A prefix used to filter returned repositories. Only repositories with names that start with repositoryPrefix are returned.

  • :max_results (Integer)

    The maximum number of results to return per page.

  • :next_token (String)

    The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

Returns:

See Also:

#list_repositories_in_domain(options = {}) ⇒ Types::ListRepositoriesInDomainResult

Returns a list of RepositorySummary objects. Each RepositorySummary contains information about a repository in the specified domain and that matches the input parameters.

Examples:

Request syntax with placeholder values


resp = client.list_repositories_in_domain({
  domain: "DomainName", # required
  domain_owner: "AccountId",
  administrator_account: "AccountId",
  repository_prefix: "RepositoryName",
  max_results: 1,
  next_token: "PaginationToken",
})

Response structure


resp.repositories #=> Array
resp.repositories[0].name #=> String
resp.repositories[0]. #=> String
resp.repositories[0].domain_name #=> String
resp.repositories[0].domain_owner #=> String
resp.repositories[0].arn #=> String
resp.repositories[0].description #=> String
resp.next_token #=> String

Options Hash (options):

  • :domain (required, String)

    The name of the domain that contains the returned list of repositories.

  • :domain_owner (String)

    The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

  • :administrator_account (String)

    Filter the list of repositories to only include those that are managed by the AWS account ID.

  • :repository_prefix (String)

    A prefix used to filter returned repositories. Only repositories with names that start with repositoryPrefix are returned.

  • :max_results (Integer)

    The maximum number of results to return per page.

  • :next_token (String)

    The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.

Returns:

See Also:

#list_tags_for_resource(options = {}) ⇒ Types::ListTagsForResourceResult

Gets information about AWS tags for a specified Amazon Resource Name (ARN) in AWS CodeArtifact.

Examples:

Request syntax with placeholder values


resp = client.list_tags_for_resource({
  resource_arn: "Arn", # required
})

Response structure


resp.tags #=> Array
resp.tags[0].key #=> String
resp.tags[0].value #=> String

Options Hash (options):

  • :resource_arn (required, String)

    The Amazon Resource Name (ARN) of the resource to get tags for.

Returns:

See Also:

#put_domain_permissions_policy(options = {}) ⇒ Types::PutDomainPermissionsPolicyResult

Sets a resource policy on a domain that specifies permissions to access it.

When you call PutDomainPermissionsPolicy, the resource policy on the domain is ignored when evaluting permissions. This ensures that the owner of a domain cannot lock themselves out of the domain, which would prevent them from being able to update the resource policy.

Examples:

Request syntax with placeholder values


resp = client.put_domain_permissions_policy({
  domain: "DomainName", # required
  domain_owner: "AccountId",
  policy_revision: "PolicyRevision",
  policy_document: "PolicyDocument", # required
})

Response structure


resp.policy.resource_arn #=> String
resp.policy.revision #=> String
resp.policy.document #=> String

Options Hash (options):

  • :domain (required, String)

    The name of the domain on which to set the resource policy.

  • :domain_owner (String)

    The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

  • :policy_revision (String)

    The current revision of the resource policy to be set. This revision is used for optimistic locking, which prevents others from overwriting your changes to the domain\'s resource policy.

  • :policy_document (required, String)

    A valid displayable JSON Aspen policy string to be set as the access control resource policy on the provided domain.

Returns:

See Also:

#put_repository_permissions_policy(options = {}) ⇒ Types::PutRepositoryPermissionsPolicyResult

Sets the resource policy on a repository that specifies permissions to access it.

When you call PutRepositoryPermissionsPolicy, the resource policy on the repository is ignored when evaluting permissions. This ensures that the owner of a repository cannot lock themselves out of the repository, which would prevent them from being able to update the resource policy.

Examples:

Request syntax with placeholder values


resp = client.put_repository_permissions_policy({
  domain: "DomainName", # required
  domain_owner: "AccountId",
  repository: "RepositoryName", # required
  policy_revision: "PolicyRevision",
  policy_document: "PolicyDocument", # required
})

Response structure


resp.policy.resource_arn #=> String
resp.policy.revision #=> String
resp.policy.document #=> String

Options Hash (options):

  • :domain (required, String)

    The name of the domain containing the repository to set the resource policy on.

  • :domain_owner (String)

    The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

  • :repository (required, String)

    The name of the repository to set the resource policy on.

  • :policy_revision (String)

    Sets the revision of the resource policy that specifies permissions to access the repository. This revision is used for optimistic locking, which prevents others from overwriting your changes to the repository\'s resource policy.

  • :policy_document (required, String)

    A valid displayable JSON Aspen policy string to be set as the access control resource policy on the provided repository.

Returns:

See Also:

#tag_resource(options = {}) ⇒ Struct

Adds or updates tags for a resource in AWS CodeArtifact.

Examples:

Request syntax with placeholder values


resp = client.tag_resource({
  resource_arn: "Arn", # required
  tags: [ # required
    {
      key: "TagKey", # required
      value: "TagValue", # required
    },
  ],
})

Options Hash (options):

  • :resource_arn (required, String)

    The Amazon Resource Name (ARN) of the resource to which you want to add or update tags.

  • :tags (required, Array<Types::Tag>)

    The tags you want to modify or add to the resource.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#untag_resource(options = {}) ⇒ Struct

Removes tags from a resource in AWS CodeArtifact.

Examples:

Request syntax with placeholder values


resp = client.untag_resource({
  resource_arn: "Arn", # required
  tag_keys: ["TagKey"], # required
})

Options Hash (options):

  • :resource_arn (required, String)

    The Amazon Resource Name (ARN) of the resource to which you want to remove tags.

  • :tag_keys (required, Array<String>)

    The tag key for each tag that you want to remove from the resource.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_package_versions_status(options = {}) ⇒ Types::UpdatePackageVersionsStatusResult

Updates the status of one or more versions of a package.

Examples:

Request syntax with placeholder values


resp = client.update_package_versions_status({
  domain: "DomainName", # required
  domain_owner: "AccountId",
  repository: "RepositoryName", # required
  format: "npm", # required, accepts npm, pypi, maven
  namespace: "PackageNamespace",
  package: "PackageName", # required
  versions: ["PackageVersion"], # required
  version_revisions: {
    "PackageVersion" => "PackageVersionRevision",
  },
  expected_status: "Published", # accepts Published, Unfinished, Unlisted, Archived, Disposed, Deleted
  target_status: "Published", # required, accepts Published, Unfinished, Unlisted, Archived, Disposed, Deleted
})

Response structure


resp.successful_versions #=> Hash
resp.successful_versions["PackageVersion"].revision #=> String
resp.successful_versions["PackageVersion"].status #=> String, one of "Published", "Unfinished", "Unlisted", "Archived", "Disposed", "Deleted"
resp.failed_versions #=> Hash
resp.failed_versions["PackageVersion"].error_code #=> String, one of "ALREADY_EXISTS", "MISMATCHED_REVISION", "MISMATCHED_STATUS", "NOT_ALLOWED", "NOT_FOUND", "SKIPPED"
resp.failed_versions["PackageVersion"].error_message #=> String

Options Hash (options):

  • :domain (required, String)

    The domain that contains the repository that contains the package versions with a status to be updated.

  • :domain_owner (String)

    The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

  • :repository (required, String)

    The repository that contains the package versions with the status you want to update.

  • :format (required, String)

    A format that specifies the type of the package with the statuses to update. The valid values are:

    • npm

    • pypi

    • maven

  • :namespace (String)

    The namespace of the package. The package component that specifies its namespace depends on its type. For example:

    • The namespace of a Maven package is its groupId.

    • The namespace of an npm package is its scope.

    • A Python package does not contain a corresponding component, so Python packages do not have a namespace.

  • :package (required, String)

    The name of the package with the version statuses to update.

  • :versions (required, Array<String>)

    An array of strings that specify the versions of the package with the statuses to update.

  • :version_revisions (Hash<String,String>)

    A map of package versions and package version revisions. The map key is the package version (for example, 3.5.2), and the map value is the package version revision.

  • :expected_status (String)

    The package version’s expected status before it is updated. If expectedStatus is provided, the package version\'s status is updated only if its status at the time UpdatePackageVersionsStatus is called matches expectedStatus.

  • :target_status (required, String)

    The status you want to change the package version status to.

Returns:

See Also:

#update_repository(options = {}) ⇒ Types::UpdateRepositoryResult

Update the properties of a repository.

Examples:

Request syntax with placeholder values


resp = client.update_repository({
  domain: "DomainName", # required
  domain_owner: "AccountId",
  repository: "RepositoryName", # required
  description: "Description",
  upstreams: [
    {
      repository_name: "RepositoryName", # required
    },
  ],
})

Response structure


resp.repository.name #=> String
resp.repository. #=> String
resp.repository.domain_name #=> String
resp.repository.domain_owner #=> String
resp.repository.arn #=> String
resp.repository.description #=> String
resp.repository.upstreams #=> Array
resp.repository.upstreams[0].repository_name #=> String
resp.repository.external_connections #=> Array
resp.repository.external_connections[0].external_connection_name #=> String
resp.repository.external_connections[0].package_format #=> String, one of "npm", "pypi", "maven"
resp.repository.external_connections[0].status #=> String, one of "Available"

Options Hash (options):

  • :domain (required, String)

    The name of the domain associated with the repository to update.

  • :domain_owner (String)

    The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

  • :repository (required, String)

    The name of the repository to update.

  • :description (String)

    An updated repository description.

  • :upstreams (Array<Types::UpstreamRepository>)

    A list of upstream repositories to associate with the repository. The order of the upstream repositories in the list determines their priority order when AWS CodeArtifact looks for a requested package version. For more information, see Working with upstream repositories.

Returns:

See Also:

#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean

Waiters polls an API operation until a resource enters a desired state.

Basic Usage

Waiters will poll until they are succesful, they fail by entering a terminal state, or until a maximum number of attempts are made.

# polls in a loop, sleeping between attempts client.waiter_until(waiter_name, params)

Configuration

You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You configure waiters by passing a block to #wait_until:

# poll for ~25 seconds
client.wait_until(...) do |w|
  w.max_attempts = 5
  w.delay = 5
end

Callbacks

You can be notified before each polling attempt and before each delay. If you throw :success or :failure from these callbacks, it will terminate the waiter.

started_at = Time.now
client.wait_until(...) do |w|

  # disable max attempts
  w.max_attempts = nil

  # poll for 1 hour, instead of a number of attempts
  w.before_wait do |attempts, response|
    throw :failure if Time.now - started_at > 3600
  end

end

Handling Errors

When a waiter is successful, it returns true. When a waiter fails, it raises an error. All errors raised extend from Waiters::Errors::WaiterFailed.

begin
  client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
  # resource did not enter the desired state in time
end

Parameters:

  • waiter_name (Symbol)

    The name of the waiter. See #waiter_names for a full list of supported waiters.

  • params (Hash) (defaults to: {})

    Additional request parameters. See the #waiter_names for a list of supported waiters and what request they call. The called request determines the list of accepted parameters.

Yield Parameters:

Returns:

  • (Boolean)

    Returns true if the waiter was successful.

Raises:

  • (Errors::FailureStateError)

    Raised when the waiter terminates because the waiter has entered a state that it will not transition out of, preventing success.

  • (Errors::TooManyAttemptsError)

    Raised when the configured maximum number of attempts have been made, and the waiter is not yet successful.

  • (Errors::UnexpectedError)

    Raised when an error is encounted while polling for a resource that is not expected.

  • (Errors::NoSuchWaiterError)

    Raised when you request to wait for an unknown state.

#waiter_namesArray<Symbol>

Returns the list of supported waiters. The following table lists the supported waiters and the client method they call:

Waiter NameClient MethodDefault Delay:Default Max Attempts:

Returns:

  • (Array<Symbol>)

    the list of supported waiters.