Skip to content

Instantly share code, notes, and snippets.

@mattiarossi
Created May 18, 2020 20:46
Show Gist options
  • Select an option

  • Save mattiarossi/a7e5ceff8de0da0a12393a27ffc5c6e8 to your computer and use it in GitHub Desktop.

Select an option

Save mattiarossi/a7e5ceff8de0da0a12393a27ffc5c6e8 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))'
@GoochD4
Copy link
Copy Markdown

GoochD4 commented Jan 26, 2023

Hey, thanks for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment