Updates a backup plan.

Request parameters

Parameter Type Required Example Description
Action String Yes UpdateBackupPlan

The operation that you want to perform. Set the value to UpdateBackupPlan.

PlanId String Yes plan-20211***735

The ID of the backup plan.

PlanName String No planname

The name of the backup plan.

Schedule String No I|1602673264|P1D

The backup policy. Format: I|{startTime}|{interval}. The expression specifies that the system runs the first backup job at a point in time that is specified in the {startTime} parameter and the subsequent backup jobs at an interval that is specified in the {interval} parameter. The system does not run a backup job before the specified point in time. Each backup job, except the first one, starts only after the previous backup job is complete. For example, I|1631685600|P1D specifies that the system runs the first backup job at 2021-09-15 14:00:00 and the subsequent backup jobs once a day.

  • startTime: the time at which the system starts to run a backup job. The time follows the UNIX time format. Unit: seconds.
  • interval: the interval at which the system runs a backup job. The interval must follow the ISO8601 standard. For example, PT1H indicates an interval of 1 hour. P1D indicates an interval of one day.
Retention Long Yes 7

The retention period of the backup plan. Maximum value: 1. Unit: days.

Prefix String No oss-prefix

This parameter is required only if the SourceType parameter is set to OSS. This parameter specifies a prefix. After a prefix is specified, only objects whose names start with the prefix are backed up.

VaultId String Yes v-0006******q

The ID of the backup vault.

SourceType String No ECS_FILE

The type of the data source. Valid values:

  • ECS_FILE: The system backs up data from Elastic Compute Service (ECS) instances.
  • OSS: The system backs up data from Object Storage Service (OSS) buckets.
  • NAS: The system backs up data from Apsara File Storage NAS file systems.
SpeedLimit String No 0:24:5120

This parameter is required only if the SourceType parameter is set to ECS_FILE. This parameter indicates the throttling rules. You can limit the bandwidth that is used for data backup during peak hours to ensure business continuity. Format: {start}|{end}|{bandwidth}. Multiple throttling rules are separated with vertical bars (<codeph>|</codeph>). A specified time range cannot overlap with another time range.

  • start: the start time
  • end: the end time
  • bandwidth: bandwidth. Unit: KB per second
Include String No ["/home/alice/*.pdf", "/home/bob/*.txt"]

This parameter is required only if the SourceType parameter is set 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.

Exclude String No ["/var", "/proc"]

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

Options String No null

This parameter is required only if the SourceType parameter is set to ECS_FILE. This parameter specifies whether to use Windows VSS to define a backup 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 that you want to back up before you set this parameter to ["UseVSS":true].
  • If you use VSS, you cannot back up data from multiple directories.
UpdatePaths Boolean No false

Specifies whether to update the backup path if the backup path is empty. Valid values:

  • true: The system replaces the original backup path with the specified backup path.
  • false: The system does not update the original backup path. The system backs up data based on the backup path that you specified when you created the backup plan.
Path.N String No ["/home"]

The backup path. The value must be 1 to 65,536 characters in length.

Specify paths based on the following rules:

  • If the source path does not contain an asterisk (*) wildcard, you can enter up to eight source paths.
  • If the source path contains an asterisk (*) wildcard, you can enter only a single path. The path can be in the /*/* format.
  • Only absolute paths are supported.
  • If VSS backup is used, you can enter only one path. UNC paths and wildcards (*) are not supported. You cannot exclude files from the backup plan.
  • If UNC paths are used, VSS paths and wildcards (*) are not supported. You cannot exclude files from the backup plan. If a UNC path is specified, HBR does not back up the access control list (ACL) of Windows.

Response parameters

Parameter Type Example Description
Code String 200

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

Message String successful

The message that is returned. If the request is successful, a value of successful is returned. If the request fails, an error message is returned.

RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the instance.

Success Boolean true

Indicates whether the request is successful. Valid values:

  • true: The request is successful.
  • false: The request failed.

Examples

Sample requests

http(s)://[Endpoint]/?Action=UpdateBackupPlan
&PlanId=plan-20211***735
&PlanName=planname
&Schedule=I|1602673264|P1D
&Retention=7
&Prefix=oss-prefix
&VaultId=v-0006******q
&SourceType=ECS_FILE
&SpeedLimit=0:24:5120
&Include=["/home/alice/*.pdf", "/home/bob/*.txt"]
&Exclude=["/var", "/proc"]
&Options={"UseVSS":false}
&UpdatePaths=false
&Path=["[\"/home\"]"]
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<UpdateBackupPlanResponse>
    <Code>200</Code>
    <Message>successful</Message>
    <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
    <Success>true</Success>
</UpdateBackupPlanResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Code" : "200",
  "Message" : "successful",
  "RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "Success" : true
}

Error codes

For a list of error codes, visit the API Error Center.