OpenStack

v3.9.0 published on Thursday, Aug 4, 2022 by Pulumi

getImageIds

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

Example Usage

using Pulumi;
using OpenStack = Pulumi.OpenStack;

class MyStack : Stack
{
    public MyStack()
    {
        var images = Output.Create(OpenStack.Images.GetImageIds.InvokeAsync(new OpenStack.Images.GetImageIdsArgs
        {
            NameRegex = "^Ubuntu 16\\.04.*-amd64",
            Properties = 
            {
                { "key", "value" },
            },
            Sort = "updated_at",
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-openstack/sdk/v3/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"),
			Properties: map[string]interface{}{
				"key": "value",
			},
			Sort: pulumi.StringRef("updated_at"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
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")
            .properties(Map.of("key", "value"))
            .sort("updated_at")
            .build());

    }
}
import pulumi
import pulumi_openstack as openstack

images = openstack.images.get_image_ids(name_regex="^Ubuntu 16\\.04.*-amd64",
    properties={
        "key": "value",
    },
    sort="updated_at")
import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";

const images = pulumi.output(openstack.images.getImageIds({
    nameRegex: "^Ubuntu 16\\.04.*-amd64",
    properties: {
        key: "value",
    },
    sort: "updated_at",
}));
variables:
  images:
    Fn::Invoke:
      Function: openstack:images:getImageIds
      Arguments:
        nameRegex: ^Ubuntu 16\.04.*-amd64
        properties:
          key: value
        sort: updated_at

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(member_status: Optional[str] = None,
                  name: Optional[str] = None,
                  name_regex: Optional[str] = None,
                  owner: Optional[str] = None,
                  properties: Optional[Mapping[str, Any]] = None,
                  region: Optional[str] = None,
                  size_max: Optional[int] = None,
                  size_min: Optional[int] = None,
                  sort: Optional[str] = None,
                  sort_direction: Optional[str] = None,
                  sort_key: Optional[str] = None,
                  tag: Optional[str] = None,
                  visibility: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetImageIdsResult
def get_image_ids_output(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, Any]]] = 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,
                  sort_direction: Optional[pulumi.Input[str]] = None,
                  sort_key: Optional[pulumi.Input[str]] = None,
                  tag: Optional[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:

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, object>

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. sort cannot be used simultaneously with sort_key. If both are present in a configuration then only sort will be used.

SortDirection string

Order the results in either asc or desc. Can be applied only with sort_key. Defaults to asc

Deprecated:

Use option 'sort' instead.

SortKey string

Sort images based on a certain key. Defaults to name. sort_key cannot be used simultaneously with sort. If both are present in a configuration then only sort will be used.

Deprecated:

Use option 'sort' instead.

Tag string

Search for images with a specific tag.

Visibility string

The visibility of the image. Must be one of "public", "private", "community", or "shared". Defaults to "private".

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]interface{}

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. sort cannot be used simultaneously with sort_key. If both are present in a configuration then only sort will be used.

SortDirection string

Order the results in either asc or desc. Can be applied only with sort_key. Defaults to asc

Deprecated:

Use option 'sort' instead.

SortKey string

Sort images based on a certain key. Defaults to name. sort_key cannot be used simultaneously with sort. If both are present in a configuration then only sort will be used.

Deprecated:

Use option 'sort' instead.

Tag string

Search for images with a specific tag.

Visibility string

The visibility of the image. Must be one of "public", "private", "community", or "shared". Defaults to "private".

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,Object>

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. sort cannot be used simultaneously with sort_key. If both are present in a configuration then only sort will be used.

sortDirection String

Order the results in either asc or desc. Can be applied only with sort_key. Defaults to asc

Deprecated:

Use option 'sort' instead.

sortKey String

Sort images based on a certain key. Defaults to name. sort_key cannot be used simultaneously with sort. If both are present in a configuration then only sort will be used.

Deprecated:

Use option 'sort' instead.

tag String

Search for images with a specific tag.

visibility String

The visibility of the image. Must be one of "public", "private", "community", or "shared". Defaults to "private".

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]: any}

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. sort cannot be used simultaneously with sort_key. If both are present in a configuration then only sort will be used.

sortDirection string

Order the results in either asc or desc. Can be applied only with sort_key. Defaults to asc

Deprecated:

Use option 'sort' instead.

sortKey string

Sort images based on a certain key. Defaults to name. sort_key cannot be used simultaneously with sort. If both are present in a configuration then only sort will be used.

Deprecated:

Use option 'sort' instead.

tag string

Search for images with a specific tag.

visibility string

The visibility of the image. Must be one of "public", "private", "community", or "shared". Defaults to "private".

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, Any]

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. sort cannot be used simultaneously with sort_key. If both are present in a configuration then only sort will be used.

sort_direction str

Order the results in either asc or desc. Can be applied only with sort_key. Defaults to asc

Deprecated:

Use option 'sort' instead.

sort_key str

Sort images based on a certain key. Defaults to name. sort_key cannot be used simultaneously with sort. If both are present in a configuration then only sort will be used.

Deprecated:

Use option 'sort' instead.

tag str

Search for images with a specific tag.

visibility str

The visibility of the image. Must be one of "public", "private", "community", or "shared". Defaults to "private".

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<Any>

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. sort cannot be used simultaneously with sort_key. If both are present in a configuration then only sort will be used.

sortDirection String

Order the results in either asc or desc. Can be applied only with sort_key. Defaults to asc

Deprecated:

Use option 'sort' instead.

sortKey String

Sort images based on a certain key. Defaults to name. sort_key cannot be used simultaneously with sort. If both are present in a configuration then only sort will be used.

Deprecated:

Use option 'sort' instead.

tag String

Search for images with a specific tag.

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
MemberStatus string
Name string
NameRegex string
Owner string
Properties Dictionary<string, object>
SizeMax int
SizeMin int
Sort string
SortDirection string

Deprecated:

Use option 'sort' instead.

SortKey string

Deprecated:

Use option 'sort' instead.

Tag string
Visibility string
Id string

The provider-assigned unique ID for this managed resource.

Ids []string
Region string
MemberStatus string
Name string
NameRegex string
Owner string
Properties map[string]interface{}
SizeMax int
SizeMin int
Sort string
SortDirection string

Deprecated:

Use option 'sort' instead.

SortKey string

Deprecated:

Use option 'sort' instead.

Tag string
Visibility string
id String

The provider-assigned unique ID for this managed resource.

ids List<String>
region String
memberStatus String
name String
nameRegex String
owner String
properties Map<String,Object>
sizeMax Integer
sizeMin Integer
sort String
sortDirection String

Deprecated:

Use option 'sort' instead.

sortKey String

Deprecated:

Use option 'sort' instead.

tag String
visibility String
id string

The provider-assigned unique ID for this managed resource.

ids string[]
region string
memberStatus string
name string
nameRegex string
owner string
properties {[key: string]: any}
sizeMax number
sizeMin number
sort string
sortDirection string

Deprecated:

Use option 'sort' instead.

sortKey string

Deprecated:

Use option 'sort' instead.

tag string
visibility string
id str

The provider-assigned unique ID for this managed resource.

ids Sequence[str]
region str
member_status str
name str
name_regex str
owner str
properties Mapping[str, Any]
size_max int
size_min int
sort str
sort_direction str

Deprecated:

Use option 'sort' instead.

sort_key str

Deprecated:

Use option 'sort' instead.

tag str
visibility str
id String

The provider-assigned unique ID for this managed resource.

ids List<String>
region String
memberStatus String
name String
nameRegex String
owner String
properties Map<Any>
sizeMax Number
sizeMin Number
sort String
sortDirection String

Deprecated:

Use option 'sort' instead.

sortKey String

Deprecated:

Use option 'sort' instead.

tag String
visibility String

Package Details

Repository
https://github.com/pulumi/pulumi-openstack
License
Apache-2.0
Notes

This Pulumi package is based on the openstack Terraform Provider.