OpenStack v4.0.0 published on Tuesday, May 21, 2024 by Pulumi
openstack.images.getImage
Explore with Pulumi AI
Use this data source to get the ID of an available OpenStack image.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";
const ubuntu = openstack.images.getImage({
name: "Ubuntu 16.04",
mostRecent: true,
properties: {
key: "value",
},
});
import pulumi
import pulumi_openstack as openstack
ubuntu = openstack.images.get_image(name="Ubuntu 16.04",
most_recent=True,
properties={
"key": "value",
})
package main
import (
"github.com/pulumi/pulumi-openstack/sdk/v4/go/openstack/images"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := images.LookupImage(ctx, &images.LookupImageArgs{
Name: pulumi.StringRef("Ubuntu 16.04"),
MostRecent: pulumi.BoolRef(true),
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 ubuntu = OpenStack.Images.GetImage.Invoke(new()
{
Name = "Ubuntu 16.04",
MostRecent = true,
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.GetImageArgs;
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 ubuntu = ImagesFunctions.getImage(GetImageArgs.builder()
.name("Ubuntu 16.04")
.mostRecent(true)
.properties(Map.of("key", "value"))
.build());
}
}
variables:
ubuntu:
fn::invoke:
Function: openstack:images:getImage
Arguments:
name: Ubuntu 16.04
mostRecent: true
properties:
key: value
Using getImage
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 getImage(args: GetImageArgs, opts?: InvokeOptions): Promise<GetImageResult>
function getImageOutput(args: GetImageOutputArgs, opts?: InvokeOptions): Output<GetImageResult>
def get_image(hidden: Optional[bool] = None,
member_status: Optional[str] = None,
most_recent: Optional[bool] = 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,
tag: Optional[str] = None,
tags: Optional[Sequence[str]] = None,
visibility: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetImageResult
def get_image_output(hidden: Optional[pulumi.Input[bool]] = None,
member_status: Optional[pulumi.Input[str]] = None,
most_recent: Optional[pulumi.Input[bool]] = 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,
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[GetImageResult]
func LookupImage(ctx *Context, args *LookupImageArgs, opts ...InvokeOption) (*LookupImageResult, error)
func LookupImageOutput(ctx *Context, args *LookupImageOutputArgs, opts ...InvokeOption) LookupImageResultOutput
> Note: This function is named LookupImage
in the Go SDK.
public static class GetImage
{
public static Task<GetImageResult> InvokeAsync(GetImageArgs args, InvokeOptions? opts = null)
public static Output<GetImageResult> Invoke(GetImageInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetImageResult> getImage(GetImageArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: openstack:images/getImage:getImage
arguments:
# arguments dictionary
The following arguments are supported:
- 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".
- Most
Recent bool - If more than one result is returned, use the most recent image.
- 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, 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. Filtering is applied if server responce contains at least 2 images. In case there is only one image theproperties
ignores. - 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".
- 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".
- Most
Recent bool - If more than one result is returned, use the most recent image.
- 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]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. Filtering is applied if server responce contains at least 2 images. In case there is only one image theproperties
ignores. - 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".
- 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".
- most
Recent Boolean - If more than one result is returned, use the most recent image.
- 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,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. Filtering is applied if server responce contains at least 2 images. In case there is only one image theproperties
ignores. - 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".
- 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".
- most
Recent boolean - If more than one result is returned, use the most recent image.
- 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]: 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. Filtering is applied if server responce contains at least 2 images. In case there is only one image theproperties
ignores. - 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".
- 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".
- most_
recent bool - If more than one result is returned, use the most recent image.
- 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, 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. Filtering is applied if server responce contains at least 2 images. In case there is only one image theproperties
ignores. - 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".
- 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".
- most
Recent Boolean - If more than one result is returned, use the most recent image.
- 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<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. Filtering is applied if server responce contains at least 2 images. In case there is only one image theproperties
ignores. - 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".
getImage Result
The following output properties are available:
- Checksum string
- The checksum of the data associated with the image.
- Container
Format string - The format of the image's container.
- Created
At string - The date the image was created.
- Disk
Format string - The format of the image's disk.
- File string
- the trailing path after the glance endpoint that represent the location of the image or the path to retrieve it.
- Id string
- The provider-assigned unique ID for this managed resource.
- Metadata Dictionary<string, object>
- The metadata associated with the image. Image metadata allow for meaningfully define the image properties and tags. See https://docs.openstack.org/glance/latest/user/metadefs-concepts.html.
- Min
Disk intGb - The minimum amount of disk space required to use the image.
- Min
Ram intMb - The minimum amount of ram required to use the image.
- Protected bool
- Whether or not the image is protected.
- Region string
- Schema string
- The path to the JSON-schema that represent the image or image
- Size
Bytes int - The size of the image (in bytes).
- List<string>
- The tags list of the image.
- Updated
At string - The date the image was last updated.
- bool
- Member
Status string - Most
Recent bool - Name string
- Name
Regex string - Owner string
- Properties Dictionary<string, object>
- Freeform information about the image.
- Size
Max int - Size
Min int - Sort string
- Tag string
- Visibility string
- Checksum string
- The checksum of the data associated with the image.
- Container
Format string - The format of the image's container.
- Created
At string - The date the image was created.
- Disk
Format string - The format of the image's disk.
- File string
- the trailing path after the glance endpoint that represent the location of the image or the path to retrieve it.
- Id string
- The provider-assigned unique ID for this managed resource.
- Metadata map[string]interface{}
- The metadata associated with the image. Image metadata allow for meaningfully define the image properties and tags. See https://docs.openstack.org/glance/latest/user/metadefs-concepts.html.
- Min
Disk intGb - The minimum amount of disk space required to use the image.
- Min
Ram intMb - The minimum amount of ram required to use the image.
- Protected bool
- Whether or not the image is protected.
- Region string
- Schema string
- The path to the JSON-schema that represent the image or image
- Size
Bytes int - The size of the image (in bytes).
- []string
- The tags list of the image.
- Updated
At string - The date the image was last updated.
- bool
- Member
Status string - Most
Recent bool - Name string
- Name
Regex string - Owner string
- Properties map[string]interface{}
- Freeform information about the image.
- Size
Max int - Size
Min int - Sort string
- Tag string
- Visibility string
- checksum String
- The checksum of the data associated with the image.
- container
Format String - The format of the image's container.
- created
At String - The date the image was created.
- disk
Format String - The format of the image's disk.
- file String
- the trailing path after the glance endpoint that represent the location of the image or the path to retrieve it.
- id String
- The provider-assigned unique ID for this managed resource.
- metadata Map<String,Object>
- The metadata associated with the image. Image metadata allow for meaningfully define the image properties and tags. See https://docs.openstack.org/glance/latest/user/metadefs-concepts.html.
- min
Disk IntegerGb - The minimum amount of disk space required to use the image.
- min
Ram IntegerMb - The minimum amount of ram required to use the image.
- protected_ Boolean
- Whether or not the image is protected.
- region String
- schema String
- The path to the JSON-schema that represent the image or image
- size
Bytes Integer - The size of the image (in bytes).
- List<String>
- The tags list of the image.
- updated
At String - The date the image was last updated.
- Boolean
- member
Status String - most
Recent Boolean - name String
- name
Regex String - owner String
- properties Map<String,Object>
- Freeform information about the image.
- size
Max Integer - size
Min Integer - sort String
- tag String
- visibility String
- checksum string
- The checksum of the data associated with the image.
- container
Format string - The format of the image's container.
- created
At string - The date the image was created.
- disk
Format string - The format of the image's disk.
- file string
- the trailing path after the glance endpoint that represent the location of the image or the path to retrieve it.
- id string
- The provider-assigned unique ID for this managed resource.
- metadata {[key: string]: any}
- The metadata associated with the image. Image metadata allow for meaningfully define the image properties and tags. See https://docs.openstack.org/glance/latest/user/metadefs-concepts.html.
- min
Disk numberGb - The minimum amount of disk space required to use the image.
- min
Ram numberMb - The minimum amount of ram required to use the image.
- protected boolean
- Whether or not the image is protected.
- region string
- schema string
- The path to the JSON-schema that represent the image or image
- size
Bytes number - The size of the image (in bytes).
- string[]
- The tags list of the image.
- updated
At string - The date the image was last updated.
- boolean
- member
Status string - most
Recent boolean - name string
- name
Regex string - owner string
- properties {[key: string]: any}
- Freeform information about the image.
- size
Max number - size
Min number - sort string
- tag string
- visibility string
- checksum str
- The checksum of the data associated with the image.
- container_
format str - The format of the image's container.
- created_
at str - The date the image was created.
- disk_
format str - The format of the image's disk.
- file str
- the trailing path after the glance endpoint that represent the location of the image or the path to retrieve it.
- id str
- The provider-assigned unique ID for this managed resource.
- metadata Mapping[str, Any]
- The metadata associated with the image. Image metadata allow for meaningfully define the image properties and tags. See https://docs.openstack.org/glance/latest/user/metadefs-concepts.html.
- min_
disk_ intgb - The minimum amount of disk space required to use the image.
- min_
ram_ intmb - The minimum amount of ram required to use the image.
- protected bool
- Whether or not the image is protected.
- region str
- schema str
- The path to the JSON-schema that represent the image or image
- size_
bytes int - The size of the image (in bytes).
- Sequence[str]
- The tags list of the image.
- updated_
at str - The date the image was last updated.
- bool
- member_
status str - most_
recent bool - name str
- name_
regex str - owner str
- properties Mapping[str, Any]
- Freeform information about the image.
- size_
max int - size_
min int - sort str
- tag str
- visibility str
- checksum String
- The checksum of the data associated with the image.
- container
Format String - The format of the image's container.
- created
At String - The date the image was created.
- disk
Format String - The format of the image's disk.
- file String
- the trailing path after the glance endpoint that represent the location of the image or the path to retrieve it.
- id String
- The provider-assigned unique ID for this managed resource.
- metadata Map<Any>
- The metadata associated with the image. Image metadata allow for meaningfully define the image properties and tags. See https://docs.openstack.org/glance/latest/user/metadefs-concepts.html.
- min
Disk NumberGb - The minimum amount of disk space required to use the image.
- min
Ram NumberMb - The minimum amount of ram required to use the image.
- protected Boolean
- Whether or not the image is protected.
- region String
- schema String
- The path to the JSON-schema that represent the image or image
- size
Bytes Number - The size of the image (in bytes).
- List<String>
- The tags list of the image.
- updated
At String - The date the image was last updated.
- Boolean
- member
Status String - most
Recent Boolean - name String
- name
Regex String - owner String
- properties Map<Any>
- Freeform information about the image.
- size
Max Number - size
Min Number - sort String
- tag 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.