1. Packages
  2. Nutanix
  3. API Docs
  4. getUserKeysV2
Nutanix v0.10.0 published on Monday, Sep 1, 2025 by Piers Karsenbarg

nutanix.getUserKeysV2

Explore with Pulumi AI

nutanix logo
Nutanix v0.10.0 published on Monday, Sep 1, 2025 by Piers Karsenbarg

    List all keys identified by the external identifier of a user.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as nutanix from "@pierskarsenbarg/nutanix";
    
    const getKeys = nutanix.getUserKeysV2({
        userExtId: "<SERVICE_ACCOUNT_UUID>",
    });
    const getKeysFilter = nutanix.getUserKeysV2({
        filter: "name eq '<NAME_OF_API_KEY>'",
        userExtId: "<SERVICE_ACCOUNT_UUID>",
    });
    
    import pulumi
    import pulumi_nutanix as nutanix
    
    get_keys = nutanix.get_user_keys_v2(user_ext_id="<SERVICE_ACCOUNT_UUID>")
    get_keys_filter = nutanix.get_user_keys_v2(filter="name eq '<NAME_OF_API_KEY>'",
        user_ext_id="<SERVICE_ACCOUNT_UUID>")
    
    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 {
    		_, err := nutanix.GetUserKeysV2(ctx, &nutanix.GetUserKeysV2Args{
    			UserExtId: "<SERVICE_ACCOUNT_UUID>",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = nutanix.GetUserKeysV2(ctx, &nutanix.GetUserKeysV2Args{
    			Filter:    pulumi.StringRef("name eq '<NAME_OF_API_KEY>'"),
    			UserExtId: "<SERVICE_ACCOUNT_UUID>",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Nutanix = Pulumi.Nutanix;
    
    return await Deployment.RunAsync(() => 
    {
        var getKeys = Nutanix.GetUserKeysV2.Invoke(new()
        {
            UserExtId = "<SERVICE_ACCOUNT_UUID>",
        });
    
        var getKeysFilter = Nutanix.GetUserKeysV2.Invoke(new()
        {
            Filter = "name eq '<NAME_OF_API_KEY>'",
            UserExtId = "<SERVICE_ACCOUNT_UUID>",
        });
    
    });
    
    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.GetUserKeysV2Args;
    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 getKeys = NutanixFunctions.getUserKeysV2(GetUserKeysV2Args.builder()
                .userExtId("<SERVICE_ACCOUNT_UUID>")
                .build());
    
            final var getKeysFilter = NutanixFunctions.getUserKeysV2(GetUserKeysV2Args.builder()
                .filter("name eq '<NAME_OF_API_KEY>'")
                .userExtId("<SERVICE_ACCOUNT_UUID>")
                .build());
    
        }
    }
    
    variables:
      getKeys:
        fn::invoke:
          function: nutanix:getUserKeysV2
          arguments:
            userExtId: <SERVICE_ACCOUNT_UUID>
      getKeysFilter:
        fn::invoke:
          function: nutanix:getUserKeysV2
          arguments:
            filter: name eq '<NAME_OF_API_KEY>'
            userExtId: <SERVICE_ACCOUNT_UUID>
    

    Argument Reference

    The following arguments are supported:

    • user_ext_id: - ( Required ) External Identifier of the User.
    • page:- (Optional)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.
    • limit:- (Optional) 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.
    • filter :- (Optional) 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:
      • assignedTo
      • creationType
      • extId
      • keyType
      • lastUpdatedBy
      • name
      • status
      • tenantId
    • orderby :- (Optional) 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: * createdBy
      • assignedTo
      • createdBy
      • createdTime
      • expiryTime
      • keyType
      • lastUpdatedTime
      • lastUsedTime
      • name
      • status
      • tenantId
    • select :- (Optional) 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. following fields:
      • assignedTo
      • createdBy
      • createdTime
      • creationType
      • description
      • expiryTime
      • extId
      • keyType
      • lastUpdatedBy
      • lastUpdatedTime
      • lastUsedTime
      • name
      • status
      • tenantId

    Using getUserKeysV2

    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 getUserKeysV2(args: GetUserKeysV2Args, opts?: InvokeOptions): Promise<GetUserKeysV2Result>
    function getUserKeysV2Output(args: GetUserKeysV2OutputArgs, opts?: InvokeOptions): Output<GetUserKeysV2Result>
    def get_user_keys_v2(filter: Optional[str] = None,
                         limit: Optional[int] = None,
                         order_by: Optional[str] = None,
                         page: Optional[int] = None,
                         select: Optional[str] = None,
                         user_ext_id: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetUserKeysV2Result
    def get_user_keys_v2_output(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,
                         user_ext_id: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetUserKeysV2Result]
    func GetUserKeysV2(ctx *Context, args *GetUserKeysV2Args, opts ...InvokeOption) (*GetUserKeysV2Result, error)
    func GetUserKeysV2Output(ctx *Context, args *GetUserKeysV2OutputArgs, opts ...InvokeOption) GetUserKeysV2ResultOutput

    > Note: This function is named GetUserKeysV2 in the Go SDK.

    public static class GetUserKeysV2 
    {
        public static Task<GetUserKeysV2Result> InvokeAsync(GetUserKeysV2Args args, InvokeOptions? opts = null)
        public static Output<GetUserKeysV2Result> Invoke(GetUserKeysV2InvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetUserKeysV2Result> getUserKeysV2(GetUserKeysV2Args args, InvokeOptions options)
    public static Output<GetUserKeysV2Result> getUserKeysV2(GetUserKeysV2Args args, InvokeOptions options)
    
    fn::invoke:
      function: nutanix:index/getUserKeysV2:getUserKeysV2
      arguments:
        # arguments dictionary

    The following arguments are supported:

    UserExtId string
    Filter string
    Limit int
    OrderBy string
    Page int
    Select string
    UserExtId string
    Filter string
    Limit int
    OrderBy string
    Page int
    Select string
    userExtId String
    filter String
    limit Integer
    orderBy String
    page Integer
    select String
    userExtId string
    filter string
    limit number
    orderBy string
    page number
    select string
    userExtId String
    filter String
    limit Number
    orderBy String
    page Number
    select String

    getUserKeysV2 Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Keys List<PiersKarsenbarg.Nutanix.Outputs.GetUserKeysV2Key>
    UserExtId string
    Filter string
    Limit int
    OrderBy string
    Page int
    Select string
    Id string
    The provider-assigned unique ID for this managed resource.
    Keys []GetUserKeysV2Key
    UserExtId string
    Filter string
    Limit int
    OrderBy string
    Page int
    Select string
    id String
    The provider-assigned unique ID for this managed resource.
    keys List<GetUserKeysV2Key>
    userExtId String
    filter String
    limit Integer
    orderBy String
    page Integer
    select String
    id string
    The provider-assigned unique ID for this managed resource.
    keys GetUserKeysV2Key[]
    userExtId string
    filter string
    limit number
    orderBy string
    page number
    select string
    id str
    The provider-assigned unique ID for this managed resource.
    keys Sequence[GetUserKeysV2Key]
    user_ext_id str
    filter str
    limit int
    order_by str
    page int
    select str
    id String
    The provider-assigned unique ID for this managed resource.
    keys List<Property Map>
    userExtId String
    filter String
    limit Number
    orderBy String
    page Number
    select String

    Supporting Types

    GetUserKeysV2Key

    AssignedTo string
    • External client to whom the given key is allocated.
    CreatedBy string
    • User or service who created the key.
    CreatedTime string
    • The creation time of the key.
    CreationType string
    • The creation mechanism of this entity.
    ExpiryTime string
    • The time when the key will expire.
    ExtId string
    The External Identifier of the User Group.
    KeyDetails List<PiersKarsenbarg.Nutanix.Inputs.GetUserKeysV2KeyKeyDetail>
    • Details specific to type of the key.
    KeyType string
    • The type of key.
    LastUpdatedBy string
    • User who updated the key.
    LastUpdatedTime string
    • The time when the key was updated.
    LastUsedTime string
    • The time when the key was last used.
    Links List<PiersKarsenbarg.Nutanix.Inputs.GetUserKeysV2KeyLink>
    • 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.
    Name string
    • Identifier for the key in the form of a name.
    Status string
    • The status of the key.
    TenantId string
    A globally unique identifier that represents the tenant that owns this entity. The system automatically assigns it, and it and is immutable from an API consumer perspective (some use cases may cause this Id to change - For instance, a use case may require the transfer of ownership of the entity, but these cases are handled automatically on the server).
    UserExtId string
    Description string
    • Brief description of the key.
    AssignedTo string
    • External client to whom the given key is allocated.
    CreatedBy string
    • User or service who created the key.
    CreatedTime string
    • The creation time of the key.
    CreationType string
    • The creation mechanism of this entity.
    ExpiryTime string
    • The time when the key will expire.
    ExtId string
    The External Identifier of the User Group.
    KeyDetails []GetUserKeysV2KeyKeyDetail
    • Details specific to type of the key.
    KeyType string
    • The type of key.
    LastUpdatedBy string
    • User who updated the key.
    LastUpdatedTime string
    • The time when the key was updated.
    LastUsedTime string
    • The time when the key was last used.
    Links []GetUserKeysV2KeyLink
    • 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.
    Name string
    • Identifier for the key in the form of a name.
    Status string
    • The status of the key.
    TenantId string
    A globally unique identifier that represents the tenant that owns this entity. The system automatically assigns it, and it and is immutable from an API consumer perspective (some use cases may cause this Id to change - For instance, a use case may require the transfer of ownership of the entity, but these cases are handled automatically on the server).
    UserExtId string
    Description string
    • Brief description of the key.
    assignedTo String
    • External client to whom the given key is allocated.
    createdBy String
    • User or service who created the key.
    createdTime String
    • The creation time of the key.
    creationType String
    • The creation mechanism of this entity.
    expiryTime String
    • The time when the key will expire.
    extId String
    The External Identifier of the User Group.
    keyDetails List<GetUserKeysV2KeyKeyDetail>
    • Details specific to type of the key.
    keyType String
    • The type of key.
    lastUpdatedBy String
    • User who updated the key.
    lastUpdatedTime String
    • The time when the key was updated.
    lastUsedTime String
    • The time when the key was last used.
    links List<GetUserKeysV2KeyLink>
    • 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.
    name String
    • Identifier for the key in the form of a name.
    status String
    • The status of the key.
    tenantId String
    A globally unique identifier that represents the tenant that owns this entity. The system automatically assigns it, and it and is immutable from an API consumer perspective (some use cases may cause this Id to change - For instance, a use case may require the transfer of ownership of the entity, but these cases are handled automatically on the server).
    userExtId String
    description String
    • Brief description of the key.
    assignedTo string
    • External client to whom the given key is allocated.
    createdBy string
    • User or service who created the key.
    createdTime string
    • The creation time of the key.
    creationType string
    • The creation mechanism of this entity.
    expiryTime string
    • The time when the key will expire.
    extId string
    The External Identifier of the User Group.
    keyDetails GetUserKeysV2KeyKeyDetail[]
    • Details specific to type of the key.
    keyType string
    • The type of key.
    lastUpdatedBy string
    • User who updated the key.
    lastUpdatedTime string
    • The time when the key was updated.
    lastUsedTime string
    • The time when the key was last used.
    links GetUserKeysV2KeyLink[]
    • 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.
    name string
    • Identifier for the key in the form of a name.
    status string
    • The status of the key.
    tenantId string
    A globally unique identifier that represents the tenant that owns this entity. The system automatically assigns it, and it and is immutable from an API consumer perspective (some use cases may cause this Id to change - For instance, a use case may require the transfer of ownership of the entity, but these cases are handled automatically on the server).
    userExtId string
    description string
    • Brief description of the key.
    assigned_to str
    • External client to whom the given key is allocated.
    created_by str
    • User or service who created the key.
    created_time str
    • The creation time of the key.
    creation_type str
    • The creation mechanism of this entity.
    expiry_time str
    • The time when the key will expire.
    ext_id str
    The External Identifier of the User Group.
    key_details Sequence[GetUserKeysV2KeyKeyDetail]
    • Details specific to type of the key.
    key_type str
    • The type of key.
    last_updated_by str
    • User who updated the key.
    last_updated_time str
    • The time when the key was updated.
    last_used_time str
    • The time when the key was last used.
    links Sequence[GetUserKeysV2KeyLink]
    • 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.
    name str
    • Identifier for the key in the form of a name.
    status str
    • The status of the key.
    tenant_id str
    A globally unique identifier that represents the tenant that owns this entity. The system automatically assigns it, and it and is immutable from an API consumer perspective (some use cases may cause this Id to change - For instance, a use case may require the transfer of ownership of the entity, but these cases are handled automatically on the server).
    user_ext_id str
    description str
    • Brief description of the key.
    assignedTo String
    • External client to whom the given key is allocated.
    createdBy String
    • User or service who created the key.
    createdTime String
    • The creation time of the key.
    creationType String
    • The creation mechanism of this entity.
    expiryTime String
    • The time when the key will expire.
    extId String
    The External Identifier of the User Group.
    keyDetails List<Property Map>
    • Details specific to type of the key.
    keyType String
    • The type of key.
    lastUpdatedBy String
    • User who updated the key.
    lastUpdatedTime String
    • The time when the key was updated.
    lastUsedTime String
    • The time when the key was last used.
    links List<Property Map>
    • 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.
    name String
    • Identifier for the key in the form of a name.
    status String
    • The status of the key.
    tenantId String
    A globally unique identifier that represents the tenant that owns this entity. The system automatically assigns it, and it and is immutable from an API consumer perspective (some use cases may cause this Id to change - For instance, a use case may require the transfer of ownership of the entity, but these cases are handled automatically on the server).
    userExtId String
    description String
    • Brief description of the key.

    GetUserKeysV2KeyKeyDetail

    GetUserKeysV2KeyKeyDetailApiKeyDetail

    ApiKey string
    ApiKey string
    apiKey String
    apiKey string
    apiKey String

    GetUserKeysV2KeyKeyDetailObjectKeyDetail

    AccessKey string
    SecretKey string
    AccessKey string
    SecretKey string
    accessKey String
    secretKey String
    accessKey string
    secretKey string
    accessKey String
    secretKey String
    Href string
    Rel string
    Href string
    Rel string
    href String
    rel String
    href string
    rel string
    href str
    rel str
    href String
    rel String

    Package Details

    Repository
    nutanix pierskarsenbarg/pulumi-nutanix
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the nutanix Terraform Provider.
    nutanix logo
    Nutanix v0.10.0 published on Monday, Sep 1, 2025 by Piers Karsenbarg
      AI Agentic Workflows: Register now