Skip to content
Nick Kasprzak edited this page Sep 28, 2020 · 9 revisions

Introduction

This is a guide to using iland's Python SDK. To get started using iland's Python SDK look at the installation section here.

We have many example of the things you are able to do with the Python SDK such as:

Create Scratch vApp

Powering on/off and deleting a VM

Create and email a VAC tenants report

Requirements

The only requirements to get started using iland's Python SDK is having Python and the iland-sdk installed.

To check if you have python installed do this in your terminal

python --version

To confirm you have iland's Python SDK installed use this command:

pip list | grep iland-sdk

Imports

The very first thing we need to do even before authenticating is to import iland's Python SDK like this:

import iland

Authentication

Next before we use the SDK we need to sign in. To do this we need the following:

  • client_id
  • client_secret
  • username
  • password

The username and password is the one you use to login into iland's console. To get your client_id and client_secret contact support@iland.com

After you have both of those then you can use the following code to authenticate.

CLIENT_ID = ''
CLIENT_SECRET = ''
USERNAME = ''
PASSWORD = ''

api = iland.Api(client_id=CLIENT_ID, client_secret=CLIENT_SECRET, username=USERNAME, password=PASSWORD)

Important Links

iland API Docs

iland's Python SDK Docs

Tips

All the endpoints in iland's API are plural, so if you are trying to do something with a VM remember that the beginning of the endpoint is /vms and not /vm.

If you are doing actions on a resource such as powering on a VM, remember to wait for the task that is returned to sync.

Common Errors

ImportError: No module named 'iland'

You have not installed Python iland SDK, do so with by following the instructions here or running pip install iland-sdk