yunify / qingcloud-sdk-go

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

Support volume in SnapshotResource #129

Closed wnxn closed 5 years ago

wnxn commented 5 years ago

After asking with Cipher, user can get original volume size at snapshot_resource.size when enabling verbose mode in describe snapshot. But, our go sdk cannot support volume in snapshot resource. Will you please support volume in snapshot resource?

$ qingcloud iaas describe-snapshots -n ss-y09nkhe0 -V 1
{
  "action": "DescribeSnapshotsResponse", 
  "snapshot_set": [
    {
      "is_taken": 1, 
      "resource_id": "vol-td7o17gg", 
      "backstore_type": 1, 
      "head_chain": 1, 
      "console_id": "qingcloud", 
      "snapshot_name": "test", 
      "raw_size": 1, 
      "snapshot_id": "ss-y09nkhe0", 
      "owner": "usr-kylwuKxL", 
      "x_resource_id": "", 
      "size": 10240, 
      "virtual_size": 10240, 
      "total_size": 10240, 
      "sub_code": 0, 
      "snapshot_mode": "zfs", 
      "parent_id": "self", 
      "provider": "self", 
      "status_time": "2019-07-08T02:55:38Z", 
      "status": "available", 
      "description": null, 
      "root_id": "ss-y09nkhe0", 
      "transition_status": "", 
      "snapshot_repl_info": {
        "ap2a": 2
      }, 
      "visibility": "private", 
      "image_id": "", 
      "controller": "self", 
      "total_store_size": 1, 
      "store_size": 1, 
      "tags": [], 
      "snapshot_time": "2019-07-08T02:55:27Z", 
      "resource": {
        "resource_name": "test", 
        "resource_type": "volume", 
        "resource_id": "vol-td7o17gg"
      }, 
      "is_head": 1, 
      "sub_id": "", 
      "total_count": 1, 
      "snapshot_resource": {
        "mount_point": "", 
        "volume_id": "vol-td7o17gg", 
        "volume_type": 100, 
        "mount_options": "", 
        "filesystem": "", 
        "size": 10, 
        "architecture": "hp"
      }, 
      "snapshot_type": 1, 
      "lastest_snapshot_time": "2019-07-08T02:55:27Z", 
      "root_user_id": "usr-kylwuKxL", 
      "create_time": "2019-07-08T02:55:38Z", 
      "store_splits": 1, 
      "resource_project_info": []
    }
  ], 
  "ret_code": 0, 
  "total_count": 1
}

https://github.com/yunify/qingcloud-sdk-go/blob/c8f8d40dd4793219c129b7516d6f8ae130bc83c9/service/types.go#L2901-L2904