oracle / oci-cli

Command Line Interface for Oracle Cloud Infrastructure
https://cloud.oracle.com/cloud-infrastructure
Other
447 stars 185 forks source link

Marketplace images #193

Closed Erniemoore closed 5 years ago

Erniemoore commented 5 years ago

Is there a way to pull marketplace image and other data out of OCI

paul-hummel-oracle commented 5 years ago

Hi @Erniemoore , I don't believe there is a way using CLI to pull down the marketplace image. We have "oci compute pic" commands to browse the catalog, etc. Most CLI commands are backed by RESTful APIs -- browsing here and other pages, I don't see anything available. https://docs.cloud.oracle.com/iaas/api/#/en/marketplace/20181001/

mattiarossi commented 4 years ago

A little late to the party, but you can use oci-cli and raw-http requests Here is an example script that fetches a Marketplace image listing and id using the marketplace description and resource version: https://gist.github.com/mattiarossi/a7e5ceff8de0da0a12393a27ffc5c6e8

./getMarketplaceImageId 'FortiGate Next-Gen Firewall (BYOL)' '6.4.0'
{
  "listingId": "ocid1.appcataloglisting.oc1..aaaaaaaam7ewzrjbltqiarxukuk72v2lqkdtpqtwxqpszqqvrm7likfnpt5q",
  "listingResourceId": "ocid1.image.oc1..aaaaaaaaa5u7qtj3j3um4zryg3qkn6if2sqctqjfh46pdq5z56kq6zagg4va",
  "listingResourceVersion": "6.4.0_SR-IOV_Paravirtualized_Mod",
  "timePublished": "2020-04-14T01:05:07.615Z"
}