/
getCustomJob.go
157 lines (131 loc) · 8.15 KB
/
getCustomJob.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
// 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"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Gets a CustomJob.
func LookupCustomJob(ctx *pulumi.Context, args *LookupCustomJobArgs, opts ...pulumi.InvokeOption) (*LookupCustomJobResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupCustomJobResult
err := ctx.Invoke("google-native:aiplatform/v1:getCustomJob", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupCustomJobArgs struct {
CustomJobId string `pulumi:"customJobId"`
Location string `pulumi:"location"`
Project *string `pulumi:"project"`
}
type LookupCustomJobResult struct {
// Time when the CustomJob was created.
CreateTime string `pulumi:"createTime"`
// The display name of the CustomJob. The name can be up to 128 characters long and can consist of any UTF-8 characters.
DisplayName string `pulumi:"displayName"`
// Customer-managed encryption key options for a CustomJob. If this is set, then all resources created by the CustomJob will be encrypted with the provided encryption key.
EncryptionSpec GoogleCloudAiplatformV1EncryptionSpecResponse `pulumi:"encryptionSpec"`
// Time when the CustomJob entered any of the following states: `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`.
EndTime string `pulumi:"endTime"`
// Only populated when job's state is `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`.
Error GoogleRpcStatusResponse `pulumi:"error"`
// Job spec.
JobSpec GoogleCloudAiplatformV1CustomJobSpecResponse `pulumi:"jobSpec"`
// The labels with user-defined metadata to organize CustomJobs. 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"`
// Resource name of a CustomJob.
Name string `pulumi:"name"`
// Time when the CustomJob for the first time entered the `JOB_STATE_RUNNING` state.
StartTime string `pulumi:"startTime"`
// The detailed state of the job.
State string `pulumi:"state"`
// Time when the CustomJob was most recently updated.
UpdateTime string `pulumi:"updateTime"`
// URIs for accessing [interactive shells](https://cloud.google.com/vertex-ai/docs/training/monitor-debug-interactive-shell) (one URI for each training node). Only available if job_spec.enable_web_access is `true`. The keys are names of each node in the training job; for example, `workerpool0-0` for the primary node, `workerpool1-0` for the first node in the second worker pool, and `workerpool1-1` for the second node in the second worker pool. The values are the URIs for each node's interactive shell.
WebAccessUris map[string]string `pulumi:"webAccessUris"`
}
func LookupCustomJobOutput(ctx *pulumi.Context, args LookupCustomJobOutputArgs, opts ...pulumi.InvokeOption) LookupCustomJobResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupCustomJobResult, error) {
args := v.(LookupCustomJobArgs)
r, err := LookupCustomJob(ctx, &args, opts...)
var s LookupCustomJobResult
if r != nil {
s = *r
}
return s, err
}).(LookupCustomJobResultOutput)
}
type LookupCustomJobOutputArgs struct {
CustomJobId pulumi.StringInput `pulumi:"customJobId"`
Location pulumi.StringInput `pulumi:"location"`
Project pulumi.StringPtrInput `pulumi:"project"`
}
func (LookupCustomJobOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupCustomJobArgs)(nil)).Elem()
}
type LookupCustomJobResultOutput struct{ *pulumi.OutputState }
func (LookupCustomJobResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupCustomJobResult)(nil)).Elem()
}
func (o LookupCustomJobResultOutput) ToLookupCustomJobResultOutput() LookupCustomJobResultOutput {
return o
}
func (o LookupCustomJobResultOutput) ToLookupCustomJobResultOutputWithContext(ctx context.Context) LookupCustomJobResultOutput {
return o
}
// Time when the CustomJob was created.
func (o LookupCustomJobResultOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupCustomJobResult) string { return v.CreateTime }).(pulumi.StringOutput)
}
// The display name of the CustomJob. The name can be up to 128 characters long and can consist of any UTF-8 characters.
func (o LookupCustomJobResultOutput) DisplayName() pulumi.StringOutput {
return o.ApplyT(func(v LookupCustomJobResult) string { return v.DisplayName }).(pulumi.StringOutput)
}
// Customer-managed encryption key options for a CustomJob. If this is set, then all resources created by the CustomJob will be encrypted with the provided encryption key.
func (o LookupCustomJobResultOutput) EncryptionSpec() GoogleCloudAiplatformV1EncryptionSpecResponseOutput {
return o.ApplyT(func(v LookupCustomJobResult) GoogleCloudAiplatformV1EncryptionSpecResponse { return v.EncryptionSpec }).(GoogleCloudAiplatformV1EncryptionSpecResponseOutput)
}
// Time when the CustomJob entered any of the following states: `JOB_STATE_SUCCEEDED`, `JOB_STATE_FAILED`, `JOB_STATE_CANCELLED`.
func (o LookupCustomJobResultOutput) EndTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupCustomJobResult) string { return v.EndTime }).(pulumi.StringOutput)
}
// Only populated when job's state is `JOB_STATE_FAILED` or `JOB_STATE_CANCELLED`.
func (o LookupCustomJobResultOutput) Error() GoogleRpcStatusResponseOutput {
return o.ApplyT(func(v LookupCustomJobResult) GoogleRpcStatusResponse { return v.Error }).(GoogleRpcStatusResponseOutput)
}
// Job spec.
func (o LookupCustomJobResultOutput) JobSpec() GoogleCloudAiplatformV1CustomJobSpecResponseOutput {
return o.ApplyT(func(v LookupCustomJobResult) GoogleCloudAiplatformV1CustomJobSpecResponse { return v.JobSpec }).(GoogleCloudAiplatformV1CustomJobSpecResponseOutput)
}
// The labels with user-defined metadata to organize CustomJobs. 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 LookupCustomJobResultOutput) Labels() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupCustomJobResult) map[string]string { return v.Labels }).(pulumi.StringMapOutput)
}
// Resource name of a CustomJob.
func (o LookupCustomJobResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupCustomJobResult) string { return v.Name }).(pulumi.StringOutput)
}
// Time when the CustomJob for the first time entered the `JOB_STATE_RUNNING` state.
func (o LookupCustomJobResultOutput) StartTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupCustomJobResult) string { return v.StartTime }).(pulumi.StringOutput)
}
// The detailed state of the job.
func (o LookupCustomJobResultOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v LookupCustomJobResult) string { return v.State }).(pulumi.StringOutput)
}
// Time when the CustomJob was most recently updated.
func (o LookupCustomJobResultOutput) UpdateTime() pulumi.StringOutput {
return o.ApplyT(func(v LookupCustomJobResult) string { return v.UpdateTime }).(pulumi.StringOutput)
}
// URIs for accessing [interactive shells](https://cloud.google.com/vertex-ai/docs/training/monitor-debug-interactive-shell) (one URI for each training node). Only available if job_spec.enable_web_access is `true`. The keys are names of each node in the training job; for example, `workerpool0-0` for the primary node, `workerpool1-0` for the first node in the second worker pool, and `workerpool1-1` for the second node in the second worker pool. The values are the URIs for each node's interactive shell.
func (o LookupCustomJobResultOutput) WebAccessUris() pulumi.StringMapOutput {
return o.ApplyT(func(v LookupCustomJobResult) map[string]string { return v.WebAccessUris }).(pulumi.StringMapOutput)
}
func init() {
pulumi.RegisterOutputType(LookupCustomJobResultOutput{})
}