createPresignedMlflowAppUrl method

Future<CreatePresignedMlflowAppUrlResponse> createPresignedMlflowAppUrl({
  1. required String arn,
  2. int? expiresInSeconds,
  3. int? sessionExpirationDurationInSeconds,
})

Returns a presigned URL that you can use to connect to the MLflow UI attached to your MLflow App. For more information, see Launch the MLflow UI using a presigned URL.

May throw ResourceNotFound.

Parameter arn : The ARN of the MLflow App to connect to your MLflow UI.

Parameter expiresInSeconds : The duration in seconds that your presigned URL is valid. The presigned URL can be used only once.

Parameter sessionExpirationDurationInSeconds : The duration in seconds that your presigned URL is valid. The presigned URL can be used only once.

Implementation

Future<CreatePresignedMlflowAppUrlResponse> createPresignedMlflowAppUrl({
  required String arn,
  int? expiresInSeconds,
  int? sessionExpirationDurationInSeconds,
}) async {
  _s.validateNumRange(
    'expiresInSeconds',
    expiresInSeconds,
    5,
    300,
  );
  _s.validateNumRange(
    'sessionExpirationDurationInSeconds',
    sessionExpirationDurationInSeconds,
    1800,
    43200,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.CreatePresignedMlflowAppUrl'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Arn': arn,
      if (expiresInSeconds != null) 'ExpiresInSeconds': expiresInSeconds,
      if (sessionExpirationDurationInSeconds != null)
        'SessionExpirationDurationInSeconds':
            sessionExpirationDurationInSeconds,
    },
  );

  return CreatePresignedMlflowAppUrlResponse.fromJson(jsonResponse.body);
}