createApp method
Creates an application. An application consists of one or more server groups. Each server group contain one or more servers.
May throw UnauthorizedOperationException. May throw InvalidParameterException. May throw MissingRequiredParameterException. May throw InternalError. May throw OperationNotPermittedException.
Parameter clientToken
:
A unique, case-sensitive identifier that you provide to ensure the
idempotency of application creation.
Parameter description
:
The description of the new application
Parameter name
:
The name of the new application.
Parameter roleName
:
The name of the service role in the customer's account to be used by AWS
SMS.
Parameter serverGroups
:
The server groups to include in the application.
Parameter tags
:
The tags to be associated with the application.
Implementation
Future<CreateAppResponse> createApp({
String? clientToken,
String? description,
String? name,
String? roleName,
List<ServerGroup>? serverGroups,
List<Tag>? tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSServerMigrationService_V2016_10_24.CreateApp'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
if (clientToken != null) 'clientToken': clientToken,
if (description != null) 'description': description,
if (name != null) 'name': name,
if (roleName != null) 'roleName': roleName,
if (serverGroups != null) 'serverGroups': serverGroups,
if (tags != null) 'tags': tags,
},
);
return CreateAppResponse.fromJson(jsonResponse.body);
}