...
1
2
3
4 package location
5
6
7
8
9 import (
10 "encoding/xml"
11
12 "github.com/Azure/azure-sdk-for-go/services/classic/management"
13 )
14
15 const (
16 azureLocationListURL = "locations"
17 errParamNotSpecified = "Parameter %s is not specified."
18 )
19
20
21 func NewClient(client management.Client) LocationClient {
22 return LocationClient{client: client}
23 }
24
25 func (c LocationClient) ListLocations() (ListLocationsResponse, error) {
26 var l ListLocationsResponse
27
28 response, err := c.client.SendAzureGetRequest(azureLocationListURL)
29 if err != nil {
30 return l, err
31 }
32
33 err = xml.Unmarshal(response, &l)
34 return l, err
35 }
36
View as plain text