-
Notifications
You must be signed in to change notification settings - Fork 31
beta.orb.live Quickstart with orb agent Autoprovision
Shannon Weyrick edited this page Sep 13, 2021
·
23 revisions
- If not registered, register a new account with email address and password at https://beta.orb.live/auth/register
- Create a
SESSION_TOKEN
with theEMAIL_ADDRESS
andPASSWORD
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>"
}'
- The output from creating a session token looks like this:
{
"token": "SESSION_TOKEN"
}
- 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
}'
- The output from creating a
PERMANENT_TOKEN
looks like the following. Please take note of theid
(used later to revoke) and thevalue
(the permanent API token)
{
"id": "710c6a92-b463-42ec-bf24-8ae24eb13081",
"value": "PERMANENT_TOKEN",
"issued_at": "2021-09-07T15:29:49.70146088Z"
}
-
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>'
- 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
- You can now pull and run
ns1labs/orb-agent
to auto provision, substituting in thePERMANENT_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