-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document API changes supporting new Droplet backup policies (#911)
* droplet: add backup_policy to create requests. * droplet actions: add backup_policy to enable_backups action * droplet actions: add change_backup_policy action * droplet: add /v2/droplets/backups/supported_policies endpoint. * droplet: add /v2/droplets/{droplet_id}/backups/policy endpoint. * Update descriptions for clarity. * droplet: add /v2/droplets/backups/policies endpoint. * Additional examples. * Rename droplet_backup_policy_record
- Loading branch information
1 parent
89f7c8f
commit a6ae557
Showing
18 changed files
with
463 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
specification/resources/droplets/droplets_get_backup_policy.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
operationId: droplets_get_backup_policy | ||
|
||
summary: Retrieve the Backup Policy for an Existing Droplet | ||
|
||
description: | | ||
To show information about an individual Droplet's backup policy, send a GET | ||
request to `/v2/droplets/$DROPLET_ID/backups/policy`. | ||
tags: | ||
- Droplets | ||
|
||
parameters: | ||
- $ref: 'parameters.yml#/droplet_id' | ||
|
||
responses: | ||
'200': | ||
$ref: 'responses/droplet_backup_policy.yml' | ||
|
||
'401': | ||
$ref: '../../shared/responses/unauthorized.yml' | ||
|
||
'404': | ||
$ref: '../../shared/responses/not_found.yml' | ||
|
||
'429': | ||
$ref: '../../shared/responses/too_many_requests.yml' | ||
|
||
'500': | ||
$ref: '../../shared/responses/server_error.yml' | ||
|
||
default: | ||
$ref: '../../shared/responses/unexpected_error.yml' | ||
|
||
x-codeSamples: | ||
- $ref: 'examples/curl/droplets_get_backup_policy.yml' | ||
|
||
security: | ||
- bearer_auth: | ||
- 'droplet:read' |
40 changes: 40 additions & 0 deletions
40
specification/resources/droplets/droplets_list_backup_policies.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
operationId: droplets_list_backup_policies | ||
|
||
summary: List Backup Policies for All Existing Droplets | ||
|
||
description: | | ||
To list information about the backup policies for all Droplets in the account, | ||
send a GET request to `/v2/droplets/backups/policies`. | ||
tags: | ||
- Droplets | ||
|
||
parameters: | ||
- $ref: '../../shared/parameters.yml#/per_page' | ||
- $ref: '../../shared/parameters.yml#/page' | ||
|
||
responses: | ||
'200': | ||
$ref: 'responses/all_droplet_backup_policies.yml' | ||
|
||
'401': | ||
$ref: '../../shared/responses/unauthorized.yml' | ||
|
||
'404': | ||
$ref: '../../shared/responses/not_found.yml' | ||
|
||
'429': | ||
$ref: '../../shared/responses/too_many_requests.yml' | ||
|
||
'500': | ||
$ref: '../../shared/responses/server_error.yml' | ||
|
||
default: | ||
$ref: '../../shared/responses/unexpected_error.yml' | ||
|
||
x-codeSamples: | ||
- $ref: 'examples/curl/droplets_list_backup_policies.yml' | ||
|
||
security: | ||
- bearer_auth: | ||
- 'droplet:read' |
36 changes: 36 additions & 0 deletions
36
specification/resources/droplets/droplets_list_supported_backup_policies.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
operationId: droplets_list_supported_backup_policies | ||
|
||
summary: List Supported Droplet Backup Policies | ||
|
||
description: | | ||
To retrieve a list of all supported Droplet backup policies, send a GET | ||
request to `/v2/droplets/backups/supported_policies`. | ||
tags: | ||
- Droplets | ||
|
||
responses: | ||
'200': | ||
$ref: 'responses/droplets_supported_backup_policies.yml' | ||
|
||
'401': | ||
$ref: '../../shared/responses/unauthorized.yml' | ||
|
||
'404': | ||
$ref: '../../shared/responses/not_found.yml' | ||
|
||
'429': | ||
$ref: '../../shared/responses/too_many_requests.yml' | ||
|
||
'500': | ||
$ref: '../../shared/responses/server_error.yml' | ||
|
||
default: | ||
$ref: '../../shared/responses/unexpected_error.yml' | ||
|
||
x-codeSamples: | ||
- $ref: 'examples/curl/droplets_list_supported_backup_policies.yml' | ||
|
||
security: | ||
- bearer_auth: | ||
- 'droplet:read' |
5 changes: 5 additions & 0 deletions
5
specification/resources/droplets/examples/curl/droplets_get_backup_policy.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
lang: cURL | ||
source: |- | ||
curl -X GET \ | ||
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ | ||
"https://api.digitalocean.com/v2/droplets/3164494/backups/policy" |
5 changes: 5 additions & 0 deletions
5
specification/resources/droplets/examples/curl/droplets_list_backup_policies.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
lang: cURL | ||
source: |- | ||
curl -X GET \ | ||
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ | ||
"https://api.digitalocean.com/v2/droplets/backups/policies" |
5 changes: 5 additions & 0 deletions
5
specification/resources/droplets/examples/curl/droplets_list_supported_backup_policies.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
lang: cURL | ||
source: |- | ||
curl -X GET \ | ||
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ | ||
"https://api.digitalocean.com/v2/droplets/backups/supported_policies" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
specification/resources/droplets/models/droplet_backup_policy.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
type: object | ||
|
||
properties: | ||
plan: | ||
type: string | ||
enum: | ||
- daily | ||
- weekly | ||
example: daily | ||
description: The backup plan used for the Droplet. The plan can be either | ||
`daily` or `weekly`. | ||
|
||
weekday: | ||
type: string | ||
enum: | ||
- SUN | ||
- MON | ||
- TUE | ||
- WED | ||
- THU | ||
- FRI | ||
- SAT | ||
example: SUN | ||
description: The day of the week on which the backup will occur. | ||
|
||
hour: | ||
type: integer | ||
enum: | ||
- 0 | ||
- 4 | ||
- 8 | ||
- 12 | ||
- 16 | ||
- 20 | ||
example: 0 | ||
description: The hour of the day that the backup window will start. | ||
|
||
window_length_hours: | ||
type: integer | ||
readOnly: true | ||
example: 4 | ||
description: The length of the backup window starting from `hour`. | ||
|
||
retention_period_days: | ||
type: integer | ||
readOnly: true | ||
example: 7 | ||
description: The number of days the backup will be retained. |
24 changes: 24 additions & 0 deletions
24
specification/resources/droplets/models/droplet_backup_policy_record.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
type: object | ||
|
||
properties: | ||
droplet_id: | ||
type: integer | ||
example: 7101383 | ||
description: The unique identifier for the Droplet. | ||
|
||
backup_enabled: | ||
type: boolean | ||
example: true | ||
description: A boolean value indicating whether backups are enabled for the | ||
Droplet. | ||
|
||
backup_policy: | ||
allOf: | ||
- $ref: 'droplet_backup_policy.yml' | ||
- description: An object specifying the backup policy for the Droplet. | ||
|
||
next_backup_window: | ||
allOf: | ||
- $ref: 'droplet_next_backup_window.yml' | ||
- description: An object containing keys with the start and end times of the | ||
window during which the backup will occur. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
specification/resources/droplets/models/droplet_next_backup_window.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
type: object | ||
nullable: true | ||
properties: | ||
start: | ||
type: string | ||
format: date-time | ||
example: '2019-12-04T00:00:00Z' | ||
description: A time value given in ISO8601 combined date and time format | ||
specifying the start of the Droplet's backup window. | ||
end: | ||
type: string | ||
format: date-time | ||
example: '2019-12-04T23:00:00Z' | ||
description: A time value given in ISO8601 combined date and time format | ||
specifying the end of the Droplet's backup window. |
39 changes: 39 additions & 0 deletions
39
specification/resources/droplets/models/supported_droplet_backup_policy.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
type: object | ||
|
||
properties: | ||
name: | ||
type: string | ||
example: daily | ||
description: The name of the Droplet backup plan. | ||
|
||
possible_window_starts: | ||
type: array | ||
items: | ||
type: integer | ||
description: | | ||
An array of integers representing the hours of the day that a backup can | ||
start. | ||
example: | ||
- 0 | ||
- 4 | ||
- 8 | ||
- 12 | ||
- 16 | ||
- 20 | ||
|
||
window_length_hours: | ||
type: integer | ||
example: 4 | ||
description: The number of hours that a backup window is open. | ||
|
||
retention_period_days: | ||
type: integer | ||
example: 7 | ||
description: The number of days that a backup will be kept. | ||
|
||
possible_days: | ||
type: array | ||
items: | ||
type: string | ||
example: ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"] | ||
description: The day of the week the backup will occur. |
Oops, something went wrong.