Skip to content

terminate_sol_network_instance

terminate_sol_network_instance(
    ns_instance_id: NsInstanceId,
    *,
    config_overrides: Optional[tnbClientConfig] = None,
    tags: Optional[TagMap] = None,
) -> TerminateSolNetworkInstanceOutput

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

You must terminate a network instance before you can delete it.

Parameters:

  • ns_instance_id (NsInstanceId) –

    ID of the network instance.

  • 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. When you use this API, the tags are only applied to the network operation that is created. These tags are not applied to the network instance. Use tags to search and filter your resources or track your Amazon Web Services costs.

Raises:

Examples:

Terminate a Sol Network Instance

>>> client.terminate_sol_network_instance(ns_instance_id='ni-0d5b823eb5c2a9241', tags={'Name': 'Resource'})
Source code in docs_src/capo_tnb/_services/tnb.py
def terminate_sol_network_instance(
    self,
    ns_instance_id: "capo_tnb.types.ns_instance_id.NsInstanceId",
    *,
    config_overrides: Optional[tnbClientConfig] = None,
    tags: Optional["capo_tnb.types.tag_map.TagMap"] = None,
) -> "capo_tnb.types.terminate_sol_network_instance_output.TerminateSolNetworkInstanceOutput":
    """<p>Terminates 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.</p> <p>You must terminate a network instance before you can delete it.</p>

    Args:
        ns_instance_id: <p>ID of the network instance.</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. When you use this API, the tags are only applied to the network operation that is created. These tags are not applied to the network instance. 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:
        Terminate a Sol Network Instance

        >>> client.terminate_sol_network_instance(ns_instance_id='ni-0d5b823eb5c2a9241', tags={'Name': 'Resource'})
    """

    def _handler(
        req: "OperationRequest[capo_tnb.types.terminate_sol_network_instance_input.TerminateSolNetworkInstanceInput]",
    ) -> OperationResponse[
        "capo_tnb.types.terminate_sol_network_instance_output.TerminateSolNetworkInstanceOutput"
    ]:
        import capo_tnb._operations.tnb.terminate_sol_network_instance

        output, http_response = (
            capo_tnb._operations.tnb.terminate_sol_network_instance.terminate_sol_network_instance(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

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

        return capo_tnb.types.terminate_sol_network_instance_input.redact_sensitive(
            input_
        )

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

        return (
            capo_tnb.types.terminate_sol_network_instance_output.redact_sensitive(
                output
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "TerminateSolNetworkInstance",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_tnb.types.terminate_sol_network_instance_input.TerminateSolNetworkInstanceInput = {
        "ns_instance_id": ns_instance_id
    }
    if tags is not None:
        input_["tags"] = tags

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