Skip to content

create_registry

create_registry(
    registry_name: __string,
    *,
    config_overrides: Optional[schemasClientConfig] = None,
    description: Optional[__stringMin0Max256] = None,
    tags: Optional[Tags] = None,
) -> CreateRegistryResponse

Creates a registry.

Parameters:

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

    A description of the registry to be created.

  • registry_name (__string) –

    The name of the registry.

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

    Tags to associate with the registry.

Raises:

Source code in docs_src/capo_schemas/_services/schemas.py
def create_registry(
    self,
    registry_name: "capo_schemas.types.__string.__string",
    *,
    config_overrides: Optional[schemasClientConfig] = None,
    description: Optional[
        "capo_schemas.types.__string_min0_max256.__stringMin0Max256"
    ] = None,
    tags: Optional["capo_schemas.types.tags.Tags"] = None,
) -> "capo_schemas.types.create_registry_response.CreateRegistryResponse":
    """<p>Creates a registry.</p>

    Args:
        description: <p>A description of the registry to be created.</p>
        registry_name: <p>The name of the registry.</p>
        tags: <p>Tags to associate with the registry.</p>

    Raises:
        capo_schemas.errors.bad_request_exception.BadRequestException
        capo_schemas.errors.conflict_exception.ConflictException
        capo_schemas.errors.forbidden_exception.ForbiddenException
        capo_schemas.errors.internal_server_error_exception.InternalServerErrorException
        capo_schemas.errors.service_unavailable_exception.ServiceUnavailableException
        capo_schemas.errors.unauthorized_exception.UnauthorizedException
        capo_schemas.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_schemas.types.create_registry_request.CreateRegistryRequest]",
    ) -> OperationResponse[
        "capo_schemas.types.create_registry_response.CreateRegistryResponse"
    ]:
        import capo_schemas._operations.schemas.create_registry

        output, http_response = (
            capo_schemas._operations.schemas.create_registry.create_registry(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateRegistry")
    )
    input_: capo_schemas.types.create_registry_request.CreateRegistryRequest = {
        "registry_name": registry_name
    }
    if description is not None:
        input_["description"] = description
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output