在这里,我正在打印我的快照。我在下面发布了我希望快照打印出来的样子,并且还希望能够打印单个快照。我不确定如何做到这一点,任何帮助都会很棒。
svc := ec2.New(&aws.Config{Region: "us-east-1"})
params := &ec2.DescribeSnapshotsInput{
OwnerIDs: []*string{
aws.String("130300684064"),
},
}
b, err2 := svc.DescribeSnapshots(params)
if err2 != nil {
panic(err2)
}
fmt.Printf(awsutil.StringValue(b))
这是输出的内容:http : //imgur.com/3MnBNXI 这是我想要输出的内容:
{
Snapshots:
----0
Description: "Snapshot from MULTI",
Encrypted: false,
OwnerID: "130300684064",
Progress: "100%!"(MISSING),
SnapshotID: "snap-81b1dff6",
StartTime: 2015-07-21 18:41:54 +0000 UTC,
State: "completed",
VolumeID: "vol-5121ebaa",
VolumeSize: 1
},{
----1
Description: "Snapshot from MULTI",
Encrypted: false,
OwnerID: "130300684064",
Progress: "100%!"(MISSING),
SnapshotID: "snap-08352a7f",
StartTime: 2015-07-21 18:41:54 +0000 UTC,
State: "completed",
VolumeID: "vol-9b21eb60",
VolumeSize: 1
},{
----2
Description: "Snapshot from MULTI",
Encrypted: false,
OwnerID: "130300684064",
Progress: "100%!"(MISSING),
SnapshotID: "snap-768ffb00",
StartTime: 2015-07-21 18:41:54 +0000 UTC,
State: "completed",
VolumeID: "vol-5620eaad",
VolumeSize: 1
}]
完整代码在这里:http : //pastebin.com/QgmV6kRj
湖上湖
相关分类