2

I need to fetch all the instances (authorized) in the tenancy. In Oracle Cloud documentation, I have seen fetching the instances by compartment ID(ListInstances API). So in order to fetch all instances, I need all the compartments.

Any inputs? Or Is there a way of fetching all instances irrespective of compartments?

karthik_varma_k
  • 353
  • 4
  • 26

1 Answers1

4

You want ListCompartments, under the IAM section of the docs, here https://docs.cloud.oracle.com/iaas/api/#/en/identity/20160918/Compartment/ListCompartments

You need to give it the parent compartment, which would be the root compartment for the first-level compartments.

  • 3
    Just to add -- the root-level compartment is the tenancy itself. So root-level compartment ocid is the tenancy ocid – Joe Apr 17 '19 at 19:33