Merge lp:~allenap/gwacl/list-hosted-services into lp:gwacl

Proposed by Gavin Panella
Status: Merged
Approved by: Gavin Panella
Approved revision: 110
Merged at revision: 109
Proposed branch: lp:~allenap/gwacl/list-hosted-services
Merge into: lp:gwacl
Diff against target: 73 lines (+8/-6)
4 files modified
example/management/run.go (+1/-1)
management.go (+2/-2)
management_test.go (+3/-3)
xmlobjects.go (+2/-0)
To merge this branch: bzr merge lp:~allenap/gwacl/list-hosted-services
Reviewer Review Type Date Requested Status
Julian Edwards (community) Approve
Review via email: mp+169931@code.launchpad.net

Commit message

Rename ListHostedServiceDescriptors to ListHostedServices to match Azure's naming.

To post a comment you must log in.
Revision history for this message
Julian Edwards (julian-edwards) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

 review: approve
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlG/t58ACgkQWhGlTF8G/HdWNwCgnZ8+MQ9hR+/FajX6h7IQI758
b+kAoIl2BDnLxiLaHYJXCoSaCs3MJsGh
=jz/b
-----END PGP SIGNATURE-----

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'example/management/run.go'
--- example/management/run.go 2013-06-11 10:14:14 +0000
+++ example/management/run.go 2013-06-17 19:58:28 +0000
@@ -106,7 +106,7 @@
106 fmt.Println("Done creating a hosted service\n")106 fmt.Println("Done creating a hosted service\n")
107107
108 fmt.Println("Listing hosted services...")108 fmt.Println("Listing hosted services...")
109 hostedServices, err := api.ListHostedServiceDescriptors()109 hostedServices, err := api.ListHostedServices()
110 checkError(err)110 checkError(err)
111 fmt.Printf("Got %d hosted service(s)\n", len(hostedServices))111 fmt.Printf("Got %d hosted service(s)\n", len(hostedServices))
112 if len(hostedServices) > 0 {112 if len(hostedServices) > 0 {
113113
=== renamed file 'managementapi.go' => 'management.go'
--- managementapi.go 2013-04-26 15:31:50 +0000
+++ management.go 2013-06-17 19:58:28 +0000
@@ -106,11 +106,11 @@
106 return &images, err106 return &images, err
107}107}
108108
109// ListHostedServiceDescriptors loads a list of HostedServiceDescriptor objects from the109// ListHostedServices loads a list of HostedServiceDescriptor objects from the
110// Azure management API. 110// Azure management API.
111// HostedServiceDescriptor objects contains a small subset of the fields present in111// HostedServiceDescriptor objects contains a small subset of the fields present in
112// HostedService objects.112// HostedService objects.
113func (api *ManagementAPI) ListHostedServiceDescriptors() ([]HostedServiceDescriptor, error) {113func (api *ManagementAPI) ListHostedServices() ([]HostedServiceDescriptor, error) {
114 URI := "services/hostedservices"114 URI := "services/hostedservices"
115 res, err := api.session.get(URI)115 res, err := api.session.get(URI)
116 if err != nil {116 if err != nil {
117117
=== renamed file 'managementapi_test.go' => 'management_test.go'
--- managementapi_test.go 2013-04-26 15:41:12 +0000
+++ management_test.go 2013-06-17 19:58:28 +0000
@@ -350,7 +350,7 @@
350 c.Check(receivedNames, DeepEquals, imageNames)350 c.Check(receivedNames, DeepEquals, imageNames)
351}351}
352352
353func (suite *managementAPISuite) TestListHostedServiceDescriptors(c *C) {353func (suite *managementAPISuite) TestListHostedServices(c *C) {
354 api := makeAPI(c)354 api := makeAPI(c)
355 fixedResponse := x509Response{355 fixedResponse := x509Response{
356 StatusCode: http.StatusOK,356 StatusCode: http.StatusOK,
@@ -360,14 +360,14 @@
360 recordedRequests := make([]*x509Request, 0)360 recordedRequests := make([]*x509Request, 0)
361 rigRecordingDispatcher(&recordedRequests)361 rigRecordingDispatcher(&recordedRequests)
362362
363 _, err := api.ListHostedServiceDescriptors()363 _, err := api.ListHostedServices()
364364
365 c.Assert(err, IsNil)365 c.Assert(err, IsNil)
366 expectedURL := AZURE_URL + api.session.subscriptionId + "/services/hostedservices"366 expectedURL := AZURE_URL + api.session.subscriptionId + "/services/hostedservices"
367 checkOneRequest(c, &recordedRequests, expectedURL, []byte{}, "GET")367 checkOneRequest(c, &recordedRequests, expectedURL, []byte{}, "GET")
368}368}
369369
370// TODO test that ListHostedServiceDescriptors parses the structures correctly370// TODO test that ListHostedServices parses the structures correctly
371371
372func (suite *managementAPISuite) TestLoadHostedService(c *C) {372func (suite *managementAPISuite) TestLoadHostedService(c *C) {
373 api := makeAPI(c)373 api := makeAPI(c)
374374
=== modified file 'xmlobjects.go'
--- xmlobjects.go 2013-06-11 10:14:14 +0000
+++ xmlobjects.go 2013-06-17 19:58:28 +0000
@@ -293,6 +293,8 @@
293 HostedServices []HostedServiceDescriptor `xml:"HostedService"`293 HostedServices []HostedServiceDescriptor `xml:"HostedService"`
294}294}
295295
296// HostedServiceDescriptor contains a subset of the details in HostedService,
297// and is used when describing a list of HostedServices.
296type HostedServiceDescriptor struct {298type HostedServiceDescriptor struct {
297 XMLNS string `xml:"xmlns,attr"`299 XMLNS string `xml:"xmlns,attr"`
298 URL string `xml:"Url"`300 URL string `xml:"Url"`

Subscribers

People subscribed via source and target branches

to all changes: