addWorkload method
Adds a workload to a component. Each component can have at most five workloads.
May throw InternalServerException.
May throw ResourceInUseException.
May throw ResourceNotFoundException.
May throw ValidationException.
Parameter componentName :
The name of the component.
Parameter resourceGroupName :
The name of the resource group.
Parameter workloadConfiguration :
The configuration settings of the workload. The value is the escaped JSON
of the configuration.
Implementation
Future<AddWorkloadResponse> addWorkload({
required String componentName,
required String resourceGroupName,
required WorkloadConfiguration workloadConfiguration,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'EC2WindowsBarleyService.AddWorkload'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ComponentName': componentName,
'ResourceGroupName': resourceGroupName,
'WorkloadConfiguration': workloadConfiguration,
},
);
return AddWorkloadResponse.fromJson(jsonResponse.body);
}