Skip to content

create_network async

create_network(
    client_request_token: ClientRequestTokenString,
    name: NameString,
    framework: Framework,
    framework_version: FrameworkVersionString,
    voting_policy: VotingPolicy,
    member_configuration: MemberConfiguration,
    *,
    config_overrides: Optional[AsyncManagedBlockchainClientConfig] = None,
    description: Optional[DescriptionString] = None,
    framework_configuration: Optional[NetworkFrameworkConfiguration] = None,
    tags: Optional[InputTagMap] = None,
) -> CreateNetworkOutput

Creates a new blockchain network using Amazon Managed Blockchain.

Applies only to Hyperledger Fabric.

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.

  • name (NameString) –

    The name of the network.

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

    An optional description for the network.

  • framework (Framework) –

    The blockchain framework that the network uses.

  • framework_version (FrameworkVersionString) –

    The version of the blockchain framework that the network uses.

  • framework_configuration (Optional[NetworkFrameworkConfiguration], default: None ) –

    Configuration properties of the blockchain framework relevant to the network configuration.

  • voting_policy (VotingPolicy) –

    The voting rules used by the network to determine if a proposal is approved.

  • member_configuration (MemberConfiguration) –

    Configuration properties for the first member within the network.

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

    Tags to assign to the network.

    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.

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/async_managed_blockchain.py
async def create_network(
    self,
    client_request_token: "capo_managedblockchain.types.client_request_token_string.ClientRequestTokenString",
    name: "capo_managedblockchain.types.name_string.NameString",
    framework: "capo_managedblockchain.types.framework.Framework",
    framework_version: "capo_managedblockchain.types.framework_version_string.FrameworkVersionString",
    voting_policy: "capo_managedblockchain.types.voting_policy.VotingPolicy",
    member_configuration: "capo_managedblockchain.types.member_configuration.MemberConfiguration",
    *,
    config_overrides: Optional[AsyncManagedBlockchainClientConfig] = None,
    description: Optional[
        "capo_managedblockchain.types.description_string.DescriptionString"
    ] = None,
    framework_configuration: Optional[
        "capo_managedblockchain.types.network_framework_configuration.NetworkFrameworkConfiguration"
    ] = None,
    tags: Optional["capo_managedblockchain.types.input_tag_map.InputTagMap"] = None,
) -> "capo_managedblockchain.types.create_network_output.CreateNetworkOutput":
    """<p>Creates a new blockchain network using Amazon Managed Blockchain.</p> <p>Applies only to Hyperledger Fabric.</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>
        name: <p>The name of the network.</p>
        description: <p>An optional description for the network.</p>
        framework: <p>The blockchain framework that the network uses.</p>
        framework_version: <p>The version of the blockchain framework that the network uses.</p>
        framework_configuration: <p> Configuration properties of the blockchain framework relevant to the network configuration. </p>
        voting_policy: <p> The voting rules used by the network to determine if a proposal is approved. </p>
        member_configuration: <p>Configuration properties for the first member within the network.</p>
        tags: <p>Tags to assign to the network.</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>

    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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_managedblockchain.types.create_network_input.CreateNetworkInput]",
    ) -> AsyncOperationResponse[
        "capo_managedblockchain.types.create_network_output.CreateNetworkOutput"
    ]:
        import capo_managedblockchain._operations.taiga_web_service.create_network

        (
            output,
            http_response,
        ) = await capo_managedblockchain._operations.taiga_web_service.create_network.async_create_network(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_managedblockchain.types.create_network_input.CreateNetworkInput",
    ) -> dict[str, Any]:
        import capo_managedblockchain.types.create_network_input

        return capo_managedblockchain.types.create_network_input.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateNetwork", redact_input=_redact_input),
    )
    input_: capo_managedblockchain.types.create_network_input.CreateNetworkInput = {
        "client_request_token": client_request_token,
        "name": name,
        "framework": framework,
        "framework_version": framework_version,
        "voting_policy": voting_policy,
        "member_configuration": member_configuration,
    }
    if description is not None:
        input_["description"] = description
    if framework_configuration is not None:
        input_["framework_configuration"] = framework_configuration
    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