updateScalingPlan method

Future<void> updateScalingPlan({
  1. required String scalingPlanName,
  2. required int scalingPlanVersion,
  3. ApplicationSource? applicationSource,
  4. List<ScalingInstruction>? scalingInstructions,
})

Updates the specified scaling plan.

You cannot update a scaling plan if it is in the process of being created, updated, or deleted.

May throw ValidationException. May throw ConcurrentUpdateException. May throw InternalServiceException. May throw ObjectNotFoundException.

Parameter scalingPlanName : The name of the scaling plan.

Parameter scalingPlanVersion : The version number of the scaling plan.

Parameter applicationSource : A CloudFormation stack or set of tags.

Parameter scalingInstructions : The scaling instructions.

Implementation

Future<void> updateScalingPlan({
  required String scalingPlanName,
  required int scalingPlanVersion,
  ApplicationSource? applicationSource,
  List<ScalingInstruction>? scalingInstructions,
}) async {
  ArgumentError.checkNotNull(scalingPlanName, 'scalingPlanName');
  _s.validateStringLength(
    'scalingPlanName',
    scalingPlanName,
    1,
    128,
    isRequired: true,
  );
  ArgumentError.checkNotNull(scalingPlanVersion, 'scalingPlanVersion');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AnyScaleScalingPlannerFrontendService.UpdateScalingPlan'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ScalingPlanName': scalingPlanName,
      'ScalingPlanVersion': scalingPlanVersion,
      if (applicationSource != null) 'ApplicationSource': applicationSource,
      if (scalingInstructions != null)
        'ScalingInstructions': scalingInstructions,
    },
  );
}