Deployment API
ace-deployment-server
service exposes API endpoints which are mostly used by ACE CLI commands.
This page describes stable API endpoints that can be used by external tools.
API endpoints
Deploy git workspace
This API is used to deploy workspace from git repository to production environment.
POST http://{ace-deployment-server}/deploy/workspace/git
Query parameters
merge
(pass astrue
) - used to merge existing workspace with a new onepackageName
optional - used to define name of the package. Can also be used in combination with merge command to merge with corresponding existing package.
Body
repository
- repository urltoken
- git tokenbranch
- git branch namecommit
optional - git commitusername
optional - git usernamerepositoryWorkspacePath
(default:src/ace
) - path to workspace.deploymentSecrets
optional - resolution for dependency secrets specified inpackage.yaml
with${{key}}
format.
Deploy workspace from zip file
This API is used to deploy workspace from zip file to production environment.
POST http://{ace-deployment-server}/deploy/workspace/zip
Query parameters
merge
(pass astrue
) - used to merge existing workspace with a new onepackageName
optional - used to define name of the package. Can also be used in combination with merge command to merge with corresponding existing package.
Body
Need to specify header Content-Type: application/zip
Body must contain binary zip
file content.
List deployed packages
This API is used to list all packages in the production environment.
GET http://{ace-deployment-server}/workspaces
Delete deployed package
This API is used to delete package in the production environment by packageName
.
DELETE http://{ace-deployment-server}/workspace
Query parameters
packageName
optional - name of the package to delete.
Download deployed package
This API is used to download package in the production environment by packageName
.
GET http://{ace-deployment-server}/workspace/download
Query parameters
packageName
optional - name of the package to download.
Deploy schedules from git repository
This API is used to deploy schedules from git repository to production environment.
POST http://{ace-deployment-server}/deploy/schedules/git
Body
repository
- repository urltoken
- git tokenbranch
- git branch namecommit
optional - git commitusername
optional - git usernamerepositoryWorkspacePath
(default:src/ace
) - path to workspace.deploymentSecrets
optional - resolution for dependency secrets specified inpackage.yaml
with${{key}}
format.
Deploy schedules from zip
This API is used to deploy schedules from zip file to production environment.
POST http://{ace-deployment-server}/deploy/schedules/zip
Body
Need to specify header Content-Type: application/zip
Body must contain binary zip
file content.
Clean up development workspaces
This API is used to delete development workspaces in MongoDB based on workspaces age. By default, workspaces that are older than 24 hours are deleted.
DELETE http://{ace-deployment-server}/clear/workspace/dev?workspaceAge={workspaceAge}
Parameters
workspaceAge
(default:24
) - A optional numeric value that represents hours. Workspaces that are older than the provided value are deleted.
Clear (redis) cache
This API is used to clear cached values in redis database based on prefix.
DELETE http://{ace-deployment-server}/clear/redis/cache
Parameters
Parameters used by this API are set up as environment variables
REDIS_CACHE_URL
- redis connection string, should start withredis://
orrediss://
REDIS_CACHE_KEY
- redis passwordREDIS_KEY_PREFIX
(default:ace-cache
) - prefix to be used by installed jobsREDIS_CACHE_DB
- redis dbREDIS_CACHE_HOST
- redis hostREDIS_CACHE_PORT
- redis portREDIS_CACHE_USER
- redis usernameREDIS_CACHE_TLS_ENABLED
- redis tls enabled flagREDIS_CACHE_TLS_KEY
- redis tls keyREDIS_CACHE_TLS_CERT
- redis tls certREDIS_CACHE_TLS_CA
- redis tls ca
Export workspace
This API packages a workspace and all it's dependencies into a conveniently structured zip file for deployment or importing into ACE UI.
Since this API resolves dependencies, it is necessary to supply required secrets in deploymentSecrets
field.
POST http://{ace-deployment-server}/export/workspace
Body
repository
- repository urltoken
- git tokenbranch
- git branch namecommit
optional - git commitusername
optional - git usernamerepositoryWorkspacePath
(default:src/ace
) - path to workspace.deploymentSecrets
optional - resolution for dependency secrets specified inpackage.yaml
with${{key}}
format.
Returns
Returns a zip file containing the bundled workspace.
Supplying secrets
If using dependencies or other features that require secret resolution during deployment, you may pass them via body property deploymentSecrets
as a plain object with key-value mappings.
An example package.yaml
definition with a respective deploymentSecrets
mapping:
wsVersion:2
dependencies:
- name: common
kind: git
gitUrl: http://github.com/repo
gitToken: ${{ myGitToken }}
# ^--- Deployment secret key
wsPath: /src/ace
{
"deploymentSecrets": {
"myGitToken": "secret"
},
// ... other properties
}