1. Packages
  2. Openstack Provider
  3. API Docs
  4. images
  5. getImageIds
OpenStack v5.0.3 published on Wednesday, Feb 12, 2025 by Pulumi

openstack.images.getImageIds

Explore with Pulumi AI

OpenStack v5.0.3 published on Wednesday, Feb 12, 2025 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",
    },
});
Copy
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",
    })
Copy
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
	})
}
Copy
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" },
        },
    });

});
Copy
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());

    }
}
Copy
variables:
  images:
    fn::invoke:
      function: openstack:images:getImageIds
      arguments:
        nameRegex: ^Ubuntu 16\.04.*-amd64
        sort: updated_at
        properties:
          key: value
Copy

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>
Copy
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]
Copy
func GetImageIds(ctx *Context, args *GetImageIdsArgs, opts ...InvokeOption) (*GetImageIdsResult, error)
func GetImageIdsOutput(ctx *Context, args *GetImageIdsOutputArgs, opts ...InvokeOption) GetImageIdsResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetImageIdsResult> getImageIds(GetImageIdsArgs args, InvokeOptions options)
public static Output<GetImageIdsResult> getImageIds(GetImageIdsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: openstack:images/getImageIds:getImageIds
  arguments:
    # arguments dictionary
Copy

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 Changes to this property will trigger replacement. string
The status of the image. Must be one of "accepted", "pending", "rejected", or "all".
Name Changes to this property will trigger replacement. string
The name of the image. Cannot be used simultaneously with name_regex.
NameRegex Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The owner (UUID) of the image.
Properties Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. int
The maximum size (in bytes) of the image to return.
SizeMin Changes to this property will trigger replacement. int
The minimum size (in bytes) of the image to return.
Sort Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The status of the image. Must be one of "accepted", "pending", "rejected", or "all".
Name Changes to this property will trigger replacement. string
The name of the image. Cannot be used simultaneously with name_regex.
NameRegex Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The owner (UUID) of the image.
Properties Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. int
The maximum size (in bytes) of the image to return.
SizeMin Changes to this property will trigger replacement. int
The minimum size (in bytes) of the image to return.
Sort Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
The status of the image. Must be one of "accepted", "pending", "rejected", or "all".
name Changes to this property will trigger replacement. String
The name of the image. Cannot be used simultaneously with name_regex.
nameRegex Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
The owner (UUID) of the image.
properties Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. Integer
The maximum size (in bytes) of the image to return.
sizeMin Changes to this property will trigger replacement. Integer
The minimum size (in bytes) of the image to return.
sort Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The status of the image. Must be one of "accepted", "pending", "rejected", or "all".
name Changes to this property will trigger replacement. string
The name of the image. Cannot be used simultaneously with name_regex.
nameRegex Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The owner (UUID) of the image.
properties Changes to this property will trigger replacement. {[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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. number
The maximum size (in bytes) of the image to return.
sizeMin Changes to this property will trigger replacement. number
The minimum size (in bytes) of the image to return.
sort Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. str
The status of the image. Must be one of "accepted", "pending", "rejected", or "all".
name Changes to this property will trigger replacement. str
The name of the image. Cannot be used simultaneously with name_regex.
name_regex Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. str
The owner (UUID) of the image.
properties Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. int
The maximum size (in bytes) of the image to return.
size_min Changes to this property will trigger replacement. int
The minimum size (in bytes) of the image to return.
sort Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
The status of the image. Must be one of "accepted", "pending", "rejected", or "all".
name Changes to this property will trigger replacement. String
The name of the image. Cannot be used simultaneously with name_regex.
nameRegex Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
The owner (UUID) of the image.
properties Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. Number
The maximum size (in bytes) of the image to return.
sizeMin Changes to this property will trigger replacement. Number
The minimum size (in bytes) of the image to return.
sort Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 v5.0.3 published on Wednesday, Feb 12, 2025 by Pulumi