Class: OCI::ObjectStorage::ObjectStorageClient
- Inherits:
-
Object
- Object
- OCI::ObjectStorage::ObjectStorageClient
- Defined in:
- lib/oci/object_storage/object_storage_client.rb
Instance Attribute Summary collapse
-
#api_client ⇒ OCI::ApiClient
readonly
Client used to make HTTP requests.
-
#endpoint ⇒ String
readonly
Fully qualified endpoint URL.
-
#region ⇒ String
The region, which will usually correspond to a value in Regions::REGION_ENUM.
Instance Method Summary collapse
-
#abort_multipart_upload(namespace_name, bucket_name, object_name, upload_id, opts = {}) ⇒ Response
Aborts an in-progress multipart upload and deletes all parts that have been uploaded.
-
#commit_multipart_upload(namespace_name, bucket_name, object_name, upload_id, commit_multipart_upload_details, opts = {}) ⇒ Response
Commits a multipart upload, which involves checking part numbers and ETags of the parts, to create an aggregate object.
-
#create_bucket(namespace_name, create_bucket_details, opts = {}) ⇒ Response
Creates a bucket in the given namespace with a bucket name and optional user-defined metadata.
-
#create_multipart_upload(namespace_name, bucket_name, create_multipart_upload_details, opts = {}) ⇒ Response
Starts a new multipart upload to a specific object in the given bucket in the given namespace.
-
#create_preauthenticated_request(namespace_name, bucket_name, create_preauthenticated_request_details, opts = {}) ⇒ Response
Creates a pre-authenticated request specific to the bucket.
-
#delete_bucket(namespace_name, bucket_name, opts = {}) ⇒ Response
Deletes a bucket if it is already empty.
-
#delete_object(namespace_name, bucket_name, object_name, opts = {}) ⇒ Response
Deletes an object.
-
#delete_preauthenticated_request(namespace_name, bucket_name, par_id, opts = {}) ⇒ Response
Deletes the pre-authenticated request for the bucket.
-
#get_bucket(namespace_name, bucket_name, opts = {}) ⇒ Response
Gets the current representation of the given bucket in the given namespace.
-
#get_namespace(opts = {}) ⇒ Response
Namespaces are unique.
-
#get_namespace_metadata(namespace_name, opts = {}) ⇒ Response
Get the metadata for the namespace, which contains defaultS3CompartmentId and defaultSwiftCompartmentId.
-
#get_object(namespace_name, bucket_name, object_name, opts = {}, &block) ⇒ Response
Gets the metadata and body of an object.
-
#get_preauthenticated_request(namespace_name, bucket_name, par_id, opts = {}) ⇒ Response
Gets the pre-authenticated request for the bucket.
-
#head_bucket(namespace_name, bucket_name, opts = {}) ⇒ Response
Efficiently checks to see if a bucket exists and gets the current ETag for the bucket.
-
#head_object(namespace_name, bucket_name, object_name, opts = {}) ⇒ Response
Gets the user-defined metadata and entity tag for an object.
-
#initialize(config: nil, region: nil, signer: nil) ⇒ ObjectStorageClient
constructor
Creates a new ObjectStorageClient.
-
#list_buckets(namespace_name, compartment_id, opts = {}) ⇒ Response
Gets a list of all ‘BucketSummary`s in a compartment.
-
#list_multipart_upload_parts(namespace_name, bucket_name, object_name, upload_id, opts = {}) ⇒ Response
Lists the parts of an in-progress multipart upload.
-
#list_multipart_uploads(namespace_name, bucket_name, opts = {}) ⇒ Response
Lists all in-progress multipart uploads for the given bucket in the given namespace.
-
#list_objects(namespace_name, bucket_name, opts = {}) ⇒ Response
Lists the objects in a bucket.
-
#list_preauthenticated_requests(namespace_name, bucket_name, opts = {}) ⇒ Response
Lists pre-authenticated requests for the bucket.
-
#logger ⇒ Logger
The logger for this client.
-
#put_object(namespace_name, bucket_name, object_name, put_object_body, opts = {}) ⇒ Response
Creates a new object or overwrites an existing one.
-
#rename_object(namespace_name, bucket_name, rename_object_details, opts = {}) ⇒ Response
Rename an object from source key to target key in the given namespace.
-
#restore_objects(namespace_name, bucket_name, restore_objects_details, opts = {}) ⇒ Response
Restore one or more objects specified by objectName parameter.
-
#update_bucket(namespace_name, bucket_name, update_bucket_details, opts = {}) ⇒ Response
Performs a partial or full update of a bucket’s user-defined metadata.
-
#update_namespace_metadata(namespace_name, update_namespace_metadata_details, opts = {}) ⇒ Response
Change the default Swift/S3 compartmentId of user’s namespace into the user-defined compartmentId.
-
#upload_part(namespace_name, bucket_name, object_name, upload_id, upload_part_num, upload_part_body, opts = {}) ⇒ Response
Uploads a single part of a multipart upload.
Constructor Details
#initialize(config: nil, region: nil, signer: nil) ⇒ ObjectStorageClient
Creates a new ObjectStorageClient. If a config is not specified, then the global OCI.config will be used.
A region must be specified in either the config or the region parameter. If specified in both, then the region parameter will be used.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 34 def initialize(config:nil, region:nil, signer:nil) # If the signer is an InstancePrincipalsSecurityTokenSigner and no config was supplied (which is valid for instance principals) # then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals # and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then # pass it to this constructor. # # If there is no signer (or the signer is not an instance principals signer) and no config was supplied, this is not valid # so try and load the config from the default file. config ||= OCI.config unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner) config ||= OCI::Config.new if signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner) config.validate unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner) if signer.nil? signer = Signer.new(config.user, config.fingerprint, config.tenancy, config.key_file, pass_phrase: config.pass_phrase, private_key_content: config.key_content, signing_strategy: Signer::OBJECT_STORAGE) end @api_client = ApiClient.new(config, signer) region ||= config.region region ||= signer.region if signer.respond_to?(:region) self.region = region end |
Instance Attribute Details
#api_client ⇒ OCI::ApiClient (readonly)
Client used to make HTTP requests.
12 13 14 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 12 def api_client @api_client end |
#endpoint ⇒ String (readonly)
Fully qualified endpoint URL
16 17 18 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 16 def endpoint @endpoint end |
#region ⇒ String
The region, which will usually correspond to a value in Regions::REGION_ENUM.
20 21 22 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 20 def region @region end |
Instance Method Details
#abort_multipart_upload(namespace_name, bucket_name, object_name, upload_id, opts = {}) ⇒ Response
Aborts an in-progress multipart upload and deletes all parts that have been uploaded.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 88 def abort_multipart_upload(namespace_name, bucket_name, object_name, upload_id, opts = {}) logger.debug "Calling operation ObjectStorageClient#abort_multipart_upload." if logger raise "Missing the required parameter 'namespace_name' when calling abort_multipart_upload." if namespace_name.nil? raise "Missing the required parameter 'bucket_name' when calling abort_multipart_upload." if bucket_name.nil? raise "Missing the required parameter 'object_name' when calling abort_multipart_upload." if object_name.nil? raise "Missing the required parameter 'upload_id' when calling abort_multipart_upload." if upload_id.nil? path = "/n/{namespaceName}/b/{bucketName}/u/{objectName}".sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s).sub('{objectName}', object_name.to_s) # Query Params query_params = {} query_params[:'uploadId'] = upload_id # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'opc-client-request-id'] = opts[:'opc_client_request_id'] if opts[:'opc_client_request_id'] post_body = nil return @api_client.call_api( :DELETE, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body) end |
#commit_multipart_upload(namespace_name, bucket_name, object_name, upload_id, commit_multipart_upload_details, opts = {}) ⇒ Response
Commits a multipart upload, which involves checking part numbers and ETags of the parts, to create an aggregate object.
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 139 def commit_multipart_upload(namespace_name, bucket_name, object_name, upload_id, commit_multipart_upload_details, opts = {}) logger.debug "Calling operation ObjectStorageClient#commit_multipart_upload." if logger raise "Missing the required parameter 'namespace_name' when calling commit_multipart_upload." if namespace_name.nil? raise "Missing the required parameter 'bucket_name' when calling commit_multipart_upload." if bucket_name.nil? raise "Missing the required parameter 'object_name' when calling commit_multipart_upload." if object_name.nil? raise "Missing the required parameter 'upload_id' when calling commit_multipart_upload." if upload_id.nil? raise "Missing the required parameter 'commit_multipart_upload_details' when calling commit_multipart_upload." if commit_multipart_upload_details.nil? path = "/n/{namespaceName}/b/{bucketName}/u/{objectName}".sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s).sub('{objectName}', object_name.to_s) # Query Params query_params = {} query_params[:'uploadId'] = upload_id # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match'] header_params[:'if-none-match'] = opts[:'if_none_match'] if opts[:'if_none_match'] header_params[:'opc-client-request-id'] = opts[:'opc_client_request_id'] if opts[:'opc_client_request_id'] post_body = @api_client.object_to_http_body(commit_multipart_upload_details) return @api_client.call_api( :POST, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body) end |
#create_bucket(namespace_name, create_bucket_details, opts = {}) ⇒ Response
Creates a bucket in the given namespace with a bucket name and optional user-defined metadata.
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 180 def create_bucket(namespace_name, create_bucket_details, opts = {}) logger.debug "Calling operation ObjectStorageClient#create_bucket." if logger raise "Missing the required parameter 'namespace_name' when calling create_bucket." if namespace_name.nil? raise "Missing the required parameter 'create_bucket_details' when calling create_bucket." if create_bucket_details.nil? path = "/n/{namespaceName}/b/".sub('{namespaceName}', namespace_name.to_s) # Query Params query_params = {} # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'opc-client-request-id'] = opts[:'opc_client_request_id'] if opts[:'opc_client_request_id'] post_body = @api_client.object_to_http_body(create_bucket_details) return @api_client.call_api( :POST, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'OCI::ObjectStorage::Models::Bucket') end |
#create_multipart_upload(namespace_name, bucket_name, create_multipart_upload_details, opts = {}) ⇒ Response
Starts a new multipart upload to a specific object in the given bucket in the given namespace.
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 225 def create_multipart_upload(namespace_name, bucket_name, create_multipart_upload_details, opts = {}) logger.debug "Calling operation ObjectStorageClient#create_multipart_upload." if logger raise "Missing the required parameter 'namespace_name' when calling create_multipart_upload." if namespace_name.nil? raise "Missing the required parameter 'bucket_name' when calling create_multipart_upload." if bucket_name.nil? raise "Missing the required parameter 'create_multipart_upload_details' when calling create_multipart_upload." if create_multipart_upload_details.nil? path = "/n/{namespaceName}/b/{bucketName}/u".sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s) # Query Params query_params = {} # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match'] header_params[:'if-none-match'] = opts[:'if_none_match'] if opts[:'if_none_match'] header_params[:'opc-client-request-id'] = opts[:'opc_client_request_id'] if opts[:'opc_client_request_id'] post_body = @api_client.object_to_http_body(create_multipart_upload_details) return @api_client.call_api( :POST, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'OCI::ObjectStorage::Models::MultipartUpload') end |
#create_preauthenticated_request(namespace_name, bucket_name, create_preauthenticated_request_details, opts = {}) ⇒ Response
Creates a pre-authenticated request specific to the bucket.
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 267 def create_preauthenticated_request(namespace_name, bucket_name, create_preauthenticated_request_details, opts = {}) logger.debug "Calling operation ObjectStorageClient#create_preauthenticated_request." if logger raise "Missing the required parameter 'namespace_name' when calling create_preauthenticated_request." if namespace_name.nil? raise "Missing the required parameter 'bucket_name' when calling create_preauthenticated_request." if bucket_name.nil? raise "Missing the required parameter 'create_preauthenticated_request_details' when calling create_preauthenticated_request." if create_preauthenticated_request_details.nil? path = "/n/{namespaceName}/b/{bucketName}/p/".sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s) # Query Params query_params = {} # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'opc-client-request-id'] = opts[:'opc_client_request_id'] if opts[:'opc_client_request_id'] post_body = @api_client.object_to_http_body(create_preauthenticated_request_details) return @api_client.call_api( :POST, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'OCI::ObjectStorage::Models::PreauthenticatedRequest') end |
#delete_bucket(namespace_name, bucket_name, opts = {}) ⇒ Response
Deletes a bucket if it is already empty. If the bucket is not empty, use delete_object first.
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 309 def delete_bucket(namespace_name, bucket_name, opts = {}) logger.debug "Calling operation ObjectStorageClient#delete_bucket." if logger raise "Missing the required parameter 'namespace_name' when calling delete_bucket." if namespace_name.nil? raise "Missing the required parameter 'bucket_name' when calling delete_bucket." if bucket_name.nil? path = "/n/{namespaceName}/b/{bucketName}/".sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s) # Query Params query_params = {} # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match'] header_params[:'opc-client-request-id'] = opts[:'opc_client_request_id'] if opts[:'opc_client_request_id'] post_body = nil return @api_client.call_api( :DELETE, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body) end |
#delete_object(namespace_name, bucket_name, object_name, opts = {}) ⇒ Response
Deletes an object.
353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 353 def delete_object(namespace_name, bucket_name, object_name, opts = {}) logger.debug "Calling operation ObjectStorageClient#delete_object." if logger raise "Missing the required parameter 'namespace_name' when calling delete_object." if namespace_name.nil? raise "Missing the required parameter 'bucket_name' when calling delete_object." if bucket_name.nil? raise "Missing the required parameter 'object_name' when calling delete_object." if object_name.nil? path = "/n/{namespaceName}/b/{bucketName}/o/{objectName}".sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s).sub('{objectName}', object_name.to_s) # Query Params query_params = {} # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match'] header_params[:'opc-client-request-id'] = opts[:'opc_client_request_id'] if opts[:'opc_client_request_id'] post_body = nil return @api_client.call_api( :DELETE, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body) end |
#delete_preauthenticated_request(namespace_name, bucket_name, par_id, opts = {}) ⇒ Response
Deletes the pre-authenticated request for the bucket.
394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 394 def delete_preauthenticated_request(namespace_name, bucket_name, par_id, opts = {}) logger.debug "Calling operation ObjectStorageClient#delete_preauthenticated_request." if logger raise "Missing the required parameter 'namespace_name' when calling delete_preauthenticated_request." if namespace_name.nil? raise "Missing the required parameter 'bucket_name' when calling delete_preauthenticated_request." if bucket_name.nil? raise "Missing the required parameter 'par_id' when calling delete_preauthenticated_request." if par_id.nil? path = "/n/{namespaceName}/b/{bucketName}/p/{parId}".sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s).sub('{parId}', par_id.to_s) # Query Params query_params = {} # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'opc-client-request-id'] = opts[:'opc_client_request_id'] if opts[:'opc_client_request_id'] post_body = nil return @api_client.call_api( :DELETE, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body) end |
#get_bucket(namespace_name, bucket_name, opts = {}) ⇒ Response
Gets the current representation of the given bucket in the given namespace.
438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 438 def get_bucket(namespace_name, bucket_name, opts = {}) logger.debug "Calling operation ObjectStorageClient#get_bucket." if logger raise "Missing the required parameter 'namespace_name' when calling get_bucket." if namespace_name.nil? raise "Missing the required parameter 'bucket_name' when calling get_bucket." if bucket_name.nil? path = "/n/{namespaceName}/b/{bucketName}/".sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s) # Query Params query_params = {} # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match'] header_params[:'if-none-match'] = opts[:'if_none_match'] if opts[:'if_none_match'] header_params[:'opc-client-request-id'] = opts[:'opc_client_request_id'] if opts[:'opc_client_request_id'] post_body = nil return @api_client.call_api( :GET, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'OCI::ObjectStorage::Models::Bucket') end |
#get_namespace(opts = {}) ⇒ Response
Namespaces are unique. Namespaces are either the tenancy name or a random string automatically generated during account creation. You cannot edit a namespace.
475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 475 def get_namespace(opts = {}) logger.debug "Calling operation ObjectStorageClient#get_namespace." if logger path = "/n/" # Query Params query_params = {} # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'opc-client-request-id'] = opts[:'opc_client_request_id'] if opts[:'opc_client_request_id'] post_body = nil return @api_client.call_api( :GET, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'String') end |
#get_namespace_metadata(namespace_name, opts = {}) ⇒ Response
Get the metadata for the namespace, which contains defaultS3CompartmentId and defaultSwiftCompartmentId. Any user with the NAMESPACE_READ permission will be able to see the current metadata. If you’re not authorized, talk to an administrator. If you’re an administrator who needs to write policies to give users access, see [Getting Started with Policies](docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm).
511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 511 def (namespace_name, opts = {}) logger.debug "Calling operation ObjectStorageClient#get_namespace_metadata." if logger raise "Missing the required parameter 'namespace_name' when calling get_namespace_metadata." if namespace_name.nil? path = "/n/{namespaceName}".sub('{namespaceName}', namespace_name.to_s) # Query Params query_params = {} # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'opc-client-request-id'] = opts[:'opc_client_request_id'] if opts[:'opc_client_request_id'] post_body = nil return @api_client.call_api( :GET, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'OCI::ObjectStorage::Models::NamespaceMetadata') end |
#get_object(namespace_name, bucket_name, object_name, opts = {}, &block) ⇒ Response
Gets the metadata and body of an object.
562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 562 def get_object(namespace_name, bucket_name, object_name, opts = {}, &block) logger.debug "Calling operation ObjectStorageClient#get_object." if logger raise "Missing the required parameter 'namespace_name' when calling get_object." if namespace_name.nil? raise "Missing the required parameter 'bucket_name' when calling get_object." if bucket_name.nil? raise "Missing the required parameter 'object_name' when calling get_object." if object_name.nil? path = "/n/{namespaceName}/b/{bucketName}/o/{objectName}".sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s).sub('{objectName}', object_name.to_s) # Query Params query_params = {} # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match'] header_params[:'if-none-match'] = opts[:'if_none_match'] if opts[:'if_none_match'] header_params[:'opc-client-request-id'] = opts[:'opc_client_request_id'] if opts[:'opc_client_request_id'] header_params[:'range'] = opts[:'range'] if opts[:'range'] post_body = nil if !block.nil? return @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, body: post_body, return_type: 'Stream', &block ) elsif opts[:response_target] if opts[:response_target].respond_to? :write return @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, body: post_body, return_type: 'Stream', &proc { |chunk, response| opts[:response_target].write(chunk) } ) elsif opts[:response_target].is_a?(String) open(opts[:response_target], 'wb') do |output| return @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, body: post_body, return_type: 'Stream', &proc { |chunk, response| output.write(chunk) } ) end end else return @api_client.call_api( :GET, path, endpoint, header_params:header_params, query_params: query_params, body: post_body, return_type: 'String' ) end end |
#get_preauthenticated_request(namespace_name, bucket_name, par_id, opts = {}) ⇒ Response
Gets the pre-authenticated request for the bucket.
646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 646 def get_preauthenticated_request(namespace_name, bucket_name, par_id, opts = {}) logger.debug "Calling operation ObjectStorageClient#get_preauthenticated_request." if logger raise "Missing the required parameter 'namespace_name' when calling get_preauthenticated_request." if namespace_name.nil? raise "Missing the required parameter 'bucket_name' when calling get_preauthenticated_request." if bucket_name.nil? raise "Missing the required parameter 'par_id' when calling get_preauthenticated_request." if par_id.nil? path = "/n/{namespaceName}/b/{bucketName}/p/{parId}".sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s).sub('{parId}', par_id.to_s) # Query Params query_params = {} # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'opc-client-request-id'] = opts[:'opc_client_request_id'] if opts[:'opc_client_request_id'] post_body = nil return @api_client.call_api( :GET, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'OCI::ObjectStorage::Models::PreauthenticatedRequestSummary') end |
#head_bucket(namespace_name, bucket_name, opts = {}) ⇒ Response
Efficiently checks to see if a bucket exists and gets the current ETag for the bucket.
691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 691 def head_bucket(namespace_name, bucket_name, opts = {}) logger.debug "Calling operation ObjectStorageClient#head_bucket." if logger raise "Missing the required parameter 'namespace_name' when calling head_bucket." if namespace_name.nil? raise "Missing the required parameter 'bucket_name' when calling head_bucket." if bucket_name.nil? path = "/n/{namespaceName}/b/{bucketName}/".sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s) # Query Params query_params = {} # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match'] header_params[:'if-none-match'] = opts[:'if_none_match'] if opts[:'if_none_match'] header_params[:'opc-client-request-id'] = opts[:'opc_client_request_id'] if opts[:'opc_client_request_id'] post_body = nil return @api_client.call_api( :HEAD, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body) end |
#head_object(namespace_name, bucket_name, object_name, opts = {}) ⇒ Response
Gets the user-defined metadata and entity tag for an object.
739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 739 def head_object(namespace_name, bucket_name, object_name, opts = {}) logger.debug "Calling operation ObjectStorageClient#head_object." if logger raise "Missing the required parameter 'namespace_name' when calling head_object." if namespace_name.nil? raise "Missing the required parameter 'bucket_name' when calling head_object." if bucket_name.nil? raise "Missing the required parameter 'object_name' when calling head_object." if object_name.nil? path = "/n/{namespaceName}/b/{bucketName}/o/{objectName}".sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s).sub('{objectName}', object_name.to_s) # Query Params query_params = {} # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match'] header_params[:'if-none-match'] = opts[:'if_none_match'] if opts[:'if_none_match'] header_params[:'opc-client-request-id'] = opts[:'opc_client_request_id'] if opts[:'opc_client_request_id'] post_body = nil return @api_client.call_api( :HEAD, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body) end |
#list_buckets(namespace_name, compartment_id, opts = {}) ⇒ Response
Gets a list of all ‘BucketSummary`s in a compartment. A `BucketSummary` contains only summary fields for the bucket and does not contain fields like the user-defined metadata.
To use this and other API operations, you must be authorized in an IAM policy. If you’re not authorized, talk to an administrator. If you’re an administrator who needs to write policies to give users access, see [Getting Started with Policies](docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm).
789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 789 def list_buckets(namespace_name, compartment_id, opts = {}) logger.debug "Calling operation ObjectStorageClient#list_buckets." if logger raise "Missing the required parameter 'namespace_name' when calling list_buckets." if namespace_name.nil? raise "Missing the required parameter 'compartment_id' when calling list_buckets." if compartment_id.nil? fields_allowable_values = ['tags'] if opts[:'fields'] && !opts[:'fields'].empty? opts[:'fields'].each do |val_to_check| unless fields_allowable_values.include?(val_to_check) raise 'Invalid value for "fields", must be one of tags.' end end end path = "/n/{namespaceName}/b/".sub('{namespaceName}', namespace_name.to_s) # Query Params query_params = {} query_params[:'compartmentId'] = compartment_id query_params[:'limit'] = opts[:'limit'] if opts[:'limit'] query_params[:'page'] = opts[:'page'] if opts[:'page'] query_params[:'fields'] = OCI::ApiClient.build_collection_params(opts[:'fields'], :csv) if opts[:'fields'] && !opts[:'fields'].empty? # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'opc-client-request-id'] = opts[:'opc_client_request_id'] if opts[:'opc_client_request_id'] post_body = nil return @api_client.call_api( :GET, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'Array<OCI::ObjectStorage::Models::BucketSummary>') end |
#list_multipart_upload_parts(namespace_name, bucket_name, object_name, upload_id, opts = {}) ⇒ Response
Lists the parts of an in-progress multipart upload.
847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 847 def list_multipart_upload_parts(namespace_name, bucket_name, object_name, upload_id, opts = {}) logger.debug "Calling operation ObjectStorageClient#list_multipart_upload_parts." if logger raise "Missing the required parameter 'namespace_name' when calling list_multipart_upload_parts." if namespace_name.nil? raise "Missing the required parameter 'bucket_name' when calling list_multipart_upload_parts." if bucket_name.nil? raise "Missing the required parameter 'object_name' when calling list_multipart_upload_parts." if object_name.nil? raise "Missing the required parameter 'upload_id' when calling list_multipart_upload_parts." if upload_id.nil? path = "/n/{namespaceName}/b/{bucketName}/u/{objectName}".sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s).sub('{objectName}', object_name.to_s) # Query Params query_params = {} query_params[:'uploadId'] = upload_id query_params[:'limit'] = opts[:'limit'] if opts[:'limit'] query_params[:'page'] = opts[:'page'] if opts[:'page'] # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'opc-client-request-id'] = opts[:'opc_client_request_id'] if opts[:'opc_client_request_id'] post_body = nil return @api_client.call_api( :GET, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'Array<OCI::ObjectStorage::Models::MultipartUploadPartSummary>') end |
#list_multipart_uploads(namespace_name, bucket_name, opts = {}) ⇒ Response
Lists all in-progress multipart uploads for the given bucket in the given namespace.
892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 892 def list_multipart_uploads(namespace_name, bucket_name, opts = {}) logger.debug "Calling operation ObjectStorageClient#list_multipart_uploads." if logger raise "Missing the required parameter 'namespace_name' when calling list_multipart_uploads." if namespace_name.nil? raise "Missing the required parameter 'bucket_name' when calling list_multipart_uploads." if bucket_name.nil? path = "/n/{namespaceName}/b/{bucketName}/u".sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s) # Query Params query_params = {} query_params[:'limit'] = opts[:'limit'] if opts[:'limit'] query_params[:'page'] = opts[:'page'] if opts[:'page'] # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'opc-client-request-id'] = opts[:'opc_client_request_id'] if opts[:'opc_client_request_id'] post_body = nil return @api_client.call_api( :GET, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'Array<OCI::ObjectStorage::Models::MultipartUpload>') end |
#list_objects(namespace_name, bucket_name, opts = {}) ⇒ Response
Lists the objects in a bucket.
To use this and other API operations, you must be authorized in an IAM policy. If you’re not authorized, talk to an administrator. If you’re an administrator who needs to write policies to give users access, see [Getting Started with Policies](docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm).
951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 951 def list_objects(namespace_name, bucket_name, opts = {}) logger.debug "Calling operation ObjectStorageClient#list_objects." if logger raise "Missing the required parameter 'namespace_name' when calling list_objects." if namespace_name.nil? raise "Missing the required parameter 'bucket_name' when calling list_objects." if bucket_name.nil? path = "/n/{namespaceName}/b/{bucketName}/o".sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s) # Query Params query_params = {} query_params[:'prefix'] = opts[:'prefix'] if opts[:'prefix'] query_params[:'start'] = opts[:'start'] if opts[:'start'] query_params[:'end'] = opts[:'_end'] if opts[:'_end'] query_params[:'limit'] = opts[:'limit'] if opts[:'limit'] query_params[:'delimiter'] = opts[:'delimiter'] if opts[:'delimiter'] query_params[:'fields'] = opts[:'fields'] if opts[:'fields'] # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'opc-client-request-id'] = opts[:'opc_client_request_id'] if opts[:'opc_client_request_id'] post_body = nil return @api_client.call_api( :GET, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'OCI::ObjectStorage::Models::ListObjects') end |
#list_preauthenticated_requests(namespace_name, bucket_name, opts = {}) ⇒ Response
Lists pre-authenticated requests for the bucket.
998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 998 def list_preauthenticated_requests(namespace_name, bucket_name, opts = {}) logger.debug "Calling operation ObjectStorageClient#list_preauthenticated_requests." if logger raise "Missing the required parameter 'namespace_name' when calling list_preauthenticated_requests." if namespace_name.nil? raise "Missing the required parameter 'bucket_name' when calling list_preauthenticated_requests." if bucket_name.nil? path = "/n/{namespaceName}/b/{bucketName}/p/".sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s) # Query Params query_params = {} query_params[:'objectNamePrefix'] = opts[:'object_name_prefix'] if opts[:'object_name_prefix'] query_params[:'limit'] = opts[:'limit'] if opts[:'limit'] query_params[:'page'] = opts[:'page'] if opts[:'page'] # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'opc-client-request-id'] = opts[:'opc_client_request_id'] if opts[:'opc_client_request_id'] post_body = nil return @api_client.call_api( :GET, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'Array<OCI::ObjectStorage::Models::PreauthenticatedRequestSummary>') end |
#logger ⇒ Logger
Returns The logger for this client. May be nil.
70 71 72 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 70 def logger @api_client.config.logger end |
#put_object(namespace_name, bucket_name, object_name, put_object_body, opts = {}) ⇒ Response
Creates a new object or overwrites an existing one.
1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 1056 def put_object(namespace_name, bucket_name, object_name, put_object_body, opts = {}) logger.debug "Calling operation ObjectStorageClient#put_object." if logger raise "Missing the required parameter 'namespace_name' when calling put_object." if namespace_name.nil? raise "Missing the required parameter 'bucket_name' when calling put_object." if bucket_name.nil? raise "Missing the required parameter 'object_name' when calling put_object." if object_name.nil? raise "Missing the required parameter 'put_object_body' when calling put_object." if put_object_body.nil? path = "/n/{namespaceName}/b/{bucketName}/o/{objectName}".sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s).sub('{objectName}', object_name.to_s) # Query Params query_params = {} # Header Params header_params = {} header_params['accept'] = 'application/json' header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match'] header_params[:'if-none-match'] = opts[:'if_none_match'] if opts[:'if_none_match'] header_params[:'opc-client-request-id'] = opts[:'opc_client_request_id'] if opts[:'opc_client_request_id'] header_params[:'Expect'] = opts[:'expect'] if opts[:'expect'] header_params[:'Content-Length'] = opts[:'content_length'] if opts[:'content_length'] header_params[:'Content-MD5'] = opts[:'content_md5'] if opts[:'content_md5'] header_params[:'Content-Type'] = opts[:'content_type'] if opts[:'content_type'] header_params[:'Content-Language'] = opts[:'content_language'] if opts[:'content_language'] header_params[:'Content-Encoding'] = opts[:'content_encoding'] if opts[:'content_encoding'] if opts[:opc_meta] opts[:opc_meta].each do |key, value| header_params["opc-meta-#{key}".to_sym] = value end end post_body = @api_client.object_to_http_body(put_object_body) return @api_client.call_api( :PUT, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body) end |
#rename_object(namespace_name, bucket_name, rename_object_details, opts = {}) ⇒ Response
Rename an object from source key to target key in the given namespace.
1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 1109 def rename_object(namespace_name, bucket_name, rename_object_details, opts = {}) logger.debug "Calling operation ObjectStorageClient#rename_object." if logger raise "Missing the required parameter 'namespace_name' when calling rename_object." if namespace_name.nil? raise "Missing the required parameter 'bucket_name' when calling rename_object." if bucket_name.nil? raise "Missing the required parameter 'rename_object_details' when calling rename_object." if rename_object_details.nil? path = "/n/{namespaceName}/b/{bucketName}/actions/renameObject".sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s) # Query Params query_params = {} # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'opc-client-request-id'] = opts[:'opc_client_request_id'] if opts[:'opc_client_request_id'] post_body = @api_client.object_to_http_body(rename_object_details) return @api_client.call_api( :POST, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body) end |
#restore_objects(namespace_name, bucket_name, restore_objects_details, opts = {}) ⇒ Response
Restore one or more objects specified by objectName parameter. By default object will be restored for 24 hours.Duration can be configured using hours parameter.
1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 1149 def restore_objects(namespace_name, bucket_name, restore_objects_details, opts = {}) logger.debug "Calling operation ObjectStorageClient#restore_objects." if logger raise "Missing the required parameter 'namespace_name' when calling restore_objects." if namespace_name.nil? raise "Missing the required parameter 'bucket_name' when calling restore_objects." if bucket_name.nil? raise "Missing the required parameter 'restore_objects_details' when calling restore_objects." if restore_objects_details.nil? path = "/n/{namespaceName}/b/{bucketName}/actions/restoreObjects".sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s) # Query Params query_params = {} # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'opc-client-request-id'] = opts[:'opc_client_request_id'] if opts[:'opc_client_request_id'] post_body = @api_client.object_to_http_body(restore_objects_details) return @api_client.call_api( :POST, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body) end |
#update_bucket(namespace_name, bucket_name, update_bucket_details, opts = {}) ⇒ Response
Performs a partial or full update of a bucket’s user-defined metadata.
1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 1191 def update_bucket(namespace_name, bucket_name, update_bucket_details, opts = {}) logger.debug "Calling operation ObjectStorageClient#update_bucket." if logger raise "Missing the required parameter 'namespace_name' when calling update_bucket." if namespace_name.nil? raise "Missing the required parameter 'bucket_name' when calling update_bucket." if bucket_name.nil? raise "Missing the required parameter 'update_bucket_details' when calling update_bucket." if update_bucket_details.nil? path = "/n/{namespaceName}/b/{bucketName}/".sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s) # Query Params query_params = {} # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match'] header_params[:'opc-client-request-id'] = opts[:'opc_client_request_id'] if opts[:'opc_client_request_id'] post_body = @api_client.object_to_http_body(update_bucket_details) return @api_client.call_api( :POST, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'OCI::ObjectStorage::Models::Bucket') end |
#update_namespace_metadata(namespace_name, update_namespace_metadata_details, opts = {}) ⇒ Response
Change the default Swift/S3 compartmentId of user’s namespace into the user-defined compartmentId. Upon doing this, all subsequent bucket creations will use the new default compartment, but no previously created buckets will be modified. A user must have the NAMESPACE_UPDATE permission to make changes to the default compartments for S3 and Swift.
1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 1232 def (namespace_name, , opts = {}) logger.debug "Calling operation ObjectStorageClient#update_namespace_metadata." if logger raise "Missing the required parameter 'namespace_name' when calling update_namespace_metadata." if namespace_name.nil? raise "Missing the required parameter 'update_namespace_metadata_details' when calling update_namespace_metadata." if .nil? path = "/n/{namespaceName}".sub('{namespaceName}', namespace_name.to_s) # Query Params query_params = {} # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'opc-client-request-id'] = opts[:'opc_client_request_id'] if opts[:'opc_client_request_id'] post_body = @api_client.object_to_http_body() return @api_client.call_api( :PUT, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'OCI::ObjectStorage::Models::NamespaceMetadata') end |
#upload_part(namespace_name, bucket_name, object_name, upload_id, upload_part_num, upload_part_body, opts = {}) ⇒ Response
Uploads a single part of a multipart upload.
1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 |
# File 'lib/oci/object_storage/object_storage_client.rb', line 1285 def upload_part(namespace_name, bucket_name, object_name, upload_id, upload_part_num, upload_part_body, opts = {}) logger.debug "Calling operation ObjectStorageClient#upload_part." if logger raise "Missing the required parameter 'namespace_name' when calling upload_part." if namespace_name.nil? raise "Missing the required parameter 'bucket_name' when calling upload_part." if bucket_name.nil? raise "Missing the required parameter 'object_name' when calling upload_part." if object_name.nil? raise "Missing the required parameter 'upload_id' when calling upload_part." if upload_id.nil? raise "Missing the required parameter 'upload_part_num' when calling upload_part." if upload_part_num.nil? raise "Missing the required parameter 'upload_part_body' when calling upload_part." if upload_part_body.nil? path = "/n/{namespaceName}/b/{bucketName}/u/{objectName}".sub('{namespaceName}', namespace_name.to_s).sub('{bucketName}', bucket_name.to_s).sub('{objectName}', object_name.to_s) # Query Params query_params = {} query_params[:'uploadId'] = upload_id query_params[:'uploadPartNum'] = upload_part_num # Header Params header_params = {} header_params['accept'] = 'application/json' header_params[:'opc-client-request-id'] = opts[:'opc_client_request_id'] if opts[:'opc_client_request_id'] header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match'] header_params[:'if-none-match'] = opts[:'if_none_match'] if opts[:'if_none_match'] header_params[:'Expect'] = opts[:'expect'] if opts[:'expect'] header_params[:'Content-Length'] = opts[:'content_length'] if opts[:'content_length'] header_params[:'Content-MD5'] = opts[:'content_md5'] if opts[:'content_md5'] post_body = @api_client.object_to_http_body(upload_part_body) return @api_client.call_api( :PUT, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body) end |