sacreman / dlcli

Dataloop Command Line Tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

install dlcli using pip

pip install dlcli

set your org, account and api key by creating ~/dlcli.yaml

---
account: account_name
key: key_from_account_settings
org: orgname
url: https://api.dataloop.io/v1

Or you can update the file interactively.

dlcli set org acme-ltd
dlcli set account staging
dlcli set key xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

these get stored in ~/dlcli.yaml so the details only need to be changed when you are switching orgs or accounts

now verify you have a successful connection

dlcli status

then get a list of all of your agents

dlcli get agents

fun! this is a work in progress so if you want to collaborate please raise PR's

dlcli commands can be thought of as a series of nested commands, with each stage having its own options and flags.

dlcli [FLAGS] COMMAND [FLAGS] SUBCOMMAND [FLAGS]

The square braces indicate optional elements. Some commands have flags, some do not. Some of those flags are optional, some are mandatory per the command. See the list of commands and flags for more information.

The first thing to know is that help is never far away. You can use the --help flag at any stage to discover which flags are available:

dlcli --help
dlcli COMMAND --help
dlcli COMMAND SUBCOMMAND --help

Understand that using the --help flag in between two nested commands will result in the previous level --help output being shown.

dlcli --help COMMAND will have the same output as dlcli --help, and likewise, dlcli COMMAND --help SUBCOMMAND will have the same output as dlcli COMMAND --help.

The top-level help output looks like this:

Note that all available flags and commands for this level are shown. This pattern is repeated at each successive level of --help

You can use the API code outside of the command line utility.

from dlcli import api

settings = {
    'url': 'https://app.dataloop.io/api/v1',
    'org': 'org_name',
    'account': 'account_name',
    'key': 'api_key',
}

print api.agents.get_agents(**settings)

Where org_name, account_name and api_key need to be updated with your personal settings.

About

Dataloop Command Line Tool

License:Apache License 2.0


Languages

Language:Python 100.0%