Retrieve the Backup Policy for an Existing Droplet
client.GPUDroplets.Backups.GetPolicy(ctx, dropletID) (*GPUDropletBackupGetPolicyResponse, error)
/v2/droplets/{droplet_id}/backups/policy
To show information about an individual Droplet's backup policy, send a GET
request to /v2/droplets/$DROPLET_ID/backups/policy.
Parameters
dropletID int64
minimum1
Returns
Retrieve the Backup Policy for an Existing Droplet
package main
import (
"context"
"fmt"
"github.com/stainless-sdks/-go"
"github.com/stainless-sdks/-go/option"
)
func main() {
client := gradient.NewClient(
option.WithAccessToken("My Access Token"),
)
response, err := client.GPUDroplets.Backups.GetPolicy(context.TODO(), int64(3164444))
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Policy)
}
{
"policy": {
"backup_enabled": true,
"backup_policy": {
"hour": 0,
"plan": "daily",
"retention_period_days": 7,
"weekday": "SUN",
"window_length_hours": 4
},
"droplet_id": 7101383,
"next_backup_window": {
"end": "2019-12-04T23:00:00Z",
"start": "2019-12-04T00:00:00Z"
}
}
}Returns Examples
{
"policy": {
"backup_enabled": true,
"backup_policy": {
"hour": 0,
"plan": "daily",
"retention_period_days": 7,
"weekday": "SUN",
"window_length_hours": 4
},
"droplet_id": 7101383,
"next_backup_window": {
"end": "2019-12-04T23:00:00Z",
"start": "2019-12-04T00:00:00Z"
}
}
}