Homec4science

Add a very basic AWS API to libphutil

Authored by epriestley <git@epriestley.com> on Jan 18 2012, 23:30.

Description

Add a very basic AWS API to libphutil

Summary:
I want programmatic access to EC2 in order to make DryDock do something
nontrivial. The two major PHP EC2 implementations I could find weren't thrilling
to me:

gigantic (27,000 lines) and very heavyweight (defines its own array-like class,
for instance).

uses SOAP and thus has 1K lines of envelope-signing stuff. Defines a bunch of
classes like "images" and "groups". Assumes key information is in declare()s,
etc.

Instead, just provide simple Query API access on top of Futures.

Test Plan:
Wrote a little script like this:

#!/usr/bin/env php
<?php

$root = dirname(dirname(dirname(__FILE__)));
require_once $root.'/scripts/__init_script__.php';

$future = new PhutilAWSEC2Future();
$future->setAWSKeys(
  'YOUR-ACCESS-KEY',
  'YOUR-PRIVATE-KEY');

$future->setRawAWSQuery(
  'DescribeInstances',
  array(
  ));

var_dump($future->resolve());

...and issued some queries, including allocating an instance.

Reviewers: btrahan, jungejason

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D1452

Details

Committed
epriestley <git@epriestley.com>Jan 19 2012, 02:08
Pushed
aubortMar 17 2017, 12:03
Parents
rPHUb7647fd37273: Move utf8 HTML hardwrapping to libphutil
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHU5c0cb28e6e45: Add a very basic AWS API to libphutil (authored by epriestley <git@epriestley.com>).Jan 19 2012, 02:08