Skip to content

create_context_store

create_context_store(
    global_network_id: GlobalNetworkId,
    *,
    config_overrides: Optional[NetworkManagerClientConfig] = None,
    description: Optional[ConstrainedString] = None,
    tags: Optional[TagList] = None,
    client_token: Optional[ClientToken] = None,
) -> CreateContextStoreResponse

Creates a context store in a global network. A context store maintains context entries, such as security groups, subnets, and attachments, for the resources connected to the transit gateways that you associate with it.

The context store is in the PENDING state when it's created, and changes to AVAILABLE when it's ready to use.

Parameters:

  • global_network_id (GlobalNetworkId) –

    The ID of the global network to create the context store in.

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

    A description of the context store.

    Constraints: Maximum length of 256 characters. Only printable ASCII characters are allowed.

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

    The tags to apply to the context store during creation.

  • client_token (Optional[ClientToken], default: None ) –

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

Raises:

Source code in docs_src/capo_networkmanager/_services/network_manager.py
def create_context_store(
    self,
    global_network_id: "capo_networkmanager.types.global_network_id.GlobalNetworkId",
    *,
    config_overrides: Optional[NetworkManagerClientConfig] = None,
    description: Optional[
        "capo_networkmanager.types.constrained_string.ConstrainedString"
    ] = None,
    tags: Optional["capo_networkmanager.types.tag_list.TagList"] = None,
    client_token: Optional[
        "capo_networkmanager.types.client_token.ClientToken"
    ] = None,
) -> "capo_networkmanager.types.create_context_store_response.CreateContextStoreResponse":
    """<p>Creates a context store in a global network. A context store maintains context entries, such as security groups, subnets, and attachments, for the resources connected to the transit gateways that you associate with it.</p> <p>The context store is in the <code>PENDING</code> state when it's created, and changes to <code>AVAILABLE</code> when it's ready to use.</p>

    Args:
        global_network_id: <p>The ID of the global network to create the context store in.</p>
        description: <p>A description of the context store.</p> <p>Constraints: Maximum length of 256 characters. Only printable ASCII characters are allowed.</p>
        tags: <p>The tags to apply to the context store during creation.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>

    Raises:
        capo_networkmanager.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_networkmanager.errors.conflict_exception.ConflictException: <p>There was a conflict processing the request. Updating or deleting the resource can cause an inconsistent state.</p>
        capo_networkmanager.errors.internal_server_exception.InternalServerException: <p>The request has failed due to an internal error.</p>
        capo_networkmanager.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource could not be found.</p>
        capo_networkmanager.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>A service limit was exceeded.</p>
        capo_networkmanager.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_networkmanager.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints.</p>
        capo_networkmanager.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_networkmanager.types.create_context_store_request.CreateContextStoreRequest]",
    ) -> OperationResponse[
        "capo_networkmanager.types.create_context_store_response.CreateContextStoreResponse"
    ]:
        import capo_networkmanager._operations.network_manager.create_context_store

        output, http_response = (
            capo_networkmanager._operations.network_manager.create_context_store.create_context_store(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateContextStore")
    )
    input_: capo_networkmanager.types.create_context_store_request.CreateContextStoreRequest = {
        "global_network_id": global_network_id
    }
    if description is not None:
        input_["description"] = description
    if tags is not None:
        input_["tags"] = tags
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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