-
Notifications
You must be signed in to change notification settings - Fork 8
/
getImage.ts
179 lines (175 loc) · 5.03 KB
/
getImage.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
import * as pulumi from "@pulumi/pulumi";
import * as utilities from "../utilities";
/**
* Use this data source to get the ID of an available OpenStack image.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as openstack from "@pulumi/openstack";
*
* const ubuntu = pulumi.output(openstack.images.getImage({
* mostRecent: true,
* name: "Ubuntu 16.04",
* properties: {
* key: "value",
* },
* }));
* ```
*/
export function getImage(args?: GetImageArgs, opts?: pulumi.InvokeOptions): Promise<GetImageResult> {
args = args || {};
return pulumi.runtime.invoke("openstack:images/getImage:getImage", {
"memberStatus": args.memberStatus,
"mostRecent": args.mostRecent,
"name": args.name,
"owner": args.owner,
"properties": args.properties,
"region": args.region,
"sizeMax": args.sizeMax,
"sizeMin": args.sizeMin,
"sortDirection": args.sortDirection,
"sortKey": args.sortKey,
"tag": args.tag,
"visibility": args.visibility,
}, opts);
}
/**
* A collection of arguments for invoking getImage.
*/
export interface GetImageArgs {
/**
* The status of the image. Must be one of
* "accepted", "pending", "rejected", or "all".
*/
readonly memberStatus?: string;
/**
* If more than one result is returned, use the most
* recent image.
*/
readonly mostRecent?: boolean;
/**
* The name of the image.
*/
readonly name?: string;
/**
* The owner (UUID) of the image.
*/
readonly owner?: string;
/**
* a map of key/value pairs to match an image with.
* All specified properties must be matched.
*/
readonly properties?: {[key: string]: any};
/**
* 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.
*/
readonly region?: string;
/**
* The maximum size (in bytes) of the image to return.
*/
readonly sizeMax?: number;
/**
* The minimum size (in bytes) of the image to return.
*/
readonly sizeMin?: number;
/**
* Order the results in either `asc` or `desc`.
*/
readonly sortDirection?: string;
/**
* Sort images based on a certain key. Defaults to `name`.
*/
readonly sortKey?: string;
/**
* Search for images with a specific tag.
*/
readonly tag?: string;
/**
* The visibility of the image. Must be one of
* "public", "private", "community", or "shared". Defaults to "private".
*/
readonly visibility?: string;
}
/**
* A collection of values returned by getImage.
*/
export interface GetImageResult {
/**
* The checksum of the data associated with the image.
*/
readonly checksum: string;
readonly containerFormat: string;
/**
* The date the image was created.
* * `container_format`: The format of the image's container.
* * `disk_format`: The format of the image's disk.
*/
readonly createdAt: string;
readonly diskFormat: string;
/**
* the trailing path after the glance endpoint that represent the
* location of the image or the path to retrieve it.
*/
readonly file: string;
readonly memberStatus?: string;
/**
* 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.
*/
readonly metadata: {[key: string]: any};
/**
* The minimum amount of disk space required to use the image.
*/
readonly minDiskGb: number;
/**
* The minimum amount of ram required to use the image.
*/
readonly minRamMb: number;
readonly mostRecent?: boolean;
readonly name?: string;
readonly owner?: string;
/**
* Freeform information about the image.
*/
readonly properties?: {[key: string]: any};
/**
* Whether or not the image is protected.
*/
readonly protected: boolean;
readonly region: string;
/**
* The path to the JSON-schema that represent
* the image or image
*/
readonly schema: string;
/**
* The size of the image (in bytes).
*/
readonly sizeBytes: number;
readonly sizeMax?: number;
readonly sizeMin?: number;
readonly sortDirection?: string;
readonly sortKey?: string;
readonly tag?: string;
/**
* The tags list of the image.
*/
readonly tags: string[];
/**
* The date the image was last updated.
*/
readonly updatedAt: string;
readonly visibility?: string;
/**
* id is the provider-assigned unique ID for this managed resource.
*/
readonly id: string;
}