/
nasJob.go
244 lines (205 loc) · 11.3 KB
/
nasJob.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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package v1
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Creates a NasJob
// Auto-naming is currently not supported for this resource.
type NasJob struct {
pulumi.CustomResourceState
// Time when the NasJob was created.
CreateTime pulumi.StringOutput `pulumi:"createTime"`
// The display name of the NasJob. The name can be up to 128 characters long and can consist of any UTF-8 characters.
DisplayName pulumi.StringOutput `pulumi:"displayName"`
// Optional. Enable a separation of Custom model training and restricted image training for tenant project.
EnableRestrictedImageTraining pulumi.BoolOutput `pulumi:"enableRestrictedImageTraining"`
// Customer-managed encryption key options for a NasJob. If this is set, then all resources created by the NasJob will be encrypted with the provided encryption key.
EncryptionSpec GoogleCloudAiplatformV1EncryptionSpecResponseOutput `pulumi:"encryptionSpec"`
// Time when the NasJob entered any of the following states: `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`.
EndTime pulumi.StringOutput `pulumi:"endTime"`
// Only populated when job's state is JOB_STATE_FAILED or JOB_STATE_CANCELLED.
Error GoogleRpcStatusResponseOutput `pulumi:"error"`
// The labels with user-defined metadata to organize NasJobs. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.
Labels pulumi.StringMapOutput `pulumi:"labels"`
Location pulumi.StringOutput `pulumi:"location"`
// Resource name of the NasJob.
Name pulumi.StringOutput `pulumi:"name"`
// Output of the NasJob.
NasJobOutput GoogleCloudAiplatformV1NasJobOutputResponseOutput `pulumi:"nasJobOutput"`
// The specification of a NasJob.
NasJobSpec GoogleCloudAiplatformV1NasJobSpecResponseOutput `pulumi:"nasJobSpec"`
Project pulumi.StringOutput `pulumi:"project"`
// Time when the NasJob for the first time entered the `JOB_STATE_RUNNING` state.
StartTime pulumi.StringOutput `pulumi:"startTime"`
// The detailed state of the job.
State pulumi.StringOutput `pulumi:"state"`
// Time when the NasJob was most recently updated.
UpdateTime pulumi.StringOutput `pulumi:"updateTime"`
}
// NewNasJob registers a new resource with the given unique name, arguments, and options.
func NewNasJob(ctx *pulumi.Context,
name string, args *NasJobArgs, opts ...pulumi.ResourceOption) (*NasJob, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DisplayName == nil {
return nil, errors.New("invalid value for required argument 'DisplayName'")
}
if args.NasJobSpec == nil {
return nil, errors.New("invalid value for required argument 'NasJobSpec'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"location",
"project",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource NasJob
err := ctx.RegisterResource("google-native:aiplatform/v1:NasJob", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetNasJob gets an existing NasJob 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 GetNasJob(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *NasJobState, opts ...pulumi.ResourceOption) (*NasJob, error) {
var resource NasJob
err := ctx.ReadResource("google-native:aiplatform/v1:NasJob", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering NasJob resources.
type nasJobState struct {
}
type NasJobState struct {
}
func (NasJobState) ElementType() reflect.Type {
return reflect.TypeOf((*nasJobState)(nil)).Elem()
}
type nasJobArgs struct {
// The display name of the NasJob. The name can be up to 128 characters long and can consist of any UTF-8 characters.
DisplayName string `pulumi:"displayName"`
// Optional. Enable a separation of Custom model training and restricted image training for tenant project.
EnableRestrictedImageTraining *bool `pulumi:"enableRestrictedImageTraining"`
// Customer-managed encryption key options for a NasJob. If this is set, then all resources created by the NasJob will be encrypted with the provided encryption key.
EncryptionSpec *GoogleCloudAiplatformV1EncryptionSpec `pulumi:"encryptionSpec"`
// The labels with user-defined metadata to organize NasJobs. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.
Labels map[string]string `pulumi:"labels"`
Location *string `pulumi:"location"`
// The specification of a NasJob.
NasJobSpec GoogleCloudAiplatformV1NasJobSpec `pulumi:"nasJobSpec"`
Project *string `pulumi:"project"`
}
// The set of arguments for constructing a NasJob resource.
type NasJobArgs struct {
// The display name of the NasJob. The name can be up to 128 characters long and can consist of any UTF-8 characters.
DisplayName pulumi.StringInput
// Optional. Enable a separation of Custom model training and restricted image training for tenant project.
EnableRestrictedImageTraining pulumi.BoolPtrInput
// Customer-managed encryption key options for a NasJob. If this is set, then all resources created by the NasJob will be encrypted with the provided encryption key.
EncryptionSpec GoogleCloudAiplatformV1EncryptionSpecPtrInput
// The labels with user-defined metadata to organize NasJobs. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.
Labels pulumi.StringMapInput
Location pulumi.StringPtrInput
// The specification of a NasJob.
NasJobSpec GoogleCloudAiplatformV1NasJobSpecInput
Project pulumi.StringPtrInput
}
func (NasJobArgs) ElementType() reflect.Type {
return reflect.TypeOf((*nasJobArgs)(nil)).Elem()
}
type NasJobInput interface {
pulumi.Input
ToNasJobOutput() NasJobOutput
ToNasJobOutputWithContext(ctx context.Context) NasJobOutput
}
func (*NasJob) ElementType() reflect.Type {
return reflect.TypeOf((**NasJob)(nil)).Elem()
}
func (i *NasJob) ToNasJobOutput() NasJobOutput {
return i.ToNasJobOutputWithContext(context.Background())
}
func (i *NasJob) ToNasJobOutputWithContext(ctx context.Context) NasJobOutput {
return pulumi.ToOutputWithContext(ctx, i).(NasJobOutput)
}
type NasJobOutput struct{ *pulumi.OutputState }
func (NasJobOutput) ElementType() reflect.Type {
return reflect.TypeOf((**NasJob)(nil)).Elem()
}
func (o NasJobOutput) ToNasJobOutput() NasJobOutput {
return o
}
func (o NasJobOutput) ToNasJobOutputWithContext(ctx context.Context) NasJobOutput {
return o
}
// Time when the NasJob was created.
func (o NasJobOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v *NasJob) pulumi.StringOutput { return v.CreateTime }).(pulumi.StringOutput)
}
// The display name of the NasJob. The name can be up to 128 characters long and can consist of any UTF-8 characters.
func (o NasJobOutput) DisplayName() pulumi.StringOutput {
return o.ApplyT(func(v *NasJob) pulumi.StringOutput { return v.DisplayName }).(pulumi.StringOutput)
}
// Optional. Enable a separation of Custom model training and restricted image training for tenant project.
func (o NasJobOutput) EnableRestrictedImageTraining() pulumi.BoolOutput {
return o.ApplyT(func(v *NasJob) pulumi.BoolOutput { return v.EnableRestrictedImageTraining }).(pulumi.BoolOutput)
}
// Customer-managed encryption key options for a NasJob. If this is set, then all resources created by the NasJob will be encrypted with the provided encryption key.
func (o NasJobOutput) EncryptionSpec() GoogleCloudAiplatformV1EncryptionSpecResponseOutput {
return o.ApplyT(func(v *NasJob) GoogleCloudAiplatformV1EncryptionSpecResponseOutput { return v.EncryptionSpec }).(GoogleCloudAiplatformV1EncryptionSpecResponseOutput)
}
// Time when the NasJob entered any of the following states: `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`.
func (o NasJobOutput) EndTime() pulumi.StringOutput {
return o.ApplyT(func(v *NasJob) pulumi.StringOutput { return v.EndTime }).(pulumi.StringOutput)
}
// Only populated when job's state is JOB_STATE_FAILED or JOB_STATE_CANCELLED.
func (o NasJobOutput) Error() GoogleRpcStatusResponseOutput {
return o.ApplyT(func(v *NasJob) GoogleRpcStatusResponseOutput { return v.Error }).(GoogleRpcStatusResponseOutput)
}
// The labels with user-defined metadata to organize NasJobs. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.
func (o NasJobOutput) Labels() pulumi.StringMapOutput {
return o.ApplyT(func(v *NasJob) pulumi.StringMapOutput { return v.Labels }).(pulumi.StringMapOutput)
}
func (o NasJobOutput) Location() pulumi.StringOutput {
return o.ApplyT(func(v *NasJob) pulumi.StringOutput { return v.Location }).(pulumi.StringOutput)
}
// Resource name of the NasJob.
func (o NasJobOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *NasJob) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Output of the NasJob.
func (o NasJobOutput) NasJobOutput() GoogleCloudAiplatformV1NasJobOutputResponseOutput {
return o.ApplyT(func(v *NasJob) GoogleCloudAiplatformV1NasJobOutputResponseOutput { return v.NasJobOutput }).(GoogleCloudAiplatformV1NasJobOutputResponseOutput)
}
// The specification of a NasJob.
func (o NasJobOutput) NasJobSpec() GoogleCloudAiplatformV1NasJobSpecResponseOutput {
return o.ApplyT(func(v *NasJob) GoogleCloudAiplatformV1NasJobSpecResponseOutput { return v.NasJobSpec }).(GoogleCloudAiplatformV1NasJobSpecResponseOutput)
}
func (o NasJobOutput) Project() pulumi.StringOutput {
return o.ApplyT(func(v *NasJob) pulumi.StringOutput { return v.Project }).(pulumi.StringOutput)
}
// Time when the NasJob for the first time entered the `JOB_STATE_RUNNING` state.
func (o NasJobOutput) StartTime() pulumi.StringOutput {
return o.ApplyT(func(v *NasJob) pulumi.StringOutput { return v.StartTime }).(pulumi.StringOutput)
}
// The detailed state of the job.
func (o NasJobOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v *NasJob) pulumi.StringOutput { return v.State }).(pulumi.StringOutput)
}
// Time when the NasJob was most recently updated.
func (o NasJobOutput) UpdateTime() pulumi.StringOutput {
return o.ApplyT(func(v *NasJob) pulumi.StringOutput { return v.UpdateTime }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*NasJobInput)(nil)).Elem(), &NasJob{})
pulumi.RegisterOutputType(NasJobOutput{})
}