Class: OCI::Marketplace::MarketplaceClient
- Inherits:
-
Object
- Object
- OCI::Marketplace::MarketplaceClient
- Defined in:
- lib/oci/marketplace/marketplace_client.rb
Overview
Manage applications in Oracle Cloud Infrastructure Marketplace.
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_accepted_agreement(create_accepted_agreement_details, opts = {}) ⇒ Response
Accepts a terms of use agreement for a specific package version of a listing.
-
#delete_accepted_agreement(accepted_agreement_id, opts = {}) ⇒ Response
Removes a previously accepted terms of use agreement from the list of agreements that Marketplace checks before initiating a deployment.
-
#get_accepted_agreement(accepted_agreement_id, opts = {}) ⇒ Response
Gets the details of a specific, previously accepted terms of use agreement.
-
#get_agreement(listing_id, package_version, agreement_id, opts = {}) ⇒ Response
Returns a terms of use agreement for a package with a time-based signature that can be used to accept the agreement.
-
#get_listing(listing_id, opts = {}) ⇒ Response
Gets detailed information about a listing, including the listing's name, version, description, and resources.
-
#get_package(listing_id, package_version, opts = {}) ⇒ Response
Get the details of the specified version of a package, including information needed to launch the package.
-
#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ MarketplaceClient
constructor
Creates a new MarketplaceClient.
-
#list_accepted_agreements(compartment_id, opts = {}) ⇒ Response
Lists the terms of use agreements that have been accepted in the specified compartment.
-
#list_agreements(listing_id, package_version, opts = {}) ⇒ Response
Returns the terms of use agreements that must be accepted before you can deploy the specified version of a package.
-
#list_categories(opts = {}) ⇒ Response
Gets the list of all the categories for listings published to Oracle Cloud Infrastructure Marketplace.
-
#list_listings(opts = {}) ⇒ Response
Gets a list of listings from Oracle Cloud Infrastructure Marketplace by searching keywords and filtering according to listing attributes.
-
#list_packages(listing_id, opts = {}) ⇒ Response
Gets the list of packages for a listing.
-
#list_publishers(opts = {}) ⇒ Response
Gets the list of all the publishers of listings available in Oracle Cloud Infrastructure Marketplace.
-
#list_report_types(compartment_id, opts = {}) ⇒ Response
Lists available types of reports for the compartment.
-
#list_reports(report_type, date, compartment_id, opts = {}) ⇒ Response
Lists reports in the compartment that match the specified report type and date.
-
#logger ⇒ Logger
The logger for this client.
-
#update_accepted_agreement(accepted_agreement_id, update_accepted_agreement_details, opts = {}) ⇒ Response
Updates the display name or tags associated with a listing's previously accepted terms of use agreement.
Constructor Details
#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ MarketplaceClient
Creates a new MarketplaceClient. 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.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/oci/marketplace/marketplace_client.rb', line 53 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) if signer.nil? signer = OCI::Signer.new( config.user, config.fingerprint, config.tenancy, config.key_file, pass_phrase: config.pass_phrase, private_key_content: config.key_content ) end @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings) @retry_config = retry_config if endpoint @endpoint = endpoint + '/20181001' else region ||= config.region region ||= signer.region if signer.respond_to?(:region) self.region = region end logger.info "MarketplaceClient endpoint set to '#{@endpoint}'." if logger end |
Instance Attribute Details
#api_client ⇒ OCI::ApiClient (readonly)
Client used to make HTTP requests.
13 14 15 |
# File 'lib/oci/marketplace/marketplace_client.rb', line 13 def api_client @api_client end |
#endpoint ⇒ String (readonly)
Fully qualified endpoint URL
17 18 19 |
# File 'lib/oci/marketplace/marketplace_client.rb', line 17 def endpoint @endpoint end |
#region ⇒ String
The region, which will usually correspond to a value in Regions::REGION_ENUM.
27 28 29 |
# File 'lib/oci/marketplace/marketplace_client.rb', line 27 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
23 24 25 |
# File 'lib/oci/marketplace/marketplace_client.rb', line 23 def retry_config @retry_config end |
Instance Method Details
#create_accepted_agreement(create_accepted_agreement_details, opts = {}) ⇒ Response
Accepts a terms of use agreement for a specific package version of a listing. You must accept all terms of use for a package before you can deploy the package.
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/marketplace/marketplace_client.rb', line 126 def create_accepted_agreement(create_accepted_agreement_details, opts = {}) logger.debug 'Calling operation MarketplaceClient#create_accepted_agreement.' if logger raise "Missing the required parameter 'create_accepted_agreement_details' when calling create_accepted_agreement." if create_accepted_agreement_details.nil? path = '/acceptedAgreements' 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_accepted_agreement_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'MarketplaceClient#create_accepted_agreement') 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::Marketplace::Models::AcceptedAgreement' ) end # rubocop:enable Metrics/BlockLength end |
#delete_accepted_agreement(accepted_agreement_id, opts = {}) ⇒ Response
Removes a previously accepted terms of use agreement from the list of agreements that Marketplace checks before initiating a deployment. Listings in the Marketplace that require acceptance of the specified terms of use can no longer be deployed, but existing deployments aren't affected.
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 226 227 |
# File 'lib/oci/marketplace/marketplace_client.rb', line 190 def delete_accepted_agreement(accepted_agreement_id, opts = {}) logger.debug 'Calling operation MarketplaceClient#delete_accepted_agreement.' if logger raise "Missing the required parameter 'accepted_agreement_id' when calling delete_accepted_agreement." if accepted_agreement_id.nil? raise "Parameter value for 'accepted_agreement_id' must not be blank" if OCI::Internal::Util.blank_string?(accepted_agreement_id) path = '/acceptedAgreements/{acceptedAgreementId}'.sub('{acceptedAgreementId}', accepted_agreement_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:signature] = opts[:signature] if opts[:signature] # 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[:'if-match'] = opts[:if_match] if opts[:if_match] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'MarketplaceClient#delete_accepted_agreement') 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_accepted_agreement(accepted_agreement_id, opts = {}) ⇒ Response
Gets the details of a specific, previously accepted terms of use agreement.
247 248 249 250 251 252 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 |
# File 'lib/oci/marketplace/marketplace_client.rb', line 247 def get_accepted_agreement(accepted_agreement_id, opts = {}) logger.debug 'Calling operation MarketplaceClient#get_accepted_agreement.' if logger raise "Missing the required parameter 'accepted_agreement_id' when calling get_accepted_agreement." if accepted_agreement_id.nil? raise "Parameter value for 'accepted_agreement_id' must not be blank" if OCI::Internal::Util.blank_string?(accepted_agreement_id) path = '/acceptedAgreements/{acceptedAgreementId}'.sub('{acceptedAgreementId}', accepted_agreement_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: 'MarketplaceClient#get_accepted_agreement') 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::Marketplace::Models::AcceptedAgreement' ) end # rubocop:enable Metrics/BlockLength end |
#get_agreement(listing_id, package_version, agreement_id, opts = {}) ⇒ Response
Returns a terms of use agreement for a package with a time-based signature that can be used to accept the agreement.
307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 |
# File 'lib/oci/marketplace/marketplace_client.rb', line 307 def get_agreement(listing_id, package_version, agreement_id, opts = {}) logger.debug 'Calling operation MarketplaceClient#get_agreement.' if logger raise "Missing the required parameter 'listing_id' when calling get_agreement." if listing_id.nil? raise "Missing the required parameter 'package_version' when calling get_agreement." if package_version.nil? raise "Missing the required parameter 'agreement_id' when calling get_agreement." if agreement_id.nil? raise "Parameter value for 'listing_id' must not be blank" if OCI::Internal::Util.blank_string?(listing_id) raise "Parameter value for 'package_version' must not be blank" if OCI::Internal::Util.blank_string?(package_version) raise "Parameter value for 'agreement_id' must not be blank" if OCI::Internal::Util.blank_string?(agreement_id) path = '/listings/{listingId}/packages/{packageVersion}/agreements/{agreementId}'.sub('{listingId}', listing_id.to_s).sub('{packageVersion}', package_version.to_s).sub('{agreementId}', agreement_id.to_s) 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: 'MarketplaceClient#get_agreement') 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::Marketplace::Models::Agreement' ) end # rubocop:enable Metrics/BlockLength end |
#get_listing(listing_id, opts = {}) ⇒ Response
Gets detailed information about a listing, including the listing's name, version, description, and resources.
If you plan to launch an instance from an image listing, you must first subscribe to the listing. When you launch the instance, you also need to provide the image ID of the listing resource version that you want.
Subscribing to the listing requires you to first get a signature from the terms of use agreement for the listing resource version. To get the signature, issue a GetAppCatalogListingAgreements API call. The AppCatalogListingResourceVersionAgreements object, including its signature, is returned in the response. With the signature for the terms of use agreement for the desired listing resource version, create a subscription by issuing a CreateAppCatalogSubscription API call.
To get the image ID to launch an instance, issue a GetAppCatalogListingResourceVersion API call. Lastly, to launch the instance, use the image ID of the listing resource version to issue a LaunchInstance API call.
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 418 419 420 |
# File 'lib/oci/marketplace/marketplace_client.rb', line 383 def get_listing(listing_id, opts = {}) logger.debug 'Calling operation MarketplaceClient#get_listing.' if logger raise "Missing the required parameter 'listing_id' when calling get_listing." if listing_id.nil? raise "Parameter value for 'listing_id' must not be blank" if OCI::Internal::Util.blank_string?(listing_id) path = '/listings/{listingId}'.sub('{listingId}', listing_id.to_s) 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: 'MarketplaceClient#get_listing') 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::Marketplace::Models::Listing' ) end # rubocop:enable Metrics/BlockLength end |
#get_package(listing_id, package_version, opts = {}) ⇒ Response
Get the details of the specified version of a package, including information needed to launch the package.
If you plan to launch an instance from an image listing, you must first subscribe to the listing. When you launch the instance, you also need to provide the image ID of the listing resource version that you want.
Subscribing to the listing requires you to first get a signature from the terms of use agreement for the listing resource version. To get the signature, issue a GetAppCatalogListingAgreements API call. The AppCatalogListingResourceVersionAgreements object, including its signature, is returned in the response. With the signature for the terms of use agreement for the desired listing resource version, create a subscription by issuing a CreateAppCatalogSubscription API call.
To get the image ID to launch an instance, issue a GetAppCatalogListingResourceVersion API call. Lastly, to launch the instance, use the image ID of the listing resource version to issue a LaunchInstance API call.
455 456 457 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/marketplace/marketplace_client.rb', line 455 def get_package(listing_id, package_version, opts = {}) logger.debug 'Calling operation MarketplaceClient#get_package.' if logger raise "Missing the required parameter 'listing_id' when calling get_package." if listing_id.nil? raise "Missing the required parameter 'package_version' when calling get_package." if package_version.nil? raise "Parameter value for 'listing_id' must not be blank" if OCI::Internal::Util.blank_string?(listing_id) raise "Parameter value for 'package_version' must not be blank" if OCI::Internal::Util.blank_string?(package_version) path = '/listings/{listingId}/packages/{packageVersion}'.sub('{listingId}', listing_id.to_s).sub('{packageVersion}', package_version.to_s) 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: 'MarketplaceClient#get_package') 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::Marketplace::Models::ListingPackage' ) end # rubocop:enable Metrics/BlockLength end |
#list_accepted_agreements(compartment_id, opts = {}) ⇒ Response
Lists the terms of use agreements that have been accepted in the specified compartment. You can filter results by specifying query parameters.
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 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 |
# File 'lib/oci/marketplace/marketplace_client.rb', line 529 def list_accepted_agreements(compartment_id, opts = {}) logger.debug 'Calling operation MarketplaceClient#list_accepted_agreements.' if logger raise "Missing the required parameter 'compartment_id' when calling list_accepted_agreements." if compartment_id.nil? if opts[:sort_by] && !%w[TIMEACCEPTED].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of TIMEACCEPTED.' 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 path = '/acceptedAgreements' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:displayName] = opts[:display_name] if opts[:display_name] query_params[:listingId] = opts[:listing_id] if opts[:listing_id] query_params[:packageVersion] = opts[:package_version] if opts[:package_version] query_params[:acceptedAgreementId] = opts[:accepted_agreement_id] if opts[:accepted_agreement_id] query_params[:sortBy] = opts[:sort_by] if opts[:sort_by] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-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: 'MarketplaceClient#list_accepted_agreements') 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::Marketplace::Models::AcceptedAgreementSummary>' ) end # rubocop:enable Metrics/BlockLength end |
#list_agreements(listing_id, package_version, opts = {}) ⇒ Response
Returns the terms of use agreements that must be accepted before you can deploy the specified version of a package.
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 636 637 638 639 640 641 642 643 644 645 646 647 |
# File 'lib/oci/marketplace/marketplace_client.rb', line 606 def list_agreements(listing_id, package_version, opts = {}) logger.debug 'Calling operation MarketplaceClient#list_agreements.' if logger raise "Missing the required parameter 'listing_id' when calling list_agreements." if listing_id.nil? raise "Missing the required parameter 'package_version' when calling list_agreements." if package_version.nil? raise "Parameter value for 'listing_id' must not be blank" if OCI::Internal::Util.blank_string?(listing_id) raise "Parameter value for 'package_version' must not be blank" if OCI::Internal::Util.blank_string?(package_version) path = '/listings/{listingId}/packages/{packageVersion}/agreements'.sub('{listingId}', listing_id.to_s).sub('{packageVersion}', package_version.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[: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: 'MarketplaceClient#list_agreements') 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::Marketplace::Models::AgreementSummary>' ) end # rubocop:enable Metrics/BlockLength end |
#list_categories(opts = {}) ⇒ Response
Gets the list of all the categories for listings published to Oracle Cloud Infrastructure Marketplace. Categories apply to the software product provided by the listing.
671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 |
# File 'lib/oci/marketplace/marketplace_client.rb', line 671 def list_categories(opts = {}) logger.debug 'Calling operation MarketplaceClient#list_categories.' if logger path = '/categories' 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[: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: 'MarketplaceClient#list_categories') 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::Marketplace::Models::CategorySummary>' ) end # rubocop:enable Metrics/BlockLength end |
#list_listings(opts = {}) ⇒ Response
Gets a list of listings from Oracle Cloud Infrastructure Marketplace by searching keywords and filtering according to listing attributes.
If you plan to launch an instance from an image listing, you must first subscribe to the listing. When you launch the instance, you also need to provide the image ID of the listing resource version that you want.
Subscribing to the listing requires you to first get a signature from the terms of use agreement for the listing resource version. To get the signature, issue a GetAppCatalogListingAgreements API call. The AppCatalogListingResourceVersionAgreements object, including its signature, is returned in the response. With the signature for the terms of use agreement for the desired listing resource version, create a subscription by issuing a CreateAppCatalogSubscription API call.
To get the image ID to launch an instance, issue a GetAppCatalogListingResourceVersion API call. Lastly, to launch the instance, use the image ID of the listing resource version to issue a LaunchInstance API call.
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 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 |
# File 'lib/oci/marketplace/marketplace_client.rb', line 766 def list_listings(opts = {}) logger.debug 'Calling operation MarketplaceClient#list_listings.' if logger if opts[:sort_by] && !%w[TIMERELEASED].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of TIMERELEASED.' 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 pricing_allowable_values = %w[FREE BYOL PAYGO] if opts[:pricing] && !opts[:pricing].empty? opts[:pricing].each do |val_to_check| unless pricing_allowable_values.include?(val_to_check) raise 'Invalid value for "pricing", must be one of FREE, BYOL, PAYGO.' end end end path = '/listings' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:name] = OCI::ApiClient.build_collection_params(opts[:name], :multi) if opts[:name] && !opts[:name].empty? query_params[:listingId] = opts[:listing_id] if opts[:listing_id] query_params[:publisherId] = opts[:publisher_id] if opts[:publisher_id] query_params[:packageType] = opts[:package_type] if opts[:package_type] 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[:category] = OCI::ApiClient.build_collection_params(opts[:category], :multi) if opts[:category] && !opts[:category].empty? query_params[:pricing] = OCI::ApiClient.build_collection_params(opts[:pricing], :multi) if opts[:pricing] && !opts[:pricing].empty? query_params[:isFeatured] = opts[:is_featured] if !opts[:is_featured].nil? 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: 'MarketplaceClient#list_listings') 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::Marketplace::Models::ListingSummary>' ) end # rubocop:enable Metrics/BlockLength end |
#list_packages(listing_id, opts = {}) ⇒ Response
Gets the list of packages for a listing.
If you plan to launch an instance from an image listing, you must first subscribe to the listing. When you launch the instance, you also need to provide the image ID of the listing resource version that you want.
Subscribing to the listing requires you to first get a signature from the terms of use agreement for the listing resource version. To get the signature, issue a GetAppCatalogListingAgreements API call. The AppCatalogListingResourceVersionAgreements object, including its signature, is returned in the response. With the signature for the terms of use agreement for the desired listing resource version, create a subscription by issuing a CreateAppCatalogSubscription API call.
To get the image ID to launch an instance, issue a GetAppCatalogListingResourceVersion API call. Lastly, to launch the instance, use the image ID of the listing resource version to issue a LaunchInstance API call.
877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 |
# File 'lib/oci/marketplace/marketplace_client.rb', line 877 def list_packages(listing_id, opts = {}) logger.debug 'Calling operation MarketplaceClient#list_packages.' if logger raise "Missing the required parameter 'listing_id' when calling list_packages." if listing_id.nil? if opts[:sort_by] && !%w[TIMERELEASED].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of TIMERELEASED.' 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 'listing_id' must not be blank" if OCI::Internal::Util.blank_string?(listing_id) path = '/listings/{listingId}/packages'.sub('{listingId}', listing_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:packageVersion] = opts[:package_version] if opts[:package_version] query_params[:packageType] = opts[:package_type] if opts[:package_type] 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[: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: 'MarketplaceClient#list_packages') 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::Marketplace::Models::ListingPackageSummary>' ) end # rubocop:enable Metrics/BlockLength end |
#list_publishers(opts = {}) ⇒ Response
Gets the list of all the publishers of listings available in Oracle Cloud Infrastructure Marketplace.
952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 |
# File 'lib/oci/marketplace/marketplace_client.rb', line 952 def list_publishers(opts = {}) logger.debug 'Calling operation MarketplaceClient#list_publishers.' if logger path = '/publishers' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:publisherId] = opts[:publisher_id] if opts[:publisher_id] query_params[:limit] = opts[:limit] if opts[:limit] query_params[:page] = opts[:page] if opts[:page] 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: 'MarketplaceClient#list_publishers') 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::Marketplace::Models::PublisherSummary>' ) end # rubocop:enable Metrics/BlockLength end |
#list_report_types(compartment_id, opts = {}) ⇒ Response
Lists available types of reports for the compartment.
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 |
# File 'lib/oci/marketplace/marketplace_client.rb', line 1010 def list_report_types(compartment_id, opts = {}) logger.debug 'Calling operation MarketplaceClient#list_report_types.' if logger raise "Missing the required parameter 'compartment_id' when calling list_report_types." if compartment_id.nil? path = '/reportTypes' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:compartmentId] = compartment_id query_params[:page] = opts[:page] if opts[:page] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-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: 'MarketplaceClient#list_report_types') 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::Marketplace::Models::ReportTypeCollection' ) end # rubocop:enable Metrics/BlockLength end |
#list_reports(report_type, date, compartment_id, opts = {}) ⇒ Response
Lists reports in the compartment that match the specified report type and date.
1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 |
# File 'lib/oci/marketplace/marketplace_client.rb', line 1069 def list_reports(report_type, date, compartment_id, opts = {}) logger.debug 'Calling operation MarketplaceClient#list_reports.' if logger raise "Missing the required parameter 'report_type' when calling list_reports." if report_type.nil? raise "Missing the required parameter 'date' when calling list_reports." if date.nil? raise "Missing the required parameter 'compartment_id' when calling list_reports." if compartment_id.nil? path = '/reports' operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:reportType] = report_type query_params[:date] = date query_params[:compartmentId] = compartment_id query_params[:page] = opts[:page] if opts[:page] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-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: 'MarketplaceClient#list_reports') 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::Marketplace::Models::ReportCollection' ) end # rubocop:enable Metrics/BlockLength end |
#logger ⇒ Logger
Returns The logger for this client. May be nil.
101 102 103 |
# File 'lib/oci/marketplace/marketplace_client.rb', line 101 def logger @api_client.config.logger end |
#update_accepted_agreement(accepted_agreement_id, update_accepted_agreement_details, opts = {}) ⇒ Response
Updates the display name or tags associated with a listing's previously accepted terms of use agreement.
1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 |
# File 'lib/oci/marketplace/marketplace_client.rb', line 1140 def update_accepted_agreement(accepted_agreement_id, update_accepted_agreement_details, opts = {}) logger.debug 'Calling operation MarketplaceClient#update_accepted_agreement.' if logger raise "Missing the required parameter 'accepted_agreement_id' when calling update_accepted_agreement." if accepted_agreement_id.nil? raise "Missing the required parameter 'update_accepted_agreement_details' when calling update_accepted_agreement." if update_accepted_agreement_details.nil? raise "Parameter value for 'accepted_agreement_id' must not be blank" if OCI::Internal::Util.blank_string?(accepted_agreement_id) path = '/acceptedAgreements/{acceptedAgreementId}'.sub('{acceptedAgreementId}', accepted_agreement_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] 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] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(update_accepted_agreement_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'MarketplaceClient#update_accepted_agreement') 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::Marketplace::Models::AcceptedAgreement' ) end # rubocop:enable Metrics/BlockLength end |