1. Packages
  2. OpenStack
  3. API Docs
  4. images
  5. getImageIds
OpenStack v3.15.2 published on Friday, Mar 29, 2024 by Pulumi

openstack.images.getImageIds

Explore with Pulumi AI

openstack logo
OpenStack v3.15.2 published on Friday, Mar 29, 2024 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",
        properties: {
            key: "value",
        },
        sort: "updated_at",
    });
    
    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")
    
    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
    	})
    }
    
    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",
            Properties = 
            {
                { "key", "value" },
            },
            Sort = "updated_at",
        });
    
    });
    
    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());
    
        }
    }
    
    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,
                      tags: Optional[Sequence[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,
                      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:

    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.
    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".
    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.
    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".
    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.
    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".
    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.
    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".
    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.
    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".
    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.
    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".

    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
    Tags List<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
    Tags []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
    tags List<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
    tags 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
    tags Sequence[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
    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 logo
    OpenStack v3.15.2 published on Friday, Mar 29, 2024 by Pulumi