OpenStack v5.0.0 published on Friday, Sep 27, 2024 by Pulumi
openstack.images.getImageIds
Explore with Pulumi AI
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:
- Container
Format string - The container format of the image.
- Disk
Format string - The disk format of the image.
- bool
- Whether or not the image is hidden from public list.
- Member
Status 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
. - Name
Regex string - The regular expressian of the name of the image.
Cannot be used simultaneously with
name
. Unlike filtering byname
thename_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. - 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 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 expressionsort = "name:asc,status"
sorts ascending by name and descending by status. - Tag string
- Search for images with a specific tag.
- 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".
- Container
Format string - The container format of the image.
- Disk
Format string - The disk format of the image.
- bool
- Whether or not the image is hidden from public list.
- Member
Status 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
. - Name
Regex string - The regular expressian of the name of the image.
Cannot be used simultaneously with
name
. Unlike filtering byname
thename_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. - 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 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 expressionsort = "name:asc,status"
sorts ascending by name and descending by status. - Tag string
- Search for images with a specific tag.
- []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 String - The container format of the image.
- disk
Format String - The disk format of the image.
- Boolean
- Whether or not the image is hidden from public list.
- member
Status 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
. - name
Regex String - The regular expressian of the name of the image.
Cannot be used simultaneously with
name
. Unlike filtering byname
thename_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. - size
Max Integer - The maximum size (in bytes) of the image to return.
- size
Min 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 expressionsort = "name:asc,status"
sorts ascending by name and descending by status. - tag String
- Search for images with a specific tag.
- 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".
- container
Format string - The container format of the image.
- disk
Format string - The disk format of the image.
- boolean
- Whether or not the image is hidden from public list.
- member
Status 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
. - name
Regex string - The regular expressian of the name of the image.
Cannot be used simultaneously with
name
. Unlike filtering byname
thename_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. - size
Max number - The maximum size (in bytes) of the image to return.
- size
Min 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 expressionsort = "name:asc,status"
sorts ascending by name and descending by status. - tag string
- Search for images with a specific tag.
- 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.
- 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 byname
thename_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 expressionsort = "name:asc,status"
sorts ascending by name and descending by status. - tag str
- Search for images with a specific tag.
- 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".
- container
Format String - The container format of the image.
- disk
Format String - The disk format of the image.
- Boolean
- Whether or not the image is hidden from public list.
- member
Status 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
. - name
Regex String - The regular expressian of the name of the image.
Cannot be used simultaneously with
name
. Unlike filtering byname
thename_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. - size
Max Number - The maximum size (in bytes) of the image to return.
- size
Min 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 expressionsort = "name:asc,status"
sorts ascending by name and descending by status. - tag String
- Search for images with a specific tag.
- 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
- Container
Format string - Disk
Format string - bool
- Member
Status string - Name string
- Name
Regex string - Owner string
- Properties Dictionary<string, string>
- Size
Max int - Size
Min int - Sort string
- Tag string
- List<string>
- Visibility string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Region string
- Container
Format string - Disk
Format string - bool
- Member
Status string - Name string
- Name
Regex string - Owner string
- Properties map[string]string
- Size
Max int - Size
Min int - Sort string
- Tag string
- []string
- Visibility string
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- region String
- container
Format String - disk
Format String - Boolean
- member
Status String - name String
- name
Regex String - owner String
- properties Map<String,String>
- size
Max Integer - size
Min Integer - sort String
- tag String
- List<String>
- visibility String
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- region string
- container
Format string - disk
Format string - boolean
- member
Status string - name string
- name
Regex string - owner string
- properties {[key: string]: string}
- size
Max number - size
Min number - sort string
- tag string
- 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 - 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
- Sequence[str]
- visibility str
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- region String
- container
Format String - disk
Format String - Boolean
- member
Status String - name String
- name
Regex String - owner String
- properties Map<String>
- size
Max Number - size
Min Number - sort String
- tag String
- 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.