Core
PaaS v2.x
2

Project configuration #

Project configuration items are stored in the configuration collection of the project tenant.

Controller: project/config

Base HTTP route:

/projects/:projectId/config

Create a configuration item #

const document = await kuzzle.query({
  controller: 'project/config',
  action: 'create',
  projectId: 'paas-project-my-project',
  name: 'slack',
  body: {
    webhookUrl: 'https://hooks.slack.com/services/...'
  }
});

HTTP route:

POST /projects/:projectId/config/:name

List configuration items #

Returns configuration document identifiers.

const names = await kuzzle.query({
  controller: 'project/config',
  action: 'list',
  projectId: 'paas-project-my-project'
});

HTTP route:

GET /projects/:projectId/config

Get a configuration item #

const document = await kuzzle.query({
  controller: 'project/config',
  action: 'get',
  projectId: 'paas-project-my-project',
  name: 'slack'
});

HTTP route:

GET /projects/:projectId/config/:name

Check if a configuration item exists #

const exists = await kuzzle.query({
  controller: 'project/config',
  action: 'exists',
  projectId: 'paas-project-my-project',
  name: 'slack'
});

HTTP route:

GET /projects/:projectId/config/:name/_exists

Update a configuration item #

const document = await kuzzle.query({
  controller: 'project/config',
  action: 'update',
  projectId: 'paas-project-my-project',
  name: 'slack',
  body: {
    webhookUrl: 'https://hooks.slack.com/services/new-value'
  }
});

HTTP route:

PUT /projects/:projectId/config/:name

Delete a configuration item #

await kuzzle.query({
  controller: 'project/config',
  action: 'delete',
  projectId: 'paas-project-my-project',
  name: 'slack'
});

HTTP route:

DELETE /projects/:projectId/config/:name

Create a Scaleway SMTP API key #

Creates a Scaleway SMTP API key for the project.

const apiKey = await kuzzle.query({
  controller: 'project/config',
  action: 'createScalewaySmtpApiKey',
  projectId: 'paas-project-my-project'
});

HTTP route:

POST /projects/:projectId/config/scaleway/smtp-api-key

The response is the JSON object returned by Scaleway through the backend integration.