generated from pulumi/pulumi-tf-provider-boilerplate
/
getContainerImages.go
223 lines (197 loc) · 11 KB
/
getContainerImages.go
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package artifacts
import (
"context"
"reflect"
"github.com/pulumi/pulumi-oci/sdk/go/oci/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// This data source provides the list of Container Images in Oracle Cloud Infrastructure Artifacts service.
//
// List container images in a compartment.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-oci/sdk/go/oci/Artifacts"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := Artifacts.GetContainerImages(ctx, &artifacts.GetContainerImagesArgs{
// CompartmentId: compartmentId,
// CompartmentIdInSubtree: pulumi.BoolRef(containerImageCompartmentIdInSubtree),
// DisplayName: pulumi.StringRef(containerImageDisplayName),
// ImageId: pulumi.StringRef(testImage.Id),
// IsVersioned: pulumi.BoolRef(containerImageIsVersioned),
// RepositoryId: pulumi.StringRef(testRepository.Id),
// RepositoryName: pulumi.StringRef(testRepository.Name),
// State: pulumi.StringRef(containerImageState),
// Version: pulumi.StringRef(containerImageVersion),
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func GetContainerImages(ctx *pulumi.Context, args *GetContainerImagesArgs, opts ...pulumi.InvokeOption) (*GetContainerImagesResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetContainerImagesResult
err := ctx.Invoke("oci:Artifacts/getContainerImages:getContainerImages", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getContainerImages.
type GetContainerImagesArgs struct {
// The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment.
CompartmentId string `pulumi:"compartmentId"`
// When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are inspected depending on the the setting of `accessLevel`. Default is false. Can only be set to true when calling the API on the tenancy (root compartment).
CompartmentIdInSubtree *bool `pulumi:"compartmentIdInSubtree"`
// A filter to return only resources that match the given display name exactly.
DisplayName *string `pulumi:"displayName"`
Filters []GetContainerImagesFilter `pulumi:"filters"`
// A filter to return a container image summary only for the specified container image OCID.
ImageId *string `pulumi:"imageId"`
// A filter to return container images based on whether there are any associated versions.
IsVersioned *bool `pulumi:"isVersioned"`
// A filter to return container images only for the specified container repository OCID.
RepositoryId *string `pulumi:"repositoryId"`
// A filter to return container images or container image signatures that match the repository name. Example: `foo` or `foo*`
RepositoryName *string `pulumi:"repositoryName"`
// A filter to return only resources that match the given lifecycle state name exactly.
State *string `pulumi:"state"`
// A filter to return container images that match the version. Example: `foo` or `foo*`
Version *string `pulumi:"version"`
}
// A collection of values returned by getContainerImages.
type GetContainerImagesResult struct {
// The compartment OCID to which the container image belongs. Inferred from the container repository.
CompartmentId string `pulumi:"compartmentId"`
CompartmentIdInSubtree *bool `pulumi:"compartmentIdInSubtree"`
// The list of container_image_collection.
ContainerImageCollections []GetContainerImagesContainerImageCollection `pulumi:"containerImageCollections"`
// The repository name and the most recent version associated with the image. If there are no versions associated with the image, then last known version and digest are used instead. If the last known version is unavailable, then 'unknown' is used instead of the version. Example: `ubuntu:latest` or `ubuntu:latest@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2`
DisplayName *string `pulumi:"displayName"`
Filters []GetContainerImagesFilter `pulumi:"filters"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
ImageId *string `pulumi:"imageId"`
IsVersioned *bool `pulumi:"isVersioned"`
// The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container repository.
RepositoryId *string `pulumi:"repositoryId"`
// The container repository name.
RepositoryName *string `pulumi:"repositoryName"`
// The current state of the container image.
State *string `pulumi:"state"`
// The version name.
Version *string `pulumi:"version"`
}
func GetContainerImagesOutput(ctx *pulumi.Context, args GetContainerImagesOutputArgs, opts ...pulumi.InvokeOption) GetContainerImagesResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetContainerImagesResult, error) {
args := v.(GetContainerImagesArgs)
r, err := GetContainerImages(ctx, &args, opts...)
var s GetContainerImagesResult
if r != nil {
s = *r
}
return s, err
}).(GetContainerImagesResultOutput)
}
// A collection of arguments for invoking getContainerImages.
type GetContainerImagesOutputArgs struct {
// The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment.
CompartmentId pulumi.StringInput `pulumi:"compartmentId"`
// When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are inspected depending on the the setting of `accessLevel`. Default is false. Can only be set to true when calling the API on the tenancy (root compartment).
CompartmentIdInSubtree pulumi.BoolPtrInput `pulumi:"compartmentIdInSubtree"`
// A filter to return only resources that match the given display name exactly.
DisplayName pulumi.StringPtrInput `pulumi:"displayName"`
Filters GetContainerImagesFilterArrayInput `pulumi:"filters"`
// A filter to return a container image summary only for the specified container image OCID.
ImageId pulumi.StringPtrInput `pulumi:"imageId"`
// A filter to return container images based on whether there are any associated versions.
IsVersioned pulumi.BoolPtrInput `pulumi:"isVersioned"`
// A filter to return container images only for the specified container repository OCID.
RepositoryId pulumi.StringPtrInput `pulumi:"repositoryId"`
// A filter to return container images or container image signatures that match the repository name. Example: `foo` or `foo*`
RepositoryName pulumi.StringPtrInput `pulumi:"repositoryName"`
// A filter to return only resources that match the given lifecycle state name exactly.
State pulumi.StringPtrInput `pulumi:"state"`
// A filter to return container images that match the version. Example: `foo` or `foo*`
Version pulumi.StringPtrInput `pulumi:"version"`
}
func (GetContainerImagesOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetContainerImagesArgs)(nil)).Elem()
}
// A collection of values returned by getContainerImages.
type GetContainerImagesResultOutput struct{ *pulumi.OutputState }
func (GetContainerImagesResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetContainerImagesResult)(nil)).Elem()
}
func (o GetContainerImagesResultOutput) ToGetContainerImagesResultOutput() GetContainerImagesResultOutput {
return o
}
func (o GetContainerImagesResultOutput) ToGetContainerImagesResultOutputWithContext(ctx context.Context) GetContainerImagesResultOutput {
return o
}
// The compartment OCID to which the container image belongs. Inferred from the container repository.
func (o GetContainerImagesResultOutput) CompartmentId() pulumi.StringOutput {
return o.ApplyT(func(v GetContainerImagesResult) string { return v.CompartmentId }).(pulumi.StringOutput)
}
func (o GetContainerImagesResultOutput) CompartmentIdInSubtree() pulumi.BoolPtrOutput {
return o.ApplyT(func(v GetContainerImagesResult) *bool { return v.CompartmentIdInSubtree }).(pulumi.BoolPtrOutput)
}
// The list of container_image_collection.
func (o GetContainerImagesResultOutput) ContainerImageCollections() GetContainerImagesContainerImageCollectionArrayOutput {
return o.ApplyT(func(v GetContainerImagesResult) []GetContainerImagesContainerImageCollection {
return v.ContainerImageCollections
}).(GetContainerImagesContainerImageCollectionArrayOutput)
}
// The repository name and the most recent version associated with the image. If there are no versions associated with the image, then last known version and digest are used instead. If the last known version is unavailable, then 'unknown' is used instead of the version. Example: `ubuntu:latest` or `ubuntu:latest@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2`
func (o GetContainerImagesResultOutput) DisplayName() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetContainerImagesResult) *string { return v.DisplayName }).(pulumi.StringPtrOutput)
}
func (o GetContainerImagesResultOutput) Filters() GetContainerImagesFilterArrayOutput {
return o.ApplyT(func(v GetContainerImagesResult) []GetContainerImagesFilter { return v.Filters }).(GetContainerImagesFilterArrayOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetContainerImagesResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetContainerImagesResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o GetContainerImagesResultOutput) ImageId() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetContainerImagesResult) *string { return v.ImageId }).(pulumi.StringPtrOutput)
}
func (o GetContainerImagesResultOutput) IsVersioned() pulumi.BoolPtrOutput {
return o.ApplyT(func(v GetContainerImagesResult) *bool { return v.IsVersioned }).(pulumi.BoolPtrOutput)
}
// The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the container repository.
func (o GetContainerImagesResultOutput) RepositoryId() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetContainerImagesResult) *string { return v.RepositoryId }).(pulumi.StringPtrOutput)
}
// The container repository name.
func (o GetContainerImagesResultOutput) RepositoryName() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetContainerImagesResult) *string { return v.RepositoryName }).(pulumi.StringPtrOutput)
}
// The current state of the container image.
func (o GetContainerImagesResultOutput) State() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetContainerImagesResult) *string { return v.State }).(pulumi.StringPtrOutput)
}
// The version name.
func (o GetContainerImagesResultOutput) Version() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetContainerImagesResult) *string { return v.Version }).(pulumi.StringPtrOutput)
}
func init() {
pulumi.RegisterOutputType(GetContainerImagesResultOutput{})
}