From c92478200fa77ac8d651c97623ab15e2510680be Mon Sep 17 00:00:00 2001 From: Rupak Ganguly Date: Mon, 16 Apr 2012 17:17:52 -0400 Subject: [PATCH] Add uuid and links atrributes to the list servers mock. --- README_HP.rdoc => lib/fog/hp/README_HP.rdoc | 47 ++++++++------------- lib/fog/hp/requests/compute/list_servers.rb | 2 +- 2 files changed, 18 insertions(+), 31 deletions(-) rename README_HP.rdoc => lib/fog/hp/README_HP.rdoc (52%) diff --git a/README_HP.rdoc b/lib/fog/hp/README_HP.rdoc similarity index 52% rename from README_HP.rdoc rename to lib/fog/hp/README_HP.rdoc index d033fec05..b3d898072 100644 --- a/README_HP.rdoc +++ b/lib/fog/hp/README_HP.rdoc @@ -1,52 +1,41 @@ = HP Cloud Extensions to Ruby Fog Library -HP provides a native Ruby library through an HP Cloud developed extension to the Ruby Fog provider. By using -the HP Cloud Ruby library, developers can write applications using Ruby that interacts with the -HP Cloud Services without having to deal with the underlying REST API or XML document formats. +HP contributed to the native Ruby library Fog, through an HP Cloud developed extension to Fog via +the Object Storage, Compute and CDN providers. By using the HP Cloud Extensions to Fog, developers +can write applications using Ruby that interacts with the HP Cloud Services without having to deal +with the underlying REST API or JSON/XML document formats. == Background This library is an extension of Fog[https://github.com/fog/fog], a Ruby open-source cloud -computing library. +computing library. The code in this library, contains all HP-specific support and is being +contributed back to the primary open-source library. -Because the details of the HP Cloud Services are not formally announced, we are maintaining a -running branch of the Fog library that contains all HP-specific support. When our formal -product announcement comes and the services become publicly available, we intend to return our -contributions to the primary open-source library. - -The HP Cloud Ruby library currently supports HP Cloud Object Storage and HP Cloud Compute, and +The HP Cloud Ruby library currently supports HP Cloud Object Storage, Compute, CDN, and support for other services will be added as available. == Installation -1) Start by installing the software the HP Cloud Services Ruby Fog library depends on: - -* {Ruby 1.9.2 or Ruby 1.8.7}[http://www.ruby-lang.org/en/] -* {RubyGems 1.3.7 or later}[http://docs.rubygems.org/read/chapter/3] - -2) {Download the HP Cloud Services Ruby Fog gem}[/downloads/hpfog.tar] and unpack it to a local directory. - -3) cd into the directory you downloaded the gem into during Step 2) and type: - - gem install hpfog-.gem - -where <version> is the version number of the downloaded and unpacked file, for example 0.0.8 + sudo gem install fog That's it! Try out the usage examples explained below to confirm your installation. If you should ever need to remove the library: - gem uninstall hpfog + sudo gem uninstall fog == Usage -The Ruby Fog library is well documented on the community web site, but for specific examples +The Ruby Fog library is well documented on the community web site at {fog.io}[http://fog.io], but for specific examples using HP's extensions, see: -* {HP Cloud Fog library - Object Storage Examples}[http://build.hpcloud.com/bindings/fog/object-storage] -* {HP Cloud Fog library - Compute Examples}[http://build.hpcloud.com/bindings/fog/compute] +* {HP Cloud Fog library - Object Storage Examples}[https://build.hpcloud.com/bindings/fog/object-storage] +* {HP Cloud Fog library - Compute Examples}[https://build.hpcloud.com/bindings/fog/compute] +* {HP Cloud Fog library - CDN Examples}[https://build.hpcloud.com/bindings/fog/cdn] -= Notice +Having trouble? {Get help over at the Forums}[https://connect.hpcloud.com] + +== Notice The following notice applies to files included in the /lib/fog/hp directory and its sub-directories. @@ -66,6 +55,4 @@ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PA PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - - +DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/lib/fog/hp/requests/compute/list_servers.rb b/lib/fog/hp/requests/compute/list_servers.rb index d82315466..83e87a472 100644 --- a/lib/fog/hp/requests/compute/list_servers.rb +++ b/lib/fog/hp/requests/compute/list_servers.rb @@ -28,7 +28,7 @@ module Fog data = list_servers_detail.body['servers'] servers = [] for server in data - servers << server.reject { |key, value| !['id', 'name'].include?(key) } + servers << server.reject { |key, value| !['id', 'name', 'links', 'uuid'].include?(key) } end response.status = [200, 203][rand(1)] response.body = { 'servers' => servers }