Skip to content

create_network async

create_network(
    *,
    config_overrides: Optional[AsyncMediaLiveClientConfig] = None,
    ip_pools: Optional[__listOfIpPoolCreateRequest] = None,
    name: Optional[__string] = None,
    request_id: Optional[__string] = None,
    routes: Optional[__listOfRouteCreateRequest] = None,
    tags: Optional[Tags] = None,
) -> CreateNetworkResponse

Create as many Networks as you need. You will associate one or more Clusters with each Network.Each Network provides MediaLive Anywhere with required information about the network in your organization that you are using for video encoding using MediaLive.

Parameters:

  • ip_pools (Optional[__listOfIpPoolCreateRequest], default: None ) –

    An array of IpPoolCreateRequests that identify a collection of IP addresses in your network that you want to reserve for use in MediaLive Anywhere. MediaLiveAnywhere uses these IP addresses for Push inputs (in both Bridge and NATnetworks) and for output destinations (only in Bridge networks). EachIpPoolUpdateRequest specifies one CIDR block.

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

    Specify a name that is unique in the AWS account. We recommend that you assign a name that hints at the type of traffic on the network. Names are case-sensitive.

  • request_id (Optional[__string], default: None ) –

    An ID that you assign to a create request. This ID ensures idempotency when creating resources.

  • routes (Optional[__listOfRouteCreateRequest], default: None ) –

    An array of routes that MediaLive Anywhere needs to know about in order to route encoding traffic.

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

    A collection of key-value pairs.

Raises:

Source code in docs_src/capo_medialive/_services/async_media_live.py
async def create_network(
    self,
    *,
    config_overrides: Optional[AsyncMediaLiveClientConfig] = None,
    ip_pools: Optional[
        "capo_medialive.types.__list_of_ip_pool_create_request.__listOfIpPoolCreateRequest"
    ] = None,
    name: Optional["capo_medialive.types.__string.__string"] = None,
    request_id: Optional["capo_medialive.types.__string.__string"] = None,
    routes: Optional[
        "capo_medialive.types.__list_of_route_create_request.__listOfRouteCreateRequest"
    ] = None,
    tags: Optional["capo_medialive.types.tags.Tags"] = None,
) -> "capo_medialive.types.create_network_response.CreateNetworkResponse":
    """Create as many Networks as you need. You will associate one or more Clusters with each Network.Each Network provides MediaLive Anywhere with required information about the network in your organization that you are using for video encoding using MediaLive.

    Args:
        ip_pools: An array of IpPoolCreateRequests that identify a collection of IP addresses in your network that you want to reserve for use in MediaLive Anywhere. MediaLiveAnywhere uses these IP addresses for Push inputs (in both Bridge and NATnetworks) and for output destinations (only in Bridge networks). EachIpPoolUpdateRequest specifies one CIDR block.
        name: Specify a name that is unique in the AWS account. We recommend that you assign a name that hints at the type of traffic on the network. Names are case-sensitive.
        request_id: An ID that you assign to a create request. This ID ensures idempotency when creating resources.
        routes: An array of routes that MediaLive Anywhere needs to know about in order to route encoding traffic.
        tags: A collection of key-value pairs.

    Raises:
        capo_medialive.errors.bad_gateway_exception.BadGatewayException: Placeholder documentation for BadGatewayException
        capo_medialive.errors.bad_request_exception.BadRequestException: Placeholder documentation for BadRequestException
        capo_medialive.errors.conflict_exception.ConflictException: Placeholder documentation for ConflictException
        capo_medialive.errors.forbidden_exception.ForbiddenException: Placeholder documentation for ForbiddenException
        capo_medialive.errors.gateway_timeout_exception.GatewayTimeoutException: Placeholder documentation for GatewayTimeoutException
        capo_medialive.errors.internal_server_error_exception.InternalServerErrorException: Placeholder documentation for InternalServerErrorException
        capo_medialive.errors.too_many_requests_exception.TooManyRequestsException: Placeholder documentation for TooManyRequestsException
        capo_medialive.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_medialive.types.create_network_request.CreateNetworkRequest]",
    ) -> AsyncOperationResponse[
        "capo_medialive.types.create_network_response.CreateNetworkResponse"
    ]:
        import capo_medialive._operations.media_live.create_network

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateNetwork")
    )
    input_: capo_medialive.types.create_network_request.CreateNetworkRequest = {}
    if ip_pools is not None:
        input_["ip_pools"] = ip_pools
    if name is not None:
        input_["name"] = name
    if request_id is None:
        request_id = str(uuid.uuid4())
    input_["request_id"] = request_id
    if routes is not None:
        input_["routes"] = routes
    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