Skip to main content
Python-Stackato
===============

[![PyPi version](https://pypip.in/v/python-stackato/badge.png)](https://crate.io/packages/python-stackato/)
[![PyPi downloads](https://pypip.in/d/python-stackato/badge.png)](https://crate.io/packages/python-stackato/)

A wrapper to the Stackato Client API. Allows users to make requests to the Stackato API. Easy Peasy Lemon Squeezy.

To read up more on the Stackato Client API, please see the documentation [here](http://docs.stackato.com/api/client.html).

## Installation

pip install python-stackato

alternatively...

git clone https://github.com/bacongobbler/python-stackato
python setup.py install

## Usage

Take a look at the examples/ folder for some real-life examples.

### Logging into the client

```python
from stackato import Session

s = Session("https://api.stackato-xxxx.local/")
s.login("username", "password")
```

### Passwordless Authentication

This is for when you have previously logged in and the token is stored
within your client token file (hidden at ~/.stackato/client/token)

```python
from stackato import Session
s = Session("https://api.stacka.to/")
if s.login():
print(s._get('info'))
```

### Storing the authentication token locally, and deleting an app

```python
from stackato import Session

# Spot the difference!
s = Session("https://api.stackato-xxxx.local/")

if s.login(store_token=True):
s.delete_app('demo')
```

### Lisng all services bound to an app

```python
from stackato import Session

s = Session("https://api.stackato-xxxx.local/")

if s.login():
print(s.get_app('demo').services)
```

### Forcing your app to increase its number of instances by one

```python
from stackato import Session

s = Session("https://api.stackato-xxxx.local/")

if s.login():
app = s.get_app('demo')
app['instances'] += 1

# make a PUT request to the application
if s.put_app('demo', app):
print('added one more instance to this application.')
```

### Making a custom GET request

This will also work with _post(), _put(), and _delete(). You can also take a look at _request() if you want to make your own custom request call.

```python
from stackato import Session

s = Session("https://api.stackato-xxxx.local/")

if s.login():
print(s._get('stackato/usage?all=1'))
```

Metadata

Release files for python-stackato 1.4

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

Source distribution (sdist)

Source distribution for python-stackato 1.4
File Size Uploaded
python-stackato-1.4.tar.gz 4.3 kB Details

Release files / python-stackato-1.4.tar.gz

Download URL python-stackato-1.4.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9832b4f1bcea75061d6f0f2f96a7ebe18fa38287b5352d3b6871d994cf58aca2
BLAKE2b-256 checksum
How to use checksums
f02bad9625d665830cc199a52cfa6dc1476ae830ed4e32004eb5ea582e806745
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.4 This release

1 release file

1.3

1 release file

1.2

1.1

1.0

1 release file

0.1

1 release file

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