oci 2.0.6 → 2.0.7
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.
- checksums.yaml +4 -4
- data/README.md +23 -1
- data/lib/oci.rb +4 -7
- data/lib/oci/api_client.rb +51 -6
- data/lib/oci/auth/auth.rb +5 -2
- data/lib/oci/auth/federation_client.rb +2 -2
- data/lib/oci/auth/internal/auth_token_request_signer.rb +2 -2
- data/lib/oci/auth/security_token_container.rb +2 -2
- data/lib/oci/auth/session_key_supplier.rb +3 -4
- data/lib/oci/auth/signers/instance_principals_security_token_signer.rb +30 -17
- data/lib/oci/auth/signers/security_token_signer.rb +13 -6
- data/lib/oci/auth/signers/x509_federation_client_based_security_token_signer.rb +8 -4
- data/lib/oci/auth/url_based_certificate_retriever.rb +3 -4
- data/lib/oci/auth/util.rb +6 -4
- data/lib/oci/base_signer.rb +54 -50
- data/lib/oci/config_file_loader.rb +3 -11
- data/lib/oci/core/blockstorage_client.rb +211 -0
- data/lib/oci/core/compute_client.rb +4 -2
- data/lib/oci/core/core.rb +9 -0
- data/lib/oci/core/models/attach_i_scsi_volume_details.rb +5 -1
- data/lib/oci/core/models/attach_volume_details.rb +13 -1
- data/lib/oci/core/models/create_public_ip_details.rb +186 -0
- data/lib/oci/core/models/create_vnic_details.rb +8 -2
- data/lib/oci/core/models/create_volume_backup_details.rb +27 -1
- data/lib/oci/core/models/create_volume_backup_policy_assignment_details.rb +133 -0
- data/lib/oci/core/models/create_volume_details.rb +15 -1
- data/lib/oci/core/models/get_public_ip_by_ip_address_details.rb +125 -0
- data/lib/oci/core/models/get_public_ip_by_private_ip_id_details.rb +124 -0
- data/lib/oci/core/models/i_scsi_volume_attachment.rb +5 -1
- data/lib/oci/core/models/public_ip.rb +328 -0
- data/lib/oci/core/models/update_public_ip_details.rb +140 -0
- data/lib/oci/core/models/volume_attachment.rb +13 -1
- data/lib/oci/core/models/volume_backup.rb +72 -1
- data/lib/oci/core/models/volume_backup_policy.rb +161 -0
- data/lib/oci/core/models/volume_backup_policy_assignment.rb +159 -0
- data/lib/oci/core/models/volume_backup_schedule.rb +191 -0
- data/lib/oci/core/virtual_network_client.rb +374 -4
- data/lib/oci/database/database_client.rb +3 -1
- data/lib/oci/dns/dns.rb +34 -0
- data/lib/oci/dns/dns_client.rb +985 -0
- data/lib/oci/dns/models/create_zone_details.rb +174 -0
- data/lib/oci/dns/models/external_master.rb +145 -0
- data/lib/oci/dns/models/patch_domain_records_details.rb +120 -0
- data/lib/oci/dns/models/patch_rr_set_details.rb +120 -0
- data/lib/oci/dns/models/patch_zone_records_details.rb +120 -0
- data/lib/oci/dns/models/record.rb +204 -0
- data/lib/oci/dns/models/record_collection.rb +121 -0
- data/lib/oci/dns/models/record_details.rb +204 -0
- data/lib/oci/dns/models/record_operation.rb +253 -0
- data/lib/oci/dns/models/rr_set.rb +123 -0
- data/lib/oci/dns/models/sort_order.rb +12 -0
- data/lib/oci/dns/models/tsig.rb +149 -0
- data/lib/oci/dns/models/update_domain_records_details.rb +120 -0
- data/lib/oci/dns/models/update_rr_set_details.rb +120 -0
- data/lib/oci/dns/models/update_zone_details.rb +122 -0
- data/lib/oci/dns/models/update_zone_records_details.rb +120 -0
- data/lib/oci/dns/models/zone.rb +272 -0
- data/lib/oci/dns/models/zone_summary.rb +230 -0
- data/lib/oci/dns/util.rb +2 -0
- data/lib/oci/errors.rb +20 -0
- data/lib/oci/identity/identity_client.rb +1 -0
- data/lib/oci/identity/models/create_dynamic_group_details.rb +4 -2
- data/lib/oci/identity/models/dynamic_group.rb +9 -6
- data/lib/oci/identity/models/update_dynamic_group_details.rb +4 -2
- data/lib/oci/load_balancer/load_balancer.rb +6 -0
- data/lib/oci/load_balancer/load_balancer_client.rb +219 -0
- data/lib/oci/load_balancer/models/create_listener_details.rb +17 -1
- data/lib/oci/load_balancer/models/create_load_balancer_details.rb +12 -1
- data/lib/oci/load_balancer/models/create_path_route_set_details.rb +138 -0
- data/lib/oci/load_balancer/models/listener.rb +17 -1
- data/lib/oci/load_balancer/models/listener_details.rb +17 -1
- data/lib/oci/load_balancer/models/load_balancer.rb +12 -1
- data/lib/oci/load_balancer/models/path_match_type.rb +153 -0
- data/lib/oci/load_balancer/models/path_route.rb +161 -0
- data/lib/oci/load_balancer/models/path_route_set.rb +139 -0
- data/lib/oci/load_balancer/models/path_route_set_details.rb +122 -0
- data/lib/oci/load_balancer/models/update_listener_details.rb +17 -1
- data/lib/oci/load_balancer/models/update_path_route_set_details.rb +122 -0
- data/lib/oci/load_balancer/util.rb +1 -3
- data/lib/oci/object_storage/transfer/multipart/internal/file_part_io_wrapper.rb +111 -0
- data/lib/oci/object_storage/transfer/multipart/internal/multipart_upload_parts_collection.rb +41 -0
- data/lib/oci/object_storage/transfer/multipart/internal/seekable_non_file_part_io_wrapper.rb +48 -0
- data/lib/oci/object_storage/transfer/multipart/internal/stdin_part_io_wrapper.rb +54 -0
- data/lib/oci/object_storage/transfer/multipart/multipart_object_assembler.rb +545 -0
- data/lib/oci/object_storage/transfer/transfer.rb +31 -0
- data/lib/oci/object_storage/transfer/upload_manager.rb +212 -0
- data/lib/oci/object_storage/transfer/upload_manager_config.rb +60 -0
- data/lib/oci/regions.rb +3 -1
- data/lib/oci/response.rb +1 -3
- data/lib/oci/version.rb +1 -1
- data/lib/oci/waiter.rb +16 -11
- data/lib/oraclebmc.rb +1 -1
- metadata +46 -2
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
|
2
|
+
|
|
3
|
+
module OCI
|
|
4
|
+
module ObjectStorage
|
|
5
|
+
# This module contains functionality to simplifies interaction with the Object Storage service by
|
|
6
|
+
# abstracting away the method used to upload objects, and will automatically break an upload into
|
|
7
|
+
# multiple parts if needed (based on provided configuration).
|
|
8
|
+
#
|
|
9
|
+
# The main entry point to this module should be the {OCI::ObjectStorage::Transfer::UploadManager}
|
|
10
|
+
# class.
|
|
11
|
+
module Transfer
|
|
12
|
+
MEBIBYTE = 1024 * 1024
|
|
13
|
+
MULTIPART_UPLOAD_THRESHOLD = 128 * MEBIBYTE
|
|
14
|
+
MULTIPART_PART_SIZE = 128 * MEBIBYTE
|
|
15
|
+
NON_FILE_IO_MULTIPART_PART_SIZE = 10 * MEBIBYTE
|
|
16
|
+
|
|
17
|
+
# This module contains functionality to handle multipart uploads to Object Storage
|
|
18
|
+
module Multipart
|
|
19
|
+
DEFAULT_PARALLEL_PROCESS_COUNT = 3
|
|
20
|
+
|
|
21
|
+
# Internal helper functions and classes for multipart uploads. Not intended for public use
|
|
22
|
+
module Internal
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
require 'oci/object_storage/transfer/upload_manager_config'
|
|
30
|
+
require 'oci/object_storage/transfer/upload_manager'
|
|
31
|
+
require 'oci/object_storage/transfer/multipart/multipart_object_assembler'
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
|
2
|
+
|
|
3
|
+
require_relative 'upload_manager_config'
|
|
4
|
+
require_relative 'multipart/multipart_object_assembler'
|
|
5
|
+
|
|
6
|
+
module OCI
|
|
7
|
+
module ObjectStorage
|
|
8
|
+
module Transfer
|
|
9
|
+
# UploadManager simplifies interaction with the Object Storage service by abstracting away the method used
|
|
10
|
+
# to upload objects. Depending on the configuration parameters, UploadManager may choose to do a single
|
|
11
|
+
# put_object request, or break up the upload into multiple parts and utilize multi-part uploads.
|
|
12
|
+
#
|
|
13
|
+
# An advantage of using multi-part uploads is the ability to retry individual failed parts, as well as being
|
|
14
|
+
# able to upload parts in parallel to reduce upload time.
|
|
15
|
+
class UploadManager
|
|
16
|
+
# The client used to interact with the Object Storage service
|
|
17
|
+
# @return [OCI::ObjectStorage::ObjectStorageClient]
|
|
18
|
+
attr_accessor :object_storage_client
|
|
19
|
+
|
|
20
|
+
# Configuration for the UploadManager
|
|
21
|
+
# @return [OCI::ObjectStorage::Transfer::UploadManagerConfig]
|
|
22
|
+
attr_accessor :upload_manager_config
|
|
23
|
+
|
|
24
|
+
# Creates a new UploadManager
|
|
25
|
+
#
|
|
26
|
+
# @param [OCI::ObjectStorage::ObjectStorageClient] object_storage_client The client used to interact with the Object Storage service
|
|
27
|
+
# @param [OCI::ObjectStorage::Transfer::UploadManagerConfig] upload_manager_config Configuration for the UploadManager. If not provided
|
|
28
|
+
# then default configuration values are used
|
|
29
|
+
def initialize(object_storage_client:, upload_manager_config: OCI::ObjectStorage::Transfer::UploadManagerConfig.new)
|
|
30
|
+
@object_storage_client = object_storage_client
|
|
31
|
+
@upload_manager_config = upload_manager_config
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Uploads an object to Object Storage. The object can be a path to a file, an IO-like object, or $stdin. Depending on
|
|
35
|
+
# the configuration of the UploadManager and the object provided, it may be uploaded in multiple parts. Note that input
|
|
36
|
+
# from $stdin will always be uploaded via a multipart upload.
|
|
37
|
+
#
|
|
38
|
+
# @param [String] namespace_name The namespace containing the bucket in which to store the object
|
|
39
|
+
# @param [String] bucket_name The bucket where we'll upload the object
|
|
40
|
+
# @param [String] object_name The name of the object in Object Storage
|
|
41
|
+
# @param [String, IO] object_io_or_file_path Either a path to the file to upload, an IO-like object containing the data to upload or $stdin.
|
|
42
|
+
#
|
|
43
|
+
# @param [Hash] opts the optional parameters
|
|
44
|
+
# @option opts [String] :if_match The entity tag to match
|
|
45
|
+
# @option opts [String] :if_none_match The entity tag to avoid matching. The only valid value is *, which indicates that the request should fail if the object already exists.
|
|
46
|
+
# @option opts [String] :opc_client_request_id The client request ID for tracing.
|
|
47
|
+
# @option opts [Integer] :content_length The content length of the body. This will be ignored for multipart uploads.
|
|
48
|
+
# @option opts [String] :content_type The content type of the object. Defaults to 'application/octet-stream' if not overridden.
|
|
49
|
+
# @option opts [String] :content_language The content language of the object.
|
|
50
|
+
# @option opts [String] :content_encoding The content encoding of the object.
|
|
51
|
+
# @option opts [String] :content_md5 The base-64 encoded MD5 hash of the body. This will be ignored for multipart uploads.
|
|
52
|
+
# @option opts [Hash<String, String>] :metadata A hash of string keys to string values representing any custom metadata to be applied to the object.
|
|
53
|
+
#
|
|
54
|
+
# @return [Response] A Response object with data of type nil. For a multipart upload, the headers of the response will contain
|
|
55
|
+
# an opc-multipart-md5 key. For scenarios where the object was uploaded in a single part, the opc-content-md5 key will be
|
|
56
|
+
# present in the headers of the Response.
|
|
57
|
+
#
|
|
58
|
+
# @raise [OCI::Errors::MultipartUploadError] if an error occurred when performing a multipart upload. Consult the errors collection inside
|
|
59
|
+
# the exception to check the underlying errors which caused the failure.
|
|
60
|
+
def upload(namespace_name, bucket_name, object_name, object_io_or_file_path, opts = {})
|
|
61
|
+
raise 'A namespace_name must be provided' if namespace_name.nil?
|
|
62
|
+
raise 'A bucket_name must be provided' if bucket_name.nil?
|
|
63
|
+
raise 'An object_name must be provided' if object_name.nil?
|
|
64
|
+
raise 'An object_io_or_file_path must be provided' if object_io_or_file_path.nil?
|
|
65
|
+
|
|
66
|
+
content_length = File.size(object_io_or_file_path) if object_io_or_file_path.is_a?(String)
|
|
67
|
+
|
|
68
|
+
unless object_io_or_file_path.is_a?(String)
|
|
69
|
+
content_length = object_io_or_file_path.size if object_io_or_file_path.respond_to?(:size)
|
|
70
|
+
content_length = object_io_or_file_path.stat.size unless object_io_or_file_path.respond_to?(:size)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# $stdin is always multipart uploaded (since we can't always make a size guarantee). Otherwise, it depends on the UploadManager settings
|
|
74
|
+
# and the size of the object identified by object_io_or_file_path
|
|
75
|
+
return upload_multipart(namespace_name, bucket_name, object_name, object_io_or_file_path, opts) \
|
|
76
|
+
if object_io_or_file_path.eql?($stdin)
|
|
77
|
+
|
|
78
|
+
return upload_single(namespace_name, bucket_name, object_name, object_io_or_file_path, opts) \
|
|
79
|
+
unless use_multipart?(content_length)
|
|
80
|
+
|
|
81
|
+
upload_multipart(namespace_name, bucket_name, object_name, object_io_or_file_path, opts)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Resumes a multipart upload. Note that the multipart upload part size which has been configured for this UploadManager needs to match
|
|
85
|
+
# the part size of any parts which have previously been uploaded for the given multipart upload.
|
|
86
|
+
#
|
|
87
|
+
# @param [String] upload_id The ID of the multipart upload to resume.
|
|
88
|
+
# @param [String] namespace_name The namespace containing the bucket in which to store the object
|
|
89
|
+
# @param [String] bucket_name The bucket where we'll upload the object
|
|
90
|
+
# @param [String] object_name The name of the object in Object Storage
|
|
91
|
+
# @param [String, IO] object_io_or_file_path Either a path to the file to upload, an IO-like object containing the data to upload or $stdin.
|
|
92
|
+
#
|
|
93
|
+
# @param [Hash] opts the optional parameters
|
|
94
|
+
# @option opts [String] :opc_client_request_id The client request ID for tracing.
|
|
95
|
+
#
|
|
96
|
+
# @return [Response] A Response object with data of type nil. For a multipart upload, the headers of the response will contain
|
|
97
|
+
# an opc-multipart-md5 key. For scenarios where the object was uploaded in a single part, the opc-content-md5 key will be
|
|
98
|
+
# present in the headers of the Response.
|
|
99
|
+
#
|
|
100
|
+
# @raise [OCI::Errors::MultipartUploadError] if an error occurred when performing a multipart upload. Consult the errors collection inside
|
|
101
|
+
# the exception to check the underlying errors which caused the failure
|
|
102
|
+
def resume(upload_id, namespace_name, bucket_name, object_name, object_io_or_file_path, opts = {})
|
|
103
|
+
raise 'An upload_id must be provided' if upload_id.nil?
|
|
104
|
+
raise 'A namespace_name must be provided' if namespace_name.nil?
|
|
105
|
+
raise 'A bucket_name must be provided' if bucket_name.nil?
|
|
106
|
+
raise 'An object_name must be provided' if object_name.nil?
|
|
107
|
+
raise 'An object_io_or_file_path must be provided' if object_io_or_file_path.nil?
|
|
108
|
+
|
|
109
|
+
assembler = OCI::ObjectStorage::Transfer::Multipart::MultipartObjectAssembler.new(
|
|
110
|
+
object_storage_client: @object_storage_client,
|
|
111
|
+
namespace: namespace_name,
|
|
112
|
+
bucket_name: bucket_name,
|
|
113
|
+
object_name: object_name,
|
|
114
|
+
multipart_part_size: @upload_manager_config.multipart_part_size,
|
|
115
|
+
non_file_io_multipart_part_size: @upload_manager_config.non_file_io_multipart_part_size,
|
|
116
|
+
parallel_process_count: multipart_parallel_process_count,
|
|
117
|
+
multipart_upload_opts: opts
|
|
118
|
+
)
|
|
119
|
+
assembler.io_for_transfer = object_io_or_file_path
|
|
120
|
+
|
|
121
|
+
errors = assembler.resume(upload_id)
|
|
122
|
+
raise OCI::Errors::MultipartUploadError('Errors occurred while resuming the multipart upload', errors, upload_id) \
|
|
123
|
+
unless errors.empty?
|
|
124
|
+
|
|
125
|
+
assembler.commit
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Aborts a multipart upload.
|
|
129
|
+
#
|
|
130
|
+
# @param [String] upload_id The ID of the multipart upload to abort.
|
|
131
|
+
# @param [String] namespace_name The namespace containing the bucket in which to store the object
|
|
132
|
+
# @param [String] bucket_name The bucket where we'll upload the object
|
|
133
|
+
# @param [String] object_name The name of the object in Object Storage
|
|
134
|
+
#
|
|
135
|
+
# @param [Hash] opts the optional parameters
|
|
136
|
+
# @option opts [String] :opc_client_request_id The client request ID for tracing.
|
|
137
|
+
#
|
|
138
|
+
# @return [Response] A Response object with data of type nil
|
|
139
|
+
def abort(upload_id, namespace_name, bucket_name, object_name, opts = {})
|
|
140
|
+
raise 'An upload_id must be provided' if upload_id.nil?
|
|
141
|
+
raise 'A namespace_name must be provided' if namespace_name.nil?
|
|
142
|
+
raise 'A bucket_name must be provided' if bucket_name.nil?
|
|
143
|
+
raise 'An object_name must be provided' if object_name.nil?
|
|
144
|
+
|
|
145
|
+
assembler = OCI::ObjectStorage::Transfer::Multipart::MultipartObjectAssembler.new(
|
|
146
|
+
object_storage_client: @object_storage_client,
|
|
147
|
+
namespace: namespace_name,
|
|
148
|
+
bucket_name: bucket_name,
|
|
149
|
+
object_name: object_name,
|
|
150
|
+
multipart_upload_opts: opts
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
assembler.abort(upload_id)
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
private
|
|
157
|
+
|
|
158
|
+
def use_multipart?(content_length)
|
|
159
|
+
@upload_manager_config.allow_multipart && content_length >= @upload_manager_config.multipart_upload_threshold
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
def multipart_parallel_process_count
|
|
163
|
+
return 1 unless @upload_manager_config.allow_parallel_multipart_uploads
|
|
164
|
+
@upload_manager_config.parallel_process_count
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
def upload_single(namespace_name, bucket_name, object_name, object_io_or_file_path, opts = {})
|
|
168
|
+
opts[:opc_meta] = opts.delete(:metadata) if opts.key?(:metadata)
|
|
169
|
+
|
|
170
|
+
if object_io_or_file_path.is_a?(String)
|
|
171
|
+
File.open(object_io_or_file_path) do |file|
|
|
172
|
+
@object_storage_client.put_object(namespace_name, bucket_name, object_name, file, opts)
|
|
173
|
+
end
|
|
174
|
+
else
|
|
175
|
+
@object_storage_client.put_object(namespace_name, bucket_name, object_name, object_io_or_file_path, opts)
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
def upload_multipart(namespace_name, bucket_name, object_name, object_io_or_file_path, opts = {})
|
|
180
|
+
assembler = OCI::ObjectStorage::Transfer::Multipart::MultipartObjectAssembler.new(
|
|
181
|
+
object_storage_client: @object_storage_client,
|
|
182
|
+
namespace: namespace_name,
|
|
183
|
+
bucket_name: bucket_name,
|
|
184
|
+
object_name: object_name,
|
|
185
|
+
multipart_part_size: @upload_manager_config.multipart_part_size,
|
|
186
|
+
non_file_io_multipart_part_size: @upload_manager_config.non_file_io_multipart_part_size,
|
|
187
|
+
parallel_process_count: multipart_parallel_process_count,
|
|
188
|
+
multipart_upload_opts: opts
|
|
189
|
+
)
|
|
190
|
+
|
|
191
|
+
upload_id = assembler.new_upload.data.upload_id
|
|
192
|
+
assembler.io_for_transfer = object_io_or_file_path
|
|
193
|
+
|
|
194
|
+
errors = assembler.upload
|
|
195
|
+
|
|
196
|
+
# stdin is not resumable, so abort the upload if there were errors
|
|
197
|
+
assembler.abort(upload_id) if !errors.empty? && object_io_or_file_path.eql?($stdin)
|
|
198
|
+
|
|
199
|
+
unless errors.empty?
|
|
200
|
+
raise OCI::Errors::MultipartUploadError.new(
|
|
201
|
+
'Errors occurred while performing the multipart upload',
|
|
202
|
+
errors,
|
|
203
|
+
upload_id
|
|
204
|
+
)
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
assembler.commit
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
end
|
|
211
|
+
end
|
|
212
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
|
|
2
|
+
|
|
3
|
+
module OCI
|
|
4
|
+
module ObjectStorage
|
|
5
|
+
module Transfer
|
|
6
|
+
# A bag of configuration properties that can be used to configure {OCI::ObjectStorage::Transfer::UploadManager}
|
|
7
|
+
class UploadManagerConfig
|
|
8
|
+
# Whether to allow multipart uploads or not. Defaults to true
|
|
9
|
+
# @return [Boolean]
|
|
10
|
+
attr_accessor :allow_multipart
|
|
11
|
+
|
|
12
|
+
# For multipart uploads, whether we can upload parts in parallel. Defaults to true
|
|
13
|
+
# @return [Boolean]
|
|
14
|
+
attr_accessor :allow_parallel_multipart_uploads
|
|
15
|
+
|
|
16
|
+
# How many parts we can upload in parallel. Defaults to 3. If this is set to 1, this is the
|
|
17
|
+
# equivalent of not allowing parts to be uploaded in parallel.
|
|
18
|
+
# @return [Integer]
|
|
19
|
+
attr_accessor :parallel_process_count
|
|
20
|
+
|
|
21
|
+
# The size, in bytes, which a file (or IO-like object) needs to exceed before we attempt a multipart upload.
|
|
22
|
+
# Defaults to 128 MiB (128 * 1024 * 1024 bytes)
|
|
23
|
+
# @return [Integer]
|
|
24
|
+
attr_accessor :multipart_upload_threshold
|
|
25
|
+
|
|
26
|
+
# The size, in bytes, of each part of a multipart upload. This applies when we are uploading files from disk
|
|
27
|
+
# and defaults to 128 MiB
|
|
28
|
+
# @return [Integer]
|
|
29
|
+
attr_accessor :multipart_part_size
|
|
30
|
+
|
|
31
|
+
# The size, in bytes, of each part of a multipart upload when we are reading from stdin or a non-file IO-like
|
|
32
|
+
# source (e.g. a StringIO). Defaults to 10 MiB
|
|
33
|
+
# @return [Integer]
|
|
34
|
+
attr_accessor :non_file_io_multipart_part_size
|
|
35
|
+
|
|
36
|
+
# Creates a new UploadManagerConfig.
|
|
37
|
+
#
|
|
38
|
+
# @param [Boolean] allow_multipart Whether to allow multipart uploads or not. Defaults to true
|
|
39
|
+
# @param [Boolean] allow_parallel_multipart_uploads For multipart uploads, whether we can upload parts in parallel. Defaults to true
|
|
40
|
+
# @param [Integer] parallel_process_count How many parts we can upload in parallel. Defaults to 3
|
|
41
|
+
# @param [Integer] multipart_upload_threshold The size, in bytes, which a file (or IO-like object) needs to exceed before we attempt a multipart upload. Defaults to 128 MiB
|
|
42
|
+
# @param [Integer] multipart_part_size The size, in bytes, of each part of a multipart upload. This applies when we are uploading files from disk and defaults to 128 MiB
|
|
43
|
+
# @param [Integer] non_file_io_multipart_part_size The size, in bytes, of each part of a multipart upload when we are reading from stdin or a non-file IO-like source (e.g. a StringIO). Defaults to 10 MiB
|
|
44
|
+
def initialize(allow_multipart: true,
|
|
45
|
+
allow_parallel_multipart_uploads: true,
|
|
46
|
+
parallel_process_count: OCI::ObjectStorage::Transfer::Multipart::DEFAULT_PARALLEL_PROCESS_COUNT,
|
|
47
|
+
multipart_upload_threshold: OCI::ObjectStorage::Transfer::MULTIPART_UPLOAD_THRESHOLD,
|
|
48
|
+
multipart_part_size: OCI::ObjectStorage::Transfer::MULTIPART_PART_SIZE,
|
|
49
|
+
non_file_io_multipart_part_size: OCI::ObjectStorage::Transfer::NON_FILE_IO_MULTIPART_PART_SIZE)
|
|
50
|
+
@allow_multipart = allow_multipart
|
|
51
|
+
@allow_parallel_multipart_uploads = allow_parallel_multipart_uploads
|
|
52
|
+
@parallel_process_count = parallel_process_count
|
|
53
|
+
@multipart_upload_threshold = multipart_upload_threshold
|
|
54
|
+
@multipart_part_size = multipart_part_size
|
|
55
|
+
@non_file_io_multipart_part_size = non_file_io_multipart_part_size
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
data/lib/oci/regions.rb
CHANGED
|
@@ -24,7 +24,9 @@ module OCI
|
|
|
24
24
|
ObjectStorageClient: 'objectstorage',
|
|
25
25
|
DatabaseClient: 'database',
|
|
26
26
|
AuditClient: 'audit',
|
|
27
|
-
Auth: 'auth'
|
|
27
|
+
Auth: 'auth',
|
|
28
|
+
DnsClient: 'dns',
|
|
29
|
+
FileStorageClient: 'filestorage'
|
|
28
30
|
}.freeze
|
|
29
31
|
|
|
30
32
|
# Returns an endpoint for the given region and service.
|
data/lib/oci/response.rb
CHANGED
|
@@ -68,9 +68,7 @@ module OCI
|
|
|
68
68
|
while @api_call && page
|
|
69
69
|
next_response = @api_call.call(page)
|
|
70
70
|
|
|
71
|
-
if page == next_response.next_page
|
|
72
|
-
raise 'Paging failure: Two consecutive responses had the same next page token.'
|
|
73
|
-
end
|
|
71
|
+
raise 'Paging failure: Two consecutive responses had the same next page token.' if page == next_response.next_page
|
|
74
72
|
|
|
75
73
|
page = next_response.next_page
|
|
76
74
|
yield next_response
|
data/lib/oci/version.rb
CHANGED
data/lib/oci/waiter.rb
CHANGED
|
@@ -45,19 +45,26 @@ module OCI
|
|
|
45
45
|
# @param [Symbol] property The property of the response data to evaluate. For example, :lifecycle_state.
|
|
46
46
|
# @param state The value of the property that will indicate successful completion of the wait.
|
|
47
47
|
# @param [Proc] eval_proc A proc/lambda which can be fed a response from a GET operation and evaluate whether a waiter should return
|
|
48
|
-
#
|
|
49
|
-
#
|
|
50
|
-
#
|
|
48
|
+
# or keep checking. This can be used for logic which extends beyond checking equality of a single attribute, for example checking
|
|
49
|
+
# that an attribute is one of a possible set of values. If an eval_proc is specified, then neither a property nor state can
|
|
50
|
+
# be specified. The result of the proc/lambda should be truthy if the waiter should stop waiting, and falsey otherwise.
|
|
51
51
|
# @param [Integer] max_interval_seconds The maximum interval between queries, in seconds.
|
|
52
52
|
# @param [Integer] max_wait_seconds The maximum time to wait, in seconds.
|
|
53
|
-
# @param [boolean] succeed_on_not_found A boolean determining whether or not the waiter should return successfully if the data we're waiting on is not found (e.g. a 404 is
|
|
54
|
-
#
|
|
55
|
-
#
|
|
53
|
+
# @param [boolean] succeed_on_not_found A boolean determining whether or not the waiter should return successfully if the data we're waiting on is not found (e.g. a 404 is
|
|
54
|
+
# returned from the service). This defaults to false and so a 404 would cause an exception to be thrown by this function. Setting it to true may be useful
|
|
55
|
+
# in scenarios when waiting for a resource to be terminated/deleted since it is possible that the resource would not be returned by the a GET call anymore.
|
|
56
56
|
# @yieldparam [Response] response A response object for every additional successful call to the get request.
|
|
57
57
|
# Throw :stop_succeed from the yield to stop the waiter and return the current response.
|
|
58
58
|
# Throw :stop_fail from the yield to stop the waiter and throw a WaiterFailedError.
|
|
59
59
|
# @return [Response] The final response, which will contain the property in the specified state.
|
|
60
|
-
def wait_until(
|
|
60
|
+
def wait_until(
|
|
61
|
+
property = nil,
|
|
62
|
+
state = nil,
|
|
63
|
+
eval_proc: nil,
|
|
64
|
+
max_interval_seconds: 30,
|
|
65
|
+
max_wait_seconds: 1200,
|
|
66
|
+
succeed_on_not_found: false
|
|
67
|
+
)
|
|
61
68
|
raise 'Cannot wait on a response without data.' unless data
|
|
62
69
|
raise 'Either an eval_proc or a property and response must be specified' if !eval_proc && property.nil? && state.nil?
|
|
63
70
|
raise 'Cannot specify both an eval_proc and a property or state' if eval_proc && (!property.nil? || !state.nil?)
|
|
@@ -87,14 +94,12 @@ module OCI
|
|
|
87
94
|
sleep(interval_seconds)
|
|
88
95
|
|
|
89
96
|
interval_seconds *= 2
|
|
90
|
-
if interval_seconds > max_interval_seconds
|
|
91
|
-
interval_seconds = max_interval_seconds
|
|
92
|
-
end
|
|
97
|
+
interval_seconds = max_interval_seconds if interval_seconds > max_interval_seconds
|
|
93
98
|
|
|
94
99
|
begin
|
|
95
100
|
response = @api_call.call(nil)
|
|
96
101
|
rescue OCI::Errors::ServiceError => e
|
|
97
|
-
return nil if e.status_code == 404
|
|
102
|
+
return nil if e.status_code == 404 && succeed_on_not_found
|
|
98
103
|
raise
|
|
99
104
|
end
|
|
100
105
|
|
data/lib/oraclebmc.rb
CHANGED
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.0.
|
|
4
|
+
version: 2.0.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Oracle
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-02-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: json
|
|
@@ -193,6 +193,7 @@ files:
|
|
|
193
193
|
- "./lib/oci/core/models/create_ip_sec_connection_details.rb"
|
|
194
194
|
- "./lib/oci/core/models/create_local_peering_gateway_details.rb"
|
|
195
195
|
- "./lib/oci/core/models/create_private_ip_details.rb"
|
|
196
|
+
- "./lib/oci/core/models/create_public_ip_details.rb"
|
|
196
197
|
- "./lib/oci/core/models/create_route_table_details.rb"
|
|
197
198
|
- "./lib/oci/core/models/create_security_list_details.rb"
|
|
198
199
|
- "./lib/oci/core/models/create_subnet_details.rb"
|
|
@@ -201,6 +202,7 @@ files:
|
|
|
201
202
|
- "./lib/oci/core/models/create_virtual_circuit_public_prefix_details.rb"
|
|
202
203
|
- "./lib/oci/core/models/create_vnic_details.rb"
|
|
203
204
|
- "./lib/oci/core/models/create_volume_backup_details.rb"
|
|
205
|
+
- "./lib/oci/core/models/create_volume_backup_policy_assignment_details.rb"
|
|
204
206
|
- "./lib/oci/core/models/create_volume_details.rb"
|
|
205
207
|
- "./lib/oci/core/models/cross_connect.rb"
|
|
206
208
|
- "./lib/oci/core/models/cross_connect_group.rb"
|
|
@@ -220,6 +222,8 @@ files:
|
|
|
220
222
|
- "./lib/oci/core/models/export_image_via_object_storage_tuple_details.rb"
|
|
221
223
|
- "./lib/oci/core/models/export_image_via_object_storage_uri_details.rb"
|
|
222
224
|
- "./lib/oci/core/models/fast_connect_provider_service.rb"
|
|
225
|
+
- "./lib/oci/core/models/get_public_ip_by_ip_address_details.rb"
|
|
226
|
+
- "./lib/oci/core/models/get_public_ip_by_private_ip_id_details.rb"
|
|
223
227
|
- "./lib/oci/core/models/i_scsi_volume_attachment.rb"
|
|
224
228
|
- "./lib/oci/core/models/icmp_options.rb"
|
|
225
229
|
- "./lib/oci/core/models/image.rb"
|
|
@@ -243,6 +247,7 @@ files:
|
|
|
243
247
|
- "./lib/oci/core/models/local_peering_gateway.rb"
|
|
244
248
|
- "./lib/oci/core/models/port_range.rb"
|
|
245
249
|
- "./lib/oci/core/models/private_ip.rb"
|
|
250
|
+
- "./lib/oci/core/models/public_ip.rb"
|
|
246
251
|
- "./lib/oci/core/models/route_rule.rb"
|
|
247
252
|
- "./lib/oci/core/models/route_table.rb"
|
|
248
253
|
- "./lib/oci/core/models/security_list.rb"
|
|
@@ -266,6 +271,7 @@ files:
|
|
|
266
271
|
- "./lib/oci/core/models/update_ip_sec_connection_details.rb"
|
|
267
272
|
- "./lib/oci/core/models/update_local_peering_gateway_details.rb"
|
|
268
273
|
- "./lib/oci/core/models/update_private_ip_details.rb"
|
|
274
|
+
- "./lib/oci/core/models/update_public_ip_details.rb"
|
|
269
275
|
- "./lib/oci/core/models/update_route_table_details.rb"
|
|
270
276
|
- "./lib/oci/core/models/update_security_list_details.rb"
|
|
271
277
|
- "./lib/oci/core/models/update_subnet_details.rb"
|
|
@@ -283,6 +289,9 @@ files:
|
|
|
283
289
|
- "./lib/oci/core/models/volume.rb"
|
|
284
290
|
- "./lib/oci/core/models/volume_attachment.rb"
|
|
285
291
|
- "./lib/oci/core/models/volume_backup.rb"
|
|
292
|
+
- "./lib/oci/core/models/volume_backup_policy.rb"
|
|
293
|
+
- "./lib/oci/core/models/volume_backup_policy_assignment.rb"
|
|
294
|
+
- "./lib/oci/core/models/volume_backup_schedule.rb"
|
|
286
295
|
- "./lib/oci/core/models/volume_source_details.rb"
|
|
287
296
|
- "./lib/oci/core/models/volume_source_from_volume_backup_details.rb"
|
|
288
297
|
- "./lib/oci/core/models/volume_source_from_volume_details.rb"
|
|
@@ -328,6 +337,27 @@ files:
|
|
|
328
337
|
- "./lib/oci/database/models/update_db_home_details.rb"
|
|
329
338
|
- "./lib/oci/database/models/update_db_system_details.rb"
|
|
330
339
|
- "./lib/oci/database/util.rb"
|
|
340
|
+
- "./lib/oci/dns/dns.rb"
|
|
341
|
+
- "./lib/oci/dns/dns_client.rb"
|
|
342
|
+
- "./lib/oci/dns/models/create_zone_details.rb"
|
|
343
|
+
- "./lib/oci/dns/models/external_master.rb"
|
|
344
|
+
- "./lib/oci/dns/models/patch_domain_records_details.rb"
|
|
345
|
+
- "./lib/oci/dns/models/patch_rr_set_details.rb"
|
|
346
|
+
- "./lib/oci/dns/models/patch_zone_records_details.rb"
|
|
347
|
+
- "./lib/oci/dns/models/record.rb"
|
|
348
|
+
- "./lib/oci/dns/models/record_collection.rb"
|
|
349
|
+
- "./lib/oci/dns/models/record_details.rb"
|
|
350
|
+
- "./lib/oci/dns/models/record_operation.rb"
|
|
351
|
+
- "./lib/oci/dns/models/rr_set.rb"
|
|
352
|
+
- "./lib/oci/dns/models/sort_order.rb"
|
|
353
|
+
- "./lib/oci/dns/models/tsig.rb"
|
|
354
|
+
- "./lib/oci/dns/models/update_domain_records_details.rb"
|
|
355
|
+
- "./lib/oci/dns/models/update_rr_set_details.rb"
|
|
356
|
+
- "./lib/oci/dns/models/update_zone_details.rb"
|
|
357
|
+
- "./lib/oci/dns/models/update_zone_records_details.rb"
|
|
358
|
+
- "./lib/oci/dns/models/zone.rb"
|
|
359
|
+
- "./lib/oci/dns/models/zone_summary.rb"
|
|
360
|
+
- "./lib/oci/dns/util.rb"
|
|
331
361
|
- "./lib/oci/errors.rb"
|
|
332
362
|
- "./lib/oci/global_context.rb"
|
|
333
363
|
- "./lib/oci/identity/identity.rb"
|
|
@@ -401,6 +431,7 @@ files:
|
|
|
401
431
|
- "./lib/oci/load_balancer/models/create_certificate_details.rb"
|
|
402
432
|
- "./lib/oci/load_balancer/models/create_listener_details.rb"
|
|
403
433
|
- "./lib/oci/load_balancer/models/create_load_balancer_details.rb"
|
|
434
|
+
- "./lib/oci/load_balancer/models/create_path_route_set_details.rb"
|
|
404
435
|
- "./lib/oci/load_balancer/models/health_check_result.rb"
|
|
405
436
|
- "./lib/oci/load_balancer/models/health_checker.rb"
|
|
406
437
|
- "./lib/oci/load_balancer/models/health_checker_details.rb"
|
|
@@ -413,6 +444,10 @@ files:
|
|
|
413
444
|
- "./lib/oci/load_balancer/models/load_balancer_policy.rb"
|
|
414
445
|
- "./lib/oci/load_balancer/models/load_balancer_protocol.rb"
|
|
415
446
|
- "./lib/oci/load_balancer/models/load_balancer_shape.rb"
|
|
447
|
+
- "./lib/oci/load_balancer/models/path_match_type.rb"
|
|
448
|
+
- "./lib/oci/load_balancer/models/path_route.rb"
|
|
449
|
+
- "./lib/oci/load_balancer/models/path_route_set.rb"
|
|
450
|
+
- "./lib/oci/load_balancer/models/path_route_set_details.rb"
|
|
416
451
|
- "./lib/oci/load_balancer/models/session_persistence_configuration_details.rb"
|
|
417
452
|
- "./lib/oci/load_balancer/models/ssl_configuration.rb"
|
|
418
453
|
- "./lib/oci/load_balancer/models/ssl_configuration_details.rb"
|
|
@@ -421,6 +456,7 @@ files:
|
|
|
421
456
|
- "./lib/oci/load_balancer/models/update_health_checker_details.rb"
|
|
422
457
|
- "./lib/oci/load_balancer/models/update_listener_details.rb"
|
|
423
458
|
- "./lib/oci/load_balancer/models/update_load_balancer_details.rb"
|
|
459
|
+
- "./lib/oci/load_balancer/models/update_path_route_set_details.rb"
|
|
424
460
|
- "./lib/oci/load_balancer/models/work_request.rb"
|
|
425
461
|
- "./lib/oci/load_balancer/models/work_request_error.rb"
|
|
426
462
|
- "./lib/oci/load_balancer/util.rb"
|
|
@@ -444,6 +480,14 @@ files:
|
|
|
444
480
|
- "./lib/oci/object_storage/models/update_namespace_metadata_details.rb"
|
|
445
481
|
- "./lib/oci/object_storage/object_storage.rb"
|
|
446
482
|
- "./lib/oci/object_storage/object_storage_client.rb"
|
|
483
|
+
- "./lib/oci/object_storage/transfer/multipart/internal/file_part_io_wrapper.rb"
|
|
484
|
+
- "./lib/oci/object_storage/transfer/multipart/internal/multipart_upload_parts_collection.rb"
|
|
485
|
+
- "./lib/oci/object_storage/transfer/multipart/internal/seekable_non_file_part_io_wrapper.rb"
|
|
486
|
+
- "./lib/oci/object_storage/transfer/multipart/internal/stdin_part_io_wrapper.rb"
|
|
487
|
+
- "./lib/oci/object_storage/transfer/multipart/multipart_object_assembler.rb"
|
|
488
|
+
- "./lib/oci/object_storage/transfer/transfer.rb"
|
|
489
|
+
- "./lib/oci/object_storage/transfer/upload_manager.rb"
|
|
490
|
+
- "./lib/oci/object_storage/transfer/upload_manager_config.rb"
|
|
447
491
|
- "./lib/oci/object_storage/util.rb"
|
|
448
492
|
- "./lib/oci/regions.rb"
|
|
449
493
|
- "./lib/oci/response.rb"
|