Preview Environment
Let's take some action - but only a little
A little more serious now
Now let's make Tuono do something, but only a little to make sure you're comfortable. Maybe a non-destructive action, like "Preview" in the GUI.
Since this is an action, it requires us to create a "Job" object.
job
POST
https://portal.tuono.io/api/v1/job
Preview an environment apply to your cloud provider.
Headers
Name
Type
Description
Authorization
string
Bearer {YOUR_TOKEN}
Content-Type
string
application/json
Request Body
Name
Type
Description
environment_id
string
Id of the environment to preview
action
string
simulate
{'object': {'_id': '5f7617f87ff7f3e5da7a8d52',
'_inserted': '2020-10-01 17:55:04',
'_updated': '2020-10-01 17:55:04',
'action': 'simulate',
'blueprint_ids': [],
'cred_type': 'static',
'credential_set': 'mh-static-aws',
'credential_set_id': '5f7612549e2aa1e6a254c4ae',
'environment_id': '5f76120d92160c05fa55ac04',
'executed_by': '5f7611299e2aa1e6a254c4a8',
'execution_feedback': [],
'failure_insights': [],
'organization_id': '5f76112956599f23a120fdcc',
'previous_working_set': {},
'simulation_feedback': [],
'status': 'starting',
'sts_credentials': None,
'support': [],
'venue': 'aws',
'working_set': {}
}
}
Example code
import json
import requests
token = "Your JWT token"
env_id = "Environment ID"
headers = {"Authorization": f"Bearer {token}", "Content-Type": "application/json"}
url = "https://portal.tuono.io/api/v1/job"
data = dict(action="simulate", environment_id=env_id)
response = requests.post(url, data=json.dumps(data), headers=headers)
job = response.json()["object"]
Last updated
Was this helpful?