createBackupPlan method

Future<CreateBackupPlanOutput> createBackupPlan({
  1. required BackupPlanInput backupPlan,
  2. Map<String, String>? backupPlanTags,
  3. String? creatorRequestId,
})

Creates a backup plan using a backup plan name and backup rules. A backup plan is a document that contains information that Backup uses to schedule tasks that create recovery points for resources.

If you call CreateBackupPlan with a plan that already exists, you receive an AlreadyExistsException exception.

May throw AlreadyExistsException. May throw InvalidParameterValueException. May throw LimitExceededException. May throw MissingParameterValueException. May throw ServiceUnavailableException.

Parameter backupPlan : The body of a backup plan. Includes a BackupPlanName and one or more sets of Rules.

Parameter backupPlanTags : The tags to assign to the backup plan.

Parameter creatorRequestId : Identifies the request and allows failed requests to be retried without the risk of running the operation twice. If the request includes a CreatorRequestId that matches an existing backup plan, that plan is returned. This parameter is optional.

If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.

Implementation

Future<CreateBackupPlanOutput> createBackupPlan({
  required BackupPlanInput backupPlan,
  Map<String, String>? backupPlanTags,
  String? creatorRequestId,
}) async {
  final $payload = <String, dynamic>{
    'BackupPlan': backupPlan,
    if (backupPlanTags != null) 'BackupPlanTags': backupPlanTags,
    'CreatorRequestId': creatorRequestId ?? _s.generateIdempotencyToken(),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/backup/plans',
    exceptionFnMap: _exceptionFns,
  );
  return CreateBackupPlanOutput.fromJson(response);
}