Oracle Cloud partners publish their solutions on Oracle Cloud Marketplace which end customers can use from Cloud Shell, the Oracle Cloud Infrastructure (OCI) Console, or through APIs for application integration. Partner solutions also integrate with Marketplace listings within their native or software-as-a-service (SaaS) offerings. In this blog, I cover how you can deploy an instance using Marketplace listings with the OCI Python software developer kit (SDK) library, which gives you an idea how to use listing within your products depending on your use case.
Prerequisites
-
An OCI account. If you don’t have an account, you can sign up for an Oracle Cloud Free Tier account.
-
Follow the OCI Python SDK Library instructions to install and set up your development environment.
Marketplace listings
Deployed listings are exposed to OCI in the following options:
-
Compute image listing: Partners’ Compute image listings published on Oracle Cloud Marketplace
-
Stack listing: Partners’ Terraform code stack listings published on Oracle Cloud Marketplace, which uses partners’ Compute images in a public or private listing.
You can follow this document to know more about Oracle Cloud Marketplace docs and required steps to publish your listings. Each partner is considered a publisher on OCI Marketplace. You can find publishers and their listings using the following OCI CLI Marketplace subcommands from Cloud Shell:
cloudshell:~ (us-ashburn-1)$ oci marketplace publisher list --all | less
cloudshell:~ (us-ashburn-1)$ oci marketplace listing list --publisher-id <publisher_id>
You can use the list and get subcommands to get a particular listing value, which can be a Compute image or stack listing.
cloudshell:~ (us-ashburn-1)$ oci marketplace package list --listing-id
cloudshell:~ (us-ashburn-1)$ oci marketplace package get --listing-id
--package-version
You can also use OCI Python SDK’s Marketplace Client class to get publishers and their listings. To learn more about how to retrieve particular image or stack listing details, see Explore Marketplace listings using Oracle Cloud Shell.
Instance deployment using Marketplace listings
Use the following steps to deploy an instance using the OCI Python SDK:
-
Write the Python code to support necessary networking components to create an instance within your compartment’s virtual cloud network (VCN), subnet, or network security group.
-
Update the Python code to include the necessary steps to subscribe to the Marketplace listing.
-
Update the Python code to use that listing’s custom image OCID within your compartment.
You can follow the official sample code example on GitHub.
Subscribe to the Marketplace listing
Refer to the following code snippet as a reference point to update or write your Python program to support instance deployment:

You can also refer to the program written to support this use case.
Deploy the Compute image listing instance
The following snippet shows an example of running the Python program to deploy an instance using the Puppet listing:
cloudshell:~ (us-ashburn-1)$ python blog.py "Puppet Enterprise (BYOL)" "puppet-host" "compartment_ocid" "AD_Value" "NEW_VCN_CIDR" "public_key_file_path"

Conclusion
This post explained how to use Oracle Cloud Infrastructure Python SDK library to deploy an instance using Marketplace listings and the subscribe to the listing before you use it. These offerings can benefit your SaaS or cloud products efforts.
To know more about Oracle Cloud Shell, Oracle Cloud Marketplace, and more, see the following resources:
