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, proxy_settings: 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, proxy_settings: 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.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/oci/core/blockstorage_client.rb', line 36 def initialize(config: nil, region: nil, signer: nil, proxy_settings: 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, proxy_settings: proxy_settings) 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.
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 126 127 |
# File 'lib/oci/core/blockstorage_client.rb', line 101 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.
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/core/blockstorage_client.rb', line 145 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.
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 |
# File 'lib/oci/core/blockstorage_client.rb', line 180 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.
219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 |
# File 'lib/oci/core/blockstorage_client.rb', line 219 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? raise "Parameter value for 'boot_volume_id' must not be blank" if OCI::Internal::Util::blank_string?(boot_volume_id) 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.
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 |
# File 'lib/oci/core/blockstorage_client.rb', line 259 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? raise "Parameter value for 'volume_id' must not be blank" if OCI::Internal::Util::blank_string?(volume_id) 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.
295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 |
# File 'lib/oci/core/blockstorage_client.rb', line 295 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? raise "Parameter value for 'volume_backup_id' must not be blank" if OCI::Internal::Util::blank_string?(volume_backup_id) 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).
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 |
# File 'lib/oci/core/blockstorage_client.rb', line 331 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? raise "Parameter value for 'policy_assignment_id' must not be blank" if OCI::Internal::Util::blank_string?(policy_assignment_id) 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.
363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 |
# File 'lib/oci/core/blockstorage_client.rb', line 363 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? raise "Parameter value for 'boot_volume_id' must not be blank" if OCI::Internal::Util::blank_string?(boot_volume_id) 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.
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/core/blockstorage_client.rb', line 395 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? raise "Parameter value for 'volume_id' must not be blank" if OCI::Internal::Util::blank_string?(volume_id) 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.
427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 |
# File 'lib/oci/core/blockstorage_client.rb', line 427 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? raise "Parameter value for 'volume_backup_id' must not be blank" if OCI::Internal::Util::blank_string?(volume_backup_id) 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.
459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 |
# File 'lib/oci/core/blockstorage_client.rb', line 459 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? raise "Parameter value for 'policy_id' must not be blank" if OCI::Internal::Util::blank_string?(policy_id) 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).
500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 |
# File 'lib/oci/core/blockstorage_client.rb', line 500 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.
534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 |
# File 'lib/oci/core/blockstorage_client.rb', line 534 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? raise "Parameter value for 'policy_assignment_id' must not be blank" if OCI::Internal::Util::blank_string?(policy_assignment_id) 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.
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 |
# File 'lib/oci/core/blockstorage_client.rb', line 577 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.
618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 |
# File 'lib/oci/core/blockstorage_client.rb', line 618 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.
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 711 712 713 714 715 716 717 718 719 720 721 |
# File 'lib/oci/core/blockstorage_client.rb', line 676 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.
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 791 792 793 794 795 796 797 798 799 800 801 |
# File 'lib/oci/core/blockstorage_client.rb', line 756 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.
72 73 74 |
# File 'lib/oci/core/blockstorage_client.rb', line 72 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.
812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 |
# File 'lib/oci/core/blockstorage_client.rb', line 812 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? raise "Parameter value for 'boot_volume_id' must not be blank" if OCI::Internal::Util::blank_string?(boot_volume_id) 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.
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 880 881 |
# File 'lib/oci/core/blockstorage_client.rb', line 853 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? raise "Parameter value for 'volume_id' must not be blank" if OCI::Internal::Util::blank_string?(volume_id) 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.
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 922 |
# File 'lib/oci/core/blockstorage_client.rb', line 894 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? raise "Parameter value for 'volume_backup_id' must not be blank" if OCI::Internal::Util::blank_string?(volume_backup_id) 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 |