Skip to content

associate_feed

associate_feed(
    id: FeedId,
    associated_resource_name: AssociatedResourceName,
    outputs: CreateOutputList,
    *,
    config_overrides: Optional[ElementalInferenceClientConfig] = None,
    dry_run: Optional[bool] = None,
) -> AssociateFeedResponse

Associates a resource with the feed. The resource provides the input that Elemental Inference needs in order to perform an Elemental Inference feature, such as cropping video. You always provide the resource by associating it with a feed. You can associate only one resource with each feed. With an association, a specific source media is claiming ownership of the feed.

AssociateFeed is a PATCH operation, which means that you can include only parameters that you want to change. Parameters that you don't include will not be affected by the operation.

Specifically:

  • You can add more outputs to the existing outputs. New outputs will be appended.

  • You can't modify an existing output (for example to change its name). Instead, use UpdateFeed.

  • You can't delete an existing output. Instead, use UpdateFeed.

Also note that you can't change the feed name with AssociateFeed. Instead, use UpdateFeed.

Parameters:

  • id (FeedId) –

    The ID of the feed.

  • associated_resource_name (AssociatedResourceName) –

    An identifier for the resource. This name must not resemble an ARN.

    The resource is the source media that the feed will process. The name you assign should help you to later identify the source media that belongs to the feed. In this way, you will know which source media to push to the feed (using PutMedia).

  • outputs (CreateOutputList) –

    An array of one or more outputs that you want to add to this feed now, to supplement any outputs that you specified when you created or updated the feed.

  • dry_run (Optional[bool], default: None ) –

    Set to true if you want to do a dry run of the associate action.

    Elemental Inference will validate that the real request would succeed without actually making any changes. A dry run catches errors such as missing IAM permissions, quota limits exceeded, conflicting outputs, and so on. If the dry run fails, the action returns a 4xx error code. After you've fixed the errors, resubmit the request.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

  • ConflictException –

    The request could not be completed due to a conflict.

  • InternalServerErrorException –

    An internal server error occurred. This is a temporary condition and the request can be retried. If the problem persists, contact AWS Support.

  • ResourceNotFoundException –

    The resource specified in the action doesn't exist.

  • ServiceQuotaExceededException –

    The request was rejected because it would exceed one or more service quotas for your account. Review your service quotas and either delete unused resources or request a quota increase.

  • TooManyRequestException –

    The request was denied due to request throttling. Too many requests have been made within a given time period. Reduce the frequency of requests and use exponential backoff when retrying.

  • ValidationException –

    The input fails to satisfy the constraints specified by the service. Check the error message for details about which parameter or field is invalid and correct the request before retrying.

  • UnknownServiceError –

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

Source code in docs_src/capo_elementalinference/_services/elemental_inference.py
def associate_feed(
    self,
    id: "capo_elementalinference.types.feed_id.FeedId",
    associated_resource_name: "capo_elementalinference.types.associated_resource_name.AssociatedResourceName",
    outputs: "capo_elementalinference.types.create_output_list.CreateOutputList",
    *,
    config_overrides: Optional[ElementalInferenceClientConfig] = None,
    dry_run: Optional[bool] = None,
) -> "capo_elementalinference.types.associate_feed_response.AssociateFeedResponse":
    """<p>Associates a resource with the feed. The resource provides the input that Elemental Inference needs in order to perform an Elemental Inference feature, such as cropping video. You always provide the resource by associating it with a feed. You can associate only one resource with each feed. With an association, a specific source media is claiming ownership of the feed. </p> <p>AssociateFeed is a PATCH operation, which means that you can include only parameters that you want to change. Parameters that you don't include will not be affected by the operation. </p> <p>Specifically:</p> <ul> <li> <p>You can add more outputs to the existing outputs. New outputs will be appended.</p> </li> <li> <p>You can't modify an existing output (for example to change its name). Instead, use UpdateFeed. </p> </li> <li> <p>You can't delete an existing output. Instead, use UpdateFeed.</p> </li> </ul> <p>Also note that you can't change the feed name with AssociateFeed. Instead, use UpdateFeed. </p>

    Args:
        id: <p>The ID of the feed.</p>
        associated_resource_name: <p>An identifier for the resource. This name must not resemble an ARN.</p> <p>The resource is the source media that the feed will process. The name you assign should help you to later identify the source media that belongs to the feed. In this way, you will know which source media to push to the feed (using PutMedia). </p>
        outputs: <p>An array of one or more outputs that you want to add to this feed now, to supplement any outputs that you specified when you created or updated the feed. </p>
        dry_run: <p>Set to true if you want to do a dry run of the associate action.</p> <p>Elemental Inference will validate that the real request would succeed without actually making any changes. A dry run catches errors such as missing IAM permissions, quota limits exceeded, conflicting outputs, and so on. If the dry run fails, the action returns a 4xx error code. After you've fixed the errors, resubmit the request. </p>

    Raises:
        capo_elementalinference.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_elementalinference.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict.</p>
        capo_elementalinference.errors.internal_server_error_exception.InternalServerErrorException: <p>An internal server error occurred. This is a temporary condition and the request can be retried. If the problem persists, contact AWS Support. </p>
        capo_elementalinference.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the action doesn't exist.</p>
        capo_elementalinference.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request was rejected because it would exceed one or more service quotas for your account. Review your service quotas and either delete unused resources or request a quota increase. </p>
        capo_elementalinference.errors.too_many_request_exception.TooManyRequestException: <p>The request was denied due to request throttling. Too many requests have been made within a given time period. Reduce the frequency of requests and use exponential backoff when retrying. </p>
        capo_elementalinference.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the service. Check the error message for details about which parameter or field is invalid and correct the request before retrying. </p>
        capo_elementalinference.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_elementalinference.types.associate_feed_request.AssociateFeedRequest]",
    ) -> OperationResponse[
        "capo_elementalinference.types.associate_feed_response.AssociateFeedResponse"
    ]:
        import capo_elementalinference._operations.elemental_inference.associate_feed

        output, http_response = (
            capo_elementalinference._operations.elemental_inference.associate_feed.associate_feed(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AssociateFeed")
    )
    input_: capo_elementalinference.types.associate_feed_request.AssociateFeedRequest = {
        "id": id,
        "associated_resource_name": associated_resource_name,
        "outputs": outputs,
    }
    if dry_run is not None:
        input_["dry_run"] = dry_run

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