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.
- checksums.yaml +4 -4
- data/.gitignore +23 -10
- data/.rubocop.yml +31 -4
- data/.rubocop_todo.yml +83 -55
- data/Gemfile +2 -0
- data/Rakefile +2 -0
- data/bin/console +4 -3
- data/fog-aliyun.gemspec +19 -18
- data/lib/fog/aliyun.rb +4 -2
- data/lib/fog/aliyun/compute.rb +45 -43
- data/lib/fog/aliyun/models/compute/eip_address.rb +10 -8
- data/lib/fog/aliyun/models/compute/eip_addresses.rb +3 -3
- data/lib/fog/aliyun/models/compute/image.rb +23 -21
- data/lib/fog/aliyun/models/compute/images.rb +2 -0
- data/lib/fog/aliyun/models/compute/route_entry.rb +7 -5
- data/lib/fog/aliyun/models/compute/route_entrys.rb +2 -0
- data/lib/fog/aliyun/models/compute/route_table.rb +6 -4
- data/lib/fog/aliyun/models/compute/route_tables.rb +3 -3
- data/lib/fog/aliyun/models/compute/security_group.rb +7 -5
- data/lib/fog/aliyun/models/compute/security_group_rule.rb +15 -13
- data/lib/fog/aliyun/models/compute/security_group_rules.rb +2 -0
- data/lib/fog/aliyun/models/compute/security_groups.rb +2 -0
- data/lib/fog/aliyun/models/compute/server.rb +28 -26
- data/lib/fog/aliyun/models/compute/servers.rb +3 -3
- data/lib/fog/aliyun/models/compute/snapshot.rb +12 -10
- data/lib/fog/aliyun/models/compute/snapshots.rb +2 -0
- data/lib/fog/aliyun/models/compute/volume.rb +27 -25
- data/lib/fog/aliyun/models/compute/volumes.rb +2 -0
- data/lib/fog/aliyun/models/compute/vpc.rb +12 -10
- data/lib/fog/aliyun/models/compute/vpcs.rb +3 -3
- data/lib/fog/aliyun/models/compute/vrouter.rb +8 -6
- data/lib/fog/aliyun/models/compute/vrouters.rb +3 -3
- data/lib/fog/aliyun/models/compute/vswitch.rb +11 -9
- data/lib/fog/aliyun/models/compute/vswitches.rb +3 -3
- data/lib/fog/aliyun/models/storage/directories.rb +3 -1
- data/lib/fog/aliyun/models/storage/directory.rb +2 -0
- data/lib/fog/aliyun/models/storage/file.rb +18 -16
- data/lib/fog/aliyun/models/storage/files.rb +13 -19
- data/lib/fog/aliyun/requests/compute/allocate_eip_address.rb +5 -3
- data/lib/fog/aliyun/requests/compute/allocate_public_ip_address.rb +4 -2
- data/lib/fog/aliyun/requests/compute/associate_eip_address.rb +4 -2
- data/lib/fog/aliyun/requests/compute/attach_disk.rb +7 -5
- data/lib/fog/aliyun/requests/compute/create_disk.rb +15 -13
- data/lib/fog/aliyun/requests/compute/create_image.rb +3 -1
- data/lib/fog/aliyun/requests/compute/create_security_group.rb +11 -9
- data/lib/fog/aliyun/requests/compute/create_security_group_egress_ip_rule.rb +13 -11
- data/lib/fog/aliyun/requests/compute/create_security_group_egress_sg_rule.rb +12 -10
- data/lib/fog/aliyun/requests/compute/create_security_group_ip_rule.rb +13 -11
- data/lib/fog/aliyun/requests/compute/create_security_group_sg_rule.rb +12 -10
- data/lib/fog/aliyun/requests/compute/create_server.rb +11 -9
- data/lib/fog/aliyun/requests/compute/create_snapshot.rb +3 -1
- data/lib/fog/aliyun/requests/compute/create_vpc.rb +6 -4
- data/lib/fog/aliyun/requests/compute/create_vpn_connection.rb +8 -6
- data/lib/fog/aliyun/requests/compute/create_vpn_customergateway.rb +6 -6
- data/lib/fog/aliyun/requests/compute/create_vswitch.rb +6 -4
- data/lib/fog/aliyun/requests/compute/delete_disk.rb +8 -6
- data/lib/fog/aliyun/requests/compute/delete_image.rb +3 -1
- data/lib/fog/aliyun/requests/compute/delete_security_group.rb +7 -5
- data/lib/fog/aliyun/requests/compute/delete_security_group_egress_ip_rule.rb +13 -11
- data/lib/fog/aliyun/requests/compute/delete_security_group_egress_sg_rule.rb +12 -10
- data/lib/fog/aliyun/requests/compute/delete_security_group_ip_rule.rb +13 -11
- data/lib/fog/aliyun/requests/compute/delete_security_group_sg_rule.rb +12 -10
- data/lib/fog/aliyun/requests/compute/delete_server.rb +2 -0
- data/lib/fog/aliyun/requests/compute/delete_snapshot.rb +3 -1
- data/lib/fog/aliyun/requests/compute/delete_vpc.rb +6 -4
- data/lib/fog/aliyun/requests/compute/delete_vpn_connection.rb +6 -4
- data/lib/fog/aliyun/requests/compute/delete_vpn_customergateway.rb +6 -4
- data/lib/fog/aliyun/requests/compute/delete_vswitch.rb +6 -4
- data/lib/fog/aliyun/requests/compute/detach_disk.rb +6 -4
- data/lib/fog/aliyun/requests/compute/join_security_group.rb +2 -0
- data/lib/fog/aliyun/requests/compute/leave_security_group.rb +2 -0
- data/lib/fog/aliyun/requests/compute/list_disks.rb +5 -3
- data/lib/fog/aliyun/requests/compute/list_eip_addresses.rb +5 -3
- data/lib/fog/aliyun/requests/compute/list_images.rb +5 -3
- data/lib/fog/aliyun/requests/compute/list_route_tables.rb +6 -4
- data/lib/fog/aliyun/requests/compute/list_security_group_rules.rb +7 -5
- data/lib/fog/aliyun/requests/compute/list_security_groups.rb +10 -8
- data/lib/fog/aliyun/requests/compute/list_server_types.rb +8 -6
- data/lib/fog/aliyun/requests/compute/list_servers.rb +4 -2
- data/lib/fog/aliyun/requests/compute/list_snapshots.rb +4 -2
- data/lib/fog/aliyun/requests/compute/list_vpcs.rb +5 -3
- data/lib/fog/aliyun/requests/compute/list_vpn_connections.rb +49 -49
- data/lib/fog/aliyun/requests/compute/list_vpn_customergateways.rb +42 -43
- data/lib/fog/aliyun/requests/compute/list_vpn_gateways.rb +49 -49
- data/lib/fog/aliyun/requests/compute/list_vrouters.rb +6 -4
- data/lib/fog/aliyun/requests/compute/list_vswitchs.rb +6 -4
- data/lib/fog/aliyun/requests/compute/list_zones.rb +3 -1
- data/lib/fog/aliyun/requests/compute/modify_vpc.rb +7 -5
- data/lib/fog/aliyun/requests/compute/modify_vswitch.rb +6 -4
- data/lib/fog/aliyun/requests/compute/reboot_server.rb +2 -0
- data/lib/fog/aliyun/requests/compute/release_eip_address.rb +4 -2
- data/lib/fog/aliyun/requests/compute/start_server.rb +9 -7
- data/lib/fog/aliyun/requests/compute/stop_server.rb +9 -7
- data/lib/fog/aliyun/requests/compute/unassociate_eip_address.rb +4 -2
- data/lib/fog/aliyun/requests/storage/copy_object.rb +3 -2
- data/lib/fog/aliyun/requests/storage/delete_bucket.rb +3 -2
- data/lib/fog/aliyun/requests/storage/delete_container.rb +3 -2
- data/lib/fog/aliyun/requests/storage/delete_object.rb +4 -3
- data/lib/fog/aliyun/requests/storage/get_bucket.rb +6 -11
- data/lib/fog/aliyun/requests/storage/get_container.rb +3 -2
- data/lib/fog/aliyun/requests/storage/get_containers.rb +3 -2
- data/lib/fog/aliyun/requests/storage/get_object.rb +4 -3
- data/lib/fog/aliyun/requests/storage/get_object_http_url.rb +5 -4
- data/lib/fog/aliyun/requests/storage/get_object_https_url.rb +5 -4
- data/lib/fog/aliyun/requests/storage/head_object.rb +3 -2
- data/lib/fog/aliyun/requests/storage/list_buckets.rb +3 -2
- data/lib/fog/aliyun/requests/storage/list_objects.rb +5 -4
- data/lib/fog/aliyun/requests/storage/put_bucket.rb +3 -2
- data/lib/fog/aliyun/requests/storage/put_container.rb +3 -2
- data/lib/fog/aliyun/requests/storage/put_object.rb +12 -17
- data/lib/fog/aliyun/storage.rb +41 -52
- data/lib/fog/aliyun/version.rb +3 -1
- data/lib/fog/bin/aliyun.rb +10 -7
- 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,
|
8
|
+
identity :id, aliases: 'AllocationId'
|
7
9
|
|
8
|
-
attribute :allocated_at,
|
9
|
-
attribute :bandwidth,
|
10
|
-
attribute :server_id,
|
11
|
-
attribute :charge_type,
|
12
|
-
attribute :ip_address,
|
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,
|
15
|
-
attribute :state,
|
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,
|
8
|
+
identity :id, aliases: 'ImageId'
|
7
9
|
|
8
|
-
attribute :description,
|
9
|
-
attribute :product_code,
|
10
|
-
attribute :os_type,
|
11
|
-
attribute :architecture,
|
12
|
-
attribute :os_name,
|
13
|
-
attribute :disk_device_mappings,
|
14
|
-
attribute :owner_alias,
|
15
|
-
attribute :progress,
|
16
|
-
attribute :usage,
|
17
|
-
attribute :created_at,
|
18
|
-
attribute :tags,
|
19
|
-
attribute :version,
|
20
|
-
attribute :state,
|
21
|
-
attribute :name,
|
22
|
-
attribute :is_self_shared,
|
23
|
-
attribute :is_copied,
|
24
|
-
attribute :is_subscribed,
|
25
|
-
attribute :platform,
|
26
|
-
attribute :size,
|
27
|
-
attribute :snapshot_id,
|
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/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,
|
15
|
-
attribute :state,
|
16
|
-
attribute :server_id,
|
17
|
-
attribute :type,
|
18
|
-
attribute :route_table_id,
|
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/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,
|
15
|
-
attribute :created_at,
|
16
|
-
attribute :type,
|
17
|
-
attribute :v_router_id,
|
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
|
8
|
-
attribute :name,
|
9
|
-
attribute :description,
|
10
|
-
attribute :created_at,
|
11
|
-
attribute :vpc_id,
|
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,
|
8
|
-
attribute :source_cidr_ip,
|
9
|
-
attribute :source_owner,
|
10
|
-
attribute :source_group_id,
|
11
|
-
attribute :ip_protocol,
|
12
|
-
attribute :dest_cidr_ip,
|
13
|
-
attribute :dest_owner,
|
14
|
-
attribute :dest_group_id,
|
15
|
-
attribute :nic_type,
|
16
|
-
attribute :policy,
|
17
|
-
attribute :port_range,
|
18
|
-
attribute :direction,
|
19
|
-
attribute :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,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,
|
8
|
-
attribute :image_id,
|
9
|
-
attribute :inner_ip,
|
10
|
-
attribute :vlan_id,
|
11
|
-
attribute :eip,
|
12
|
-
attribute :max_bandwidth_in,
|
13
|
-
attribute :zone_id,
|
14
|
-
attribute :internet_charge_type,
|
15
|
-
attribute :serial_number,
|
16
|
-
attribute :io_optimized,
|
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,
|
19
|
-
attribute :device_available,
|
20
|
-
attribute :private_ip,
|
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,
|
23
|
-
attribute :description,
|
24
|
-
attribute :network_type,
|
25
|
-
attribute :public_ip,
|
26
|
-
attribute :host_name,
|
27
|
-
attribute :type,
|
28
|
-
attribute :created_at,
|
29
|
-
attribute :state,
|
30
|
-
attribute :cluster_id,
|
31
|
-
attribute :region_id,
|
32
|
-
attribute :charge_type,
|
33
|
-
attribute :operation_locks,
|
34
|
-
attribute :expired_at,
|
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
|
7
|
-
attribute :name,
|
8
|
+
identity :id, aliases: 'SnapshotId'
|
9
|
+
attribute :name, aliases: 'SnapshotName'
|
8
10
|
attribute :description, aliases: 'Description'
|
9
|
-
attribute :progress,
|
10
|
-
attribute :volume_id,
|
11
|
-
attribute :volume_size,
|
12
|
-
attribute :volume_type,
|
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,
|
15
|
-
attribute :state,
|
16
|
-
attribute :usage,
|
17
|
-
attribute :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/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
|
20
|
-
attribute :region_id,
|
21
|
-
attribute :zone_id,
|
22
|
-
attribute :name,
|
23
|
-
attribute :description,
|
24
|
-
attribute :type,
|
25
|
-
attribute :category,
|
26
|
-
attribute :size,
|
27
|
-
attribute :image_id,
|
28
|
-
attribute :snapshot_id,
|
29
|
-
attribute :product_code,
|
30
|
-
attribute :portable,
|
31
|
-
attribute :state,
|
32
|
-
attribute :operation_locks,
|
33
|
-
attribute :server_id,
|
34
|
-
attribute :device,
|
35
|
-
attribute :delete_with_instance,
|
36
|
-
attribute :delete_auto_snapshot,
|
37
|
-
attribute :enable_auto_snapshot,
|
38
|
-
attribute :created_at,
|
39
|
-
attribute :attached_at,
|
40
|
-
attribute :detached_at,
|
41
|
-
attribute :expired_at,
|
42
|
-
attribute :charge_type,
|
43
|
-
attribute :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
|