put_package_origin_configuration
(**kwargs)¶Sets the package origin configuration for a package.
The package origin configuration determines how new versions of a package can be added to a repository. You can allow or block direct publishing of new package versions, or ingestion and retaining of new package versions from an external connection or upstream source. For more information about package origin controls and configuration, see Editing package origin controls in the CodeArtifact User Guide .
PutPackageOriginConfiguration
can be called on a package that doesn't yet exist in the repository. When called on a package that does not exist, a package is created in the repository with no versions and the requested restrictions are set on the package. This can be used to preemptively block ingesting or retaining any versions from external connections or upstream repositories, or to block publishing any versions of the package into the repository before connecting any package managers or publishers to the repository.
See also: AWS API Documentation
Request Syntax
response = client.put_package_origin_configuration(
domain='string',
domainOwner='string',
repository='string',
format='npm'|'pypi'|'maven'|'nuget',
namespace='string',
package='string',
restrictions={
'publish': 'ALLOW'|'BLOCK',
'upstream': 'ALLOW'|'BLOCK'
}
)
[REQUIRED]
The name of the domain that contains the repository that contains the package.
[REQUIRED]
The name of the repository that contains the package.
[REQUIRED]
A format that specifies the type of the package to be updated.
The namespace of the package to be updated. The package component that specifies its namespace depends on its type. For example:
groupId
.scope
.[REQUIRED]
The name of the package to be updated.
[REQUIRED]
A PackageOriginRestrictions object that contains information about the upstream
and publish
package origin restrictions. The upstream
restriction determines if new package versions can be ingested or retained from external connections or upstream repositories. The publish
restriction determines if new package versions can be published directly to the repository.
You must include both the desired upstream
and publish
restrictions.
The package origin configuration that determines if new versions of the package can be published directly to the repository.
The package origin configuration that determines if new versions of the package can be added to the repository from an external connection or upstream source.
dict
Response Syntax
{
'originConfiguration': {
'restrictions': {
'publish': 'ALLOW'|'BLOCK',
'upstream': 'ALLOW'|'BLOCK'
}
}
}
Response Structure
(dict) --
originConfiguration (dict) --
A PackageOriginConfiguration object that describes the origin configuration set for the package. It contains a PackageOriginRestrictions object that describes how new versions of the package can be introduced to the repository.
restrictions (dict) --
A PackageOriginRestrictions
object that contains information about the upstream and publish package origin configuration for the package.
publish (string) --
The package origin configuration that determines if new versions of the package can be published directly to the repository.
upstream (string) --
The package origin configuration that determines if new versions of the package can be added to the repository from an external connection or upstream source.
Exceptions
CodeArtifact.Client.exceptions.AccessDeniedException
CodeArtifact.Client.exceptions.InternalServerException
CodeArtifact.Client.exceptions.ResourceNotFoundException
CodeArtifact.Client.exceptions.ThrottlingException
CodeArtifact.Client.exceptions.ValidationException