A package to interact with StackPath
Project description
PyStackpath
Python library interact with StackPath API (https://developer.stackpath.com/en/)
It uses a custom OAuth2 requests.session
Examples
Set up a new Stackpath instance
from pystackpack import Stackpath
sp = Stackpath(
os.getenv("STACKPATH_CLIENTID"),
os.getenv("STACKPATH_APISECRET")
)
Search for stacks
stacks = sp.stacks().index(filter="name='my-awesome-stack' and status='ACTIVE'")
print(stacks)
Get one stack
stackid = "afcdaf14-47cb-40dd-9c13-3b20e6caf74a
onestack = sd.stacks().get(stackid)
Create a new stack
accountid = "081af5ee-38f8-44e9-b08a-881ea5de66f9"
newstack = sp.stacks().create(accountid, "my-second-stack")
Create a cdn site
stackid = "afcdaf14-47cb-40dd-9c13-3b20e6caf74a
cdnsite = sd.stacks().get(stackid).cdnsites().create("cdn.johndoe.com", "www.johndoe.com")
Search for cdn sites
cdnsite = sd.stacks().get(stackid).cdnsites().index(
filter="label='www.johndoe.com' and status='ACTIVE'"
)
Delete a cdn site
cdnsiteid = "19e1a7b2-068f-491c-a95f-b64eae66dd34"
cdnsite = sd.stacks().get(stackid).cdnsites().get(cdnsiteid).delete()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pystackpath-0.0.1.tar.gz
(3.6 kB
view hashes)
Built Distribution
Close
Hashes for pystackpath-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6ae13cf07ea9ba8661d5d32dc9cc3fc482f395efedb3852007a9f2ae3ffcdd8 |
|
MD5 | ce96d059296fab737d77607a5a51adfa |
|
BLAKE2b-256 | ff5a4008bbed7120292538ac340ee1bdaa56a92e121e5038913b2f9e51554fe2 |