Skip to content

create_gateway async

create_gateway(
    *,
    config_overrides: Optional[AsyncMediaConnectClientConfig] = None,
    egress_cidr_blocks: Optional[__listOfString] = None,
    name: Optional[str] = None,
    networks: Optional[__listOfGatewayNetwork] = None,
) -> CreateGatewayResponse

Creates a new gateway. The request must include at least one network (up to four).

Parameters:

  • egress_cidr_blocks (Optional[__listOfString], default: None ) –

    The range of IP addresses that are allowed to contribute content or initiate output requests for flows communicating with this gateway. These IP addresses should be in the form of a Classless Inter-Domain Routing (CIDR) block; for example, 10.0.0.0/16.

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

    The name of the gateway. This name can not be modified after the gateway is created.

  • networks (Optional[__listOfGatewayNetwork], default: None ) –

    The list of networks that you want to add to the gateway.

Raises:

  • BadRequestException –

    This exception is thrown if the request contains a semantic error. The precise meaning depends on the API, and is documented in the error message.

  • ConflictException –

    The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request.

  • CreateGateway420Exception –

    Exception raised by Elemental MediaConnect when creating the gateway. See the error message for the operation for more information on the cause of this exception.

  • ForbiddenException –

    You do not have sufficient access to perform this action.

  • InternalServerErrorException –

    The server encountered an internal error and is unable to complete the request.

  • ServiceUnavailableException –

    The service is currently unavailable or busy.

  • TooManyRequestsException –

    The request was denied due to request throttling.

  • UnknownServiceError –

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

Source code in docs_src/capo_mediaconnect/_services/async_media_connect.py
async def create_gateway(
    self,
    *,
    config_overrides: Optional[AsyncMediaConnectClientConfig] = None,
    egress_cidr_blocks: Optional[
        "capo_mediaconnect.types.__list_of_string.__listOfString"
    ] = None,
    name: Optional[str] = None,
    networks: Optional[
        "capo_mediaconnect.types.__list_of_gateway_network.__listOfGatewayNetwork"
    ] = None,
) -> "capo_mediaconnect.types.create_gateway_response.CreateGatewayResponse":
    """<p> Creates a new gateway. The request must include at least one network (up to four).</p>

    Args:
        egress_cidr_blocks: <p> The range of IP addresses that are allowed to contribute content or initiate output requests for flows communicating with this gateway. These IP addresses should be in the form of a Classless Inter-Domain Routing (CIDR) block; for example, 10.0.0.0/16.</p>
        name: <p> The name of the gateway. This name can not be modified after the gateway is created.</p>
        networks: <p> The list of networks that you want to add to the gateway.</p>

    Raises:
        capo_mediaconnect.errors.bad_request_exception.BadRequestException: <p>This exception is thrown if the request contains a semantic error. The precise meaning depends on the API, and is documented in the error message. </p>
        capo_mediaconnect.errors.conflict_exception.ConflictException: <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. </p>
        capo_mediaconnect.errors.create_gateway420_exception.CreateGateway420Exception: <p>Exception raised by Elemental MediaConnect when creating the gateway. See the error message for the operation for more information on the cause of this exception. </p>
        capo_mediaconnect.errors.forbidden_exception.ForbiddenException: <p>You do not have sufficient access to perform this action. </p>
        capo_mediaconnect.errors.internal_server_error_exception.InternalServerErrorException: <p>The server encountered an internal error and is unable to complete the request. </p>
        capo_mediaconnect.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is currently unavailable or busy. </p>
        capo_mediaconnect.errors.too_many_requests_exception.TooManyRequestsException: <p>The request was denied due to request throttling. </p>
        capo_mediaconnect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_mediaconnect.types.create_gateway_request.CreateGatewayRequest]",
    ) -> AsyncOperationResponse[
        "capo_mediaconnect.types.create_gateway_response.CreateGatewayResponse"
    ]:
        import capo_mediaconnect._operations.media_connect.create_gateway

        (
            output,
            http_response,
        ) = await capo_mediaconnect._operations.media_connect.create_gateway.async_create_gateway(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateGateway")
    )
    input_: capo_mediaconnect.types.create_gateway_request.CreateGatewayRequest = {}
    if egress_cidr_blocks is not None:
        input_["egress_cidr_blocks"] = egress_cidr_blocks
    if name is not None:
        input_["name"] = name
    if networks is not None:
        input_["networks"] = networks

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output