Initial Configuration
Learn how to quickly configure Spyctl to interact with your Spyderbat data
Prerequisites
Initial Configuration
In this section you will learn how to configure Spyctl to enable data retrieval from across your entire organization. To do so, you must first create an APISecret and then use that APISecret to set a Context. An APISecret encapsulates your Spyderbat API credentials; the Context specifies where Spyctl should look for data when interacting with the Spyderbat API (e.g., organization, cluster, machine, service, or container image).
Create an APISecret
An APISecret encapsulates your Spyderbat API credentials. You must create at least one APISecret in order for Spyctl to access your data via theSpyderbat API.
To create an APISecret, use an API key generated from the Spyderbat Console.
United States
https://api.spyderbat.com
Mumbai, India
https://api.mum.prod.spyderbat.com
Frankfurt, Germany
https://api.deu.prod.spyderbat.com
Copy a generated API key and region-specific API URL into the following command:
spyctl config set-apisecret -k <apikey> -u <apiurl> NAME
For example:
$ spyctl config set-apisecret -k ZXlKaGJHY2lPaUpJVXpJMU5pSXNJbXRwWkNJNkluTm\
lJaXdpZEhsd0lqb2lTbGRVSW4wLmV5SmxlSEFpT2pFM01EUTVPVGM1TWpBc0ltbGhkQ0k2TVRZM\
016UTJNVGt4T1N3aWFYTnpJam9pYTJGdVoyRnliMjlpWVhRdWJtVjBJaXdpYzNWaUlqb2ljSGhX\
YjBwMlVFeElXakJIY1VJd2RXMTNTMEVpZlEuZGpxWkRCOTNuUnB4RUF0UU4yQ0ZrOU5zblQ5Z2Q\
tN0tYT081TEZBZC1GSQ== -u "https://api.spyderbat.com" my_secret
Set new apisecret 'my_secret' in '/home/demouser/.spyctl/.secrets/secrets'
Set a Context
Contexts will let Spyctl know where to look for data. The broadest possible Context is organization-wide. This means that when you run Spyctl commands, the Spyderbat API will return results relevant to your entire organization.
spyctl config set-context --org <ORG NAME or UID> --secret <SECRET NAME> NAME
For example:
$ spyctl config set-context --org "John's Org" --secret my_secret my_context
Set new context 'my_context' in configuration file '/home/demouser/.spyctl/config'.
You can view your configuration by issuing the following command:
spyctl config view
You should see something like this:
apiVersion: spyderbat/v1
kind: Config
contexts:
- name: my_context
secret: my_secret
context:
organization: John's Org
current-context: my_context
At this point you should now be able to run spyctl commands that utilize the Spyderbat API.
Last updated
Was this helpful?