DEV Community

Faris Durrani
Faris Durrani

Posted on

How to list all OCI resources in a Tenancy or Compartment

We walk through how to use list all Oracle Cloud resources in a single tenancy or compartment.

Using the CLI: Tenancy Resources

oci search resource structured-search --query-text 'query all resources'
Enter fullscreen mode Exit fullscreen mode

Using the CLI: Compartment Resources

oci search resource structured-search --query-text 'query all resources where compartmentId = "ocid1.compartment.oc1..aaaaaaaanw5m"'
Enter fullscreen mode Exit fullscreen mode

Screenshot of terminal getting compartment resources

Using the Console

Alternatively, you can use OCI Search feature on the console. See: Querying Resources, Services, Documentation, and Marketplace. From the OCI console, go to Advanced Search > Query for everything.

You can also use the Tenancy Explorer feature in the Console to see all work requests of all resources in the tenancy.

Safe harbor statement

The information provided on this channel/article/story is solely intended for informational purposes and cannot be used as a part of any contractual agreement. The content does not guarantee the delivery of any material, code, or functionality, and should not be the sole basis for making purchasing decisions. The postings on this site are my own and do not necessarily reflect the views or work of Oracle or Mythics, LLC.

This work is licensed under a Creative Commons Attribution 4.0 International License.

Top comments (0)