/
getJob.go
136 lines (113 loc) · 5.36 KB
/
getJob.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
// 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 v2
import (
"context"
"reflect"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Returns information about a specific job. Job information is available for a six month period after creation. Requires that you're the person who ran the job, or have the Is Owner project role.
func LookupJob(ctx *pulumi.Context, args *LookupJobArgs, opts ...pulumi.InvokeOption) (*LookupJobResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupJobResult
err := ctx.Invoke("google-native:bigquery/v2:getJob", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
type LookupJobArgs struct {
JobId string `pulumi:"jobId"`
Location *string `pulumi:"location"`
Project *string `pulumi:"project"`
}
type LookupJobResult struct {
// [Required] Describes the job configuration.
Configuration JobConfigurationResponse `pulumi:"configuration"`
// A hash of this resource.
Etag string `pulumi:"etag"`
// If set, it provides the reason why a Job was created. If not set, it should be treated as the default: REQUESTED. This feature is not yet available. Jobs will always be created.
JobCreationReason interface{} `pulumi:"jobCreationReason"`
// [Optional] Reference describing the unique-per-user name of the job.
JobReference JobReferenceResponse `pulumi:"jobReference"`
// The type of the resource.
Kind string `pulumi:"kind"`
// A URL that can be used to access this resource again.
SelfLink string `pulumi:"selfLink"`
// Information about the job, including starting time and ending time of the job.
Statistics JobStatisticsResponse `pulumi:"statistics"`
// The status of this job. Examine this value when polling an asynchronous job to see if the job is complete.
Status JobStatusResponse `pulumi:"status"`
// Email address of the user who ran the job.
UserEmail string `pulumi:"userEmail"`
}
func LookupJobOutput(ctx *pulumi.Context, args LookupJobOutputArgs, opts ...pulumi.InvokeOption) LookupJobResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupJobResult, error) {
args := v.(LookupJobArgs)
r, err := LookupJob(ctx, &args, opts...)
var s LookupJobResult
if r != nil {
s = *r
}
return s, err
}).(LookupJobResultOutput)
}
type LookupJobOutputArgs struct {
JobId pulumi.StringInput `pulumi:"jobId"`
Location pulumi.StringPtrInput `pulumi:"location"`
Project pulumi.StringPtrInput `pulumi:"project"`
}
func (LookupJobOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupJobArgs)(nil)).Elem()
}
type LookupJobResultOutput struct{ *pulumi.OutputState }
func (LookupJobResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupJobResult)(nil)).Elem()
}
func (o LookupJobResultOutput) ToLookupJobResultOutput() LookupJobResultOutput {
return o
}
func (o LookupJobResultOutput) ToLookupJobResultOutputWithContext(ctx context.Context) LookupJobResultOutput {
return o
}
// [Required] Describes the job configuration.
func (o LookupJobResultOutput) Configuration() JobConfigurationResponseOutput {
return o.ApplyT(func(v LookupJobResult) JobConfigurationResponse { return v.Configuration }).(JobConfigurationResponseOutput)
}
// A hash of this resource.
func (o LookupJobResultOutput) Etag() pulumi.StringOutput {
return o.ApplyT(func(v LookupJobResult) string { return v.Etag }).(pulumi.StringOutput)
}
// If set, it provides the reason why a Job was created. If not set, it should be treated as the default: REQUESTED. This feature is not yet available. Jobs will always be created.
func (o LookupJobResultOutput) JobCreationReason() pulumi.AnyOutput {
return o.ApplyT(func(v LookupJobResult) interface{} { return v.JobCreationReason }).(pulumi.AnyOutput)
}
// [Optional] Reference describing the unique-per-user name of the job.
func (o LookupJobResultOutput) JobReference() JobReferenceResponseOutput {
return o.ApplyT(func(v LookupJobResult) JobReferenceResponse { return v.JobReference }).(JobReferenceResponseOutput)
}
// The type of the resource.
func (o LookupJobResultOutput) Kind() pulumi.StringOutput {
return o.ApplyT(func(v LookupJobResult) string { return v.Kind }).(pulumi.StringOutput)
}
// A URL that can be used to access this resource again.
func (o LookupJobResultOutput) SelfLink() pulumi.StringOutput {
return o.ApplyT(func(v LookupJobResult) string { return v.SelfLink }).(pulumi.StringOutput)
}
// Information about the job, including starting time and ending time of the job.
func (o LookupJobResultOutput) Statistics() JobStatisticsResponseOutput {
return o.ApplyT(func(v LookupJobResult) JobStatisticsResponse { return v.Statistics }).(JobStatisticsResponseOutput)
}
// The status of this job. Examine this value when polling an asynchronous job to see if the job is complete.
func (o LookupJobResultOutput) Status() JobStatusResponseOutput {
return o.ApplyT(func(v LookupJobResult) JobStatusResponse { return v.Status }).(JobStatusResponseOutput)
}
// Email address of the user who ran the job.
func (o LookupJobResultOutput) UserEmail() pulumi.StringOutput {
return o.ApplyT(func(v LookupJobResult) string { return v.UserEmail }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupJobResultOutput{})
}