Core
PaaS v2.x
2

Applications #

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

Any project member can read applications (list, get, observability, snapshotStatus). Every other action of this controller — including listArtifacts — requires an owner or admin role.

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 #

Applies a Docker image to an existing application: the tag is checked in the project registry (Harbor), written into the application's ArgoCD values, and ArgoCD rolls it out. A tag missing from the registry is refused before anything is applied. The image is passed in the request body. Requires an owner or admin role.

This is the low-level, per-application apply. To ship a version of a project, deploy a release instead: it builds the images of the release for the target environment, applies them to every deployable application in order, follows the rollout and records the deployment.

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 actions, typically polled by the environment view. Available to any project member.

Runtime status #

Returns the ArgoCD sync and health status of an application and its resource tree, down to its pods.

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

HTTP route:

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

Backup status #

Reports whether the Elasticsearch snapshot repository and snapshot policy are active for a Kuzzle application.

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

HTTP route:

GET /_/organizations/:organizationId/projects/:projectId/environments/:environmentId/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