Skip to content

associate_publisher

associate_publisher(
    record_arn: RegistryRecordArn,
    publisher_arn: PublisherIdentifierArn,
    *,
    config_overrides: Optional[AgentRegistryControlClientConfig] = None,
    subdomain: Optional[Subdomain] = None,
    categories: Optional[CategoryList] = None,
    client_token: Optional[ClientToken] = None,
) -> AssociatePublisherResponse

Associates a registry record in Amazon Web Services Agent Registry with a publisher and assigns the record a public identifier under the publisher's verified domain. The registry record must be APPROVED, and the publisher must be ACTIVE. A registry record supports only one publisher association. The new association starts in PENDING_APPROVAL. A curator approves or rejects it by calling UpdatePublisherAssociationApprovalStatus.

The request fails with ConflictException in these cases:

  • The publisher isn't ACTIVE. Call GetPublisher to check its status.

  • The registry record already has an association. To change it, call DisassociatePublisher first.

  • Another registry record already uses the same public identifier. Specify a different subdomain or different categories.

To retry safely, repeat the request with the same clientToken. A retry returns the original association instead of failing.

If the publisher has reached its association quota, the request fails with ServiceQuotaExceededException. You can remove an unused association or request a quota increase.

If your account doesn't own the registry record, the request fails with AccessDeniedException. Call the operation from the account that owns the registry record.

If a service that the request depends on is temporarily unavailable, the request fails with DependencyException. Retry the request.

Parameters:

  • record_arn (RegistryRecordArn) –

    The Amazon Resource Name (ARN) of the registry record to associate with the publisher. The registry record must be APPROVED.

  • publisher_arn (PublisherIdentifierArn) –

    The Amazon Resource Name (ARN) of the publisher to associate the registry record with. The publisher must be ACTIVE.

  • subdomain (Optional[Subdomain], default: None ) –

    An optional Domain Name System (DNS) label to place in front of the publisher's domain in the public identifier. For example, agents with the domain example.com produces the authority agents.example.com. If you omit it, the public identifier uses the publisher's domain. The label can contain letters, digits, and hyphens, can't start or end with a hyphen, and can be up to 63 characters long.

  • categories (Optional[CategoryList], default: None ) –

    An optional ordered list of categories to include in the public identifier, after the domain. You can specify up to 8 categories. Each category can be up to 64 characters long and can contain lowercase letters, digits, periods (.), underscores (_), and hyphens (-).

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

    A unique, case-sensitive identifier that you provide to ensure that the operation completes no more than one time. If you retry a request with the same client token, the service returns the original association instead of creating a new one.

Raises:

Source code in docs_src/capo_agent_registry_control/_services/agent_registry_control.py
def associate_publisher(
    self,
    record_arn: "capo_agent_registry_control.types.registry_record_arn.RegistryRecordArn",
    publisher_arn: "capo_agent_registry_control.types.publisher_identifier_arn.PublisherIdentifierArn",
    *,
    config_overrides: Optional[AgentRegistryControlClientConfig] = None,
    subdomain: Optional[
        "capo_agent_registry_control.types.subdomain.Subdomain"
    ] = None,
    categories: Optional[
        "capo_agent_registry_control.types.category_list.CategoryList"
    ] = None,
    client_token: Optional[
        "capo_agent_registry_control.types.client_token.ClientToken"
    ] = None,
) -> "capo_agent_registry_control.types.associate_publisher_response.AssociatePublisherResponse":
    """<p>Associates a registry record in Amazon Web Services Agent Registry with a publisher and assigns the record a public identifier under the publisher's verified domain. The registry record must be <code>APPROVED</code>, and the publisher must be <code>ACTIVE</code>. A registry record supports only one publisher association. The new association starts in <code>PENDING_APPROVAL</code>. A curator approves or rejects it by calling <code>UpdatePublisherAssociationApprovalStatus</code>.</p> <p>The request fails with <code>ConflictException</code> in these cases:</p> <ul> <li> <p>The publisher isn't <code>ACTIVE</code>. Call <code>GetPublisher</code> to check its status.</p> </li> <li> <p>The registry record already has an association. To change it, call <code>DisassociatePublisher</code> first.</p> </li> <li> <p>Another registry record already uses the same public identifier. Specify a different <code>subdomain</code> or different <code>categories</code>.</p> </li> </ul> <p>To retry safely, repeat the request with the same <code>clientToken</code>. A retry returns the original association instead of failing.</p> <p>If the publisher has reached its association quota, the request fails with <code>ServiceQuotaExceededException</code>. You can remove an unused association or request a quota increase.</p> <p>If your account doesn't own the registry record, the request fails with <code>AccessDeniedException</code>. Call the operation from the account that owns the registry record.</p> <p>If a service that the request depends on is temporarily unavailable, the request fails with <code>DependencyException</code>. Retry the request.</p>

    Args:
        record_arn: <p>The Amazon Resource Name (ARN) of the registry record to associate with the publisher. The registry record must be <code>APPROVED</code>.</p>
        publisher_arn: <p>The Amazon Resource Name (ARN) of the publisher to associate the registry record with. The publisher must be <code>ACTIVE</code>.</p>
        subdomain: <p>An optional Domain Name System (DNS) label to place in front of the publisher's domain in the public identifier. For example, <code>agents</code> with the domain <code>example.com</code> produces the authority <code>agents.example.com</code>. If you omit it, the public identifier uses the publisher's domain. The label can contain letters, digits, and hyphens, can't start or end with a hyphen, and can be up to 63 characters long.</p>
        categories: <p>An optional ordered list of categories to include in the public identifier, after the domain. You can specify up to 8 categories. Each category can be up to 64 characters long and can contain lowercase letters, digits, periods (.), underscores (_), and hyphens (-).</p>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure that the operation completes no more than one time. If you retry a request with the same client token, the service returns the original association instead of creating a new one.</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.dependency_exception.DependencyException: <p>A service that the request depends on returned an error or was unavailable. Retry the request.</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.
    """

    def _handler(
        req: "OperationRequest[capo_agent_registry_control.types.associate_publisher_request.AssociatePublisherRequest]",
    ) -> OperationResponse[
        "capo_agent_registry_control.types.associate_publisher_response.AssociatePublisherResponse"
    ]:
        import capo_agent_registry_control._operations.agent_registry_control.associate_publisher

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

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

        return capo_agent_registry_control.types.associate_publisher_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("AssociatePublisher", redact_output=_redact_output),
    )
    input_: capo_agent_registry_control.types.associate_publisher_request.AssociatePublisherRequest = {
        "record_arn": record_arn,
        "publisher_arn": publisher_arn,
    }
    if subdomain is not None:
        input_["subdomain"] = subdomain
    if categories is not None:
        input_["categories"] = categories
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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