Class: OCI::Core::BlockstorageClient
- Inherits:
-
Object
- Object
- OCI::Core::BlockstorageClient
- Defined in:
- lib/oci/core/blockstorage_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
-
#create_volume(create_volume_details, opts = {}) ⇒ Response
Creates a new volume in the specified compartment.
-
#create_volume_backup(create_volume_backup_details, opts = {}) ⇒ Response
Creates a new backup of the specified volume.
-
#create_volume_backup_policy_assignment(create_volume_backup_policy_assignment_details, opts = {}) ⇒ Response
Assigns a policy to the specified asset, such as a volume.
-
#delete_boot_volume(boot_volume_id, opts = {}) ⇒ Response
Deletes the specified boot volume.
-
#delete_volume(volume_id, opts = {}) ⇒ Response
Deletes the specified volume.
-
#delete_volume_backup(volume_backup_id, opts = {}) ⇒ Response
Deletes a volume backup.
-
#delete_volume_backup_policy_assignment(policy_assignment_id, opts = {}) ⇒ Response
Deletes a volume backup policy assignment (i.e. unassigns the policy from an asset).
-
#get_boot_volume(boot_volume_id, opts = {}) ⇒ Response
Gets information for the specified boot volume.
-
#get_volume(volume_id, opts = {}) ⇒ Response
Gets information for the specified volume.
-
#get_volume_backup(volume_backup_id, opts = {}) ⇒ Response
Gets information for the specified volume backup.
-
#get_volume_backup_policy(policy_id, opts = {}) ⇒ Response
Gets information for the specified volume backup policy.
-
#get_volume_backup_policy_asset_assignment(asset_id, opts = {}) ⇒ Response
Gets the volume backup policy assignment for the specified asset.
-
#get_volume_backup_policy_assignment(policy_assignment_id, opts = {}) ⇒ Response
Gets information for the specified volume backup policy assignment.
-
#initialize(config: nil, region: nil, signer: nil) ⇒ BlockstorageClient
constructor
Creates a new BlockstorageClient.
-
#list_boot_volumes(availability_domain, compartment_id, opts = {}) ⇒ Response
Lists the boot volumes in the specified compartment and Availability Domain.
-
#list_volume_backup_policies(opts = {}) ⇒ Response
Lists all volume backup policies available to the caller.
-
#list_volume_backups(compartment_id, opts = {}) ⇒ Response
Lists the volume backups in the specified compartment.
-
#list_volumes(compartment_id, opts = {}) ⇒ Response
Lists the volumes in the specified compartment and Availability Domain.
-
#logger ⇒ Logger
The logger for this client.
-
#update_boot_volume(boot_volume_id, update_boot_volume_details, opts = {}) ⇒ Response
Updates the specified boot volume’s display name.
-
#update_volume(volume_id, update_volume_details, opts = {}) ⇒ Response
Updates the specified volume’s display name.
-
#update_volume_backup(volume_backup_id, update_volume_backup_details, opts = {}) ⇒ Response
Updates the display name for the specified volume backup.
Constructor Details
#initialize(config: nil, region: nil, signer: nil) ⇒ BlockstorageClient
Creates a new BlockstorageClient. 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/core/blockstorage_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::STANDARD) 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/core/blockstorage_client.rb', line 12 def api_client @api_client end |
#endpoint ⇒ String (readonly)
Fully qualified endpoint URL
16 17 18 |
# File 'lib/oci/core/blockstorage_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/core/blockstorage_client.rb', line 20 def region @region end |
Instance Method Details
#create_volume(create_volume_details, opts = {}) ⇒ Response
Creates a new volume in the specified compartment. Volumes can be created in sizes ranging from 50 GB (51200 MB) to 16 TB (16777216 MB), in 1 GB (1024 MB) increments. By default, volumes are 1 TB (1048576 MB). For general information about block volumes, see [Overview of Block Volume Service](docs.us-phoenix-1.oraclecloud.com/Content/Block/Concepts/overview.htm).
A volume and instance can be in separate compartments but must be in the same Availability Domain. For information about access control and compartments, see [Overview of the IAM Service](docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm). For information about Availability Domains, see [Regions and Availability Domains](docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm). To get a list of Availability Domains, use the ‘ListAvailabilityDomains` operation in the Identity and Access Management Service API.
You may optionally specify a *display name* for the volume, which is simply a friendly name or description. It does not have to be unique, and you can change it. Avoid entering confidential information.
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/oci/core/blockstorage_client.rb', line 99 def create_volume(create_volume_details, opts = {}) logger.debug "Calling operation BlockstorageClient#create_volume." if logger raise "Missing the required parameter 'create_volume_details' when calling create_volume." if create_volume_details.nil? path = "/volumes" # Query Params query_params = {} # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token'] post_body = @api_client.object_to_http_body(create_volume_details) return @api_client.call_api( :POST, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'OCI::Core::Models::Volume') end |
#create_volume_backup(create_volume_backup_details, opts = {}) ⇒ Response
Creates a new backup of the specified volume. For general information about volume backups, see [Overview of Block Volume Service Backups](docs.us-phoenix-1.oraclecloud.com/Content/Block/Concepts/blockvolumebackups.htm)
When the request is received, the backup object is in a REQUEST_RECEIVED state. When the data is imaged, it goes into a CREATING state. After the backup is fully uploaded to the cloud, it goes into an AVAILABLE state.
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 |
# File 'lib/oci/core/blockstorage_client.rb', line 143 def create_volume_backup(create_volume_backup_details, opts = {}) logger.debug "Calling operation BlockstorageClient#create_volume_backup." if logger raise "Missing the required parameter 'create_volume_backup_details' when calling create_volume_backup." if create_volume_backup_details.nil? path = "/volumeBackups" # Query Params query_params = {} # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token'] post_body = @api_client.object_to_http_body(create_volume_backup_details) return @api_client.call_api( :POST, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'OCI::Core::Models::VolumeBackup') end |
#create_volume_backup_policy_assignment(create_volume_backup_policy_assignment_details, opts = {}) ⇒ Response
Assigns a policy to the specified asset, such as a volume. Note that a given asset can only have one policy assigned to it; if this method is called for an asset that previously has a different policy assigned, the prior assignment will be silently deleted.
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
# File 'lib/oci/core/blockstorage_client.rb', line 178 def create_volume_backup_policy_assignment(create_volume_backup_policy_assignment_details, opts = {}) logger.debug "Calling operation BlockstorageClient#create_volume_backup_policy_assignment." if logger raise "Missing the required parameter 'create_volume_backup_policy_assignment_details' when calling create_volume_backup_policy_assignment." if create_volume_backup_policy_assignment_details.nil? path = "/volumeBackupPolicyAssignments" # Query Params query_params = {} # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' post_body = @api_client.object_to_http_body(create_volume_backup_policy_assignment_details) return @api_client.call_api( :POST, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'OCI::Core::Models::VolumeBackupPolicyAssignment') end |
#delete_boot_volume(boot_volume_id, opts = {}) ⇒ Response
Deletes the specified boot volume. The volume cannot have an active connection to an instance. To disconnect the boot volume from a connected instance, see [Disconnecting From a Boot Volume](docs.us-phoenix-1.oraclecloud.com/Content/Block/Tasks/deletingbootvolume.htm). Warning: All data on the boot volume will be permanently lost when the boot volume is deleted.
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
# File 'lib/oci/core/blockstorage_client.rb', line 217 def delete_boot_volume(boot_volume_id, opts = {}) logger.debug "Calling operation BlockstorageClient#delete_boot_volume." if logger raise "Missing the required parameter 'boot_volume_id' when calling delete_boot_volume." if boot_volume_id.nil? path = "/bootVolumes/{bootVolumeId}".sub('{bootVolumeId}', boot_volume_id.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'] post_body = nil return @api_client.call_api( :DELETE, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body) end |
#delete_volume(volume_id, opts = {}) ⇒ Response
Deletes the specified volume. The volume cannot have an active connection to an instance. To disconnect the volume from a connected instance, see [Disconnecting From a Volume](docs.us-phoenix-1.oraclecloud.com/Content/Block/Tasks/disconnectingfromavolume.htm). Warning: All data on the volume will be permanently lost when the volume is deleted.
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 |
# File 'lib/oci/core/blockstorage_client.rb', line 256 def delete_volume(volume_id, opts = {}) logger.debug "Calling operation BlockstorageClient#delete_volume." if logger raise "Missing the required parameter 'volume_id' when calling delete_volume." if volume_id.nil? path = "/volumes/{volumeId}".sub('{volumeId}', volume_id.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'] post_body = nil return @api_client.call_api( :DELETE, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body) end |
#delete_volume_backup(volume_backup_id, opts = {}) ⇒ Response
Deletes a volume backup.
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 |
# File 'lib/oci/core/blockstorage_client.rb', line 291 def delete_volume_backup(volume_backup_id, opts = {}) logger.debug "Calling operation BlockstorageClient#delete_volume_backup." if logger raise "Missing the required parameter 'volume_backup_id' when calling delete_volume_backup." if volume_backup_id.nil? path = "/volumeBackups/{volumeBackupId}".sub('{volumeBackupId}', volume_backup_id.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'] post_body = nil return @api_client.call_api( :DELETE, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body) end |
#delete_volume_backup_policy_assignment(policy_assignment_id, opts = {}) ⇒ Response
Deletes a volume backup policy assignment (i.e. unassigns the policy from an asset).
326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 |
# File 'lib/oci/core/blockstorage_client.rb', line 326 def delete_volume_backup_policy_assignment(policy_assignment_id, opts = {}) logger.debug "Calling operation BlockstorageClient#delete_volume_backup_policy_assignment." if logger raise "Missing the required parameter 'policy_assignment_id' when calling delete_volume_backup_policy_assignment." if policy_assignment_id.nil? path = "/volumeBackupPolicyAssignments/{policyAssignmentId}".sub('{policyAssignmentId}', policy_assignment_id.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'] post_body = nil return @api_client.call_api( :DELETE, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body) end |
#get_boot_volume(boot_volume_id, opts = {}) ⇒ Response
Gets information for the specified boot volume.
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 382 |
# File 'lib/oci/core/blockstorage_client.rb', line 357 def get_boot_volume(boot_volume_id, opts = {}) logger.debug "Calling operation BlockstorageClient#get_boot_volume." if logger raise "Missing the required parameter 'boot_volume_id' when calling get_boot_volume." if boot_volume_id.nil? path = "/bootVolumes/{bootVolumeId}".sub('{bootVolumeId}', boot_volume_id.to_s) # Query Params query_params = {} # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' 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::Core::Models::BootVolume') end |
#get_volume(volume_id, opts = {}) ⇒ Response
Gets information for the specified volume.
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 |
# File 'lib/oci/core/blockstorage_client.rb', line 388 def get_volume(volume_id, opts = {}) logger.debug "Calling operation BlockstorageClient#get_volume." if logger raise "Missing the required parameter 'volume_id' when calling get_volume." if volume_id.nil? path = "/volumes/{volumeId}".sub('{volumeId}', volume_id.to_s) # Query Params query_params = {} # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' 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::Core::Models::Volume') end |
#get_volume_backup(volume_backup_id, opts = {}) ⇒ Response
Gets information for the specified volume backup.
419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 |
# File 'lib/oci/core/blockstorage_client.rb', line 419 def get_volume_backup(volume_backup_id, opts = {}) logger.debug "Calling operation BlockstorageClient#get_volume_backup." if logger raise "Missing the required parameter 'volume_backup_id' when calling get_volume_backup." if volume_backup_id.nil? path = "/volumeBackups/{volumeBackupId}".sub('{volumeBackupId}', volume_backup_id.to_s) # Query Params query_params = {} # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' 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::Core::Models::VolumeBackup') end |
#get_volume_backup_policy(policy_id, opts = {}) ⇒ Response
Gets information for the specified volume backup policy.
450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 |
# File 'lib/oci/core/blockstorage_client.rb', line 450 def get_volume_backup_policy(policy_id, opts = {}) logger.debug "Calling operation BlockstorageClient#get_volume_backup_policy." if logger raise "Missing the required parameter 'policy_id' when calling get_volume_backup_policy." if policy_id.nil? path = "/volumeBackupPolicies/{policyId}".sub('{policyId}', policy_id.to_s) # Query Params query_params = {} # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' 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::Core::Models::VolumeBackupPolicy') end |
#get_volume_backup_policy_asset_assignment(asset_id, opts = {}) ⇒ Response
Gets the volume backup policy assignment for the specified asset. Note that the assetId query parameter is required, and that the returned list will contain at most one item (since any given asset can only have one policy assigned to it).
490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 |
# File 'lib/oci/core/blockstorage_client.rb', line 490 def get_volume_backup_policy_asset_assignment(asset_id, opts = {}) logger.debug "Calling operation BlockstorageClient#get_volume_backup_policy_asset_assignment." if logger raise "Missing the required parameter 'asset_id' when calling get_volume_backup_policy_asset_assignment." if asset_id.nil? path = "/volumeBackupPolicyAssignments" # Query Params query_params = {} query_params[:'assetId'] = asset_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' 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::Core::Models::VolumeBackupPolicyAssignment>') end |
#get_volume_backup_policy_assignment(policy_assignment_id, opts = {}) ⇒ Response
Gets information for the specified volume backup policy assignment.
524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 |
# File 'lib/oci/core/blockstorage_client.rb', line 524 def get_volume_backup_policy_assignment(policy_assignment_id, opts = {}) logger.debug "Calling operation BlockstorageClient#get_volume_backup_policy_assignment." if logger raise "Missing the required parameter 'policy_assignment_id' when calling get_volume_backup_policy_assignment." if policy_assignment_id.nil? path = "/volumeBackupPolicyAssignments/{policyAssignmentId}".sub('{policyAssignmentId}', policy_assignment_id.to_s) # Query Params query_params = {} # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' 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::Core::Models::VolumeBackupPolicyAssignment') end |
#list_boot_volumes(availability_domain, compartment_id, opts = {}) ⇒ Response
Lists the boot volumes in the specified compartment and Availability Domain.
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 |
# File 'lib/oci/core/blockstorage_client.rb', line 566 def list_boot_volumes(availability_domain, compartment_id, opts = {}) logger.debug "Calling operation BlockstorageClient#list_boot_volumes." if logger raise "Missing the required parameter 'availability_domain' when calling list_boot_volumes." if availability_domain.nil? raise "Missing the required parameter 'compartment_id' when calling list_boot_volumes." if compartment_id.nil? path = "/bootVolumes" # Query Params query_params = {} query_params[:'availabilityDomain'] = availability_domain query_params[:'compartmentId'] = compartment_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' 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::Core::Models::BootVolume>') end |
#list_volume_backup_policies(opts = {}) ⇒ Response
Lists all volume backup policies available to the caller.
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/core/blockstorage_client.rb', line 607 def list_volume_backup_policies(opts = {}) logger.debug "Calling operation BlockstorageClient#list_volume_backup_policies." if logger path = "/volumeBackupPolicies" # 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' 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::Core::Models::VolumeBackupPolicy>') end |
#list_volume_backups(compartment_id, opts = {}) ⇒ Response
Lists the volume backups in the specified compartment. You can filter the results by volume.
665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 |
# File 'lib/oci/core/blockstorage_client.rb', line 665 def list_volume_backups(compartment_id, opts = {}) logger.debug "Calling operation BlockstorageClient#list_volume_backups." if logger raise "Missing the required parameter 'compartment_id' when calling list_volume_backups." if compartment_id.nil? if opts[:'sort_by'] && !['TIMECREATED', 'DISPLAYNAME'].include?(opts[:'sort_by']) raise 'Invalid value for "sort_by", must be one of TIMECREATED, DISPLAYNAME.' end if opts[:'sort_order'] && !['ASC', 'DESC'].include?(opts[:'sort_order']) raise 'Invalid value for "sort_order", must be one of ASC, DESC.' end if opts[:'lifecycle_state'] && !OCI::Core::Models::VolumeBackup::LIFECYCLE_STATE_ENUM.include?(opts[:'lifecycle_state']) raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Core::Models::VolumeBackup::LIFECYCLE_STATE_ENUM.' end path = "/volumeBackups" # Query Params query_params = {} query_params[:'compartmentId'] = compartment_id query_params[:'volumeId'] = opts[:'volume_id'] if opts[:'volume_id'] query_params[:'limit'] = opts[:'limit'] if opts[:'limit'] query_params[:'page'] = opts[:'page'] if opts[:'page'] query_params[:'displayName'] = opts[:'display_name'] if opts[:'display_name'] query_params[:'sortBy'] = opts[:'sort_by'] if opts[:'sort_by'] query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order'] query_params[:'lifecycleState'] = opts[:'lifecycle_state'] if opts[:'lifecycle_state'] # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' 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::Core::Models::VolumeBackup>') end |
#list_volumes(compartment_id, opts = {}) ⇒ Response
Lists the volumes in the specified compartment and Availability Domain.
745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 |
# File 'lib/oci/core/blockstorage_client.rb', line 745 def list_volumes(compartment_id, opts = {}) logger.debug "Calling operation BlockstorageClient#list_volumes." if logger raise "Missing the required parameter 'compartment_id' when calling list_volumes." if compartment_id.nil? if opts[:'sort_by'] && !['TIMECREATED', 'DISPLAYNAME'].include?(opts[:'sort_by']) raise 'Invalid value for "sort_by", must be one of TIMECREATED, DISPLAYNAME.' end if opts[:'sort_order'] && !['ASC', 'DESC'].include?(opts[:'sort_order']) raise 'Invalid value for "sort_order", must be one of ASC, DESC.' end if opts[:'lifecycle_state'] && !OCI::Core::Models::Volume::LIFECYCLE_STATE_ENUM.include?(opts[:'lifecycle_state']) raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Core::Models::Volume::LIFECYCLE_STATE_ENUM.' end path = "/volumes" # Query Params query_params = {} query_params[:'compartmentId'] = compartment_id query_params[:'availabilityDomain'] = opts[:'availability_domain'] if opts[:'availability_domain'] query_params[:'limit'] = opts[:'limit'] if opts[:'limit'] query_params[:'page'] = opts[:'page'] if opts[:'page'] query_params[:'displayName'] = opts[:'display_name'] if opts[:'display_name'] query_params[:'sortBy'] = opts[:'sort_by'] if opts[:'sort_by'] query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order'] query_params[:'lifecycleState'] = opts[:'lifecycle_state'] if opts[:'lifecycle_state'] # Header Params header_params = {} header_params['accept'] = 'application/json' header_params['content-type'] = 'application/json' 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::Core::Models::Volume>') end |
#logger ⇒ Logger
Returns The logger for this client. May be nil.
70 71 72 |
# File 'lib/oci/core/blockstorage_client.rb', line 70 def logger @api_client.config.logger end |
#update_boot_volume(boot_volume_id, update_boot_volume_details, opts = {}) ⇒ Response
Updates the specified boot volume’s display name.
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 |
# File 'lib/oci/core/blockstorage_client.rb', line 801 def update_boot_volume(boot_volume_id, update_boot_volume_details, opts = {}) logger.debug "Calling operation BlockstorageClient#update_boot_volume." if logger raise "Missing the required parameter 'boot_volume_id' when calling update_boot_volume." if boot_volume_id.nil? raise "Missing the required parameter 'update_boot_volume_details' when calling update_boot_volume." if update_boot_volume_details.nil? path = "/bootVolumes/{bootVolumeId}".sub('{bootVolumeId}', boot_volume_id.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'] post_body = @api_client.object_to_http_body(update_boot_volume_details) return @api_client.call_api( :PUT, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'OCI::Core::Models::BootVolume') end |
#update_volume(volume_id, update_volume_details, opts = {}) ⇒ Response
Updates the specified volume’s display name. Avoid entering confidential information.
841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 |
# File 'lib/oci/core/blockstorage_client.rb', line 841 def update_volume(volume_id, update_volume_details, opts = {}) logger.debug "Calling operation BlockstorageClient#update_volume." if logger raise "Missing the required parameter 'volume_id' when calling update_volume." if volume_id.nil? raise "Missing the required parameter 'update_volume_details' when calling update_volume." if update_volume_details.nil? path = "/volumes/{volumeId}".sub('{volumeId}', volume_id.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'] post_body = @api_client.object_to_http_body(update_volume_details) return @api_client.call_api( :PUT, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'OCI::Core::Models::Volume') end |
#update_volume_backup(volume_backup_id, update_volume_backup_details, opts = {}) ⇒ Response
Updates the display name for the specified volume backup. Avoid entering confidential information.
881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 |
# File 'lib/oci/core/blockstorage_client.rb', line 881 def update_volume_backup(volume_backup_id, update_volume_backup_details, opts = {}) logger.debug "Calling operation BlockstorageClient#update_volume_backup." if logger raise "Missing the required parameter 'volume_backup_id' when calling update_volume_backup." if volume_backup_id.nil? raise "Missing the required parameter 'update_volume_backup_details' when calling update_volume_backup." if update_volume_backup_details.nil? path = "/volumeBackups/{volumeBackupId}".sub('{volumeBackupId}', volume_backup_id.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'] post_body = @api_client.object_to_http_body(update_volume_backup_details) return @api_client.call_api( :PUT, path, endpoint, :header_params => header_params, :query_params => query_params, :body => post_body, :return_type => 'OCI::Core::Models::VolumeBackup') end |