createDataSource method
- required String domainIdentifier,
- required String name,
- required String projectIdentifier,
- required String type,
- List<
FormInput> ? assetFormsInput, - String? clientToken,
- DataSourceConfigurationInput? configuration,
- String? connectionIdentifier,
- String? description,
- EnableSetting? enableSetting,
- String? environmentIdentifier,
- bool? publishOnImport,
- RecommendationConfiguration? recommendation,
- ScheduleConfiguration? schedule,
Creates an Amazon DataZone data source.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter domainIdentifier :
The ID of the Amazon DataZone domain where the data source is created.
Parameter name :
The name of the data source.
Parameter projectIdentifier :
The identifier of the Amazon DataZone project in which you want to add
this data source.
Parameter type :
The type of the data source. In Amazon DataZone, you can use data sources
to import technical metadata of assets (data) from the source databases or
data warehouses into Amazon DataZone. In the current release of Amazon
DataZone, you can create and run data sources for Amazon Web Services Glue
and Amazon Redshift.
Parameter assetFormsInput :
The metadata forms that are to be attached to the assets that this data
source works with.
Parameter clientToken :
A unique, case-sensitive identifier that is provided to ensure the
idempotency of the request.
Parameter configuration :
Specifies the configuration of the data source. It can be set to either
glueRunConfiguration or
redshiftRunConfiguration.
Parameter connectionIdentifier :
The ID of the connection.
Parameter description :
The description of the data source.
Parameter enableSetting :
Specifies whether the data source is enabled.
Parameter environmentIdentifier :
The unique identifier of the Amazon DataZone environment to which the data
source publishes assets.
Parameter publishOnImport :
Specifies whether the assets that this data source creates in the
inventory are to be also automatically published to the catalog.
Parameter recommendation :
Specifies whether the business name generation is to be enabled for this
data source.
Parameter schedule :
The schedule of the data source runs.
Implementation
Future<CreateDataSourceOutput> createDataSource({
required String domainIdentifier,
required String name,
required String projectIdentifier,
required String type,
List<FormInput>? assetFormsInput,
String? clientToken,
DataSourceConfigurationInput? configuration,
String? connectionIdentifier,
String? description,
EnableSetting? enableSetting,
String? environmentIdentifier,
bool? publishOnImport,
RecommendationConfiguration? recommendation,
ScheduleConfiguration? schedule,
}) async {
final $payload = <String, dynamic>{
'name': name,
'projectIdentifier': projectIdentifier,
'type': type,
if (assetFormsInput != null) 'assetFormsInput': assetFormsInput,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (configuration != null) 'configuration': configuration,
if (connectionIdentifier != null)
'connectionIdentifier': connectionIdentifier,
if (description != null) 'description': description,
if (enableSetting != null) 'enableSetting': enableSetting.value,
if (environmentIdentifier != null)
'environmentIdentifier': environmentIdentifier,
if (publishOnImport != null) 'publishOnImport': publishOnImport,
if (recommendation != null) 'recommendation': recommendation,
if (schedule != null) 'schedule': schedule,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/v2/domains/${Uri.encodeComponent(domainIdentifier)}/data-sources',
exceptionFnMap: _exceptionFns,
);
return CreateDataSourceOutput.fromJson(response);
}