-
Notifications
You must be signed in to change notification settings - Fork 8
/
endpointV3.go
194 lines (181 loc) · 6.4 KB
/
endpointV3.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
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package identity
import (
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Manages a V3 Endpoint resource within OpenStack Keystone.
//
// > **Note:** This usually requires admin privileges.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-openstack/sdk/v2/go/openstack/identity"
// "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// service1, err := identity.NewServiceV3(ctx, "service1", &identity.ServiceV3Args{
// Type: pulumi.String("my-service-type"),
// })
// if err != nil {
// return err
// }
// _, err = identity.NewEndpointV3(ctx, "endpoint1", &identity.EndpointV3Args{
// EndpointRegion: service1.Region,
// ServiceId: service1.ID(),
// Url: pulumi.String("http://my-endpoint"),
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
type EndpointV3 struct {
pulumi.CustomResourceState
// The endpoint region. The `region` and
// `endpointRegion` can be different.
EndpointRegion pulumi.StringOutput `pulumi:"endpointRegion"`
// The endpoint interface. Valid values are `public`,
// `internal` and `admin`. Default value is `public`
Interface pulumi.StringPtrOutput `pulumi:"interface"`
// The endpoint name.
Name pulumi.StringOutput `pulumi:"name"`
// The region in which to obtain the V3 Keystone client.
// If omitted, the `region` argument of the provider is used.
Region pulumi.StringOutput `pulumi:"region"`
// The endpoint service ID.
ServiceId pulumi.StringOutput `pulumi:"serviceId"`
// The service name of the endpoint.
ServiceName pulumi.StringOutput `pulumi:"serviceName"`
// The service type of the endpoint.
ServiceType pulumi.StringOutput `pulumi:"serviceType"`
// The endpoint url.
Url pulumi.StringOutput `pulumi:"url"`
}
// NewEndpointV3 registers a new resource with the given unique name, arguments, and options.
func NewEndpointV3(ctx *pulumi.Context,
name string, args *EndpointV3Args, opts ...pulumi.ResourceOption) (*EndpointV3, error) {
if args == nil || args.EndpointRegion == nil {
return nil, errors.New("missing required argument 'EndpointRegion'")
}
if args == nil || args.ServiceId == nil {
return nil, errors.New("missing required argument 'ServiceId'")
}
if args == nil || args.Url == nil {
return nil, errors.New("missing required argument 'Url'")
}
if args == nil {
args = &EndpointV3Args{}
}
var resource EndpointV3
err := ctx.RegisterResource("openstack:identity/endpointV3:EndpointV3", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetEndpointV3 gets an existing EndpointV3 resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetEndpointV3(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *EndpointV3State, opts ...pulumi.ResourceOption) (*EndpointV3, error) {
var resource EndpointV3
err := ctx.ReadResource("openstack:identity/endpointV3:EndpointV3", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering EndpointV3 resources.
type endpointV3State struct {
// The endpoint region. The `region` and
// `endpointRegion` can be different.
EndpointRegion *string `pulumi:"endpointRegion"`
// The endpoint interface. Valid values are `public`,
// `internal` and `admin`. Default value is `public`
Interface *string `pulumi:"interface"`
// The endpoint name.
Name *string `pulumi:"name"`
// The region in which to obtain the V3 Keystone client.
// If omitted, the `region` argument of the provider is used.
Region *string `pulumi:"region"`
// The endpoint service ID.
ServiceId *string `pulumi:"serviceId"`
// The service name of the endpoint.
ServiceName *string `pulumi:"serviceName"`
// The service type of the endpoint.
ServiceType *string `pulumi:"serviceType"`
// The endpoint url.
Url *string `pulumi:"url"`
}
type EndpointV3State struct {
// The endpoint region. The `region` and
// `endpointRegion` can be different.
EndpointRegion pulumi.StringPtrInput
// The endpoint interface. Valid values are `public`,
// `internal` and `admin`. Default value is `public`
Interface pulumi.StringPtrInput
// The endpoint name.
Name pulumi.StringPtrInput
// The region in which to obtain the V3 Keystone client.
// If omitted, the `region` argument of the provider is used.
Region pulumi.StringPtrInput
// The endpoint service ID.
ServiceId pulumi.StringPtrInput
// The service name of the endpoint.
ServiceName pulumi.StringPtrInput
// The service type of the endpoint.
ServiceType pulumi.StringPtrInput
// The endpoint url.
Url pulumi.StringPtrInput
}
func (EndpointV3State) ElementType() reflect.Type {
return reflect.TypeOf((*endpointV3State)(nil)).Elem()
}
type endpointV3Args struct {
// The endpoint region. The `region` and
// `endpointRegion` can be different.
EndpointRegion string `pulumi:"endpointRegion"`
// The endpoint interface. Valid values are `public`,
// `internal` and `admin`. Default value is `public`
Interface *string `pulumi:"interface"`
// The endpoint name.
Name *string `pulumi:"name"`
// The region in which to obtain the V3 Keystone client.
// If omitted, the `region` argument of the provider is used.
Region *string `pulumi:"region"`
// The endpoint service ID.
ServiceId string `pulumi:"serviceId"`
// The endpoint url.
Url string `pulumi:"url"`
}
// The set of arguments for constructing a EndpointV3 resource.
type EndpointV3Args struct {
// The endpoint region. The `region` and
// `endpointRegion` can be different.
EndpointRegion pulumi.StringInput
// The endpoint interface. Valid values are `public`,
// `internal` and `admin`. Default value is `public`
Interface pulumi.StringPtrInput
// The endpoint name.
Name pulumi.StringPtrInput
// The region in which to obtain the V3 Keystone client.
// If omitted, the `region` argument of the provider is used.
Region pulumi.StringPtrInput
// The endpoint service ID.
ServiceId pulumi.StringInput
// The endpoint url.
Url pulumi.StringInput
}
func (EndpointV3Args) ElementType() reflect.Type {
return reflect.TypeOf((*endpointV3Args)(nil)).Elem()
}