Rightscale API Client for PHP
This library implements Rightscale's 1.5 API in PHP. It is currently incomplete
but the aim is to mirror the functionality of the official Rightscale ruby library, (*1)
- Ruby API client: https://github.com/rightscale/right_api_client
- API Documentation: http://support.rightscale.com/12-Guides/RightScale_API_1.5
- API Reference Docs: http://reference.rightscale.com/api1.5/index.html
This is an unofficial library and is not supported by Rightscale., (*2)
Installation
Installation through Composer is recommended., (*3)
composer.json:, (*4)
{
"require": {
"raventools/RightscaleAPIClient": "master"
}
}
Then require Composer's autoloader, (*5)
require 'vendor/autoload.php';
Examples
This client should function in much the same way as the official ruby api client,
for design philosophy, etc, see https://github.com/rightscale/right_api_client, (*6)
Creating a new client:, (*7)
$client = new RightscaleClient([
"account_id" => 1234,
"email" => "example@email.com",
"password" => "54321"
]);
Listing api methods available to a particular resource:, (*8)
$methods = $client->api_methods();
$methods = $client->servers(["id"=>995905004])->api_methods();
List Deployments:, (*9)
$resources = $client->deployments()->index();
Get list of instances with the tag "deploy:myapp=true", (*10)
$resourcedetail = $client
->tags()
->by_tag([
"resource_type"=>"instances",
"tags"=>["deploy:myapp=true]"
]);