Class: OCI::Zpr::ZprClient
- Inherits:
-
Object
- Object
- OCI::Zpr::ZprClient
- Defined in:
- lib/oci/zpr/zpr_client.rb
Overview
Use the Zero Trust Packet Routing Control Plane API to manage ZPR configuration and policy. See the Zero Trust Packet Routing documentation for more information.
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
-
#create_configuration(create_configuration_details, opts = {}) ⇒ Response
Initiates the process to onboard ZPR in a root compartment (the root compartment is the tenancy).
-
#create_zpr_policy(create_zpr_policy_details, opts = {}) ⇒ Response
Creates a ZprPolicy.
-
#delete_zpr_policy(zpr_policy_id, opts = {}) ⇒ Response
Deletes a ZprPolicy.
-
#get_configuration(opts = {}) ⇒ Response
Retrieves the ZPR configuration details for the root compartment (the root compartment is the tenancy).
-
#get_zpr_configuration_work_request(work_request_id, opts = {}) ⇒ Response
Gets the details of a work request.
-
#get_zpr_policy(zpr_policy_id, opts = {}) ⇒ Response
Gets information about a ZprPolicy.
-
#get_zpr_policy_work_request(work_request_id, opts = {}) ⇒ Response
Gets the details of a work request.
-
#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ ZprClient
constructor
Creates a new ZprClient.
-
#list_zpr_configuration_work_request_errors(work_request_id, opts = {}) ⇒ Response
Lists the errors for a work request.
-
#list_zpr_configuration_work_request_logs(work_request_id, opts = {}) ⇒ Response
Lists the logs for a work request.
-
#list_zpr_configuration_work_requests(opts = {}) ⇒ Response
Lists the work requests in a compartment.
-
#list_zpr_policies(opts = {}) ⇒ Response
Gets a list of ZprPolicies.
-
#list_zpr_policy_work_request_errors(work_request_id, opts = {}) ⇒ Response
Lists the errors for a work request.
-
#list_zpr_policy_work_request_logs(work_request_id, opts = {}) ⇒ Response
Lists the logs for a work request.
-
#list_zpr_policy_work_requests(opts = {}) ⇒ Response
Lists the work requests in a compartment.
-
#logger ⇒ Logger
The logger for this client.
-
#update_zpr_policy(zpr_policy_id, update_zpr_policy_details, opts = {}) ⇒ Response
Updates a specific ZprPolicy.
Constructor Details
#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ ZprClient
Creates a new ZprClient. 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/zpr/zpr_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 + '/20240301' else region ||= config.region region ||= signer.region if signer.respond_to?(:region) self.region = region end logger.info "ZprClient 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/zpr/zpr_client.rb', line 15 def api_client @api_client end |
#endpoint ⇒ String (readonly)
Fully qualified endpoint URL
19 20 21 |
# File 'lib/oci/zpr/zpr_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/zpr/zpr_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/zpr/zpr_client.rb', line 25 def retry_config @retry_config end |
Instance Method Details
#create_configuration(create_configuration_details, opts = {}) ⇒ Response
Click here to see an example of how to use create_configuration API.
Initiates the process to onboard ZPR in a root compartment (the root compartment is the tenancy). It creates an object of ZPR configuration as part of onboarding.
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 160 161 162 163 |
# File 'lib/oci/zpr/zpr_client.rb', line 126 def create_configuration(create_configuration_details, opts = {}) logger.debug 'Calling operation ZprClient#create_configuration.' if logger raise "Missing the required parameter 'create_configuration_details' when calling create_configuration." if create_configuration_details.nil? path = '/configuration' 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] header_params[:'opc-dry-run'] = opts[:opc_dry_run] if !opts[:opc_dry_run].nil? # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(create_configuration_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ZprClient#create_configuration') 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_zpr_policy(create_zpr_policy_details, opts = {}) ⇒ Response
Click here to see an example of how to use create_zpr_policy API.
Creates a ZprPolicy.
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 226 227 228 229 230 231 232 233 |
# File 'lib/oci/zpr/zpr_client.rb', line 195 def create_zpr_policy(create_zpr_policy_details, opts = {}) logger.debug 'Calling operation ZprClient#create_zpr_policy.' if logger raise "Missing the required parameter 'create_zpr_policy_details' when calling create_zpr_policy." if create_zpr_policy_details.nil? path = '/zprPolicies' 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-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'opc-dry-run'] = opts[:opc_dry_run] if !opts[:opc_dry_run].nil? # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(create_zpr_policy_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ZprClient#create_zpr_policy') 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::Zpr::Models::ZprPolicy' ) end # rubocop:enable Metrics/BlockLength end |
#delete_zpr_policy(zpr_policy_id, opts = {}) ⇒ Response
Click here to see an example of how to use delete_zpr_policy API.
Deletes a ZprPolicy.
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 292 293 294 295 296 297 298 299 300 |
# File 'lib/oci/zpr/zpr_client.rb', line 263 def delete_zpr_policy(zpr_policy_id, opts = {}) logger.debug 'Calling operation ZprClient#delete_zpr_policy.' if logger raise "Missing the required parameter 'zpr_policy_id' when calling delete_zpr_policy." if zpr_policy_id.nil? raise "Parameter value for 'zpr_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(zpr_policy_id) path = '/zprPolicies/{zprPolicyId}'.sub('{zprPolicyId}', zpr_policy_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-dry-run'] = opts[:opc_dry_run] if !opts[:opc_dry_run].nil? # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ZprClient#delete_zpr_policy') do @api_client.call_api( :DELETE, 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 |
#get_configuration(opts = {}) ⇒ Response
Click here to see an example of how to use get_configuration API.
Retrieves the ZPR configuration details for the root compartment (the root compartment is the tenancy). Returns ZPR configuration for root compartment (the root compartment is the tenancy).
324 325 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 352 353 354 355 356 357 358 359 |
# File 'lib/oci/zpr/zpr_client.rb', line 324 def get_configuration(opts = {}) logger.debug 'Calling operation ZprClient#get_configuration.' if logger path = '/configuration' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = opts[:compartment_id] if opts[:compartment_id] # 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: 'ZprClient#get_configuration') 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::Zpr::Models::Configuration' ) end # rubocop:enable Metrics/BlockLength end |
#get_zpr_configuration_work_request(work_request_id, opts = {}) ⇒ Response
Click here to see an example of how to use get_zpr_configuration_work_request API.
Gets the details of a work request.
381 382 383 384 385 386 387 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 414 415 416 417 |
# File 'lib/oci/zpr/zpr_client.rb', line 381 def get_zpr_configuration_work_request(work_request_id, opts = {}) logger.debug 'Calling operation ZprClient#get_zpr_configuration_work_request.' if logger raise "Missing the required parameter 'work_request_id' when calling get_zpr_configuration_work_request." if work_request_id.nil? raise "Parameter value for 'work_request_id' must not be blank" if OCI::Internal::Util.blank_string?(work_request_id) path = '/zprConfigurationWorkRequests/{workRequestId}'.sub('{workRequestId}', work_request_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: 'ZprClient#get_zpr_configuration_work_request') 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::Zpr::Models::WorkRequest' ) end # rubocop:enable Metrics/BlockLength end |
#get_zpr_policy(zpr_policy_id, opts = {}) ⇒ Response
Click here to see an example of how to use get_zpr_policy API.
Gets information about a ZprPolicy.
439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 |
# File 'lib/oci/zpr/zpr_client.rb', line 439 def get_zpr_policy(zpr_policy_id, opts = {}) logger.debug 'Calling operation ZprClient#get_zpr_policy.' if logger raise "Missing the required parameter 'zpr_policy_id' when calling get_zpr_policy." if zpr_policy_id.nil? raise "Parameter value for 'zpr_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(zpr_policy_id) path = '/zprPolicies/{zprPolicyId}'.sub('{zprPolicyId}', zpr_policy_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: 'ZprClient#get_zpr_policy') 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::Zpr::Models::ZprPolicy' ) end # rubocop:enable Metrics/BlockLength end |
#get_zpr_policy_work_request(work_request_id, opts = {}) ⇒ Response
Click here to see an example of how to use get_zpr_policy_work_request API.
Gets the details of a work request.
497 498 499 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 529 530 531 532 533 |
# File 'lib/oci/zpr/zpr_client.rb', line 497 def get_zpr_policy_work_request(work_request_id, opts = {}) logger.debug 'Calling operation ZprClient#get_zpr_policy_work_request.' if logger raise "Missing the required parameter 'work_request_id' when calling get_zpr_policy_work_request." if work_request_id.nil? raise "Parameter value for 'work_request_id' must not be blank" if OCI::Internal::Util.blank_string?(work_request_id) path = '/zprPolicyWorkRequests/{workRequestId}'.sub('{workRequestId}', work_request_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: 'ZprClient#get_zpr_policy_work_request') 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::Zpr::Models::WorkRequest' ) end # rubocop:enable Metrics/BlockLength end |
#list_zpr_configuration_work_request_errors(work_request_id, opts = {}) ⇒ Response
Click here to see an example of how to use list_zpr_configuration_work_request_errors API.
Lists the errors for a work request.
Allowed values are: timestamp
568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 |
# File 'lib/oci/zpr/zpr_client.rb', line 568 def list_zpr_configuration_work_request_errors(work_request_id, opts = {}) logger.debug 'Calling operation ZprClient#list_zpr_configuration_work_request_errors.' if logger raise "Missing the required parameter 'work_request_id' when calling list_zpr_configuration_work_request_errors." if work_request_id.nil? if opts[:sort_by] && !%w[timestamp].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of timestamp.' end if opts[:sort_order] && !OCI::Zpr::Models::SORT_ORDER_ENUM.include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of the values in OCI::Zpr::Models::SORT_ORDER_ENUM.' end raise "Parameter value for 'work_request_id' must not be blank" if OCI::Internal::Util.blank_string?(work_request_id) path = '/zprConfigurationWorkRequests/{workRequestId}/errors'.sub('{workRequestId}', work_request_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:page] = opts[:page] if opts[:page] query_params[:limit] = opts[:limit] if opts[:limit] 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: 'ZprClient#list_zpr_configuration_work_request_errors') 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::Zpr::Models::WorkRequestErrorCollection' ) end # rubocop:enable Metrics/BlockLength end |
#list_zpr_configuration_work_request_logs(work_request_id, opts = {}) ⇒ Response
Click here to see an example of how to use list_zpr_configuration_work_request_logs API.
Lists the logs for a work request.
Allowed values are: timestamp
651 652 653 654 655 656 657 658 659 660 661 662 663 664 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 |
# File 'lib/oci/zpr/zpr_client.rb', line 651 def list_zpr_configuration_work_request_logs(work_request_id, opts = {}) logger.debug 'Calling operation ZprClient#list_zpr_configuration_work_request_logs.' if logger raise "Missing the required parameter 'work_request_id' when calling list_zpr_configuration_work_request_logs." if work_request_id.nil? if opts[:sort_by] && !%w[timestamp].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of timestamp.' end if opts[:sort_order] && !OCI::Zpr::Models::SORT_ORDER_ENUM.include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of the values in OCI::Zpr::Models::SORT_ORDER_ENUM.' end raise "Parameter value for 'work_request_id' must not be blank" if OCI::Internal::Util.blank_string?(work_request_id) path = '/zprConfigurationWorkRequests/{workRequestId}/logs'.sub('{workRequestId}', work_request_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:page] = opts[:page] if opts[:page] query_params[:limit] = opts[:limit] if opts[:limit] 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: 'ZprClient#list_zpr_configuration_work_request_logs') 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::Zpr::Models::WorkRequestLogEntryCollection' ) end # rubocop:enable Metrics/BlockLength end |
#list_zpr_configuration_work_requests(opts = {}) ⇒ Response
Click here to see an example of how to use list_zpr_configuration_work_requests API.
Lists the work requests in a compartment.
Allowed values are: timeAccepted
737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 |
# File 'lib/oci/zpr/zpr_client.rb', line 737 def list_zpr_configuration_work_requests(opts = {}) logger.debug 'Calling operation ZprClient#list_zpr_configuration_work_requests.' if logger if opts[:status] && !OCI::Zpr::Models::WORK_REQUEST_STATUS_ENUM.include?(opts[:status]) raise 'Invalid value for "status", must be one of the values in OCI::Zpr::Models::WORK_REQUEST_STATUS_ENUM.' end if opts[:sort_order] && !OCI::Zpr::Models::SORT_ORDER_ENUM.include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of the values in OCI::Zpr::Models::SORT_ORDER_ENUM.' end if opts[:sort_by] && !%w[timeAccepted].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of timeAccepted.' end path = '/zprConfigurationWorkRequests' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = opts[:compartment_id] if opts[:compartment_id] query_params[:workRequestId] = opts[:work_request_id] if opts[:work_request_id] query_params[:status] = opts[:status] if opts[:status] query_params[:resourceId] = opts[:resource_id] if opts[:resource_id] query_params[:page] = opts[:page] if opts[:page] query_params[:limit] = opts[:limit] if opts[:limit] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] query_params[:sortBy] = opts[:sort_by] if opts[:sort_by] # 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: 'ZprClient#list_zpr_configuration_work_requests') 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::Zpr::Models::WorkRequestSummaryCollection' ) end # rubocop:enable Metrics/BlockLength end |
#list_zpr_policies(opts = {}) ⇒ Response
Click here to see an example of how to use list_zpr_policies API.
Gets a list of ZprPolicies.
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 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 |
# File 'lib/oci/zpr/zpr_client.rb', line 832 def list_zpr_policies(opts = {}) logger.debug 'Calling operation ZprClient#list_zpr_policies.' if logger if opts[:lifecycle_state] && !OCI::Zpr::Models::ZprPolicy::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state]) raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Zpr::Models::ZprPolicy::LIFECYCLE_STATE_ENUM.' end if opts[:sort_order] && !OCI::Zpr::Models::SORT_ORDER_ENUM.include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of the values in OCI::Zpr::Models::SORT_ORDER_ENUM.' end if opts[:sort_by] && !%w[timeCreated name].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of timeCreated, name.' end path = '/zprPolicies' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = opts[:compartment_id] if opts[:compartment_id] query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state] query_params[:name] = opts[:name] if opts[:name] query_params[:id] = opts[:id] if opts[:id] query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] query_params[:sortBy] = opts[:sort_by] if opts[:sort_by] # 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: 'ZprClient#list_zpr_policies') 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::Zpr::Models::ZprPolicyCollection' ) end # rubocop:enable Metrics/BlockLength end |
#list_zpr_policy_work_request_errors(work_request_id, opts = {}) ⇒ Response
Click here to see an example of how to use list_zpr_policy_work_request_errors API.
Lists the errors for a work request.
Allowed values are: timestamp
921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 |
# File 'lib/oci/zpr/zpr_client.rb', line 921 def list_zpr_policy_work_request_errors(work_request_id, opts = {}) logger.debug 'Calling operation ZprClient#list_zpr_policy_work_request_errors.' if logger raise "Missing the required parameter 'work_request_id' when calling list_zpr_policy_work_request_errors." if work_request_id.nil? if opts[:sort_by] && !%w[timestamp].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of timestamp.' end if opts[:sort_order] && !OCI::Zpr::Models::SORT_ORDER_ENUM.include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of the values in OCI::Zpr::Models::SORT_ORDER_ENUM.' end raise "Parameter value for 'work_request_id' must not be blank" if OCI::Internal::Util.blank_string?(work_request_id) path = '/zprPolicyWorkRequests/{workRequestId}/errors'.sub('{workRequestId}', work_request_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:page] = opts[:page] if opts[:page] query_params[:limit] = opts[:limit] if opts[:limit] 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: 'ZprClient#list_zpr_policy_work_request_errors') 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::Zpr::Models::WorkRequestErrorCollection' ) end # rubocop:enable Metrics/BlockLength end |
#list_zpr_policy_work_request_logs(work_request_id, opts = {}) ⇒ Response
Click here to see an example of how to use list_zpr_policy_work_request_logs API.
Lists the logs for a work request.
Allowed values are: timestamp
1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 |
# File 'lib/oci/zpr/zpr_client.rb', line 1004 def list_zpr_policy_work_request_logs(work_request_id, opts = {}) logger.debug 'Calling operation ZprClient#list_zpr_policy_work_request_logs.' if logger raise "Missing the required parameter 'work_request_id' when calling list_zpr_policy_work_request_logs." if work_request_id.nil? if opts[:sort_by] && !%w[timestamp].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of timestamp.' end if opts[:sort_order] && !OCI::Zpr::Models::SORT_ORDER_ENUM.include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of the values in OCI::Zpr::Models::SORT_ORDER_ENUM.' end raise "Parameter value for 'work_request_id' must not be blank" if OCI::Internal::Util.blank_string?(work_request_id) path = '/zprPolicyWorkRequests/{workRequestId}/logs'.sub('{workRequestId}', work_request_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:page] = opts[:page] if opts[:page] query_params[:limit] = opts[:limit] if opts[:limit] 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: 'ZprClient#list_zpr_policy_work_request_logs') 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::Zpr::Models::WorkRequestLogEntryCollection' ) end # rubocop:enable Metrics/BlockLength end |
#list_zpr_policy_work_requests(opts = {}) ⇒ Response
Click here to see an example of how to use list_zpr_policy_work_requests API.
Lists the work requests in a compartment.
Allowed values are: timeAccepted
1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 |
# File 'lib/oci/zpr/zpr_client.rb', line 1090 def list_zpr_policy_work_requests(opts = {}) logger.debug 'Calling operation ZprClient#list_zpr_policy_work_requests.' if logger if opts[:status] && !OCI::Zpr::Models::WORK_REQUEST_STATUS_ENUM.include?(opts[:status]) raise 'Invalid value for "status", must be one of the values in OCI::Zpr::Models::WORK_REQUEST_STATUS_ENUM.' end if opts[:sort_order] && !OCI::Zpr::Models::SORT_ORDER_ENUM.include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of the values in OCI::Zpr::Models::SORT_ORDER_ENUM.' end if opts[:sort_by] && !%w[timeAccepted].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of timeAccepted.' end path = '/zprPolicyWorkRequests' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = opts[:compartment_id] if opts[:compartment_id] query_params[:workRequestId] = opts[:work_request_id] if opts[:work_request_id] query_params[:status] = opts[:status] if opts[:status] query_params[:resourceId] = opts[:resource_id] if opts[:resource_id] query_params[:page] = opts[:page] if opts[:page] query_params[:limit] = opts[:limit] if opts[:limit] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] query_params[:sortBy] = opts[:sort_by] if opts[:sort_by] # 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: 'ZprClient#list_zpr_policy_work_requests') 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::Zpr::Models::WorkRequestSummaryCollection' ) end # rubocop:enable Metrics/BlockLength end |
#logger ⇒ Logger
Returns The logger for this client. May be nil.
94 95 96 |
# File 'lib/oci/zpr/zpr_client.rb', line 94 def logger @api_client.config.logger end |
#update_zpr_policy(zpr_policy_id, update_zpr_policy_details, opts = {}) ⇒ Response
Click here to see an example of how to use update_zpr_policy API.
Updates a specific ZprPolicy. If updating on statements, the entire list of policy statements is required, which will replace the existing policy statements associated with the policy ID.
1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 |
# File 'lib/oci/zpr/zpr_client.rb', line 1181 def update_zpr_policy(zpr_policy_id, update_zpr_policy_details, opts = {}) logger.debug 'Calling operation ZprClient#update_zpr_policy.' if logger raise "Missing the required parameter 'zpr_policy_id' when calling update_zpr_policy." if zpr_policy_id.nil? raise "Missing the required parameter 'update_zpr_policy_details' when calling update_zpr_policy." if update_zpr_policy_details.nil? raise "Parameter value for 'zpr_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(zpr_policy_id) path = '/zprPolicies/{zprPolicyId}'.sub('{zprPolicyId}', zpr_policy_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-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] 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-dry-run'] = opts[:opc_dry_run] if !opts[:opc_dry_run].nil? # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(update_zpr_policy_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'ZprClient#update_zpr_policy') 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 ) end # rubocop:enable Metrics/BlockLength end |