I am trying to get the list of all compartments (including child compartments) in OCI Tenancy using Python SDK.
But the below OCI API does not give the root compartment details.
Is there a way to get root compartment details via any API directly?
Below is my code:
import oci
from oci.config import from_file
from oci.signer import Signer
config = from_file()
COMPARTMENT_ID="ocid1.tenancy.oc1..a"
identity_client = oci.identity.IdentityClient(config)
list_compartments_response = identity_client.list_compartments(
compartment_id=COMPARTMENT_ID,
compartment_id_in_subtree=True)
compartmentlist = list_compartments_response.data
compartmentlist dict does not contain the root compartment details.
Please help.
Edit 1:
COMPARTMENT_ID given above in the code is the root compartment ID. I need the details of even this root compartment in the final response of API.