/
getEndpoint.go
84 lines (79 loc) · 2.69 KB
/
getEndpoint.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
// *** 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 (
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Use this data source to get the ID of an OpenStack endpoint.
//
// > **Note:** This usually requires admin privileges.
//
// > This content is derived from https://github.com/terraform-providers/terraform-provider-openstack/blob/master/website/docs/d/identity_endpoint_v3.html.markdown.
func LookupEndpoint(ctx *pulumi.Context, args *GetEndpointArgs) (*GetEndpointResult, error) {
inputs := make(map[string]interface{})
if args != nil {
inputs["endpointRegion"] = args.EndpointRegion
inputs["interface"] = args.Interface
inputs["name"] = args.Name
inputs["region"] = args.Region
inputs["serviceId"] = args.ServiceId
inputs["serviceName"] = args.ServiceName
inputs["serviceType"] = args.ServiceType
}
outputs, err := ctx.Invoke("openstack:identity/getEndpoint:getEndpoint", inputs)
if err != nil {
return nil, err
}
return &GetEndpointResult{
EndpointRegion: outputs["endpointRegion"],
Interface: outputs["interface"],
Name: outputs["name"],
Region: outputs["region"],
ServiceId: outputs["serviceId"],
ServiceName: outputs["serviceName"],
ServiceType: outputs["serviceType"],
Url: outputs["url"],
Id: outputs["id"],
}, nil
}
// A collection of arguments for invoking getEndpoint.
type GetEndpointArgs struct {
// The region the endpoint is assigned to. The
// `region` and `endpointRegion` can be different.
EndpointRegion interface{}
// The endpoint interface. Valid values are `public`,
// `internal`, and `admin`. Default value is `public`
Interface interface{}
// The name of the endpoint.
Name interface{}
// The region in which to obtain the V3 Keystone client.
// If omitted, the `region` argument of the provider is used.
Region interface{}
// The service id this endpoint belongs to.
ServiceId interface{}
// The service name of the endpoint.
ServiceName interface{}
// The service type of the endpoint.
ServiceType interface{}
}
// A collection of values returned by getEndpoint.
type GetEndpointResult struct {
// See Argument Reference above.
EndpointRegion interface{}
// See Argument Reference above.
Interface interface{}
// See Argument Reference above.
Name interface{}
// See Argument Reference above.
Region interface{}
// See Argument Reference above.
ServiceId interface{}
// See Argument Reference above.
ServiceName interface{}
// See Argument Reference above.
ServiceType interface{}
// The endpoint URL.
Url interface{}
// id is the provider-assigned unique ID for this managed resource.
Id interface{}
}