Skip to content

beta.orb.live Quickstart with orb agent Autoprovision

Shannon Weyrick edited this page Sep 13, 2021 · 23 revisions
  1. If not registered, register a new account with email address and password at https://beta.orb.live/auth/register
  2. Create a SESSION_TOKEN with the EMAIL_ADDRESS and PASSWORD from registration:
curl --location --request POST 'https://beta.orb.live/api/v1/tokens' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "<EMAIL_ADDRESS>",
"password": "<PASSWORD>"
}'
  1. The output from creating a session token looks like this:
{
    "token": "SESSION_TOKEN"
}
  1. Because session tokens expire after 24 hours, you can create a permanent API token for agent provisioning by using the SESSION_TOKEN above:
curl --location --request POST 'https://beta.orb.live/api/v1/keys' \
--header 'Authorization: <SESSION_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"type": 2
}'
  1. The output from creating a PERMANENT_TOKEN looks like the following. Please take note of the id (used later to revoke) and the value (the permanent API token)
{
    "id": "710c6a92-b463-42ec-bf24-8ae24eb13081",
    "value": "PERMANENT_TOKEN",
    "issued_at": "2021-09-07T15:29:49.70146088Z"
}
  1. Currently the permanent token allows access to all API functionality, not just provisioning! You can revoke this permanent token at any time with the following call, using the id field above:
curl --location --request DELETE 'beta.orb.live:80/api/v1/keys/<PERMANENT_TOKEN_ID>' \
--header 'Authorization: <SESSION_TOKEN>'
  1. Create config for orb and pktvisor taps, for example /local/orb/agent.yaml
version: "1.0"

visor:
  taps:
    ethernet:
      input_type: pcap
      config:
        iface: "eth0"

orb:
  db:
    file: /usr/local/orb/orb-agent.db
  tags:
    region: EU
    pop: ams02
    node_type: dns
  cloud:
    config:
      agent_name: myagent1
    api:
      address: https://beta.orb.live
    mqtt:
      address: tls://beta.orb.live:8883
  1. You can now pull and run ns1labs/orb-agent to auto provision, substituting in the PERMANENT_TOKEN and optionally configuring agent name and orb tags. If you don't set the agent name, it will attempt to use host name. You must mount the directory to save agent state database, and the config file:
docker pull ns1labs/orb-agent:develop
docker run -v /local/orb:/usr/local/orb/ --rm --net=host \
-e ORB_CLOUD_API_TOKEN=<PERMANENT_TOKEN> \
ns1labs/orb-agent:develop -d -c /usr/local/orb/agent.yaml