oraclebmc 2.0.4 → 2.0.5

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: 13c41c0392380175ee3c43643bd99e99c805d275
4
- data.tar.gz: c2e5572fd95c89338dffa524d12e67f3d043b1a2
3
+ metadata.gz: a28198a99b195ebdd589c4218374c7218f0afcf7
4
+ data.tar.gz: 72c1ec046a5fc461b1c396a20af867c5dbfa5633
5
5
  SHA512:
6
- metadata.gz: fc1be9a7f32c738ef13b152ae8d2b62ecb7493a56558c2ce9d049f63a113eea758e6f7fcb580850ac5c6ce0161bb675f42b526ce5f1f1c2cacd679b60fd80530
7
- data.tar.gz: a6dc3c4aa2acb1b6b22cf6ebb75684abe883d20eed55d0be09af6fc3f2d6edd5b67ec503ab8f12ebac47a87cd9e0ef620f2613f38c59602d93835ee83bfc5bb7
6
+ metadata.gz: b53ad7d7aa505a6476401c1eff20137c23f74dc8a93f8e82d0e81cf8f2edb66a92fecb91db5944c0c99521f738eb606598af96100213e25b4f82b46ed03f12cc
7
+ data.tar.gz: 88a10ca661c45559ee193cc5499fca6d06b1373e95a95746d9210c7cfdfbbe36d868b3398517a50f060d8fafc87d0c9e6865725207f317eb656478939e759df4
data/LICENSE.txt CHANGED
@@ -1,9 +1,9 @@
1
- Copyright (c) 2016, 2017, Oracle and/or its affiliates.  All rights reserved.
1
+ Copyright (c) 2016, 2018, Oracle and/or its affiliates.  All rights reserved.
2
2
 
3
3
  This software is dual-licensed to you under the Universal Permissive License (UPL) and Apache License 2.0.  See below for license terms.  You may choose either license, or both.
4
4
   ____________________________
5
5
  The Universal Permissive License (UPL), Version 1.0
6
- Copyright (c) 2016, 2017, Oracle and/or its affiliates.  All rights reserved.
6
+ Copyright (c) 2016, 2018, Oracle and/or its affiliates.  All rights reserved.
7
7
 
8
8
  Subject to the condition set forth below, permission is hereby granted to any person obtaining a copy of this software, associated documentation and/or data (collectively the "Software"), free of charge and under any and all copyright rights in the Software, and any and all patent rights owned or freely licensable by each licensor hereunder covering either (i) the unmodified Software as contributed to or provided by such licensor, or (ii) the Larger Works (as defined below), to deal in both
9
9
 
@@ -19,7 +19,7 @@ The above copyright notice and either this complete permission notice or at a mi
19
19
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
20
 
21
21
  The Apache Software License, Version 2.0
22
- Copyright (c) 2016, 2017, Oracle and/or its affiliates.  All rights reserved.
22
+ Copyright (c) 2016, 2018, Oracle and/or its affiliates.  All rights reserved.
23
23
 
24
24
  Licensed under the Apache License, Version 2.0 (the "License"); You may not use this product except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. A copy of the license is also reproduced below. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
25
25
 
data/README_BMCS.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # Oracle Cloud Infrastructure Ruby SDK
2
- **Version 2.0.4**
2
+ **Version 2.0.5**
3
3
 
4
4
  This topic describes how to install, configure, and use the Oracle Cloud Infrastructure Ruby SDK.
5
5
 
@@ -224,6 +224,72 @@ The following example shows how to launch an instance (which assumes that you al
224
224
  instance_id = response.data.id
225
225
  response = api.get_instance(instance_id).wait_until(:lifecycle_state, OracleBMC::Core::Models::Instance::LIFECYCLE_STATE_RUNNING)
226
226
 
227
+ ### Waiting for state using a proc/lambda
228
+ Instead of waiting until the attribute of a resource reaches a given state, the `wait_until` method can also be passed a proc/lambda via its `eval_proc` keyword argument.
229
+ Using `eval_proc` may be useful in situations where logic other than checking if an attribute has a certain value is needed, for example checking
230
+ that an attribute is one of a possible set of values. `eval_proc` should take a single argument, which is the raw response received from the service call, and its result
231
+ should be a truthy value if the waiter should stop waiting, and it should be falsey otherwise. If the `eval_proc` is provided, then neither the `property`
232
+ nor `state` parameters should be provided.
233
+
234
+ An example using a lambda is:
235
+
236
+ require 'oraclebmc'
237
+
238
+ request = OracleBMC::Core::Models::CreateVcnDetails.new
239
+ request.cidr_block = '10.0.0.0/16'
240
+ request.display_name = 'my_test_vcn'
241
+ request.compartment_id = compartment_id # TODO: set your compartment ID here
242
+
243
+ api = OracleBMC::Core::VirtualNetworkClient.new
244
+ response = api.create_vcn(request)
245
+ vcn_id = response.data.id
246
+
247
+ response = api.get_vcn(vcn.id).wait_until(eval_proc: lambda { |response| response.data.lifecycle_state == OracleBMC::Core::Models::Vcn::LIFECYCLE_STATE_AVAILABLE })
248
+
249
+ An example using a proc is:
250
+
251
+ require 'oraclebmc'
252
+
253
+ request = OracleBMC::Core::Models::CreateVcnDetails.new
254
+ request.cidr_block = '10.0.0.0/16'
255
+ request.display_name = 'my_test_vcn'
256
+ request.compartment_id = compartment_id # TODO: set your compartment ID here
257
+
258
+ api = OracleBMC::Core::VirtualNetworkClient.new
259
+ response = api.create_vcn(request)
260
+ vcn_id = response.data.id
261
+
262
+ check_available_proc = Proc.new do |response|
263
+ [OracleBMC::Core::Models::Vcn::LIFECYCLE_STATE_AVAILABLE].include?(response.data.lifecycle_state)
264
+ end
265
+
266
+ response = api.get_vcn(vcn.id).wait_until(eval_proc: check_available_proc)
267
+
268
+ ### Waiting on terminated/deleted resources
269
+ When waiting for a request to be terminated/deleted, there is a chance that doing a GET of that resource will return a 404 because the resource is no longer available. Instead
270
+ of having to catch this, for example:
271
+
272
+ require 'oraclebmc'
273
+
274
+ api = OracleBMC::Core::VirtualNetworkClient.new
275
+ api.delete_vcn(vcn.id)
276
+
277
+ begin
278
+ api.get_vcn(vcn.id).wait_until(:lifecycle_state, OracleBMC::Core::Models::Vcn::LIFECYCLE_STATE_TERMINATED)
279
+ rescue OracleBMC::Errors::ServiceError => e
280
+ raise unless e.status_code == 404
281
+ end
282
+
283
+ You can instruct the waiter to take care of this for you and consider that a 404 means success. For example:
284
+
285
+ require 'oraclebmc'
286
+
287
+ api = OracleBMC::Core::VirtualNetworkClient.new
288
+ api.delete_vcn(vcn.id)
289
+ api.get_vcn(vcn.id).wait_until(:lifecycle_state, OracleBMC::Core::Models::Vcn::LIFECYCLE_STATE_TERMINATED, succeed_on_not_found: true)
290
+
291
+ Using the `succeed_on_not_found` keyword argument is likely only useful when waiting on temrinated/deleted resources.
292
+
227
293
  ### Signing a Raw Request
228
294
  The {OracleBMC::Signer} can be used to sign arbitrary requests to the Oracle Cloud Infrastructure Services. The following example uses Net::HTTP to call the IAM service directly.
229
295
 
data/lib/oraclebmc.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
2
 
3
3
  require 'oci'
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oraclebmc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oracle
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-11 00:00:00.000000000 Z
11
+ date: 2018-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oci
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 2.0.4
19
+ version: 2.0.5
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 2.0.4
26
+ version: 2.0.5
27
27
  description: "Ruby SDK for Oracle Cloud Infrastructure. \n \n This gem is deprecated
28
28
  and will no longer be maintained starting March 2018. Please move to 'oci' (https://rubygems.org/gems/oci)
29
29
  instead to avoid interruption."