Skip to content

test_role async

test_role(
    role: Role,
    input_bucket: BucketName,
    output_bucket: BucketName,
    topics: SnsTopics,
    *,
    config_overrides: Optional[AsyncElasticTranscoderClientConfig] = None,
) -> TestRoleResponse

The TestRole operation tests the IAM role used to create the pipeline.

The TestRole action lets you determine whether the IAM role you are using has sufficient permissions to let Elastic Transcoder perform tasks associated with the transcoding process. The action attempts to assume the specified IAM role, checks read access to the input and output buckets, and tries to send a test notification to Amazon SNS topics that you specify.

Parameters:

  • role (Role) –

    The IAM Amazon Resource Name (ARN) for the role that you want Elastic Transcoder to test.

  • input_bucket (BucketName) –

    The Amazon S3 bucket that contains media files to be transcoded. The action attempts to read from this bucket.

  • output_bucket (BucketName) –

    The Amazon S3 bucket that Elastic Transcoder writes transcoded media files to. The action attempts to read from this bucket.

  • topics (SnsTopics) –

    The ARNs of one or more Amazon Simple Notification Service (Amazon SNS) topics that you want the action to send a test notification to.

Raises:

  • AccessDeniedException –

    General authentication failure. The request was not signed correctly.

  • InternalServiceException –

    Elastic Transcoder encountered an unexpected exception while trying to fulfill the request.

  • ResourceNotFoundException –

    The requested resource does not exist or is not available. For example, the pipeline to which you're trying to add a job doesn't exist or is still being created.

  • ValidationException –

    One or more required parameter values were not provided in the request.

  • UnknownServiceError –

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

Source code in docs_src/capo_elastic_transcoder/_services/async_elastic_transcoder.py
async def test_role(
    self,
    role: "capo_elastic_transcoder.types.role.Role",
    input_bucket: "capo_elastic_transcoder.types.bucket_name.BucketName",
    output_bucket: "capo_elastic_transcoder.types.bucket_name.BucketName",
    topics: "capo_elastic_transcoder.types.sns_topics.SnsTopics",
    *,
    config_overrides: Optional[AsyncElasticTranscoderClientConfig] = None,
) -> "capo_elastic_transcoder.types.test_role_response.TestRoleResponse":
    """<p>The TestRole operation tests the IAM role used to create the pipeline.</p> <p>The <code>TestRole</code> action lets you determine whether the IAM role you are using has sufficient permissions to let Elastic Transcoder perform tasks associated with the transcoding process. The action attempts to assume the specified IAM role, checks read access to the input and output buckets, and tries to send a test notification to Amazon SNS topics that you specify.</p>

    Args:
        role: <p>The IAM Amazon Resource Name (ARN) for the role that you want Elastic Transcoder to test.</p>
        input_bucket: <p>The Amazon S3 bucket that contains media files to be transcoded. The action attempts to read from this bucket.</p>
        output_bucket: <p>The Amazon S3 bucket that Elastic Transcoder writes transcoded media files to. The action attempts to read from this bucket.</p>
        topics: <p>The ARNs of one or more Amazon Simple Notification Service (Amazon SNS) topics that you want the action to send a test notification to.</p>

    Raises:
        capo_elastic_transcoder.errors.access_denied_exception.AccessDeniedException: <p>General authentication failure. The request was not signed correctly.</p>
        capo_elastic_transcoder.errors.incompatible_version_exception.IncompatibleVersionException
        capo_elastic_transcoder.errors.internal_service_exception.InternalServiceException: <p>Elastic Transcoder encountered an unexpected exception while trying to fulfill the request.</p>
        capo_elastic_transcoder.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource does not exist or is not available. For example, the pipeline to which you're trying to add a job doesn't exist or is still being created.</p>
        capo_elastic_transcoder.errors.validation_exception.ValidationException: <p>One or more required parameter values were not provided in the request.</p>
        capo_elastic_transcoder.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_elastic_transcoder.types.test_role_request.TestRoleRequest]",
    ) -> AsyncOperationResponse[
        "capo_elastic_transcoder.types.test_role_response.TestRoleResponse"
    ]:
        import capo_elastic_transcoder._operations.ets_customer_service.test_role

        (
            output,
            http_response,
        ) = await capo_elastic_transcoder._operations.ets_customer_service.test_role.async_test_role(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("TestRole")
    )
    input_: capo_elastic_transcoder.types.test_role_request.TestRoleRequest = {
        "role": role,
        "input_bucket": input_bucket,
        "output_bucket": output_bucket,
        "topics": topics,
    }

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