generated from pulumi/pulumi-tf-provider-boilerplate
/
getDrPlans.go
175 lines (153 loc) · 6.65 KB
/
getDrPlans.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
// 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 the list of Dr Plans in Oracle Cloud Infrastructure Disaster Recovery service.
//
// Get a summary list of all DR plans for a DR protection group.
//
// ## 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.GetDrPlans(ctx, &disasterrecovery.GetDrPlansArgs{
// DrProtectionGroupId: testDrProtectionGroup.Id,
// DisplayName: pulumi.StringRef(drPlanDisplayName),
// DrPlanId: pulumi.StringRef(testDrPlan.Id),
// DrPlanType: pulumi.StringRef(drPlanDrPlanType),
// State: pulumi.StringRef(drPlanState),
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func GetDrPlans(ctx *pulumi.Context, args *GetDrPlansArgs, opts ...pulumi.InvokeOption) (*GetDrPlansResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetDrPlansResult
err := ctx.Invoke("oci:DisasterRecovery/getDrPlans:getDrPlans", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getDrPlans.
type GetDrPlansArgs struct {
// A filter to return only resources that match the given display name. Example: `MyResourceDisplayName`
DisplayName *string `pulumi:"displayName"`
// The OCID of the DR plan. Example: `ocid1.drplan.oc1..uniqueID`
DrPlanId *string `pulumi:"drPlanId"`
// The DR plan type.
DrPlanType *string `pulumi:"drPlanType"`
// The OCID of the DR protection group. Mandatory query param. Example: `ocid1.drprotectiongroup.oc1..uniqueID`
DrProtectionGroupId string `pulumi:"drProtectionGroupId"`
Filters []GetDrPlansFilter `pulumi:"filters"`
// A filter to return only DR plans that match the given lifecycle state.
State *string `pulumi:"state"`
}
// A collection of values returned by getDrPlans.
type GetDrPlansResult struct {
// The display name of the group. Example: `DATABASE_SWITCHOVER`
DisplayName *string `pulumi:"displayName"`
// The list of dr_plan_collection.
DrPlanCollections []GetDrPlansDrPlanCollection `pulumi:"drPlanCollections"`
DrPlanId *string `pulumi:"drPlanId"`
DrPlanType *string `pulumi:"drPlanType"`
// The OCID of the DR protection group to which this DR plan belongs. Example: `ocid1.drplan.oc1..uniqueID`
DrProtectionGroupId string `pulumi:"drProtectionGroupId"`
Filters []GetDrPlansFilter `pulumi:"filters"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// The current state of the DR plan.
State *string `pulumi:"state"`
}
func GetDrPlansOutput(ctx *pulumi.Context, args GetDrPlansOutputArgs, opts ...pulumi.InvokeOption) GetDrPlansResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetDrPlansResult, error) {
args := v.(GetDrPlansArgs)
r, err := GetDrPlans(ctx, &args, opts...)
var s GetDrPlansResult
if r != nil {
s = *r
}
return s, err
}).(GetDrPlansResultOutput)
}
// A collection of arguments for invoking getDrPlans.
type GetDrPlansOutputArgs struct {
// A filter to return only resources that match the given display name. Example: `MyResourceDisplayName`
DisplayName pulumi.StringPtrInput `pulumi:"displayName"`
// The OCID of the DR plan. Example: `ocid1.drplan.oc1..uniqueID`
DrPlanId pulumi.StringPtrInput `pulumi:"drPlanId"`
// The DR plan type.
DrPlanType pulumi.StringPtrInput `pulumi:"drPlanType"`
// The OCID of the DR protection group. Mandatory query param. Example: `ocid1.drprotectiongroup.oc1..uniqueID`
DrProtectionGroupId pulumi.StringInput `pulumi:"drProtectionGroupId"`
Filters GetDrPlansFilterArrayInput `pulumi:"filters"`
// A filter to return only DR plans that match the given lifecycle state.
State pulumi.StringPtrInput `pulumi:"state"`
}
func (GetDrPlansOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetDrPlansArgs)(nil)).Elem()
}
// A collection of values returned by getDrPlans.
type GetDrPlansResultOutput struct{ *pulumi.OutputState }
func (GetDrPlansResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetDrPlansResult)(nil)).Elem()
}
func (o GetDrPlansResultOutput) ToGetDrPlansResultOutput() GetDrPlansResultOutput {
return o
}
func (o GetDrPlansResultOutput) ToGetDrPlansResultOutputWithContext(ctx context.Context) GetDrPlansResultOutput {
return o
}
// The display name of the group. Example: `DATABASE_SWITCHOVER`
func (o GetDrPlansResultOutput) DisplayName() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetDrPlansResult) *string { return v.DisplayName }).(pulumi.StringPtrOutput)
}
// The list of dr_plan_collection.
func (o GetDrPlansResultOutput) DrPlanCollections() GetDrPlansDrPlanCollectionArrayOutput {
return o.ApplyT(func(v GetDrPlansResult) []GetDrPlansDrPlanCollection { return v.DrPlanCollections }).(GetDrPlansDrPlanCollectionArrayOutput)
}
func (o GetDrPlansResultOutput) DrPlanId() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetDrPlansResult) *string { return v.DrPlanId }).(pulumi.StringPtrOutput)
}
func (o GetDrPlansResultOutput) DrPlanType() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetDrPlansResult) *string { return v.DrPlanType }).(pulumi.StringPtrOutput)
}
// The OCID of the DR protection group to which this DR plan belongs. Example: `ocid1.drplan.oc1..uniqueID`
func (o GetDrPlansResultOutput) DrProtectionGroupId() pulumi.StringOutput {
return o.ApplyT(func(v GetDrPlansResult) string { return v.DrProtectionGroupId }).(pulumi.StringOutput)
}
func (o GetDrPlansResultOutput) Filters() GetDrPlansFilterArrayOutput {
return o.ApplyT(func(v GetDrPlansResult) []GetDrPlansFilter { return v.Filters }).(GetDrPlansFilterArrayOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetDrPlansResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetDrPlansResult) string { return v.Id }).(pulumi.StringOutput)
}
// The current state of the DR plan.
func (o GetDrPlansResultOutput) State() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetDrPlansResult) *string { return v.State }).(pulumi.StringPtrOutput)
}
func init() {
pulumi.RegisterOutputType(GetDrPlansResultOutput{})
}