Nutanix v0.8.0 published on Sunday, May 11, 2025 by Piers Karsenbarg
nutanix.getCategoriesV2
Explore with Pulumi AI
List categories
Example
import * as pulumi from "@pulumi/pulumi";
import * as nutanix from "@pulumi/nutanix";
const categories_list = nutanix.getCategoriesV2({});
const categories_paginated = nutanix.getCategoriesV2({
page: 1,
limit: 10,
});
const categories_sorted = nutanix.getCategoriesV2({
orderBy: "key desc",
});
const categories_filtered = nutanix.getCategoriesV2({
filter: "key eq 'key_example'",
});
export const category = categories_list.then(categories_list => categories_list.categories?.[0]);
import pulumi
import pulumi_nutanix as nutanix
categories_list = nutanix.get_categories_v2()
categories_paginated = nutanix.get_categories_v2(page=1,
limit=10)
categories_sorted = nutanix.get_categories_v2(order_by="key desc")
categories_filtered = nutanix.get_categories_v2(filter="key eq 'key_example'")
pulumi.export("category", categories_list.categories[0])
package main
import (
"github.com/pierskarsenbarg/pulumi-nutanix/sdk/go/nutanix"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
categories_list, err := nutanix.GetCategoriesV2(ctx, &nutanix.GetCategoriesV2Args{}, nil)
if err != nil {
return err
}
_, err = nutanix.GetCategoriesV2(ctx, &nutanix.GetCategoriesV2Args{
Page: pulumi.IntRef(1),
Limit: pulumi.IntRef(10),
}, nil)
if err != nil {
return err
}
_, err = nutanix.GetCategoriesV2(ctx, &nutanix.GetCategoriesV2Args{
OrderBy: pulumi.StringRef("key desc"),
}, nil)
if err != nil {
return err
}
_, err = nutanix.GetCategoriesV2(ctx, &nutanix.GetCategoriesV2Args{
Filter: pulumi.StringRef("key eq 'key_example'"),
}, nil)
if err != nil {
return err
}
ctx.Export("category", categories_list.Categories[0])
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Nutanix = Pulumi.Nutanix;
return await Deployment.RunAsync(() =>
{
var categories_list = Nutanix.GetCategoriesV2.Invoke();
var categories_paginated = Nutanix.GetCategoriesV2.Invoke(new()
{
Page = 1,
Limit = 10,
});
var categories_sorted = Nutanix.GetCategoriesV2.Invoke(new()
{
OrderBy = "key desc",
});
var categories_filtered = Nutanix.GetCategoriesV2.Invoke(new()
{
Filter = "key eq 'key_example'",
});
return new Dictionary<string, object?>
{
["category"] = categories_list.Apply(categories_list => categories_list.Apply(getCategoriesV2Result => getCategoriesV2Result.Categories[0])),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.nutanix.NutanixFunctions;
import com.pulumi.nutanix.inputs.GetCategoriesV2Args;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var categories-list = NutanixFunctions.getCategoriesV2(GetCategoriesV2Args.builder()
.build());
final var categories-paginated = NutanixFunctions.getCategoriesV2(GetCategoriesV2Args.builder()
.page(1)
.limit(10)
.build());
final var categories-sorted = NutanixFunctions.getCategoriesV2(GetCategoriesV2Args.builder()
.orderBy("key desc")
.build());
final var categories-filtered = NutanixFunctions.getCategoriesV2(GetCategoriesV2Args.builder()
.filter("key eq 'key_example'")
.build());
ctx.export("category", categories_list.categories()[0]);
}
}
variables:
categories-list:
fn::invoke:
function: nutanix:getCategoriesV2
arguments: {}
categories-paginated:
fn::invoke:
function: nutanix:getCategoriesV2
arguments:
page: 1
limit: 10
categories-sorted:
fn::invoke:
function: nutanix:getCategoriesV2
arguments:
orderBy: key desc
categories-filtered:
fn::invoke:
function: nutanix:getCategoriesV2
arguments:
filter: key eq 'key_example'
outputs:
category: ${["categories-list"].categories[0]}
Categories
The categories
contains list of categories. Each category has the following attributes:
ext_id
: The extID for the category.key
: The key of a category when it is represented in key:value format.value
: The value of a category when it is represented in key:value formattype
: Denotes the type of a category. There are three types of categories: SYSTEM, INTERNAL, and USER.description
: A string consisting of the description of the category as defined by the user.owner_uuid
: This field contains the UUID of a user who owns the category.associations
: This field gives basic information about resources that are associated to the category.detailed_associations
: This field gives detailed information about resources that are associated to the category.tenant_id
: A globally unique identifier that represents the tenant that owns this entity.links
: A HATEOAS style link for the response. Each link contains a user-friendly name identifying the link and an address for retrieving the particular resource.
associations
category_id
: External identifier for the given category, used across all v4 apis/entities/resources where categories are referenced.resource_type
: An enum denoting the associated resource types. Resource types are further grouped into 2 types - entity or a policy.resource_group
: An enum denoting the resource group. Resources can be organized into either an entity or a policy.count
: Count of associations of a particular type of entity or policy
detailed_associations
category_id
: External identifier for the given category, used across all v4 apis/entities/resources where categories are referenced.resource_type
: An enum denoting the associated resource types. Resource types are further grouped into 2 types - entity or a policy.resource_group
: An enum denoting the resource group. Resources can be organized into either an entity or a policy.resource_id
: The UUID of the entity or policy associated with the particular category.
See detailed information in Nutanix List Categories v4.
Using getCategoriesV2
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getCategoriesV2(args: GetCategoriesV2Args, opts?: InvokeOptions): Promise<GetCategoriesV2Result>
function getCategoriesV2Output(args: GetCategoriesV2OutputArgs, opts?: InvokeOptions): Output<GetCategoriesV2Result>
def get_categories_v2(expand: Optional[str] = None,
filter: Optional[str] = None,
limit: Optional[int] = None,
order_by: Optional[str] = None,
page: Optional[int] = None,
select: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetCategoriesV2Result
def get_categories_v2_output(expand: Optional[pulumi.Input[str]] = None,
filter: Optional[pulumi.Input[str]] = None,
limit: Optional[pulumi.Input[int]] = None,
order_by: Optional[pulumi.Input[str]] = None,
page: Optional[pulumi.Input[int]] = None,
select: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetCategoriesV2Result]
func GetCategoriesV2(ctx *Context, args *GetCategoriesV2Args, opts ...InvokeOption) (*GetCategoriesV2Result, error)
func GetCategoriesV2Output(ctx *Context, args *GetCategoriesV2OutputArgs, opts ...InvokeOption) GetCategoriesV2ResultOutput
> Note: This function is named GetCategoriesV2
in the Go SDK.
public static class GetCategoriesV2
{
public static Task<GetCategoriesV2Result> InvokeAsync(GetCategoriesV2Args args, InvokeOptions? opts = null)
public static Output<GetCategoriesV2Result> Invoke(GetCategoriesV2InvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetCategoriesV2Result> getCategoriesV2(GetCategoriesV2Args args, InvokeOptions options)
public static Output<GetCategoriesV2Result> getCategoriesV2(GetCategoriesV2Args args, InvokeOptions options)
fn::invoke:
function: nutanix:index/getCategoriesV2:getCategoriesV2
arguments:
# arguments dictionary
The following arguments are supported:
- Expand string
- A URL query parameter that allows clients to request related resources when a resource that satisfies a particular request is retrieved. Each expanded item is evaluated relative to the entity containing the property being expanded. Other query options can be applied to an expanded property by appending a semicolon-separated list of query options, enclosed in parentheses, to the property name. Permissible system query options are $filter, $select and $orderby. The following expansion keys are supported:
- associations
- detailedAssociations
- Filter string
- A URL query parameter that allows clients to filter a collection of resources. The expression specified with $filter is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response. Expression specified with the $filter must conform to the OData V4.01 URL conventions. For example, filter '$filter=name eq 'karbon-ntnx-1.0' would filter the result on cluster name 'karbon-ntnx1.0', filter '$filter=startswith(name, 'C')' would filter on cluster name starting with 'C'. The filter can be applied to the following fields:
- extId
- key
- ownerUuid
- type
- value
- Limit int
- A URL query parameter that specifies the total number of records returned in the result set. Must be a positive integer between 1 and 100. Any number out of this range will lead to a validation error. If the limit is not provided, a default value of 50 records will be returned in the result set.
- Order
By string - A URL query parameter that allows clients to specify the sort criteria for the returned list of objects. Resources can be sorted in ascending order using asc or descending order using desc. If asc or desc are not specified, the resources will be sorted in ascending order by default. For example, '$orderby=templateName desc' would get all templates sorted by templateName in descending order. The orderby can be applied to the following fields:
- key
- value
- Page int
- A URL query parameter that specifies the page number of the result set. It must be a positive integer between 0 and the maximum number of pages that are available for that resource. Any number out of this range might lead to no results.
- Select string
- A URL query parameter that allows clients to request a specific set of properties for each entity or complex type. Expression specified with the $select must conform to the OData V4.01 URL conventions. If a $select expression consists of a single select item that is an asterisk (i.e., *), then all properties on the matching resource will be returned. The select can be applied to the following fields:
- description
- extId
- key
- ownerUuid
- type
- value
- Expand string
- A URL query parameter that allows clients to request related resources when a resource that satisfies a particular request is retrieved. Each expanded item is evaluated relative to the entity containing the property being expanded. Other query options can be applied to an expanded property by appending a semicolon-separated list of query options, enclosed in parentheses, to the property name. Permissible system query options are $filter, $select and $orderby. The following expansion keys are supported:
- associations
- detailedAssociations
- Filter string
- A URL query parameter that allows clients to filter a collection of resources. The expression specified with $filter is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response. Expression specified with the $filter must conform to the OData V4.01 URL conventions. For example, filter '$filter=name eq 'karbon-ntnx-1.0' would filter the result on cluster name 'karbon-ntnx1.0', filter '$filter=startswith(name, 'C')' would filter on cluster name starting with 'C'. The filter can be applied to the following fields:
- extId
- key
- ownerUuid
- type
- value
- Limit int
- A URL query parameter that specifies the total number of records returned in the result set. Must be a positive integer between 1 and 100. Any number out of this range will lead to a validation error. If the limit is not provided, a default value of 50 records will be returned in the result set.
- Order
By string - A URL query parameter that allows clients to specify the sort criteria for the returned list of objects. Resources can be sorted in ascending order using asc or descending order using desc. If asc or desc are not specified, the resources will be sorted in ascending order by default. For example, '$orderby=templateName desc' would get all templates sorted by templateName in descending order. The orderby can be applied to the following fields:
- key
- value
- Page int
- A URL query parameter that specifies the page number of the result set. It must be a positive integer between 0 and the maximum number of pages that are available for that resource. Any number out of this range might lead to no results.
- Select string
- A URL query parameter that allows clients to request a specific set of properties for each entity or complex type. Expression specified with the $select must conform to the OData V4.01 URL conventions. If a $select expression consists of a single select item that is an asterisk (i.e., *), then all properties on the matching resource will be returned. The select can be applied to the following fields:
- description
- extId
- key
- ownerUuid
- type
- value
- expand String
- A URL query parameter that allows clients to request related resources when a resource that satisfies a particular request is retrieved. Each expanded item is evaluated relative to the entity containing the property being expanded. Other query options can be applied to an expanded property by appending a semicolon-separated list of query options, enclosed in parentheses, to the property name. Permissible system query options are $filter, $select and $orderby. The following expansion keys are supported:
- associations
- detailedAssociations
- filter String
- A URL query parameter that allows clients to filter a collection of resources. The expression specified with $filter is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response. Expression specified with the $filter must conform to the OData V4.01 URL conventions. For example, filter '$filter=name eq 'karbon-ntnx-1.0' would filter the result on cluster name 'karbon-ntnx1.0', filter '$filter=startswith(name, 'C')' would filter on cluster name starting with 'C'. The filter can be applied to the following fields:
- extId
- key
- ownerUuid
- type
- value
- limit Integer
- A URL query parameter that specifies the total number of records returned in the result set. Must be a positive integer between 1 and 100. Any number out of this range will lead to a validation error. If the limit is not provided, a default value of 50 records will be returned in the result set.
- order
By String - A URL query parameter that allows clients to specify the sort criteria for the returned list of objects. Resources can be sorted in ascending order using asc or descending order using desc. If asc or desc are not specified, the resources will be sorted in ascending order by default. For example, '$orderby=templateName desc' would get all templates sorted by templateName in descending order. The orderby can be applied to the following fields:
- key
- value
- page Integer
- A URL query parameter that specifies the page number of the result set. It must be a positive integer between 0 and the maximum number of pages that are available for that resource. Any number out of this range might lead to no results.
- select String
- A URL query parameter that allows clients to request a specific set of properties for each entity or complex type. Expression specified with the $select must conform to the OData V4.01 URL conventions. If a $select expression consists of a single select item that is an asterisk (i.e., *), then all properties on the matching resource will be returned. The select can be applied to the following fields:
- description
- extId
- key
- ownerUuid
- type
- value
- expand string
- A URL query parameter that allows clients to request related resources when a resource that satisfies a particular request is retrieved. Each expanded item is evaluated relative to the entity containing the property being expanded. Other query options can be applied to an expanded property by appending a semicolon-separated list of query options, enclosed in parentheses, to the property name. Permissible system query options are $filter, $select and $orderby. The following expansion keys are supported:
- associations
- detailedAssociations
- filter string
- A URL query parameter that allows clients to filter a collection of resources. The expression specified with $filter is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response. Expression specified with the $filter must conform to the OData V4.01 URL conventions. For example, filter '$filter=name eq 'karbon-ntnx-1.0' would filter the result on cluster name 'karbon-ntnx1.0', filter '$filter=startswith(name, 'C')' would filter on cluster name starting with 'C'. The filter can be applied to the following fields:
- extId
- key
- ownerUuid
- type
- value
- limit number
- A URL query parameter that specifies the total number of records returned in the result set. Must be a positive integer between 1 and 100. Any number out of this range will lead to a validation error. If the limit is not provided, a default value of 50 records will be returned in the result set.
- order
By string - A URL query parameter that allows clients to specify the sort criteria for the returned list of objects. Resources can be sorted in ascending order using asc or descending order using desc. If asc or desc are not specified, the resources will be sorted in ascending order by default. For example, '$orderby=templateName desc' would get all templates sorted by templateName in descending order. The orderby can be applied to the following fields:
- key
- value
- page number
- A URL query parameter that specifies the page number of the result set. It must be a positive integer between 0 and the maximum number of pages that are available for that resource. Any number out of this range might lead to no results.
- select string
- A URL query parameter that allows clients to request a specific set of properties for each entity or complex type. Expression specified with the $select must conform to the OData V4.01 URL conventions. If a $select expression consists of a single select item that is an asterisk (i.e., *), then all properties on the matching resource will be returned. The select can be applied to the following fields:
- description
- extId
- key
- ownerUuid
- type
- value
- expand str
- A URL query parameter that allows clients to request related resources when a resource that satisfies a particular request is retrieved. Each expanded item is evaluated relative to the entity containing the property being expanded. Other query options can be applied to an expanded property by appending a semicolon-separated list of query options, enclosed in parentheses, to the property name. Permissible system query options are $filter, $select and $orderby. The following expansion keys are supported:
- associations
- detailedAssociations
- filter str
- A URL query parameter that allows clients to filter a collection of resources. The expression specified with $filter is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response. Expression specified with the $filter must conform to the OData V4.01 URL conventions. For example, filter '$filter=name eq 'karbon-ntnx-1.0' would filter the result on cluster name 'karbon-ntnx1.0', filter '$filter=startswith(name, 'C')' would filter on cluster name starting with 'C'. The filter can be applied to the following fields:
- extId
- key
- ownerUuid
- type
- value
- limit int
- A URL query parameter that specifies the total number of records returned in the result set. Must be a positive integer between 1 and 100. Any number out of this range will lead to a validation error. If the limit is not provided, a default value of 50 records will be returned in the result set.
- order_
by str - A URL query parameter that allows clients to specify the sort criteria for the returned list of objects. Resources can be sorted in ascending order using asc or descending order using desc. If asc or desc are not specified, the resources will be sorted in ascending order by default. For example, '$orderby=templateName desc' would get all templates sorted by templateName in descending order. The orderby can be applied to the following fields:
- key
- value
- page int
- A URL query parameter that specifies the page number of the result set. It must be a positive integer between 0 and the maximum number of pages that are available for that resource. Any number out of this range might lead to no results.
- select str
- A URL query parameter that allows clients to request a specific set of properties for each entity or complex type. Expression specified with the $select must conform to the OData V4.01 URL conventions. If a $select expression consists of a single select item that is an asterisk (i.e., *), then all properties on the matching resource will be returned. The select can be applied to the following fields:
- description
- extId
- key
- ownerUuid
- type
- value
- expand String
- A URL query parameter that allows clients to request related resources when a resource that satisfies a particular request is retrieved. Each expanded item is evaluated relative to the entity containing the property being expanded. Other query options can be applied to an expanded property by appending a semicolon-separated list of query options, enclosed in parentheses, to the property name. Permissible system query options are $filter, $select and $orderby. The following expansion keys are supported:
- associations
- detailedAssociations
- filter String
- A URL query parameter that allows clients to filter a collection of resources. The expression specified with $filter is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response. Expression specified with the $filter must conform to the OData V4.01 URL conventions. For example, filter '$filter=name eq 'karbon-ntnx-1.0' would filter the result on cluster name 'karbon-ntnx1.0', filter '$filter=startswith(name, 'C')' would filter on cluster name starting with 'C'. The filter can be applied to the following fields:
- extId
- key
- ownerUuid
- type
- value
- limit Number
- A URL query parameter that specifies the total number of records returned in the result set. Must be a positive integer between 1 and 100. Any number out of this range will lead to a validation error. If the limit is not provided, a default value of 50 records will be returned in the result set.
- order
By String - A URL query parameter that allows clients to specify the sort criteria for the returned list of objects. Resources can be sorted in ascending order using asc or descending order using desc. If asc or desc are not specified, the resources will be sorted in ascending order by default. For example, '$orderby=templateName desc' would get all templates sorted by templateName in descending order. The orderby can be applied to the following fields:
- key
- value
- page Number
- A URL query parameter that specifies the page number of the result set. It must be a positive integer between 0 and the maximum number of pages that are available for that resource. Any number out of this range might lead to no results.
- select String
- A URL query parameter that allows clients to request a specific set of properties for each entity or complex type. Expression specified with the $select must conform to the OData V4.01 URL conventions. If a $select expression consists of a single select item that is an asterisk (i.e., *), then all properties on the matching resource will be returned. The select can be applied to the following fields:
- description
- extId
- key
- ownerUuid
- type
- value
getCategoriesV2 Result
The following output properties are available:
- Categories
List<Piers
Karsenbarg. Nutanix. Outputs. Get Categories V2Category> - List of categories
- Id string
- The provider-assigned unique ID for this managed resource.
- Expand string
- Filter string
- Limit int
- Order
By string - Page int
- Select string
- Categories
[]Get
Categories V2Category - List of categories
- Id string
- The provider-assigned unique ID for this managed resource.
- Expand string
- Filter string
- Limit int
- Order
By string - Page int
- Select string
- categories
List<Get
Categories V2Category> - List of categories
- id String
- The provider-assigned unique ID for this managed resource.
- expand String
- filter String
- limit Integer
- order
By String - page Integer
- select String
- categories
Get
Categories V2Category[] - List of categories
- id string
- The provider-assigned unique ID for this managed resource.
- expand string
- filter string
- limit number
- order
By string - page number
- select string
- categories
Sequence[Get
Categories V2Category] - List of categories
- id str
- The provider-assigned unique ID for this managed resource.
- expand str
- filter str
- limit int
- order_
by str - page int
- select str
- categories List<Property Map>
- List of categories
- id String
- The provider-assigned unique ID for this managed resource.
- expand String
- filter String
- limit Number
- order
By String - page Number
- select String
Supporting Types
GetCategoriesV2Category
- Associations
List<Piers
Karsenbarg. Nutanix. Inputs. Get Categories V2Category Association> - Description string
- Detailed
Associations List<PiersKarsenbarg. Nutanix. Inputs. Get Categories V2Category Detailed Association> - Ext
Id string - Key string
- Links
List<Piers
Karsenbarg. Nutanix. Inputs. Get Categories V2Category Link> - Owner
Uuid string - Tenant
Id string - Type string
- Value string
- Associations
[]Get
Categories V2Category Association - Description string
- Detailed
Associations []GetCategories V2Category Detailed Association - Ext
Id string - Key string
- Links
[]Get
Categories V2Category Link - Owner
Uuid string - Tenant
Id string - Type string
- Value string
- associations
List<Get
Categories V2Category Association> - description String
- detailed
Associations List<GetCategories V2Category Detailed Association> - ext
Id String - key String
- links
List<Get
Categories V2Category Link> - owner
Uuid String - tenant
Id String - type String
- value String
- associations
Get
Categories V2Category Association[] - description string
- detailed
Associations GetCategories V2Category Detailed Association[] - ext
Id string - key string
- links
Get
Categories V2Category Link[] - owner
Uuid string - tenant
Id string - type string
- value string
- associations List<Property Map>
- description String
- detailed
Associations List<Property Map> - ext
Id String - key String
- links List<Property Map>
- owner
Uuid String - tenant
Id String - type String
- value String
GetCategoriesV2CategoryAssociation
- Category
Id string - Count int
- Resource
Group string - Resource
Type string
- Category
Id string - Count int
- Resource
Group string - Resource
Type string
- category
Id String - count Integer
- resource
Group String - resource
Type String
- category
Id string - count number
- resource
Group string - resource
Type string
- category_
id str - count int
- resource_
group str - resource_
type str
- category
Id String - count Number
- resource
Group String - resource
Type String
GetCategoriesV2CategoryDetailedAssociation
- Category
Id string - Resource
Group string - Resource
Id string - Resource
Type string
- Category
Id string - Resource
Group string - Resource
Id string - Resource
Type string
- category
Id String - resource
Group String - resource
Id String - resource
Type String
- category
Id string - resource
Group string - resource
Id string - resource
Type string
- category_
id str - resource_
group str - resource_
id str - resource_
type str
- category
Id String - resource
Group String - resource
Id String - resource
Type String
GetCategoriesV2CategoryLink
Package Details
- Repository
- nutanix pierskarsenbarg/pulumi-nutanix
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
nutanix
Terraform Provider.