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 Provenance Actions
python-stackato-1.4.tar.gz 4.3 kB Without provenance Details for python-stackato-1.4.tar.gz

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

Security for python-stackato 1.4

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.4 This release

1 release file No provenance

1.2

1.1

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