Control your WeDeploy cloud services via a simple RESTful api
This describes the resources that make up the official WeDeploy API v1. If you have any problems or requests please contact support. All API access is over HTTPS, and accessed from the https://api.wedeploy.com .
Name
Type
Required
Options
status
string
auth, data, email, storage, all
curl " https://api.wedeploy.com/"
{
version : "0.0.0" ,
domains : {
infrastructure : "wedeploy.com" ,
service : "wedeploy.io"
}
}
curl " https://api.wedeploy.com/?status=all"
curl " https://api.wedeploy.com/?status=auth"
curl " https://api.wedeploy.com/?status=data"
curl " https://api.wedeploy.com/?status=email"
curl " https://api.wedeploy.com/?status=storage"
Name
Type
Required
github
Object
projectId
string
environment
boolean
metadata
Object
curl -X POST " https://api.wedeploy.com/projects" -u user@domain.com:pass \
-H " Content-Type: application/json" \
-d $' {
"projectId": "myproject"
}'
{
"collaborators" : [
"212069869435631201"
] ,
"createdAt" : 1490046559186 ,
"github" : { } ,
"health" : "healthy" ,
"id" : "<UID>" ,
"invitations" : { } ,
"masterToken" : "<MASTER_TOKEN>" ,
"ownerId" : "212069869435631201" ,
"projectId" : "myproject"
}
Name
Type
Required
Options
filter
string
allProjects, ownedProjects, contributedProjects
field
string
projectId, createdAt, latestActivity
order
string
asc, desc
listServices
boolean
curl " https://api.wedeploy.com/projects?filter=allProjects&field=projectId&order=desc&listServices=true" -u user@domain.com:pass
[
{
"collaborators" : [
"212069869435631201"
] ,
"createdAt" : 1490046559186 ,
"github" : { } ,
"health" : "healthy" ,
"id" : "<UID>" ,
"invitations" : { } ,
"masterToken" : "<MASTER_TOKEN>" ,
"ownerId" : "212069869435631201" ,
"projectId" : "myproject" ,
"services" : [ ...]
}
]
Name
Type
Required
Options
listServices
boolean
curl " https://api.wedeploy.com/projects/myproject?listServices=true" -u user@domain.com:pass
{
"collaborators" : [
"212069869435631201"
] ,
"createdAt" : 1490046559186 ,
"github" : { } ,
"health" : "healthy" ,
"id" : "<UID>" ,
"invitations" : { } ,
"masterToken" : "<MASTER_TOKEN>" ,
"ownerId" : "212069869435631201" ,
"projectId" : "myproject" ,
"services" : [ ...]
}
PATCH /projects/:projectId/:masterToken?
Name
Type
Required
github
Object
metadata
Object
curl -X PATCH " https://api.wedeploy.com/projects/myproject/<PROJECT_MASTER_TOKEN>" -u user@domain.com:pass \
-H " Content-Type: application/json" \
-d $' {
"github": {}
"metadata": {
"dynatraceId": 1234,
}
}'
{
"collaborators" : [
"212069869435631201"
] ,
"createdAt" : 1490046559186 ,
"github" : { } ,
"health" : "healthy" ,
"id" : "<UID>" ,
"invitations" : { } ,
"masterToken" : "<MASTER_TOKEN>" ,
"ownerId" : "212069869435631201" ,
"projectId" : "myproject"
}
DELETE /projects/:projectId
curl -X DELETE " https://api.wedeploy.com/projects/myproject" -u user@domain.com:pass
(empty)
POST /projects/:projectId/build
Name
Type
Required
deploy
boolean
provider
string
repository
string
masterToken
string
wedeployGitBranch
string
wedeployJsons
Object
curl -X POST " https://api.wedeploy.com/projects/myproject/build" \
-H " Content-Type: application/json" \
-d $' {
"masterToken": "<PROJECT_MASTER_TOKEN>",
"provider": "github",
"repository": "https://github.com/wedeploy/demo-ghost",
"wedeployJsons": {
"ui": {
"cpu": "0.75"
}
}
}'
[
{
"cpu" : 1.0 ,
"createdAt" : 1490054338701 ,
"buildGroupUid" : "<BUILD_GROUP_ID>" ,
"deployGroupUid" : "<DEPLOY_GROUP_ID>" ,
"groupUid" : "<DEPLOY_GROUP_ID>" ,
"health" : "up" ,
"id" : "<UID>" ,
"image" : "wedeploy/hosting" ,
"memory" : 4096 ,
"port" : 80 ,
"projectId" : "myproject" ,
"scale" : 1 ,
"serviceId" : "hosting"
} ,
...
]
Deploy or Promote project services
POST /projects/:projectId/deploy
Name
Type
Required
(deprecating) groupUid
string
buildGroupUid
string
X
curl -X POST " https://api.wedeploy.com/projects/myproject/deploy" \
-H " Content-Type: application/json" \
-d $' {
"buildGroupUid": "1",
}'
(empty)
POST /projects/:projectId/transfer
Name
Type
Required
userId
string
✓
curl -X POST " https://api.wedeploy.com/projects/myproject/transfer" -u user@domain.com:pass \
-H " Content-Type: application/json" \
-d $' {
"userId": "1"
}'
(empty)
Copy project services to child project
POST /projects/:projectId/copy
Name
Type
Required
destinationProjectId
string
✓
wedeployJsons
Object
curl -X POST " https://api.wedeploy.com/projects/example/copy" -u user@domain.com:pass \
-H " Content-Type: application/json" \
-d $' {
"destinationProjectId": "example-dev",
"wedeployJsons": {
"ui": {
"cpu": "0.75",
}
}
}'
[
{
"image": "wedeploy/hosting",
"memory": 1365.3333,
"projectUid": "284690249352078105",
"internalPort": 45594,
"volumes": {},
"cpu": 0.75,
"health": "none",
"scale": 1,
"zeroDowntime": true,
"constraints": [],
"dependencies": [],
"createdAt": 1524252889735,
"customDomains": [],
"port": 80,
"healthCheck": { startPeriod: 1, retries: 10, interval: 5, timeout: 5 },
"id": "284690250138355225",
"serviceId": "ui",
"projectId": "example-dev",
"groupUid": "rwq3ih2"
},
...
]
GET /projects/:projectId/logs
Name
Type
Required
serviceId
string
start
integer
end
integer
limit
integer
level
integer
build
boolean
download
boolean
curl " https://api.wedeploy.com/projects/myproject/logs" -u user@domain.com:pass
[
{
"buildUid" : null ,
"containerId" : "serviceId" ,
"containerUid" : "<CONTAINER_UID>" ,
"deployUid" : "<DEPLOY_UID>" ,
"level" : 6 ,
"message" : "A line of the log..." ,
"projectId" : "myproject" ,
"timestamp" : "1487022020949" ,
"uid" : "<UID>"
} ,
...
]
Invite project collaborator
POST /projects/:projectId/invite
Name
Type
Required
email
string
✓ (exclusive)
userId
string
✓ (exclusive)
role
string
✓
curl -X POST " https://api.wedeploy.com/projects/myproject/invite" -u user@domain.com:pass \
-H " Content-Type: application/json" \
-d $' {
"email": "email@domain.com"
"role": "guest",
}'
(empty)
Accept project collaborator invitation
GET /projects/:projectId/invite
Name
Type
Required
email
string
✓
invitationToken
string
✓
curl " https://api.wedeploy.com/projects/myproject/invite?email=email@domain.com&invitationToken=INVITATION_TOKEN" -u user@domain.com:pass
(empty)
Delete project collaborator invitation
DELETE /projects/:projectId/invite
Name
Type
Required
email
string
✓
curl -X DELETE " https://api.wedeploy.com/projects/myproject/invite?email=email@domain.com" -u user@domain.com:pass
(empty)
Suggest project collaborator
GET /projects/:projectId/invite/suggestion
Name
Type
Required
keyword
string
✓
limit
integer
curl " https://api.wedeploy.com/projects/myproject/invite/suggestion?keyword=user" -u user@domain.com:pass
[
{
"id" : "<UID>" ,
"initials" : "U" ,
"name" : "User A" ,
"email" : "usera@domain.com" ,
"emailHash" : "3bc81bc52e7f209c3455af320abeee00"
} ,
{
"id" : "<UID>" ,
"initials" : "U" ,
"name" : "User B" ,
"email" : "userb@domain.com" ,
"emailHash" : "ed076488b22b5359d7ffb16b8e30caed"
}
]
Delete project collaborator
DELETE /projects/:projectId/collaborators/:id
curl -X DELETE " https://api.wedeploy.com/projects/myproject/collaborators/1" -u user@domain.com:pass
(empty)
Get project collaborators
GET /projects/:projectId/collaborators
curl " https://api.wedeploy.com/projects/myproject/collaborators"
-u user@domain.com:pass
[
{
"createdAt" : 1489019572853 ,
"email" : "user@domain.com" ,
"id" : "<UID>" ,
"initials" : "E" ,
"invitationPending" : false ,
"name" : "User Name"
} ,
...
]
Link project git provider
POST /projects/:projectId/link-provider
Name
Type
Required
provider
string
✓
providerToken
string
✓
curl -X POST " https://api.wedeploy.com/projects/myproject/link-provider" -u user@domain.com:pass \
-H " Content-Type: application/json" \
-d $' {
"provider": "github",
"providerToken": "<GITHUB_TOKEN>"
}'
(empty)
Unlink project git provider
DELETE /projects/:projectId/link-provider
Name
Type
Required
provider
string
✓
curl -X DELETE " https://api.wedeploy.com/projects/myproject/link-provider?provider=github" -u user@domain.com:pass
(empty)
Link project git repository
POST /projects/:projectId/link-repository
Name
Type
Required
branch
string
✓
provider
string
✓
repository
string
✓
curl -X POST " https://api.wedeploy.com/projects/myproject/link-repository" -u user@domain.com:pass \
-H " Content-Type: application/json" \
-d $' {
"branch": "master",
"provider": "github",
"repository": "user/myproject"
}'
(empty)
Unlink project git repository
DELETE /projects/:projectId/link-repository
Name
Type
Required
provider
string
✓
providerHookId
string
✓
providerToken
string
✓
repository
string
✓
curl -X DELETE " https://api.wedeploy.com/projects/myproject/link-repository?provider=github&providerToken=TOKEN&providerHookId=HOOK_ID" -u user@domain.com:pass
(empty)
Change Collaborator Project Role
PATCH /projects/:projectId/collaborator-role
Name
Type
Required
collaboratorId
string
✓
role
string
✓
curl -X PATCH " https://api.wedeploy.com/projects/myProject/collaborator-role" \
-H ' Content-Type: application/json; charset=utf-8' \
-u user@domain.com:pass \
-d $' {
"collaboratorId": "12345678",
"role": "guest"
}'
(empty)
POST /projects/:projectId/services
Name
Type
Required
command
array
constraints
array
cpu
integer
customDomains
array
env
Object
image
string
imageHint
string
memory
integer
port
integer
public
boolean
scale
integer
serviceId
string
volume
string
recipeType
string
skipGenerateCertificate
boolean
curl -X POST " https://api.wedeploy.com/projects/myproject/services" -u user@domain.com:pass \
-H " Content-Type: application/json" \
-d $' {
"cpu": 1.0,
"customDomains": [
"myproject.com",
"www.myproject.com"
],
"env": {
"NODE_ENV": "production"
},
"image": "wedeploy/hosting",
"memory": 4096,
"port": 80,
"public": true,
"scale": 1,
"serviceId": "hosting",
"volume": "/shared"
}'
{
"cpu" : 1.0 ,
"createdAt" : 1490054338701 ,
"customDomains" : [
"myproject.com" ,
"www.myproject.com"
] ,
"health" : "up" ,
"id" : "<UID>" ,
"image" : "wedeploy/hosting" ,
"memory" : 4096 ,
"port" : 80 ,
"public" : true ,
"projectId" : "myproject" ,
"scale" : 1 ,
"serviceId" : "hosting" ,
"volume" : "/shared"
}
GET /projects/:projectId/services
curl " https://api.wedeploy.com/projects/myproject/services" -u user@domain.com:pass
[
{
"cpu" : 1.0 ,
"createdAt" : 1490054338701 ,
"customDomains" : [
"myproject.com" ,
"www.myproject.com"
] ,
"health" : "up" ,
"id" : "<UID>" ,
"image" : "wedeploy/hosting" ,
"memory" : 4096 ,
"port" : 80 ,
"projectId" : "myproject" ,
"scale" : 1 ,
"serviceId" : "hosting"
}
]
GET /projects/:projectId/services/:serviceId
curl " https://api.wedeploy.com/projects/myproject/services/hosting" -u user@domain.com:pass
{
"cpu" : 1.0 ,
"createdAt" : 1490054338701 ,
"health" : "up" ,
"customDomains" : [
"myproject.com" ,
"www.myproject.com"
] ,
"id" : "<UID>" ,
"image" : "wedeploy/hosting" ,
"memory" : 4096 ,
"port" : 80 ,
"projectId" : "myproject" ,
"scale" : 1 ,
"serviceId" : "hosting"
}
DELETE /projects/:projectId/services/:serviceId
curl -X DELETE " https://api.wedeploy.com/projects/myproject/services/hosting" -u user@domain.com:pass
(empty)
POST /projects/:projectId/services/:serviceId/restart
curl -X POST " https://api.wedeploy.com/projects/myproject/services/hosting/restart" -u user@domain.com:pass
(empty)
PATCH /projects/:projectId/services/:serviceId/stop
curl -X PATCH " https://api.wedeploy.com/projects/myproject/services/hosting/stop" -u user@domain.com:pass
(empty)
List project service logs
GET /projects/:projectId/services/:serviceId/logs
Name
Type
Required
start
integer
end
integer
limit
integer
level
integer
build
boolean
download
boolean
curl " https://api.wedeploy.com/projects/myproject/services/hosting/logs" -u user@domain.com:pass
[
{
"buildUid" : null ,
"containerId" : "hosting" ,
"containerUid" : "<CONTAINER_UID>" ,
"deployUid" : "<DEPLOY_UID>" ,
"level" : 6 ,
"message" : "A line of the log..." ,
"projectId" : "myproject" ,
"timestamp" : "1487022020949" ,
"uid" : "<UID>"
} ,
...
]
List project service instances
GET /projects/:projectId/services/:serviceId/instances
curl " https://api.wedeploy.com/projects/myproject/services/hosting/instances" -u user@domain.com:pass
[
{
"createdAt" : "2019-02-11T13:35:31.8960205Z" ,
"containerId" : "87bbb217b0f73c304dbd60291c6ecca1de9a62acaf098a01a501fa076e0c79cd" ,
"state" : "running" ,
"taskId" : "su8zo1bdng6ggbdb2kg4sl4xy"
}
. . .
]
Replace project service custom domains
PUT /projects/:projectId/services/:serviceId/custom-domains
Name
Type
Required
value
array
✓
skipGenerateCertificate
boolean
skipAddDnsRecords
boolean
curl -X PUT " https://api.wedeploy.com/projects/myproject/services/hosting/custom-domains" -u user@domain.com:pass \
-H " Content-Type: application/json" \
-d $' {
"value": [
"myproject.com",
"www.myproject.com"
]
}'
Update project service scale properties
PATCH /projects/:projectId/services/:serviceId/scale
Name
Type
Required
Description
difference
int
scale will increase/decrease by difference
value
int
scale will be replaced by value
canAutoscale
boolean
turn on/off autoscaling capability
curl -X PATCH " https://api.wedeploy.com/projects/myproject/services/myservice/scale" \
-H ' Content-Type: application/json; charset=utf-8' \
-u user@domain.com:pass \
-d ' {
"scale": 2,
"canAutoscale": true
}'
(empty)
Create project service integration activities
POST /projects/:projectId/services/:serviceId/integrations
Name
Type
Required
type
string
✓
masterToken
string
✓
metadata
Object
curl -X POST " https://api.wedeploy.com/projects/myproject/services/myservice/integrations" \
-H ' Content-Type: application/json; charset=utf-8' \
-d ' {
"type": "CI_STARTED",
"masterToken": <PROJECT_MASTER_TOKEN>,
"metadata": {
"jenkinsURL": "www.jenkins.com"
}
}'
{
createdAt: 1531525927705,
metadata: {
projectId: 'myproject',
serviceId: 'myservice',
integrationType: 'CI_STARTED'
jenkinsURL: 'www.jenkins.com'
},
projectUid: '299942973016451145',
id: '299942976036258986',
type: 'INTEGRATION',
projectId: 'myproject',
userId: '_GLOBAL_'
}
Name
Type
Required
Options
commit
string
(deprecating) groupUid
string
buildGroupUid
string
limit
integer
offset
integer
type
string
order
string
'asc' (default), 'desc'
GET /projects/:projectId/activities
curl " https://api.wedeploy.com/projects/myproject/activities" -u user@domain.com:pass
[
{
"createdAt" : "1474608905803" ,
"id" : "<UID>" ,
"metadata" : {
"emailAddress" : "email@domain.com" ,
"emailAddressHash" : "ZW1haWxAZG9tYWluLmNvbQ==" ,
"userPhotoUrl" : null ,
"projectId" : "myproject" ,
"userId" : "212069869435631201" ,
"userInitials" : "E"
} ,
"projectId" : "myproject" ,
"type" : "PROJECT_CREATED"
} ,
...
]
List builds and deployments activities
Name
Type
Required
commit
string
buildGroupUid
string
limit
integer
offset
integer
verbose
boolean
shouldGroup
boolean
type
string
GET /projects/:projectId/activities/builds-deployments
curl " https://api.wedeploy.com/projects/myproject/activities/builds-deployments" -u user@domain.com:pass
[
{
"createdAt" : "1474608905803" ,
"id" : "<UID>" ,
"metadata" : {
"emailAddress" : "email@domain.com" ,
"emailAddressHash" : "ZW1haWxAZG9tYWluLmNvbQ==" ,
"userPhotoUrl" : null ,
"projectId" : "myproject" ,
"userId" : "212069869435631201" ,
"userInitials" : "E"
} ,
"projectId" : "myproject" ,
"type" : "BUILD_STARTED"
} ,
...
]
GET /projects/:projectId/activities/:id
curl " https://api.wedeploy.com/projects/myproject/activities/180579269793175907" -u user@domain.com:pass
{
"createdAt" : "1474608905803" ,
"id" : "<UID>" ,
"metadata" : {
"emailAddress" : "email@domain.com" ,
"emailAddressHash" : "ZW1haWxAZG9tYWluLmNvbQ==" ,
"userPhotoUrl" : null ,
"projectId" : "myproject" ,
"userId" : "212069869435631201" ,
"userInitials" : "E"
} ,
"projectId" : "myproject" ,
"type" : "PROJECT_CREATED"
}
Name
Type
Required
Options
unread
boolean
type
string
user, projects
projectId
string
curl " https://api.wedeploy.com/alerts?unread=true" -u user@domain.com:pass
[
{
"createdAt" : 1532104627259 ,
"metadata" : {
"message" : "90% of your available transfer has been used." ,
"userId" : "301156522137698482"
} ,
"projectUid" : "_GLOBAL_" ,
"readBy" : [ ] ,
"id" : "301156538201055363" ,
"type" : "USER_QUOTA_TRANSFER_ALMOST" ,
"projectId" : "_GLOBAL_" ,
"userId" : "301156522137698482"
} ,
...
]
Mark some alerts as read by user
Name
Type
Required
ids
array
false
curl -X PATCH " https://api.wedeploy.com/alerts/read" \
-H " Content-Type: application/json" \
-u teamuser@domain.com:pass \
-d ' {
"ids": ["123", "456"]
}'
Mark alerts for all user projects as read by user
Name
Type
Required
projectId
string
false
curl -X PATCH " https://api.wedeploy.com/alerts/read" \
-H " Content-Type: application/json" \
-d ' {
"projectId": "projectId"
}'
-u teamuser@domain.com:pass
Mark all alerts as read by user
Name
Type
Required
all
boolean
false
curl -X PATCH " https://api.wedeploy.com/alerts/read" \
-H " Content-Type: application/json" \
-d ' {
"all": true
}'
-u teamuser@domain.com:pass
Name
Type
Required
Description
(deprecating) groupUid
string
buildGroupUid
string
serviceid
string
limit
integer
offset
integer
verbose
boolean
status
string
overEnvironments
boolean
List all builds from all project environments
shouldGroup
boolean
Return builds grouped by buildGroupUid
GET /projects/:projectId/builds
curl " https://api.wedeploy.com/projects/myproject/builds" -u user@domain.com:pass
[
{
image : "<BUILD_IMAGE>" ,
metadata : {
commit : "<BUILD_COMMIT>" ,
commitAuthorEmail : "user@domain.com" ,
commitAuthor : "User" ,
commitBranch : "testing" ,
commitMessage : "Update index.js" ,
commitDate : "1499368678"
} ,
repository : "https://github.com/wedeploy/temp" ,
type : "dockerfile" ,
branch : "master" ,
directory : "<BUILD_DIRECTORY>" ,
createdAt : 1499379569854 ,
id : "<UID>" ,
serviceId : "service1" ,
wedeploy : {
id : "service1"
} ,
projectId : "myproject" ,
buildGroupUid : "<BUILD_GROUP_UID>" ,
status : "SUCCEEDED" ,
} ,
...
]
GET /projects/:projectId/builds/:id
curl " https://api.wedeploy.com/projects/myproject/builds/232527117389994306" -u user@domain.com:pass
{
image : "<BUILD_IMAGE>" ,
metadata : {
commit : "<BUILD_COMMIT>" ,
commitAuthorEmail : "user@domain.com" ,
commitMessage : "Update index.js" ,
commitAuthor : "User" ,
commitDate : "1499368678"
} ,
repository : "https://github.com/wedeploy/temp" ,
type : "dockerfile" ,
branch : "master" ,
directory : "<BUILD_DIRECTORY>" ,
createdAt : 1499379569854 ,
id : "<UID>" ,
serviceId : "service1" ,
wedeploy : {
id : "service1"
} ,
projectId : "myproject" ,
buildGroupUid : "<BUILD_GROUP_UID>" ,
status : "FAILED"
}
List ending deployment activities and associated build
Name
Type
Required
Description
status
string
limit
integer
offset
integer
verbose
boolean
overEnvironments
boolean
List all deployment activities from all project environments
shouldGroup
boolean
Return deployment activities grouped by deployGroupUid
GET /projects/:projectId/deployments
curl " https://api.wedeploy.com/projects/myproject/deployments" -u user@domain.com:pass
[
{
"createdAt" : 1499368678 ,
"metadata" :
{
buildGroupUid,
groupUid,
image,
imageHint,
projectId,
serviceId,
emailAddress,
userName,
userPhotoUrl,
userInitials,
} ,
"projectUid" : '309890364454566095' ,
"id" : '309890364669170261' ,
"type" : 'DEPLOY_TIMEOUT' ,
"projectId" : '1' ,
"build" :
{
image : "<BUILD_IMAGE>" ,
metadata : {
commit : "<BUILD_COMMIT>" ,
commitAuthorEmail : "user@domain.com" ,
commitMessage : "Update index.js" ,
commitAuthor : "User" ,
commitDate : "1499368678"
} ,
repository : "https://github.com/wedeploy/temp" ,
type : "dockerfile" ,
branch : "master" ,
directory : "<BUILD_DIRECTORY>" ,
createdAt : 1499379569854 ,
id : "<UID>" ,
serviceId : "service1" ,
wedeploy : {
id : "service1"
} ,
projectId : "myproject" ,
buildGroupUid : "<BUILD_GROUP_UID>" ,
status : "SUCCEEDED" ,
}
} ,
...
]
GET /projects/:projectId/builds/order/:buildGroupUid
Name
Type
Options
Required
format
string
pretty
curl " https://api.wedeploy.com/projects/myproject/builds/order/jiax601" -u user@domain.com:pass
Create or replace project service environment variable
PUT /projects/:projectId/services/:serviceId/environment-variables/:name
curl -X PUT " https://api.wedeploy.com/projects/myproject/services/hosting/environment-variables/NAME" \
-H " Content-Type: application/json" \
-u user@domain.com:pass \
-d $' {
"value": "VALUE"
}'
Replace project service environment variables
PUT /projects/:projectId/services/:serviceId/environment-variables
curl -X PUT " https://api.wedeploy.com/projects/myproject/services/nodejs/environment-variables" \
-H " Content-Type: application/json" \
-u user@domain.com:pass \
-d $' {
"env": {
"NODE_ENV": "production"
},
}'
List project service environment variables
GET /projects/:projectId/services/:serviceId/environment-variables
curl " https://api.wedeploy.com/projects/myproject/services/hosting/environment-variables" -u user@domain.com:pass
[
{
"createdAt" : 1474607678754 ,
"id" : "<UID>" ,
"name" : "NAME" ,
"projectId" : "myproject" ,
"serviceId" : "hosting" ,
"value" : "VALUE"
}
]
Get project service environment variable
GET /projects/:projectId/services/:serviceId/environment-variables/:name
curl " https://api.wedeploy.com/projects/myproject/services/hosting/env/NAME" -u user@domain.com:pass
{
"createdAt" : 1474607678754 ,
"id" : "<UID>" ,
"name" : "NAME" ,
"projectId" : "myproject" ,
"serviceId" : "hosting" ,
"value" : "VALUE"
}
Delete project service environment variable
DELETE /projects/:projectId/services/:serviceId/environment-variables/:name
curl -X DELETE " https://api.wedeploy.com/projects/myproject/services/hosting/environment-variables/NAME" \
-u user@domain.com:pass
(empty)
List plans visible to user
curl " https://api.wedeploy.com/plans/user"
{
"free" : {
"projects" : 2 ,
"memory" : 1024 ,
"instances" : 2 ,
"description" : "Free" ,
"cpu" : 1 ,
"services" : 2 ,
"storage" : 512 ,
"buildsPerDay" : 100 ,
"customDomains" : 0 ,
"price" : 0 ,
"collaborators" : 0 ,
"planId" : "free" ,
"id" : "280737384934014710" ,
"support" : false ,
"traffic" : 1024 ,
"canScale" : false
} ,
"premium" : {
"projects" : 20 ,
"memory" : 10240 ,
"instances" : 20 ,
"description" : "Premium" ,
"cpu" : 8 ,
"services" : 20 ,
"storage" : 51200 ,
"buildsPerDay" : 10000 ,
"customDomains" : 25 ,
"price" : 149 ,
"collaborators" : 20 ,
"planId" : "premium" ,
"id" : "280737384916914365" ,
"support" : false ,
"traffic" : 122880 ,
"canScale" : true
} ,
"basic" : {
"projects" : 3 ,
"memory" : 2048 ,
"instances" : 3 ,
"description" : "Basic" ,
"cpu" : 2 ,
"services" : 3 ,
"storage" : 2048 ,
"buildsPerDay" : 300 ,
"customDomains" : 3 ,
"price" : 12 ,
"collaborators" : 2 ,
"planId" : "basic" ,
"id" : "280737384942616917" ,
"support" : false ,
"traffic" : 5120 ,
"canScale" : false
} ,
"standard" : {
"projects" : 10 ,
"memory" : 6144 ,
"instances" : 10 ,
"description" : "Standard" ,
"cpu" : 4 ,
"services" : 10 ,
"storage" : 10240 ,
"buildsPerDay" : 1000 ,
"customDomains" : 10 ,
"price" : 49 ,
"collaborators" : 10 ,
"planId" : "standard" ,
"id" : "280737384944430630" ,
"support" : false ,
"traffic" : 20480 ,
"canScale" : true
}
}
All byte-related quotas are in MB
Name
Type
Required
Options
planId
string
yes
description
string
yes
projects
number
yes
services
number
yes
cpu
number
yes
memory
number
yes
traffic
number
yes
customDomains
number
yes
collaborators
number
yes
canScale
boolean
yes
instances
number
yes
storage
number
yes
buildsPerDay
number
yes
constraints
array
support
boolean
yes
price
number
yes
curl -X POST " https://api.wedeploy.com/plans?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>" \
-H " Content-Type: application/json" \
-u teamuser@domain.com:pass
-d ' {
"planId": "free",
"description": "Free",
"projects": 2,
"services": 2,
"cpu": 1,
"memory": 1024,
"traffic": 1024,
"customDomains": 0,
"collaborators": 0,
"canScale": false,
"instances": 2,
"storage": 512,
"buildsPerDay": 100,
"support": false,
"price": 0
}'
{
"planId" : "free" ,
"description" : "Free" ,
"projects" : 2 ,
"services" : 2 ,
"cpu" : 1 ,
"memory" : 1024 ,
"traffic" : 1024 ,
"customDomains" : 0 ,
"collaborators" : 0 ,
"canScale" : false ,
"instances" : 2 ,
"storage" : 512 ,
"buildsPerDay" : 100 ,
"support" : false ,
"price" : 0
} ,
All byte-related quotas are in MB
Name
Type
Required
Options
planId
string
description
string
projects
number
services
number
cpu
number
memory
number
traffic
number
customDomains
number
collaborators
number
canScale
boolean
instances
number
storage
number
buildsPerDay
number
constraints
array
support
boolean
price
number
curl -X PATCH " https://api.wedeploy.com/plans/myplan?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>" \
-H " Content-Type: application/json" \
-u teamuser@domain.com:pass \
-d ' {
"description": "Changed",
}'
(empty)
curl -X DELETE " https://api.wedeploy.com/plans/myplan?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>"
-u teamuser@domain.com:pass
(empty)
Includes services specifically for that environment
curl " https://api.wedeploy.com/catalog/services"
{
"wedeploy/auth" : {
"category" : "WeDeploy™" ,
"description" : "Simple authentication with email\/password or third-party providers like GitHub and Google." ,
"image" : "wedeploy\/auth" ,
"name" : "WeDeploy™ Auth" ,
"state" : "active" ,
"versions" : [ "latest" , "v1.5.0" ]
} ,
...
}
For every request a token or credential may be extracted in the following order:
Source
Key
Basic Authentication
curl -u "username:password" "https://api.wedeploy.com"
Oauth2 Token (header)
curl -H "Authorization: Bearer TOKEN" "https://api.wedeploy.com"
Oauth2 Token (cookie)
curl -H "Cookie:access_token=TOKEN" "https://api.wedeploy.com"
MasterToken (header)
curl -H "Authorization: MasterToken TOKEN" "https://api.wedeploy.com
Name
Type
Required
email
string
✓
name
string
✓
password
string
✓
photoUrl
string
curl -X POST " https://api.wedeploy.com/user/create" \
-H " Content-Type: application/json" \
-d $' {
"email": "user@domain.com",
"name": "User Name",
"password": "pass"
}'
{
"createdAt" : 1489019572853 ,
"email" : "user@domain.com" ,
"id" : "<UID>" ,
"initials" : "U" ,
"invitationPending" : false ,
"name" : "User Name" ,
"password" : "<PASSWORD>" ,
"photoUrl" : null ,
"supportedScopes" : [ ]
}
curl " https://api.wedeploy.com/user" -u user@domain.com:pass
{
"createdAt" : 1489019572853 ,
"email" : "user@domain.com" ,
"id" : "<UID>" ,
"initials" : "E" ,
"invitationPending" : false ,
"name" : "User Name"
}
Name
Type
Required
email
string
name
string
preferences
object
curl -X PATCH https://api.wedeploy.com/user/update \
-H " Content-Type: application/json" \
-u user@domain.com:pass \
-d ' {
"email":"update@domain.com",
"name":"Update Name",
"preferences": {
"alertsServiceStatusConsole": "true",
"alertsServiceStatusEmail": "false",
"alertsCpuUsageConsole": "true",
"alertsCpuUsageEmail": "false",
"alertsMemoryUsageConsole": "true",
"alertsMemoryUsageEmail": "false",
"alertsInstancesUsageConsole": "true",
"alertsInstancesUsageEmail": "false",
"alertsTransferUsageConsole": "true",
"alertsTransferUsageEmail": "false",
"alertsStorageUsageConsole": "true",
"alertsStorageUsageEmail": "false"
},
}'
(empty)
(empty)
Send recover password email
Name
Type
Required
email
string
✓
curl -X POST " https://api.wedeploy.com/user/recover" \
-H " Content-Type: application/json" \
-d $' {
"email": "user@domain.com"
}'
(empty)
Name
Type
Required
email
string
✓
curl -X POST " https://api.wedeploy.com/confirm" \
-H " Content-Type: application/json" \
-d $' {
"email": "user@domain.com"
}'
(empty)
Confirm email verification
Name
Type
Required
email
string
✓
confirmationToken
string
✓
ignoreRedirect
boolean
curl " https://api.wedeploy.com/confirm?email=user@domain.com&confirmationToken=12345"
(empty)
Name
Type
Required
code
string
✓
email
string
✓
password
string
✓
curl -X POST " https://api.wedeploy.com/user/reset" \
-H " Content-Type: application/json" \
-d $' {
"code": "<RESET_CODE>",
"email": "user@domain.com",
"password": "newpass"
}'
(empty)
Send Reset Password Email (For api-auth)
Name
Type
Required
resetCode
string
✓
email
string
✓
curl -X POST " https://api.wedeploy.com/reset-password" \
-H " Content-Type: application/json" \
-d $' {
"resetCode": "<RESET_CODE>",
"email": "user@domain.com",
}'
(empty)
Send Reset Password Success Email (For api-auth)
POST /reset-password-success
Name
Type
Required
email
string
✓
curl -X POST " https://api.wedeploy.com/reset-password-success" \
-H " Content-Type: application/json" \
-d $' {
"email": "user@domain.com",
}'
(empty)
Login user using credentials
Name
Type
Required
email
string
✓
password
string
✓
curl -X POST " https://api.wedeploy.com/login" \
-H " Content-Type: application/json" \
-d $' {
"email": "user@domain.com",
"password": "pass"
}'
{
"createdAt" : 1489019572853 ,
"email" : "user@domain.com" ,
"id" : "<UID>" ,
"initials" : "E" ,
"invitationPending" : false ,
"name" : "User name" ,
"password" : null ,
"photoUrl" : null ,
"supportedScopes" : [ ] ,
"token" : "TOKEN"
}
Login user using provider
Name
Type
Required
provider
string
✓
provider_scope
string
✓
redirect_uri
string
✓
scope
string
curl " https://api.wedeploy.com/oauth/authorize?provider=github&provider_scope=email&redirect_uri=http://myproject.com"
Name
Type
Required
redirect_uri
string
curl " https://api.wedeploy.com/logout" -u user@domain.com:pass
(empty)
Name
Type
Required
token
string
✓
curl " https://api.wedeploy.com/oauth/tokeninfo?token=TOKEN"
{
"access_token" : "<TOKEN>" ,
"expires_in" : null ,
"refresh_token" : null ,
"scope" : null ,
"token_type" : "bearer"
}
Name
Type
Required
redirect_uri
string
token
string
✓
curl " https://api.wedeploy.com/oauth/revoke?token=TOKEN"
(empty)
Create user token (password)
Name
Type
Required
grant_type
string
✓
password
string
✓
username
string
✓
curl -X POST " https://api.wedeploy.com/oauth/token" \
-H " Content-Type: application/json" \
-d $' {
"grant_type": "password",
"password": "pass",
"username": "user@domain.com"
}'
{
"access_token" : "<TOKEN>" ,
"expires_in" : null ,
"refresh_token" : null ,
"scope" : null ,
"token_type" : "bearer"
}
Name
Type
Required
code
string
✓
grant_type
string
✓
provider
string
✓
redirect_uri
string
curl -X POST " https://api.wedeploy.com/oauth/token?code=CODE&provider=github&redirect_uri=http://myproject.com" \
-H " Content-Type: application/json" \
-d $' {
"code": "<CODE>",
"grant_type": "authorization_code",
"provider": "github"
}'
{
"access_token" : "<TOKEN>" ,
"expires_in" : null ,
"refresh_token" : null ,
"scope" : null ,
"token_type" : "bearer"
}
GET /validators/projects/:projectId/services/:serviceId/custom-domains
Name
Type
Required
value
string
✓
curl " https://api.wedeploy.com/validators/projects/1/services/2/custom-domains?value=valid.wedeploy.com" -u user@domain.com:pass
(empty)
Name
Type
Required
value
string
✓
curl " https://api.wedeploy.com/validators/email?value=email@domain.com" -u user@domain.com:pass
(empty)
Validate project collaborator
GET /validators/projects/:projectId/collaborator
Name
Type
Required
value
string
✓
curl " https://api.wedeploy.com/validators/projects/1/collaborator?value=1" -u user@domain.com:pass
(empty)
GET /validators/accounts/email
Name
Type
Required
value
string
✓
curl " https://api.wedeploy.com/validators/accounts/email?value=test@domain.com" -u user@domain.com:pass
(empty)
GET /validators/projects/id
Name
Type
Required
value
string
✓
curl " https://api.wedeploy.com/validators/projects/id?value=projectId" -u user@domain.com:pass
(empty)
GET /validators/projects/:projectId/services/id
Name
Type
Required
value
string
✓
curl " https://api.wedeploy.com/validators/projects/1/services/id?value=serviceId" -u user@domain.com:pass
(empty)
Name
Type
Required
value
string
✓
curl " https://api.wedeploy.com/validators/required?value=value"
(empty)
POST /hooks/providers/:provider/build/:projectId/:masterToken?
Name
Type
Required
ref
string
✓
repository
string
✓
curl -X POST " https://api.wedeploy.com/hooks/providers/github/build/myproject/<OPTIONAL_PROJECT_MASTER_TOKEN>" \
-H " Content-Type: application/json" \
-u user@domain.com:pass \
-d $' {
"ref": "refs/heads/master",
"repository": {full_name: ' user/repo' },
}'
[
{
"cpu" : 1.0 ,
"createdAt" : 1490054338701 ,
"deployGroupUid" : "<DEPLOY_GROUP_ID>" ,
"health" : "up" ,
"id" : "<UID>" ,
"image" : "wedeploy/hosting" ,
"memory" : 4096 ,
"port" : 80 ,
"projectId" : "myproject" ,
"scale" : 1 ,
"serviceId" : "hosting"
} ,
...
]
GET /hooks/providers/:provider/oauth/link-provider
Name
Type
Required
state
string
✓
code
string
✓
redirect_uri
string
curl " https://api.wedeploy.com/hooks/providers/Github/oauth/link-provider \
?state=<OAUTH_STATE> \
&code=<OAUTH_CODE> \
&redirect_uri=https://console.wedeploy.com/projects/:projectId/github"
(empty)
Subscribe project activities
WS /subscribe/project/activities
Name
Type
Required
accessToken
string
✓
projectId
string
✓
WS /subscribe/user/projects
Name
Type
Required
accessToken
string
✓
Subscribe project services
WS /subscribe/project/services
Name
Type
Required
accessToken
string
✓
projectId
string
✓
Subscribe project service
WS /subscribe/project/service
Name
Type
Required
accessToken
string
✓
projectId
string
✓
serviceId
string
✓
Retrieve CPU metrics for service
Name
Type
Required
period
string
start
string
end
string
frequency
string
order
string
limit
number
curl " https://api.wedeploy.com/projects/myproject/services/myservice/metrics/cpu?period=10m&frequency=30s" \
-u user@domain.com:pass
[
{
time : 1504025885000 ,
value : 0.0391573682 ,
instance : 1
} ,
...
]
Retrieve Memory metrics for service
Name
Type
Required
period
string
start
string
end
string
frequency
string
order
string
limit
number
curl " https://api.wedeploy.com/projects/myproject/services/myservice/metrics/memory?period=10m&frequency=30s" \
-u user@domain.com:pass
[
{
time : 1504025885000 ,
value : 14401536 ,
instance : 1
} ,
...
]
Retrieve Traffic-In metrics for service
Name
Type
Required
period
string
start
string
end
string
frequency
string
order
string
limit
number
curl " https://api.wedeploy.com/projects/myproject/services/myservice/metrics/traffic/in?period=10m&frequency=30s" \
-u user@domain.com:pass
[
{
time : 1504025885000 ,
value : 143 ,
instance : 1
} ,
...
]
Retrieve Traffic-Out metrics for service
Name
Type
Required
period
string
start
string
end
string
frequency
string
order
string
limit
number
curl " https://api.wedeploy.com/projects/myproject/services/myservice/metrics/traffic/out?period=10m&frequency=30s" \
-u user@domain.com:pass
[
{
time : 1504025885000 ,
value : 143 ,
instance : 1
} ,
...
]
Retrieve Health metrics for service
Name
Type
Required
period
string
start
string
end
string
frequency
string
order
string
limit
number
now
boolean
curl " https://api.wedeploy.com/projects/myproject/services/myservice/metrics/health?period=10m&frequency=30s" \
-u user@domain.com:pass
[
{
time : 1504025885000 ,
value : 1 ,
instance : 1
} ,
...
]
Retrieve volume metrics for project
curl " https://api.wedeploy.com/projects/myproject/metrics/volumes" \
-u user@domain.com:pass
[
{
"name" : "283438694262688104-data" ,
"path" : "/var/lib/mysql" ,
"files" : 694 ,
"directories" : 5 ,
"value" : 134.155
} ,
...
]
Retrieve account collaborator usage
GET /account/usage/collaborators
curl " https://api.wedeploy.com/account/usage/collaborators" \
-u user@domain.com:pass
{
value : 1 ,
planTotal : 5 ,
projects : [
{
projectId : "example" ,
value : 1
}
]
}
Retrieve account CPU usage
curl " https://api.wedeploy.com/account/usage/cpu" \
-u user@domain.com:pass
{
value : 0.5 ,
planTotal : 1 ,
services : [
{
projectId : "example" ,
serviceId : "hosting" ,
value : 0.5 ,
}
]
}
Retrieve account custom domain usage
GET /account/usage/custom-domains
curl " https://api.wedeploy.com/account/usage/custom-domains" \
-u user@domain.com:pass
{
value : 1 ,
planTotal : 5 ,
services : [
{
serviceId : "hosting" ,
projectId : "example" ,
value : 1 ,
}
]
}
Retrieve account instance usage
GET /account/usage/instances
curl " https://api.wedeploy.com/account/usage/instances" \
-u user@domain.com:pass
{
value : 1 ,
planTotal : 2 ,
services : [
{
serviceId : "hosting" ,
projectId : "example" ,
value : 1 ,
}
]
}
Retrieve account memory usage
GET /account/usage/memory
curl " https://api.wedeploy.com/account/usage/memory" \
-u user@domain.com:pass
{
value : 512 ,
planTotal : 1024 ,
services : [
{
serviceId : "hosting" ,
projectId : "example" ,
value : 512 ,
}
]
}
Retrieve account projects usage
GET /account/usage/projects
curl " https://api.wedeploy.com/account/usage/projects" \
-u user@domain.com:pass
{
value : 1 ,
planTotal : 3 ,
}
Retrieve account support capability
GET /account/usage/support
curl " https://api.wedeploy.com/account/usage/support" \
-u user@domain.com:pass
Retrieve account scale capability
curl " https://api.wedeploy.com/account/usage/scale" \
-u user@domain.com:pass
Retrieve account traffic usage
GET /account/usage/traffic
curl " https://api.wedeploy.com/account/usage/traffic" \
-u user@domain.com:pass
{
value : 4341653 ,
planTotal : 1024000000 ,
services : [
{
serviceId : "hosting" ,
projectId : "example" ,
value : 4341653 ,
}
]
}
Retrieve account volume usage
GET /account/usage/volumes
curl " https://api.wedeploy.com/account/usage/volumes" \
-u user@domain.com:pass
{
"value" : 274240995 ,
"planTotal" : 1000 ,
"services" : [
{
"name" : "283438694262688104-data" ,
"path" : "/var/lib/mysql" ,
"files" : 694 ,
"directories" : 5 ,
"value" : 274240995
}
]
}
curl " https://api.wedeploy.com/account/usage" \
-u user@domain.com:pass
{
"collaborators" : {
"value" : 0 ,
"planTotal" : 600 ,
"projects" : [
{
"projectId" : "test1" ,
"value" : 0
}
]
} ,
"cpu" : {
"value" : 6 ,
"planTotal" : 300 ,
"services" : [
{
"projectId" : "test1" ,
"serviceId" : "db" ,
"value" : 6
}
]
} ,
"customDomains" : {
"value" : 0 ,
"planTotal" : 600 ,
"services" : [
{
"projectId" : "test1" ,
"serviceId" : "db" ,
"value" : 0
}
]
} ,
"memory" : {
"value" : 4096 ,
"planTotal" : 307200 ,
"services" : [
{
"projectId" : "test1" ,
"serviceId" : "db" ,
"value" : 4096
}
]
} ,
"projects" : {
"value" : 1 ,
"planTotal" : 300
} ,
"instances" : {
"value" : 1 ,
"planTotal" : 300 ,
"services" : [
{
"projectId" : "test1" ,
"serviceId" : "db" ,
"value" : 1
}
]
} ,
"traffic" : {
"value" : 35785407.70634852 ,
"planTotal" : 10737418240000 ,
"services" : [
{
"projectId" : "test1" ,
"serviceId" : "db" ,
"value" : 35785407.70634852
}
]
} ,
"volumes" : {
"value" : 274240995 ,
"planTotal" : 1000 ,
"services" : [
{
"name" : "276399336844630531-data" ,
"path" : "/var/lib/mysql" ,
"files" : 694 ,
"directories" : 5 ,
"value" : 274240995
}
]
}
}
curl " https://api.wedeploy.com/account/usage/top" \
-u user@domain.com:pass
{
value : 0.6666666666666666 ,
planTotal : 1 ,
services : [
{
projectId : "example" ,
serviceId : "hosting" ,
value : 0.3333333333333333
} ,
{
projectId : "example" ,
serviceId : "auth" ,
value : 0.3333333333333333
} ,
]
}
List current account subscription
GET /account/billing/subscriptions
curl " https://api.wedeploy.com/account/billing/subscriptions" \
-u user@domain.com:pass
[
{
id : "sub_BRD6hMr5X9rPGS" ,
planId : "free" ,
status : "active" ,
amount : 0 ,
currency : "usd" ,
interval : "month" ,
intervalCount : 1 ,
createdAt : 1505961871000 ,
canceledAt : null ,
endedAt : null ,
currentPeriodEnd : 1508553871000 ,
currentPeriodStart : 1505961871000 ,
trialEnd : null ,
trialStart : null
}
]
List invoices for account
GET /account/billing/invoices
curl " https://api.wedeploy.com/account/billing/invoices" \
-u user@domain.com:pass
[
{
id : "in_1B4KfzErwzAsisk6abS3yUuJ" ,
date : 1505961871000 ,
lines : [
{
planId : "free" ,
description : "WeDeploy Free" ,
subtotal : 0 ,
total : 0 ,
amountDue : 0 ,
currency : "usd" ,
interval : "month" ,
intervalCount : 1 ,
trial : null ,
periodEnd : 1508553871000 ,
periodStart : 1505961871000
}
]
}
. . .
]
Retrieve payment info for account
GET /account/billing/payment-info
curl " https://api.wedeploy.com/account/billing/payment-info" \
-u user@domain.com:pass
{
brand : "Visa" ,
last4 : "4242" ,
token : "tok_1B4KrxErwzAsisk6QCiNsdt2" ,
type : "card"
}
Retrieve trial period for plan
GET /account/billing/trial-period/:planId
curl " https://api.wedeploy.com/account/billing/trial-period/:planId" \
-u user@domain.com:pass
Update payment info for account
POST /account/billing/payment-info
Name
Type
Required
stripeToken
string
✓
stripeTokenType
string
✓
shippingName
string
✓
shippingAddressCountry
string
✓
shippingAddressCountryCode
string
✓
shippingAddressZip
string
✓
shippingAddressLine1
string
✓
shippingAddressCity
string
✓
shippingAddressStat
string
✓
curl -X POST " https://api.wedeploy.com/account/billing/payment-info" \
-H ' Content-Type: application/json; charset=utf-8' \
-u user@domain.com:pass \
-d $' {
"stripeToken": "tok_1B4L0ZErwzAsisk6GKGA4FHj",
"stripeTokenType": "card"
"shippingName": "Liferay",
"shippingAddressCountry": "United States",
"shippingAddressCountryCode": "US",
"shippingAddressZip": "91765",
"shippingAddressLine1": "1400 Montefino Ave",
"shippingAddressCity": "Diamond Bar",
"shippingAddressState": "91765",
}'
{
customerPaymentType : "card" ,
customerPaymentToken : "tok_1B4L0ZErwzAsisk6GKGA4FHj" ,
}
POST /account/billing/subscribe
Name
Type
Required
planId
string
✓
coupon
string
curl -X POST " https://api.wedeploy.com/account/billing/subscribe" \
-H ' Content-Type: application/json; charset=utf-8' \
-u user@domain.com:pass \
-d $' {
"planId": "basic",
"coupon": "DEVCON2017"
}'
{
"subscriptionId" : "sub_BRDbydjqmxaAdw"
}
POST /account/billing/unsubscribe
Name
Type
Required
planId
string
✓
curl -X POST " https://api.wedeploy.com/account/billing/unsubscribe" \
-H ' Content-Type: application/json; charset=utf-8' \
-u user@domain.com:pass \
-d $' {
"planId": "basic"
}'
POST /projects/:projectId/vpn
curl -X POST " https://api.wedeploy.com/projects/:projectId/vpn" \
-H " Content-Type: application/json" \
-u teamuser@domain.com:pass \
-d ' {
"host": "127.0.0.1:8090",
"login": "the-login",
"password": "the-password",
"certificate": "-----BEGIN CERTIFICATE-----\nMIIDFzCCAf+gAwIBDQEBCwUAMBExDzANBgNV\n-----END CERTIFICATE-----"
}'
{
connected : true ,
host : "127.0.0.1:8090" ,
login : "the-login" ,
password : "the-password" ,
certificate : "-----BEGIN CERTIFICATE-----\nMIIDFzCCAf+gAwIBDQEBCwUAMBExDzANBgNV\n-----END CERTIFICATE-----"
}
DELETE /projects/:projectId/vpn
curl -X DELETE " https://api.wedeploy.com/projects/:projectId/vpn" \
-H " Content-Type: application/json" \
-u teamuser@domain.com:pass \
Return vpn connection configurations
GET /projects/:projectId/vpn
curl " https://api.wedeploy.com/projects/:projectId/vpn" -u teamuser@domain.com:pass
{
connected : true ,
host : "127.0.0.1:8090" ,
password : "123456" ,
login : "the-login" ,
certificate : "-----BEGIN CERTIFICATE-----\nMIIDFzCCAf+gAwIBDQEBCwUAMBExDzANBgNV\n-----END CERTIFICATE-----" ,
forwardingPorts : [ ] ,
}
Maintenance vpn port forwarding
POST /projects/:projectId/vpn-forwarding
curl -X POST " https://api.wedeploy.com/projects/:projectId/vpn-forwarding" \
-H " Content-Type: application/json" \
-u teamuser@domain.com:pass \
-d ' {
"forwarding":
[
{
"host": "127.0.0.1",
"port": 8090,
},
{
"host": "127.0.0.1",
"port": 8091,
}
]
}'
{
connected : true ,
host : "127.0.0.1:8090" ,
password : "123456" ,
login : "the-login" ,
certificate : "-----BEGIN CERTIFICATE-----\nMIIDFzCCAf+gAwIBDQEBCwUAMBExDzANBgNV\n-----END CERTIFICATE-----" ,
forwardingPorts : [
{
host : "127.0.0.1" ,
port : 8090 ,
internalPort : 30125
} ,
{
host : "127.0.0.1" ,
port : 8091 ,
internalPort : 30126
}
]
}
GET /admin/:collection/:id?
Examples:
GET /admin/activities/:id?
GET /admin/builds/:id?
GET /admin/envs/:id?
GET /admin/plans/:id?
GET /admin/projects/:id?
GET /admin/services/:id?
GET /admin/users/:id?
Name
Type
Required
Options
type
string
count
limit
string
offset
string
field
string
order
string
asc, desc
curl " https://api.wedeploy.com/admin/users?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>" -u teamuser@domain.com:pass
[
{
"createdAt" : 1489019572853 ,
"email" : "user@domain.com" ,
"id" : "<UID>" ,
"initials" : "E" ,
"invitationPending" : false ,
"name" : "User Name"
} ,
...
]
if type=count
List Health of all Services
curl " https://api.wedeploy.com/admin/health?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>" -u teamuser@domain.com:pass
[
{
node : {
total : 1 ,
up : 1
} ,
miscellaneous : {
total : 0 ,
up : 0
} ,
wedeploy / auth : {
total : 1 ,
up : 0
} ,
wedeploy / data : {
total : 1 ,
up : 0
} ,
wedeploy / email : {
total : 0 ,
up : 0
} ,
wedeploy / engine : {
total : 0 ,
up : 0
} ,
wedeploy / hosting : {
total : 2 ,
up : 2
} ,
wedeploy / liferay : {
total : 0 ,
up : 0
}
}
. . .
]
Retrieve system wide usage
curl " https://api.wedeploy.com/admin/usage?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>" -u teamuser@domain.com:pass
{
"cpu" : 123 ,
"memory" : 204800 ,
"customDomains" : 100 ,
"instances" : 200 ,
"collaborators" : 25 ,
"traffic" : 231829384731 ,
"storage" : 102400005678 ,
}
Update Collection Document
PATCH /admin/:collection/:id?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>
curl -X PATCH " https://api.wedeploy.com/admin/users/123?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>" \
-H " Content-Type: application/json" \
-u teamuser@domain.com:pass \
-d ' {
"email":"update@domain.com",
"name":"Updated Name",
"supportedScopes": ["team"]
}'
(empty)
POST /admin/:collection?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>
curl -X POST " https://api.wedeploy.com/admin/projects?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>" \
-H " Content-Type: application/json" \
-u teamuser@domain.com:pass \
-d ' {
"projectId": "myproject",
"id": "5678",
"collaborators": ["212069869435631201"]
}'
{
"collaborators" : [
"212069869435631201"
] ,
"id" : "5678" ,
"projectId" : "myproject" ,
}
DELETE /admin/user/:userId?
Name
Type
Required
email
string
id
string
curl -X DELETE " https://api.wedeploy.com/admin/user/123?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>" \
-u teamuser@domain.com:pass
(empty)
DELETE /admin/collection/:collection/:id/:field?
####DO NOT USE UNLESS YOU JUST NEED TO DELETE A DOCUMENT AND NOT THEIR RELATED ASSETS
FOR EXAMPLE, THIS WILL NOT DELETE THE SERVICES OF A PROJECT
curl -X DELETE " https://api.wedeploy.com/admin/projects/123/ownerId?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>" \
-u teamuser@domain.com:pass
(empty)
POST /admin/billing/subscribe/user/:userId
curl -X POST " https://api.wedeploy.com/admin/billing/subscribe/user/123?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>" \
-H " Content-Type: application/json" \
-u teamuser@domain.com:pass \
-d ' {
"planId": "premium"
}'
{
"subscriptionId" : "sub_BRDbydjqmxaAdw"
}
Retrieve user account usage by spec
GET /admin/usage/:spec/user/:userId
curl -X GET " https://api.wedeploy.com/admin/usage/cpu/user/123?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>" \
-H " Content-Type: application/json" \
-u teamuser@domain.com:pass
{
value : 0.5 ,
planTotal : 1 ,
services : [
{
projectId : "example" ,
serviceId : "hosting" ,
value : 0.5 ,
}
]
}
POST /admin/wedeploy/recover
curl -X POST " https://api.wedeploy.com/admin/wedeploy/recover?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>" \
-H " Content-Type: application/json" \
-u teamuser@domain.com:pass
(empty)
There is a Jenkinsfile containing the information about how this project is built. There, we select a Jenkins slave node to execute the tasks, and then we define several stages for the pipeline:
Setup: we asure the machine has been configured properly, mainly node.
Install dependencies: we fetch all dependencies using NPM.
Start infrastructure: we start the local infrastructure
Test: we execute unit and integration tests in parallel against the XYZ environment. At the end of the test execution, the CI server will gather the test execution results.
Finally, when all previous stages have finished, we ensure that the infrastructure is shutdown properly.
The build of the image has been delegated to the CI. A merge commit to master will update the current snapshot, following tag name convention:
Successfully tagged wedeploy/api:staging
Successfully tagged wedeploy/api:local
Successfully tagged wedeploy/api:4.5.2-20190329084603_942b49f4
Successfully tagged wedeploy/api:4.5.2
The wedeploy/api:local
image can be tagged by running the ./tag-images.sh
script.
With it you can customize some parameters of the build:
variable
description
IMAGE_PREFIX
Configures the prefix of the image (defaults to wedeploy
)
IMAGE_TAG
Configures the tag of the image (defaults to staging
)
For instance:
IMAGE_PREFIX=localhost:5000/cirocosta.co \
IMAGE_TAG=dev \
./tag-images.sh
# Starting to tag image
# FULL_NAME: localhost:5000/cirocosta.co/api:dev
# IMAGE_PREFIX: localhost:5000/cirocosta.co
# IMAGE_TAG: dev
# CONTEXT: /Users/cirocosta/Development/wedeploy/api
Note 1.: In order to tag the docker images, it assumes you have previously built the current code with the tag local
.
Publishing the image to Docker Hub
We advise against pushing local images in favour of letting the CI to do it. For that reason the push
script has been removed from this repository. Instead, the CI will push the image in two scenarios:
On merges to master: it will push a Docker tag following this tag name convention currentVersion-timestamp_shortHash . As an example: 4.5.2-20190227111212_abcdef
.
On git tags (api releases ): it will push a Docker tag with the current version. The latest
tag won't be updated. It's important to mention that the git tag value must go in-sync with project version.
If you are still interested in pushing from local, which is not a best practice, please follow Jenkinsfile instructions to build and push the image.
There is a ./package.json file with current version of the image. This value determines the tag of the Docker image representing the project. Please do not update it manually: use the available scripts instead.
Send a pull request to wedeploy/api
Github repository, against master
branch. At release time, a merge commit to master
branch will produce that the CI server (Jenkins) pushes the Docker image with following tags:
wedeploy/api:staging
wedeploy/api:4.5.2-20190329084603_942b49f4
If you still want to build, push and release the api
images locally, please use the commands that are present in the Jenkinsfile, where you can clearly see which environment variables are affecting the build.
This is not recommended, as the publication of the image must be as much automated as possible, using the CI. First make sure that your "local" tag is in the desired state.
# Download release scripts
GITHUB_TOKEN=' YOUR_GITHUB_TOKEN' ./.jenkins/main.sh --setup-machine
# Build images with proper tag convention
./.jenkins/main.sh --build-images
# Push snapshots to Docker Hub
DOCKER_USERNAME=' YOUR_DOCKER_USER' DOCKER_PASSWORD=' YOUR_DOCKER_PASSWORD' ./.jenkins/main.sh --push-images
# Push release to Docker Hub
DOCKER_USERNAME=' YOUR_DOCKER_USER' DOCKER_PASSWORD=' YOUR_DOCKER_PASSWORD' ./.jenkins/main.sh --release-images
To release the api
images using SEMVER, we are going to use mdelapenya/webump:1.0.0
. Just execute the following shell script to perform the bump:
./bump.sh [major| minor| patch]
which will update the version present in the package.json
in consequence. This will also create a git commit with the bump, and a git tag with the proper version. After pushing this git tag to the repository, the CI will execute the release process, which will read the current value of the version from the previous files, and use them as Docker tag. Then it will push the released image to Docker Hub, using the described above process for releasing.
IMPORTANT: You still have to go to Jenkins UI to manually trigger the build. Check out why here .
BSD-3-Clause © Liferay, Inc.
Control your WeDeploy cloud services via a simple RESTful api
This describes the resources that make up the official WeDeploy API v1. If you have any problems or requests please contact support. All API access is over HTTPS, and accessed from the https://api.wedeploy.com .
Name
Type
Required
Options
status
string
auth, data, email, storage, all
curl " https://api.wedeploy.com/"
{
version : "0.0.0" ,
domains : {
infrastructure : "wedeploy.com" ,
service : "wedeploy.io"
}
}
curl " https://api.wedeploy.com/?status=all"
curl " https://api.wedeploy.com/?status=auth"
curl " https://api.wedeploy.com/?status=data"
curl " https://api.wedeploy.com/?status=email"
curl " https://api.wedeploy.com/?status=storage"
Name
Type
Required
github
Object
projectId
string
environment
boolean
metadata
Object
curl -X POST " https://api.wedeploy.com/projects" -u user@domain.com:pass \
-H " Content-Type: application/json" \
-d $' {
"projectId": "myproject"
}'
{
"collaborators" : [
"212069869435631201"
] ,
"createdAt" : 1490046559186 ,
"github" : { } ,
"health" : "healthy" ,
"id" : "<UID>" ,
"invitations" : { } ,
"masterToken" : "<MASTER_TOKEN>" ,
"ownerId" : "212069869435631201" ,
"projectId" : "myproject"
}
Name
Type
Required
Options
filter
string
allProjects, ownedProjects, contributedProjects
field
string
projectId, createdAt, latestActivity
order
string
asc, desc
listServices
boolean
curl " https://api.wedeploy.com/projects?filter=allProjects&field=projectId&order=desc&listServices=true" -u user@domain.com:pass
[
{
"collaborators" : [
"212069869435631201"
] ,
"createdAt" : 1490046559186 ,
"github" : { } ,
"health" : "healthy" ,
"id" : "<UID>" ,
"invitations" : { } ,
"masterToken" : "<MASTER_TOKEN>" ,
"ownerId" : "212069869435631201" ,
"projectId" : "myproject" ,
"services" : [ ...]
}
]
Name
Type
Required
Options
listServices
boolean
curl " https://api.wedeploy.com/projects/myproject?listServices=true" -u user@domain.com:pass
{
"collaborators" : [
"212069869435631201"
] ,
"createdAt" : 1490046559186 ,
"github" : { } ,
"health" : "healthy" ,
"id" : "<UID>" ,
"invitations" : { } ,
"masterToken" : "<MASTER_TOKEN>" ,
"ownerId" : "212069869435631201" ,
"projectId" : "myproject" ,
"services" : [ ...]
}
PATCH /projects/:projectId/:masterToken?
Name
Type
Required
github
Object
metadata
Object
curl -X PATCH " https://api.wedeploy.com/projects/myproject/<PROJECT_MASTER_TOKEN>" -u user@domain.com:pass \
-H " Content-Type: application/json" \
-d $' {
"github": {}
"metadata": {
"dynatraceId": 1234,
}
}'
{
"collaborators" : [
"212069869435631201"
] ,
"createdAt" : 1490046559186 ,
"github" : { } ,
"health" : "healthy" ,
"id" : "<UID>" ,
"invitations" : { } ,
"masterToken" : "<MASTER_TOKEN>" ,
"ownerId" : "212069869435631201" ,
"projectId" : "myproject"
}
DELETE /projects/:projectId
curl -X DELETE " https://api.wedeploy.com/projects/myproject" -u user@domain.com:pass
(empty)
POST /projects/:projectId/build
Name
Type
Required
deploy
boolean
provider
string
repository
string
masterToken
string
wedeployGitBranch
string
wedeployJsons
Object
curl -X POST " https://api.wedeploy.com/projects/myproject/build" \
-H " Content-Type: application/json" \
-d $' {
"masterToken": "<PROJECT_MASTER_TOKEN>",
"provider": "github",
"repository": "https://github.com/wedeploy/demo-ghost",
"wedeployJsons": {
"ui": {
"cpu": "0.75"
}
}
}'
[
{
"cpu" : 1.0 ,
"createdAt" : 1490054338701 ,
"buildGroupUid" : "<BUILD_GROUP_ID>" ,
"deployGroupUid" : "<DEPLOY_GROUP_ID>" ,
"groupUid" : "<DEPLOY_GROUP_ID>" ,
"health" : "up" ,
"id" : "<UID>" ,
"image" : "wedeploy/hosting" ,
"memory" : 4096 ,
"port" : 80 ,
"projectId" : "myproject" ,
"scale" : 1 ,
"serviceId" : "hosting"
} ,
...
]
Deploy or Promote project services
POST /projects/:projectId/deploy
Name
Type
Required
(deprecating) groupUid
string
buildGroupUid
string
X
curl -X POST " https://api.wedeploy.com/projects/myproject/deploy" \
-H " Content-Type: application/json" \
-d $' {
"buildGroupUid": "1",
}'
(empty)
POST /projects/:projectId/transfer
Name
Type
Required
userId
string
✓
curl -X POST " https://api.wedeploy.com/projects/myproject/transfer" -u user@domain.com:pass \
-H " Content-Type: application/json" \
-d $' {
"userId": "1"
}'
(empty)
Copy project services to child project
POST /projects/:projectId/copy
Name
Type
Required
destinationProjectId
string
✓
wedeployJsons
Object
curl -X POST " https://api.wedeploy.com/projects/example/copy" -u user@domain.com:pass \
-H " Content-Type: application/json" \
-d $' {
"destinationProjectId": "example-dev",
"wedeployJsons": {
"ui": {
"cpu": "0.75",
}
}
}'
[
{
"image": "wedeploy/hosting",
"memory": 1365.3333,
"projectUid": "284690249352078105",
"internalPort": 45594,
"volumes": {},
"cpu": 0.75,
"health": "none",
"scale": 1,
"zeroDowntime": true,
"constraints": [],
"dependencies": [],
"createdAt": 1524252889735,
"customDomains": [],
"port": 80,
"healthCheck": { startPeriod: 1, retries: 10, interval: 5, timeout: 5 },
"id": "284690250138355225",
"serviceId": "ui",
"projectId": "example-dev",
"groupUid": "rwq3ih2"
},
...
]
GET /projects/:projectId/logs
Name
Type
Required
serviceId
string
start
integer
end
integer
limit
integer
level
integer
build
boolean
download
boolean
curl " https://api.wedeploy.com/projects/myproject/logs" -u user@domain.com:pass
[
{
"buildUid" : null ,
"containerId" : "serviceId" ,
"containerUid" : "<CONTAINER_UID>" ,
"deployUid" : "<DEPLOY_UID>" ,
"level" : 6 ,
"message" : "A line of the log..." ,
"projectId" : "myproject" ,
"timestamp" : "1487022020949" ,
"uid" : "<UID>"
} ,
...
]
Invite project collaborator
POST /projects/:projectId/invite
Name
Type
Required
email
string
✓ (exclusive)
userId
string
✓ (exclusive)
role
string
✓
curl -X POST " https://api.wedeploy.com/projects/myproject/invite" -u user@domain.com:pass \
-H " Content-Type: application/json" \
-d $' {
"email": "email@domain.com"
"role": "guest",
}'
(empty)
Accept project collaborator invitation
GET /projects/:projectId/invite
Name
Type
Required
email
string
✓
invitationToken
string
✓
curl " https://api.wedeploy.com/projects/myproject/invite?email=email@domain.com&invitationToken=INVITATION_TOKEN" -u user@domain.com:pass
(empty)
Delete project collaborator invitation
DELETE /projects/:projectId/invite
Name
Type
Required
email
string
✓
curl -X DELETE " https://api.wedeploy.com/projects/myproject/invite?email=email@domain.com" -u user@domain.com:pass
(empty)
Suggest project collaborator
GET /projects/:projectId/invite/suggestion
Name
Type
Required
keyword
string
✓
limit
integer
curl " https://api.wedeploy.com/projects/myproject/invite/suggestion?keyword=user" -u user@domain.com:pass
[
{
"id" : "<UID>" ,
"initials" : "U" ,
"name" : "User A" ,
"email" : "usera@domain.com" ,
"emailHash" : "3bc81bc52e7f209c3455af320abeee00"
} ,
{
"id" : "<UID>" ,
"initials" : "U" ,
"name" : "User B" ,
"email" : "userb@domain.com" ,
"emailHash" : "ed076488b22b5359d7ffb16b8e30caed"
}
]
Delete project collaborator
DELETE /projects/:projectId/collaborators/:id
curl -X DELETE " https://api.wedeploy.com/projects/myproject/collaborators/1" -u user@domain.com:pass
(empty)
Get project collaborators
GET /projects/:projectId/collaborators
curl " https://api.wedeploy.com/projects/myproject/collaborators"
-u user@domain.com:pass
[
{
"createdAt" : 1489019572853 ,
"email" : "user@domain.com" ,
"id" : "<UID>" ,
"initials" : "E" ,
"invitationPending" : false ,
"name" : "User Name"
} ,
...
]
Link project git provider
POST /projects/:projectId/link-provider
Name
Type
Required
provider
string
✓
providerToken
string
✓
curl -X POST " https://api.wedeploy.com/projects/myproject/link-provider" -u user@domain.com:pass \
-H " Content-Type: application/json" \
-d $' {
"provider": "github",
"providerToken": "<GITHUB_TOKEN>"
}'
(empty)
Unlink project git provider
DELETE /projects/:projectId/link-provider
Name
Type
Required
provider
string
✓
curl -X DELETE " https://api.wedeploy.com/projects/myproject/link-provider?provider=github" -u user@domain.com:pass
(empty)
Link project git repository
POST /projects/:projectId/link-repository
Name
Type
Required
branch
string
✓
provider
string
✓
repository
string
✓
curl -X POST " https://api.wedeploy.com/projects/myproject/link-repository" -u user@domain.com:pass \
-H " Content-Type: application/json" \
-d $' {
"branch": "master",
"provider": "github",
"repository": "user/myproject"
}'
(empty)
Unlink project git repository
DELETE /projects/:projectId/link-repository
Name
Type
Required
provider
string
✓
providerHookId
string
✓
providerToken
string
✓
repository
string
✓
curl -X DELETE " https://api.wedeploy.com/projects/myproject/link-repository?provider=github&providerToken=TOKEN&providerHookId=HOOK_ID" -u user@domain.com:pass
(empty)
Change Collaborator Project Role
PATCH /projects/:projectId/collaborator-role
Name
Type
Required
collaboratorId
string
✓
role
string
✓
curl -X PATCH " https://api.wedeploy.com/projects/myProject/collaborator-role" \
-H ' Content-Type: application/json; charset=utf-8' \
-u user@domain.com:pass \
-d $' {
"collaboratorId": "12345678",
"role": "guest"
}'
(empty)
POST /projects/:projectId/services
Name
Type
Required
command
array
constraints
array
cpu
integer
customDomains
array
env
Object
image
string
imageHint
string
memory
integer
port
integer
public
boolean
scale
integer
serviceId
string
volume
string
recipeType
string
skipGenerateCertificate
boolean
curl -X POST " https://api.wedeploy.com/projects/myproject/services" -u user@domain.com:pass \
-H " Content-Type: application/json" \
-d $' {
"cpu": 1.0,
"customDomains": [
"myproject.com",
"www.myproject.com"
],
"env": {
"NODE_ENV": "production"
},
"image": "wedeploy/hosting",
"memory": 4096,
"port": 80,
"public": true,
"scale": 1,
"serviceId": "hosting",
"volume": "/shared"
}'
{
"cpu" : 1.0 ,
"createdAt" : 1490054338701 ,
"customDomains" : [
"myproject.com" ,
"www.myproject.com"
] ,
"health" : "up" ,
"id" : "<UID>" ,
"image" : "wedeploy/hosting" ,
"memory" : 4096 ,
"port" : 80 ,
"public" : true ,
"projectId" : "myproject" ,
"scale" : 1 ,
"serviceId" : "hosting" ,
"volume" : "/shared"
}
GET /projects/:projectId/services
curl " https://api.wedeploy.com/projects/myproject/services" -u user@domain.com:pass
[
{
"cpu" : 1.0 ,
"createdAt" : 1490054338701 ,
"customDomains" : [
"myproject.com" ,
"www.myproject.com"
] ,
"health" : "up" ,
"id" : "<UID>" ,
"image" : "wedeploy/hosting" ,
"memory" : 4096 ,
"port" : 80 ,
"projectId" : "myproject" ,
"scale" : 1 ,
"serviceId" : "hosting"
}
]
GET /projects/:projectId/services/:serviceId
curl " https://api.wedeploy.com/projects/myproject/services/hosting" -u user@domain.com:pass
{
"cpu" : 1.0 ,
"createdAt" : 1490054338701 ,
"health" : "up" ,
"customDomains" : [
"myproject.com" ,
"www.myproject.com"
] ,
"id" : "<UID>" ,
"image" : "wedeploy/hosting" ,
"memory" : 4096 ,
"port" : 80 ,
"projectId" : "myproject" ,
"scale" : 1 ,
"serviceId" : "hosting"
}
DELETE /projects/:projectId/services/:serviceId
curl -X DELETE " https://api.wedeploy.com/projects/myproject/services/hosting" -u user@domain.com:pass
(empty)
POST /projects/:projectId/services/:serviceId/restart
curl -X POST " https://api.wedeploy.com/projects/myproject/services/hosting/restart" -u user@domain.com:pass
(empty)
PATCH /projects/:projectId/services/:serviceId/stop
curl -X PATCH " https://api.wedeploy.com/projects/myproject/services/hosting/stop" -u user@domain.com:pass
(empty)
List project service logs
GET /projects/:projectId/services/:serviceId/logs
Name
Type
Required
start
integer
end
integer
limit
integer
level
integer
build
boolean
download
boolean
curl " https://api.wedeploy.com/projects/myproject/services/hosting/logs" -u user@domain.com:pass
[
{
"buildUid" : null ,
"containerId" : "hosting" ,
"containerUid" : "<CONTAINER_UID>" ,
"deployUid" : "<DEPLOY_UID>" ,
"level" : 6 ,
"message" : "A line of the log..." ,
"projectId" : "myproject" ,
"timestamp" : "1487022020949" ,
"uid" : "<UID>"
} ,
...
]
List project service instances
GET /projects/:projectId/services/:serviceId/instances
curl " https://api.wedeploy.com/projects/myproject/services/hosting/instances" -u user@domain.com:pass
[
{
"createdAt" : "2019-02-11T13:35:31.8960205Z" ,
"containerId" : "87bbb217b0f73c304dbd60291c6ecca1de9a62acaf098a01a501fa076e0c79cd" ,
"state" : "running" ,
"taskId" : "su8zo1bdng6ggbdb2kg4sl4xy"
}
. . .
]
Replace project service custom domains
PUT /projects/:projectId/services/:serviceId/custom-domains
Name
Type
Required
value
array
✓
skipGenerateCertificate
boolean
skipAddDnsRecords
boolean
curl -X PUT " https://api.wedeploy.com/projects/myproject/services/hosting/custom-domains" -u user@domain.com:pass \
-H " Content-Type: application/json" \
-d $' {
"value": [
"myproject.com",
"www.myproject.com"
]
}'
Update project service scale properties
PATCH /projects/:projectId/services/:serviceId/scale
Name
Type
Required
Description
difference
int
scale will increase/decrease by difference
value
int
scale will be replaced by value
canAutoscale
boolean
turn on/off autoscaling capability
curl -X PATCH " https://api.wedeploy.com/projects/myproject/services/myservice/scale" \
-H ' Content-Type: application/json; charset=utf-8' \
-u user@domain.com:pass \
-d ' {
"scale": 2,
"canAutoscale": true
}'
(empty)
Create project service integration activities
POST /projects/:projectId/services/:serviceId/integrations
Name
Type
Required
type
string
✓
masterToken
string
✓
metadata
Object
curl -X POST " https://api.wedeploy.com/projects/myproject/services/myservice/integrations" \
-H ' Content-Type: application/json; charset=utf-8' \
-d ' {
"type": "CI_STARTED",
"masterToken": <PROJECT_MASTER_TOKEN>,
"metadata": {
"jenkinsURL": "www.jenkins.com"
}
}'
{
createdAt: 1531525927705,
metadata: {
projectId: 'myproject',
serviceId: 'myservice',
integrationType: 'CI_STARTED'
jenkinsURL: 'www.jenkins.com'
},
projectUid: '299942973016451145',
id: '299942976036258986',
type: 'INTEGRATION',
projectId: 'myproject',
userId: '_GLOBAL_'
}
Name
Type
Required
Options
commit
string
(deprecating) groupUid
string
buildGroupUid
string
limit
integer
offset
integer
type
string
order
string
'asc' (default), 'desc'
GET /projects/:projectId/activities
curl " https://api.wedeploy.com/projects/myproject/activities" -u user@domain.com:pass
[
{
"createdAt" : "1474608905803" ,
"id" : "<UID>" ,
"metadata" : {
"emailAddress" : "email@domain.com" ,
"emailAddressHash" : "ZW1haWxAZG9tYWluLmNvbQ==" ,
"userPhotoUrl" : null ,
"projectId" : "myproject" ,
"userId" : "212069869435631201" ,
"userInitials" : "E"
} ,
"projectId" : "myproject" ,
"type" : "PROJECT_CREATED"
} ,
...
]
List builds and deployments activities
Name
Type
Required
commit
string
buildGroupUid
string
limit
integer
offset
integer
verbose
boolean
shouldGroup
boolean
type
string
GET /projects/:projectId/activities/builds-deployments
curl " https://api.wedeploy.com/projects/myproject/activities/builds-deployments" -u user@domain.com:pass
[
{
"createdAt" : "1474608905803" ,
"id" : "<UID>" ,
"metadata" : {
"emailAddress" : "email@domain.com" ,
"emailAddressHash" : "ZW1haWxAZG9tYWluLmNvbQ==" ,
"userPhotoUrl" : null ,
"projectId" : "myproject" ,
"userId" : "212069869435631201" ,
"userInitials" : "E"
} ,
"projectId" : "myproject" ,
"type" : "BUILD_STARTED"
} ,
...
]
GET /projects/:projectId/activities/:id
curl " https://api.wedeploy.com/projects/myproject/activities/180579269793175907" -u user@domain.com:pass
{
"createdAt" : "1474608905803" ,
"id" : "<UID>" ,
"metadata" : {
"emailAddress" : "email@domain.com" ,
"emailAddressHash" : "ZW1haWxAZG9tYWluLmNvbQ==" ,
"userPhotoUrl" : null ,
"projectId" : "myproject" ,
"userId" : "212069869435631201" ,
"userInitials" : "E"
} ,
"projectId" : "myproject" ,
"type" : "PROJECT_CREATED"
}
Name
Type
Required
Options
unread
boolean
type
string
user, projects
projectId
string
curl " https://api.wedeploy.com/alerts?unread=true" -u user@domain.com:pass
[
{
"createdAt" : 1532104627259 ,
"metadata" : {
"message" : "90% of your available transfer has been used." ,
"userId" : "301156522137698482"
} ,
"projectUid" : "_GLOBAL_" ,
"readBy" : [ ] ,
"id" : "301156538201055363" ,
"type" : "USER_QUOTA_TRANSFER_ALMOST" ,
"projectId" : "_GLOBAL_" ,
"userId" : "301156522137698482"
} ,
...
]
Mark some alerts as read by user
Name
Type
Required
ids
array
false
curl -X PATCH " https://api.wedeploy.com/alerts/read" \
-H " Content-Type: application/json" \
-u teamuser@domain.com:pass \
-d ' {
"ids": ["123", "456"]
}'
Mark alerts for all user projects as read by user
Name
Type
Required
projectId
string
false
curl -X PATCH " https://api.wedeploy.com/alerts/read" \
-H " Content-Type: application/json" \
-d ' {
"projectId": "projectId"
}'
-u teamuser@domain.com:pass
Mark all alerts as read by user
Name
Type
Required
all
boolean
false
curl -X PATCH " https://api.wedeploy.com/alerts/read" \
-H " Content-Type: application/json" \
-d ' {
"all": true
}'
-u teamuser@domain.com:pass
Name
Type
Required
Description
(deprecating) groupUid
string
buildGroupUid
string
serviceid
string
limit
integer
offset
integer
verbose
boolean
status
string
overEnvironments
boolean
List all builds from all project environments
shouldGroup
boolean
Return builds grouped by buildGroupUid
GET /projects/:projectId/builds
curl " https://api.wedeploy.com/projects/myproject/builds" -u user@domain.com:pass
[
{
image : "<BUILD_IMAGE>" ,
metadata : {
commit : "<BUILD_COMMIT>" ,
commitAuthorEmail : "user@domain.com" ,
commitAuthor : "User" ,
commitBranch : "testing" ,
commitMessage : "Update index.js" ,
commitDate : "1499368678"
} ,
repository : "https://github.com/wedeploy/temp" ,
type : "dockerfile" ,
branch : "master" ,
directory : "<BUILD_DIRECTORY>" ,
createdAt : 1499379569854 ,
id : "<UID>" ,
serviceId : "service1" ,
wedeploy : {
id : "service1"
} ,
projectId : "myproject" ,
buildGroupUid : "<BUILD_GROUP_UID>" ,
status : "SUCCEEDED" ,
} ,
...
]
GET /projects/:projectId/builds/:id
curl " https://api.wedeploy.com/projects/myproject/builds/232527117389994306" -u user@domain.com:pass
{
image : "<BUILD_IMAGE>" ,
metadata : {
commit : "<BUILD_COMMIT>" ,
commitAuthorEmail : "user@domain.com" ,
commitMessage : "Update index.js" ,
commitAuthor : "User" ,
commitDate : "1499368678"
} ,
repository : "https://github.com/wedeploy/temp" ,
type : "dockerfile" ,
branch : "master" ,
directory : "<BUILD_DIRECTORY>" ,
createdAt : 1499379569854 ,
id : "<UID>" ,
serviceId : "service1" ,
wedeploy : {
id : "service1"
} ,
projectId : "myproject" ,
buildGroupUid : "<BUILD_GROUP_UID>" ,
status : "FAILED"
}
List ending deployment activities and associated build
Name
Type
Required
Description
status
string
limit
integer
offset
integer
verbose
boolean
overEnvironments
boolean
List all deployment activities from all project environments
shouldGroup
boolean
Return deployment activities grouped by deployGroupUid
GET /projects/:projectId/deployments
curl " https://api.wedeploy.com/projects/myproject/deployments" -u user@domain.com:pass
[
{
"createdAt" : 1499368678 ,
"metadata" :
{
buildGroupUid,
groupUid,
image,
imageHint,
projectId,
serviceId,
emailAddress,
userName,
userPhotoUrl,
userInitials,
} ,
"projectUid" : '309890364454566095' ,
"id" : '309890364669170261' ,
"type" : 'DEPLOY_TIMEOUT' ,
"projectId" : '1' ,
"build" :
{
image : "<BUILD_IMAGE>" ,
metadata : {
commit : "<BUILD_COMMIT>" ,
commitAuthorEmail : "user@domain.com" ,
commitMessage : "Update index.js" ,
commitAuthor : "User" ,
commitDate : "1499368678"
} ,
repository : "https://github.com/wedeploy/temp" ,
type : "dockerfile" ,
branch : "master" ,
directory : "<BUILD_DIRECTORY>" ,
createdAt : 1499379569854 ,
id : "<UID>" ,
serviceId : "service1" ,
wedeploy : {
id : "service1"
} ,
projectId : "myproject" ,
buildGroupUid : "<BUILD_GROUP_UID>" ,
status : "SUCCEEDED" ,
}
} ,
...
]
GET /projects/:projectId/builds/order/:buildGroupUid
Name
Type
Options
Required
format
string
pretty
curl " https://api.wedeploy.com/projects/myproject/builds/order/jiax601" -u user@domain.com:pass
Create or replace project service environment variable
PUT /projects/:projectId/services/:serviceId/environment-variables/:name
curl -X PUT " https://api.wedeploy.com/projects/myproject/services/hosting/environment-variables/NAME" \
-H " Content-Type: application/json" \
-u user@domain.com:pass \
-d $' {
"value": "VALUE"
}'
Replace project service environment variables
PUT /projects/:projectId/services/:serviceId/environment-variables
curl -X PUT " https://api.wedeploy.com/projects/myproject/services/nodejs/environment-variables" \
-H " Content-Type: application/json" \
-u user@domain.com:pass \
-d $' {
"env": {
"NODE_ENV": "production"
},
}'
List project service environment variables
GET /projects/:projectId/services/:serviceId/environment-variables
curl " https://api.wedeploy.com/projects/myproject/services/hosting/environment-variables" -u user@domain.com:pass
[
{
"createdAt" : 1474607678754 ,
"id" : "<UID>" ,
"name" : "NAME" ,
"projectId" : "myproject" ,
"serviceId" : "hosting" ,
"value" : "VALUE"
}
]
Get project service environment variable
GET /projects/:projectId/services/:serviceId/environment-variables/:name
curl " https://api.wedeploy.com/projects/myproject/services/hosting/env/NAME" -u user@domain.com:pass
{
"createdAt" : 1474607678754 ,
"id" : "<UID>" ,
"name" : "NAME" ,
"projectId" : "myproject" ,
"serviceId" : "hosting" ,
"value" : "VALUE"
}
Delete project service environment variable
DELETE /projects/:projectId/services/:serviceId/environment-variables/:name
curl -X DELETE " https://api.wedeploy.com/projects/myproject/services/hosting/environment-variables/NAME" \
-u user@domain.com:pass
(empty)
List plans visible to user
curl " https://api.wedeploy.com/plans/user"
{
"free" : {
"projects" : 2 ,
"memory" : 1024 ,
"instances" : 2 ,
"description" : "Free" ,
"cpu" : 1 ,
"services" : 2 ,
"storage" : 512 ,
"buildsPerDay" : 100 ,
"customDomains" : 0 ,
"price" : 0 ,
"collaborators" : 0 ,
"planId" : "free" ,
"id" : "280737384934014710" ,
"support" : false ,
"traffic" : 1024 ,
"canScale" : false
} ,
"premium" : {
"projects" : 20 ,
"memory" : 10240 ,
"instances" : 20 ,
"description" : "Premium" ,
"cpu" : 8 ,
"services" : 20 ,
"storage" : 51200 ,
"buildsPerDay" : 10000 ,
"customDomains" : 25 ,
"price" : 149 ,
"collaborators" : 20 ,
"planId" : "premium" ,
"id" : "280737384916914365" ,
"support" : false ,
"traffic" : 122880 ,
"canScale" : true
} ,
"basic" : {
"projects" : 3 ,
"memory" : 2048 ,
"instances" : 3 ,
"description" : "Basic" ,
"cpu" : 2 ,
"services" : 3 ,
"storage" : 2048 ,
"buildsPerDay" : 300 ,
"customDomains" : 3 ,
"price" : 12 ,
"collaborators" : 2 ,
"planId" : "basic" ,
"id" : "280737384942616917" ,
"support" : false ,
"traffic" : 5120 ,
"canScale" : false
} ,
"standard" : {
"projects" : 10 ,
"memory" : 6144 ,
"instances" : 10 ,
"description" : "Standard" ,
"cpu" : 4 ,
"services" : 10 ,
"storage" : 10240 ,
"buildsPerDay" : 1000 ,
"customDomains" : 10 ,
"price" : 49 ,
"collaborators" : 10 ,
"planId" : "standard" ,
"id" : "280737384944430630" ,
"support" : false ,
"traffic" : 20480 ,
"canScale" : true
}
}
All byte-related quotas are in MB
Name
Type
Required
Options
planId
string
yes
description
string
yes
projects
number
yes
services
number
yes
cpu
number
yes
memory
number
yes
traffic
number
yes
customDomains
number
yes
collaborators
number
yes
canScale
boolean
yes
instances
number
yes
storage
number
yes
buildsPerDay
number
yes
constraints
array
support
boolean
yes
price
number
yes
curl -X POST " https://api.wedeploy.com/plans?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>" \
-H " Content-Type: application/json" \
-u teamuser@domain.com:pass
-d ' {
"planId": "free",
"description": "Free",
"projects": 2,
"services": 2,
"cpu": 1,
"memory": 1024,
"traffic": 1024,
"customDomains": 0,
"collaborators": 0,
"canScale": false,
"instances": 2,
"storage": 512,
"buildsPerDay": 100,
"support": false,
"price": 0
}'
{
"planId" : "free" ,
"description" : "Free" ,
"projects" : 2 ,
"services" : 2 ,
"cpu" : 1 ,
"memory" : 1024 ,
"traffic" : 1024 ,
"customDomains" : 0 ,
"collaborators" : 0 ,
"canScale" : false ,
"instances" : 2 ,
"storage" : 512 ,
"buildsPerDay" : 100 ,
"support" : false ,
"price" : 0
} ,
All byte-related quotas are in MB
Name
Type
Required
Options
planId
string
description
string
projects
number
services
number
cpu
number
memory
number
traffic
number
customDomains
number
collaborators
number
canScale
boolean
instances
number
storage
number
buildsPerDay
number
constraints
array
support
boolean
price
number
curl -X PATCH " https://api.wedeploy.com/plans/myplan?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>" \
-H " Content-Type: application/json" \
-u teamuser@domain.com:pass \
-d ' {
"description": "Changed",
}'
(empty)
curl -X DELETE " https://api.wedeploy.com/plans/myplan?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>"
-u teamuser@domain.com:pass
(empty)
Includes services specifically for that environment
curl " https://api.wedeploy.com/catalog/services"
{
"wedeploy/auth" : {
"category" : "WeDeploy™" ,
"description" : "Simple authentication with email\/password or third-party providers like GitHub and Google." ,
"image" : "wedeploy\/auth" ,
"name" : "WeDeploy™ Auth" ,
"state" : "active" ,
"versions" : [ "latest" , "v1.5.0" ]
} ,
...
}
For every request a token or credential may be extracted in the following order:
Source
Key
Basic Authentication
curl -u "username:password" "https://api.wedeploy.com"
Oauth2 Token (header)
curl -H "Authorization: Bearer TOKEN" "https://api.wedeploy.com"
Oauth2 Token (cookie)
curl -H "Cookie:access_token=TOKEN" "https://api.wedeploy.com"
MasterToken (header)
curl -H "Authorization: MasterToken TOKEN" "https://api.wedeploy.com
Name
Type
Required
email
string
✓
name
string
✓
password
string
✓
photoUrl
string
curl -X POST " https://api.wedeploy.com/user/create" \
-H " Content-Type: application/json" \
-d $' {
"email": "user@domain.com",
"name": "User Name",
"password": "pass"
}'
{
"createdAt" : 1489019572853 ,
"email" : "user@domain.com" ,
"id" : "<UID>" ,
"initials" : "U" ,
"invitationPending" : false ,
"name" : "User Name" ,
"password" : "<PASSWORD>" ,
"photoUrl" : null ,
"supportedScopes" : [ ]
}
curl " https://api.wedeploy.com/user" -u user@domain.com:pass
{
"createdAt" : 1489019572853 ,
"email" : "user@domain.com" ,
"id" : "<UID>" ,
"initials" : "E" ,
"invitationPending" : false ,
"name" : "User Name"
}
Name
Type
Required
email
string
name
string
preferences
object
curl -X PATCH https://api.wedeploy.com/user/update \
-H " Content-Type: application/json" \
-u user@domain.com:pass \
-d ' {
"email":"update@domain.com",
"name":"Update Name",
"preferences": {
"alertsServiceStatusConsole": "true",
"alertsServiceStatusEmail": "false",
"alertsCpuUsageConsole": "true",
"alertsCpuUsageEmail": "false",
"alertsMemoryUsageConsole": "true",
"alertsMemoryUsageEmail": "false",
"alertsInstancesUsageConsole": "true",
"alertsInstancesUsageEmail": "false",
"alertsTransferUsageConsole": "true",
"alertsTransferUsageEmail": "false",
"alertsStorageUsageConsole": "true",
"alertsStorageUsageEmail": "false"
},
}'
(empty)
(empty)
Send recover password email
Name
Type
Required
email
string
✓
curl -X POST " https://api.wedeploy.com/user/recover" \
-H " Content-Type: application/json" \
-d $' {
"email": "user@domain.com"
}'
(empty)
Name
Type
Required
email
string
✓
curl -X POST " https://api.wedeploy.com/confirm" \
-H " Content-Type: application/json" \
-d $' {
"email": "user@domain.com"
}'
(empty)
Confirm email verification
Name
Type
Required
email
string
✓
confirmationToken
string
✓
ignoreRedirect
boolean
curl " https://api.wedeploy.com/confirm?email=user@domain.com&confirmationToken=12345"
(empty)
Name
Type
Required
code
string
✓
email
string
✓
password
string
✓
curl -X POST " https://api.wedeploy.com/user/reset" \
-H " Content-Type: application/json" \
-d $' {
"code": "<RESET_CODE>",
"email": "user@domain.com",
"password": "newpass"
}'
(empty)
Send Reset Password Email (For api-auth)
Name
Type
Required
resetCode
string
✓
email
string
✓
curl -X POST " https://api.wedeploy.com/reset-password" \
-H " Content-Type: application/json" \
-d $' {
"resetCode": "<RESET_CODE>",
"email": "user@domain.com",
}'
(empty)
Send Reset Password Success Email (For api-auth)
POST /reset-password-success
Name
Type
Required
email
string
✓
curl -X POST " https://api.wedeploy.com/reset-password-success" \
-H " Content-Type: application/json" \
-d $' {
"email": "user@domain.com",
}'
(empty)
Login user using credentials
Name
Type
Required
email
string
✓
password
string
✓
curl -X POST " https://api.wedeploy.com/login" \
-H " Content-Type: application/json" \
-d $' {
"email": "user@domain.com",
"password": "pass"
}'
{
"createdAt" : 1489019572853 ,
"email" : "user@domain.com" ,
"id" : "<UID>" ,
"initials" : "E" ,
"invitationPending" : false ,
"name" : "User name" ,
"password" : null ,
"photoUrl" : null ,
"supportedScopes" : [ ] ,
"token" : "TOKEN"
}
Login user using provider
Name
Type
Required
provider
string
✓
provider_scope
string
✓
redirect_uri
string
✓
scope
string
curl " https://api.wedeploy.com/oauth/authorize?provider=github&provider_scope=email&redirect_uri=http://myproject.com"
Name
Type
Required
redirect_uri
string
curl " https://api.wedeploy.com/logout" -u user@domain.com:pass
(empty)
Name
Type
Required
token
string
✓
curl " https://api.wedeploy.com/oauth/tokeninfo?token=TOKEN"
{
"access_token" : "<TOKEN>" ,
"expires_in" : null ,
"refresh_token" : null ,
"scope" : null ,
"token_type" : "bearer"
}
Name
Type
Required
redirect_uri
string
token
string
✓
curl " https://api.wedeploy.com/oauth/revoke?token=TOKEN"
(empty)
Create user token (password)
Name
Type
Required
grant_type
string
✓
password
string
✓
username
string
✓
curl -X POST " https://api.wedeploy.com/oauth/token" \
-H " Content-Type: application/json" \
-d $' {
"grant_type": "password",
"password": "pass",
"username": "user@domain.com"
}'
{
"access_token" : "<TOKEN>" ,
"expires_in" : null ,
"refresh_token" : null ,
"scope" : null ,
"token_type" : "bearer"
}
Name
Type
Required
code
string
✓
grant_type
string
✓
provider
string
✓
redirect_uri
string
curl -X POST " https://api.wedeploy.com/oauth/token?code=CODE&provider=github&redirect_uri=http://myproject.com" \
-H " Content-Type: application/json" \
-d $' {
"code": "<CODE>",
"grant_type": "authorization_code",
"provider": "github"
}'
{
"access_token" : "<TOKEN>" ,
"expires_in" : null ,
"refresh_token" : null ,
"scope" : null ,
"token_type" : "bearer"
}
GET /validators/projects/:projectId/services/:serviceId/custom-domains
Name
Type
Required
value
string
✓
curl " https://api.wedeploy.com/validators/projects/1/services/2/custom-domains?value=valid.wedeploy.com" -u user@domain.com:pass
(empty)
Name
Type
Required
value
string
✓
curl " https://api.wedeploy.com/validators/email?value=email@domain.com" -u user@domain.com:pass
(empty)
Validate project collaborator
GET /validators/projects/:projectId/collaborator
Name
Type
Required
value
string
✓
curl " https://api.wedeploy.com/validators/projects/1/collaborator?value=1" -u user@domain.com:pass
(empty)
GET /validators/accounts/email
Name
Type
Required
value
string
✓
curl " https://api.wedeploy.com/validators/accounts/email?value=test@domain.com" -u user@domain.com:pass
(empty)
GET /validators/projects/id
Name
Type
Required
value
string
✓
curl " https://api.wedeploy.com/validators/projects/id?value=projectId" -u user@domain.com:pass
(empty)
GET /validators/projects/:projectId/services/id
Name
Type
Required
value
string
✓
curl " https://api.wedeploy.com/validators/projects/1/services/id?value=serviceId" -u user@domain.com:pass
(empty)
Name
Type
Required
value
string
✓
curl " https://api.wedeploy.com/validators/required?value=value"
(empty)
POST /hooks/providers/:provider/build/:projectId/:masterToken?
Name
Type
Required
ref
string
✓
repository
string
✓
curl -X POST " https://api.wedeploy.com/hooks/providers/github/build/myproject/<OPTIONAL_PROJECT_MASTER_TOKEN>" \
-H " Content-Type: application/json" \
-u user@domain.com:pass \
-d $' {
"ref": "refs/heads/master",
"repository": {full_name: ' user/repo' },
}'
[
{
"cpu" : 1.0 ,
"createdAt" : 1490054338701 ,
"deployGroupUid" : "<DEPLOY_GROUP_ID>" ,
"health" : "up" ,
"id" : "<UID>" ,
"image" : "wedeploy/hosting" ,
"memory" : 4096 ,
"port" : 80 ,
"projectId" : "myproject" ,
"scale" : 1 ,
"serviceId" : "hosting"
} ,
...
]
GET /hooks/providers/:provider/oauth/link-provider
Name
Type
Required
state
string
✓
code
string
✓
redirect_uri
string
curl " https://api.wedeploy.com/hooks/providers/Github/oauth/link-provider \
?state=<OAUTH_STATE> \
&code=<OAUTH_CODE> \
&redirect_uri=https://console.wedeploy.com/projects/:projectId/github"
(empty)
Subscribe project activities
WS /subscribe/project/activities
Name
Type
Required
accessToken
string
✓
projectId
string
✓
WS /subscribe/user/projects
Name
Type
Required
accessToken
string
✓
Subscribe project services
WS /subscribe/project/services
Name
Type
Required
accessToken
string
✓
projectId
string
✓
Subscribe project service
WS /subscribe/project/service
Name
Type
Required
accessToken
string
✓
projectId
string
✓
serviceId
string
✓
Retrieve CPU metrics for service
Name
Type
Required
period
string
start
string
end
string
frequency
string
order
string
limit
number
curl " https://api.wedeploy.com/projects/myproject/services/myservice/metrics/cpu?period=10m&frequency=30s" \
-u user@domain.com:pass
[
{
time : 1504025885000 ,
value : 0.0391573682 ,
instance : 1
} ,
...
]
Retrieve Memory metrics for service
Name
Type
Required
period
string
start
string
end
string
frequency
string
order
string
limit
number
curl " https://api.wedeploy.com/projects/myproject/services/myservice/metrics/memory?period=10m&frequency=30s" \
-u user@domain.com:pass
[
{
time : 1504025885000 ,
value : 14401536 ,
instance : 1
} ,
...
]
Retrieve Traffic-In metrics for service
Name
Type
Required
period
string
start
string
end
string
frequency
string
order
string
limit
number
curl " https://api.wedeploy.com/projects/myproject/services/myservice/metrics/traffic/in?period=10m&frequency=30s" \
-u user@domain.com:pass
[
{
time : 1504025885000 ,
value : 143 ,
instance : 1
} ,
...
]
Retrieve Traffic-Out metrics for service
Name
Type
Required
period
string
start
string
end
string
frequency
string
order
string
limit
number
curl " https://api.wedeploy.com/projects/myproject/services/myservice/metrics/traffic/out?period=10m&frequency=30s" \
-u user@domain.com:pass
[
{
time : 1504025885000 ,
value : 143 ,
instance : 1
} ,
...
]
Retrieve Health metrics for service
Name
Type
Required
period
string
start
string
end
string
frequency
string
order
string
limit
number
now
boolean
curl " https://api.wedeploy.com/projects/myproject/services/myservice/metrics/health?period=10m&frequency=30s" \
-u user@domain.com:pass
[
{
time : 1504025885000 ,
value : 1 ,
instance : 1
} ,
...
]
Retrieve volume metrics for project
curl " https://api.wedeploy.com/projects/myproject/metrics/volumes" \
-u user@domain.com:pass
[
{
"name" : "283438694262688104-data" ,
"path" : "/var/lib/mysql" ,
"files" : 694 ,
"directories" : 5 ,
"value" : 134.155
} ,
...
]
Retrieve account collaborator usage
GET /account/usage/collaborators
curl " https://api.wedeploy.com/account/usage/collaborators" \
-u user@domain.com:pass
{
value : 1 ,
planTotal : 5 ,
projects : [
{
projectId : "example" ,
value : 1
}
]
}
Retrieve account CPU usage
curl " https://api.wedeploy.com/account/usage/cpu" \
-u user@domain.com:pass
{
value : 0.5 ,
planTotal : 1 ,
services : [
{
projectId : "example" ,
serviceId : "hosting" ,
value : 0.5 ,
}
]
}
Retrieve account custom domain usage
GET /account/usage/custom-domains
curl " https://api.wedeploy.com/account/usage/custom-domains" \
-u user@domain.com:pass
{
value : 1 ,
planTotal : 5 ,
services : [
{
serviceId : "hosting" ,
projectId : "example" ,
value : 1 ,
}
]
}
Retrieve account instance usage
GET /account/usage/instances
curl " https://api.wedeploy.com/account/usage/instances" \
-u user@domain.com:pass
{
value : 1 ,
planTotal : 2 ,
services : [
{
serviceId : "hosting" ,
projectId : "example" ,
value : 1 ,
}
]
}
Retrieve account memory usage
GET /account/usage/memory
curl " https://api.wedeploy.com/account/usage/memory" \
-u user@domain.com:pass
{
value : 512 ,
planTotal : 1024 ,
services : [
{
serviceId : "hosting" ,
projectId : "example" ,
value : 512 ,
}
]
}
Retrieve account projects usage
GET /account/usage/projects
curl " https://api.wedeploy.com/account/usage/projects" \
-u user@domain.com:pass
{
value : 1 ,
planTotal : 3 ,
}
Retrieve account support capability
GET /account/usage/support
curl " https://api.wedeploy.com/account/usage/support" \
-u user@domain.com:pass
Retrieve account scale capability
curl " https://api.wedeploy.com/account/usage/scale" \
-u user@domain.com:pass
Retrieve account traffic usage
GET /account/usage/traffic
curl " https://api.wedeploy.com/account/usage/traffic" \
-u user@domain.com:pass
{
value : 4341653 ,
planTotal : 1024000000 ,
services : [
{
serviceId : "hosting" ,
projectId : "example" ,
value : 4341653 ,
}
]
}
Retrieve account volume usage
GET /account/usage/volumes
curl " https://api.wedeploy.com/account/usage/volumes" \
-u user@domain.com:pass
{
"value" : 274240995 ,
"planTotal" : 1000 ,
"services" : [
{
"name" : "283438694262688104-data" ,
"path" : "/var/lib/mysql" ,
"files" : 694 ,
"directories" : 5 ,
"value" : 274240995
}
]
}
curl " https://api.wedeploy.com/account/usage" \
-u user@domain.com:pass
{
"collaborators" : {
"value" : 0 ,
"planTotal" : 600 ,
"projects" : [
{
"projectId" : "test1" ,
"value" : 0
}
]
} ,
"cpu" : {
"value" : 6 ,
"planTotal" : 300 ,
"services" : [
{
"projectId" : "test1" ,
"serviceId" : "db" ,
"value" : 6
}
]
} ,
"customDomains" : {
"value" : 0 ,
"planTotal" : 600 ,
"services" : [
{
"projectId" : "test1" ,
"serviceId" : "db" ,
"value" : 0
}
]
} ,
"memory" : {
"value" : 4096 ,
"planTotal" : 307200 ,
"services" : [
{
"projectId" : "test1" ,
"serviceId" : "db" ,
"value" : 4096
}
]
} ,
"projects" : {
"value" : 1 ,
"planTotal" : 300
} ,
"instances" : {
"value" : 1 ,
"planTotal" : 300 ,
"services" : [
{
"projectId" : "test1" ,
"serviceId" : "db" ,
"value" : 1
}
]
} ,
"traffic" : {
"value" : 35785407.70634852 ,
"planTotal" : 10737418240000 ,
"services" : [
{
"projectId" : "test1" ,
"serviceId" : "db" ,
"value" : 35785407.70634852
}
]
} ,
"volumes" : {
"value" : 274240995 ,
"planTotal" : 1000 ,
"services" : [
{
"name" : "276399336844630531-data" ,
"path" : "/var/lib/mysql" ,
"files" : 694 ,
"directories" : 5 ,
"value" : 274240995
}
]
}
}
curl " https://api.wedeploy.com/account/usage/top" \
-u user@domain.com:pass
{
value : 0.6666666666666666 ,
planTotal : 1 ,
services : [
{
projectId : "example" ,
serviceId : "hosting" ,
value : 0.3333333333333333
} ,
{
projectId : "example" ,
serviceId : "auth" ,
value : 0.3333333333333333
} ,
]
}
List current account subscription
GET /account/billing/subscriptions
curl " https://api.wedeploy.com/account/billing/subscriptions" \
-u user@domain.com:pass
[
{
id : "sub_BRD6hMr5X9rPGS" ,
planId : "free" ,
status : "active" ,
amount : 0 ,
currency : "usd" ,
interval : "month" ,
intervalCount : 1 ,
createdAt : 1505961871000 ,
canceledAt : null ,
endedAt : null ,
currentPeriodEnd : 1508553871000 ,
currentPeriodStart : 1505961871000 ,
trialEnd : null ,
trialStart : null
}
]
List invoices for account
GET /account/billing/invoices
curl " https://api.wedeploy.com/account/billing/invoices" \
-u user@domain.com:pass
[
{
id : "in_1B4KfzErwzAsisk6abS3yUuJ" ,
date : 1505961871000 ,
lines : [
{
planId : "free" ,
description : "WeDeploy Free" ,
subtotal : 0 ,
total : 0 ,
amountDue : 0 ,
currency : "usd" ,
interval : "month" ,
intervalCount : 1 ,
trial : null ,
periodEnd : 1508553871000 ,
periodStart : 1505961871000
}
]
}
. . .
]
Retrieve payment info for account
GET /account/billing/payment-info
curl " https://api.wedeploy.com/account/billing/payment-info" \
-u user@domain.com:pass
{
brand : "Visa" ,
last4 : "4242" ,
token : "tok_1B4KrxErwzAsisk6QCiNsdt2" ,
type : "card"
}
Retrieve trial period for plan
GET /account/billing/trial-period/:planId
curl " https://api.wedeploy.com/account/billing/trial-period/:planId" \
-u user@domain.com:pass
Update payment info for account
POST /account/billing/payment-info
Name
Type
Required
stripeToken
string
✓
stripeTokenType
string
✓
shippingName
string
✓
shippingAddressCountry
string
✓
shippingAddressCountryCode
string
✓
shippingAddressZip
string
✓
shippingAddressLine1
string
✓
shippingAddressCity
string
✓
shippingAddressStat
string
✓
curl -X POST " https://api.wedeploy.com/account/billing/payment-info" \
-H ' Content-Type: application/json; charset=utf-8' \
-u user@domain.com:pass \
-d $' {
"stripeToken": "tok_1B4L0ZErwzAsisk6GKGA4FHj",
"stripeTokenType": "card"
"shippingName": "Liferay",
"shippingAddressCountry": "United States",
"shippingAddressCountryCode": "US",
"shippingAddressZip": "91765",
"shippingAddressLine1": "1400 Montefino Ave",
"shippingAddressCity": "Diamond Bar",
"shippingAddressState": "91765",
}'
{
customerPaymentType : "card" ,
customerPaymentToken : "tok_1B4L0ZErwzAsisk6GKGA4FHj" ,
}
POST /account/billing/subscribe
Name
Type
Required
planId
string
✓
coupon
string
curl -X POST " https://api.wedeploy.com/account/billing/subscribe" \
-H ' Content-Type: application/json; charset=utf-8' \
-u user@domain.com:pass \
-d $' {
"planId": "basic",
"coupon": "DEVCON2017"
}'
{
"subscriptionId" : "sub_BRDbydjqmxaAdw"
}
POST /account/billing/unsubscribe
Name
Type
Required
planId
string
✓
curl -X POST " https://api.wedeploy.com/account/billing/unsubscribe" \
-H ' Content-Type: application/json; charset=utf-8' \
-u user@domain.com:pass \
-d $' {
"planId": "basic"
}'
POST /projects/:projectId/vpn
curl -X POST " https://api.wedeploy.com/projects/:projectId/vpn" \
-H " Content-Type: application/json" \
-u teamuser@domain.com:pass \
-d ' {
"host": "127.0.0.1:8090",
"login": "the-login",
"password": "the-password",
"certificate": "-----BEGIN CERTIFICATE-----\nMIIDFzCCAf+gAwIBDQEBCwUAMBExDzANBgNV\n-----END CERTIFICATE-----"
}'
{
connected : true ,
host : "127.0.0.1:8090" ,
login : "the-login" ,
password : "the-password" ,
certificate : "-----BEGIN CERTIFICATE-----\nMIIDFzCCAf+gAwIBDQEBCwUAMBExDzANBgNV\n-----END CERTIFICATE-----"
}
DELETE /projects/:projectId/vpn
curl -X DELETE " https://api.wedeploy.com/projects/:projectId/vpn" \
-H " Content-Type: application/json" \
-u teamuser@domain.com:pass \
Return vpn connection configurations
GET /projects/:projectId/vpn
curl " https://api.wedeploy.com/projects/:projectId/vpn" -u teamuser@domain.com:pass
{
connected : true ,
host : "127.0.0.1:8090" ,
password : "123456" ,
login : "the-login" ,
certificate : "-----BEGIN CERTIFICATE-----\nMIIDFzCCAf+gAwIBDQEBCwUAMBExDzANBgNV\n-----END CERTIFICATE-----" ,
forwardingPorts : [ ] ,
}
Maintenance vpn port forwarding
POST /projects/:projectId/vpn-forwarding
curl -X POST " https://api.wedeploy.com/projects/:projectId/vpn-forwarding" \
-H " Content-Type: application/json" \
-u teamuser@domain.com:pass \
-d ' {
"forwarding":
[
{
"host": "127.0.0.1",
"port": 8090,
},
{
"host": "127.0.0.1",
"port": 8091,
}
]
}'
{
connected : true ,
host : "127.0.0.1:8090" ,
password : "123456" ,
login : "the-login" ,
certificate : "-----BEGIN CERTIFICATE-----\nMIIDFzCCAf+gAwIBDQEBCwUAMBExDzANBgNV\n-----END CERTIFICATE-----" ,
forwardingPorts : [
{
host : "127.0.0.1" ,
port : 8090 ,
internalPort : 30125
} ,
{
host : "127.0.0.1" ,
port : 8091 ,
internalPort : 30126
}
]
}
GET /admin/:collection/:id?
Examples:
GET /admin/activities/:id?
GET /admin/builds/:id?
GET /admin/envs/:id?
GET /admin/plans/:id?
GET /admin/projects/:id?
GET /admin/services/:id?
GET /admin/users/:id?
Name
Type
Required
Options
type
string
count
limit
string
offset
string
field
string
order
string
asc, desc
curl " https://api.wedeploy.com/admin/users?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>" -u teamuser@domain.com:pass
[
{
"createdAt" : 1489019572853 ,
"email" : "user@domain.com" ,
"id" : "<UID>" ,
"initials" : "E" ,
"invitationPending" : false ,
"name" : "User Name"
} ,
...
]
if type=count
List Health of all Services
curl " https://api.wedeploy.com/admin/health?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>" -u teamuser@domain.com:pass
[
{
node : {
total : 1 ,
up : 1
} ,
miscellaneous : {
total : 0 ,
up : 0
} ,
wedeploy / auth : {
total : 1 ,
up : 0
} ,
wedeploy / data : {
total : 1 ,
up : 0
} ,
wedeploy / email : {
total : 0 ,
up : 0
} ,
wedeploy / engine : {
total : 0 ,
up : 0
} ,
wedeploy / hosting : {
total : 2 ,
up : 2
} ,
wedeploy / liferay : {
total : 0 ,
up : 0
}
}
. . .
]
Retrieve system wide usage
curl " https://api.wedeploy.com/admin/usage?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>" -u teamuser@domain.com:pass
{
"cpu" : 123 ,
"memory" : 204800 ,
"customDomains" : 100 ,
"instances" : 200 ,
"collaborators" : 25 ,
"traffic" : 231829384731 ,
"storage" : 102400005678 ,
}
Update Collection Document
PATCH /admin/:collection/:id?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>
curl -X PATCH " https://api.wedeploy.com/admin/users/123?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>" \
-H " Content-Type: application/json" \
-u teamuser@domain.com:pass \
-d ' {
"email":"update@domain.com",
"name":"Updated Name",
"supportedScopes": ["team"]
}'
(empty)
POST /admin/:collection?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>
curl -X POST " https://api.wedeploy.com/admin/projects?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>" \
-H " Content-Type: application/json" \
-u teamuser@domain.com:pass \
-d ' {
"projectId": "myproject",
"id": "5678",
"collaborators": ["212069869435631201"]
}'
{
"collaborators" : [
"212069869435631201"
] ,
"id" : "5678" ,
"projectId" : "myproject" ,
}
DELETE /admin/user/:userId?
Name
Type
Required
email
string
id
string
curl -X DELETE " https://api.wedeploy.com/admin/user/123?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>" \
-u teamuser@domain.com:pass
(empty)
DELETE /admin/collection/:collection/:id/:field?
####DO NOT USE UNLESS YOU JUST NEED TO DELETE A DOCUMENT AND NOT THEIR RELATED ASSETS
FOR EXAMPLE, THIS WILL NOT DELETE THE SERVICES OF A PROJECT
curl -X DELETE " https://api.wedeploy.com/admin/projects/123/ownerId?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>" \
-u teamuser@domain.com:pass
(empty)
POST /admin/billing/subscribe/user/:userId
curl -X POST " https://api.wedeploy.com/admin/billing/subscribe/user/123?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>" \
-H " Content-Type: application/json" \
-u teamuser@domain.com:pass \
-d ' {
"planId": "premium"
}'
{
"subscriptionId" : "sub_BRDbydjqmxaAdw"
}
Retrieve user account usage by spec
GET /admin/usage/:spec/user/:userId
curl -X GET " https://api.wedeploy.com/admin/usage/cpu/user/123?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>" \
-H " Content-Type: application/json" \
-u teamuser@domain.com:pass
{
value : 0.5 ,
planTotal : 1 ,
services : [
{
projectId : "example" ,
serviceId : "hosting" ,
value : 0.5 ,
}
]
}
POST /admin/wedeploy/recover
curl -X POST " https://api.wedeploy.com/admin/wedeploy/recover?master_token=<OPTIONAL_WEDEPLOY_MASTER_TOKEN>" \
-H " Content-Type: application/json" \
-u teamuser@domain.com:pass
(empty)
There is a Jenkinsfile containing the information about how this project is built. There, we select a Jenkins slave node to execute the tasks, and then we define several stages for the pipeline:
Setup: we asure the machine has been configured properly, mainly node.
Install dependencies: we fetch all dependencies using NPM.
Start infrastructure: we start the local infrastructure
Test: we execute unit and integration tests in parallel against the XYZ environment. At the end of the test execution, the CI server will gather the test execution results.
Finally, when all previous stages have finished, we ensure that the infrastructure is shutdown properly.
The build of the image has been delegated to the CI. A merge commit to master will update the current snapshot, following tag name convention:
Successfully tagged wedeploy/api:staging
Successfully tagged wedeploy/api:local
Successfully tagged wedeploy/api:4.5.2-20190329084603_942b49f4
Successfully tagged wedeploy/api:4.5.2
The wedeploy/api:local
image can be tagged by running the ./tag-images.sh
script.
With it you can customize some parameters of the build:
variable
description
IMAGE_PREFIX
Configures the prefix of the image (defaults to wedeploy
)
IMAGE_TAG
Configures the tag of the image (defaults to staging
)
For instance:
IMAGE_PREFIX=localhost:5000/cirocosta.co \
IMAGE_TAG=dev \
./tag-images.sh
# Starting to tag image
# FULL_NAME: localhost:5000/cirocosta.co/api:dev
# IMAGE_PREFIX: localhost:5000/cirocosta.co
# IMAGE_TAG: dev
# CONTEXT: /Users/cirocosta/Development/wedeploy/api
Note 1.: In order to tag the docker images, it assumes you have previously built the current code with the tag local
.
Publishing the image to Docker Hub
We advise against pushing local images in favour of letting the CI to do it. For that reason the push
script has been removed from this repository. Instead, the CI will push the image in two scenarios:
On merges to master: it will push a Docker tag following this tag name convention currentVersion-timestamp_shortHash . As an example: 4.5.2-20190227111212_abcdef
.
On git tags (api releases ): it will push a Docker tag with the current version. The latest
tag won't be updated. It's important to mention that the git tag value must go in-sync with project version.
If you are still interested in pushing from local, which is not a best practice, please follow Jenkinsfile instructions to build and push the image.
There is a ./package.json file with current version of the image. This value determines the tag of the Docker image representing the project. Please do not update it manually: use the available scripts instead.
Send a pull request to wedeploy/api
Github repository, against master
branch. At release time, a merge commit to master
branch will produce that the CI server (Jenkins) pushes the Docker image with following tags:
wedeploy/api:staging
wedeploy/api:4.5.2-20190329084603_942b49f4
If you still want to build, push and release the api
images locally, please use the commands that are present in the Jenkinsfile, where you can clearly see which environment variables are affecting the build.
This is not recommended, as the publication of the image must be as much automated as possible, using the CI. First make sure that your "local" tag is in the desired state.
# Download release scripts
GITHUB_TOKEN=' YOUR_GITHUB_TOKEN' ./.jenkins/main.sh --setup-machine
# Build images with proper tag convention
./.jenkins/main.sh --build-images
# Push snapshots to Docker Hub
DOCKER_USERNAME=' YOUR_DOCKER_USER' DOCKER_PASSWORD=' YOUR_DOCKER_PASSWORD' ./.jenkins/main.sh --push-images
# Push release to Docker Hub
DOCKER_USERNAME=' YOUR_DOCKER_USER' DOCKER_PASSWORD=' YOUR_DOCKER_PASSWORD' ./.jenkins/main.sh --release-images
To release the api
images using SEMVER, we are going to use mdelapenya/webump:1.0.0
. Just execute the following shell script to perform the bump:
./bump.sh [major| minor| patch]
which will update the version present in the package.json
in consequence. This will also create a git commit with the bump, and a git tag with the proper version. After pushing this git tag to the repository, the CI will execute the release process, which will read the current value of the version from the previous files, and use them as Docker tag. Then it will push the released image to Docker Hub, using the described above process for releasing.
IMPORTANT: You still have to go to Jenkins UI to manually trigger the build. Check out why here .
BSD-3-Clause © Liferay, Inc.