oraclecloud 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 114f5803f4c77b8c23858167d333564ced2961d0
4
- data.tar.gz: 958dad16f17017b1210ce926f224b59619fff360
3
+ metadata.gz: fb91dc27431a829a92b8410ee1176a4c0e3652d4
4
+ data.tar.gz: 0d55cb121a613f2fd488b9c5730a9740d5e77ec5
5
5
  SHA512:
6
- metadata.gz: 337eebb3ff3423dc93cceb7481896a08e20bb21fca8f6b387da4a0bc80cb917bf3458ff574909ddf4a4438139f03da2948f3f67dc5656234bed3af406cccf01d
7
- data.tar.gz: be3492b4887cfebc5f4542ec254a091cae1aadf998e4ac3aa31f00b71df5ea0bc6885d1322b983b5423b993461f0775d4eb60619eb74f05e741ec04e8c16071c
6
+ metadata.gz: 11e4eff48cbc99ec3fe94f7783383947b34c5d85ee7e8311459a5c9557462c04f966b581fc0c5b1fdda03aa2b89c9bece193a6c0341f41d4545bb523479f4dca
7
+ data.tar.gz: 6058dafde29ca9173ab44414a2869d659f7bf72300ec99a101fef27227b797d33e2f82d6b8974bff2e075a8b7dc40adf7276a5d9baad362400c669bae6afbc0f
@@ -1,5 +1,8 @@
1
1
  # oraclecloud client gem CHANGELOG
2
2
 
3
+ ## v1.1.0 (2015-11-12)
4
+ * [pr#4](https://github.com/chef-partners/oracle-cloud-client/pull/4) Added support for non-public deployments of Oracle Cloud where the identity domain follows a different convention
5
+
3
6
  ## v1.0.0 (2015-10-15)
4
7
  * Initial release
5
8
 
@@ -17,6 +17,7 @@
17
17
  #
18
18
 
19
19
  require 'ffi_yajl'
20
+ require 'json'
20
21
  require 'rest-client'
21
22
 
22
23
  module OracleCloud
@@ -26,6 +27,7 @@ module OracleCloud
26
27
  def initialize(opts)
27
28
  @api_url = opts[:api_url]
28
29
  @identity_domain = opts[:identity_domain]
30
+ @private_cloud = opts[:private_cloud] || false
29
31
  @username = opts[:username]
30
32
  @password = opts[:password]
31
33
  @verify_ssl = opts.fetch(:verify_ssl, true)
@@ -86,12 +88,20 @@ module OracleCloud
86
88
  false
87
89
  end
88
90
 
91
+ def private_cloud?
92
+ @private_cloud
93
+ end
94
+
89
95
  def username_with_domain
90
- "#{compute_identity_domain}/#{@username}"
96
+ "#{full_identity_domain}/#{@username}"
91
97
  end
92
98
 
93
- def compute_identity_domain
94
- "Compute-#{@identity_domain}"
99
+ def full_identity_domain
100
+ if private_cloud?
101
+ @identity_domain
102
+ else
103
+ "Compute-#{@identity_domain}"
104
+ end
95
105
  end
96
106
 
97
107
  def authenticate!
@@ -168,7 +178,7 @@ module OracleCloud
168
178
  end
169
179
 
170
180
  def url_with_identity_domain(type, path = '')
171
- "/#{type}/#{compute_identity_domain}/#{path}"
181
+ "/#{type}/#{full_identity_domain}/#{path}"
172
182
  end
173
183
 
174
184
  def http_get(request_type, url)
@@ -48,7 +48,7 @@ module OracleCloud
48
48
  end
49
49
 
50
50
  def full_name
51
- "#{client.compute_identity_domain}/#{client.username}/#{name}"
51
+ "#{client.full_identity_domain}/#{client.username}/#{name}"
52
52
  end
53
53
 
54
54
  def nat
@@ -35,9 +35,9 @@ module OracleCloud
35
35
 
36
36
  def create_request_payload
37
37
  {
38
- 'name' => "#{client.compute_identity_domain}/#{client.username}/#{create_opts[:name]}",
38
+ 'name' => "#{client.full_identity_domain}/#{client.username}/#{create_opts[:name]}",
39
39
  'relationships' => [],
40
- 'account' => "#{client.compute_identity_domain}/default",
40
+ 'account' => "#{client.full_identity_domain}/default",
41
41
  'description' => create_opts[:description],
42
42
  'schedule' => { 'start_time' => nil, 'stop_time' => nil },
43
43
  'uri' => nil,
@@ -16,5 +16,5 @@
16
16
  # limitations under the License.
17
17
  #
18
18
  module OracleCloud
19
- VERSION = '1.0.0'
19
+ VERSION = '1.1.0'
20
20
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oraclecloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef Partner Engineering
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-15 00:00:00.000000000 Z
11
+ date: 2015-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client