Skip to content

create_registry async

create_registry(
    name: RegistryName,
    *,
    config_overrides: Optional[AsyncAgentRegistryControlClientConfig] = None,
    description: Optional[Description] = None,
    encryption_configuration: Optional[EncryptionConfiguration] = None,
    discovery_configuration: Optional[DiscoveryConfiguration] = None,
    client_token: Optional[ClientToken] = None,
    tags: Optional[TagsMap] = None,
    approval_configuration: Optional[ApprovalConfiguration] = None,
    custom_metadata_schema_configuration: Optional[
        CustomMetadataSchemaConfiguration
    ] = None,
    auto_detection_configuration: Optional[AutoDetectionConfiguration] = None,
) -> CreateRegistryResponse

Creates a new registry, a catalog that organizes registry records and defines their discovery authorization and record approval behavior. Creation is asynchronous: the registry begins in the CREATING status and becomes usable once it reaches READY.

Parameters:

  • name (RegistryName) –

    The name of the registry

  • description (Optional[Description], default: None ) –

    The description of the registry

  • encryption_configuration (Optional[EncryptionConfiguration], default: None ) –

    The optional server-side encryption configuration for the registry. When you provide this field, the specified customer-managed Amazon Web Services KMS key encrypts the registry's content. Omit this field to use an Amazon Web Services-owned encryption key. You cannot change the encryption configuration after registry creation.

  • discovery_configuration (Optional[DiscoveryConfiguration], default: None ) –

    Discovery configuration for the registry

  • client_token (Optional[ClientToken], default: None ) –

    A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request, but does not return an error.

  • tags (Optional[TagsMap], default: None ) –

    Tags to associate with the registry

  • approval_configuration (Optional[ApprovalConfiguration], default: None ) –

    Approval configuration for registry records

  • custom_metadata_schema_configuration (Optional[CustomMetadataSchemaConfiguration], default: None ) –

    The optional custom metadata schema configuration for the registry. When provided, registry records can carry structured metadata validated against this schema.

  • auto_detection_configuration (Optional[AutoDetectionConfiguration], default: None ) –

    The optional auto-detection configuration for the registry. When provided, the registry is automatically populated with resources discovered according to the configuration. Omit this field for registries whose records are managed exclusively through the Agent Registry Control API.

Raises:

Source code in docs_src/capo_agent_registry_control/_services/async_agent_registry_control.py
async def create_registry(
    self,
    name: "capo_agent_registry_control.types.registry_name.RegistryName",
    *,
    config_overrides: Optional[AsyncAgentRegistryControlClientConfig] = None,
    description: Optional[
        "capo_agent_registry_control.types.description.Description"
    ] = None,
    encryption_configuration: Optional[
        "capo_agent_registry_control.types.encryption_configuration.EncryptionConfiguration"
    ] = None,
    discovery_configuration: Optional[
        "capo_agent_registry_control.types.discovery_configuration.DiscoveryConfiguration"
    ] = None,
    client_token: Optional[
        "capo_agent_registry_control.types.client_token.ClientToken"
    ] = None,
    tags: Optional["capo_agent_registry_control.types.tags_map.TagsMap"] = None,
    approval_configuration: Optional[
        "capo_agent_registry_control.types.approval_configuration.ApprovalConfiguration"
    ] = None,
    custom_metadata_schema_configuration: Optional[
        "capo_agent_registry_control.types.custom_metadata_schema_configuration.CustomMetadataSchemaConfiguration"
    ] = None,
    auto_detection_configuration: Optional[
        "capo_agent_registry_control.types.auto_detection_configuration.AutoDetectionConfiguration"
    ] = None,
) -> "capo_agent_registry_control.types.create_registry_response.CreateRegistryResponse":
    """<p>Creates a new registry, a catalog that organizes registry records and defines their discovery authorization and record approval behavior. Creation is asynchronous: the registry begins in the CREATING status and becomes usable once it reaches READY.</p>

    Args:
        name: <p>The name of the registry</p>
        description: <p>The description of the registry</p>
        encryption_configuration: <p>The optional server-side encryption configuration for the registry. When you provide this field, the specified customer-managed Amazon Web Services KMS key encrypts the registry's content. Omit this field to use an Amazon Web Services-owned encryption key. You cannot change the encryption configuration after registry creation.</p>
        discovery_configuration: <p>Discovery configuration for the registry</p>
        client_token: <p>A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request, but does not return an error.</p>
        tags: <p>Tags to associate with the registry</p>
        approval_configuration: <p>Approval configuration for registry records</p>
        custom_metadata_schema_configuration: <p>The optional custom metadata schema configuration for the registry. When provided, registry records can carry structured metadata validated against this schema.</p>
        auto_detection_configuration: <p>The optional auto-detection configuration for the registry. When provided, the registry is automatically populated with resources discovered according to the configuration. Omit this field for registries whose records are managed exclusively through the Agent Registry Control API.</p>

    Raises:
        capo_agent_registry_control.errors.access_denied_exception.AccessDeniedException: <p>The caller is not authorized to perform the requested action.</p>
        capo_agent_registry_control.errors.conflict_exception.ConflictException: <p>The request conflicts with the current state of the resource.</p>
        capo_agent_registry_control.errors.internal_server_exception.InternalServerException: <p>The request failed due to an unexpected internal error; the caller may retry.</p>
        capo_agent_registry_control.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request would exceed a service quota.</p>
        capo_agent_registry_control.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling; the caller may retry after a delay.</p>
        capo_agent_registry_control.errors.validation_exception.ValidationException: <p>The request failed validation of one or more input fields.</p>
        capo_agent_registry_control.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_agent_registry_control.types.create_registry_request.CreateRegistryRequest]",
    ) -> AsyncOperationResponse[
        "capo_agent_registry_control.types.create_registry_response.CreateRegistryResponse"
    ]:
        import capo_agent_registry_control._operations.agent_registry_control.create_registry

        (
            output,
            http_response,
        ) = await capo_agent_registry_control._operations.agent_registry_control.create_registry.async_create_registry(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_agent_registry_control.types.create_registry_request.CreateRegistryRequest",
    ) -> dict[str, Any]:
        import capo_agent_registry_control.types.create_registry_request

        return capo_agent_registry_control.types.create_registry_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateRegistry", redact_input=_redact_input),
    )
    input_: capo_agent_registry_control.types.create_registry_request.CreateRegistryRequest = {
        "name": name
    }
    if description is not None:
        input_["description"] = description
    if encryption_configuration is not None:
        input_["encryption_configuration"] = encryption_configuration
    if discovery_configuration is not None:
        input_["discovery_configuration"] = discovery_configuration
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if tags is not None:
        input_["tags"] = tags
    if approval_configuration is not None:
        input_["approval_configuration"] = approval_configuration
    if custom_metadata_schema_configuration is not None:
        input_["custom_metadata_schema_configuration"] = (
            custom_metadata_schema_configuration
        )
    if auto_detection_configuration is not None:
        input_["auto_detection_configuration"] = auto_detection_configuration

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output