Example #1
0
//OpenstackEndpoint returns API endpoint for each service name
func OpenstackEndpoint(client *gophercloud.ServiceClient, endpointType, name, region, availability string) (interface{}, error) {
	if availability == "" {
		availability = "public"
	}
	return client.EndpointLocator(
		gophercloud.EndpointOpts{
			Type:         endpointType,
			Name:         name,
			Region:       region,
			Availability: gophercloud.Availability(availability),
		})
}