Merge lp:~axwalk/gwacl/vnet-location-docalignment into lp:gwacl

Proposed by Andrew Wilkins on 2014-06-24
Status: Merged
Approved by: Andrew Wilkins on 2014-06-25
Approved revision: 236
Merged at revision: 236
Proposed branch: lp:~axwalk/gwacl/vnet-location-docalignment
Merge into: lp:gwacl
Diff against target: 82 lines (+15/-13)
2 files modified
management_base.go (+4/-3)
xmlobjects.go (+11/-10)
To merge this branch: bzr merge lp:~axwalk/gwacl/vnet-location-docalignment
Reviewer Review Type Date Requested Status
Ian Booth 2014-06-24 Approve on 2014-06-25
Review via email: mp+224254@code.launchpad.net

Commit message

Virtual networking changes

- Add Location field to NetworkConfiguration,
  so we can use that instead of AffinityGroup
  as the docs recommend.
- Use text/plain content-type in network config
  PUT, as specified in the docs.
- Use the most recent version for the network
  config APIs, which is actually older than what
  was in the code.
- Fix various "omitempty" tags.

Description of the change

Virtual networking changes

- Add Location field to NetworkConfiguration,
  so we can use that instead of AffinityGroup
  as the docs recommend.
- Use text/plain content-type in network config
  PUT, as specified in the docs.
- Use the most recent version for the network
  config APIs, which is actually older than what
  was in the code.
- Fix various "omitempty" tags.

To post a comment you must log in.
Ian Booth (wallyworld) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'management_base.go'
2--- management_base.go 2014-03-12 03:56:53 +0000
3+++ management_base.go 2014-06-24 09:45:42 +0000
4@@ -593,7 +593,7 @@
5 // be nil.
6 // See http://msdn.microsoft.com/en-us/library/windowsazure/jj157196.aspx
7 func (api *ManagementAPI) GetNetworkConfiguration() (*NetworkConfiguration, error) {
8- response, err := api.session.get("services/networking/media", "2013-10-01")
9+ response, err := api.session.get("services/networking/media", "2012-03-01")
10 if err != nil {
11 if IsNotFoundError(err) {
12 return nil, nil
13@@ -618,8 +618,9 @@
14 return err
15 }
16 response, err := api.session.put(
17- "services/networking/media", "2013-10-01", []byte(body),
18- "application/octet-stream")
19+ "services/networking/media", "2012-03-01", []byte(body),
20+ "text/plain",
21+ )
22 if err != nil {
23 return err
24 }
25
26=== modified file 'xmlobjects.go'
27--- xmlobjects.go 2014-03-10 03:56:29 +0000
28+++ xmlobjects.go 2014-06-24 09:45:42 +0000
29@@ -499,7 +499,7 @@
30 Locked string `xml:"Locked,omitempty"` // Only used for "Get Deployment."
31 RollbackAllowed string `xml:"RollbackAllowed,omitempty"` // Only used for "Get Deployment."
32 VirtualNetworkName string `xml:VirtualNetworkName,omitempty"`
33- DNS []DnsServer `xml:"Dns>DnsServers>DnsServer",omitempty`
34+ DNS []DnsServer `xml:"Dns>DnsServers>DnsServer,omitempty"`
35 ExtendedProperties []ExtendedProperty `xml:"ExtendedProperties>ExtendedProperty,omitempty"` // Only used for "Get Deployment."
36 }
37
38@@ -667,18 +667,19 @@
39
40 type VirtualNetworkSite struct {
41 Name string `xml:"name,attr"`
42- AffinityGroup string `xml:"AffinityGroup,attr"`
43+ AffinityGroup string `xml:"AffinityGroup,attr,omitempty"`
44+ Location string `xml:"Location,attr,omitempty"`
45 AddressSpacePrefixes []string `xml:"AddressSpace>AddressPrefix"`
46- Subnets *[]Subnet `xml:"Subnets>Subnet",omitempty`
47- DnsServersRef *[]DnsServerRef `xml:"DnsServersRef>DnsServerRef",omitempty`
48- Gateway *Gateway `xml:"Gateway",omitempty`
49+ Subnets *[]Subnet `xml:"Subnets>Subnet,omitempty"`
50+ DnsServersRef *[]DnsServerRef `xml:"DnsServersRef>DnsServerRef,omitempty"`
51+ Gateway *Gateway `xml:"Gateway,omitempty"`
52 }
53
54 type NetworkConfiguration struct {
55 XMLNS string `xml:"xmlns,attr"`
56- DNS *[]VirtualNetDnsServer `xml:"VirtualNetworkConfiguration>Dns>DnsServers>DnsServer",omitempty`
57- LocalNetworkSites *[]LocalNetworkSite `xml:"VirtualNetworkConfiguration>LocalNetworkSites>LocalNetworkSite",omitempty`
58- VirtualNetworkSites *[]VirtualNetworkSite `xml:"VirtualNetworkConfiguration>VirtualNetworkSites>VirtualNetworkSite",omitempty`
59+ DNS *[]VirtualNetDnsServer `xml:"VirtualNetworkConfiguration>Dns>DnsServers>DnsServer,omitempty"`
60+ LocalNetworkSites *[]LocalNetworkSite `xml:"VirtualNetworkConfiguration>LocalNetworkSites>LocalNetworkSite,omitempty"`
61+ VirtualNetworkSites *[]VirtualNetworkSite `xml:"VirtualNetworkConfiguration>VirtualNetworkSites>VirtualNetworkSite,omitempty"`
62 }
63
64 func (nc *NetworkConfiguration) Serialize() (string, error) {
65@@ -698,7 +699,7 @@
66 XMLNS string `xml:"xmlns,attr"`
67 Name string `xml:"Name"`
68 Label string `xml:"Label"` // Must be base64 encoded.
69- Description string `xml:"Description",omitempty`
70+ Description string `xml:"Description,omitempty"`
71 Location string `xml:"Location"` // Value comes from ListLocations.
72 }
73
74@@ -721,7 +722,7 @@
75 type UpdateAffinityGroup struct {
76 XMLNS string `xml:"xmlns,attr"`
77 Label string `xml:"Label"` // Must be base64 encoded.
78- Description string `xml:"Description",omitempty`
79+ Description string `xml:"Description,omitempty"`
80 }
81
82 func (u *UpdateAffinityGroup) Serialize() (string, error) {

Subscribers

People subscribed via source and target branches

to all changes: