Skip to content

create_attribute_group async

create_attribute_group(
    name: Name,
    attributes: Attributes,
    client_token: ClientToken,
    *,
    config_overrides: Optional[AsyncServiceCatalogAppRegistryClientConfig] = None,
    description: Optional[Description] = None,
    tags: Optional[Tags] = None,
) -> CreateAttributeGroupResponse

Creates a new attribute group as a container for user-defined attributes. This feature enables users to have full control over their cloud application's metadata in a rich machine-readable format to facilitate integration with automated workflows and third-party tools.

Parameters:

  • name (Name) –

    The name of the attribute group.

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

    The description of the attribute group that the user provides.

  • attributes (Attributes) –

    A JSON string in the form of nested key-value pairs that represent the attributes in the group and describes an application and its components.

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

    Key-value pairs you can use to associate with the attribute group.

  • client_token (ClientToken) –

    A unique identifier that you provide to ensure idempotency. If you retry a request that completed successfully using the same client token and the same parameters, the retry succeeds without performing any further actions. If you retry a successful request using the same client token, but one or more of the parameters are different, the retry fails.

Raises:

Source code in docs_src/capo_service_catalog_appregistry/_services/async_service_catalog_app_registry.py
async def create_attribute_group(
    self,
    name: "capo_service_catalog_appregistry.types.name.Name",
    attributes: "capo_service_catalog_appregistry.types.attributes.Attributes",
    client_token: "capo_service_catalog_appregistry.types.client_token.ClientToken",
    *,
    config_overrides: Optional[AsyncServiceCatalogAppRegistryClientConfig] = None,
    description: Optional[
        "capo_service_catalog_appregistry.types.description.Description"
    ] = None,
    tags: Optional["capo_service_catalog_appregistry.types.tags.Tags"] = None,
) -> "capo_service_catalog_appregistry.types.create_attribute_group_response.CreateAttributeGroupResponse":
    """<p>Creates a new attribute group as a container for user-defined attributes. This feature enables users to have full control over their cloud application's metadata in a rich machine-readable format to facilitate integration with automated workflows and third-party tools.</p>

    Args:
        name: <p>The name of the attribute group.</p>
        description: <p>The description of the attribute group that the user provides.</p>
        attributes: <p>A JSON string in the form of nested key-value pairs that represent the attributes in the group and describes an application and its components.</p>
        tags: <p>Key-value pairs you can use to associate with the attribute group.</p>
        client_token: <p>A unique identifier that you provide to ensure idempotency. If you retry a request that completed successfully using the same client token and the same parameters, the retry succeeds without performing any further actions. If you retry a successful request using the same client token, but one or more of the parameters are different, the retry fails.</p>

    Raises:
        capo_service_catalog_appregistry.errors.conflict_exception.ConflictException: <p>There was a conflict when processing the request (for example, a resource with the given name already exists within the account).</p>
        capo_service_catalog_appregistry.errors.internal_server_exception.InternalServerException: <p>The service is experiencing internal problems.</p>
        capo_service_catalog_appregistry.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p> The maximum number of resources per account has been reached.</p>
        capo_service_catalog_appregistry.errors.validation_exception.ValidationException: <p>The request has invalid or missing parameters.</p>
        capo_service_catalog_appregistry.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_service_catalog_appregistry.types.create_attribute_group_request.CreateAttributeGroupRequest]",
    ) -> AsyncOperationResponse[
        "capo_service_catalog_appregistry.types.create_attribute_group_response.CreateAttributeGroupResponse"
    ]:
        import capo_service_catalog_appregistry._operations.aws242_app_registry.create_attribute_group

        (
            output,
            http_response,
        ) = await capo_service_catalog_appregistry._operations.aws242_app_registry.create_attribute_group.async_create_attribute_group(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateAttributeGroup")
    )
    input_: capo_service_catalog_appregistry.types.create_attribute_group_request.CreateAttributeGroupRequest = {
        "name": name,
        "attributes": attributes,
        "client_token": client_token,
    }
    if description is not None:
        input_["description"] = description
    if tags is not None:
        input_["tags"] = tags

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output