createConnection method
Creates a connection definition in the Data Catalog.
May throw AlreadyExistsException. May throw InvalidInputException. May throw OperationTimeoutException. May throw ResourceNumberLimitExceededException. May throw GlueEncryptionException.
Parameter connectionInput
:
A ConnectionInput
object defining the connection to create.
Parameter catalogId
:
The ID of the Data Catalog in which to create the connection. If none is
provided, the AWS account ID is used by default.
Implementation
Future<void> createConnection({
required ConnectionInput connectionInput,
String? catalogId,
}) async {
ArgumentError.checkNotNull(connectionInput, 'connectionInput');
_s.validateStringLength(
'catalogId',
catalogId,
1,
255,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSGlue.CreateConnection'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ConnectionInput': connectionInput,
if (catalogId != null) 'CatalogId': catalogId,
},
);
}