generated from pulumi/pulumi-tf-provider-boilerplate
/
getHttpRedirects.go
181 lines (158 loc) · 7.67 KB
/
getHttpRedirects.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
// 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 waas
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 Http Redirects in Oracle Cloud Infrastructure Web Application Acceleration and Security service.
//
// Gets a list of HTTP Redirects.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-oci/sdk/go/oci/Waas"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := Waas.GetHttpRedirects(ctx, &waas.GetHttpRedirectsArgs{
// CompartmentId: compartmentId,
// DisplayNames: httpRedirectDisplayNames,
// Ids: httpRedirectIds,
// States: httpRedirectStates,
// TimeCreatedGreaterThanOrEqualTo: pulumi.StringRef(httpRedirectTimeCreatedGreaterThanOrEqualTo),
// TimeCreatedLessThan: pulumi.StringRef(httpRedirectTimeCreatedLessThan),
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func GetHttpRedirects(ctx *pulumi.Context, args *GetHttpRedirectsArgs, opts ...pulumi.InvokeOption) (*GetHttpRedirectsResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetHttpRedirectsResult
err := ctx.Invoke("oci:Waas/getHttpRedirects:getHttpRedirects", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getHttpRedirects.
type GetHttpRedirectsArgs struct {
// The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. This number is generated when the compartment is created.
CompartmentId string `pulumi:"compartmentId"`
// Filter redirects using a display name.
DisplayNames []string `pulumi:"displayNames"`
Filters []GetHttpRedirectsFilter `pulumi:"filters"`
// Filter redirects using a list of redirect OCIDs.
Ids []string `pulumi:"ids"`
// Filter redirects using a list of lifecycle states.
States []string `pulumi:"states"`
// A filter that matches redirects created on or after the specified date and time.
TimeCreatedGreaterThanOrEqualTo *string `pulumi:"timeCreatedGreaterThanOrEqualTo"`
// A filter that matches redirects created before the specified date-time. Default to 1 day before now.
TimeCreatedLessThan *string `pulumi:"timeCreatedLessThan"`
}
// A collection of values returned by getHttpRedirects.
type GetHttpRedirectsResult struct {
// The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the HTTP Redirect's compartment.
CompartmentId string `pulumi:"compartmentId"`
DisplayNames []string `pulumi:"displayNames"`
Filters []GetHttpRedirectsFilter `pulumi:"filters"`
// The list of http_redirects.
HttpRedirects []GetHttpRedirectsHttpRedirect `pulumi:"httpRedirects"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
Ids []string `pulumi:"ids"`
States []string `pulumi:"states"`
TimeCreatedGreaterThanOrEqualTo *string `pulumi:"timeCreatedGreaterThanOrEqualTo"`
TimeCreatedLessThan *string `pulumi:"timeCreatedLessThan"`
}
func GetHttpRedirectsOutput(ctx *pulumi.Context, args GetHttpRedirectsOutputArgs, opts ...pulumi.InvokeOption) GetHttpRedirectsResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetHttpRedirectsResult, error) {
args := v.(GetHttpRedirectsArgs)
r, err := GetHttpRedirects(ctx, &args, opts...)
var s GetHttpRedirectsResult
if r != nil {
s = *r
}
return s, err
}).(GetHttpRedirectsResultOutput)
}
// A collection of arguments for invoking getHttpRedirects.
type GetHttpRedirectsOutputArgs struct {
// The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment. This number is generated when the compartment is created.
CompartmentId pulumi.StringInput `pulumi:"compartmentId"`
// Filter redirects using a display name.
DisplayNames pulumi.StringArrayInput `pulumi:"displayNames"`
Filters GetHttpRedirectsFilterArrayInput `pulumi:"filters"`
// Filter redirects using a list of redirect OCIDs.
Ids pulumi.StringArrayInput `pulumi:"ids"`
// Filter redirects using a list of lifecycle states.
States pulumi.StringArrayInput `pulumi:"states"`
// A filter that matches redirects created on or after the specified date and time.
TimeCreatedGreaterThanOrEqualTo pulumi.StringPtrInput `pulumi:"timeCreatedGreaterThanOrEqualTo"`
// A filter that matches redirects created before the specified date-time. Default to 1 day before now.
TimeCreatedLessThan pulumi.StringPtrInput `pulumi:"timeCreatedLessThan"`
}
func (GetHttpRedirectsOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetHttpRedirectsArgs)(nil)).Elem()
}
// A collection of values returned by getHttpRedirects.
type GetHttpRedirectsResultOutput struct{ *pulumi.OutputState }
func (GetHttpRedirectsResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetHttpRedirectsResult)(nil)).Elem()
}
func (o GetHttpRedirectsResultOutput) ToGetHttpRedirectsResultOutput() GetHttpRedirectsResultOutput {
return o
}
func (o GetHttpRedirectsResultOutput) ToGetHttpRedirectsResultOutputWithContext(ctx context.Context) GetHttpRedirectsResultOutput {
return o
}
// The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the HTTP Redirect's compartment.
func (o GetHttpRedirectsResultOutput) CompartmentId() pulumi.StringOutput {
return o.ApplyT(func(v GetHttpRedirectsResult) string { return v.CompartmentId }).(pulumi.StringOutput)
}
func (o GetHttpRedirectsResultOutput) DisplayNames() pulumi.StringArrayOutput {
return o.ApplyT(func(v GetHttpRedirectsResult) []string { return v.DisplayNames }).(pulumi.StringArrayOutput)
}
func (o GetHttpRedirectsResultOutput) Filters() GetHttpRedirectsFilterArrayOutput {
return o.ApplyT(func(v GetHttpRedirectsResult) []GetHttpRedirectsFilter { return v.Filters }).(GetHttpRedirectsFilterArrayOutput)
}
// The list of http_redirects.
func (o GetHttpRedirectsResultOutput) HttpRedirects() GetHttpRedirectsHttpRedirectArrayOutput {
return o.ApplyT(func(v GetHttpRedirectsResult) []GetHttpRedirectsHttpRedirect { return v.HttpRedirects }).(GetHttpRedirectsHttpRedirectArrayOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetHttpRedirectsResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetHttpRedirectsResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o GetHttpRedirectsResultOutput) Ids() pulumi.StringArrayOutput {
return o.ApplyT(func(v GetHttpRedirectsResult) []string { return v.Ids }).(pulumi.StringArrayOutput)
}
func (o GetHttpRedirectsResultOutput) States() pulumi.StringArrayOutput {
return o.ApplyT(func(v GetHttpRedirectsResult) []string { return v.States }).(pulumi.StringArrayOutput)
}
func (o GetHttpRedirectsResultOutput) TimeCreatedGreaterThanOrEqualTo() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetHttpRedirectsResult) *string { return v.TimeCreatedGreaterThanOrEqualTo }).(pulumi.StringPtrOutput)
}
func (o GetHttpRedirectsResultOutput) TimeCreatedLessThan() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetHttpRedirectsResult) *string { return v.TimeCreatedLessThan }).(pulumi.StringPtrOutput)
}
func init() {
pulumi.RegisterOutputType(GetHttpRedirectsResultOutput{})
}