Skip to content

get_managed_endpoint_session_credentials

get_managed_endpoint_session_credentials(
    endpoint_identifier: String2048,
    virtual_cluster_identifier: String2048,
    execution_role_arn: IAMRoleArn,
    credential_type: CredentialType,
    *,
    config_overrides: Optional[EMRcontainersClientConfig] = None,
    duration_in_seconds: Optional[JavaInteger] = None,
    log_context: Optional[LogContext] = None,
    client_token: Optional[ClientToken] = None,
) -> GetManagedEndpointSessionCredentialsResponse

Generate a session token to connect to a managed endpoint.

Parameters:

  • endpoint_identifier (String2048) –

    The ARN of the managed endpoint for which the request is submitted.

  • virtual_cluster_identifier (String2048) –

    The ARN of the Virtual Cluster which the Managed Endpoint belongs to.

  • execution_role_arn (IAMRoleArn) –

    The IAM Execution Role ARN that will be used by the job run.

  • credential_type (CredentialType) –

    Type of the token requested. Currently supported and default value of this field is “TOKEN.”

  • duration_in_seconds (Optional[JavaInteger], default: None ) –

    Duration in seconds for which the session token is valid. The default duration is 15 minutes and the maximum is 12 hours.

  • log_context (Optional[LogContext], default: None ) –

    String identifier used to separate sections of the execution logs uploaded to S3.

  • client_token (Optional[ClientToken], default: None ) –

    The client idempotency token of the job run request.

Raises:

Source code in docs_src/capo_emr_containers/_services/em_rcontainers.py
def get_managed_endpoint_session_credentials(
    self,
    endpoint_identifier: "capo_emr_containers.types.string2048.String2048",
    virtual_cluster_identifier: "capo_emr_containers.types.string2048.String2048",
    execution_role_arn: "capo_emr_containers.types.iam_role_arn.IAMRoleArn",
    credential_type: "capo_emr_containers.types.credential_type.CredentialType",
    *,
    config_overrides: Optional[EMRcontainersClientConfig] = None,
    duration_in_seconds: Optional[
        "capo_emr_containers.types.java_integer.JavaInteger"
    ] = None,
    log_context: Optional[
        "capo_emr_containers.types.log_context.LogContext"
    ] = None,
    client_token: Optional[
        "capo_emr_containers.types.client_token.ClientToken"
    ] = None,
) -> "capo_emr_containers.types.get_managed_endpoint_session_credentials_response.GetManagedEndpointSessionCredentialsResponse":
    """<p>Generate a session token to connect to a managed endpoint. </p>

    Args:
        endpoint_identifier: <p>The ARN of the managed endpoint for which the request is submitted. </p>
        virtual_cluster_identifier: <p>The ARN of the Virtual Cluster which the Managed Endpoint belongs to. </p>
        execution_role_arn: <p>The IAM Execution Role ARN that will be used by the job run. </p>
        credential_type: <p>Type of the token requested. Currently supported and default value of this field is “TOKEN.”</p>
        duration_in_seconds: <p>Duration in seconds for which the session token is valid. The default duration is 15 minutes and the maximum is 12 hours.</p>
        log_context: <p>String identifier used to separate sections of the execution logs uploaded to S3.</p>
        client_token: <p>The client idempotency token of the job run request.</p>

    Raises:
        capo_emr_containers.errors.internal_server_exception.InternalServerException: <p>This is an internal server exception.</p>
        capo_emr_containers.errors.request_throttled_exception.RequestThrottledException: <p>The request throttled.</p>
        capo_emr_containers.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_emr_containers.errors.validation_exception.ValidationException: <p>There are invalid parameters in the client request.</p>
        capo_emr_containers.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_emr_containers.types.get_managed_endpoint_session_credentials_request.GetManagedEndpointSessionCredentialsRequest]",
    ) -> OperationResponse[
        "capo_emr_containers.types.get_managed_endpoint_session_credentials_response.GetManagedEndpointSessionCredentialsResponse"
    ]:
        import capo_emr_containers._operations.aws_chicago_web_service.get_managed_endpoint_session_credentials

        output, http_response = (
            capo_emr_containers._operations.aws_chicago_web_service.get_managed_endpoint_session_credentials.get_managed_endpoint_session_credentials(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_emr_containers.types.get_managed_endpoint_session_credentials_response.GetManagedEndpointSessionCredentialsResponse",
    ) -> dict[str, Any]:
        import capo_emr_containers.types.get_managed_endpoint_session_credentials_response

        return capo_emr_containers.types.get_managed_endpoint_session_credentials_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "GetManagedEndpointSessionCredentials", redact_output=_redact_output
        ),
    )
    input_: capo_emr_containers.types.get_managed_endpoint_session_credentials_request.GetManagedEndpointSessionCredentialsRequest = {
        "endpoint_identifier": endpoint_identifier,
        "virtual_cluster_identifier": virtual_cluster_identifier,
        "execution_role_arn": execution_role_arn,
        "credential_type": credential_type,
    }
    if duration_in_seconds is not None:
        input_["duration_in_seconds"] = duration_in_seconds
    if log_context is not None:
        input_["log_context"] = log_context
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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