Skip to content

create_application_presigned_url

create_application_presigned_url(
    application_name: ApplicationName,
    url_type: UrlType,
    *,
    config_overrides: Optional[KinesisAnalyticsV2ClientConfig] = None,
    session_expiration_duration_in_seconds: Optional[
        SessionExpirationDurationInSeconds
    ] = None,
) -> CreateApplicationPresignedUrlResponse

Creates and returns a URL that you can use to connect to an application's extension.

The IAM role or user used to call this API defines the permissions to access the extension. After the presigned URL is created, no additional permission is required to access this URL. IAM authorization policies for this API are also enforced for every HTTP request that attempts to connect to the extension.

You control the amount of time that the URL will be valid using the SessionExpirationDurationInSeconds parameter. If you do not provide this parameter, the returned URL is valid for twelve hours.

The URL that you get from a call to CreateApplicationPresignedUrl must be used within 3 minutes to be valid. If you first try to use the URL after the 3-minute limit expires, the service returns an HTTP 403 Forbidden error.

Parameters:

  • application_name (ApplicationName) –

    The name of the application.

  • url_type (UrlType) –

    The type of the extension for which to create and return a URL. Currently, the only valid extension URL type is FLINK_DASHBOARD_URL.

  • session_expiration_duration_in_seconds (Optional[SessionExpirationDurationInSeconds], default: None ) –

    The duration in seconds for which the returned URL will be valid.

Raises:

Source code in docs_src/capo_kinesis_analytics_v2/_services/kinesis_analytics_v2.py
def create_application_presigned_url(
    self,
    application_name: "capo_kinesis_analytics_v2.types.application_name.ApplicationName",
    url_type: "capo_kinesis_analytics_v2.types.url_type.UrlType",
    *,
    config_overrides: Optional[KinesisAnalyticsV2ClientConfig] = None,
    session_expiration_duration_in_seconds: Optional[
        "capo_kinesis_analytics_v2.types.session_expiration_duration_in_seconds.SessionExpirationDurationInSeconds"
    ] = None,
) -> "capo_kinesis_analytics_v2.types.create_application_presigned_url_response.CreateApplicationPresignedUrlResponse":
    """<p>Creates and returns a URL that you can use to connect to an application's extension.</p> <p>The IAM role or user used to call this API defines the permissions to access the extension. After the presigned URL is created, no additional permission is required to access this URL. IAM authorization policies for this API are also enforced for every HTTP request that attempts to connect to the extension. </p> <p>You control the amount of time that the URL will be valid using the <code>SessionExpirationDurationInSeconds</code> parameter. If you do not provide this parameter, the returned URL is valid for twelve hours.</p> <note> <p>The URL that you get from a call to CreateApplicationPresignedUrl must be used within 3 minutes to be valid. If you first try to use the URL after the 3-minute limit expires, the service returns an HTTP 403 Forbidden error.</p> </note>

    Args:
        application_name: <p>The name of the application.</p>
        url_type: <p>The type of the extension for which to create and return a URL. Currently, the only valid extension URL type is <code>FLINK_DASHBOARD_URL</code>. </p>
        session_expiration_duration_in_seconds: <p>The duration in seconds for which the returned URL will be valid.</p>

    Raises:
        capo_kinesis_analytics_v2.errors.invalid_argument_exception.InvalidArgumentException: <p>The specified input parameter value is not valid.</p>
        capo_kinesis_analytics_v2.errors.resource_in_use_exception.ResourceInUseException: <p>The application is not available for this operation.</p>
        capo_kinesis_analytics_v2.errors.resource_not_found_exception.ResourceNotFoundException: <p>Specified application can't be found.</p>
        capo_kinesis_analytics_v2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_kinesis_analytics_v2.types.create_application_presigned_url_request.CreateApplicationPresignedUrlRequest]",
    ) -> OperationResponse[
        "capo_kinesis_analytics_v2.types.create_application_presigned_url_response.CreateApplicationPresignedUrlResponse"
    ]:
        import capo_kinesis_analytics_v2._operations.kinesis_analytics_20180523.create_application_presigned_url

        output, http_response = (
            capo_kinesis_analytics_v2._operations.kinesis_analytics_20180523.create_application_presigned_url.create_application_presigned_url(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateApplicationPresignedUrl")
    )
    input_: capo_kinesis_analytics_v2.types.create_application_presigned_url_request.CreateApplicationPresignedUrlRequest = {
        "application_name": application_name,
        "url_type": url_type,
    }
    if session_expiration_duration_in_seconds is not None:
        input_["session_expiration_duration_in_seconds"] = (
            session_expiration_duration_in_seconds
        )

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