$ pip install scalr-api
Here an example on how to work with Scalr roles:
from scalr import ScalrUserAPI
scalr = ScalrUserAPI(
url='https://your-scalr-host/',
key_id='your_scalr_key_id',
secret_key='your_scalr_secret_key',
env_id=4
)
role_data = {
"builtinAutomation": [
"base"
],
"category": {
"id": 1
},
"name": "string",
"os": {
"id": "string"
},
"useScalrAgent": true
}
scalr.role_create(role=role_data)
scalr.role_delete(role_id=12)
updated_role_data = {
"category": {
"id": 1
},
"description": "string",
"name": "string",
"quickStart": true,
"quickStartGroup": "string",
"tags": [
"string"
]
}
scalr.role_edit(role_id=26, role=updated_role_data)
role = scalr.role_get(role_id=9)
roles = scalr.role_list()
scalr.role_clone(role_id=45, name="Cloned Role")
- Scalr for providing examples on how to use Scalr API v2.