A library to Deploybot API.
To see how to use, look Cli.
pip install deploybot-sdk
Client is the main library, this is responsible to make and receive requests from API.
The first step, is instantiate to your application using your account name and API token.
from deploybot.client import Client
import os
account = os.environ.get('DEPLOYBOT_ACCOUNT')
token = os.environ.get('DEPLOYBOT_TOKEN')
client = Client(account, token)
Get one or list repositories.
from deploybot.repository import Repository
# client is defined before
client = object
repository = Repository(client)
# list all repositories
print(repository.list())
# get specific repository to details
print(repository.get(99999))
Get one or list your environments
from deploybot.environment import Environment
# client is defined before
client = object
environment = Environment(client)
# list all environments
repository = 1
print(environment.list(repository))
# get specific environment to details
environment = 1
print(environment.get(environment))
Get one or list your servers
from deploybot.server import Server
# client is defined before
client = object
server = Server(client)
# list all servers
print(server.list())
# get specific server to details
print(server.get(123456))
Get one or list users from account
from deploybot.user import User
# client is defined before
client = object
user = User(client)
# list all users
print(user.list())
# get specific user to details
print(user.get(123456))
List, view and trigger a deploy.
from deploybot.deploy import Deploy
# client is defined before
client = object
deploy = Deploy(client)
# list all deploys
repository = 1
environment = 2
print(deploy.list(repository, environment))
# get specific deploy to details
deploy_id = 123456
print(deploy.get(deploy_id))
# trigger a deploy
environment = 2
print(deploy.trigger(environment))
python setup.py test