Creates a publisher for a domain that you control. With a publisher, you can assign public identifiers under your domain to registry records. The publisher starts in ACTION_REQUIRED and becomes ACTIVE after you complete the domainChallenge in the response.
Your account can have one publisher for each domain. Creating a second publisher for the same domain fails with ConflictException, unless the request repeats the original clientToken, which returns the existing publisher. The request also fails with ConflictException if another account has already verified the domain. If your account has reached its publisher quota, the request fails with ServiceQuotaExceededException. You can delete an unused publisher or request a quota increase.
Parameters:
-
value
(Identifier)
–
The domain that the publisher represents.
-
tags
(Optional[TagMap], default:
None
)
–
The tags to attach to the publisher. Each tag is a key-value pair. You can attach up to 50 tags.
-
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 existing publisher instead of creating a new one.
Raises:
Source code in docs_src/capo_agent_registry_control/_services/async_agent_registry_control.py
| async def create_publisher(
self,
value: "capo_agent_registry_control.types.identifier.Identifier",
*,
config_overrides: Optional[AsyncAgentRegistryControlClientConfig] = None,
tags: Optional["capo_agent_registry_control.types.tag_map.TagMap"] = None,
client_token: Optional[
"capo_agent_registry_control.types.client_token.ClientToken"
] = None,
) -> "capo_agent_registry_control.types.create_publisher_response.CreatePublisherResponse":
"""<p>Creates a publisher for a domain that you control. With a publisher, you can assign public identifiers under your domain to registry records. The publisher starts in <code>ACTION_REQUIRED</code> and becomes <code>ACTIVE</code> after you complete the <code>domainChallenge</code> in the response.</p> <p>Your account can have one publisher for each domain. Creating a second publisher for the same domain fails with <code>ConflictException</code>, unless the request repeats the original <code>clientToken</code>, which returns the existing publisher. The request also fails with <code>ConflictException</code> if another account has already verified the domain. If your account has reached its publisher quota, the request fails with <code>ServiceQuotaExceededException</code>. You can delete an unused publisher or request a quota increase.</p>
Args:
value: <p>The domain that the publisher represents.</p>
tags: <p>The tags to attach to the publisher. Each tag is a key-value pair. You can attach up to 50 tags.</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 existing publisher 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.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_publisher_request.CreatePublisherRequest]",
) -> AsyncOperationResponse[
"capo_agent_registry_control.types.create_publisher_response.CreatePublisherResponse"
]:
import capo_agent_registry_control._operations.agent_registry_control.create_publisher
(
output,
http_response,
) = await capo_agent_registry_control._operations.agent_registry_control.create_publisher.async_create_publisher(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
def _redact_output(
output: "capo_agent_registry_control.types.create_publisher_response.CreatePublisherResponse",
) -> dict[str, Any]:
import capo_agent_registry_control.types.create_publisher_response
return capo_agent_registry_control.types.create_publisher_response.redact_sensitive(
output
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("CreatePublisher", redact_output=_redact_output),
)
input_: capo_agent_registry_control.types.create_publisher_request.CreatePublisherRequest = {
"value": value
}
if tags is not None:
input_["tags"] = tags
if client_token is None:
client_token = str(uuid.uuid4())
input_["client_token"] = client_token
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|