getManagedEndpointSessionCredentials method
Generate a session token to connect to a managed endpoint.
May throw InternalServerException.
May throw RequestThrottledException.
May throw ResourceNotFoundException.
May throw ValidationException.
Parameter credentialType :
Type of the token requested. Currently supported and default value of this
field is “TOKEN.”
Parameter endpointIdentifier :
The ARN of the managed endpoint for which the request is submitted.
Parameter executionRoleArn :
The IAM Execution Role ARN that will be used by the job run.
Parameter virtualClusterIdentifier :
The ARN of the Virtual Cluster which the Managed Endpoint belongs to.
Parameter clientToken :
The client idempotency token of the job run request.
Parameter durationInSeconds :
Duration in seconds for which the session token is valid. The default
duration is 15 minutes and the maximum is 12 hours.
Parameter logContext :
String identifier used to separate sections of the execution logs uploaded
to S3.
Implementation
Future<GetManagedEndpointSessionCredentialsResponse>
getManagedEndpointSessionCredentials({
required String credentialType,
required String endpointIdentifier,
required String executionRoleArn,
required String virtualClusterIdentifier,
String? clientToken,
int? durationInSeconds,
String? logContext,
}) async {
final $payload = <String, dynamic>{
'credentialType': credentialType,
'executionRoleArn': executionRoleArn,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (durationInSeconds != null) 'durationInSeconds': durationInSeconds,
if (logContext != null) 'logContext': logContext,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/virtualclusters/${Uri.encodeComponent(virtualClusterIdentifier)}/endpoints/${Uri.encodeComponent(endpointIdentifier)}/credentials',
exceptionFnMap: _exceptionFns,
);
return GetManagedEndpointSessionCredentialsResponse.fromJson(response);
}