Skip to content

update_registry

update_registry(
    registry_id: RegistryIdentifier,
    *,
    config_overrides: Optional[AgentRegistryControlClientConfig] = None,
    name: Optional[RegistryName] = None,
    description: Optional[UpdatedDescription] = None,
    discovery_configuration: Optional[UpdatedDiscoveryConfiguration] = None,
    approval_configuration: Optional[UpdatedApprovalConfiguration] = None,
    custom_metadata_schema_configuration: Optional[
        UpdatedCustomMetadataSchemaConfiguration
    ] = None,
    auto_detection_configuration: Optional[UpdatedAutoDetectionConfiguration] = None,
) -> UpdateRegistryResponse

Updates an existing registry. This operation uses PATCH semantics: specify only the fields you want to change, and omit the rest to leave them unchanged. Updates are applied asynchronously and the registry transitions to the UPDATING status while they are processed.

Parameters:

  • registry_id (RegistryIdentifier) –

    The identifier of the registry to update (ARN or ID)

  • name (Optional[RegistryName], default: None ) –

    The updated name of the registry

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

    The updated description of the registry

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

    The updated discovery configuration. Changing the discovery authorization can break existing consumers that rely on the previous authorization type.

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

    The updated approval configuration. The change applies only to records that move to PENDING_APPROVAL after the update; records already in PENDING_APPROVAL are unaffected.

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

    The new custom metadata schema configuration, which replaces the current one. You can add fields and allowed values, but you can't remove a field or an allowed value, or change a field's type.

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

    The updated auto-detection configuration for the registry, with PATCH semantics. Omit this field to leave the current configuration unchanged. Supply an empty wrapper to unset it. Supply optionalValue to replace it.

Raises:

Source code in docs_src/capo_agent_registry_control/_services/agent_registry_control.py
def update_registry(
    self,
    registry_id: "capo_agent_registry_control.types.registry_identifier.RegistryIdentifier",
    *,
    config_overrides: Optional[AgentRegistryControlClientConfig] = None,
    name: Optional[
        "capo_agent_registry_control.types.registry_name.RegistryName"
    ] = None,
    description: Optional[
        "capo_agent_registry_control.types.updated_description.UpdatedDescription"
    ] = None,
    discovery_configuration: Optional[
        "capo_agent_registry_control.types.updated_discovery_configuration.UpdatedDiscoveryConfiguration"
    ] = None,
    approval_configuration: Optional[
        "capo_agent_registry_control.types.updated_approval_configuration.UpdatedApprovalConfiguration"
    ] = None,
    custom_metadata_schema_configuration: Optional[
        "capo_agent_registry_control.types.updated_custom_metadata_schema_configuration.UpdatedCustomMetadataSchemaConfiguration"
    ] = None,
    auto_detection_configuration: Optional[
        "capo_agent_registry_control.types.updated_auto_detection_configuration.UpdatedAutoDetectionConfiguration"
    ] = None,
) -> "capo_agent_registry_control.types.update_registry_response.UpdateRegistryResponse":
    """<p>Updates an existing registry. This operation uses PATCH semantics: specify only the fields you want to change, and omit the rest to leave them unchanged. Updates are applied asynchronously and the registry transitions to the UPDATING status while they are processed.</p>

    Args:
        registry_id: <p>The identifier of the registry to update (ARN or ID)</p>
        name: <p>The updated name of the registry</p>
        description: <p>The updated description of the registry</p>
        discovery_configuration: <p>The updated discovery configuration. Changing the discovery authorization can break existing consumers that rely on the previous authorization type.</p>
        approval_configuration: <p>The updated approval configuration. The change applies only to records that move to PENDING_APPROVAL after the update; records already in PENDING_APPROVAL are unaffected.</p>
        custom_metadata_schema_configuration: <p>The new custom metadata schema configuration, which replaces the current one. You can add fields and allowed values, but you can't remove a field or an allowed value, or change a field's type.</p>
        auto_detection_configuration: <p>The updated auto-detection configuration for the registry, with PATCH semantics. Omit this field to leave the current configuration unchanged. Supply an empty wrapper to unset it. Supply <code>optionalValue</code> to replace it.</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.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource was not found.</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.
    """

    def _handler(
        req: "OperationRequest[capo_agent_registry_control.types.update_registry_request.UpdateRegistryRequest]",
    ) -> OperationResponse[
        "capo_agent_registry_control.types.update_registry_response.UpdateRegistryResponse"
    ]:
        import capo_agent_registry_control._operations.agent_registry_control.update_registry

        output, http_response = (
            capo_agent_registry_control._operations.agent_registry_control.update_registry.update_registry(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

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

        return capo_agent_registry_control.types.update_registry_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_agent_registry_control.types.update_registry_response.UpdateRegistryResponse",
    ) -> dict[str, Any]:
        import capo_agent_registry_control.types.update_registry_response

        return capo_agent_registry_control.types.update_registry_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateRegistry",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_agent_registry_control.types.update_registry_request.UpdateRegistryRequest = {
        "registry_id": registry_id
    }
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description
    if discovery_configuration is not None:
        input_["discovery_configuration"] = discovery_configuration
    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 = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output