Skip to content

Commit 565020a

Browse files
author
Aaron Schlesinger
committed
ref(*): move all client files to the root
1 parent 8c09031 commit 565020a

41 files changed

Lines changed: 4657 additions & 0 deletions

Some content is hidden

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

api/apps.go

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package api
2+
3+
// App is the definition of the app object.
4+
type App struct {
5+
Created string `json:"created"`
6+
ID string `json:"id"`
7+
Owner string `json:"owner"`
8+
Updated string `json:"updated"`
9+
URL string `json:"-"`
10+
UUID string `json:"uuid"`
11+
}
12+
13+
// AppCreateRequest is the definition of POST /v2/apps/.
14+
type AppCreateRequest struct {
15+
ID string `json:"id,omitempty"`
16+
}
17+
18+
// AppUpdateRequest is the definition of POST /v2/apps/<app id>/.
19+
type AppUpdateRequest struct {
20+
Owner string `json:"owner,omitempty"`
21+
}
22+
23+
// AppRunRequest is the definition of POST /v2/apps/<app id>/run.
24+
type AppRunRequest struct {
25+
Command string `json:"command"`
26+
}
27+
28+
// AppRunResponse is the definition of /v2/apps/<app id>/run.
29+
type AppRunResponse struct {
30+
Output string `json:"output"`
31+
ReturnCode int `json:"rc"`
32+
}

api/auth.go

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package api
2+
3+
// AuthRegisterRequest is the definition of POST /v2/auth/register/.
4+
type AuthRegisterRequest struct {
5+
Username string `json:"username"`
6+
Password string `json:"password"`
7+
Email string `json:"email"`
8+
FirstName string `json:"first_name,omitempty"`
9+
LastName string `json:"last_name,omitempty"`
10+
}
11+
12+
// AuthLoginRequest is the definition of POST /v2/auth/login/.
13+
type AuthLoginRequest struct {
14+
Username string `json:"username"`
15+
Password string `json:"password"`
16+
}
17+
18+
// AuthLoginResponse is the definition of /v2/auth/login/.
19+
type AuthLoginResponse tokenResponse
20+
21+
// AuthPasswdRequest is the definition of POST /v2/auth/passwd/.
22+
type AuthPasswdRequest struct {
23+
Username string `json:"username,omitempty"`
24+
Password string `json:"password,omitempty"`
25+
NewPassword string `json:"new_password"`
26+
}
27+
28+
// AuthRegenerateRequest is the definition of POST /v2/auth/tokens/.
29+
type AuthRegenerateRequest struct {
30+
Name string `json:"username,omitempty"`
31+
All bool `json:"all,omitempty"`
32+
}
33+
34+
// AuthCancelRequest is the definition of POST /v2/auth/cancel/.
35+
type AuthCancelRequest struct {
36+
Username string `json:"username"`
37+
}
38+
39+
// AuthRegenerateResponse is the definition of /v2/auth/tokens/.
40+
type AuthRegenerateResponse tokenResponse
41+
42+
// A generic defenition of a token response.
43+
type tokenResponse struct {
44+
Token string `json:"token"`
45+
}

api/builds.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package api
2+
3+
// Build is the structure of the build object.
4+
type Build struct {
5+
App string `json:"app"`
6+
Created string `json:"created"`
7+
Dockerfile string `json:"dockerfile,omitempty"`
8+
Image string `json:"image,omitempty"`
9+
Owner string `json:"owner"`
10+
Procfile map[string]string `json:"procfile"`
11+
Sha string `json:"sha,omitempty"`
12+
Updated string `json:"updated"`
13+
UUID string `json:"uuid"`
14+
}
15+
16+
// CreateBuildRequest is the structure of POST /v2/apps/<app id>/builds/.
17+
type CreateBuildRequest struct {
18+
Image string `json:"image"`
19+
Procfile map[string]string `json:"procfile,omitempty"`
20+
}

api/certs.go

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package api
2+
3+
import "github.com/deis/pkg/time"
4+
5+
// Cert is the definition of the cert object.
6+
// Some fields are omtempty because they are only
7+
// returned when creating or getting a cert.
8+
type Cert struct {
9+
Updated time.Time `json:"updated,omitempty"`
10+
Created time.Time `json:"created,omitempty"`
11+
Name string `json:"name"`
12+
CommonName string `json:"common_name"`
13+
Expires time.Time `json:"expires"`
14+
Starts time.Time `json:"starts"`
15+
Fingerprint string `json:"fingerprint"`
16+
Issuer string `json:"issuer"`
17+
Subject string `json:"subject"`
18+
SubjectAltName []string `json:"san,omitempty"`
19+
Domains []string `json:"domains,omitempty"`
20+
Owner string `json:"owner,omitempty"`
21+
ID int `json:"id,omitempty"`
22+
}
23+
24+
// CertCreateRequest is the definition of POST and PUT to /v2/certs/
25+
type CertCreateRequest struct {
26+
Certificate string `json:"certificate"`
27+
Key string `json:"key"`
28+
Name string `json:"name"`
29+
}
30+
31+
// CertAttachRequest is the defintion of post to /v2/certs/<cert>/domain
32+
type CertAttachRequest struct {
33+
Domain string `json:"domain"`
34+
}

api/config.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package api
2+
3+
// ConfigSet is the definition of POST /v2/apps/<app id>/config/.
4+
type ConfigSet struct {
5+
Values map[string]string `json:"values"`
6+
}
7+
8+
// ConfigUnset is the definition of POST /v2/apps/<app id>/config/.
9+
type ConfigUnset struct {
10+
Values map[string]interface{} `json:"values"`
11+
}
12+
13+
// Config is the structure of an app's config.
14+
type Config struct {
15+
Owner string `json:"owner,omitempty"`
16+
App string `json:"app,omitempty"`
17+
Values map[string]interface{} `json:"values,omitempty"`
18+
Memory map[string]interface{} `json:"memory,omitempty"`
19+
CPU map[string]interface{} `json:"cpu,omitempty"`
20+
Tags map[string]interface{} `json:"tags,omitempty"`
21+
Created string `json:"created,omitempty"`
22+
Updated string `json:"updated,omitempty"`
23+
UUID string `json:"uuid,omitempty"`
24+
}

api/domains.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package api
2+
3+
// Domain is the structure of the domain object.
4+
type Domain struct {
5+
App string `json:"app"`
6+
Created string `json:"created"`
7+
Domain string `json:"domain"`
8+
Owner string `json:"owner"`
9+
Updated string `json:"updated"`
10+
}
11+
12+
// DomainCreateRequest is the structure of POST /v2/app/<app id>/domains/.
13+
type DomainCreateRequest struct {
14+
Domain string `json:"domain"`
15+
}

api/keys.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package api
2+
3+
// Key is the definition of the key object.
4+
type Key struct {
5+
Created string `json:"created"`
6+
ID string `json:"id"`
7+
Owner string `json:"owner"`
8+
Public string `json:"public"`
9+
Updated string `json:"updated"`
10+
UUID string `json:"uuid"`
11+
}
12+
13+
// KeyCreateRequest is the definition of POST /v2/keys/.
14+
type KeyCreateRequest struct {
15+
ID string `json:"id"`
16+
Public string `json:"public"`
17+
Name string `json:"name,omitempty"`
18+
}

api/perms.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package api
2+
3+
// PermsAppResponse is the definition of GET /v2/apps/<app id>/perms/.
4+
type PermsAppResponse struct {
5+
Users []string `json:"users"`
6+
}
7+
8+
// PermsRequest is the definition of a requst on /perms/.
9+
type PermsRequest struct {
10+
Username string `json:"username"`
11+
}

api/ps.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package api
2+
3+
import "github.com/deis/pkg/time"
4+
5+
// Pods defines the structure of a process.
6+
type Pods struct {
7+
Release string `json:"release"`
8+
Type string `json:"type"`
9+
Name string `json:"name"`
10+
State string `json:"state"`
11+
Started time.Time `json:"started"`
12+
}

api/releases.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package api
2+
3+
// Release is the definition of the release object.
4+
type Release struct {
5+
App string `json:"app"`
6+
Build string `json:"build,omitempty"`
7+
Config string `json:"config"`
8+
Created string `json:"created"`
9+
Owner string `json:"owner"`
10+
Summary string `json:"summary"`
11+
Updated string `json:"updated"`
12+
UUID string `json:"uuid"`
13+
Version int `json:"version"`
14+
}
15+
16+
// ReleaseRollback is the defenition of POST /v2/apps/<app id>/releases/.
17+
type ReleaseRollback struct {
18+
Version int `json:"version"`
19+
}

0 commit comments

Comments
 (0)