Core
PaaS v2.x
2

Applications #

An application is a deployable component inside an environment.

Controller: application

Base HTTP route:

/projects/:projectId/environments/:environmentId/applications

Supported application types #

  • kuzzle
  • kuzzleES8
  • webapp
  • custom

Create an application #

const application = await kuzzle.query({
  controller: 'application',
  action: 'create',
  projectId: 'paas-project-my-project',
  environmentId: 'production',
  body: {
    _id: 'api',
    name: 'kuzzleES8',
    metadata: {},
    spec: {},
    settings: {
      projectId: 'paas-project-my-project',
      environmentId: 'production'
    },
    status: 'Progressing'
  }
});

HTTP route:

POST /projects/:projectId/environments/:environmentId/applications

The platform completes missing deployment values from the application templates stored by the backend.

List applications #

const applications = await kuzzle.query({
  controller: 'application',
  action: 'list',
  projectId: 'paas-project-my-project',
  environmentId: 'production'
});

HTTP route:

GET /projects/:projectId/environments/:environmentId/applications

Get an application #

const application = await kuzzle.query({
  controller: 'application',
  action: 'get',
  projectId: 'paas-project-my-project',
  environmentId: 'production',
  applicationId: 'api'
});

HTTP route:

GET /projects/:projectId/environments/:environmentId/applications/:applicationId

Update an application #

const application = await kuzzle.query({
  controller: 'application',
  action: 'update',
  projectId: 'paas-project-my-project',
  environmentId: 'production',
  applicationId: 'api',
  body: {
    _id: 'api',
    name: 'kuzzleES8',
    metadata: {},
    spec: {},
    settings: {
      projectId: 'paas-project-my-project',
      environmentId: 'production',
      customDomain: 'api.example.com'
    },
    status: 'Healthy'
  }
});

HTTP route:

PUT /projects/:projectId/environments/:environmentId/applications/:applicationId

Deploy an image #

Deploys a new Docker image version for an existing application.

await kuzzle.query({
  controller: 'application',
  action: 'deploy',
  projectId: 'paas-project-my-project',
  environmentId: 'production',
  applicationId: 'api',
  body: {
    image: {
      name: 'harbor.paas.kuzzle.io/my-project/api',
      tag: '1.2.3'
    }
  }
});

HTTP route:

POST /projects/:projectId/environments/:environmentId/applications/:applicationId/_deploy

Disable an application #

const application = await kuzzle.query({
  controller: 'application',
  action: 'disable',
  projectId: 'paas-project-my-project',
  environmentId: 'production',
  applicationId: 'api'
});

HTTP route:

POST /projects/:projectId/environments/:environmentId/applications/:applicationId/_disable

Enable an application #

const application = await kuzzle.query({
  controller: 'application',
  action: 'enable',
  projectId: 'paas-project-my-project',
  environmentId: 'production',
  applicationId: 'api'
});

HTTP route:

POST /projects/:projectId/environments/:environmentId/applications/:applicationId/_enable

Delete an application #

await kuzzle.query({
  controller: 'application',
  action: 'delete',
  projectId: 'paas-project-my-project',
  environmentId: 'production',
  applicationId: 'api'
});

HTTP route:

DELETE /projects/:projectId/environments/:environmentId/applications/:applicationId

Register an Elasticsearch snapshot repository #

Registers snapshot configuration for an existing application. This action is mostly useful for Kuzzle applications backed by Elasticsearch.

await kuzzle.query({
  controller: 'application',
  action: 'registerSnapshot',
  projectId: 'paas-project-my-project',
  environmentId: 'production',
  applicationId: 'api'
});

HTTP route:

POST /projects/:projectId/environments/:environmentId/applications/:applicationId/_register_snapshot

Response:

"snapshot registered"

The operation continues asynchronously after the acknowledgement.

Application statuses #

Known statuses:

  • Healthy
  • Progressing
  • Degraded
  • Suspended