Note: The NS1 CLI package is applicable only to NS1 Managed DNS users. The NS1 CLI package is not under active development and is not feature complete. We suggest using one of our other packages for production integrations.
NS1's Command Line Interface (ns1cli) is a lightweight shell application that can be installed easily from the pip package manager—enabling access to the NS1 platform.
Installation
From your command line, do a pip install for the ns1cli package:
$ pip install ns1cli
Once complete, the requisite components are loaded into your environment and the utility is ready to use.
Authentication & Use
Using your unique API key generated via the NS1 portal (http://my.nsone.net), enter the following command to store your API key in the local configuration:
$ ns1 -k [API KEY]
Once complete, the API key is storied in the local configuration as your default key. The key will remain in the system until superseded by using the same commands or with the 'config key' command.
The application is now running in your terminal window.
ns1 CLI version x.y
Type 'help' for help
Current Key: default
Endpoint: https://api.nsone.net/v1/
ns1>
Syntax
|
Create, retrieve, update, and delete records in a zone |
|
View and manipulate configuration settings |
|
Get help on a command |
|
Create, retrieve, update, and delete zone SOA data |
|
Retrieve queries per second |
Record
The following functions can be invoked with the record
call:
record info ZONE DOMAIN TYPE
record create [options] [--] ZONE DOMAIN TYPE ([--priority=<p>] ANSWER)...
record delete [-f] ZONE DOMAIN TYPE
record link ZONE SOURCE_DOMAIN DOMAIN TYPE
record set ZONE DOMAIN TYPE options
record meta set ZONE DOMAIN TYPE KEY VALUE
record meta remove ZONE DOMAIN TYPE KEY VALUE
record answer add ZONE DOMAIN TYPE [--priority=<p>] ANSWER
record answer remove ZONE DOMAIN TYPE ANSWER
record answer meta set ZONE DOMAIN TYPE ANSWER KEY VALUE
record answer meta remove ZONE DOMAIN TYPE ANSWER KEY
record answers ZONE DOMAIN TYPE [options] (ANSWER ...)
Config
The following functions can be invoked with the config
call:
config show
config key KEYID
Help
The following functions can be invoked with the help
call:
help
Zone
The following functions can be invoked with the zone
call:
zone list
zone info ZONE
zone create ZONE [-f] [options]
zone delete [-f] ZONE
zone set ZONE [-f] [options]
QPS
The following functions can be invoked with the qps
call:
qps
qps ZONE
Open Source Contribution
NS1 is constantly making improvements and enhancements, and your feedback has a direct impact on product development. Please submit feedback directory to us or submit your own pull requests. Pull requests can be made from a fork of the ns1cli repository into a branch other than master. You can access the source on NS1's GitHub.