Skip to main content

SquareCloud API wrapper

Project description

squarecloud-api

squarecloud-api is a wrapper of the API of SquareCloud made by @alma

Installing

pip install squarecloud-api

Starting

Where to get my api key?

to get your api key/token just go to the SquareCloud website and register/login, after that go to dashboard > my account > Regenerate API/CLI KEY and copy the key.

Getting information from your application

import squarecloud as square

client = square.Client(api_key='API KEY')


async def example():
    logs = await client.get_logs(app_id='id of your application')
    print(logs)

    complete_logs = await client.get_logs(app_id='id of your application')
    print(complete_logs)

    status = await client.app_status(app_id='id of your application')
    print(status.ram)
    print(status.cpu)
    print(status.requests)
    print(status.network)
    print(status.running)
    print(status.storage)

Managing your application

import squarecloud as square

# you can define if you want debug logs to be shown or not
# this value by default is True
client = square.Client(api_key='API KEY', debug=False)


async def example():
    await client.backup(app_id='id of your application')
    await client.start_app(app_id='id of your application')
    await client.stop_app(app_id='id of your application')
    await client.restart_app(app_id='id of your application')
    await client.delete_app(app_id='id of your application')
    await client.commit(app_id='id of your application', file=square.File('path/to/your/file'))

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

squarecloud-api-0.1.0.tar.gz (7.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page