This is a work in progress piece of code that may or may not get extended further as/when needed.
- Get API info
- Get cloud stack info
- Update cloud stack info
- Get API job info
composer install chrometoaster/sitehost-api-client:~0.1
It is recommended to define the API key and the client ID as environment variables, e.g. through your cloud container environment variables configuration or via your virtual host configuration.
use Chrometoaster\SiteHost\API\Client as SiteHostAPIClient;
$env_api_key = getenv('SITEHOST_API_KEY');
$env_client_id = getenv('SITEHOST_CLIENT_ID');
// create a client
$client = new SiteHostAPIClient($env_api_key, $env_client_id);
// read cloud stack info
$info = $client->getStackInfo('ex-myserver', 'abc123def456ab12');
// check the response is valid and has data
if ($info->isValid()) {
// work with the information here
...
...
}
- Implement methods and handling for other API endpoints
- Add tests.
BSD-3-Clause, see the licence for details.
In general, please be nice to each other. For more details see the Code of Conduct.
This project follows the standards defined in:
Before submitting a PR, please run the script below to lint and update the code according to the standards above.
composer run full-check