Skip to content

Commit

Permalink
Merge pull request #285 from lgarber-akamai/new/add-backup-avail
Browse files Browse the repository at this point in the history
new: Add `available` field to instance and backup responses
  • Loading branch information
lgarber-akamai authored Dec 19, 2022
2 parents 9bdc582 + 93940d4 commit 089fc9f
Show file tree
Hide file tree
Showing 4 changed files with 225 additions and 260 deletions.
19 changes: 10 additions & 9 deletions instance_snapshots.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@ type RestoreInstanceOptions struct {

// InstanceSnapshot represents a linode backup snapshot
type InstanceSnapshot struct {
ID int `json:"id"`
Label string `json:"label"`
Status InstanceSnapshotStatus `json:"status"`
Type string `json:"type"`
Created *time.Time `json:"-"`
Updated *time.Time `json:"-"`
Finished *time.Time `json:"-"`
Configs []string `json:"configs"`
Disks []*InstanceSnapshotDisk `json:"disks"`
ID int `json:"id"`
Label string `json:"label"`
Status InstanceSnapshotStatus `json:"status"`
Type string `json:"type"`
Created *time.Time `json:"-"`
Updated *time.Time `json:"-"`
Finished *time.Time `json:"-"`
Configs []string `json:"configs"`
Disks []*InstanceSnapshotDisk `json:"disks"`
Available bool `json:"available"`
}

// InstanceSnapshotDisk fields represent the source disk of a Snapshot
Expand Down
5 changes: 3 additions & 2 deletions instances.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ type InstanceAlert struct {

// InstanceBackup represents backup settings for an instance
type InstanceBackup struct {
Enabled bool `json:"enabled,omitempty"`
Schedule struct {
Available bool `json:"available,omitempty"` // read-only
Enabled bool `json:"enabled,omitempty"` // read-only
Schedule struct {
Day string `json:"day,omitempty"`
Window string `json:"window,omitempty"`
} `json:"schedule,omitempty"`
Expand Down
Loading

0 comments on commit 089fc9f

Please sign in to comment.