1. Packages
  2. Nutanix
  3. API Docs
  4. getImagesV2
Nutanix v0.8.0 published on Sunday, May 11, 2025 by Piers Karsenbarg

nutanix.getImagesV2

Explore with Pulumi AI

nutanix logo
Nutanix v0.8.0 published on Sunday, May 11, 2025 by Piers Karsenbarg

    List images owned by Prism Central along with the image details like name, description, type, etc. This operation supports filtering, sorting, selection & pagination.

    Example

    import * as pulumi from "@pulumi/pulumi";
    import * as nutanix from "@pulumi/nutanix";
    
    const list_images = nutanix.getImagesV2({});
    const filtered_images = nutanix.getImagesV2({
        filter: "startswith(name,'image_name')",
        limit: 10,
        page: 1,
    });
    
    import pulumi
    import pulumi_nutanix as nutanix
    
    list_images = nutanix.get_images_v2()
    filtered_images = nutanix.get_images_v2(filter="startswith(name,'image_name')",
        limit=10,
        page=1)
    
    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.LookupImagesV2(ctx, &nutanix.LookupImagesV2Args{}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = nutanix.LookupImagesV2(ctx, &nutanix.LookupImagesV2Args{
    			Filter: pulumi.StringRef("startswith(name,'image_name')"),
    			Limit:  pulumi.IntRef(10),
    			Page:   pulumi.IntRef(1),
    		}, 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 list_images = Nutanix.GetImagesV2.Invoke();
    
        var filtered_images = Nutanix.GetImagesV2.Invoke(new()
        {
            Filter = "startswith(name,'image_name')",
            Limit = 10,
            Page = 1,
        });
    
    });
    
    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.GetImagesV2Args;
    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 list-images = NutanixFunctions.getImagesV2(GetImagesV2Args.builder()
                .build());
    
            final var filtered-images = NutanixFunctions.getImagesV2(GetImagesV2Args.builder()
                .filter("startswith(name,'image_name')")
                .limit(10)
                .page(1)
                .build());
    
        }
    }
    
    variables:
      list-images:
        fn::invoke:
          function: nutanix:getImagesV2
          arguments: {}
      filtered-images:
        fn::invoke:
          function: nutanix:getImagesV2
          arguments:
            filter: startswith(name,'image_name')
            limit: 10
            page: 1
    

    Images

    The images object is a list of all images. Each image has the following attributes:

    • ext_id: A globally unique identifier of an instance that is suitable for external consumption.
    • name: The user defined name of an image.
    • description: The user defined description of an image.
    • type: The type of an image.
    • checksum: The checksum of an image.
    • size_bytes: The size in bytes of an image file.
    • source: The source of an image. It can be a VM disk or a URL.
    • category_ext_ids: List of category external identifiers for an image.
    • cluster_location_ext_ids: List of cluster external identifiers where the image is located.
    • create_time: Create time of an image.
    • last_update_time: Last update time of an image.
    • owner_ext_id: External identifier of the owner of the image
    • placement_policy_status: Status of an image placement policy.

    source

    • ext_id: The external identifier of VM Disk.
    • url: The URL for creating an image.
    • basic_auth: Basic authentication credentials for image source HTTP/S URL.
    • basic_auth.username: Username for basic authentication.
    • basic_auth.password: Password for basic authentication.

    placement_policy_status

    • placement_policy_ext_id: Image placement policy external identifier.
    • compliance_status: Compliance status for a placement policy.
    • enforcement_mode: Indicates whether the placement policy enforcement is ongoing or has failed.
    • policy_cluster_ext_ids: List of cluster external identifiers of the image location for the enforced placement policy.
    • enforced_cluster_ext_ids: List of cluster external identifiers for the enforced placement policy.
    • conflicting_policy_ext_ids: List of image placement policy external identifier that conflict with the current one.

    See detailed information in Nutanix List Images V4

    Using getImagesV2

    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 getImagesV2(args: GetImagesV2Args, opts?: InvokeOptions): Promise<GetImagesV2Result>
    function getImagesV2Output(args: GetImagesV2OutputArgs, opts?: InvokeOptions): Output<GetImagesV2Result>
    def get_images_v2(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) -> GetImagesV2Result
    def get_images_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,
                      opts: Optional[InvokeOptions] = None) -> Output[GetImagesV2Result]
    func LookupImagesV2(ctx *Context, args *LookupImagesV2Args, opts ...InvokeOption) (*LookupImagesV2Result, error)
    func LookupImagesV2Output(ctx *Context, args *LookupImagesV2OutputArgs, opts ...InvokeOption) LookupImagesV2ResultOutput

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

    public static class GetImagesV2 
    {
        public static Task<GetImagesV2Result> InvokeAsync(GetImagesV2Args args, InvokeOptions? opts = null)
        public static Output<GetImagesV2Result> Invoke(GetImagesV2InvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetImagesV2Result> getImagesV2(GetImagesV2Args args, InvokeOptions options)
    public static Output<GetImagesV2Result> getImagesV2(GetImagesV2Args args, InvokeOptions options)
    
    fn::invoke:
      function: nutanix:index/getImagesV2:getImagesV2
      arguments:
        # arguments dictionary

    The following arguments are supported:

    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:

    • description
    • name
    • sizeBytes
    • type
    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.
    OrderBy 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:

    • description
    • lastUpdateTime
    • name
    • sizeBytes
    • type
    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:

    • categoryExtIds
    • clusterLocationExtIds
    • createTime
    • description
    • extId
    • lastUpdateTime
    • links
    • name
    • ownerExtId
    • sizeBytes
    • tenantId
    • type
    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:

    • description
    • name
    • sizeBytes
    • type
    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.
    OrderBy 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:

    • description
    • lastUpdateTime
    • name
    • sizeBytes
    • type
    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:

    • categoryExtIds
    • clusterLocationExtIds
    • createTime
    • description
    • extId
    • lastUpdateTime
    • links
    • name
    • ownerExtId
    • sizeBytes
    • tenantId
    • type
    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:

    • description
    • name
    • sizeBytes
    • type
    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.
    orderBy 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:

    • description
    • lastUpdateTime
    • name
    • sizeBytes
    • type
    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:

    • categoryExtIds
    • clusterLocationExtIds
    • createTime
    • description
    • extId
    • lastUpdateTime
    • links
    • name
    • ownerExtId
    • sizeBytes
    • tenantId
    • type
    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:

    • description
    • name
    • sizeBytes
    • type
    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.
    orderBy 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:

    • description
    • lastUpdateTime
    • name
    • sizeBytes
    • type
    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:

    • categoryExtIds
    • clusterLocationExtIds
    • createTime
    • description
    • extId
    • lastUpdateTime
    • links
    • name
    • ownerExtId
    • sizeBytes
    • tenantId
    • type
    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:

    • description
    • name
    • sizeBytes
    • type
    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:

    • description
    • lastUpdateTime
    • name
    • sizeBytes
    • type
    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:

    • categoryExtIds
    • clusterLocationExtIds
    • createTime
    • description
    • extId
    • lastUpdateTime
    • links
    • name
    • ownerExtId
    • sizeBytes
    • tenantId
    • type
    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:

    • description
    • name
    • sizeBytes
    • type
    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.
    orderBy 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:

    • description
    • lastUpdateTime
    • name
    • sizeBytes
    • type
    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:

    • categoryExtIds
    • clusterLocationExtIds
    • createTime
    • description
    • extId
    • lastUpdateTime
    • links
    • name
    • ownerExtId
    • sizeBytes
    • tenantId
    • type

    getImagesV2 Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Images List<PiersKarsenbarg.Nutanix.Outputs.GetImagesV2Image>
    List of all images
    Filter string
    Limit int
    OrderBy string
    Page int
    Select string
    Id string
    The provider-assigned unique ID for this managed resource.
    Images []GetImagesV2Image
    List of all images
    Filter string
    Limit int
    OrderBy string
    Page int
    Select string
    id String
    The provider-assigned unique ID for this managed resource.
    images List<GetImagesV2Image>
    List of all images
    filter String
    limit Integer
    orderBy String
    page Integer
    select String
    id string
    The provider-assigned unique ID for this managed resource.
    images GetImagesV2Image[]
    List of all images
    filter string
    limit number
    orderBy string
    page number
    select string
    id str
    The provider-assigned unique ID for this managed resource.
    images Sequence[GetImagesV2Image]
    List of all images
    filter str
    limit int
    order_by str
    page int
    select str
    id String
    The provider-assigned unique ID for this managed resource.
    images List<Property Map>
    List of all images
    filter String
    limit Number
    orderBy String
    page Number
    select String

    Supporting Types

    GetImagesV2Image

    GetImagesV2ImageChecksum

    HexDigest string
    HexDigest string
    hexDigest String
    hexDigest string
    hexDigest String

    GetImagesV2ImagePlacementPolicyStatus

    GetImagesV2ImageSource

    GetImagesV2ImageSourceObjectLiteSource

    Key string
    Key string
    key String
    key string
    key str
    key String

    GetImagesV2ImageSourceUrlSource

    GetImagesV2ImageSourceUrlSourceBasicAuth

    Password string
    Username string
    Password string
    Username string
    password String
    username String
    password string
    username string
    password String
    username String

    GetImagesV2ImageSourceVmDiskSource

    ExtId string
    ExtId string
    extId String
    extId string
    ext_id str
    extId 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.8.0 published on Sunday, May 11, 2025 by Piers Karsenbarg