getConnection method
Retrieves a connection definition from the Data Catalog.
May throw EntityNotFoundException.
May throw GlueEncryptionException.
May throw InvalidInputException.
May throw OperationTimeoutException.
Parameter name :
The name of the connection definition to retrieve.
Parameter applyOverrideForComputeEnvironment :
For connections that may be used in multiple services, specifies returning
properties for the specified compute environment.
Parameter catalogId :
The ID of the Data Catalog in which the connection resides. If none is
provided, the Amazon Web Services account ID is used by default.
Parameter hidePassword :
Allows you to retrieve the connection metadata without returning the
password. For instance, the Glue console uses this flag to retrieve the
connection, and does not display the password. Set this parameter when the
caller might not have permission to use the KMS key to decrypt the
password, but it does have permission to access the rest of the connection
properties.
Implementation
Future<GetConnectionResponse> getConnection({
required String name,
ComputeEnvironment? applyOverrideForComputeEnvironment,
String? catalogId,
bool? hidePassword,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSGlue.GetConnection'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'Name': name,
if (applyOverrideForComputeEnvironment != null)
'ApplyOverrideForComputeEnvironment':
applyOverrideForComputeEnvironment.value,
if (catalogId != null) 'CatalogId': catalogId,
if (hidePassword != null) 'HidePassword': hidePassword,
},
);
return GetConnectionResponse.fromJson(jsonResponse.body);
}