createSnapshotSchedule method

Future<SnapshotSchedule> createSnapshotSchedule({
  1. bool? dryRun,
  2. int? nextInvocations,
  3. List<String>? scheduleDefinitions,
  4. String? scheduleDescription,
  5. String? scheduleIdentifier,
  6. List<Tag>? tags,
})

Create a snapshot schedule that can be associated to a cluster and which overrides the default system backup schedule.

May throw InvalidScheduleFault. May throw InvalidTagFault. May throw ScheduleDefinitionTypeUnsupportedFault. May throw SnapshotScheduleAlreadyExistsFault. May throw SnapshotScheduleQuotaExceededFault. May throw TagLimitExceededFault.

Parameter dryRun :

Parameter nextInvocations :

Parameter scheduleDefinitions : The definition of the snapshot schedule. The definition is made up of schedule expressions, for example "cron(30 12 *)" or "rate(12 hours)".

Parameter scheduleDescription : The description of the snapshot schedule.

Parameter scheduleIdentifier : A unique identifier for a snapshot schedule. Only alphanumeric characters are allowed for the identifier.

Parameter tags : An optional set of tags you can use to search for the schedule.

Implementation

Future<SnapshotSchedule> createSnapshotSchedule({
  bool? dryRun,
  int? nextInvocations,
  List<String>? scheduleDefinitions,
  String? scheduleDescription,
  String? scheduleIdentifier,
  List<Tag>? tags,
}) async {
  final $request = <String, String>{
    if (dryRun != null) 'DryRun': dryRun.toString(),
    if (nextInvocations != null)
      'NextInvocations': nextInvocations.toString(),
    if (scheduleDefinitions != null)
      if (scheduleDefinitions.isEmpty)
        'ScheduleDefinitions': ''
      else
        for (var i1 = 0; i1 < scheduleDefinitions.length; i1++)
          'ScheduleDefinitions.ScheduleDefinition.${i1 + 1}':
              scheduleDefinitions[i1],
    if (scheduleDescription != null)
      'ScheduleDescription': scheduleDescription,
    if (scheduleIdentifier != null) 'ScheduleIdentifier': scheduleIdentifier,
    if (tags != null)
      if (tags.isEmpty)
        'Tags': ''
      else
        for (var i1 = 0; i1 < tags.length; i1++)
          for (var e3 in tags[i1].toQueryMap().entries)
            'Tags.Tag.${i1 + 1}.${e3.key}': e3.value,
  };
  final $result = await _protocol.send(
    $request,
    action: 'CreateSnapshotSchedule',
    version: '2012-12-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    resultWrapper: 'CreateSnapshotScheduleResult',
  );
  return SnapshotSchedule.fromXml($result);
}