Getting Started

This guide provides an example usage of the API based on user scenarios. here will demonstrate of move service pods to target nodes. Currently supports robot-postgres and cw-timeseries-db services for all options. For other services which are not system-critical and are in default namespace, the system will attempt to move the pods to the specified nodes , subject to the constraints of the system as best effort. It is recommended to put the system in maintenance mode before invoking this api. Total time taken to move is proportional to the number of services and the size of the database. The system will be in maintenance mode until the move is complete. Only query option is supported for Placement api query

Prerequisites

Before using any examples provided in this guide, it is expected that the user has set up the CNC with corresponding release version.

Authentication and Authorization

Accessing the CNC NB API requires Authentication and Authorization. CNC uses a JWT based authentication which can be obtained using two-step process. Authorization of each API is controlled by API level access control as well as Role Based Access Control (RBAC) defined and configured in CNC.

  1. Get TGT ticket
API Usage sample
'curl
--location --request POST 'https://<Crosswork Server IP>:<Crosswork port>/crosswork/sso/v1/tickets?username=&password='
--header 'Content-Type: application/x-www-form-urlencoded'
--header 'Accept: text/plain''

Sample Output

<tgt-ticket>
  1. Get Jwt token
API Usage sample
'curl
--location 'https://<Crosswork Server IP>:<Crosswork port>/crosswork/sso/v2/tickets/jwt'
--header 'Content-Type: application/x-www-form-urlencoded'
--header 'Accept: application/json'
--data-urlencode 'service=https://<Crosswork Server IP>:<Crosswork port>/app-dashboard'
--data-urlencode 'tgt=<TGT-string>''

Sample Output

<jwt-token>