All Products
Search
Document Center

Cloud Backup:CreateBackupJob

Last Updated:Nov 06, 2024

Creates a backup job.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
hbr:CreateBackupJobcreate
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
JobNamestringNo

The name of the backup job.

k8s-backup-infra-20220131150046-hbr
SourceTypestringYes

The type of the data source. Valid values:

  • ECS_FILE: Elastic Compute Service (ECS) files
  • UDM_ECS: ECS instances
  • CONTAINER: containers
Enumeration Value:
  • UDM_ECS: ECS整机备份.
CONTAINER
RetentionlongYes

The retention period of the backup data. Unit: days.

15
InstanceIdstringNo

This parameter is required only if you set the SourceType parameter to UDM_ECS. This parameter specifies the ID of the Elastic Compute Service (ECS) instance.

i-bp1xxxxxxxxxxxxxxysm
DetailobjectNo

The details about ECS instance backup. The value is a JSON string.

  • doCopy: specifies whether to enable remote replication.

  • destinationRegionId: the destination region for remote replication.

  • destinationRetention: the retention period of the backup point for remote replication.

  • diskIdList: the IDs of the disks that are to be backed up. If this parameter is left empty, all disks are backed up.

  • snapshotGroup: specifies whether to use a snapshot-consistent group. This parameter is valid only if all disks of the ECS instance are Enterprise SSDs (ESSDs).

  • appConsistent: specifies whether to use the application-consistent backup feature. This parameter must be used with the preScriptPath and postScriptPath parameters.

  • preScriptPath: the path to the pre-freeze scripts.

  • postScriptPath: the path to the post-thaw scripts.

  • enableWriters: This parameter is required only if you set the AppConsistent parameter to true. This parameter specifies whether to create application-consistent snapshots.

    • true (default): creates application-consistent snapshots.
    • false: creates file system-consistent snapshots.
  • enableFsFreeze: This parameter is required only if you set the AppConsistent parameter to true. This parameter specifies whether to enable Linux fsfreeze to put file systems into the read-only state before application-consistent snapshots are created. Default value: true.

  • timeoutSeconds: This parameter is required only if you set the AppConsistent parameter to true. This parameter specifies the I/O freeze timeout period. Default value: 30. Unit: seconds.

{ "doCopy": false, "destinationRegionId": "", "destinationRetention": null, "diskIdList": [], "snapshotGroup": false, "appConsistent": false, "enableWriters": true, "preScriptPath": "", "postScriptPath": "", "enableFsFreeze": true, "timeoutInSeconds": 60 }
BackupTypestringNo

The backup type. Valid values:

  • COMPLETE: full backup
  • INCREMENTAL: incremental backup
Enumeration Value:
  • COMPLETE: 全量备份.
INCREMENTAL
VaultIdstringNo

The ID of the backup vault.

v-000xxxxxxxxxxxxxxy1v
SpeedLimitstringNo

This parameter is required only if you set the SourceType parameter to ECS_FILE. This parameter specifies the throttling rules. Format: {start}|{end}|{bandwidth}. Separate multiple throttling rules with vertical bars (|). A specified time range cannot overlap with another time range.

  • start: the start hour.
  • end: the end hour.
  • bandwidth: the bandwidth. Unit: KB/s.
0:24:NaN
OptionsstringNo

This parameter is required only if you set the SourceType parameter to ECS_FILE. This parameter specifies whether to use Windows Volume Shadow Copy Service (VSS) to define a source path.

  • This parameter is available only for Windows ECS instances.
  • If data changes occur in the backup source, the source data must be the same as the data to be backed up before you can set this parameter to ["UseVSS":true].
  • If you use VSS, you cannot back up data from multiple directories.
{"UseVSS":false}
IncludestringNo

This parameter is required only if you set the SourceType parameter to ECS_FILE. This parameter specifies the paths to the files that you want to back up. The value must be 1 to 255 characters in length.

["/home/alice/*.pdf", "/home/bob/*.txt"]
ExcludestringNo

This parameter is required only if you set the SourceType parameter to ECS_FILE. This parameter specifies the paths to the files that are excluded from the backup job. The value must be 1 to 255 characters in length.

["/var", "/proc"]
ClusterIdstringNo

The ID of the cluster.

cl-00068btz******oku
ContainerResourcesstringNo

The cluster resources. This parameter is required only if you set the SourceType parameter to CONTAINER.

[{\"resourceType\":\"PV\",\"backupMethod\":\"FILE\",\"resourceId\":\"674dac6d-74cd-47e9-a675-09e2f10d2c45\",\"resourceInfo\":\"{\\\"pv_name\\\":\\\"nas-650dac6d-74cd-47e9-a675-09e2f10d2c45\\\",\\\"pv_size\\\":\\\"8Gi\\\",\\\"storage_class\\\":\\\"alibabacloud-cnfs-nas\\\",\\\"pvc_name\\\":\\\"data-postgresql-default-0\\\",\\\"namespace\\\":\\\"database\\\"}\",\"host\":\"cn-huhehaote.192.168.13.133\",\"hostPrefix\":\"6f5e758e-8d35-4584-b9ce-8333adfc7547/volumes/kubernetes.io~csi/nas-670dac6d-74cd-47e9-a675-09e2f10d2c45/mount\",\"pvPath\":\"/\"}]
InitiatedByAckbooleanNo

This parameter specifies whether to initiate the request by using Container Service for Kubernetes (ACK). Default value: false.

false
ContainerClusterIdstringNo

The ID of the cluster. This parameter is required only if you set the SourceType parameter to CONTAINER.

cc-000xxxxxxxxxxxxxxi00
CrossAccountTypestringNo

Specifies whether data is backed up within the same Alibaba Cloud account or across Alibaba Cloud accounts. Valid values:

  • SELF_ACCOUNT: Data is backed up within the same Alibaba Cloud account.
  • CROSS_ACCOUNT: Data is backed up across Alibaba Cloud accounts.
SELF_ACCOUNT
CrossAccountUserIdlongNo

The ID of the source Alibaba Cloud account that authorizes the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.

158975xxxxxx4625
CrossAccountRoleNamestringNo

The name of the RAM role that is created within the source Alibaba Cloud account and assigned to the current Alibaba Cloud account to authorize the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.

BackupRole

Response parameters

ParameterTypeDescriptionExample
object
Codestring

The HTTP status code. The status code 200 indicates that the request was successful.

200
Messagestring

The returned message. If the request was successful, "successful" is returned. If the request failed, an error message is returned.

successful
RequestIdstring

The request ID.

25F49E7B-7E39-542E-83AD-62E6E7F73786
Successboolean

Indicates whether the request was successful. Valid values:

  • true
  • false
true
JobIdstring

The ID of the backup job.

job-000csy09q50a2jdcbwbo

Examples

Sample success responses

JSONformat

{
  "Code": "200",
  "Message": "successful",
  "RequestId": "25F49E7B-7E39-542E-83AD-62E6E7F73786",
  "Success": true,
  "JobId": "job-000csy09q50a2jdcbwbo"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history