fog-huaweicloud 0.0.3 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/lib/fog/compute/huaweicloud.rb +1 -1
- data/lib/fog/compute/huaweicloud/models/os_interface.rb +1 -1
- data/lib/fog/compute/huaweicloud/requests/create_os_interface.rb +2 -2
- data/lib/fog/compute/huaweicloud/requests/create_server.rb +1 -1
- data/lib/fog/huaweicloud/core.rb +2 -8
- data/lib/fog/huaweicloud/version.rb +1 -1
- data/lib/fog/network/huaweicloud/models/subnets.rb +4 -4
- data/lib/fog/network/huaweicloud/requests/get_subnet.rb +6 -5
- data/lib/fog/network/huaweicloud/requests/list_subnets.rb +6 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 073897e81a5750e2b73cfcf2019d1515f6bf174e
|
4
|
+
data.tar.gz: f174d120d9376189cc3905ca70675a80776d7e16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 095e90b2e07b86aa5866fee0e71485a2f3cbdc97fd4d0dcd53f235a2ad369bd0548e4d7a8794c027db7fa9edd72d28b89450dc60b32ba5f9fc512f8e2702e570
|
7
|
+
data.tar.gz: 46ae77270c82fd44c3143ed9a3ac39e217be21ff9640f212a56196060d8aad45e931f87443b2b4f993c5cd8d7b59386b977bbfda865f8417351f0ef80829ece1
|
data/CHANGELOG.md
CHANGED
@@ -336,7 +336,7 @@ module Fog
|
|
336
336
|
}
|
337
337
|
],
|
338
338
|
"mac_addr" => "fa:16:3e:4c:2c:30",
|
339
|
-
"
|
339
|
+
"net_id" => "3cb9bc59-5699-4588-a4b1-b87f96708bc6",
|
340
340
|
"port_id" => "ce531f90-199f-48c0-816c-13e38010b442",
|
341
341
|
"port_state" => "ACTIVE"
|
342
342
|
}
|
@@ -12,8 +12,8 @@ module Fog
|
|
12
12
|
|
13
13
|
if options[:port_id]
|
14
14
|
body['interfaceAttachment']['port_id'] = options[:port_id]
|
15
|
-
elsif options[:
|
16
|
-
body['interfaceAttachment']['
|
15
|
+
elsif options[:net_id]
|
16
|
+
body['interfaceAttachment']['net_id'] = options[:net_id]
|
17
17
|
end
|
18
18
|
|
19
19
|
if options[:ip_address]
|
@@ -46,7 +46,7 @@ module Fog
|
|
46
46
|
data['server']['networks'] =
|
47
47
|
Array(options['nics']).map do |nic|
|
48
48
|
neti = {}
|
49
|
-
neti['uuid'] = (nic['
|
49
|
+
neti['uuid'] = (nic['net_id'] || nic[:net_id]) unless (nic['net_id'] || nic[:net_id]).nil?
|
50
50
|
neti['fixed_ip'] = (nic['v4_fixed_ip'] || nic[:v4_fixed_ip]) unless (nic['v4_fixed_ip'] || nic[:v4_fixed_ip]).nil?
|
51
51
|
neti['port'] = (nic['port_id'] || nic[:port_id]) unless (nic['port_id'] || nic[:port_id]).nil?
|
52
52
|
neti
|
data/lib/fog/huaweicloud/core.rb
CHANGED
@@ -76,18 +76,12 @@ module Fog
|
|
76
76
|
|
77
77
|
private
|
78
78
|
|
79
|
-
def request(params, parse_json = true
|
79
|
+
def request(params, parse_json = true)
|
80
80
|
retried = false
|
81
81
|
begin
|
82
|
-
# NOTE: This is only for transition usage. It should be removed once we upgraded all
|
83
|
-
# the APIs to non-OpenStack version.
|
84
|
-
real_path = @path.clone
|
85
|
-
overwrite_version.each do |key, value|
|
86
|
-
real_path.sub!(key, value)
|
87
|
-
end
|
88
82
|
response = @connection.request(params.merge(
|
89
83
|
:headers => headers(params.delete(:headers)),
|
90
|
-
:path => "#{
|
84
|
+
:path => "#{@path}/#{params[:path]}"
|
91
85
|
))
|
92
86
|
rescue Excon::Errors::Unauthorized => error
|
93
87
|
# token expiration and token renewal possible
|
@@ -14,13 +14,13 @@ module Fog
|
|
14
14
|
super
|
15
15
|
end
|
16
16
|
|
17
|
-
def all(filters_arg = filters
|
17
|
+
def all(filters_arg = filters)
|
18
18
|
filters = filters_arg
|
19
|
-
load_response(service.list_subnets(filters
|
19
|
+
load_response(service.list_subnets(filters), 'subnets')
|
20
20
|
end
|
21
21
|
|
22
|
-
def get(subnet_id
|
23
|
-
if subnet = service.get_subnet(subnet_id
|
22
|
+
def get(subnet_id)
|
23
|
+
if subnet = service.get_subnet(subnet_id).body['subnet']
|
24
24
|
new(subnet)
|
25
25
|
end
|
26
26
|
rescue Fog::Network::HuaweiCloud::NotFound
|
@@ -2,16 +2,17 @@ module Fog
|
|
2
2
|
module Network
|
3
3
|
class HuaweiCloud
|
4
4
|
class Real
|
5
|
-
def get_subnet(subnet_id
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
def get_subnet(subnet_id)
|
6
|
+
request(
|
7
|
+
:expects => [200],
|
8
|
+
:method => 'GET',
|
9
|
+
:path => "subnets/#{subnet_id}"
|
9
10
|
)
|
10
11
|
end
|
11
12
|
end
|
12
13
|
|
13
14
|
class Mock
|
14
|
-
def get_subnet(subnet_id
|
15
|
+
def get_subnet(subnet_id)
|
15
16
|
response = Excon::Response.new
|
16
17
|
if data = self.data[:subnets][subnet_id]
|
17
18
|
response.status = 200
|
@@ -2,17 +2,18 @@ module Fog
|
|
2
2
|
module Network
|
3
3
|
class HuaweiCloud
|
4
4
|
class Real
|
5
|
-
def list_subnets(filters = {}
|
6
|
-
overwrite_version = openstack_compatible ? {} : {"v2.0" => "v1/#{@current_tenant['id']}"}
|
5
|
+
def list_subnets(filters = {})
|
7
6
|
request(
|
8
|
-
|
9
|
-
|
7
|
+
:expects => 200,
|
8
|
+
:method => 'GET',
|
9
|
+
:path => 'subnets',
|
10
|
+
:query => filters
|
10
11
|
)
|
11
12
|
end
|
12
13
|
end
|
13
14
|
|
14
15
|
class Mock
|
15
|
-
def list_subnets(_filters = {}
|
16
|
+
def list_subnets(_filters = {})
|
16
17
|
Excon::Response.new(
|
17
18
|
:body => {'subnets' => data[:subnets].values},
|
18
19
|
:status => 200
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-huaweicloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Huawei
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-core
|