associateSourceResource method
Associates a source resource with a migration task. For example, the source resource can be a source server, an application, or a migration wave.
May throw AccessDeniedException.
May throw DryRunOperation.
May throw InternalServerError.
May throw InvalidInputException.
May throw ResourceNotFoundException.
May throw ServiceUnavailableException.
May throw ThrottlingException.
May throw UnauthorizedOperation.
Parameter migrationTaskName :
A unique identifier that references the migration task. Do not include
sensitive data in this field.
Parameter progressUpdateStream :
The name of the progress-update stream, which is used for access control
as well as a namespace for migration-task names that is implicitly linked
to your AWS account. The progress-update stream must uniquely identify the
migration tool as it is used for all updates made by the tool; however, it
does not need to be unique for each AWS account because it is scoped to
the AWS account.
Parameter sourceResource :
The source resource that you want to associate.
Parameter dryRun :
This is an optional parameter that you can use to test whether the call
will succeed. Set this parameter to true to verify that you
have the permissions that are required to make the call, and that you have
specified the other parameters in the call correctly.
Implementation
Future<void> associateSourceResource({
required String migrationTaskName,
required String progressUpdateStream,
required SourceResource sourceResource,
bool? dryRun,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSMigrationHub.AssociateSourceResource'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'MigrationTaskName': migrationTaskName,
'ProgressUpdateStream': progressUpdateStream,
'SourceResource': sourceResource,
if (dryRun != null) 'DryRun': dryRun,
},
);
}