Skip to content

Commit c31b457

Browse files
Joshua-Andersonmboersma
authored andcommitted
feat(*): change format of one off commands response and bump api to v2
1 parent 9fba429 commit c31b457

54 files changed

Lines changed: 1867 additions & 463 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

client/controller/api/apps.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,22 @@ type App struct {
1010
UUID string `json:"uuid"`
1111
}
1212

13-
// AppCreateRequest is the definition of POST /v1/apps/.
13+
// AppCreateRequest is the definition of POST /v2/apps/.
1414
type AppCreateRequest struct {
1515
ID string `json:"id,omitempty"`
1616
}
1717

18-
// AppUpdateRequest is the definition of POST /v1/apps/<app id>/.
18+
// AppUpdateRequest is the definition of POST /v2/apps/<app id>/.
1919
type AppUpdateRequest struct {
2020
Owner string `json:"owner,omitempty"`
2121
}
2222

23-
// AppRunRequest is the definition of POST /v1/apps/<app id>/run.
23+
// AppRunRequest is the definition of POST /v2/apps/<app id>/run.
2424
type AppRunRequest struct {
2525
Command string `json:"command"`
2626
}
2727

28-
// AppRunResponse is the definition of /v1/apps/<app id>/run.
28+
// AppRunResponse is the definition of /v2/apps/<app id>/run.
2929
type AppRunResponse struct {
3030
Output string `json:"output"`
3131
ReturnCode int `json:"rc"`

client/controller/api/auth.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package api
22

3-
// AuthRegisterRequest is the definition of POST /v1/auth/register/.
3+
// AuthRegisterRequest is the definition of POST /v2/auth/register/.
44
type AuthRegisterRequest struct {
55
Username string `json:"username"`
66
Password string `json:"password"`
@@ -9,34 +9,34 @@ type AuthRegisterRequest struct {
99
LastName string `json:"last_name,omitempty"`
1010
}
1111

12-
// AuthLoginRequest is the definition of POST /v1/auth/login/.
12+
// AuthLoginRequest is the definition of POST /v2/auth/login/.
1313
type AuthLoginRequest struct {
1414
Username string `json:"username"`
1515
Password string `json:"password"`
1616
}
1717

18-
// AuthLoginResponse is the definition of /v1/auth/login/.
18+
// AuthLoginResponse is the definition of /v2/auth/login/.
1919
type AuthLoginResponse tokenResponse
2020

21-
// AuthPasswdRequest is the definition of POST /v1/auth/passwd/.
21+
// AuthPasswdRequest is the definition of POST /v2/auth/passwd/.
2222
type AuthPasswdRequest struct {
2323
Username string `json:"username,omitempty"`
2424
Password string `json:"password,omitempty"`
2525
NewPassword string `json:"new_password"`
2626
}
2727

28-
// AuthRegenerateRequest is the definition of POST /v1/auth/tokens/.
28+
// AuthRegenerateRequest is the definition of POST /v2/auth/tokens/.
2929
type AuthRegenerateRequest struct {
3030
Name string `json:"username,omitempty"`
3131
All bool `json:"all,omitempty"`
3232
}
3333

34-
// AuthCancelRequest is the definition of POST /v1/auth/cancel/.
34+
// AuthCancelRequest is the definition of POST /v2/auth/cancel/.
3535
type AuthCancelRequest struct {
3636
Username string `json:"username"`
3737
}
3838

39-
// AuthRegenerateResponse is the definition of /v1/auth/tokens/.
39+
// AuthRegenerateResponse is the definition of /v2/auth/tokens/.
4040
type AuthRegenerateResponse tokenResponse
4141

4242
// A generic defenition of a token response.

client/controller/api/builds.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type Build struct {
1313
UUID string `json:"uuid"`
1414
}
1515

16-
// CreateBuildRequest is the structure of POST /v1/apps/<app id>/builds/.
16+
// CreateBuildRequest is the structure of POST /v2/apps/<app id>/builds/.
1717
type CreateBuildRequest struct {
1818
Image string `json:"image"`
1919
Procfile map[string]string `json:"procfile,omitempty"`

client/controller/api/certs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ type Cert struct {
1212
ID int `json:"id,omitempty"`
1313
}
1414

15-
// CertCreateRequest is the definition of POST /v1/certs/.
15+
// CertCreateRequest is the definition of POST /v2/certs/.
1616
type CertCreateRequest struct {
1717
Certificate string `json:"certificate"`
1818
Key string `json:"key"`

client/controller/api/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package api
22

3-
// ConfigSet is the definition of POST /v1/apps/<app id>/config/.
3+
// ConfigSet is the definition of POST /v2/apps/<app id>/config/.
44
type ConfigSet struct {
55
Values map[string]string `json:"values"`
66
}
77

8-
// ConfigUnset is the definition of POST /v1/apps/<app id>/config/.
8+
// ConfigUnset is the definition of POST /v2/apps/<app id>/config/.
99
type ConfigUnset struct {
1010
Values map[string]interface{} `json:"values"`
1111
}

client/controller/api/domains.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type Domain struct {
99
Updated string `json:"updated"`
1010
}
1111

12-
// DomainCreateRequest is the structure of POST /v1/app/<app id>/domains/.
12+
// DomainCreateRequest is the structure of POST /v2/app/<app id>/domains/.
1313
type DomainCreateRequest struct {
1414
Domain string `json:"domain"`
1515
}

client/controller/api/keys.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type Key struct {
1010
UUID string `json:"uuid"`
1111
}
1212

13-
// KeyCreateRequest is the definition of POST /v1/keys/.
13+
// KeyCreateRequest is the definition of POST /v2/keys/.
1414
type KeyCreateRequest struct {
1515
ID string `json:"id"`
1616
Public string `json:"public"`

client/controller/api/perms.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package api
22

3-
// PermsAppResponse is the definition of GET /v1/apps/<app id>/perms/.
3+
// PermsAppResponse is the definition of GET /v2/apps/<app id>/perms/.
44
type PermsAppResponse struct {
55
Users []string `json:"users"`
66
}

client/controller/api/releases.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type Release struct {
1313
Version int `json:"version"`
1414
}
1515

16-
// ReleaseRollback is the defenition of POST /v1/apps/<app id>/releases/.
16+
// ReleaseRollback is the defenition of POST /v2/apps/<app id>/releases/.
1717
type ReleaseRollback struct {
1818
Version int `json:"version"`
1919
}

client/controller/client/http.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ Make sure that the Controller URI is correct and the server is running.`
159159

160160
baseURL := controllerURL.String()
161161

162-
controllerURL.Path = "/v1/"
162+
controllerURL.Path = "/v2/"
163163

164164
req, err := http.NewRequest("GET", controllerURL.String(), bytes.NewBuffer(nil))
165165
addUserAgent(&req.Header)

0 commit comments

Comments
 (0)