Skip to content

start_composition async

start_composition(
    stage_arn: StageArn,
    destinations: DestinationConfigurationList,
    *,
    config_overrides: Optional[AsyncIVSRealTimeClientConfig] = None,
    idempotency_token: Optional[CompositionClientToken] = None,
    layout: Optional[LayoutConfiguration] = None,
    tags: Optional[Tags] = None,
) -> StartCompositionResponse

Starts a Composition from a stage based on the configuration provided in the request.

A Composition is an ephemeral resource that exists after this operation returns successfully. Composition stops and the resource is deleted:

  • When StopComposition is called.

  • After a 1-minute timeout, when all participants are disconnected from the stage.

  • After a 1-minute timeout, if there are no participants in the stage when StartComposition is called.

  • When broadcasting to the IVS channel fails and all retries are exhausted.

  • When broadcasting is disconnected and all attempts to reconnect are exhausted.

Parameters:

  • stage_arn (StageArn) –

    ARN of the stage to be used for compositing.

  • idempotency_token (Optional[CompositionClientToken], default: None ) –

    Idempotency token.

  • layout (Optional[LayoutConfiguration], default: None ) –

    Layout object to configure composition parameters.

  • destinations (DestinationConfigurationList) –

    Array of destination configuration.

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

    Tags attached to the resource. Array of maps, each of the form string:string (key:value). See Best practices and strategies in Tagging AWS Resources and Tag Editor for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS has no constraints on tags beyond what is documented there.

Raises:

Source code in docs_src/capo_ivs_realtime/_services/async_ivs_real_time.py
async def start_composition(
    self,
    stage_arn: "capo_ivs_realtime.types.stage_arn.StageArn",
    destinations: "capo_ivs_realtime.types.destination_configuration_list.DestinationConfigurationList",
    *,
    config_overrides: Optional[AsyncIVSRealTimeClientConfig] = None,
    idempotency_token: Optional[
        "capo_ivs_realtime.types.composition_client_token.CompositionClientToken"
    ] = None,
    layout: Optional[
        "capo_ivs_realtime.types.layout_configuration.LayoutConfiguration"
    ] = None,
    tags: Optional["capo_ivs_realtime.types.tags.Tags"] = None,
) -> "capo_ivs_realtime.types.start_composition_response.StartCompositionResponse":
    """<p>Starts a Composition from a stage based on the configuration provided in the request.</p> <p>A Composition is an ephemeral resource that exists after this operation returns successfully. Composition stops and the resource is deleted:</p> <ul> <li> <p>When <a>StopComposition</a> is called.</p> </li> <li> <p>After a 1-minute timeout, when all participants are disconnected from the stage.</p> </li> <li> <p>After a 1-minute timeout, if there are no participants in the stage when StartComposition is called.</p> </li> <li> <p>When broadcasting to the IVS channel fails and all retries are exhausted.</p> </li> <li> <p>When broadcasting is disconnected and all attempts to reconnect are exhausted.</p> </li> </ul>

    Args:
        stage_arn: <p>ARN of the stage to be used for compositing.</p>
        idempotency_token: <p>Idempotency token.</p>
        layout: <p>Layout object to configure composition parameters.</p>
        destinations: <p>Array of destination configuration.</p>
        tags: <p>Tags attached to the resource. Array of maps, each of the form <code>string:string (key:value)</code>. See <a href="https://docs.aws.amazon.com/tag-editor/latest/userguide/best-practices-and-strats.html">Best practices and strategies</a> in <i>Tagging AWS Resources and Tag Editor</i> for details, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS has no constraints on tags beyond what is documented there.</p>

    Raises:
        capo_ivs_realtime.errors.access_denied_exception.AccessDeniedException: <p>User does not have sufficient access to perform this action.</p>
        capo_ivs_realtime.errors.conflict_exception.ConflictException: <p>Updating or deleting a resource can cause an inconsistent state.</p>
        capo_ivs_realtime.errors.internal_server_exception.InternalServerException: <p>Unexpected error during processing of request.</p>
        capo_ivs_realtime.errors.pending_verification.PendingVerification: <p>Your account is pending verification.</p>
        capo_ivs_realtime.errors.resource_not_found_exception.ResourceNotFoundException: <p>Request references a resource which does not exist.</p>
        capo_ivs_realtime.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Request would cause a service quota to be exceeded.</p>
        capo_ivs_realtime.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_ivs_realtime.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ivs_realtime.types.start_composition_request.StartCompositionRequest]",
    ) -> AsyncOperationResponse[
        "capo_ivs_realtime.types.start_composition_response.StartCompositionResponse"
    ]:
        import capo_ivs_realtime._operations.amazon_interactive_video_service_real_time.start_composition

        (
            output,
            http_response,
        ) = await capo_ivs_realtime._operations.amazon_interactive_video_service_real_time.start_composition.async_start_composition(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartComposition")
    )
    input_: capo_ivs_realtime.types.start_composition_request.StartCompositionRequest = {
        "stage_arn": stage_arn,
        "destinations": destinations,
    }
    if idempotency_token is None:
        idempotency_token = str(uuid.uuid4())
    input_["idempotency_token"] = idempotency_token
    if layout is not None:
        input_["layout"] = layout
    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