createApplication method
- required String appBlockArn,
- required S3Location iconS3Location,
- required List<
String> instanceFamilies, - required String launchPath,
- required String name,
- required List<
PlatformType> platforms, - String? description,
- String? displayName,
- String? launchParameters,
- Map<
String, String> ? tags, - String? workingDirectory,
Creates an application.
Applications are a WorkSpaces Applications resource that stores the details about how to launch applications on Elastic fleet streaming instances. An application consists of the launch details, icon, and display name. Applications are associated with an app block that contains the application binaries and other files. The applications assigned to an Elastic fleet are the applications users can launch.
This is only supported for Elastic fleets.
May throw ConcurrentModificationException.
May throw LimitExceededException.
May throw OperationNotPermittedException.
May throw ResourceAlreadyExistsException.
May throw ResourceNotFoundException.
Parameter appBlockArn :
The app block ARN to which the application should be associated
Parameter iconS3Location :
The location in S3 of the application icon.
Parameter instanceFamilies :
The instance families the application supports. Valid values are
GENERAL_PURPOSE and GRAPHICS_G4.
Parameter launchPath :
The launch path of the application.
Parameter name :
The name of the application. This name is visible to users when display
name is not specified.
Parameter platforms :
The platforms the application supports. WINDOWS_SERVER_2019, AMAZON_LINUX2
and UBUNTU_PRO_2404 are supported for Elastic fleets.
Parameter description :
The description of the application.
Parameter displayName :
The display name of the application. This name is visible to users in the
application catalog.
Parameter launchParameters :
The launch parameters of the application.
Parameter tags :
The tags assigned to the application.
Parameter workingDirectory :
The working directory of the application.
Implementation
Future<CreateApplicationResult> createApplication({
required String appBlockArn,
required S3Location iconS3Location,
required List<String> instanceFamilies,
required String launchPath,
required String name,
required List<PlatformType> platforms,
String? description,
String? displayName,
String? launchParameters,
Map<String, String>? tags,
String? workingDirectory,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'PhotonAdminProxyService.CreateApplication'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'AppBlockArn': appBlockArn,
'IconS3Location': iconS3Location,
'InstanceFamilies': instanceFamilies,
'LaunchPath': launchPath,
'Name': name,
'Platforms': platforms.map((e) => e.value).toList(),
if (description != null) 'Description': description,
if (displayName != null) 'DisplayName': displayName,
if (launchParameters != null) 'LaunchParameters': launchParameters,
if (tags != null) 'Tags': tags,
if (workingDirectory != null) 'WorkingDirectory': workingDirectory,
},
);
return CreateApplicationResult.fromJson(jsonResponse.body);
}