fog-aliyun 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +23 -10
  3. data/.rubocop.yml +31 -4
  4. data/.rubocop_todo.yml +83 -55
  5. data/Gemfile +2 -0
  6. data/Rakefile +2 -0
  7. data/bin/console +4 -3
  8. data/fog-aliyun.gemspec +19 -18
  9. data/lib/fog/aliyun.rb +4 -2
  10. data/lib/fog/aliyun/compute.rb +45 -43
  11. data/lib/fog/aliyun/models/compute/eip_address.rb +10 -8
  12. data/lib/fog/aliyun/models/compute/eip_addresses.rb +3 -3
  13. data/lib/fog/aliyun/models/compute/image.rb +23 -21
  14. data/lib/fog/aliyun/models/compute/images.rb +2 -0
  15. data/lib/fog/aliyun/models/compute/route_entry.rb +7 -5
  16. data/lib/fog/aliyun/models/compute/route_entrys.rb +2 -0
  17. data/lib/fog/aliyun/models/compute/route_table.rb +6 -4
  18. data/lib/fog/aliyun/models/compute/route_tables.rb +3 -3
  19. data/lib/fog/aliyun/models/compute/security_group.rb +7 -5
  20. data/lib/fog/aliyun/models/compute/security_group_rule.rb +15 -13
  21. data/lib/fog/aliyun/models/compute/security_group_rules.rb +2 -0
  22. data/lib/fog/aliyun/models/compute/security_groups.rb +2 -0
  23. data/lib/fog/aliyun/models/compute/server.rb +28 -26
  24. data/lib/fog/aliyun/models/compute/servers.rb +3 -3
  25. data/lib/fog/aliyun/models/compute/snapshot.rb +12 -10
  26. data/lib/fog/aliyun/models/compute/snapshots.rb +2 -0
  27. data/lib/fog/aliyun/models/compute/volume.rb +27 -25
  28. data/lib/fog/aliyun/models/compute/volumes.rb +2 -0
  29. data/lib/fog/aliyun/models/compute/vpc.rb +12 -10
  30. data/lib/fog/aliyun/models/compute/vpcs.rb +3 -3
  31. data/lib/fog/aliyun/models/compute/vrouter.rb +8 -6
  32. data/lib/fog/aliyun/models/compute/vrouters.rb +3 -3
  33. data/lib/fog/aliyun/models/compute/vswitch.rb +11 -9
  34. data/lib/fog/aliyun/models/compute/vswitches.rb +3 -3
  35. data/lib/fog/aliyun/models/storage/directories.rb +3 -1
  36. data/lib/fog/aliyun/models/storage/directory.rb +2 -0
  37. data/lib/fog/aliyun/models/storage/file.rb +18 -16
  38. data/lib/fog/aliyun/models/storage/files.rb +13 -19
  39. data/lib/fog/aliyun/requests/compute/allocate_eip_address.rb +5 -3
  40. data/lib/fog/aliyun/requests/compute/allocate_public_ip_address.rb +4 -2
  41. data/lib/fog/aliyun/requests/compute/associate_eip_address.rb +4 -2
  42. data/lib/fog/aliyun/requests/compute/attach_disk.rb +7 -5
  43. data/lib/fog/aliyun/requests/compute/create_disk.rb +15 -13
  44. data/lib/fog/aliyun/requests/compute/create_image.rb +3 -1
  45. data/lib/fog/aliyun/requests/compute/create_security_group.rb +11 -9
  46. data/lib/fog/aliyun/requests/compute/create_security_group_egress_ip_rule.rb +13 -11
  47. data/lib/fog/aliyun/requests/compute/create_security_group_egress_sg_rule.rb +12 -10
  48. data/lib/fog/aliyun/requests/compute/create_security_group_ip_rule.rb +13 -11
  49. data/lib/fog/aliyun/requests/compute/create_security_group_sg_rule.rb +12 -10
  50. data/lib/fog/aliyun/requests/compute/create_server.rb +11 -9
  51. data/lib/fog/aliyun/requests/compute/create_snapshot.rb +3 -1
  52. data/lib/fog/aliyun/requests/compute/create_vpc.rb +6 -4
  53. data/lib/fog/aliyun/requests/compute/create_vpn_connection.rb +8 -6
  54. data/lib/fog/aliyun/requests/compute/create_vpn_customergateway.rb +6 -6
  55. data/lib/fog/aliyun/requests/compute/create_vswitch.rb +6 -4
  56. data/lib/fog/aliyun/requests/compute/delete_disk.rb +8 -6
  57. data/lib/fog/aliyun/requests/compute/delete_image.rb +3 -1
  58. data/lib/fog/aliyun/requests/compute/delete_security_group.rb +7 -5
  59. data/lib/fog/aliyun/requests/compute/delete_security_group_egress_ip_rule.rb +13 -11
  60. data/lib/fog/aliyun/requests/compute/delete_security_group_egress_sg_rule.rb +12 -10
  61. data/lib/fog/aliyun/requests/compute/delete_security_group_ip_rule.rb +13 -11
  62. data/lib/fog/aliyun/requests/compute/delete_security_group_sg_rule.rb +12 -10
  63. data/lib/fog/aliyun/requests/compute/delete_server.rb +2 -0
  64. data/lib/fog/aliyun/requests/compute/delete_snapshot.rb +3 -1
  65. data/lib/fog/aliyun/requests/compute/delete_vpc.rb +6 -4
  66. data/lib/fog/aliyun/requests/compute/delete_vpn_connection.rb +6 -4
  67. data/lib/fog/aliyun/requests/compute/delete_vpn_customergateway.rb +6 -4
  68. data/lib/fog/aliyun/requests/compute/delete_vswitch.rb +6 -4
  69. data/lib/fog/aliyun/requests/compute/detach_disk.rb +6 -4
  70. data/lib/fog/aliyun/requests/compute/join_security_group.rb +2 -0
  71. data/lib/fog/aliyun/requests/compute/leave_security_group.rb +2 -0
  72. data/lib/fog/aliyun/requests/compute/list_disks.rb +5 -3
  73. data/lib/fog/aliyun/requests/compute/list_eip_addresses.rb +5 -3
  74. data/lib/fog/aliyun/requests/compute/list_images.rb +5 -3
  75. data/lib/fog/aliyun/requests/compute/list_route_tables.rb +6 -4
  76. data/lib/fog/aliyun/requests/compute/list_security_group_rules.rb +7 -5
  77. data/lib/fog/aliyun/requests/compute/list_security_groups.rb +10 -8
  78. data/lib/fog/aliyun/requests/compute/list_server_types.rb +8 -6
  79. data/lib/fog/aliyun/requests/compute/list_servers.rb +4 -2
  80. data/lib/fog/aliyun/requests/compute/list_snapshots.rb +4 -2
  81. data/lib/fog/aliyun/requests/compute/list_vpcs.rb +5 -3
  82. data/lib/fog/aliyun/requests/compute/list_vpn_connections.rb +49 -49
  83. data/lib/fog/aliyun/requests/compute/list_vpn_customergateways.rb +42 -43
  84. data/lib/fog/aliyun/requests/compute/list_vpn_gateways.rb +49 -49
  85. data/lib/fog/aliyun/requests/compute/list_vrouters.rb +6 -4
  86. data/lib/fog/aliyun/requests/compute/list_vswitchs.rb +6 -4
  87. data/lib/fog/aliyun/requests/compute/list_zones.rb +3 -1
  88. data/lib/fog/aliyun/requests/compute/modify_vpc.rb +7 -5
  89. data/lib/fog/aliyun/requests/compute/modify_vswitch.rb +6 -4
  90. data/lib/fog/aliyun/requests/compute/reboot_server.rb +2 -0
  91. data/lib/fog/aliyun/requests/compute/release_eip_address.rb +4 -2
  92. data/lib/fog/aliyun/requests/compute/start_server.rb +9 -7
  93. data/lib/fog/aliyun/requests/compute/stop_server.rb +9 -7
  94. data/lib/fog/aliyun/requests/compute/unassociate_eip_address.rb +4 -2
  95. data/lib/fog/aliyun/requests/storage/copy_object.rb +3 -2
  96. data/lib/fog/aliyun/requests/storage/delete_bucket.rb +3 -2
  97. data/lib/fog/aliyun/requests/storage/delete_container.rb +3 -2
  98. data/lib/fog/aliyun/requests/storage/delete_object.rb +4 -3
  99. data/lib/fog/aliyun/requests/storage/get_bucket.rb +6 -11
  100. data/lib/fog/aliyun/requests/storage/get_container.rb +3 -2
  101. data/lib/fog/aliyun/requests/storage/get_containers.rb +3 -2
  102. data/lib/fog/aliyun/requests/storage/get_object.rb +4 -3
  103. data/lib/fog/aliyun/requests/storage/get_object_http_url.rb +5 -4
  104. data/lib/fog/aliyun/requests/storage/get_object_https_url.rb +5 -4
  105. data/lib/fog/aliyun/requests/storage/head_object.rb +3 -2
  106. data/lib/fog/aliyun/requests/storage/list_buckets.rb +3 -2
  107. data/lib/fog/aliyun/requests/storage/list_objects.rb +5 -4
  108. data/lib/fog/aliyun/requests/storage/put_bucket.rb +3 -2
  109. data/lib/fog/aliyun/requests/storage/put_container.rb +3 -2
  110. data/lib/fog/aliyun/requests/storage/put_object.rb +12 -17
  111. data/lib/fog/aliyun/storage.rb +41 -52
  112. data/lib/fog/aliyun/version.rb +3 -1
  113. data/lib/fog/bin/aliyun.rb +10 -7
  114. metadata +37 -37
@@ -1,18 +1,20 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fog/core/model'
2
4
  module Fog
3
5
  module Compute
4
6
  class Aliyun
5
7
  class EipAddress < Fog::Model
6
- identity :id, aliases: 'AllocationId'
8
+ identity :id, aliases: 'AllocationId'
7
9
 
8
- attribute :allocated_at, aliases: 'AllocationTime'
9
- attribute :bandwidth, aliases: 'Bandwidth'
10
- attribute :server_id, aliases: 'InstanceId'
11
- attribute :charge_type, aliases: 'InternetChargeType'
12
- attribute :ip_address, aliases: %w(IpAddress EipAddress)
10
+ attribute :allocated_at, aliases: 'AllocationTime'
11
+ attribute :bandwidth, aliases: 'Bandwidth'
12
+ attribute :server_id, aliases: 'InstanceId'
13
+ attribute :charge_type, aliases: 'InternetChargeType'
14
+ attribute :ip_address, aliases: %w[IpAddress EipAddress]
13
15
  attribute :opertion_locks, aliases: 'OperationLocks'
14
- attribute :region_id, aliases: 'RegionId'
15
- attribute :state, aliases: 'Status'
16
+ attribute :region_id, aliases: 'RegionId'
17
+ attribute :state, aliases: 'Status'
16
18
 
17
19
  def destroy
18
20
  requires :id
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fog/core/collection'
2
4
  require 'fog/aliyun/models/compute/eip_address'
3
5
 
@@ -18,9 +20,7 @@ module Fog
18
20
  end
19
21
 
20
22
  def get(allocation_id)
21
- if allocation_id
22
- self.class.new(service: service).all(allocation_id: allocation_id)[0]
23
- end
23
+ self.class.new(service: service).all(allocation_id: allocation_id)[0] if allocation_id
24
24
  end
25
25
  end
26
26
  end
@@ -1,30 +1,32 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fog/core/model'
2
4
  module Fog
3
5
  module Compute
4
6
  class Aliyun
5
7
  class Image < Fog::Model
6
- identity :id, aliases: 'ImageId'
8
+ identity :id, aliases: 'ImageId'
7
9
 
8
- attribute :description, aliases: 'Description'
9
- attribute :product_code, aliases: 'ProductCode'
10
- attribute :os_type, aliases: 'OSType'
11
- attribute :architecture, aliases: 'Architecture'
12
- attribute :os_name, aliases: 'OSName'
13
- attribute :disk_device_mappings, aliases: 'DiskDeviceMappings'
14
- attribute :owner_alias, aliases: 'ImageOwnerAlias'
15
- attribute :progress, aliases: 'Progress'
16
- attribute :usage, aliases: 'Usage'
17
- attribute :created_at, aliases: 'CreationTime'
18
- attribute :tags, aliases: 'Tags'
19
- attribute :version, aliases: 'ImageVersion'
20
- attribute :state, aliases: 'Status'
21
- attribute :name, aliases: 'ImageName'
22
- attribute :is_self_shared, aliases: 'IsSelfShared'
23
- attribute :is_copied, aliases: 'IsCopied'
24
- attribute :is_subscribed, aliases: 'IsSubscribed'
25
- attribute :platform, aliases: 'Platform'
26
- attribute :size, aliases: 'Size'
27
- attribute :snapshot_id, aliases: 'SnapshotId'
10
+ attribute :description, aliases: 'Description'
11
+ attribute :product_code, aliases: 'ProductCode'
12
+ attribute :os_type, aliases: 'OSType'
13
+ attribute :architecture, aliases: 'Architecture'
14
+ attribute :os_name, aliases: 'OSName'
15
+ attribute :disk_device_mappings, aliases: 'DiskDeviceMappings'
16
+ attribute :owner_alias, aliases: 'ImageOwnerAlias'
17
+ attribute :progress, aliases: 'Progress'
18
+ attribute :usage, aliases: 'Usage'
19
+ attribute :created_at, aliases: 'CreationTime'
20
+ attribute :tags, aliases: 'Tags'
21
+ attribute :version, aliases: 'ImageVersion'
22
+ attribute :state, aliases: 'Status'
23
+ attribute :name, aliases: 'ImageName'
24
+ attribute :is_self_shared, aliases: 'IsSelfShared'
25
+ attribute :is_copied, aliases: 'IsCopied'
26
+ attribute :is_subscribed, aliases: 'IsSubscribed'
27
+ attribute :platform, aliases: 'Platform'
28
+ attribute :size, aliases: 'Size'
29
+ attribute :snapshot_id, aliases: 'SnapshotId'
28
30
 
29
31
  def initialize(attributes)
30
32
  self.snapshot_id = attributes['DiskDeviceMappings']['DiskDeviceMapping'][0]['SnapshotId']
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fog/core/collection'
2
4
  require 'fog/aliyun/models/compute/image'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fog/core/model'
2
4
  module Fog
3
5
  module Compute
@@ -11,11 +13,11 @@ module Fog
11
13
  # {"Status"=>"Available", "Type"=>"System", "InstanceId"=>"", "RouteTableId"=>"vtb-2504onoxh", "DestinationCidrBlock"=>"100.64.0.0/10"},
12
14
  # {"Status"=>"Available", "Type"=>"System", "InstanceId"=>"", "RouteTableId"=>"vtb-2504onoxh", "DestinationCidrBlock"=>"10.0.0.0/8"}]},
13
15
  # "RouteTableId"=>"vtb-2504onoxh", "RouteTableType"=>"System", "VRouterId"=>"vrt-25azmd2wm"}]}
14
- identity :cidr_block, aliases: 'DestinationCidrBlock'
15
- attribute :state, aliases: 'Status'
16
- attribute :server_id, aliases: 'InstanceId'
17
- attribute :type, aliases: 'Type'
18
- attribute :route_table_id, aliases: 'RouteTableId'
16
+ identity :cidr_block, aliases: 'DestinationCidrBlock'
17
+ attribute :state, aliases: 'Status'
18
+ attribute :server_id, aliases: 'InstanceId'
19
+ attribute :type, aliases: 'Type'
20
+ attribute :route_table_id, aliases: 'RouteTableId'
19
21
 
20
22
  # def save
21
23
  # requires :cidr_block,:route_table_id
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fog/core/collection'
2
4
  require 'fog/aliyun/models/compute/route_entry'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fog/core/model'
2
4
  module Fog
3
5
  module Compute
@@ -11,10 +13,10 @@ module Fog
11
13
  # {"Status"=>"Available", "Type"=>"System", "InstanceId"=>"", "RouteTableId"=>"vtb-2504onoxh", "DestinationCidrBlock"=>"100.64.0.0/10"},
12
14
  # {"Status"=>"Available", "Type"=>"System", "InstanceId"=>"", "RouteTableId"=>"vtb-2504onoxh", "DestinationCidrBlock"=>"10.0.0.0/8"}]},
13
15
  # "RouteTableId"=>"vtb-2504onoxh", "RouteTableType"=>"System", "VRouterId"=>"vrt-25azmd2wm"}]}
14
- identity :id, aliases: 'RouteTableId'
15
- attribute :created_at, aliases: 'CreationTime'
16
- attribute :type, aliases: 'RouteTableType'
17
- attribute :v_router_id, aliases: 'VRouterId'
16
+ identity :id, aliases: 'RouteTableId'
17
+ attribute :created_at, aliases: 'CreationTime'
18
+ attribute :type, aliases: 'RouteTableType'
19
+ attribute :v_router_id, aliases: 'VRouterId'
18
20
  # collection Fog::Compute::Aliyun::RouteEntrys
19
21
  def route_entrys
20
22
  @route_entrys ||= begin
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fog/core/collection'
2
4
  require 'fog/aliyun/models/compute/route_table'
3
5
 
@@ -17,9 +19,7 @@ module Fog
17
19
 
18
20
  def get(routeTableId)
19
21
  requires :v_router
20
- if routeTableId
21
- self.class.new(service: service, v_router: v_router).all(routeTableId: routeTableId)[0]
22
- end
22
+ self.class.new(service: service, v_router: v_router).all(routeTableId: routeTableId)[0] if routeTableId
23
23
  end
24
24
  end
25
25
  end
@@ -1,14 +1,16 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fog/core/model'
2
4
 
3
5
  module Fog
4
6
  module Compute
5
7
  class Aliyun
6
8
  class SecurityGroup < Fog::Model
7
- identity :id, aliases: 'SecurityGroupId'
8
- attribute :name, aliases: 'SecurityGroupName'
9
- attribute :description, aliases: 'Description'
10
- attribute :created_at, aliases: 'CreationTime'
11
- attribute :vpc_id, aliases: 'VpcId'
9
+ identity :id, aliases: 'SecurityGroupId'
10
+ attribute :name, aliases: 'SecurityGroupName'
11
+ attribute :description, aliases: 'Description'
12
+ attribute :created_at, aliases: 'CreationTime'
13
+ attribute :vpc_id, aliases: 'VpcId'
12
14
 
13
15
  def vpc
14
16
  requires :vpc_id
@@ -1,22 +1,24 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fog/core/model'
2
4
 
3
5
  module Fog
4
6
  module Compute
5
7
  class Aliyun
6
8
  class SecurityGroupRule < Fog::Model
7
- attribute :security_group_id, aliases: 'SecurityGroupId'
8
- attribute :source_cidr_ip, aliases: 'SourceCidrIp'
9
- attribute :source_owner, aliases: 'SourceGroupOwnerAccount'
10
- attribute :source_group_id, aliases: 'SourceGroupId'
11
- attribute :ip_protocol, aliases: 'IpProtocol'
12
- attribute :dest_cidr_ip, aliases: 'DestCidrIp'
13
- attribute :dest_owner, aliases: 'DestGroupOwnerAccount'
14
- attribute :dest_group_id, aliases: 'DestGroupId'
15
- attribute :nic_type, aliases: 'NicType'
16
- attribute :policy, aliases: 'Policy'
17
- attribute :port_range, aliases: 'PortRange'
18
- attribute :direction, aliases: 'Direction'
19
- attribute :priority, aliases: 'Priority'
9
+ attribute :security_group_id, aliases: 'SecurityGroupId'
10
+ attribute :source_cidr_ip, aliases: 'SourceCidrIp'
11
+ attribute :source_owner, aliases: 'SourceGroupOwnerAccount'
12
+ attribute :source_group_id, aliases: 'SourceGroupId'
13
+ attribute :ip_protocol, aliases: 'IpProtocol'
14
+ attribute :dest_cidr_ip, aliases: 'DestCidrIp'
15
+ attribute :dest_owner, aliases: 'DestGroupOwnerAccount'
16
+ attribute :dest_group_id, aliases: 'DestGroupId'
17
+ attribute :nic_type, aliases: 'NicType'
18
+ attribute :policy, aliases: 'Policy'
19
+ attribute :port_range, aliases: 'PortRange'
20
+ attribute :direction, aliases: 'Direction'
21
+ attribute :priority, aliases: 'Priority'
20
22
 
21
23
  def save
22
24
  requires :security_group_id, :ip_protocol, :port_range, :direction
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fog/core/collection'
2
4
  require 'fog/aliyun/models/compute/security_group_rule'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fog/core/collection'
2
4
  require 'fog/aliyun/models/compute/security_group'
3
5
 
@@ -1,37 +1,39 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fog/compute/models/server'
2
4
 
3
5
  module Fog
4
6
  module Compute
5
7
  class Aliyun
6
8
  class Server < Fog::Compute::Server
7
- identity :id, aliases: 'InstanceId'
8
- attribute :image_id, aliases: 'ImageId'
9
- attribute :inner_ip, aliases: 'InnerIpAddress'
10
- attribute :vlan_id, aliases: 'VlanId'
11
- attribute :eip, aliases: 'EipAddress'
12
- attribute :max_bandwidth_in, aliases: 'InternetMaxBandwidthIn'
13
- attribute :zone_id, aliases: 'ZoneId'
14
- attribute :internet_charge_type, aliases: 'InternetChargeType'
15
- attribute :serial_number, aliases: 'SerialNumber'
16
- attribute :io_optimized, aliases: 'IoOptimized'
9
+ identity :id, aliases: 'InstanceId'
10
+ attribute :image_id, aliases: 'ImageId'
11
+ attribute :inner_ip, aliases: 'InnerIpAddress'
12
+ attribute :vlan_id, aliases: 'VlanId'
13
+ attribute :eip, aliases: 'EipAddress'
14
+ attribute :max_bandwidth_in, aliases: 'InternetMaxBandwidthIn'
15
+ attribute :zone_id, aliases: 'ZoneId'
16
+ attribute :internet_charge_type, aliases: 'InternetChargeType'
17
+ attribute :serial_number, aliases: 'SerialNumber'
18
+ attribute :io_optimized, aliases: 'IoOptimized'
17
19
  attribute :max_bandwidth_out, aliases: 'InternetMaxBandwidthOut'
18
- attribute :vpc_attributes, aliases: 'VpcAttributes'
19
- attribute :device_available, aliases: 'DeviceAvailable'
20
- attribute :private_ip, aliases: 'PrivateIpAddress'
20
+ attribute :vpc_attributes, aliases: 'VpcAttributes'
21
+ attribute :device_available, aliases: 'DeviceAvailable'
22
+ attribute :private_ip, aliases: 'PrivateIpAddress'
21
23
  attribute :security_group_ids, aliases: 'SecurityGroupIds'
22
- attribute :name, aliases: 'InstanceName'
23
- attribute :description, aliases: 'Description'
24
- attribute :network_type, aliases: 'InstanceNetworkType'
25
- attribute :public_ip, aliases: 'PublicIpAddress'
26
- attribute :host_name, aliases: 'HostName'
27
- attribute :type, aliases: 'InstanceType'
28
- attribute :created_at, aliases: 'CreationTime'
29
- attribute :state, aliases: 'Status'
30
- attribute :cluster_id, aliases: 'ClusterId'
31
- attribute :region_id, aliases: 'RegionId'
32
- attribute :charge_type, aliases: 'InstanceChargeType'
33
- attribute :operation_locks, aliases: 'OperationLocks'
34
- attribute :expired_at, aliases: 'ExpiredTime'
24
+ attribute :name, aliases: 'InstanceName'
25
+ attribute :description, aliases: 'Description'
26
+ attribute :network_type, aliases: 'InstanceNetworkType'
27
+ attribute :public_ip, aliases: 'PublicIpAddress'
28
+ attribute :host_name, aliases: 'HostName'
29
+ attribute :type, aliases: 'InstanceType'
30
+ attribute :created_at, aliases: 'CreationTime'
31
+ attribute :state, aliases: 'Status'
32
+ attribute :cluster_id, aliases: 'ClusterId'
33
+ attribute :region_id, aliases: 'RegionId'
34
+ attribute :charge_type, aliases: 'InstanceChargeType'
35
+ attribute :operation_locks, aliases: 'OperationLocks'
36
+ attribute :expired_at, aliases: 'ExpiredTime'
35
37
 
36
38
  def image
37
39
  requires image_id
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fog/core/collection'
2
4
  require 'fog/aliyun/models/compute/server'
3
5
 
@@ -32,9 +34,7 @@ module Fog
32
34
  # end
33
35
 
34
36
  def get(server_id)
35
- if server_id
36
- self.class.new(service: service).all(instanceId: server_id)[0]
37
- end
37
+ self.class.new(service: service).all(instanceId: server_id)[0] if server_id
38
38
  end
39
39
  end
40
40
  end
@@ -1,20 +1,22 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fog/core/model'
2
4
  module Fog
3
5
  module Compute
4
6
  class Aliyun
5
7
  class Snapshot < Fog::Model
6
- identity :id, aliases: 'SnapshotId'
7
- attribute :name, aliases: 'SnapshotName'
8
+ identity :id, aliases: 'SnapshotId'
9
+ attribute :name, aliases: 'SnapshotName'
8
10
  attribute :description, aliases: 'Description'
9
- attribute :progress, aliases: 'Progress'
10
- attribute :volume_id, aliases: 'SourceDiskId'
11
- attribute :volume_size, aliases: 'SourceDiskSize'
12
- attribute :volume_type, aliases: 'SourceDiskType'
11
+ attribute :progress, aliases: 'Progress'
12
+ attribute :volume_id, aliases: 'SourceDiskId'
13
+ attribute :volume_size, aliases: 'SourceDiskSize'
14
+ attribute :volume_type, aliases: 'SourceDiskType'
13
15
  attribute :product_code, aliases: 'ProductCode'
14
- attribute :created_at, aliases: 'CreationTime'
15
- attribute :state, aliases: 'Status'
16
- attribute :usage, aliases: 'Usage'
17
- attribute :tags, aliases: 'Tags'
16
+ attribute :created_at, aliases: 'CreationTime'
17
+ attribute :state, aliases: 'Status'
18
+ attribute :usage, aliases: 'Usage'
19
+ attribute :tags, aliases: 'Tags'
18
20
 
19
21
  def destroy
20
22
  requires :id
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fog/core/collection'
2
4
  require 'fog/aliyun/models/compute/snapshot'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fog/core/model'
2
4
  module Fog
3
5
  module Compute
@@ -16,31 +18,31 @@ module Fog
16
18
  # "Status": "Available",
17
19
  # "Type": "data",
18
20
 
19
- identity :id, aliases: 'DiskId'
20
- attribute :region_id, aliases: 'RegionId'
21
- attribute :zone_id, aliases: 'ZoneId'
22
- attribute :name, aliases: 'DiskName'
23
- attribute :description, aliases: 'Description'
24
- attribute :type, aliases: 'Type'
25
- attribute :category, aliases: 'Category'
26
- attribute :size, aliases: 'Size'
27
- attribute :image_id, aliases: 'ImageId'
28
- attribute :snapshot_id, aliases: 'SourceSnapshotId'
29
- attribute :product_code, aliases: 'ProductCode'
30
- attribute :portable, aliases: 'Portable'
31
- attribute :state, aliases: 'Status'
32
- attribute :operation_locks, aliases: 'OperationLocks'
33
- attribute :server_id, aliases: 'InstanceId'
34
- attribute :device, aliases: 'Device'
35
- attribute :delete_with_instance, aliases: 'DeleteWithInstance'
36
- attribute :delete_auto_snapshot, aliases: 'DeleteAutoSnapshot'
37
- attribute :enable_auto_snapshot, aliases: 'EnableAutoSnapshot'
38
- attribute :created_at, aliases: 'CreationTime'
39
- attribute :attached_at, aliases: 'AttachedTime'
40
- attribute :detached_at, aliases: 'DetachedTime'
41
- attribute :expired_at, aliases: 'ExpiredTime'
42
- attribute :charge_type, aliases: 'DiskChargeType'
43
- attribute :tags, aliases: 'Tags'
21
+ identity :id, aliases: 'DiskId'
22
+ attribute :region_id, aliases: 'RegionId'
23
+ attribute :zone_id, aliases: 'ZoneId'
24
+ attribute :name, aliases: 'DiskName'
25
+ attribute :description, aliases: 'Description'
26
+ attribute :type, aliases: 'Type'
27
+ attribute :category, aliases: 'Category'
28
+ attribute :size, aliases: 'Size'
29
+ attribute :image_id, aliases: 'ImageId'
30
+ attribute :snapshot_id, aliases: 'SourceSnapshotId'
31
+ attribute :product_code, aliases: 'ProductCode'
32
+ attribute :portable, aliases: 'Portable'
33
+ attribute :state, aliases: 'Status'
34
+ attribute :operation_locks, aliases: 'OperationLocks'
35
+ attribute :server_id, aliases: 'InstanceId'
36
+ attribute :device, aliases: 'Device'
37
+ attribute :delete_with_instance, aliases: 'DeleteWithInstance'
38
+ attribute :delete_auto_snapshot, aliases: 'DeleteAutoSnapshot'
39
+ attribute :enable_auto_snapshot, aliases: 'EnableAutoSnapshot'
40
+ attribute :created_at, aliases: 'CreationTime'
41
+ attribute :attached_at, aliases: 'AttachedTime'
42
+ attribute :detached_at, aliases: 'DetachedTime'
43
+ attribute :expired_at, aliases: 'ExpiredTime'
44
+ attribute :charge_type, aliases: 'DiskChargeType'
45
+ attribute :tags, aliases: 'Tags'
44
46
 
45
47
  def destroy
46
48
  requires :id
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'fog/core/collection'
2
4
  require 'fog/aliyun/models/compute/volume'
3
5