generated from pulumi/pulumi-tf-provider-boilerplate
/
getDrPlan.go
213 lines (183 loc) · 9.21 KB
/
getDrPlan.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
// 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 disasterrecovery
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 Dr Plan resource in Oracle Cloud Infrastructure Disaster Recovery service.
//
// Get details for the DR plan identified by *drPlanId*.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-oci/sdk/go/oci/DisasterRecovery"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := DisasterRecovery.GetDrPlan(ctx, &disasterrecovery.GetDrPlanArgs{
// DrPlanId: testDrPlanOciDisasterRecoveryDrPlan.Id,
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func LookupDrPlan(ctx *pulumi.Context, args *LookupDrPlanArgs, opts ...pulumi.InvokeOption) (*LookupDrPlanResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupDrPlanResult
err := ctx.Invoke("oci:DisasterRecovery/getDrPlan:getDrPlan", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getDrPlan.
type LookupDrPlanArgs struct {
// The OCID of the DR plan. Example: `ocid1.drplan.oc1..uniqueID`
DrPlanId string `pulumi:"drPlanId"`
}
// A collection of values returned by getDrPlan.
type LookupDrPlanResult struct {
// The OCID of the compartment containing the DR plan. Example: `ocid1.compartment.oc1..uniqueID`
CompartmentId string `pulumi:"compartmentId"`
// Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"Operations.CostCenter": "42"}`
DefinedTags map[string]interface{} `pulumi:"definedTags"`
// The display name of the group. Example: `DATABASE_SWITCHOVER`
DisplayName string `pulumi:"displayName"`
DrPlanId string `pulumi:"drPlanId"`
// The OCID of the DR protection group to which this DR plan belongs. Example: `ocid1.drplan.oc1..uniqueID`
DrProtectionGroupId string `pulumi:"drProtectionGroupId"`
// Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"Department": "Finance"}`
FreeformTags map[string]interface{} `pulumi:"freeformTags"`
// The unique id of the step. Must not be modified by the user. Example: `sgid1.step..uniqueID`
Id string `pulumi:"id"`
// A message describing the DR plan's current state in more detail.
LifeCycleDetails string `pulumi:"lifeCycleDetails"`
// The OCID of the peer DR protection group associated with this plan's DR protection group. Example: `ocid1.drprotectiongroup.oc1..uniqueID`
PeerDrProtectionGroupId string `pulumi:"peerDrProtectionGroupId"`
// The region of the peer DR protection group associated with this plan's DR protection group. Example: `us-ashburn-1`
PeerRegion string `pulumi:"peerRegion"`
// The list of groups in this DR plan.
PlanGroups []GetDrPlanPlanGroup `pulumi:"planGroups"`
// The current state of the DR plan.
State string `pulumi:"state"`
// Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{"orcl-cloud.free-tier-retained": "true"}`
SystemTags map[string]interface{} `pulumi:"systemTags"`
// The date and time the DR plan was created. An RFC3339 formatted datetime string. Example: `2019-03-29T09:36:42Z`
TimeCreated string `pulumi:"timeCreated"`
// The date and time the DR plan was updated. An RFC3339 formatted datetime string. Example: `2019-03-29T09:36:42Z`
TimeUpdated string `pulumi:"timeUpdated"`
// The type of the DR plan.
Type string `pulumi:"type"`
}
func LookupDrPlanOutput(ctx *pulumi.Context, args LookupDrPlanOutputArgs, opts ...pulumi.InvokeOption) LookupDrPlanResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupDrPlanResult, error) {
args := v.(LookupDrPlanArgs)
r, err := LookupDrPlan(ctx, &args, opts...)
var s LookupDrPlanResult
if r != nil {
s = *r
}
return s, err
}).(LookupDrPlanResultOutput)
}
// A collection of arguments for invoking getDrPlan.
type LookupDrPlanOutputArgs struct {
// The OCID of the DR plan. Example: `ocid1.drplan.oc1..uniqueID`
DrPlanId pulumi.StringInput `pulumi:"drPlanId"`
}
func (LookupDrPlanOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupDrPlanArgs)(nil)).Elem()
}
// A collection of values returned by getDrPlan.
type LookupDrPlanResultOutput struct{ *pulumi.OutputState }
func (LookupDrPlanResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupDrPlanResult)(nil)).Elem()
}
func (o LookupDrPlanResultOutput) ToLookupDrPlanResultOutput() LookupDrPlanResultOutput {
return o
}
func (o LookupDrPlanResultOutput) ToLookupDrPlanResultOutputWithContext(ctx context.Context) LookupDrPlanResultOutput {
return o
}
// The OCID of the compartment containing the DR plan. Example: `ocid1.compartment.oc1..uniqueID`
func (o LookupDrPlanResultOutput) CompartmentId() pulumi.StringOutput {
return o.ApplyT(func(v LookupDrPlanResult) string { return v.CompartmentId }).(pulumi.StringOutput)
}
// Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"Operations.CostCenter": "42"}`
func (o LookupDrPlanResultOutput) DefinedTags() pulumi.MapOutput {
return o.ApplyT(func(v LookupDrPlanResult) map[string]interface{} { return v.DefinedTags }).(pulumi.MapOutput)
}
// The display name of the group. Example: `DATABASE_SWITCHOVER`
func (o LookupDrPlanResultOutput) DisplayName() pulumi.StringOutput {
return o.ApplyT(func(v LookupDrPlanResult) string { return v.DisplayName }).(pulumi.StringOutput)
}
func (o LookupDrPlanResultOutput) DrPlanId() pulumi.StringOutput {
return o.ApplyT(func(v LookupDrPlanResult) string { return v.DrPlanId }).(pulumi.StringOutput)
}
// The OCID of the DR protection group to which this DR plan belongs. Example: `ocid1.drplan.oc1..uniqueID`
func (o LookupDrPlanResultOutput) DrProtectionGroupId() pulumi.StringOutput {
return o.ApplyT(func(v LookupDrPlanResult) string { return v.DrProtectionGroupId }).(pulumi.StringOutput)
}
// Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"Department": "Finance"}`
func (o LookupDrPlanResultOutput) FreeformTags() pulumi.MapOutput {
return o.ApplyT(func(v LookupDrPlanResult) map[string]interface{} { return v.FreeformTags }).(pulumi.MapOutput)
}
// The unique id of the step. Must not be modified by the user. Example: `sgid1.step..uniqueID`
func (o LookupDrPlanResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v LookupDrPlanResult) string { return v.Id }).(pulumi.StringOutput)
}
// A message describing the DR plan's current state in more detail.
func (o LookupDrPlanResultOutput) LifeCycleDetails() pulumi.StringOutput {
return o.ApplyT(func(v LookupDrPlanResult) string { return v.LifeCycleDetails }).(pulumi.StringOutput)
}
// The OCID of the peer DR protection group associated with this plan's DR protection group. Example: `ocid1.drprotectiongroup.oc1..uniqueID`
func (o LookupDrPlanResultOutput) PeerDrProtectionGroupId() pulumi.StringOutput {
return o.ApplyT(func(v LookupDrPlanResult) string { return v.PeerDrProtectionGroupId }).(pulumi.StringOutput)
}
// The region of the peer DR protection group associated with this plan's DR protection group. Example: `us-ashburn-1`
func (o LookupDrPlanResultOutput) PeerRegion() pulumi.StringOutput {
return o.ApplyT(func(v LookupDrPlanResult) string { return v.PeerRegion }).(pulumi.StringOutput)
}
// The list of groups in this DR plan.
func (o LookupDrPlanResultOutput) PlanGroups() GetDrPlanPlanGroupArrayOutput {
return o.ApplyT(func(v LookupDrPlanResult) []GetDrPlanPlanGroup { return v.PlanGroups }).(GetDrPlanPlanGroupArrayOutput)
}
// The current state of the DR plan.
func (o LookupDrPlanResultOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v LookupDrPlanResult) string { return v.State }).(pulumi.StringOutput)
}
// Usage of system tag keys. These predefined keys are scoped to namespaces. Example: `{"orcl-cloud.free-tier-retained": "true"}`
func (o LookupDrPlanResultOutput) SystemTags() pulumi.MapOutput {
return o.ApplyT(func(v LookupDrPlanResult) map[string]interface{} { return v.SystemTags }).(pulumi.MapOutput)
}
// The date and time the DR plan was created. An RFC3339 formatted datetime string. Example: `2019-03-29T09:36:42Z`
func (o LookupDrPlanResultOutput) TimeCreated() pulumi.StringOutput {
return o.ApplyT(func(v LookupDrPlanResult) string { return v.TimeCreated }).(pulumi.StringOutput)
}
// The date and time the DR plan was updated. An RFC3339 formatted datetime string. Example: `2019-03-29T09:36:42Z`
func (o LookupDrPlanResultOutput) TimeUpdated() pulumi.StringOutput {
return o.ApplyT(func(v LookupDrPlanResult) string { return v.TimeUpdated }).(pulumi.StringOutput)
}
// The type of the DR plan.
func (o LookupDrPlanResultOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v LookupDrPlanResult) string { return v.Type }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupDrPlanResultOutput{})
}