1. Packages
  2. Openstack Provider
  3. API Docs
  4. images
  5. getImageIds
OpenStack v5.0.0 published on Friday, Sep 27, 2024 by Pulumi

openstack.images.getImageIds

Explore with Pulumi AI

openstack logo
OpenStack v5.0.0 published on Friday, Sep 27, 2024 by Pulumi

    Use this data source to get a list of Openstack Image IDs matching the specified criteria.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as openstack from "@pulumi/openstack";
    
    const images = openstack.images.getImageIds({
        nameRegex: "^Ubuntu 16\\.04.*-amd64",
        sort: "updated_at",
        properties: {
            key: "value",
        },
    });
    
    import pulumi
    import pulumi_openstack as openstack
    
    images = openstack.images.get_image_ids(name_regex="^Ubuntu 16\\.04.*-amd64",
        sort="updated_at",
        properties={
            "key": "value",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-openstack/sdk/v5/go/openstack/images"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := images.GetImageIds(ctx, &images.GetImageIdsArgs{
    			NameRegex: pulumi.StringRef("^Ubuntu 16\\.04.*-amd64"),
    			Sort:      pulumi.StringRef("updated_at"),
    			Properties: map[string]interface{}{
    				"key": "value",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using OpenStack = Pulumi.OpenStack;
    
    return await Deployment.RunAsync(() => 
    {
        var images = OpenStack.Images.GetImageIds.Invoke(new()
        {
            NameRegex = "^Ubuntu 16\\.04.*-amd64",
            Sort = "updated_at",
            Properties = 
            {
                { "key", "value" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.openstack.images.ImagesFunctions;
    import com.pulumi.openstack.images.inputs.GetImageIdsArgs;
    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 images = ImagesFunctions.getImageIds(GetImageIdsArgs.builder()
                .nameRegex("^Ubuntu 16\\.04.*-amd64")
                .sort("updated_at")
                .properties(Map.of("key", "value"))
                .build());
    
        }
    }
    
    variables:
      images:
        fn::invoke:
          Function: openstack:images:getImageIds
          Arguments:
            nameRegex: ^Ubuntu 16\.04.*-amd64
            sort: updated_at
            properties:
              key: value
    

    Using getImageIds

    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 getImageIds(args: GetImageIdsArgs, opts?: InvokeOptions): Promise<GetImageIdsResult>
    function getImageIdsOutput(args: GetImageIdsOutputArgs, opts?: InvokeOptions): Output<GetImageIdsResult>
    def get_image_ids(container_format: Optional[str] = None,
                      disk_format: Optional[str] = None,
                      hidden: Optional[bool] = None,
                      member_status: Optional[str] = None,
                      name: Optional[str] = None,
                      name_regex: Optional[str] = None,
                      owner: Optional[str] = None,
                      properties: Optional[Mapping[str, str]] = None,
                      region: Optional[str] = None,
                      size_max: Optional[int] = None,
                      size_min: Optional[int] = None,
                      sort: Optional[str] = None,
                      tag: Optional[str] = None,
                      tags: Optional[Sequence[str]] = None,
                      visibility: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetImageIdsResult
    def get_image_ids_output(container_format: Optional[pulumi.Input[str]] = None,
                      disk_format: Optional[pulumi.Input[str]] = None,
                      hidden: Optional[pulumi.Input[bool]] = None,
                      member_status: Optional[pulumi.Input[str]] = None,
                      name: Optional[pulumi.Input[str]] = None,
                      name_regex: Optional[pulumi.Input[str]] = None,
                      owner: Optional[pulumi.Input[str]] = None,
                      properties: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                      region: Optional[pulumi.Input[str]] = None,
                      size_max: Optional[pulumi.Input[int]] = None,
                      size_min: Optional[pulumi.Input[int]] = None,
                      sort: Optional[pulumi.Input[str]] = None,
                      tag: Optional[pulumi.Input[str]] = None,
                      tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                      visibility: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetImageIdsResult]
    func GetImageIds(ctx *Context, args *GetImageIdsArgs, opts ...InvokeOption) (*GetImageIdsResult, error)
    func GetImageIdsOutput(ctx *Context, args *GetImageIdsOutputArgs, opts ...InvokeOption) GetImageIdsResultOutput

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

    public static class GetImageIds 
    {
        public static Task<GetImageIdsResult> InvokeAsync(GetImageIdsArgs args, InvokeOptions? opts = null)
        public static Output<GetImageIdsResult> Invoke(GetImageIdsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetImageIdsResult> getImageIds(GetImageIdsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: openstack:images/getImageIds:getImageIds
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ContainerFormat string
    The container format of the image.
    DiskFormat string
    The disk format of the image.
    Hidden bool
    Whether or not the image is hidden from public list.
    MemberStatus string
    The status of the image. Must be one of "accepted", "pending", "rejected", or "all".
    Name string
    The name of the image. Cannot be used simultaneously with name_regex.
    NameRegex string
    The regular expressian of the name of the image. Cannot be used simultaneously with name. Unlike filtering by name the name_regex filtering does by client on the result of OpenStack search query.
    Owner string
    The owner (UUID) of the image.
    Properties Dictionary<string, string>
    a map of key/value pairs to match an image with. All specified properties must be matched. Unlike other options filtering by properties does by client on the result of OpenStack search query.
    Region string
    The region in which to obtain the V2 Glance client. A Glance client is needed to create an Image that can be used with a compute instance. If omitted, the region argument of the provider is used.
    SizeMax int
    The maximum size (in bytes) of the image to return.
    SizeMin int
    The minimum size (in bytes) of the image to return.
    Sort string
    Sorts the response by one or more attribute and sort direction combinations. You can also set multiple sort keys and directions. Default direction is desc. Use the comma (,) character to separate multiple values. For example expression sort = "name:asc,status" sorts ascending by name and descending by status.
    Tag string
    Search for images with a specific tag.
    Tags List<string>
    A list of tags required to be set on the image (all specified tags must be in the images tag list for it to be matched).
    Visibility string
    The visibility of the image. Must be one of "public", "private", "community", or "shared". Defaults to "private".
    ContainerFormat string
    The container format of the image.
    DiskFormat string
    The disk format of the image.
    Hidden bool
    Whether or not the image is hidden from public list.
    MemberStatus string
    The status of the image. Must be one of "accepted", "pending", "rejected", or "all".
    Name string
    The name of the image. Cannot be used simultaneously with name_regex.
    NameRegex string
    The regular expressian of the name of the image. Cannot be used simultaneously with name. Unlike filtering by name the name_regex filtering does by client on the result of OpenStack search query.
    Owner string
    The owner (UUID) of the image.
    Properties map[string]string
    a map of key/value pairs to match an image with. All specified properties must be matched. Unlike other options filtering by properties does by client on the result of OpenStack search query.
    Region string
    The region in which to obtain the V2 Glance client. A Glance client is needed to create an Image that can be used with a compute instance. If omitted, the region argument of the provider is used.
    SizeMax int
    The maximum size (in bytes) of the image to return.
    SizeMin int
    The minimum size (in bytes) of the image to return.
    Sort string
    Sorts the response by one or more attribute and sort direction combinations. You can also set multiple sort keys and directions. Default direction is desc. Use the comma (,) character to separate multiple values. For example expression sort = "name:asc,status" sorts ascending by name and descending by status.
    Tag string
    Search for images with a specific tag.
    Tags []string
    A list of tags required to be set on the image (all specified tags must be in the images tag list for it to be matched).
    Visibility string
    The visibility of the image. Must be one of "public", "private", "community", or "shared". Defaults to "private".
    containerFormat String
    The container format of the image.
    diskFormat String
    The disk format of the image.
    hidden Boolean
    Whether or not the image is hidden from public list.
    memberStatus String
    The status of the image. Must be one of "accepted", "pending", "rejected", or "all".
    name String
    The name of the image. Cannot be used simultaneously with name_regex.
    nameRegex String
    The regular expressian of the name of the image. Cannot be used simultaneously with name. Unlike filtering by name the name_regex filtering does by client on the result of OpenStack search query.
    owner String
    The owner (UUID) of the image.
    properties Map<String,String>
    a map of key/value pairs to match an image with. All specified properties must be matched. Unlike other options filtering by properties does by client on the result of OpenStack search query.
    region String
    The region in which to obtain the V2 Glance client. A Glance client is needed to create an Image that can be used with a compute instance. If omitted, the region argument of the provider is used.
    sizeMax Integer
    The maximum size (in bytes) of the image to return.
    sizeMin Integer
    The minimum size (in bytes) of the image to return.
    sort String
    Sorts the response by one or more attribute and sort direction combinations. You can also set multiple sort keys and directions. Default direction is desc. Use the comma (,) character to separate multiple values. For example expression sort = "name:asc,status" sorts ascending by name and descending by status.
    tag String
    Search for images with a specific tag.
    tags List<String>
    A list of tags required to be set on the image (all specified tags must be in the images tag list for it to be matched).
    visibility String
    The visibility of the image. Must be one of "public", "private", "community", or "shared". Defaults to "private".
    containerFormat string
    The container format of the image.
    diskFormat string
    The disk format of the image.
    hidden boolean
    Whether or not the image is hidden from public list.
    memberStatus string
    The status of the image. Must be one of "accepted", "pending", "rejected", or "all".
    name string
    The name of the image. Cannot be used simultaneously with name_regex.
    nameRegex string
    The regular expressian of the name of the image. Cannot be used simultaneously with name. Unlike filtering by name the name_regex filtering does by client on the result of OpenStack search query.
    owner string
    The owner (UUID) of the image.
    properties {[key: string]: string}
    a map of key/value pairs to match an image with. All specified properties must be matched. Unlike other options filtering by properties does by client on the result of OpenStack search query.
    region string
    The region in which to obtain the V2 Glance client. A Glance client is needed to create an Image that can be used with a compute instance. If omitted, the region argument of the provider is used.
    sizeMax number
    The maximum size (in bytes) of the image to return.
    sizeMin number
    The minimum size (in bytes) of the image to return.
    sort string
    Sorts the response by one or more attribute and sort direction combinations. You can also set multiple sort keys and directions. Default direction is desc. Use the comma (,) character to separate multiple values. For example expression sort = "name:asc,status" sorts ascending by name and descending by status.
    tag string
    Search for images with a specific tag.
    tags string[]
    A list of tags required to be set on the image (all specified tags must be in the images tag list for it to be matched).
    visibility string
    The visibility of the image. Must be one of "public", "private", "community", or "shared". Defaults to "private".
    container_format str
    The container format of the image.
    disk_format str
    The disk format of the image.
    hidden bool
    Whether or not the image is hidden from public list.
    member_status str
    The status of the image. Must be one of "accepted", "pending", "rejected", or "all".
    name str
    The name of the image. Cannot be used simultaneously with name_regex.
    name_regex str
    The regular expressian of the name of the image. Cannot be used simultaneously with name. Unlike filtering by name the name_regex filtering does by client on the result of OpenStack search query.
    owner str
    The owner (UUID) of the image.
    properties Mapping[str, str]
    a map of key/value pairs to match an image with. All specified properties must be matched. Unlike other options filtering by properties does by client on the result of OpenStack search query.
    region str
    The region in which to obtain the V2 Glance client. A Glance client is needed to create an Image that can be used with a compute instance. If omitted, the region argument of the provider is used.
    size_max int
    The maximum size (in bytes) of the image to return.
    size_min int
    The minimum size (in bytes) of the image to return.
    sort str
    Sorts the response by one or more attribute and sort direction combinations. You can also set multiple sort keys and directions. Default direction is desc. Use the comma (,) character to separate multiple values. For example expression sort = "name:asc,status" sorts ascending by name and descending by status.
    tag str
    Search for images with a specific tag.
    tags Sequence[str]
    A list of tags required to be set on the image (all specified tags must be in the images tag list for it to be matched).
    visibility str
    The visibility of the image. Must be one of "public", "private", "community", or "shared". Defaults to "private".
    containerFormat String
    The container format of the image.
    diskFormat String
    The disk format of the image.
    hidden Boolean
    Whether or not the image is hidden from public list.
    memberStatus String
    The status of the image. Must be one of "accepted", "pending", "rejected", or "all".
    name String
    The name of the image. Cannot be used simultaneously with name_regex.
    nameRegex String
    The regular expressian of the name of the image. Cannot be used simultaneously with name. Unlike filtering by name the name_regex filtering does by client on the result of OpenStack search query.
    owner String
    The owner (UUID) of the image.
    properties Map<String>
    a map of key/value pairs to match an image with. All specified properties must be matched. Unlike other options filtering by properties does by client on the result of OpenStack search query.
    region String
    The region in which to obtain the V2 Glance client. A Glance client is needed to create an Image that can be used with a compute instance. If omitted, the region argument of the provider is used.
    sizeMax Number
    The maximum size (in bytes) of the image to return.
    sizeMin Number
    The minimum size (in bytes) of the image to return.
    sort String
    Sorts the response by one or more attribute and sort direction combinations. You can also set multiple sort keys and directions. Default direction is desc. Use the comma (,) character to separate multiple values. For example expression sort = "name:asc,status" sorts ascending by name and descending by status.
    tag String
    Search for images with a specific tag.
    tags List<String>
    A list of tags required to be set on the image (all specified tags must be in the images tag list for it to be matched).
    visibility String
    The visibility of the image. Must be one of "public", "private", "community", or "shared". Defaults to "private".

    getImageIds Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Region string
    ContainerFormat string
    DiskFormat string
    Hidden bool
    MemberStatus string
    Name string
    NameRegex string
    Owner string
    Properties Dictionary<string, string>
    SizeMax int
    SizeMin int
    Sort string
    Tag string
    Tags List<string>
    Visibility string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Region string
    ContainerFormat string
    DiskFormat string
    Hidden bool
    MemberStatus string
    Name string
    NameRegex string
    Owner string
    Properties map[string]string
    SizeMax int
    SizeMin int
    Sort string
    Tag string
    Tags []string
    Visibility string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    region String
    containerFormat String
    diskFormat String
    hidden Boolean
    memberStatus String
    name String
    nameRegex String
    owner String
    properties Map<String,String>
    sizeMax Integer
    sizeMin Integer
    sort String
    tag String
    tags List<String>
    visibility String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    region string
    containerFormat string
    diskFormat string
    hidden boolean
    memberStatus string
    name string
    nameRegex string
    owner string
    properties {[key: string]: string}
    sizeMax number
    sizeMin number
    sort string
    tag string
    tags string[]
    visibility string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    region str
    container_format str
    disk_format str
    hidden bool
    member_status str
    name str
    name_regex str
    owner str
    properties Mapping[str, str]
    size_max int
    size_min int
    sort str
    tag str
    tags Sequence[str]
    visibility str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    region String
    containerFormat String
    diskFormat String
    hidden Boolean
    memberStatus String
    name String
    nameRegex String
    owner String
    properties Map<String>
    sizeMax Number
    sizeMin Number
    sort String
    tag String
    tags List<String>
    visibility String

    Package Details

    Repository
    OpenStack pulumi/pulumi-openstack
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the openstack Terraform Provider.
    openstack logo
    OpenStack v5.0.0 published on Friday, Sep 27, 2024 by Pulumi