Apply Environment

Getting down to business

Making it real

So your preview kicked off and the job status was "succeeded". Awesome! Now let's build some infrastructure!

This call will apply the Blueprints in your Environment to your cloud provider. For real. Once the execution is complete you will be the proud owner of some shiny new infrastructure in your cloud provider of choice.

job

POST https://portal.tuono.io/api/v1/job

Apply an environment 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 apply

action

string

apply

{'object': {'_id': '5f774827b744e94f770044b1',
            '_inserted': '2020-10-02 15:32:55',
            '_updated': '2020-10-02 15:32:55',
            'action': 'apply',
            '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 = f"{api_base}/job"
data = dict(action="apply", environment_id=env_id)
response = requests.post(url, data=json.dumps(data), headers=headers)
job = response.json()["object"]

Last updated

Was this helpful?