Skip to content

Instantly share code, notes, and snippets.

@shivamMg
Created May 14, 2020 16:25
Show Gist options
  • Save shivamMg/165e9d88fdba2ca68a28b7c51919a4df to your computer and use it in GitHub Desktop.
Save shivamMg/165e9d88fdba2ca68a28b7c51919a4df to your computer and use it in GitHub Desktop.
#!/usr/bin/env python2
# Need to install rapyuta_io Python SDK to use this script:
# pip install https://storage.googleapis.com/rio-sdk-python/rapyuta_io-0.13.0-py2-none-any.whl
from rapyuta_io import Client, DeploymentPhaseConstants
# Read how to get auth-token and project-guid here:
# https://userdocs.rapyuta.io/developer-guide/tooling-automation/python-sdk/sdk-tokens-parameters/
AUTH_TOKEN = ''
PROJECT = ''
if __name__ == '__main__':
client = Client(auth_token=AUTH_TOKEN, project=PROJECT)
deployments = client.get_all_deployments(phases=[DeploymentPhaseConstants.SUCCEEDED,
DeploymentPhaseConstants.PROVISIONING,
DeploymentPhaseConstants.INPROGRESS,
DeploymentPhaseConstants.FAILED_TO_START])
for dep in deployments:
url = 'https://console.rapyuta.io/deployments/{}/details?p={}'.format(dep.deploymentId,
PROJECT)
print '{}\t{}\t{}'.format(dep.name, url, dep.phase)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment