Guzzle Rightscale API client for PHP
rs_guzzle_client is a PHP Guzzle REST API client library for the RightScale API.
Support is available for v1.0 of the API and v1.5 support is coming soon!
Add rs_guzzle_client to the src/Guzzle/Rs directory of your Guzzle
installation:
cd /path/to/guzzle
git submodule add git://github.com/rgeyer/rs_guzzle_client.git ./src/Guzzle/Rs
You can now build a phar file containing guzzle-aws and the main guzzle framework:
cd /path/to/guzzle/build
phing phar
Now you just need to include guzzle.phar in your script. The phar file
will take care of autoloading Guzzle classes:
<?php
require_once 'guzzle.phar ' ;
The example script for getting your servers:
<?php
require_once 'guzzle.phar ' ;
$ serviceBuilder = \Guzzle \Service \ServiceBuilder::factory (array (
'guzzle-rs-1_0 ' => array (
'class ' => 'Guzzle\Rs\RightScaleClient ' ,
'params ' => array (
'acct_num ' => '00000 ' , / / your rightscale account id
'email ' => '[email protected] ' ,
'password ' => 'yourPassword ' ,
'version ' => '1.0 ' ,
'curl.CURLOPT_SSL_VERIFYHOST ' => false ,
'curl.CURLOPT_SSL_VERIFYPEER ' => false ,
)
),
));
$ client = $ serviceBuilder ->get ('guzzle-rs-1_0 ' );
$ params = array ();
$ command = $ client ->getCommand ('servers ' , $ params );
Below you will find the current controllers (and their commands) that are supported by the library. A quick legend for the completeness percentage.
100% - Implemented Commands, Full tests, Mock responses in the library
50% - Implemented Commands, Not tested or minimally tested, Mocks may or may not exist
0% - Not implemented
Alert Spec Subjects
Command
v1.0
v1.5
create
100%
0%
Model
0%
0%
Alert Spec
Command
v1.0
v1.5
show
100%
0%
index
100%
0%
create
100%
0%
update
100%
0%
destroy
50%
0%
Model
0%
0%
Audit Entries
Command
v1.0
v1.5
show
100%
0%
Model
0%
0%
Component EC2 EBS Volumes
Command
v1.0
v1.5
create
100%
0%
destroy
100%
0%
Model
0%
0%
Servers
Command
v1.0
v1.5
show
100%
0%
index
100%
0%
create
100%
0%
update
100%
0%
destroy
100%
0%
start
100%
0%
start_ebs
100%
0%
stop
100%
0%
stop_ebs
100%
0%
reboot
100%
0%
run_script
50%
0%
run_executable
50%
0%
attach_volume
50%
0%
settings
100%
0%
get_sketchy_data
100%
0%
current/show
100%
0%
current/update
100%
0%
current/settings
100%
0%
alert_specs
100%
0%
monitoring
100%
0%
monitoring/graph-name
100%
0%
Model
100%
0%
Credentials
Command
v1.0
v1.5
show
100%
0%
index
100%
0%
create
100%
0%
update
100%
0%
destroy
100%
0%
Model
0%
0%
Deployments
Command
v1.0
v1.5
show
100%
0%
index
100%
0%
create
100%
0%
update
100%
0%
destroy
100%
0%
duplicate
100%
0%
start_all
100%
0%
stop_all
100%
0%
Model
100%
0%
EC2 EBS Snapshots
Command
v1.0
v1.5
show
100%
0%
index
100%
0%
create
100%
0%
update
100%
0%
destroy
100%
0%
Model
0%
0%
EC2 EBS Volumes
Command
v1.0
v1.5
show
100%
0%
index
100%
0%
create
100%
0%
update
100%
0%
destroy
100%
0%
Model
0%
0%
EC2 Elastic IPs
Command
v1.0
v1.5
show
100%
0%
index
100%
0%
create
100%
0%
destroy
100%
0%
Model
0%
0%
EC2 Security Groups
Command
v1.0
v1.5
show
100%
0%
index
100%
0%
create
100%
0%
update
100%
0%
destroy
100%
0%
Model
0%
0%
Server Arrays
Command
v1.0
v1.5
show
100%
0%
index
100%
0%
create
100%
0%
update
100%
0%
destroy
100%
0%
terminate_all
100%
0%
launch
100%
0%
run_script_on_all
50%
0%
instances
100%
0%
Model
50%
0%
EC2 SSH Keys
Command
v1.0
v1.5
show
100%
0%
create
100%
0%
destroy
100%
0%
Model
100%
0%
Macros
Command
v1.0
v1.5
show
100%
0%
index
100%
0%
create
100%
0%
update
100%
0%
destroy
100%
0%
Model
0%
0%
Multi Cloud Images
Command
v1.0
v1.5
show
100%
0%
index
100%
0%
Model
100%
0%
Right Scripts
Command
v1.0
v1.5
show
100%
0%
index
100%
0%
Model
0%
0%
S3 Bucket
Command
v1.0
v1.5
create
100%
0%
destroy
100%
0%
Model
0%
0%
Server Template
Command
v1.0
v1.5
show
100%
0%
index
100%
0%
create
100%
0%
update
100%
0%
destroy
100%
0%
executables
100%
0%
alert_specs
100%
0%
Model
0%
0%
SQS Queues
Command
v1.0
v1.5
show
50%
0%
index
50%
0%
create
50%
0%
destroy
50%
0%
Model
0%
0%
Statuses
Command
v1.0
v1.5
show
50%
0%
Model
0%
0%
Tags
Command
v1.0
v1.5
search
100%
0%
set
100%
0%
unset
100%
0%
taggable_resources
100%
0%
Model
0%
0%
VPC DHCP Option
Command
v1.0
v1.5
show
50%
0%
index
50%
0%
create
50%
0%
update
50%
0%
destroy
50%
0%
Model
0%
0%
Allow the user to specify a logger.