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 AWS Backup uses to schedule tasks that create recovery points for resources.

If you call CreateBackupPlan with a plan that already exists, an AlreadyExistsException is returned.

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

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

Parameter backupPlanTags : To help organize your resources, you can assign your own metadata to the resources that you create. Each tag is a key-value pair. The specified tags are assigned to all backups created with this 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.

Implementation

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