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
=== modified file 'management_base.go'
--- management_base.go 2014-03-12 03:56:53 +0000
+++ management_base.go 2014-06-24 09:45:42 +0000
@@ -593,7 +593,7 @@
593// be nil.593// be nil.
594// See http://msdn.microsoft.com/en-us/library/windowsazure/jj157196.aspx594// See http://msdn.microsoft.com/en-us/library/windowsazure/jj157196.aspx
595func (api *ManagementAPI) GetNetworkConfiguration() (*NetworkConfiguration, error) {595func (api *ManagementAPI) GetNetworkConfiguration() (*NetworkConfiguration, error) {
596 response, err := api.session.get("services/networking/media", "2013-10-01")596 response, err := api.session.get("services/networking/media", "2012-03-01")
597 if err != nil {597 if err != nil {
598 if IsNotFoundError(err) {598 if IsNotFoundError(err) {
599 return nil, nil599 return nil, nil
@@ -618,8 +618,9 @@
618 return err618 return err
619 }619 }
620 response, err := api.session.put(620 response, err := api.session.put(
621 "services/networking/media", "2013-10-01", []byte(body),621 "services/networking/media", "2012-03-01", []byte(body),
622 "application/octet-stream")622 "text/plain",
623 )
623 if err != nil {624 if err != nil {
624 return err625 return err
625 }626 }
626627
=== modified file 'xmlobjects.go'
--- xmlobjects.go 2014-03-10 03:56:29 +0000
+++ xmlobjects.go 2014-06-24 09:45:42 +0000
@@ -499,7 +499,7 @@
499 Locked string `xml:"Locked,omitempty"` // Only used for "Get Deployment."499 Locked string `xml:"Locked,omitempty"` // Only used for "Get Deployment."
500 RollbackAllowed string `xml:"RollbackAllowed,omitempty"` // Only used for "Get Deployment."500 RollbackAllowed string `xml:"RollbackAllowed,omitempty"` // Only used for "Get Deployment."
501 VirtualNetworkName string `xml:VirtualNetworkName,omitempty"`501 VirtualNetworkName string `xml:VirtualNetworkName,omitempty"`
502 DNS []DnsServer `xml:"Dns>DnsServers>DnsServer",omitempty`502 DNS []DnsServer `xml:"Dns>DnsServers>DnsServer,omitempty"`
503 ExtendedProperties []ExtendedProperty `xml:"ExtendedProperties>ExtendedProperty,omitempty"` // Only used for "Get Deployment."503 ExtendedProperties []ExtendedProperty `xml:"ExtendedProperties>ExtendedProperty,omitempty"` // Only used for "Get Deployment."
504}504}
505505
@@ -667,18 +667,19 @@
667667
668type VirtualNetworkSite struct {668type VirtualNetworkSite struct {
669 Name string `xml:"name,attr"`669 Name string `xml:"name,attr"`
670 AffinityGroup string `xml:"AffinityGroup,attr"`670 AffinityGroup string `xml:"AffinityGroup,attr,omitempty"`
671 Location string `xml:"Location,attr,omitempty"`
671 AddressSpacePrefixes []string `xml:"AddressSpace>AddressPrefix"`672 AddressSpacePrefixes []string `xml:"AddressSpace>AddressPrefix"`
672 Subnets *[]Subnet `xml:"Subnets>Subnet",omitempty`673 Subnets *[]Subnet `xml:"Subnets>Subnet,omitempty"`
673 DnsServersRef *[]DnsServerRef `xml:"DnsServersRef>DnsServerRef",omitempty`674 DnsServersRef *[]DnsServerRef `xml:"DnsServersRef>DnsServerRef,omitempty"`
674 Gateway *Gateway `xml:"Gateway",omitempty`675 Gateway *Gateway `xml:"Gateway,omitempty"`
675}676}
676677
677type NetworkConfiguration struct {678type NetworkConfiguration struct {
678 XMLNS string `xml:"xmlns,attr"`679 XMLNS string `xml:"xmlns,attr"`
679 DNS *[]VirtualNetDnsServer `xml:"VirtualNetworkConfiguration>Dns>DnsServers>DnsServer",omitempty`680 DNS *[]VirtualNetDnsServer `xml:"VirtualNetworkConfiguration>Dns>DnsServers>DnsServer,omitempty"`
680 LocalNetworkSites *[]LocalNetworkSite `xml:"VirtualNetworkConfiguration>LocalNetworkSites>LocalNetworkSite",omitempty`681 LocalNetworkSites *[]LocalNetworkSite `xml:"VirtualNetworkConfiguration>LocalNetworkSites>LocalNetworkSite,omitempty"`
681 VirtualNetworkSites *[]VirtualNetworkSite `xml:"VirtualNetworkConfiguration>VirtualNetworkSites>VirtualNetworkSite",omitempty`682 VirtualNetworkSites *[]VirtualNetworkSite `xml:"VirtualNetworkConfiguration>VirtualNetworkSites>VirtualNetworkSite,omitempty"`
682}683}
683684
684func (nc *NetworkConfiguration) Serialize() (string, error) {685func (nc *NetworkConfiguration) Serialize() (string, error) {
@@ -698,7 +699,7 @@
698 XMLNS string `xml:"xmlns,attr"`699 XMLNS string `xml:"xmlns,attr"`
699 Name string `xml:"Name"`700 Name string `xml:"Name"`
700 Label string `xml:"Label"` // Must be base64 encoded.701 Label string `xml:"Label"` // Must be base64 encoded.
701 Description string `xml:"Description",omitempty`702 Description string `xml:"Description,omitempty"`
702 Location string `xml:"Location"` // Value comes from ListLocations.703 Location string `xml:"Location"` // Value comes from ListLocations.
703}704}
704705
@@ -721,7 +722,7 @@
721type UpdateAffinityGroup struct {722type UpdateAffinityGroup struct {
722 XMLNS string `xml:"xmlns,attr"`723 XMLNS string `xml:"xmlns,attr"`
723 Label string `xml:"Label"` // Must be base64 encoded.724 Label string `xml:"Label"` // Must be base64 encoded.
724 Description string `xml:"Description",omitempty`725 Description string `xml:"Description,omitempty"`
725}726}
726727
727func (u *UpdateAffinityGroup) Serialize() (string, error) {728func (u *UpdateAffinityGroup) Serialize() (string, error) {

Subscribers

People subscribed via source and target branches

to all changes: