Show / Hide Table of Contents

Class ListCompartmentsRequest

Inheritance
object
ListCompartmentsRequest
Implements
IOciRequest
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Oci.IdentityService.Requests
Assembly: OCI.DotNetSDK.Identity.dll
Syntax
public class ListCompartmentsRequest : IOciRequest
Examples

Click here to see an example of how to use ListCompartments request.

Properties

AccessLevel

Declaration
[HttpConverter(TargetEnum.Query, "accessLevel")]
public ListCompartmentsRequest.AccessLevelEnum? AccessLevel { get; set; }
Property Value
Type Description
ListCompartmentsRequest.AccessLevelEnum?

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.

CompartmentId

Declaration
[Required(ErrorMessage = "CompartmentId is required.")]
[HttpConverter(TargetEnum.Query, "compartmentId")]
public string CompartmentId { get; set; }
Property Value
Type Description
string

The OCID of the compartment (remember that the tenancy is simply the root compartment).

Remarks

Required

CompartmentIdInSubtree

Declaration
[HttpConverter(TargetEnum.Query, "compartmentIdInSubtree")]
public bool? CompartmentIdInSubtree { get; set; }
Property Value
Type Description
bool?

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.

LifecycleState

Declaration
[HttpConverter(TargetEnum.Query, "lifecycleState")]
public Compartment.LifecycleStateEnum? LifecycleState { get; set; }
Property Value
Type Description
Compartment.LifecycleStateEnum?

A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.

Limit

Declaration
[HttpConverter(TargetEnum.Query, "limit")]
public int? Limit { get; set; }
Property Value
Type Description
int?

The maximum number of items to return in a paginated "List" call.

Name

Declaration
[HttpConverter(TargetEnum.Query, "name")]
public string Name { get; set; }
Property Value
Type Description
string

A filter to only return resources that match the given name exactly.

Page

Declaration
[HttpConverter(TargetEnum.Query, "page")]
public string Page { get; set; }
Property Value
Type Description
string

The value of the opc-next-page response header from the previous "List" call.

SortBy

Declaration
[HttpConverter(TargetEnum.Query, "sortBy")]
public ListCompartmentsRequest.SortByEnum? SortBy { get; set; }
Property Value
Type Description
ListCompartmentsRequest.SortByEnum?

The field to sort by. You can provide one sort order (sortOrder). Default order for TIMECREATED is descending. Default order for NAME is ascending. The NAME sort order is case sensitive.
Note: In general, some "List" operations (for example, ListInstances) let you optionally filter by Availability Domain if the scope of the resource type is within a single Availability Domain. If you call one of these "List" operations without specifying an Availability Domain, the resources are grouped by Availability Domain, then sorted.

SortOrder

Declaration
[HttpConverter(TargetEnum.Query, "sortOrder")]
public ListCompartmentsRequest.SortOrderEnum? SortOrder { get; set; }
Property Value
Type Description
ListCompartmentsRequest.SortOrderEnum?

The sort order to use, either ascending (ASC) or descending (DESC). The NAME sort order is case sensitive.

Implements

IOciRequest
In this article
Back to top