Core
PaaS v2.x
2

Applications #

An application is a deployable component inside an environment. Applications are deployed through ArgoCD.

Controller: org-application

Base HTTP route:

/organizations/:organizationId/projects/:projectId/environments/:environmentId/applications

Supported application types #

  • kuzzle
  • kuzzleES8
  • webapp
  • custom

Create an application #

The application definition is passed in the request body. The platform completes missing deployment values from the application templates stored by the backend. See Data models for the full shape.

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

HTTP route:

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

List applications #

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

HTTP route:

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

Get an application #

Returns the application with its ArgoCD health status refreshed.

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

HTTP route:

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

Update an application #

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

HTTP route:

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

Deploy an image #

Deploys a new Docker image version for an existing application. The image is passed in the request body.

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

HTTP route:

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

List deployable versions #

Lists the deployable image versions (Harbor artifacts) of an application — the source of the deploy version picker.

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

HTTP route:

GET /organizations/:organizationId/projects/:projectId/environments/:environmentId/applications/:applicationId/_artifacts

Disable an application #

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

HTTP route:

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

Enable an application #

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

HTTP route:

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

Delete an application #

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

HTTP route:

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

Observability #

Read-only endpoints, typically polled by the environment view:

  • observability — the ArgoCD sync/health of an application and its resource tree down to pods (GET .../applications/:applicationId/_observability).
  • snapshotStatus — whether the Elasticsearch snapshot repository and SLM policy are active for a Kuzzle application (GET .../applications/:applicationId/_snapshot_status).

Elasticsearch snapshots #

Registers an Elasticsearch snapshot repository for a Kuzzle application (mostly useful for Kuzzle applications backed by Elasticsearch).

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

HTTP route:

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

Application statuses #

Known statuses:

  • Healthy
  • Progressing
  • Degraded
  • Suspended