oci 2.3.7 → 2.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/oci/core/blockstorage_client.rb +56 -24
  4. data/lib/oci/core/compute_client.rb +578 -24
  5. data/lib/oci/core/core.rb +11 -0
  6. data/lib/oci/core/models/app_catalog_listing.rb +242 -0
  7. data/lib/oci/core/models/app_catalog_listing_resource_version.rb +295 -0
  8. data/lib/oci/core/models/app_catalog_listing_resource_version_agreements.rb +219 -0
  9. data/lib/oci/core/models/app_catalog_listing_resource_version_summary.rb +194 -0
  10. data/lib/oci/core/models/app_catalog_listing_summary.rb +188 -0
  11. data/lib/oci/core/models/app_catalog_subscription.rb +246 -0
  12. data/lib/oci/core/models/app_catalog_subscription_summary.rb +246 -0
  13. data/lib/oci/core/models/create_app_catalog_subscription_details.rb +232 -0
  14. data/lib/oci/core/models/create_nat_gateway_details.rb +239 -0
  15. data/lib/oci/core/models/launch_instance_details.rb +4 -0
  16. data/lib/oci/core/models/nat_gateway.rb +333 -0
  17. data/lib/oci/core/models/public_ip.rb +76 -13
  18. data/lib/oci/core/models/service_gateway.rb +9 -4
  19. data/lib/oci/core/models/update_nat_gateway_details.rb +208 -0
  20. data/lib/oci/core/models/update_service_gateway_details.rb +9 -4
  21. data/lib/oci/core/virtual_network_client.rb +546 -91
  22. data/lib/oci/core/virtual_network_client_composite_operations.rb +119 -0
  23. data/lib/oci/object_storage/models/bucket.rb +18 -4
  24. data/lib/oci/object_storage/models/copy_object_details.rb +269 -0
  25. data/lib/oci/object_storage/models/multipart_upload.rb +1 -1
  26. data/lib/oci/object_storage/models/namespace_metadata.rb +1 -1
  27. data/lib/oci/object_storage/models/object_lifecycle_policy.rb +167 -0
  28. data/lib/oci/object_storage/models/object_lifecycle_rule.rb +245 -0
  29. data/lib/oci/object_storage/models/object_name_filter.rb +153 -0
  30. data/lib/oci/object_storage/models/preauthenticated_request.rb +1 -1
  31. data/lib/oci/object_storage/models/put_object_lifecycle_policy_details.rb +147 -0
  32. data/lib/oci/object_storage/models/restore_objects_details.rb +2 -2
  33. data/lib/oci/object_storage/models/work_request.rb +304 -0
  34. data/lib/oci/object_storage/models/work_request_error.rb +168 -0
  35. data/lib/oci/object_storage/models/work_request_log_entry.rb +156 -0
  36. data/lib/oci/object_storage/models/work_request_resource.rb +225 -0
  37. data/lib/oci/object_storage/models/work_request_resource_metadata_key.rb +12 -0
  38. data/lib/oci/object_storage/models/work_request_summary.rb +304 -0
  39. data/lib/oci/object_storage/object_storage.rb +12 -0
  40. data/lib/oci/object_storage/object_storage_client.rb +542 -17
  41. data/lib/oci/object_storage/object_storage_client_composite_operations.rb +53 -0
  42. data/lib/oci/version.rb +1 -1
  43. metadata +24 -2
@@ -19,6 +19,59 @@ module OCI
19
19
  def initialize(service_client = OCI::ObjectStorage::ObjectStorageClient.new)
20
20
  @service_client = service_client
21
21
  end
22
+
23
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
24
+ # rubocop:disable Layout/EmptyLines
25
+
26
+
27
+ # Calls {OCI::ObjectStorage::ObjectStorageClient#copy_object} and then waits for the {OCI::ObjectStorage::Models::WorkRequest}
28
+ # to enter the given state(s).
29
+ #
30
+ # @param [String] namespace_name The top-level namespace used for the request.
31
+ # @param [String] bucket_name The name of the bucket. Avoid entering confidential information.
32
+ # Example: `my-new-bucket1`
33
+ #
34
+ # @param [OCI::ObjectStorage::Models::CopyObjectDetails] copy_object_details The source and destination for object to be copied.
35
+ # @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::ObjectStorage::Models::WorkRequest#status}
36
+ # @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::ObjectStorage::ObjectStorageClient#copy_object}
37
+ # @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
38
+ # * max_interval_seconds: The maximum interval between queries, in seconds.
39
+ # * max_wait_seconds The maximum time to wait, in seconds
40
+ #
41
+ # @return [OCI::Response] A {OCI::Response} object containing the completed {OCI::ObjectStorage::Models::WorkRequest}
42
+ def copy_object_and_wait_for_state(namespace_name, bucket_name, copy_object_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
43
+ operation_result = @service_client.copy_object(namespace_name, bucket_name, copy_object_details, base_operation_opts)
44
+ use_util = OCI::ObjectStorage::Util.respond_to?(:wait_on_work_request)
45
+
46
+ return operation_result if wait_for_states.empty? && !use_util
47
+
48
+ lowered_wait_for_states = wait_for_states.map(&:downcase)
49
+ wait_for_resource_id = operation_result.headers['opc-work-request-id']
50
+
51
+ begin
52
+ if use_util
53
+ waiter_result = OCI::ObjectStorage::Util.wait_on_work_request(
54
+ @service_client,
55
+ wait_for_resource_id,
56
+ max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
57
+ max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
58
+ )
59
+ else
60
+ waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
61
+ eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
62
+ max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
63
+ max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
64
+ )
65
+ end
66
+ result_to_return = waiter_result
67
+
68
+ return result_to_return
69
+ rescue StandardError
70
+ raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
71
+ end
72
+ end
73
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/ParameterLists, Metrics/PerceivedComplexity
74
+ # rubocop:enable Layout/EmptyLines
22
75
  end
23
76
  end
24
77
  # rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
@@ -1,5 +1,5 @@
1
1
  # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
2
 
3
3
  module OCI
4
- VERSION = '2.3.7'.freeze
4
+ VERSION = '2.3.8'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oci
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.7
4
+ version: 2.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oracle
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-26 00:00:00.000000000 Z
11
+ date: 2018-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -253,6 +253,13 @@ files:
253
253
  - "./lib/oci/core/compute_client.rb"
254
254
  - "./lib/oci/core/compute_client_composite_operations.rb"
255
255
  - "./lib/oci/core/core.rb"
256
+ - "./lib/oci/core/models/app_catalog_listing.rb"
257
+ - "./lib/oci/core/models/app_catalog_listing_resource_version.rb"
258
+ - "./lib/oci/core/models/app_catalog_listing_resource_version_agreements.rb"
259
+ - "./lib/oci/core/models/app_catalog_listing_resource_version_summary.rb"
260
+ - "./lib/oci/core/models/app_catalog_listing_summary.rb"
261
+ - "./lib/oci/core/models/app_catalog_subscription.rb"
262
+ - "./lib/oci/core/models/app_catalog_subscription_summary.rb"
256
263
  - "./lib/oci/core/models/attach_boot_volume_details.rb"
257
264
  - "./lib/oci/core/models/attach_i_scsi_volume_details.rb"
258
265
  - "./lib/oci/core/models/attach_paravirtualized_volume_details.rb"
@@ -272,6 +279,7 @@ files:
272
279
  - "./lib/oci/core/models/connect_remote_peering_connections_details.rb"
273
280
  - "./lib/oci/core/models/console_history.rb"
274
281
  - "./lib/oci/core/models/cpe.rb"
282
+ - "./lib/oci/core/models/create_app_catalog_subscription_details.rb"
275
283
  - "./lib/oci/core/models/create_boot_volume_backup_details.rb"
276
284
  - "./lib/oci/core/models/create_boot_volume_details.rb"
277
285
  - "./lib/oci/core/models/create_cpe_details.rb"
@@ -285,6 +293,7 @@ files:
285
293
  - "./lib/oci/core/models/create_internet_gateway_details.rb"
286
294
  - "./lib/oci/core/models/create_ip_sec_connection_details.rb"
287
295
  - "./lib/oci/core/models/create_local_peering_gateway_details.rb"
296
+ - "./lib/oci/core/models/create_nat_gateway_details.rb"
288
297
  - "./lib/oci/core/models/create_private_ip_details.rb"
289
298
  - "./lib/oci/core/models/create_public_ip_details.rb"
290
299
  - "./lib/oci/core/models/create_remote_peering_connection_details.rb"
@@ -342,6 +351,7 @@ files:
342
351
  - "./lib/oci/core/models/launch_options.rb"
343
352
  - "./lib/oci/core/models/letter_of_authority.rb"
344
353
  - "./lib/oci/core/models/local_peering_gateway.rb"
354
+ - "./lib/oci/core/models/nat_gateway.rb"
345
355
  - "./lib/oci/core/models/paravirtualized_volume_attachment.rb"
346
356
  - "./lib/oci/core/models/peer_region_for_remote_peering.rb"
347
357
  - "./lib/oci/core/models/port_range.rb"
@@ -376,6 +386,7 @@ files:
376
386
  - "./lib/oci/core/models/update_internet_gateway_details.rb"
377
387
  - "./lib/oci/core/models/update_ip_sec_connection_details.rb"
378
388
  - "./lib/oci/core/models/update_local_peering_gateway_details.rb"
389
+ - "./lib/oci/core/models/update_nat_gateway_details.rb"
379
390
  - "./lib/oci/core/models/update_private_ip_details.rb"
380
391
  - "./lib/oci/core/models/update_public_ip_details.rb"
381
392
  - "./lib/oci/core/models/update_remote_peering_connection_details.rb"
@@ -679,6 +690,7 @@ files:
679
690
  - "./lib/oci/object_storage/models/bucket_summary.rb"
680
691
  - "./lib/oci/object_storage/models/commit_multipart_upload_details.rb"
681
692
  - "./lib/oci/object_storage/models/commit_multipart_upload_part_details.rb"
693
+ - "./lib/oci/object_storage/models/copy_object_details.rb"
682
694
  - "./lib/oci/object_storage/models/create_bucket_details.rb"
683
695
  - "./lib/oci/object_storage/models/create_multipart_upload_details.rb"
684
696
  - "./lib/oci/object_storage/models/create_preauthenticated_request_details.rb"
@@ -686,13 +698,23 @@ files:
686
698
  - "./lib/oci/object_storage/models/multipart_upload.rb"
687
699
  - "./lib/oci/object_storage/models/multipart_upload_part_summary.rb"
688
700
  - "./lib/oci/object_storage/models/namespace_metadata.rb"
701
+ - "./lib/oci/object_storage/models/object_lifecycle_policy.rb"
702
+ - "./lib/oci/object_storage/models/object_lifecycle_rule.rb"
703
+ - "./lib/oci/object_storage/models/object_name_filter.rb"
689
704
  - "./lib/oci/object_storage/models/object_summary.rb"
690
705
  - "./lib/oci/object_storage/models/preauthenticated_request.rb"
691
706
  - "./lib/oci/object_storage/models/preauthenticated_request_summary.rb"
707
+ - "./lib/oci/object_storage/models/put_object_lifecycle_policy_details.rb"
692
708
  - "./lib/oci/object_storage/models/rename_object_details.rb"
693
709
  - "./lib/oci/object_storage/models/restore_objects_details.rb"
694
710
  - "./lib/oci/object_storage/models/update_bucket_details.rb"
695
711
  - "./lib/oci/object_storage/models/update_namespace_metadata_details.rb"
712
+ - "./lib/oci/object_storage/models/work_request.rb"
713
+ - "./lib/oci/object_storage/models/work_request_error.rb"
714
+ - "./lib/oci/object_storage/models/work_request_log_entry.rb"
715
+ - "./lib/oci/object_storage/models/work_request_resource.rb"
716
+ - "./lib/oci/object_storage/models/work_request_resource_metadata_key.rb"
717
+ - "./lib/oci/object_storage/models/work_request_summary.rb"
696
718
  - "./lib/oci/object_storage/object_storage.rb"
697
719
  - "./lib/oci/object_storage/object_storage_client.rb"
698
720
  - "./lib/oci/object_storage/object_storage_client_composite_operations.rb"