Skip to content

Instantly share code, notes, and snippets.

@GoochD4
Forked from mattiarossi/getMarketplaceImageId
Created January 26, 2023 21:19
Show Gist options
  • Select an option

  • Save GoochD4/ba78d906a7b192fd9d4a7ba7bc57c231 to your computer and use it in GitHub Desktop.

Select an option

Save GoochD4/ba78d906a7b192fd9d4a7ba7bc57c231 to your computer and use it in GitHub Desktop.
Fetches an OCI Marketplace listing resource id
#!/bin/bash
#FortiGate Next-Gen Firewall (BYOL)
export STERM="$1"
#6.4.0
export SVERSION="$2"
export REGION="uk-london-1"
export LID=`oci raw-request --target-uri https://iaas.$REGION.oraclecloud.com/20160918/appCatalogListings --http-method GET | jq --arg STERM "$STERM" '.data[] | select ( .displayName | contains($STERM))' | jq -r '.listingId'`
oci raw-request --http-method GET --target-uri https://iaas.$REGION.oraclecloud.com/20160918/appCatalogListings/$LID/resourceVersions | jq --arg SVERSION "$SVERSION" '.data[] | select ( .listingResourceVersion | contains($SVERSION))'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment