Understanding the Tenancy

On Private Cloud Appliance, a tenancy is a special compartment. The tenancy is the root compartment where you create and administer all resources, including other compartments.

Users, groups, and identity providers are always attached directly to the tenancy, not to any child compartment of the tenancy. You cannot specify a different compartment when you create a user, group, or identity provider. When you use the OCI CLI to operate on a user, group, or identity provider, the OCID of the tenancy from the config file is used by default.

Other resources can reside in the tenancy or in any other compartment. Operating on these resources requires you to select the correct compartment in the Compute Web UI or specify the compartment OCID in the OCI CLI or API. Operating on these resources also requires also you to have the required authorization to those resources in that compartment. Check the policy statements of the groups where you are a member to see whether you have the authorizations that you require.

Use the following procedures to get the OCID of the tenancy.

    1. In the Compute Web UI, select your user profile menu in the upper right of the page.

    2. Select the Tenancy option.

    3. On the tenancy details page, copy the tenancy OCID.

  • Use the oci iam compartment list command.

    oci iam compartment list [OPTIONS]

    Look for the ocid1.tenancy.unique_ID OCID.

    • With no options, the compartment list command lists all compartments that are direct child compartments of the tenancy. The tenancy is the value of the first property listed (compartment-id) for every compartment in the list.

    • If you specify the --include-root option, the tenancy is listed first, and the tenancy OCID is the value of the id property (the value of the compartment-id property is null).

    As is true for other resources, in a compartment list or get, the compartment-id compartment is the parent compartment of the id compartment.

    For a complete list of CLI commands, flags, and options, see the Command Line Reference.

  • Use the ListCompartments operation.

    For information about using the API and signing requests, see REST APIs and Security Credentials. For information about SDKs, see Software Development Kits and Command Line Interface.