Skip to content

Commit

Permalink
Merge pull request #8 from quintilesims/fix-urls
Browse files Browse the repository at this point in the history
Make urls consistent
  • Loading branch information
diemonster authored Dec 9, 2016
2 parents 9653433 + 6e965b5 commit 03b2012
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion api/handlers/deploy_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (this *DeployHandler) Routes() *restful.WebService {
Param(id).
Returns(http.StatusNoContent, "Deleted", nil))

service.Route(service.POST("/create").
service.Route(service.POST("/").
Filter(basicAuthenticate).
To(this.CreateDeploy).
Doc("Create a new Deploy").
Expand Down
2 changes: 1 addition & 1 deletion api/handlers/load_balancer_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (this *LoadBalancerHandler) Routes() *restful.WebService {
Param(id).
Returns(http.StatusNoContent, "Deleted", nil))

service.Route(service.PUT("{id}").
service.Route(service.PUT("{id}/ports").
Filter(basicAuthenticate).
To(this.UpdateLoadBalancer).
Reads(models.UpdateLoadBalancerRequest{}).
Expand Down
2 changes: 1 addition & 1 deletion api/handlers/service_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (this *ServiceHandler) Routes() *restful.WebService {
Returns(400, "Invalid request", models.ServerError{}).
Writes(models.Service{}))

service.Route(service.PUT("/{id}/update").
service.Route(service.PUT("/{id}/deploy").
Filter(basicAuthenticate).
To(this.UpdateService).
Doc("Run a new deploy on a service").
Expand Down
2 changes: 1 addition & 1 deletion cli/client/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func (c *APIClient) CreateDeploy(name string, content []byte) (*models.Deploy, e
}

var deploy *models.Deploy
if err := c.Execute(c.Sling("deploy/create").Post("").BodyJSON(req), &deploy); err != nil {
if err := c.Execute(c.Sling("deploy").Post("").BodyJSON(req), &deploy); err != nil {
return nil, err
}

Expand Down
2 changes: 1 addition & 1 deletion cli/client/deploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
func TestCreateDeploy(t *testing.T) {
handler := func(w http.ResponseWriter, r *http.Request) {
testutils.AssertEqual(t, r.Method, "POST")
testutils.AssertEqual(t, r.URL.Path, "/deploy/create")
testutils.AssertEqual(t, r.URL.Path, "/deploy")

var req models.CreateDeployRequest
Unmarshal(t, r, &req)
Expand Down
2 changes: 1 addition & 1 deletion cli/client/load_balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (c *APIClient) UpdateLoadBalancer(id string, ports []models.Port) (*models.
}

var loadBalancer *models.LoadBalancer
if err := c.Execute(c.Sling("loadbalancer/").Put(id).BodyJSON(req), &loadBalancer); err != nil {
if err := c.Execute(c.Sling("loadbalancer/").Put(id+"/ports").BodyJSON(req), &loadBalancer); err != nil {
return nil, err
}

Expand Down
2 changes: 1 addition & 1 deletion cli/client/load_balancer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func TestUpdateLoadBalancer(t *testing.T) {

handler := func(w http.ResponseWriter, r *http.Request) {
testutils.AssertEqual(t, r.Method, "PUT")
testutils.AssertEqual(t, r.URL.Path, "/loadbalancer/id")
testutils.AssertEqual(t, r.URL.Path, "/loadbalancer/id/ports")

var req models.UpdateLoadBalancerRequest
Unmarshal(t, r, &req)
Expand Down
2 changes: 1 addition & 1 deletion cli/client/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (c *APIClient) UpdateService(serviceID, deployID string) (*models.Service,
}

var service *models.Service
if err := c.Execute(c.Sling("service/").Put(serviceID+"/update").BodyJSON(request), &service); err != nil {
if err := c.Execute(c.Sling("service/").Put(serviceID+"/deploy").BodyJSON(request), &service); err != nil {
return nil, err
}

Expand Down
2 changes: 1 addition & 1 deletion cli/client/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func TestScaleService(t *testing.T) {
func TestUpdateService(t *testing.T) {
handler := func(w http.ResponseWriter, r *http.Request) {
testutils.AssertEqual(t, r.Method, "PUT")
testutils.AssertEqual(t, r.URL.Path, "/service/id/update")
testutils.AssertEqual(t, r.URL.Path, "/service/id/deploy")

var req models.UpdateServiceRequest
Unmarshal(t, r, &req)
Expand Down

0 comments on commit 03b2012

Please sign in to comment.