2.5.3 • Published 3 years ago

agent-api v2.5.3

Weekly downloads
1
License
ISC
Repository
-
Last release
3 years ago

run RabitMQ into docker:

sudo docker run -d --hostname my-rabbit --name some-rabbit -p 5672:5672 -p 80:15672 -p 15674:15674 -e RABBITMQ_DEFAULT_USER=bigbugbunny -e RABBITMQ_DEFAULT_PASS=543 -e RABBITMQ_VM_MEMORY_HIGH_WATERMARK=56% rabbitmq:3-management

Compiling *.fbs file to TS code

To compile schema file in TypeScript flatc executable should be build or downloaded.

Installing flatc in Windows environment

  1. Go to releases page and download flatc_windows.zip
  2. Extract exe to any folder
  3. Copy .fbs file to folder where flatc.exe lies.
  4. Run following command

    flatc telemetry.fbs --ts

Installing flatc in OSx environment

To install flatc open terminal and run following command

brew install flatbuffers

To comile scheme in TS code run this:

flatc path/to/file/telemetry.fbs --ts

Updating fbs scheme file

Copy contents of new schema file to agent-api/agent-telemetry.fbs Run npm script to update TS code:

npm run gen-fb

API versioning

To call specific version of API endpoint client should send request with HTTP header that specifies the requested version of the API to use:

curl --header "X-Api-Version: 1.0.0" htts://localhost:3010/agent/jobstatus

Server accepts versions in semver notation.

The server responds with the following headers:

  • X-Requested-Version
  • X-Matched-Version