createRegistry method
Creates a new registry in your Amazon Web Services account. A registry serves as a centralized catalog for organizing and managing registry records, including MCP servers, A2A agents, agent skills, and custom resource types.
If you specify CUSTOM_JWT as the authorizerType,
you must provide an authorizerConfiguration.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter name :
The name of the registry. The name must be unique within your account and
can contain alphanumeric characters and underscores.
Parameter approvalConfiguration :
The approval configuration for registry records. Controls whether records
require explicit approval before becoming active. See the
ApprovalConfiguration data type for supported configuration
options.
Parameter authorizerConfiguration :
The authorizer configuration for the registry. Required if
authorizerType is CUSTOM_JWT. For details, see
the AuthorizerConfiguration data type.
Parameter authorizerType :
The type of authorizer to use for the registry. This controls the
authorization method for the Search and Invoke APIs used by consumers, and
does not affect the standard CRUDL APIs for registry and registry record
management used by administrators.
-
CUSTOM_JWT- Authorize with a bearer token. -
AWS_IAM- Authorize with your Amazon Web Services IAM credentials.
Parameter clientToken :
A unique, case-sensitive identifier to ensure that the API request
completes no more than one time. If you don't specify this field, a value
is randomly generated for you. If this token matches a previous request,
the service ignores the request, but doesn't return an error. For more
information, see Ensuring
idempotency.
Parameter description :
A description of the registry.
Implementation
Future<CreateRegistryResponse> createRegistry({
required String name,
ApprovalConfiguration? approvalConfiguration,
AuthorizerConfiguration? authorizerConfiguration,
RegistryAuthorizerType? authorizerType,
String? clientToken,
String? description,
}) async {
final $payload = <String, dynamic>{
'name': name,
if (approvalConfiguration != null)
'approvalConfiguration': approvalConfiguration,
if (authorizerConfiguration != null)
'authorizerConfiguration': authorizerConfiguration,
if (authorizerType != null) 'authorizerType': authorizerType.value,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (description != null) 'description': description,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/registries',
exceptionFnMap: _exceptionFns,
);
return CreateRegistryResponse.fromJson(response);
}