Class: OCI::Vault::VaultsClient
- Inherits:
-
Object
- Object
- OCI::Vault::VaultsClient
- Defined in:
- lib/oci/vault/vaults_client.rb
Overview
Use the Secret Management API to manage secrets and secret versions. For more information, see Managing Secrets.
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.
-
#retry_config ⇒ OCI::Retry::RetryConfig
readonly
The default retry configuration to apply to all operations in this service client.
Instance Method Summary collapse
-
#cancel_secret_deletion(secret_id, opts = {}) ⇒ Response
Cancels the pending deletion of the specified secret.
-
#cancel_secret_rotation(secret_id, opts = {}) ⇒ Response
Cancels the ongoing secret rotation.
-
#cancel_secret_version_deletion(secret_id, secret_version_number, opts = {}) ⇒ Response
Cancels the scheduled deletion of a secret version.
-
#change_secret_compartment(secret_id, change_secret_compartment_details, opts = {}) ⇒ Response
Moves a secret into a different compartment within the same tenancy.
-
#create_secret(create_secret_details, opts = {}) ⇒ Response
Creates a new secret according to the details of the request.
-
#get_secret(secret_id, opts = {}) ⇒ Response
Gets information about the specified secret.
-
#get_secret_version(secret_id, secret_version_number, opts = {}) ⇒ Response
Gets information about the specified version of a secret.
-
#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ VaultsClient
constructor
Creates a new VaultsClient.
-
#list_secret_versions(secret_id, opts = {}) ⇒ Response
Lists all secret versions for the specified secret.
-
#list_secrets(compartment_id, opts = {}) ⇒ Response
Lists all secrets in the specified vault and compartment.
-
#logger ⇒ Logger
The logger for this client.
-
#rotate_secret(secret_id, opts = {}) ⇒ Response
API to force rotation of an existing secret in Vault and the specified target system; expects secret to have a valid Target System Details object.
-
#schedule_secret_deletion(secret_id, schedule_secret_deletion_details, opts = {}) ⇒ Response
Schedules the deletion of the specified secret.
-
#schedule_secret_version_deletion(secret_id, secret_version_number, schedule_secret_version_deletion_details, opts = {}) ⇒ Response
Schedules the deletion of the specified secret version.
-
#update_secret(secret_id, update_secret_details, opts = {}) ⇒ Response
Updates the properties of a secret.
Constructor Details
#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ VaultsClient
Creates a new VaultsClient. Notes: If a config is not specified, then the global OCI.config will be used.
This client is not thread-safe
Either a region or an endpoint must be specified. If an endpoint is specified, it will be used instead of the region. A region may be specified in the config or via or the region parameter. If specified in both, then the region parameter will be used.
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/oci/vault/vaults_client.rb', line 55 def initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) # If the signer is an InstancePrincipalsSecurityTokenSigner or SecurityTokenSigner and no config was supplied (they are self-sufficient signers) # 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.validate_and_build_config_with_signer(config, signer) signer = OCI::Signer.config_file_auth_builder(config) if signer.nil? @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings) @retry_config = retry_config if endpoint @endpoint = endpoint + '/20180608' else region ||= config.region region ||= signer.region if signer.respond_to?(:region) self.region = region end logger.info "VaultsClient endpoint set to '#{@endpoint}'." if logger end |
Instance Attribute Details
#api_client ⇒ OCI::ApiClient (readonly)
Client used to make HTTP requests.
15 16 17 |
# File 'lib/oci/vault/vaults_client.rb', line 15 def api_client @api_client end |
#endpoint ⇒ String (readonly)
Fully qualified endpoint URL
19 20 21 |
# File 'lib/oci/vault/vaults_client.rb', line 19 def endpoint @endpoint end |
#region ⇒ String
The region, which will usually correspond to a value in Regions::REGION_ENUM.
29 30 31 |
# File 'lib/oci/vault/vaults_client.rb', line 29 def region @region end |
#retry_config ⇒ OCI::Retry::RetryConfig (readonly)
The default retry configuration to apply to all operations in this service client. This can be overridden on a per-operation basis. The default retry configuration value is nil
, which means that an operation will not perform any retries
25 26 27 |
# File 'lib/oci/vault/vaults_client.rb', line 25 def retry_config @retry_config end |
Instance Method Details
#cancel_secret_deletion(secret_id, opts = {}) ⇒ Response
Click here to see an example of how to use cancel_secret_deletion API.
Cancels the pending deletion of the specified secret. Canceling a scheduled deletion restores the secret's lifecycle state to what it was before you scheduled the secret for deletion.
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/oci/vault/vaults_client.rb', line 123 def cancel_secret_deletion(secret_id, opts = {}) logger.debug 'Calling operation VaultsClient#cancel_secret_deletion.' if logger raise "Missing the required parameter 'secret_id' when calling cancel_secret_deletion." if secret_id.nil? raise "Parameter value for 'secret_id' must not be blank" if OCI::Internal::Util.blank_string?(secret_id) path = '/secrets/{secretId}/actions/cancelDeletion'.sub('{secretId}', secret_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # 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-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'VaultsClient#cancel_secret_deletion') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body ) end # rubocop:enable Metrics/BlockLength end |
#cancel_secret_rotation(secret_id, opts = {}) ⇒ Response
Click here to see an example of how to use cancel_secret_rotation API.
Cancels the ongoing secret rotation. The cancellation is contingent on how far the rotation process has progressed. Upon cancelling a rotation, all future rotations are also disabled.
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 |
# File 'lib/oci/vault/vaults_client.rb', line 189 def cancel_secret_rotation(secret_id, opts = {}) logger.debug 'Calling operation VaultsClient#cancel_secret_rotation.' if logger raise "Missing the required parameter 'secret_id' when calling cancel_secret_rotation." if secret_id.nil? raise "Parameter value for 'secret_id' must not be blank" if OCI::Internal::Util.blank_string?(secret_id) path = '/secrets/{secretId}/actions/cancelRotation'.sub('{secretId}', secret_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # 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-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'VaultsClient#cancel_secret_rotation') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body ) end # rubocop:enable Metrics/BlockLength end |
#cancel_secret_version_deletion(secret_id, secret_version_number, opts = {}) ⇒ Response
Click here to see an example of how to use cancel_secret_version_deletion API.
Cancels the scheduled deletion of a secret version.
253 254 255 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 282 283 284 285 286 287 288 289 290 291 |
# File 'lib/oci/vault/vaults_client.rb', line 253 def cancel_secret_version_deletion(secret_id, secret_version_number, opts = {}) logger.debug 'Calling operation VaultsClient#cancel_secret_version_deletion.' if logger raise "Missing the required parameter 'secret_id' when calling cancel_secret_version_deletion." if secret_id.nil? raise "Missing the required parameter 'secret_version_number' when calling cancel_secret_version_deletion." if secret_version_number.nil? raise "Parameter value for 'secret_id' must not be blank" if OCI::Internal::Util.blank_string?(secret_id) raise "Parameter value for 'secret_version_number' must not be blank" if OCI::Internal::Util.blank_string?(secret_version_number) path = '/secrets/{secretId}/version/{secretVersionNumber}/actions/cancelDeletion'.sub('{secretId}', secret_id.to_s).sub('{secretVersionNumber}', secret_version_number.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # 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-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'VaultsClient#cancel_secret_version_deletion') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body ) end # rubocop:enable Metrics/BlockLength end |
#change_secret_compartment(secret_id, change_secret_compartment_details, opts = {}) ⇒ Response
Click here to see an example of how to use change_secret_compartment API.
Moves a secret into a different compartment within the same tenancy. For information about moving resources between compartments, see Moving Resources to a Different Compartment.
When provided, if-match is checked against the ETag values of the secret.
330 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 358 359 360 361 362 363 364 365 366 367 368 369 |
# File 'lib/oci/vault/vaults_client.rb', line 330 def change_secret_compartment(secret_id, change_secret_compartment_details, opts = {}) logger.debug 'Calling operation VaultsClient#change_secret_compartment.' if logger raise "Missing the required parameter 'secret_id' when calling change_secret_compartment." if secret_id.nil? raise "Missing the required parameter 'change_secret_compartment_details' when calling change_secret_compartment." if change_secret_compartment_details.nil? raise "Parameter value for 'secret_id' must not be blank" if OCI::Internal::Util.blank_string?(secret_id) path = '/secrets/{secretId}/actions/changeCompartment'.sub('{secretId}', secret_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # 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-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(change_secret_compartment_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'VaultsClient#change_secret_compartment') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body ) end # rubocop:enable Metrics/BlockLength end |
#create_secret(create_secret_details, opts = {}) ⇒ Response
Click here to see an example of how to use create_secret API.
Creates a new secret according to the details of the request.
This operation is not supported by the Oracle Cloud Infrastructure Terraform Provider.
400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 |
# File 'lib/oci/vault/vaults_client.rb', line 400 def create_secret(create_secret_details, opts = {}) logger.debug 'Calling operation VaultsClient#create_secret.' if logger raise "Missing the required parameter 'create_secret_details' when calling create_secret." if create_secret_details.nil? path = '/secrets' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(create_secret_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'VaultsClient#create_secret') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Vault::Models::Secret' ) end # rubocop:enable Metrics/BlockLength end |
#get_secret(secret_id, opts = {}) ⇒ Response
Click here to see an example of how to use get_secret API.
Gets information about the specified secret.
458 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 486 487 488 489 490 491 492 493 494 |
# File 'lib/oci/vault/vaults_client.rb', line 458 def get_secret(secret_id, opts = {}) logger.debug 'Calling operation VaultsClient#get_secret.' if logger raise "Missing the required parameter 'secret_id' when calling get_secret." if secret_id.nil? raise "Parameter value for 'secret_id' must not be blank" if OCI::Internal::Util.blank_string?(secret_id) path = '/secrets/{secretId}'.sub('{secretId}', secret_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'VaultsClient#get_secret') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Vault::Models::Secret' ) end # rubocop:enable Metrics/BlockLength end |
#get_secret_version(secret_id, secret_version_number, opts = {}) ⇒ Response
Click here to see an example of how to use get_secret_version API.
Gets information about the specified version of a secret.
517 518 519 520 521 522 523 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 550 551 552 553 554 555 |
# File 'lib/oci/vault/vaults_client.rb', line 517 def get_secret_version(secret_id, secret_version_number, opts = {}) logger.debug 'Calling operation VaultsClient#get_secret_version.' if logger raise "Missing the required parameter 'secret_id' when calling get_secret_version." if secret_id.nil? raise "Missing the required parameter 'secret_version_number' when calling get_secret_version." if secret_version_number.nil? raise "Parameter value for 'secret_id' must not be blank" if OCI::Internal::Util.blank_string?(secret_id) raise "Parameter value for 'secret_version_number' must not be blank" if OCI::Internal::Util.blank_string?(secret_version_number) path = '/secrets/{secretId}/version/{secretVersionNumber}'.sub('{secretId}', secret_id.to_s).sub('{secretVersionNumber}', secret_version_number.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'VaultsClient#get_secret_version') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Vault::Models::SecretVersion' ) end # rubocop:enable Metrics/BlockLength end |
#list_secret_versions(secret_id, opts = {}) ⇒ Response
Click here to see an example of how to use list_secret_versions API.
Lists all secret versions for the specified secret. Allowed values are: VERSION_NUMBER Allowed values are: ASC, DESC
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 634 635 |
# File 'lib/oci/vault/vaults_client.rb', line 587 def list_secret_versions(secret_id, opts = {}) logger.debug 'Calling operation VaultsClient#list_secret_versions.' if logger raise "Missing the required parameter 'secret_id' when calling list_secret_versions." if secret_id.nil? if opts[:sort_by] && !%w[VERSION_NUMBER].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of VERSION_NUMBER.' end if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of ASC, DESC.' end raise "Parameter value for 'secret_id' must not be blank" if OCI::Internal::Util.blank_string?(secret_id) path = '/secrets/{secretId}/versions'.sub('{secretId}', secret_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] query_params[:sortBy] = opts[:sort_by] if opts[:sort_by] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'VaultsClient#list_secret_versions') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'Array<OCI::Vault::Models::SecretVersionSummary>' ) end # rubocop:enable Metrics/BlockLength end |
#list_secrets(compartment_id, opts = {}) ⇒ Response
Click here to see an example of how to use list_secrets API.
Lists all secrets in the specified vault and compartment. Allowed values are: ASC, DESC
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 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 |
# File 'lib/oci/vault/vaults_client.rb', line 672 def list_secrets(compartment_id, opts = {}) logger.debug 'Calling operation VaultsClient#list_secrets.' if logger raise "Missing the required parameter 'compartment_id' when calling list_secrets." if compartment_id.nil? if opts[:sort_by] && !%w[TIMECREATED NAME].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of TIMECREATED, NAME.' end if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of ASC, DESC.' end if opts[:lifecycle_state] && !OCI::Vault::Models::SecretSummary::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state]) raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Vault::Models::SecretSummary::LIFECYCLE_STATE_ENUM.' end path = '/secrets' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:name] = opts[:name] if opts[:name] query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] query_params[:sortBy] = opts[:sort_by] if opts[:sort_by] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] query_params[:vaultId] = opts[:vault_id] if opts[:vault_id] 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' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'VaultsClient#list_secrets') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'Array<OCI::Vault::Models::SecretSummary>' ) end # rubocop:enable Metrics/BlockLength end |
#logger ⇒ Logger
Returns The logger for this client. May be nil.
94 95 96 |
# File 'lib/oci/vault/vaults_client.rb', line 94 def logger @api_client.config.logger end |
#rotate_secret(secret_id, opts = {}) ⇒ Response
Click here to see an example of how to use rotate_secret API.
API to force rotation of an existing secret in Vault and the specified target system; expects secret to have a valid Target System Details object
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 |
# File 'lib/oci/vault/vaults_client.rb', line 762 def rotate_secret(secret_id, opts = {}) logger.debug 'Calling operation VaultsClient#rotate_secret.' if logger raise "Missing the required parameter 'secret_id' when calling rotate_secret." if secret_id.nil? raise "Parameter value for 'secret_id' must not be blank" if OCI::Internal::Util.blank_string?(secret_id) path = '/secrets/{secretId}/actions/rotate'.sub('{secretId}', secret_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # 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-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'VaultsClient#rotate_secret') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body ) end # rubocop:enable Metrics/BlockLength end |
#schedule_secret_deletion(secret_id, schedule_secret_deletion_details, opts = {}) ⇒ Response
Click here to see an example of how to use schedule_secret_deletion API.
Schedules the deletion of the specified secret. This sets the lifecycle state of the secret to PENDING_DELETION
and then deletes it after the specified retention period ends.
830 831 832 833 834 835 836 837 838 839 840 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 |
# File 'lib/oci/vault/vaults_client.rb', line 830 def schedule_secret_deletion(secret_id, schedule_secret_deletion_details, opts = {}) logger.debug 'Calling operation VaultsClient#schedule_secret_deletion.' if logger raise "Missing the required parameter 'secret_id' when calling schedule_secret_deletion." if secret_id.nil? raise "Missing the required parameter 'schedule_secret_deletion_details' when calling schedule_secret_deletion." if schedule_secret_deletion_details.nil? raise "Parameter value for 'secret_id' must not be blank" if OCI::Internal::Util.blank_string?(secret_id) path = '/secrets/{secretId}/actions/scheduleDeletion'.sub('{secretId}', secret_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # 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-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = @api_client.object_to_http_body(schedule_secret_deletion_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'VaultsClient#schedule_secret_deletion') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body ) end # rubocop:enable Metrics/BlockLength end |
#schedule_secret_version_deletion(secret_id, secret_version_number, schedule_secret_version_deletion_details, opts = {}) ⇒ Response
Click here to see an example of how to use schedule_secret_version_deletion API.
Schedules the deletion of the specified secret version. This deletes it after the specified retention period ends. You can only delete a secret version if the secret version rotation state is marked as DEPRECATED
.
899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 |
# File 'lib/oci/vault/vaults_client.rb', line 899 def schedule_secret_version_deletion(secret_id, secret_version_number, schedule_secret_version_deletion_details, opts = {}) logger.debug 'Calling operation VaultsClient#schedule_secret_version_deletion.' if logger raise "Missing the required parameter 'secret_id' when calling schedule_secret_version_deletion." if secret_id.nil? raise "Missing the required parameter 'secret_version_number' when calling schedule_secret_version_deletion." if secret_version_number.nil? raise "Missing the required parameter 'schedule_secret_version_deletion_details' when calling schedule_secret_version_deletion." if schedule_secret_version_deletion_details.nil? raise "Parameter value for 'secret_id' must not be blank" if OCI::Internal::Util.blank_string?(secret_id) raise "Parameter value for 'secret_version_number' must not be blank" if OCI::Internal::Util.blank_string?(secret_version_number) path = '/secrets/{secretId}/version/{secretVersionNumber}/actions/scheduleDeletion'.sub('{secretId}', secret_id.to_s).sub('{secretVersionNumber}', secret_version_number.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # 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-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = @api_client.object_to_http_body(schedule_secret_version_deletion_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'VaultsClient#schedule_secret_version_deletion') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body ) end # rubocop:enable Metrics/BlockLength end |
#update_secret(secret_id, update_secret_details, opts = {}) ⇒ Response
Click here to see an example of how to use update_secret API.
Updates the properties of a secret. Specifically, you can update the version number of the secret to make that version number the current version. You can also update a secret's description, its free-form or defined tags, rules and the secret contents. Updating the secret content automatically creates a new secret version. You cannot, however, update the current secret version number, secret contents, and secret rules at the same time. Furthermore, the secret must in an ACTIVE
lifecycle state to be updated.
This operation is not supported by the Oracle Cloud Infrastructure Terraform Provider.
972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 |
# File 'lib/oci/vault/vaults_client.rb', line 972 def update_secret(secret_id, update_secret_details, opts = {}) logger.debug 'Calling operation VaultsClient#update_secret.' if logger raise "Missing the required parameter 'secret_id' when calling update_secret." if secret_id.nil? raise "Missing the required parameter 'update_secret_details' when calling update_secret." if update_secret_details.nil? raise "Parameter value for 'secret_id' must not be blank" if OCI::Internal::Util.blank_string?(secret_id) path = '/secrets/{secretId}'.sub('{secretId}', secret_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # 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-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] # rubocop:enable Style/NegatedIf post_body = @api_client.object_to_http_body(update_secret_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'VaultsClient#update_secret') do @api_client.call_api( :PUT, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::Vault::Models::Secret' ) end # rubocop:enable Metrics/BlockLength end |