Skip to main content

Skytap REST API wrapper

https://img.shields.io/pypi/v/skytap.svg Documentation Travis build status Code Health Code coverage

Skytap is a set of modules that we use to manage aspects of our Skytap infrastructure.

Usage

To use the module, you’ll need to create at least two environment variables:

SKYTAP_USER=kermit.frog@sesamestreet.net
SKYTAP_TOKEN=79824879aeb2b34534e112d23a3c

Optionally, you can also add:

SKYTAP_LOG_LEVEL=20

This can be a number between 0-50 and corresponds to the logging module from Python:

  • DEBUG: 0

  • INFO: 10

  • WARNING: 20

  • ERROR: 30

  • CRITICAL: 50

An easy way to set these variables is to create a .skytap file in your home directory (~/.skytap) with the variables in there:

export SKYTAP_USER=kermit.frog@sesamestreet.net
export SKYTAP_TOKEN=79824879aeb2b34534e112d23a3c

Then you can source the file:

source ~/.skytap

to load the variables, or add that same source command to your ~/.bash_profile or equivalent file to have it done automatically.

Via the command line

Most modules can be accessed directly from the command line to get simple information. This functionally returns the JSON from the Skytap API:

python -m skytap.Environments
python -m skytap.Users

You’ll get back a JSON for the request, something like:

[
  {
    "id": "12345",
    "url": "https://cloud.skytap.com/users/12345",
    "login_name": "kermit.frog@sesamestreet.net",
    "first_name": "Kermit",
    "last_name": "The Frog",
    "title": "Master of Ceremonies",
    "email": "kermit.frog@sesamestreet.net",
    "created_at": "2012-01-02T12:43:05-08:00",
    "deleted": false
  }
]

If you only want a one item returned instead of the full list, you can get that from the command line as well:

python -m skytap.Environments 12345
python -m skytap.Quotas svm_hours

Via Python script

To use this, simply import it:

import skytap

Then you can access the resource groups of interest.

A simple example:

import skytap
users = skytap.Users()
for u in users:
    print(u.name + ' : ' + u.email)

This can also help automate running and suspending VMs:

import skytap
envs = skytap.Environments()

envs[123456].suspend()  # or .suspend(True) if you want the script to wait.

Doing this will, by default, add a note to the environment of it’s action, so someone checking the environment can see why it’s not running.

Installation

Install this through pip:

pip install skytap

Contributor list

Contact us directly for questions.

Metadata

Release files for skytap 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for skytap 1.4.0
File Size Uploaded Provenance
skytap-1.4.0.tar.gz 49.2 kB Without provenance Details

Release files / skytap-1.4.0.tar.gz

Download URL skytap-1.4.0.tar.gz
Size 49.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f07ee4ae79b8f392dab1915f630b16f0baced1face3b53f4145565f3fde91a2a
BLAKE2b-256 checksum
How to use checksums
6ac8254966c4c99709e8ae1d69dbd6dbde5e1daf0a0053ed5bb2af3c38718ecc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for skytap 1.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page