Skip to content

create_sol_network_instance async

create_sol_network_instance(
    nsd_info_id: NsdInfoId,
    ns_name: str,
    *,
    config_overrides: Optional[AsynctnbClientConfig] = None,
    ns_description: Optional[str] = None,
    tags: Optional[TagMap] = None,
) -> CreateSolNetworkInstanceOutput

Creates a network instance.

A network instance is a single network created in Amazon Web Services TNB that can be deployed and on which life-cycle operations (like terminate, update, and delete) can be performed. Creating a network instance is the third step after creating a network package. For more information about network instances, Network instances in the Amazon Web Services Telco Network Builder User Guide.

Once you create a network instance, you can instantiate it. To instantiate a network, see InstantiateSolNetworkInstance.

Parameters:

  • nsd_info_id (NsdInfoId) –

    ID for network service descriptor.

  • ns_name (str) –

    Network instance name.

  • ns_description (Optional[str], default: None ) –

    Network instance description.

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

    A tag is a label that you assign to an Amazon Web Services resource. Each tag consists of a key and an optional value. You can use tags to search and filter your resources or track your Amazon Web Services costs.

Raises:

Examples:

Create a Sol Network Instance

>>> await client.create_sol_network_instance(nsd_info_id='np-0d5b823eb5c2a9241', ns_name='CITY Instance', ns_description='Test network for CITY', tags={'Name': 'Resource'})
Source code in docs_src/capo_tnb/_services/async_tnb.py
async def create_sol_network_instance(
    self,
    nsd_info_id: "capo_tnb.types.nsd_info_id.NsdInfoId",
    ns_name: str,
    *,
    config_overrides: Optional[AsynctnbClientConfig] = None,
    ns_description: Optional[str] = None,
    tags: Optional["capo_tnb.types.tag_map.TagMap"] = None,
) -> "capo_tnb.types.create_sol_network_instance_output.CreateSolNetworkInstanceOutput":
    """<p>Creates a network instance.</p> <p>A network instance is a single network created in Amazon Web Services TNB that can be deployed and on which life-cycle operations (like terminate, update, and delete) can be performed. Creating a network instance is the third step after creating a network package. For more information about network instances, <a href="https://docs.aws.amazon.com/tnb/latest/ug/network-instances.html">Network instances</a> in the <i>Amazon Web Services Telco Network Builder User Guide</i>.</p> <p>Once you create a network instance, you can instantiate it. To instantiate a network, see <a href="https://docs.aws.amazon.com/tnb/latest/APIReference/API_InstantiateSolNetworkInstance.html">InstantiateSolNetworkInstance</a>.</p>

    Args:
        nsd_info_id: <p>ID for network service descriptor.</p>
        ns_name: <p>Network instance name.</p>
        ns_description: <p>Network instance description.</p>
        tags: <p>A tag is a label that you assign to an Amazon Web Services resource. Each tag consists of a key and an optional value. You can use tags to search and filter your resources or track your Amazon Web Services costs.</p>

    Raises:
        capo_tnb.errors.access_denied_exception.AccessDeniedException: <p>Insufficient permissions to make request.</p>
        capo_tnb.errors.internal_server_exception.InternalServerException: <p>Unexpected error occurred. Problem on the server.</p>
        capo_tnb.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource that doesn't exist.</p>
        capo_tnb.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Service quotas have been exceeded.</p>
        capo_tnb.errors.throttling_exception.ThrottlingException: <p>Exception caused by throttling.</p>
        capo_tnb.errors.validation_exception.ValidationException: <p>Unable to process the request because the client provided input failed to satisfy request constraints.</p>
        capo_tnb.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Create a Sol Network Instance

        >>> await client.create_sol_network_instance(nsd_info_id='np-0d5b823eb5c2a9241', ns_name='CITY Instance', ns_description='Test network for CITY', tags={'Name': 'Resource'})
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_tnb.types.create_sol_network_instance_input.CreateSolNetworkInstanceInput]",
    ) -> AsyncOperationResponse[
        "capo_tnb.types.create_sol_network_instance_output.CreateSolNetworkInstanceOutput"
    ]:
        import capo_tnb._operations.tnb.create_sol_network_instance

        (
            output,
            http_response,
        ) = await capo_tnb._operations.tnb.create_sol_network_instance.async_create_sol_network_instance(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_tnb.types.create_sol_network_instance_input.CreateSolNetworkInstanceInput",
    ) -> dict[str, Any]:
        import capo_tnb.types.create_sol_network_instance_input

        return capo_tnb.types.create_sol_network_instance_input.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_tnb.types.create_sol_network_instance_output.CreateSolNetworkInstanceOutput",
    ) -> dict[str, Any]:
        import capo_tnb.types.create_sol_network_instance_output

        return capo_tnb.types.create_sol_network_instance_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateSolNetworkInstance",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_tnb.types.create_sol_network_instance_input.CreateSolNetworkInstanceInput = {
        "nsd_info_id": nsd_info_id,
        "ns_name": ns_name,
    }
    if ns_description is not None:
        input_["ns_description"] = ns_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