Skip to content

create_accessor

create_accessor(
    client_request_token: ClientRequestTokenString,
    accessor_type: AccessorType,
    *,
    config_overrides: Optional[ManagedBlockchainClientConfig] = None,
    tags: Optional[InputTagMap] = None,
    network_type: Optional[AccessorNetworkType] = None,
) -> CreateAccessorOutput

Creates a new accessor for use with Amazon Managed Blockchain service that supports token based access. The accessor contains information required for token based access.

Parameters:

  • client_request_token (ClientRequestTokenString) –

    This is a unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent operation completes no more than once. This identifier is required only if you make a service request directly using an HTTP client. It is generated automatically if you use an Amazon Web Services SDK or the Amazon Web Services CLI.

  • accessor_type (AccessorType) –

    The type of accessor.

    Currently, accessor type is restricted to BILLING_TOKEN.

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

    Tags to assign to the Accessor.

    Each tag consists of a key and an optional value. You can specify multiple key-value pairs in a single request with an overall maximum of 50 tags allowed per resource.

    For more information about tags, see Tagging Resources in the Amazon Managed Blockchain Ethereum Developer Guide, or Tagging Resources in the Amazon Managed Blockchain Hyperledger Fabric Developer Guide.

  • network_type (Optional[AccessorNetworkType], default: None ) –

    The blockchain network that the Accessor token is created for.

    • Use the actual networkType value for the blockchain network that you are creating the Accessor token for.

    • With the shut down of the Ethereum Goerli and Polygon Mumbai Testnet networks the following networkType values are no longer available for selection and use.

      • ETHEREUM_MAINNET_AND_GOERLI

      • ETHEREUM_GOERLI

      • POLYGON_MUMBAI

      However, your existing Accessor tokens with these networkType values will remain unchanged.

Raises:

  • AccessDeniedException –

    You don't have sufficient access to perform this action.

  • InternalServiceErrorException –

    The request processing has failed because of an unknown error, exception or failure.

  • InvalidRequestException –

    The action or operation requested is invalid. Verify that the action is typed correctly.

  • ResourceAlreadyExistsException –

    A resource request is issued for a resource that already exists.

  • ResourceLimitExceededException –

    The maximum number of resources of that type already exist. Ensure the resources requested are within the boundaries of the service edition and your account limits.

  • ThrottlingException –

    The request or operation couldn't be performed because a service is throttling requests. The most common source of throttling errors is creating resources that exceed your service limit for this resource type. Request a limit increase or delete unused resources if possible.

  • TooManyTagsException –

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_managedblockchain/_services/managed_blockchain.py
def create_accessor(
    self,
    client_request_token: "capo_managedblockchain.types.client_request_token_string.ClientRequestTokenString",
    accessor_type: "capo_managedblockchain.types.accessor_type.AccessorType",
    *,
    config_overrides: Optional[ManagedBlockchainClientConfig] = None,
    tags: Optional["capo_managedblockchain.types.input_tag_map.InputTagMap"] = None,
    network_type: Optional[
        "capo_managedblockchain.types.accessor_network_type.AccessorNetworkType"
    ] = None,
) -> "capo_managedblockchain.types.create_accessor_output.CreateAccessorOutput":
    """<p>Creates a new accessor for use with Amazon Managed Blockchain service that supports token based access. The accessor contains information required for token based access.</p>

    Args:
        client_request_token: <p>This is a unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent operation completes no more than once. This identifier is required only if you make a service request directly using an HTTP client. It is generated automatically if you use an Amazon Web Services SDK or the Amazon Web Services CLI.</p>
        accessor_type: <p>The type of accessor.</p> <note> <p>Currently, accessor type is restricted to <code>BILLING_TOKEN</code>.</p> </note>
        tags: <p>Tags to assign to the Accessor.</p> <p> Each tag consists of a key and an optional value. You can specify multiple key-value pairs in a single request with an overall maximum of 50 tags allowed per resource.</p> <p>For more information about tags, see <a href="https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html">Tagging Resources</a> in the <i>Amazon Managed Blockchain Ethereum Developer Guide</i>, or <a href="https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html">Tagging Resources</a> in the <i>Amazon Managed Blockchain Hyperledger Fabric Developer Guide</i>.</p>
        network_type: <p>The blockchain network that the <code>Accessor</code> token is created for.</p> <note> <ul> <li> <p>Use the actual <code>networkType</code> value for the blockchain network that you are creating the <code>Accessor</code> token for.</p> </li> <li> <p>With the shut down of the <i>Ethereum Goerli</i> and <i>Polygon Mumbai Testnet</i> networks the following <code>networkType</code> values are no longer available for selection and use.</p> <ul> <li> <p> <code>ETHEREUM_MAINNET_AND_GOERLI</code> </p> </li> <li> <p> <code>ETHEREUM_GOERLI</code> </p> </li> <li> <p> <code>POLYGON_MUMBAI</code> </p> </li> </ul> <p>However, your existing <code>Accessor</code> tokens with these <code>networkType</code> values will remain unchanged.</p> </li> </ul> </note>

    Raises:
        capo_managedblockchain.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this action.</p>
        capo_managedblockchain.errors.internal_service_error_exception.InternalServiceErrorException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
        capo_managedblockchain.errors.invalid_request_exception.InvalidRequestException: <p>The action or operation requested is invalid. Verify that the action is typed correctly.</p>
        capo_managedblockchain.errors.resource_already_exists_exception.ResourceAlreadyExistsException: <p>A resource request is issued for a resource that already exists.</p>
        capo_managedblockchain.errors.resource_limit_exceeded_exception.ResourceLimitExceededException: <p>The maximum number of resources of that type already exist. Ensure the resources requested are within the boundaries of the service edition and your account limits.</p>
        capo_managedblockchain.errors.throttling_exception.ThrottlingException: <p>The request or operation couldn't be performed because a service is throttling requests. The most common source of throttling errors is creating resources that exceed your service limit for this resource type. Request a limit increase or delete unused resources if possible.</p>
        capo_managedblockchain.errors.too_many_tags_exception.TooManyTagsException: <p></p>
        capo_managedblockchain.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_managedblockchain.types.create_accessor_input.CreateAccessorInput]",
    ) -> OperationResponse[
        "capo_managedblockchain.types.create_accessor_output.CreateAccessorOutput"
    ]:
        import capo_managedblockchain._operations.taiga_web_service.create_accessor

        output, http_response = (
            capo_managedblockchain._operations.taiga_web_service.create_accessor.create_accessor(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateAccessor")
    )
    input_: capo_managedblockchain.types.create_accessor_input.CreateAccessorInput = {
        "client_request_token": client_request_token,
        "accessor_type": accessor_type,
    }
    if tags is not None:
        input_["tags"] = tags
    if network_type is not None:
        input_["network_type"] = network_type

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