Beispiel #1
0
func snapshot(e *ec2.EC2, args ...string) {
	if len(args) != 2 {
		fmt.Fprintf(os.Stderr, "snapshot: need image id and description\n")
		os.Exit(1)
	}

	resp, err := e.CreateSnapshot(args[0], args[1])
	if err != nil {
		fmt.Fprintf(os.Stderr, "snapshot: %s\n", err)
		os.Exit(1)
	}
	fmt.Printf("%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n",
		resp.Id,
		resp.VolumeId,
		resp.Status,
		resp.StartTime,
		resp.Progress,
		resp.OwnerId,
		resp.VolumeSize,
		resp.Description,
		resp.OwnerAlias,
	)

}