1. Packages
  2. OpenStack
  3. API Docs
  4. images
  5. getImage
OpenStack v4.0.0 published on Tuesday, May 21, 2024 by Pulumi

openstack.images.getImage

Explore with Pulumi AI

openstack logo
OpenStack v4.0.0 published on Tuesday, May 21, 2024 by Pulumi

    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:

    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".
    MostRecent 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.
    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. Filtering is applied if server responce contains at least 2 images. In case there is only one image the properties 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.
    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".
    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".
    MostRecent 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.
    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. Filtering is applied if server responce contains at least 2 images. In case there is only one image the properties 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.
    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".
    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".
    mostRecent 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.
    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. Filtering is applied if server responce contains at least 2 images. In case there is only one image the properties 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.
    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".
    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".
    mostRecent 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.
    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. Filtering is applied if server responce contains at least 2 images. In case there is only one image the properties 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.
    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".
    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".
    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 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. Filtering is applied if server responce contains at least 2 images. In case there is only one image the properties 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 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".
    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".
    mostRecent 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.
    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. Filtering is applied if server responce contains at least 2 images. In case there is only one image the properties 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.
    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".

    getImage Result

    The following output properties are available:

    Checksum string
    The checksum of the data associated with the image.
    ContainerFormat string
    The format of the image's container.
    CreatedAt string
    The date the image was created.
    DiskFormat 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.
    MinDiskGb int
    The minimum amount of disk space required to use the image.
    MinRamMb int
    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
    SizeBytes int
    The size of the image (in bytes).
    Tags List<string>
    The tags list of the image.
    UpdatedAt string
    The date the image was last updated.
    Hidden bool
    MemberStatus string
    MostRecent bool
    Name string
    NameRegex string
    Owner string
    Properties Dictionary<string, object>
    Freeform information about the image.
    SizeMax int
    SizeMin int
    Sort string
    Tag string
    Visibility string
    Checksum string
    The checksum of the data associated with the image.
    ContainerFormat string
    The format of the image's container.
    CreatedAt string
    The date the image was created.
    DiskFormat 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.
    MinDiskGb int
    The minimum amount of disk space required to use the image.
    MinRamMb int
    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
    SizeBytes int
    The size of the image (in bytes).
    Tags []string
    The tags list of the image.
    UpdatedAt string
    The date the image was last updated.
    Hidden bool
    MemberStatus string
    MostRecent bool
    Name string
    NameRegex string
    Owner string
    Properties map[string]interface{}
    Freeform information about the image.
    SizeMax int
    SizeMin int
    Sort string
    Tag string
    Visibility string
    checksum String
    The checksum of the data associated with the image.
    containerFormat String
    The format of the image's container.
    createdAt String
    The date the image was created.
    diskFormat 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.
    minDiskGb Integer
    The minimum amount of disk space required to use the image.
    minRamMb Integer
    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
    sizeBytes Integer
    The size of the image (in bytes).
    tags List<String>
    The tags list of the image.
    updatedAt String
    The date the image was last updated.
    hidden Boolean
    memberStatus String
    mostRecent Boolean
    name String
    nameRegex String
    owner String
    properties Map<String,Object>
    Freeform information about the image.
    sizeMax Integer
    sizeMin Integer
    sort String
    tag String
    visibility String
    checksum string
    The checksum of the data associated with the image.
    containerFormat string
    The format of the image's container.
    createdAt string
    The date the image was created.
    diskFormat 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.
    minDiskGb number
    The minimum amount of disk space required to use the image.
    minRamMb number
    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
    sizeBytes number
    The size of the image (in bytes).
    tags string[]
    The tags list of the image.
    updatedAt string
    The date the image was last updated.
    hidden boolean
    memberStatus string
    mostRecent boolean
    name string
    nameRegex string
    owner string
    properties {[key: string]: any}
    Freeform information about the image.
    sizeMax number
    sizeMin 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_gb int
    The minimum amount of disk space required to use the image.
    min_ram_mb int
    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).
    tags Sequence[str]
    The tags list of the image.
    updated_at str
    The date the image was last updated.
    hidden 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.
    containerFormat String
    The format of the image's container.
    createdAt String
    The date the image was created.
    diskFormat 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.
    minDiskGb Number
    The minimum amount of disk space required to use the image.
    minRamMb Number
    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
    sizeBytes Number
    The size of the image (in bytes).
    tags List<String>
    The tags list of the image.
    updatedAt String
    The date the image was last updated.
    hidden Boolean
    memberStatus String
    mostRecent Boolean
    name String
    nameRegex String
    owner String
    properties Map<Any>
    Freeform information about the image.
    sizeMax Number
    sizeMin 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.
    openstack logo
    OpenStack v4.0.0 published on Tuesday, May 21, 2024 by Pulumi