Skip to content

create_flow async

create_flow(
    *,
    config_overrides: Optional[AsyncMediaConnectClientConfig] = None,
    availability_zone: Optional[str] = None,
    entitlements: Optional[__listOfGrantEntitlementRequest] = None,
    media_streams: Optional[__listOfAddMediaStreamRequest] = None,
    name: Optional[str] = None,
    outputs: Optional[__listOfAddOutputRequest] = None,
    source: Optional[SetSourceRequest] = None,
    source_failover_config: Optional[FailoverConfig] = None,
    sources: Optional[__listOfSetSourceRequest] = None,
    vpc_interfaces: Optional[__listOfVpcInterfaceRequest] = None,
    maintenance: Optional[AddMaintenance] = None,
    source_monitoring_config: Optional[MonitoringConfig] = None,
    flow_size: Optional[FlowSize] = None,
    ndi_config: Optional[NdiConfig] = None,
    encoding_config: Optional[EncodingConfig] = None,
    flow_tags: Optional[__mapOfString] = None,
) -> CreateFlowResponse

Creates a new flow. The request must include one source. The request optionally can include outputs (up to 50) and entitlements (up to 50).

Parameters:

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

    The Availability Zone that you want to create the flow in. These options are limited to the Availability Zones within the current Amazon Web Services Region.

  • entitlements (Optional[__listOfGrantEntitlementRequest], default: None ) –

    The entitlements that you want to grant on a flow.

  • media_streams (Optional[__listOfAddMediaStreamRequest], default: None ) –

    The media streams that you want to add to the flow. You can associate these media streams with sources and outputs on the flow.

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

    The name of the flow.

  • outputs (Optional[__listOfAddOutputRequest], default: None ) –

    The outputs that you want to add to this flow.

  • source (Optional[SetSourceRequest], default: None ) –

    The settings for the source that you want to use for the new flow.

  • source_failover_config (Optional[FailoverConfig], default: None ) –

    The settings for source failover.

  • sources (Optional[__listOfSetSourceRequest], default: None ) –

    The sources that are assigned to the flow.

  • vpc_interfaces (Optional[__listOfVpcInterfaceRequest], default: None ) –

    The VPC interfaces you want on the flow.

  • maintenance (Optional[AddMaintenance], default: None ) –

    The maintenance settings you want to use for the flow.

  • source_monitoring_config (Optional[MonitoringConfig], default: None ) –

    The settings for source monitoring.

  • flow_size (Optional[FlowSize], default: None ) –

    Determines the processing capacity and feature set of the flow. Set this optional parameter to LARGE if you want to enable NDI sources or outputs on the flow.

  • ndi_config (Optional[NdiConfig], default: None ) –

    Specifies the configuration settings for a flow's NDI source or output. Required when the flow includes an NDI source or output.

  • flow_tags (Optional[__mapOfString], default: None ) –

    The key-value pairs that can be used to tag and organize the flow.

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.

  • CreateFlow420Exception –

    Exception raised by Elemental MediaConnect when creating the flow. 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_flow(
    self,
    *,
    config_overrides: Optional[AsyncMediaConnectClientConfig] = None,
    availability_zone: Optional[str] = None,
    entitlements: Optional[
        "capo_mediaconnect.types.__list_of_grant_entitlement_request.__listOfGrantEntitlementRequest"
    ] = None,
    media_streams: Optional[
        "capo_mediaconnect.types.__list_of_add_media_stream_request.__listOfAddMediaStreamRequest"
    ] = None,
    name: Optional[str] = None,
    outputs: Optional[
        "capo_mediaconnect.types.__list_of_add_output_request.__listOfAddOutputRequest"
    ] = None,
    source: Optional[
        "capo_mediaconnect.types.set_source_request.SetSourceRequest"
    ] = None,
    source_failover_config: Optional[
        "capo_mediaconnect.types.failover_config.FailoverConfig"
    ] = None,
    sources: Optional[
        "capo_mediaconnect.types.__list_of_set_source_request.__listOfSetSourceRequest"
    ] = None,
    vpc_interfaces: Optional[
        "capo_mediaconnect.types.__list_of_vpc_interface_request.__listOfVpcInterfaceRequest"
    ] = None,
    maintenance: Optional[
        "capo_mediaconnect.types.add_maintenance.AddMaintenance"
    ] = None,
    source_monitoring_config: Optional[
        "capo_mediaconnect.types.monitoring_config.MonitoringConfig"
    ] = None,
    flow_size: Optional["capo_mediaconnect.types.flow_size.FlowSize"] = None,
    ndi_config: Optional["capo_mediaconnect.types.ndi_config.NdiConfig"] = None,
    encoding_config: Optional[
        "capo_mediaconnect.types.encoding_config.EncodingConfig"
    ] = None,
    flow_tags: Optional[
        "capo_mediaconnect.types.__map_of_string.__mapOfString"
    ] = None,
) -> "capo_mediaconnect.types.create_flow_response.CreateFlowResponse":
    """<p> Creates a new flow. The request must include one source. The request optionally can include outputs (up to 50) and entitlements (up to 50).</p>

    Args:
        availability_zone: <p> The Availability Zone that you want to create the flow in. These options are limited to the Availability Zones within the current Amazon Web Services Region.</p>
        entitlements: <p> The entitlements that you want to grant on a flow.</p>
        media_streams: <p> The media streams that you want to add to the flow. You can associate these media streams with sources and outputs on the flow.</p>
        name: <p> The name of the flow.</p>
        outputs: <p> The outputs that you want to add to this flow.</p>
        source: <p> The settings for the source that you want to use for the new flow. </p>
        source_failover_config: <p> The settings for source failover. </p>
        sources: <p>The sources that are assigned to the flow. </p>
        vpc_interfaces: <p> The VPC interfaces you want on the flow.</p>
        maintenance: <p> The maintenance settings you want to use for the flow. </p>
        source_monitoring_config: <p> The settings for source monitoring. </p>
        flow_size: <p> Determines the processing capacity and feature set of the flow. Set this optional parameter to <code>LARGE</code> if you want to enable NDI sources or outputs on the flow. </p>
        ndi_config: <p> Specifies the configuration settings for a flow's NDI source or output. Required when the flow includes an NDI source or output. </p>
        flow_tags: <p> The key-value pairs that can be used to tag and organize the flow. </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.create_flow420_exception.CreateFlow420Exception: <p>Exception raised by Elemental MediaConnect when creating the flow. 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_flow_request.CreateFlowRequest]",
    ) -> AsyncOperationResponse[
        "capo_mediaconnect.types.create_flow_response.CreateFlowResponse"
    ]:
        import capo_mediaconnect._operations.media_connect.create_flow

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateFlow")
    )
    input_: capo_mediaconnect.types.create_flow_request.CreateFlowRequest = {}
    if availability_zone is not None:
        input_["availability_zone"] = availability_zone
    if entitlements is not None:
        input_["entitlements"] = entitlements
    if media_streams is not None:
        input_["media_streams"] = media_streams
    if name is not None:
        input_["name"] = name
    if outputs is not None:
        input_["outputs"] = outputs
    if source is not None:
        input_["source"] = source
    if source_failover_config is not None:
        input_["source_failover_config"] = source_failover_config
    if sources is not None:
        input_["sources"] = sources
    if vpc_interfaces is not None:
        input_["vpc_interfaces"] = vpc_interfaces
    if maintenance is not None:
        input_["maintenance"] = maintenance
    if source_monitoring_config is not None:
        input_["source_monitoring_config"] = source_monitoring_config
    if flow_size is not None:
        input_["flow_size"] = flow_size
    if ndi_config is not None:
        input_["ndi_config"] = ndi_config
    if encoding_config is not None:
        input_["encoding_config"] = encoding_config
    if flow_tags is not None:
        input_["flow_tags"] = flow_tags

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