layout | title | categories | author | lang |
---|---|---|---|---|
post |
How to create a MySQL Managed Stack using the API |
ManagedStacks |
popawu |
en |
In this guide you will learn how to create your Managed Stacks MySQL cluster using the API.
- applicationKey, consumerKey and signature generated for OVH API access. You will also need to manage timestamps. You can find details on the first step with the OVH API page.
For the sake of command lines' brevity you can define this helpful aliases to interact with Managed Stacks API.
user@desk:~$ MANAGEDSTACKS_LAB=https://api.runabove.com/1.0
user@desk:~$ alias auth_curl='curl --include -H "X-Ovh-Application:$applicationKey" -H "X-Ovh-Timestamp:$time" -H "X-Ovh-Signature:$signature" -H "X-Ovh-Consumer:$consumerKey" -H "Content-Type: application/json"'
- CALL
user@desk:~$ auth_curl -X POST ${MANAGEDSTACKS_LAB}/stackMysql
- RETURN
{
"msg": "cluster created"
}
- CALL
user@desk:~$ auth_curl -X GET ${MANAGEDSTACKS_LAB}/stackMysql
- RETURN
{
"products": [
{
"id": <clusterId>
}
]
}
- CALL
user@desk:~$ auth_curl -X GET ${MANAGEDSTACKS_LAB}/stackMysql/<clusterId>
- RETURN
{
"active": <true|false>,
"nodes": [
{
"addr": "<ipAddressNode1>",
"product_id": <productId>
},
{
"addr": "<ipAddressNode2>",
"product_id": <productId>
}
],
"product_id": <productId>
}
- CALL
user@desk:~$ auth_curl -X GET ${MANAGEDSTACKS_LAB}/stackMysql/<clusterId>/status
- RETURN Json object, list of probes for each node. The object key is the probe name, object value is the result.
- CALL
user@desk:~$ auth_curl -X DELETE ${MANAGEDSTACKS_LAB}/stackMysql/<clusterId>
- RETURN
{
"msg": "cluster deleted"
}
You may have a look at: