/
describe_db_snapshots.go
61 lines (54 loc) · 2.04 KB
/
describe_db_snapshots.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package rds
import (
"encoding/xml"
"time"
)
type DescribeDBSnapshots struct {
DBInstanceIdentifier string `xml:",omitempty"`
DBSnapshotIdentifier string `xml:",omitempty"`
Filters []*Filter `xml:"Filters>member,omitempty"`
Marker string `xml:",omitempty"`
MaxRecords int `xml:",omitempty"`
SnapshotType string `xml:",omitempty"`
}
type DescribeDBSnapshotsResponse struct {
XMLName xml.Name `xml:"DescribeDBSnapshotsResponse"`
DescribeDBSnapshotsResult *DescribeDBSnapshotsResult `xml:"DescribeDBSnapshotsResult"`
}
type DescribeDBSnapshotsResult struct {
Snapshots []*DBSnapshot `xml:"DBSnapshots>DBSnapshot"`
}
type Filter struct {
Name string `xml:",omitempty"`
Values []string `xml:",omitempty"`
}
type DBSnapshot struct {
AllocatedStorage int `xml:",omitempty"`
AvailabilityZone string `xml:",omitempty"`
DBInstanceIdentifier string `xml:",omitempty"`
DBSnapshotIdentifier string `xml:",omitempty"`
Engine string `xml:",omitempty"`
EngineVersion string `xml:",omitempty"`
InstanceCreateTime time.Time `xml:",omitempty"`
Iops int `xml:",omitempty"`
LicenseModel string `xml:",omitempty"`
MasterUsername string `xml:",omitempty"`
OptionGroupName string `xml:",omitempty"`
PercentProgress int `xml:",omitempty"`
Port int `xml:",omitempty"`
SnapshotCreateTime time.Time `xml:",omitempty"`
SnapshotType string `xml:",omitempty"`
SourceRegion string `xml:",omitempty"`
Status string `xml:",omitempty"`
VpcId string `xml:",omitempty"`
}
func (d *DescribeDBSnapshots) Execute(client *Client) (*DescribeDBSnapshotsResponse, error) {
v := newAction("DescribeDBSnapshots")
e := loadValues(v, d)
if e != nil {
return nil, e
}
r := &DescribeDBSnapshotsResponse{}
e = client.loadResource("GET", client.Endpoint()+"?"+v.Encode(), nil, r)
return r, e
}