createSchedulingPolicy method
Creates an Batch scheduling policy.
May throw ClientException.
May throw ServerException.
Parameter name :
The name of the fair-share scheduling policy. It can be up to 128 letters
long. It can contain uppercase and lowercase letters, numbers, hyphens
(-), and underscores (_).
Parameter fairsharePolicy :
The fair-share scheduling policy details. Only one of fairsharePolicy or
quotaSharePolicy can be set. Once set, this policy type cannot be removed
or changed to a quotaSharePolicy.
Parameter quotaSharePolicy :
The quota share scheduling policy details. Only one of fairsharePolicy or
quotaSharePolicy can be set. Once set, this policy type cannot be removed
or changed to a fairSharePolicy.
Parameter tags :
The tags that you apply to the scheduling policy to help you categorize
and organize your resources. Each tag consists of a key and an optional
value. For more information, see Tagging
Amazon Web Services Resources in Amazon Web Services General
Reference.
These tags can be updated or removed using the TagResource and UntagResource API operations.
Implementation
Future<CreateSchedulingPolicyResponse> createSchedulingPolicy({
required String name,
FairsharePolicy? fairsharePolicy,
QuotaSharePolicy? quotaSharePolicy,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'name': name,
if (fairsharePolicy != null) 'fairsharePolicy': fairsharePolicy,
if (quotaSharePolicy != null) 'quotaSharePolicy': quotaSharePolicy,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/v1/createschedulingpolicy',
exceptionFnMap: _exceptionFns,
);
return CreateSchedulingPolicyResponse.fromJson(response);
}