import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * This data source provides the list of Compartments in Oracle Cloud Infrastructure Identity service. * * Lists the compartments in a specified compartment. The members of the list * returned depends on the values set for several parameters. * * With the exception of the tenancy (root compartment), the ListCompartments operation * returns only the first-level child compartments in the parent compartment specified in * `compartmentId`. The list does not include any subcompartments of the child * compartments (grandchildren). * * The parameter `accessLevel` specifies whether to return only those compartments for which the * requestor has INSPECT permissions on at least one resource directly * or indirectly (the resource can be in a subcompartment). * * The parameter `compartmentIdInSubtree` applies only when you perform ListCompartments on the * tenancy (root compartment). When set to true, the entire hierarchy of compartments can be returned. * To get a full list of all compartments and subcompartments in the tenancy (root compartment), * set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ANY. * * See [Where to Get the Tenancy's OCID and User's OCID](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/apisigningkey.htm#five). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as oci from "@pulumi/oci"; * * const testCompartments = oci.identity.getCompartments({ * compartmentId: compartmentId, * accessLevel: compartmentAccessLevel, * compartmentIdInSubtree: compartmentCompartmentIdInSubtree === "true", * name: compartmentName, * state: compartmentState, * }); * ``` */ export declare function getCompartments(args: GetCompartmentsArgs, opts?: pulumi.InvokeOptions): Promise; /** * A collection of arguments for invoking getCompartments. */ export interface GetCompartmentsArgs { /** * Valid values are `ANY` and `ACCESSIBLE`. Default is `ANY`. Setting this to `ACCESSIBLE` returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). For the compartments on which the user indirectly has INSPECT permissions, a restricted set of fields is returned. * * When set to `ANY` permissions are not checked. */ accessLevel?: string; /** * The OCID of the compartment (remember that the tenancy is simply the root compartment). */ compartmentId: string; /** * Default is false. Can only be set to true when performing ListCompartments on the tenancy (root compartment). When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned depending on the the setting of `accessLevel`. */ compartmentIdInSubtree?: boolean; filters?: inputs.Identity.GetCompartmentsFilter[]; /** * A filter to only return resources that match the given name exactly. */ name?: string; /** * A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. */ state?: string; } /** * A collection of values returned by getCompartments. */ export interface GetCompartmentsResult { readonly accessLevel?: string; /** * The OCID of the parent compartment containing the compartment. */ readonly compartmentId: string; readonly compartmentIdInSubtree?: boolean; /** * The list of compartments. */ readonly compartments: outputs.Identity.GetCompartmentsCompartment[]; readonly filters?: outputs.Identity.GetCompartmentsFilter[]; /** * The provider-assigned unique ID for this managed resource. */ readonly id: string; /** * The name you assign to the compartment during creation. The name must be unique across all compartments in the parent. Avoid entering confidential information. */ readonly name?: string; /** * The compartment's current state. */ readonly state?: string; } /** * This data source provides the list of Compartments in Oracle Cloud Infrastructure Identity service. * * Lists the compartments in a specified compartment. The members of the list * returned depends on the values set for several parameters. * * With the exception of the tenancy (root compartment), the ListCompartments operation * returns only the first-level child compartments in the parent compartment specified in * `compartmentId`. The list does not include any subcompartments of the child * compartments (grandchildren). * * The parameter `accessLevel` specifies whether to return only those compartments for which the * requestor has INSPECT permissions on at least one resource directly * or indirectly (the resource can be in a subcompartment). * * The parameter `compartmentIdInSubtree` applies only when you perform ListCompartments on the * tenancy (root compartment). When set to true, the entire hierarchy of compartments can be returned. * To get a full list of all compartments and subcompartments in the tenancy (root compartment), * set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ANY. * * See [Where to Get the Tenancy's OCID and User's OCID](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/apisigningkey.htm#five). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as oci from "@pulumi/oci"; * * const testCompartments = oci.identity.getCompartments({ * compartmentId: compartmentId, * accessLevel: compartmentAccessLevel, * compartmentIdInSubtree: compartmentCompartmentIdInSubtree === "true", * name: compartmentName, * state: compartmentState, * }); * ``` */ export declare function getCompartmentsOutput(args: GetCompartmentsOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output; /** * A collection of arguments for invoking getCompartments. */ export interface GetCompartmentsOutputArgs { /** * Valid values are `ANY` and `ACCESSIBLE`. Default is `ANY`. Setting this to `ACCESSIBLE` returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). For the compartments on which the user indirectly has INSPECT permissions, a restricted set of fields is returned. * * When set to `ANY` permissions are not checked. */ accessLevel?: pulumi.Input; /** * The OCID of the compartment (remember that the tenancy is simply the root compartment). */ compartmentId: pulumi.Input; /** * Default is false. Can only be set to true when performing ListCompartments on the tenancy (root compartment). When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned depending on the the setting of `accessLevel`. */ compartmentIdInSubtree?: pulumi.Input; filters?: pulumi.Input[] | undefined>; /** * A filter to only return resources that match the given name exactly. */ name?: pulumi.Input; /** * A filter to only return resources that match the given lifecycle state. The state value is case-insensitive. */ state?: pulumi.Input; } //# sourceMappingURL=getCompartments.d.ts.map