X

The latest cloud infrastructure announcements, technical solutions, and enterprise cloud insights.

Explore Marketplace listings using Oracle Cloud Shell

Arun Poonia
Senior Solutions Architect

Oracle Cloud Shell now enables customers to view Oracle Cloud Marketplace listings present on Oracle Cloud Infrastructure (OCI). As you start automating more of your use cases, you can use Cloud Shell to find listing IDs and different versions associated with them. This blog teaches you how.

Prerequisites

  • An Oracle Cloud account. If you don’t have an account, you can sign up for an Oracle Cloud Free Tier account.

  • If you want to manage your listings, an Oracle Cloud Marketplace account. If you don’t have an account, you can follow the instructions on Oracle Cloud Marketplace Publisher Account. You don’t need a publisher account to view the Marketplace listings from OCI Cloud Shell. 

Follow this document to know more about Marketplace and the required steps to publish your listings.

Marketplace listings

You can access cloud shell using OCI console following the instructions on Cloud Shell Access Information. The listings are exposed to OCI in the following ways:

  • Compute image listing: Partners Compute images listings published on Oracle Cloud Marketplace

  • Stack listing: Partners Terraform code stack listings published on Oracle Cloud Marketplace

Publisher listing

You can find publishers and their listings using OCI CLI Marketplace subcommands from Cloud Shell with the following command:

cloudshell:~ (us-ashburn-1)$ oci marketplace publisher list --all | less 
cloudshell:~ (us-ashburn-1)$ oci marketplace listing list --publisher-id <publisher_id>

Use the list and get subcommands to get particular listing values, which can be either a Compute image or stack listing.

cloudshell:~ (us-ashburn-1)$ oci marketplace package list --listing-id <listing_id>
cloudshell:~ (us-ashburn-1)$ oci marketplace package get --listing-id <listing_id> --package-version <version_name>

Compute image listing 

If you’re curious, you can find all available listings using Oracle Cloud Infrastructure CLI PIC subcommands. Use the --help flag to know more.

cloudshell:~ (us-ashburn-1)$ oci compute pic listing list --all

You can also use the listing Display Name to query particular listings and get the details of the ListingID. The following example shows you how to get particular partner listing ID:

cloudshell:~ (us-ashburn-1)$ oci compute pic listing list --display-name "CloudGuard Security Management - BYOL"
{
  "data": [
    {
      "display-name": "CloudGuard Security Management - BYOL",
      "listing-id": "ocid1.appcataloglisting.oc1..XXXXXXXXXXXXX",
      "publisher-name": "Check Point.",
      "summary": "Single pane-of-glass security management platform for Check Point products"
    }
  ]
}
cloudshell:~ (us-ashburn-1)$

You can get listing versions using the following command. Ensure that you pass the correct Listing ID.

cloudshell:~ (us-ashburn-1)$ oci compute pic version list --listing-id <listing_id>

You can also use the following shell script to see the required values. The only mandatory parameter is the Display Name of your listing.

#!/bin/bash

image_name="$1"

if [ -z "$image_name" ] 
then
  echo "Error: missing variable definitions"
  exit 1
fi

pic_listing=$(oci compute pic listing list \
--all \
--query ’data[?contains("display-name", `’"${image_name}"’`)].join(’"’"’ ’"’"’, ["listing-id", "display-name"]) | join(`\n`, @)’ \
--raw-output) ; read ocid_listing display_name <<< "${pic_listing}"
echo "PIC Listing:  " ${pic_listing}
echo "OCID Listing: " ${ocid_listing}
echo "Display Name: " ${display_name}

Here’s an example of how to use the script:

cloudshell:~ (us-ashburn-1)$ ./find_listing.sh "Oracle Cloud Developer Image"
PIC Listing:   ocid1.appcataloglisting.oc1..XXXXXXXXXXX Oracle Cloud Developer Image
OCID Listing:  ocid1.appcataloglisting.oc1..XXXXXXXXXXX
Display Name:  Oracle Cloud Developer Image
cloudshell:~ (us-ashburn-1)$

Stack listing

When you know a particular publisher listing from Cloud Shell, you can grab the listing ID and use that value to see the stack listing and associated versions:

cloudshell:~ (us-ashburn-1)$ oci marketplace package list --listing-id <listing_id>
cloudshell:~ (us-ashburn-1)$ oci marketplace package get --listing-id <listing_id> --package-version <version_string>

Conclusion

This post explained how to use Oracle Cloud Shell to provide listing IDs, OCID listings, and version details. These details can benefit your automation efforts.

Follow these resources to know more about Oracle Cloud Shell, Oracle Cloud Marketplace, and more:

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha