Installation

Before you begin

  1. Ensure that you have Python v3.9 or greater installed.

  2. Note that any items shown within angle brackets < > contain information that you must specify based on your environment, or are specified for you based on your customer account. For example the following: (id=<your-nops-client-id>) means you must either:
    • obtain your nOps client ID number from your account and enter it. If your client ID number is 123456 enter it as follows and remove the angle brackets: (id=123456)

    • Or, if information is returned, information within angle brackets displays the customer number assigned to your organization.

Create an API key

Create a secure revocable API key to identify your API request. If at any time the key is compromised, you can follow the instructions to create a new API key and use the new one instead:

  1. Log into the nOps app.

  2. From the Settings pane > Select API key.

  3. Follow the instructions to create the key.

  4. Copy and save the key information to use later.

  5. Click Okay when you are done.

Install the nOps SDK library from PyPi

pip install nops-sdk

Configure environment variables

After you install the SDK library set the following environment variables for the session by using the export command

Example command: export NOPS_API_KEY=<the-value-of-your-API-key>

Available settings:

NOPS_API_KEY (required)

Required for making requests to the nOps API. See the information above on how to create an API key.

NOPS_ENV (optional)

Uses the default when this option is not specified.

NOPS_AWS_PROFILE (optional)

If a profile name is not specified, the default profile is used. Or, specify the name of an AWS profile configured by your organization. Since profiles are configured through AWS, you must use the AWS CLI to create one.

Run a test

>>> from nops_sdk.api import APIClient
>>> client = APIClient()
>>> client.get_accounts()
[Account(id=1, name='my test account', client=Client(id=14428))]

If it didn’t crash you are good to go. Happy Sailing!