This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
registry.go
210 lines (187 loc) · 7.98 KB
/
registry.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
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v20160627preview
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// An object that represents a container registry.
type Registry struct {
pulumi.CustomResourceState
// The value that indicates whether the admin user is enabled. This value is false by default.
AdminUserEnabled pulumi.BoolPtrOutput `pulumi:"adminUserEnabled"`
// The creation date of the container registry in ISO8601 format.
CreationDate pulumi.StringOutput `pulumi:"creationDate"`
// The location of the resource. This cannot be changed after the resource is created.
Location pulumi.StringOutput `pulumi:"location"`
// The URL that can be used to log into the container registry.
LoginServer pulumi.StringOutput `pulumi:"loginServer"`
// The name of the resource.
Name pulumi.StringOutput `pulumi:"name"`
// The properties of the storage account for the container registry. If specified, the storage account must be in the same physical location as the container registry.
StorageAccount StorageAccountPropertiesResponseOutput `pulumi:"storageAccount"`
// The tags of the resource.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// The type of the resource.
Type pulumi.StringOutput `pulumi:"type"`
}
// NewRegistry registers a new resource with the given unique name, arguments, and options.
func NewRegistry(ctx *pulumi.Context,
name string, args *RegistryArgs, opts ...pulumi.ResourceOption) (*Registry, error) {
if args == nil || args.Location == nil {
return nil, errors.New("missing required argument 'Location'")
}
if args == nil || args.RegistryName == nil {
return nil, errors.New("missing required argument 'RegistryName'")
}
if args == nil || args.ResourceGroupName == nil {
return nil, errors.New("missing required argument 'ResourceGroupName'")
}
if args == nil || args.StorageAccount == nil {
return nil, errors.New("missing required argument 'StorageAccount'")
}
if args == nil {
args = &RegistryArgs{}
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-nextgen:containerregistry/latest:Registry"),
},
{
Type: pulumi.String("azure-nextgen:containerregistry/v20170301:Registry"),
},
{
Type: pulumi.String("azure-nextgen:containerregistry/v20170601preview:Registry"),
},
{
Type: pulumi.String("azure-nextgen:containerregistry/v20171001:Registry"),
},
{
Type: pulumi.String("azure-nextgen:containerregistry/v20190501:Registry"),
},
{
Type: pulumi.String("azure-nextgen:containerregistry/v20191201preview:Registry"),
},
})
opts = append(opts, aliases)
var resource Registry
err := ctx.RegisterResource("azure-nextgen:containerregistry/v20160627preview:Registry", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetRegistry gets an existing Registry resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetRegistry(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *RegistryState, opts ...pulumi.ResourceOption) (*Registry, error) {
var resource Registry
err := ctx.ReadResource("azure-nextgen:containerregistry/v20160627preview:Registry", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Registry resources.
type registryState struct {
// The value that indicates whether the admin user is enabled. This value is false by default.
AdminUserEnabled *bool `pulumi:"adminUserEnabled"`
// The creation date of the container registry in ISO8601 format.
CreationDate *string `pulumi:"creationDate"`
// The location of the resource. This cannot be changed after the resource is created.
Location *string `pulumi:"location"`
// The URL that can be used to log into the container registry.
LoginServer *string `pulumi:"loginServer"`
// The name of the resource.
Name *string `pulumi:"name"`
// The properties of the storage account for the container registry. If specified, the storage account must be in the same physical location as the container registry.
StorageAccount *StorageAccountPropertiesResponse `pulumi:"storageAccount"`
// The tags of the resource.
Tags map[string]string `pulumi:"tags"`
// The type of the resource.
Type *string `pulumi:"type"`
}
type RegistryState struct {
// The value that indicates whether the admin user is enabled. This value is false by default.
AdminUserEnabled pulumi.BoolPtrInput
// The creation date of the container registry in ISO8601 format.
CreationDate pulumi.StringPtrInput
// The location of the resource. This cannot be changed after the resource is created.
Location pulumi.StringPtrInput
// The URL that can be used to log into the container registry.
LoginServer pulumi.StringPtrInput
// The name of the resource.
Name pulumi.StringPtrInput
// The properties of the storage account for the container registry. If specified, the storage account must be in the same physical location as the container registry.
StorageAccount StorageAccountPropertiesResponsePtrInput
// The tags of the resource.
Tags pulumi.StringMapInput
// The type of the resource.
Type pulumi.StringPtrInput
}
func (RegistryState) ElementType() reflect.Type {
return reflect.TypeOf((*registryState)(nil)).Elem()
}
type registryArgs struct {
// The value that indicates whether the admin user is enabled. This value is false by default.
AdminUserEnabled *bool `pulumi:"adminUserEnabled"`
// The location of the resource. This cannot be changed after the resource is created.
Location string `pulumi:"location"`
// The name of the container registry.
RegistryName string `pulumi:"registryName"`
// The name of the resource group to which the container registry belongs.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The properties of the storage account for the container registry. If specified, the storage account must be in the same physical location as the container registry.
StorageAccount StorageAccountProperties `pulumi:"storageAccount"`
// The tags of the resource.
Tags map[string]string `pulumi:"tags"`
}
// The set of arguments for constructing a Registry resource.
type RegistryArgs struct {
// The value that indicates whether the admin user is enabled. This value is false by default.
AdminUserEnabled pulumi.BoolPtrInput
// The location of the resource. This cannot be changed after the resource is created.
Location pulumi.StringInput
// The name of the container registry.
RegistryName pulumi.StringInput
// The name of the resource group to which the container registry belongs.
ResourceGroupName pulumi.StringInput
// The properties of the storage account for the container registry. If specified, the storage account must be in the same physical location as the container registry.
StorageAccount StorageAccountPropertiesInput
// The tags of the resource.
Tags pulumi.StringMapInput
}
func (RegistryArgs) ElementType() reflect.Type {
return reflect.TypeOf((*registryArgs)(nil)).Elem()
}
type RegistryInput interface {
pulumi.Input
ToRegistryOutput() RegistryOutput
ToRegistryOutputWithContext(ctx context.Context) RegistryOutput
}
func (Registry) ElementType() reflect.Type {
return reflect.TypeOf((*Registry)(nil)).Elem()
}
func (i Registry) ToRegistryOutput() RegistryOutput {
return i.ToRegistryOutputWithContext(context.Background())
}
func (i Registry) ToRegistryOutputWithContext(ctx context.Context) RegistryOutput {
return pulumi.ToOutputWithContext(ctx, i).(RegistryOutput)
}
type RegistryOutput struct {
*pulumi.OutputState
}
func (RegistryOutput) ElementType() reflect.Type {
return reflect.TypeOf((*RegistryOutput)(nil)).Elem()
}
func (o RegistryOutput) ToRegistryOutput() RegistryOutput {
return o
}
func (o RegistryOutput) ToRegistryOutputWithContext(ctx context.Context) RegistryOutput {
return o
}
func init() {
pulumi.RegisterOutputType(RegistryOutput{})
}