yunify / qingcloud-sdk-go

The official QingCloud SDK for the Go programming language.
Apache License 2.0
29 stars 42 forks source link

Add zone in CreateVolumeFromSnapshotInput and CreateVolumeInput #133

Closed wnxn closed 5 years ago

wnxn commented 5 years ago

We can specify zone id when calling create-volume-from-snapshot in QingCloud CLI. The zone parameter is useful in region.

# qingcloud iaas create-volume-from-snapshot -h
usage: qingcloud iaas create-volume-from-snapshot -s "snapshot_id" -n <name> [-f <conf_file>]

Create volume from snapshot.

optional arguments:
  -h, --help            show this help message and exit
  -z ZONE, --zone ZONE  the ID of zone you want to access, this will override
                        zone ID in config file.
  -f CONF_FILE, --config CONF_FILE
                        config file of your access keys
  -s SNAPSHOT, --snapshot SNAPSHOT
                        the ID of snapshot you want to create volume from it.
  -N VOLUME_NAME, --volume-name VOLUME_NAME
                        the name of new volume.
root@i-anqp0nl8:~# qingcloud iaas create-volume-from-snapshot -s ss-8s3hc65p -z pek3c -N 3c
{
  "action": "CreateVolumeFromSnapshotResponse", 
  "ret_code": 0, 
  "job_id": "j-7rxoc2qarjy", 
  "volume_id": "vol-r2bcnodc"
}
root@i-anqp0nl8:~# qingcloud iaas create-volume-from-snapshot -s ss-8s3hc65p -z pek3d -N 3d
{
  "action": "CreateVolumeFromSnapshotResponse", 
  "ret_code": 0, 
  "job_id": "j-0z5jmby7wuj", 
  "volume_id": "vol-mlg1vavl"
}

Would you please add zone in CreateVolumeFromSnapshotInput and CreateVolumeInput? https://github.com/yunify/qingcloud-sdk-go/blob/ac222d4999629785bf5ca28344fadd65d9d5efb3/service/snapshot.go#L251-L254

huyujie commented 5 years ago

136 has support.