generated from pulumi/pulumi-tf-provider-boilerplate
/
getSchedule.go
220 lines (189 loc) · 9.88 KB
/
getSchedule.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
// 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 meteringcomputation
import (
"context"
"reflect"
"github.com/pulumi/pulumi-oci/sdk/go/oci/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// This data source provides details about a specific Schedule resource in Oracle Cloud Infrastructure Metering Computation service.
//
// Returns the saved schedule.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-oci/sdk/go/oci/MeteringComputation"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := MeteringComputation.GetSchedule(ctx, &meteringcomputation.GetScheduleArgs{
// ScheduleId: testScheduleOciMeteringComputationSchedule.Id,
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func LookupSchedule(ctx *pulumi.Context, args *LookupScheduleArgs, opts ...pulumi.InvokeOption) (*LookupScheduleResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupScheduleResult
err := ctx.Invoke("oci:MeteringComputation/getSchedule:getSchedule", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getSchedule.
type LookupScheduleArgs struct {
// The schedule unique OCID.
ScheduleId string `pulumi:"scheduleId"`
}
// A collection of values returned by getSchedule.
type LookupScheduleResult struct {
// The customer tenancy.
CompartmentId string `pulumi:"compartmentId"`
// Defined tags for this resource. Each key is predefined and scoped to a namespace. See [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"foo-namespace.bar-key": "value"}`
DefinedTags map[string]interface{} `pulumi:"definedTags"`
// The description of the schedule.
Description string `pulumi:"description"`
// Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"bar-key": "value"}`
FreeformTags map[string]interface{} `pulumi:"freeformTags"`
// The OCID representing a unique shedule.
Id string `pulumi:"id"`
// The unique name of the schedule created by the user.
Name string `pulumi:"name"`
// Specifies the supported output file format.
OutputFileFormat string `pulumi:"outputFileFormat"`
// The query properties.
QueryProperties []GetScheduleQueryProperty `pulumi:"queryProperties"`
// The location where usage or cost CSVs will be uploaded defined by `locationType`, which corresponds with type-specific characteristics.
ResultLocations []GetScheduleResultLocation `pulumi:"resultLocations"`
// The saved report ID which can also be used to generate a query.
SavedReportId string `pulumi:"savedReportId"`
ScheduleId string `pulumi:"scheduleId"`
// Specifies the frequency according to when the schedule will be run, in the x-obmcs-recurring-time format described in [RFC 5545 section 3.3.10](https://datatracker.ietf.org/doc/html/rfc5545#section-3.3.10). Supported values are : ONE_TIME, DAILY, WEEKLY and MONTHLY.
ScheduleRecurrences string `pulumi:"scheduleRecurrences"`
// The schedule lifecycle state.
State string `pulumi:"state"`
// Usage of system tag keys. These predefined keys are scoped to namespaces. See [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"orcl-cloud.free-tier-retained": "true"}`
SystemTags map[string]interface{} `pulumi:"systemTags"`
// The date and time the schedule was created.
TimeCreated string `pulumi:"timeCreated"`
// The date and time of the next job execution.
TimeNextRun string `pulumi:"timeNextRun"`
// The date and time of the first time job execution.
TimeScheduled string `pulumi:"timeScheduled"`
}
func LookupScheduleOutput(ctx *pulumi.Context, args LookupScheduleOutputArgs, opts ...pulumi.InvokeOption) LookupScheduleResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupScheduleResult, error) {
args := v.(LookupScheduleArgs)
r, err := LookupSchedule(ctx, &args, opts...)
var s LookupScheduleResult
if r != nil {
s = *r
}
return s, err
}).(LookupScheduleResultOutput)
}
// A collection of arguments for invoking getSchedule.
type LookupScheduleOutputArgs struct {
// The schedule unique OCID.
ScheduleId pulumi.StringInput `pulumi:"scheduleId"`
}
func (LookupScheduleOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupScheduleArgs)(nil)).Elem()
}
// A collection of values returned by getSchedule.
type LookupScheduleResultOutput struct{ *pulumi.OutputState }
func (LookupScheduleResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupScheduleResult)(nil)).Elem()
}
func (o LookupScheduleResultOutput) ToLookupScheduleResultOutput() LookupScheduleResultOutput {
return o
}
func (o LookupScheduleResultOutput) ToLookupScheduleResultOutputWithContext(ctx context.Context) LookupScheduleResultOutput {
return o
}
// The customer tenancy.
func (o LookupScheduleResultOutput) CompartmentId() pulumi.StringOutput {
return o.ApplyT(func(v LookupScheduleResult) string { return v.CompartmentId }).(pulumi.StringOutput)
}
// Defined tags for this resource. Each key is predefined and scoped to a namespace. See [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"foo-namespace.bar-key": "value"}`
func (o LookupScheduleResultOutput) DefinedTags() pulumi.MapOutput {
return o.ApplyT(func(v LookupScheduleResult) map[string]interface{} { return v.DefinedTags }).(pulumi.MapOutput)
}
// The description of the schedule.
func (o LookupScheduleResultOutput) Description() pulumi.StringOutput {
return o.ApplyT(func(v LookupScheduleResult) string { return v.Description }).(pulumi.StringOutput)
}
// Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"bar-key": "value"}`
func (o LookupScheduleResultOutput) FreeformTags() pulumi.MapOutput {
return o.ApplyT(func(v LookupScheduleResult) map[string]interface{} { return v.FreeformTags }).(pulumi.MapOutput)
}
// The OCID representing a unique shedule.
func (o LookupScheduleResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupScheduleResult) string { return v.Id }).(pulumi.StringOutput)
}
// The unique name of the schedule created by the user.
func (o LookupScheduleResultOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v LookupScheduleResult) string { return v.Name }).(pulumi.StringOutput)
}
// Specifies the supported output file format.
func (o LookupScheduleResultOutput) OutputFileFormat() pulumi.StringOutput {
return o.ApplyT(func(v LookupScheduleResult) string { return v.OutputFileFormat }).(pulumi.StringOutput)
}
// The query properties.
func (o LookupScheduleResultOutput) QueryProperties() GetScheduleQueryPropertyArrayOutput {
return o.ApplyT(func(v LookupScheduleResult) []GetScheduleQueryProperty { return v.QueryProperties }).(GetScheduleQueryPropertyArrayOutput)
}
// The location where usage or cost CSVs will be uploaded defined by `locationType`, which corresponds with type-specific characteristics.
func (o LookupScheduleResultOutput) ResultLocations() GetScheduleResultLocationArrayOutput {
return o.ApplyT(func(v LookupScheduleResult) []GetScheduleResultLocation { return v.ResultLocations }).(GetScheduleResultLocationArrayOutput)
}
// The saved report ID which can also be used to generate a query.
func (o LookupScheduleResultOutput) SavedReportId() pulumi.StringOutput {
return o.ApplyT(func(v LookupScheduleResult) string { return v.SavedReportId }).(pulumi.StringOutput)
}
func (o LookupScheduleResultOutput) ScheduleId() pulumi.StringOutput {
return o.ApplyT(func(v LookupScheduleResult) string { return v.ScheduleId }).(pulumi.StringOutput)
}
// Specifies the frequency according to when the schedule will be run, in the x-obmcs-recurring-time format described in [RFC 5545 section 3.3.10](https://datatracker.ietf.org/doc/html/rfc5545#section-3.3.10). Supported values are : ONE_TIME, DAILY, WEEKLY and MONTHLY.
func (o LookupScheduleResultOutput) ScheduleRecurrences() pulumi.StringOutput {
return o.ApplyT(func(v LookupScheduleResult) string { return v.ScheduleRecurrences }).(pulumi.StringOutput)
}
// The schedule lifecycle state.
func (o LookupScheduleResultOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v LookupScheduleResult) string { return v.State }).(pulumi.StringOutput)
}
// Usage of system tag keys. These predefined keys are scoped to namespaces. See [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm). Example: `{"orcl-cloud.free-tier-retained": "true"}`
func (o LookupScheduleResultOutput) SystemTags() pulumi.MapOutput {
return o.ApplyT(func(v LookupScheduleResult) map[string]interface{} { return v.SystemTags }).(pulumi.MapOutput)
}
// The date and time the schedule was created.
func (o LookupScheduleResultOutput) TimeCreated() pulumi.StringOutput {
return o.ApplyT(func(v LookupScheduleResult) string { return v.TimeCreated }).(pulumi.StringOutput)
}
// The date and time of the next job execution.
func (o LookupScheduleResultOutput) TimeNextRun() pulumi.StringOutput {
return o.ApplyT(func(v LookupScheduleResult) string { return v.TimeNextRun }).(pulumi.StringOutput)
}
// The date and time of the first time job execution.
func (o LookupScheduleResultOutput) TimeScheduled() pulumi.StringOutput {
return o.ApplyT(func(v LookupScheduleResult) string { return v.TimeScheduled }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupScheduleResultOutput{})
}