onlinelabs 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +34 -0
- data/.travis.yml +1 -0
- data/CHANGES.md +9 -0
- data/Gemfile +3 -0
- data/README.md +176 -0
- data/Rakefile +1 -0
- data/lib/onlinelabs.rb +343 -0
- data/lib/onlinelabs/version.rb +3 -0
- data/onlinelabs.gemspec +27 -0
- data/spec/onlinelabs_spec.rb +32 -0
- data/spec/servers_spec.rb +60 -0
- metadata +141 -0
    
        checksums.yaml
    ADDED
    
    | @@ -0,0 +1,7 @@ | |
| 1 | 
            +
            ---
         | 
| 2 | 
            +
            SHA1:
         | 
| 3 | 
            +
              metadata.gz: ddf23250dceca37a15e0ecf9235ec0c76e02fa28
         | 
| 4 | 
            +
              data.tar.gz: e4950022ffcc31b12aa47f6ce7cd6869f4d269f1
         | 
| 5 | 
            +
            SHA512:
         | 
| 6 | 
            +
              metadata.gz: b824a9b9ed40014b48d37f4f7c10a22cdb59d9e3c47c96e07faf109a0b00479ee61a58579d727ed131d192d1bf963911283d80a91fa3675e30ddb2a6c28019f4
         | 
| 7 | 
            +
              data.tar.gz: 887f3655f4dfe726c9efc7e7dfa180521df38554f30a2d4488ec902e567dc208d34616ff337073d26a773f6c1aabbc1ec8c52f42594447fc853a3f4ab1935b4d
         | 
    
        data/.gitignore
    ADDED
    
    | @@ -0,0 +1,34 @@ | |
| 1 | 
            +
            *.gem
         | 
| 2 | 
            +
            *.rbc
         | 
| 3 | 
            +
            /.config
         | 
| 4 | 
            +
            /coverage/
         | 
| 5 | 
            +
            /InstalledFiles
         | 
| 6 | 
            +
            /pkg/
         | 
| 7 | 
            +
            /spec/reports/
         | 
| 8 | 
            +
            /test/tmp/
         | 
| 9 | 
            +
            /test/version_tmp/
         | 
| 10 | 
            +
            /tmp/
         | 
| 11 | 
            +
             | 
| 12 | 
            +
            ## Specific to RubyMotion:
         | 
| 13 | 
            +
            .dat*
         | 
| 14 | 
            +
            .repl_history
         | 
| 15 | 
            +
            build/
         | 
| 16 | 
            +
             | 
| 17 | 
            +
            ## Documentation cache and generated files:
         | 
| 18 | 
            +
            /.yardoc/
         | 
| 19 | 
            +
            /_yardoc/
         | 
| 20 | 
            +
            /doc/
         | 
| 21 | 
            +
            /rdoc/
         | 
| 22 | 
            +
             | 
| 23 | 
            +
            ## Environment normalisation:
         | 
| 24 | 
            +
            /.bundle/
         | 
| 25 | 
            +
            /lib/bundler/man/
         | 
| 26 | 
            +
             | 
| 27 | 
            +
            # for a library or gem, you might want to ignore these files since the code is
         | 
| 28 | 
            +
            # intended to run in multiple environments; otherwise, check them in:
         | 
| 29 | 
            +
            # Gemfile.lock
         | 
| 30 | 
            +
            # .ruby-version
         | 
| 31 | 
            +
            # .ruby-gemset
         | 
| 32 | 
            +
             | 
| 33 | 
            +
            # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
         | 
| 34 | 
            +
            .rvmrc
         | 
    
        data/.travis.yml
    ADDED
    
    | @@ -0,0 +1 @@ | |
| 1 | 
            +
            script: "bundle exec rspec"
         | 
    
        data/CHANGES.md
    ADDED
    
    
    
        data/Gemfile
    ADDED
    
    
    
        data/README.md
    ADDED
    
    | @@ -0,0 +1,176 @@ | |
| 1 | 
            +
            # Online Labs Rubygem
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            Easy to use Online Labs api client.
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            ## Installation
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            Manual instalation:
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            	gem install onlinelabs
         | 
| 10 | 
            +
             | 
| 11 | 
            +
            add this to your gemfile:
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            	gem 'onlinelabs'
         | 
| 14 | 
            +
             | 
| 15 | 
            +
             | 
| 16 | 
            +
            ## Usage
         | 
| 17 | 
            +
             | 
| 18 | 
            +
            ### Configure the client
         | 
| 19 | 
            +
             | 
| 20 | 
            +
                require 'onlinelabs'
         | 
| 21 | 
            +
             | 
| 22 | 
            +
            	OnlineLabs.organization = <organization_key>
         | 
| 23 | 
            +
            	OnlineLabs.token = <token>
         | 
| 24 | 
            +
             | 
| 25 | 
            +
            ### Servers
         | 
| 26 | 
            +
             | 
| 27 | 
            +
            	# list all servers
         | 
| 28 | 
            +
            	OnlineLabs::Server.all
         | 
| 29 | 
            +
             | 
| 30 | 
            +
            	# list with filter
         | 
| 31 | 
            +
            	OnlineLabs::Server.all state: :running
         | 
| 32 | 
            +
             | 
| 33 | 
            +
            	# create a new server with default values
         | 
| 34 | 
            +
            	OnlineLabs::Server.create
         | 
| 35 | 
            +
             | 
| 36 | 
            +
            	# create a new server with name and tags
         | 
| 37 | 
            +
            	OnlineLabs::Server.create :name => 'my_new_server', tags: ['prod']
         | 
| 38 | 
            +
             | 
| 39 | 
            +
            	# get a server by id
         | 
| 40 | 
            +
                server = OnlineLabs::Server.find <server_id>
         | 
| 41 | 
            +
             | 
| 42 | 
            +
            	# edit a server
         | 
| 43 | 
            +
                server = OnlineLabs::Server.find <server_id>
         | 
| 44 | 
            +
            	server.name = 'new_name'
         | 
| 45 | 
            +
            	OnlineLabs::Server.edit server.id, server
         | 
| 46 | 
            +
             | 
| 47 | 
            +
            	# actions on a server
         | 
| 48 | 
            +
            	OnlineLabs::Server.power_on server.id
         | 
| 49 | 
            +
             | 
| 50 | 
            +
            	OnlineLabs::Server.power_off server.id
         | 
| 51 | 
            +
             | 
| 52 | 
            +
            	OnlineLabs::Server.terminate server.id
         | 
| 53 | 
            +
             | 
| 54 | 
            +
            	# destroy a server
         | 
| 55 | 
            +
            	OnlineLabs::Server.destroy server.id
         | 
| 56 | 
            +
             | 
| 57 | 
            +
            ### Images
         | 
| 58 | 
            +
             | 
| 59 | 
            +
            	# list all images
         | 
| 60 | 
            +
            	OnlineLabs::Image.all
         | 
| 61 | 
            +
             | 
| 62 | 
            +
            	# list marketplace images
         | 
| 63 | 
            +
            	OnlineLabs::Image.marketplace
         | 
| 64 | 
            +
             | 
| 65 | 
            +
            	# get image by id
         | 
| 66 | 
            +
            	image = OnlineLabs::Image.find <image_id>
         | 
| 67 | 
            +
             | 
| 68 | 
            +
            	# get image by name
         | 
| 69 | 
            +
            	image = OnlineLabs::Image.find_by_name('Ubuntu')
         | 
| 70 | 
            +
             | 
| 71 | 
            +
            	# create an image
         | 
| 72 | 
            +
            	image = OnlineLabs::Image.create root_volume: snapshot
         | 
| 73 | 
            +
             | 
| 74 | 
            +
            	# edit an image
         | 
| 75 | 
            +
            	image = OnlineLabs::Image.edit id, image
         | 
| 76 | 
            +
             | 
| 77 | 
            +
            	# destroy an image
         | 
| 78 | 
            +
            	image = OnlineLabs::Image.destroy id
         | 
| 79 | 
            +
             | 
| 80 | 
            +
            ### Volumes
         | 
| 81 | 
            +
             | 
| 82 | 
            +
            	# list all volumes
         | 
| 83 | 
            +
            	OnlineLabs::Volume.all
         | 
| 84 | 
            +
             | 
| 85 | 
            +
            	# get volume by id
         | 
| 86 | 
            +
            	volume = OnlineLabs::Volume.find <volume_id>
         | 
| 87 | 
            +
             | 
| 88 | 
            +
            	# create an volume
         | 
| 89 | 
            +
            	volume = OnlineLabs::Volume.create
         | 
| 90 | 
            +
            	volume = OnlineLabs::Volume.create size: 100 * 10 ** 9, volume_type: 'l_ssd'
         | 
| 91 | 
            +
             | 
| 92 | 
            +
            	# edit an volume
         | 
| 93 | 
            +
            	volume = OnlineLabs::Volume.edit id, volume
         | 
| 94 | 
            +
             | 
| 95 | 
            +
            	# destroy an volume
         | 
| 96 | 
            +
            	volume = OnlineLabs::Volume.destroy id
         | 
| 97 | 
            +
             | 
| 98 | 
            +
            ### Snapshots
         | 
| 99 | 
            +
             | 
| 100 | 
            +
            	# list all snapshots
         | 
| 101 | 
            +
            	OnlineLabs::Volume.all
         | 
| 102 | 
            +
             | 
| 103 | 
            +
            	# get snapshot by id
         | 
| 104 | 
            +
            	snapshot = OnlineLabs::Snapshot.find <snapshot_id>
         | 
| 105 | 
            +
             | 
| 106 | 
            +
            	# create an snapshot
         | 
| 107 | 
            +
            	snapshot = OnlineLabs::Snapshot.create volume_id: id
         | 
| 108 | 
            +
             | 
| 109 | 
            +
            	# edit an snapshot
         | 
| 110 | 
            +
            	snapshot = OnlineLabs::Snapshot.edit id, snapshot
         | 
| 111 | 
            +
             | 
| 112 | 
            +
            	# destroy an snapshot
         | 
| 113 | 
            +
            	snapshot = OnlineLabs::Snapshot.destroy id
         | 
| 114 | 
            +
             | 
| 115 | 
            +
            ### Ip addresses
         | 
| 116 | 
            +
             | 
| 117 | 
            +
            	# list all ip addresses
         | 
| 118 | 
            +
            	OnlineLabs::Ip.all
         | 
| 119 | 
            +
             | 
| 120 | 
            +
            	# get Ip
         | 
| 121 | 
            +
            	ip = OnlineLabs::Ip.find <ip_id>
         | 
| 122 | 
            +
            	ip = OnlineLabs::Ip.find 127.0.0.1
         | 
| 123 | 
            +
             | 
| 124 | 
            +
            	# reserve an ip
         | 
| 125 | 
            +
            	ip = OnlineLabs::Ip.reserve
         | 
| 126 | 
            +
            	# or
         | 
| 127 | 
            +
            	ip = OnlineLabs::Ip.create
         | 
| 128 | 
            +
             | 
| 129 | 
            +
            	# edit an ip
         | 
| 130 | 
            +
            	ip = OnlineLabs::Ip.edit id, ip
         | 
| 131 | 
            +
             | 
| 132 | 
            +
            	# release an ip
         | 
| 133 | 
            +
            	ip = OnlineLabs::Ip.destroy id
         | 
| 134 | 
            +
             | 
| 135 | 
            +
            ### Handle exceptions
         | 
| 136 | 
            +
             | 
| 137 | 
            +
            	# Not found
         | 
| 138 | 
            +
            	begin
         | 
| 139 | 
            +
            		puts OnlineLabs::Server.find <invalid_id>
         | 
| 140 | 
            +
            	rescue OnlineLabs::NotFound => e
         | 
| 141 | 
            +
            		# handle error here
         | 
| 142 | 
            +
            	end
         | 
| 143 | 
            +
             | 
| 144 | 
            +
            	# Other
         | 
| 145 | 
            +
            	begin
         | 
| 146 | 
            +
            		puts OnlineLabs::Server.create extra_field: ['nope']
         | 
| 147 | 
            +
            	rescue OnlineLabs::APIError => e
         | 
| 148 | 
            +
            		# handle error here
         | 
| 149 | 
            +
            	end
         | 
| 150 | 
            +
             | 
| 151 | 
            +
            ## Example
         | 
| 152 | 
            +
             | 
| 153 | 
            +
                require 'onlinelabs'
         | 
| 154 | 
            +
             | 
| 155 | 
            +
            	OnlineLabs.organization = <organization_key>
         | 
| 156 | 
            +
            	OnlineLabs.token = <token>
         | 
| 157 | 
            +
             | 
| 158 | 
            +
            	# get the docker image
         | 
| 159 | 
            +
            	image = OnlineLabs::Image.find_by_name('Docker')
         | 
| 160 | 
            +
             | 
| 161 | 
            +
            	# create 5 new servers
         | 
| 162 | 
            +
            	5.times do |x|
         | 
| 163 | 
            +
            		OnlineLabs::Server.create name: "docker#{x}', image: image.id, tags: ['docker']
         | 
| 164 | 
            +
            	end
         | 
| 165 | 
            +
             | 
| 166 | 
            +
            	# power on
         | 
| 167 | 
            +
            	OnlineLabs::Server.all.each do |server|
         | 
| 168 | 
            +
            		OnlineLabs::Server.power_on(server.id)
         | 
| 169 | 
            +
            	end
         | 
| 170 | 
            +
             | 
| 171 | 
            +
            	# do something ...
         | 
| 172 | 
            +
             | 
| 173 | 
            +
            	# terminate
         | 
| 174 | 
            +
            	OnlineLabs::Server.all.each do |server|
         | 
| 175 | 
            +
            		OnlineLabs::Server.terminate(server.id)
         | 
| 176 | 
            +
            	end
         | 
    
        data/Rakefile
    ADDED
    
    | @@ -0,0 +1 @@ | |
| 1 | 
            +
            require "bundler/gem_tasks"
         | 
    
        data/lib/onlinelabs.rb
    ADDED
    
    | @@ -0,0 +1,343 @@ | |
| 1 | 
            +
            require 'faraday'
         | 
| 2 | 
            +
            require 'faraday_middleware'
         | 
| 3 | 
            +
            require 'recursive-open-struct'
         | 
| 4 | 
            +
            require 'onlinelabs/version'
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            module OnlineLabs
         | 
| 7 | 
            +
             | 
| 8 | 
            +
              extend self
         | 
| 9 | 
            +
             | 
| 10 | 
            +
              def compute_endpoint
         | 
| 11 | 
            +
                "https://api.cloud.online.net"
         | 
| 12 | 
            +
              end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
              def account_endpoint
         | 
| 15 | 
            +
                "https://account.cloud.online.net"
         | 
| 16 | 
            +
              end
         | 
| 17 | 
            +
             | 
| 18 | 
            +
              def token=(token)
         | 
| 19 | 
            +
                @token = token
         | 
| 20 | 
            +
                setup!
         | 
| 21 | 
            +
                @token
         | 
| 22 | 
            +
              end
         | 
| 23 | 
            +
             | 
| 24 | 
            +
              def token
         | 
| 25 | 
            +
                return @token if @token
         | 
| 26 | 
            +
                "token_required"
         | 
| 27 | 
            +
              end
         | 
| 28 | 
            +
             | 
| 29 | 
            +
              def organization=(organization)
         | 
| 30 | 
            +
                @organization = organization
         | 
| 31 | 
            +
                setup!
         | 
| 32 | 
            +
                @organization
         | 
| 33 | 
            +
              end
         | 
| 34 | 
            +
             | 
| 35 | 
            +
              def organization
         | 
| 36 | 
            +
                return @organization if @organization
         | 
| 37 | 
            +
                "organization_required"
         | 
| 38 | 
            +
              end
         | 
| 39 | 
            +
             | 
| 40 | 
            +
              DEFINITIONS = {
         | 
| 41 | 
            +
                "Image" => {
         | 
| 42 | 
            +
                  :all => {
         | 
| 43 | 
            +
                    :method => :get,
         | 
| 44 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/images",
         | 
| 45 | 
            +
                    :default_params => {
         | 
| 46 | 
            +
                      :organization => Proc.new { OnlineLabs.organization }
         | 
| 47 | 
            +
                    }
         | 
| 48 | 
            +
                  },
         | 
| 49 | 
            +
                  :marketplace => {
         | 
| 50 | 
            +
                    :method => :get,
         | 
| 51 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/images",
         | 
| 52 | 
            +
                    :default_params => {
         | 
| 53 | 
            +
                      :public => true
         | 
| 54 | 
            +
                    }
         | 
| 55 | 
            +
                  },
         | 
| 56 | 
            +
                  :find => {
         | 
| 57 | 
            +
                    :method => :get,
         | 
| 58 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/images/%s",
         | 
| 59 | 
            +
                  },
         | 
| 60 | 
            +
                  :find_by_name => {
         | 
| 61 | 
            +
                    :method => :get,
         | 
| 62 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/images",
         | 
| 63 | 
            +
                    :filters => [
         | 
| 64 | 
            +
                      Proc.new { |item, params| item.name.include? params.first }
         | 
| 65 | 
            +
                    ],
         | 
| 66 | 
            +
                    :transform => Proc.new { |item, params| item.first },
         | 
| 67 | 
            +
                  },
         | 
| 68 | 
            +
                  :create => {
         | 
| 69 | 
            +
                    :method => :post,
         | 
| 70 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/images",
         | 
| 71 | 
            +
                    :default_params => {
         | 
| 72 | 
            +
                      :name => 'default',
         | 
| 73 | 
            +
                      :root_volume => 'required',
         | 
| 74 | 
            +
                      :organization => Proc.new { OnlineLabs.organization },
         | 
| 75 | 
            +
                    }
         | 
| 76 | 
            +
                  },
         | 
| 77 | 
            +
                  :edit => {
         | 
| 78 | 
            +
                    :method => :put,
         | 
| 79 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/images/%s",
         | 
| 80 | 
            +
                  },
         | 
| 81 | 
            +
                  :destroy => {
         | 
| 82 | 
            +
                    :method => :delete,
         | 
| 83 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/images/%s",
         | 
| 84 | 
            +
                  },
         | 
| 85 | 
            +
                },
         | 
| 86 | 
            +
                "Volume" => {
         | 
| 87 | 
            +
                  :all => {
         | 
| 88 | 
            +
                    :method => :get,
         | 
| 89 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/volumes",
         | 
| 90 | 
            +
                  },
         | 
| 91 | 
            +
                  :find => {
         | 
| 92 | 
            +
                    :method => :get,
         | 
| 93 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/volumes/%s",
         | 
| 94 | 
            +
                  },
         | 
| 95 | 
            +
                  :edit => {
         | 
| 96 | 
            +
                    :method => :put,
         | 
| 97 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/volumes/%s",
         | 
| 98 | 
            +
                  },
         | 
| 99 | 
            +
                  :destroy => {
         | 
| 100 | 
            +
                    :method => :delete,
         | 
| 101 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/volumes/%s",
         | 
| 102 | 
            +
                  },
         | 
| 103 | 
            +
                  :create => {
         | 
| 104 | 
            +
                    :method => :post,
         | 
| 105 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/volumes",
         | 
| 106 | 
            +
                    :default_params => {
         | 
| 107 | 
            +
                      :name => 'default',
         | 
| 108 | 
            +
                      :size => 20 * 10**9,
         | 
| 109 | 
            +
                      :volume_type => 'l_hdd',
         | 
| 110 | 
            +
                      :organization => Proc.new { OnlineLabs.organization },
         | 
| 111 | 
            +
                    }
         | 
| 112 | 
            +
                  },
         | 
| 113 | 
            +
                },
         | 
| 114 | 
            +
                "Ip" => {
         | 
| 115 | 
            +
                  :all => {
         | 
| 116 | 
            +
                    :method => :get,
         | 
| 117 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/ips",
         | 
| 118 | 
            +
                  },
         | 
| 119 | 
            +
                  :find => {
         | 
| 120 | 
            +
                    :method => :get,
         | 
| 121 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/ips/%s",
         | 
| 122 | 
            +
                  },
         | 
| 123 | 
            +
                  :edit => {
         | 
| 124 | 
            +
                    :method => :put,
         | 
| 125 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/ips/%s",
         | 
| 126 | 
            +
                  },
         | 
| 127 | 
            +
                  :destroy => {
         | 
| 128 | 
            +
                    :method => :delete,
         | 
| 129 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/ips/%s",
         | 
| 130 | 
            +
                  },
         | 
| 131 | 
            +
                  :reserve => {
         | 
| 132 | 
            +
                    :method => :post,
         | 
| 133 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/ips",
         | 
| 134 | 
            +
                    :default_params => {
         | 
| 135 | 
            +
                      :organization => Proc.new { OnlineLabs.organization },
         | 
| 136 | 
            +
                    }
         | 
| 137 | 
            +
                  },
         | 
| 138 | 
            +
                  :create => {
         | 
| 139 | 
            +
                    :method => :post,
         | 
| 140 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/ips",
         | 
| 141 | 
            +
                    :default_params => {
         | 
| 142 | 
            +
                      :organization => Proc.new { OnlineLabs.organization },
         | 
| 143 | 
            +
                    }
         | 
| 144 | 
            +
                  },
         | 
| 145 | 
            +
                },
         | 
| 146 | 
            +
                "Snapshot" => {
         | 
| 147 | 
            +
                  :all => {
         | 
| 148 | 
            +
                    :method => :get,
         | 
| 149 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/snapshots",
         | 
| 150 | 
            +
                  },
         | 
| 151 | 
            +
                  :find => {
         | 
| 152 | 
            +
                    :method => :get,
         | 
| 153 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/snapshots/%s",
         | 
| 154 | 
            +
                  },
         | 
| 155 | 
            +
                  :edit => {
         | 
| 156 | 
            +
                    :method => :put,
         | 
| 157 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/snapshots/%s",
         | 
| 158 | 
            +
                  },
         | 
| 159 | 
            +
                  :destroy => {
         | 
| 160 | 
            +
                    :method => :delete,
         | 
| 161 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/snapshots/%s",
         | 
| 162 | 
            +
                  },
         | 
| 163 | 
            +
                  :create => {
         | 
| 164 | 
            +
                    :method => :post,
         | 
| 165 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/snapshots",
         | 
| 166 | 
            +
                    :default_params => {
         | 
| 167 | 
            +
                      :name => 'default',
         | 
| 168 | 
            +
                      :volume_id => 'required',
         | 
| 169 | 
            +
                      :organization => Proc.new { OnlineLabs.organization },
         | 
| 170 | 
            +
                    }
         | 
| 171 | 
            +
                  },
         | 
| 172 | 
            +
                },
         | 
| 173 | 
            +
                "Server" => {
         | 
| 174 | 
            +
                  :all => {
         | 
| 175 | 
            +
                    :method => :get,
         | 
| 176 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/servers",
         | 
| 177 | 
            +
                  },
         | 
| 178 | 
            +
                  :power_on => {
         | 
| 179 | 
            +
                    :method => :post,
         | 
| 180 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/servers/%s/action",
         | 
| 181 | 
            +
                    :default_params => {
         | 
| 182 | 
            +
                      :action => :poweron
         | 
| 183 | 
            +
                    }
         | 
| 184 | 
            +
                  },
         | 
| 185 | 
            +
                  :power_off => {
         | 
| 186 | 
            +
                    :method => :post,
         | 
| 187 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/servers/%s/action",
         | 
| 188 | 
            +
                    :default_params => {
         | 
| 189 | 
            +
                      :action => :poweroff
         | 
| 190 | 
            +
                    }
         | 
| 191 | 
            +
                  },
         | 
| 192 | 
            +
                  :terminate => {
         | 
| 193 | 
            +
                    :method => :post,
         | 
| 194 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/servers/%s/action",
         | 
| 195 | 
            +
                    :default_params => {
         | 
| 196 | 
            +
                      :action => :terminate
         | 
| 197 | 
            +
                    }
         | 
| 198 | 
            +
                  },
         | 
| 199 | 
            +
                  :find => {
         | 
| 200 | 
            +
                    :method => :get,
         | 
| 201 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/servers/%s",
         | 
| 202 | 
            +
                  },
         | 
| 203 | 
            +
                  :edit => {
         | 
| 204 | 
            +
                    :method => :put,
         | 
| 205 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/servers/%s",
         | 
| 206 | 
            +
                  },
         | 
| 207 | 
            +
                  :destroy => {
         | 
| 208 | 
            +
                    :method => :delete,
         | 
| 209 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/servers/%s",
         | 
| 210 | 
            +
                  },
         | 
| 211 | 
            +
                  :create => {
         | 
| 212 | 
            +
                    :method => :post,
         | 
| 213 | 
            +
                    :endpoint => "#{OnlineLabs.compute_endpoint}/servers",
         | 
| 214 | 
            +
                    :default_params => {
         | 
| 215 | 
            +
                      :name => 'default',
         | 
| 216 | 
            +
                      :image => Proc.new { OnlineLabs::Image.find_by_name('Ubuntu').id },
         | 
| 217 | 
            +
                      :volumes => {},
         | 
| 218 | 
            +
                      :organization => Proc.new { OnlineLabs.organization },
         | 
| 219 | 
            +
                    }
         | 
| 220 | 
            +
                  }
         | 
| 221 | 
            +
                },
         | 
| 222 | 
            +
              }
         | 
| 223 | 
            +
             | 
| 224 | 
            +
              DEFINITIONS.each do |resource|
         | 
| 225 | 
            +
                resource_name = resource[0]
         | 
| 226 | 
            +
             | 
| 227 | 
            +
                resource_class = Class.new(Object) do
         | 
| 228 | 
            +
                  singleton = class << self; self end
         | 
| 229 | 
            +
             | 
| 230 | 
            +
                  DEFINITIONS[resource_name].each do |method_name, query|
         | 
| 231 | 
            +
                    singleton.send :define_method, method_name do |*args|
         | 
| 232 | 
            +
                      OnlineLabs.request_and_respond(query, *args)
         | 
| 233 | 
            +
                    end
         | 
| 234 | 
            +
                  end
         | 
| 235 | 
            +
                end
         | 
| 236 | 
            +
             | 
| 237 | 
            +
                OnlineLabs.const_set(resource_name, resource_class)
         | 
| 238 | 
            +
              end
         | 
| 239 | 
            +
             | 
| 240 | 
            +
              def request=(request)
         | 
| 241 | 
            +
                @request = request
         | 
| 242 | 
            +
              end
         | 
| 243 | 
            +
             | 
| 244 | 
            +
              def request
         | 
| 245 | 
            +
                @request
         | 
| 246 | 
            +
              end
         | 
| 247 | 
            +
             | 
| 248 | 
            +
              def request_and_respond(query, *params)
         | 
| 249 | 
            +
                body = {}
         | 
| 250 | 
            +
                body.merge! query[:default_params] || {}
         | 
| 251 | 
            +
                endpoint = query[:endpoint]
         | 
| 252 | 
            +
             | 
| 253 | 
            +
                params.each do |param|
         | 
| 254 | 
            +
                  if param.is_a? Hash or param.is_a? RecursiveOpenStruct
         | 
| 255 | 
            +
                    body.merge! param
         | 
| 256 | 
            +
                  elsif not param.nil?
         | 
| 257 | 
            +
                    endpoint = endpoint % param
         | 
| 258 | 
            +
                  end
         | 
| 259 | 
            +
                end
         | 
| 260 | 
            +
             | 
| 261 | 
            +
                body = Hash[body.map { |k, v|
         | 
| 262 | 
            +
                  if v.respond_to? :call then [k, v.call()] else [k, v] end
         | 
| 263 | 
            +
                }]
         | 
| 264 | 
            +
             | 
| 265 | 
            +
                resp = OnlineLabs.request.send(query[:method], endpoint, body)
         | 
| 266 | 
            +
                body = resp.body
         | 
| 267 | 
            +
                if resp.status == 204
         | 
| 268 | 
            +
                  return
         | 
| 269 | 
            +
                end
         | 
| 270 | 
            +
             | 
| 271 | 
            +
                if resp.status == 404
         | 
| 272 | 
            +
                  raise OnlineLabs::NotFound, resp
         | 
| 273 | 
            +
                elsif resp.status >= 300
         | 
| 274 | 
            +
                  raise OnlineLabs::APIError, resp
         | 
| 275 | 
            +
                end
         | 
| 276 | 
            +
             | 
| 277 | 
            +
                hash = RecursiveOpenStruct.new(body, :recurse_over_arrays => true)
         | 
| 278 | 
            +
             | 
| 279 | 
            +
                if body.length == 1
         | 
| 280 | 
            +
                  hash = hash.send(body.keys.first)
         | 
| 281 | 
            +
                end
         | 
| 282 | 
            +
             | 
| 283 | 
            +
                if query[:filters]
         | 
| 284 | 
            +
                  filters = query[:filters]
         | 
| 285 | 
            +
                  hash = hash.find_all do |item|
         | 
| 286 | 
            +
                    filters.all? do |filter|
         | 
| 287 | 
            +
                      filter.call(item, params)
         | 
| 288 | 
            +
                    end
         | 
| 289 | 
            +
                  end
         | 
| 290 | 
            +
                end
         | 
| 291 | 
            +
             | 
| 292 | 
            +
                if query[:transform]
         | 
| 293 | 
            +
                  hash = query[:transform].call(hash, params)
         | 
| 294 | 
            +
                end
         | 
| 295 | 
            +
             | 
| 296 | 
            +
                hash
         | 
| 297 | 
            +
              end
         | 
| 298 | 
            +
             | 
| 299 | 
            +
              class APIError < Exception
         | 
| 300 | 
            +
                def initialize(response)
         | 
| 301 | 
            +
                  self.status = response.status
         | 
| 302 | 
            +
                  self.body = RecursiveOpenStruct.new(response.body, :recurse_over_arrays => true)
         | 
| 303 | 
            +
                  self.type = self.body.type
         | 
| 304 | 
            +
                  self.error_message = self.body.message
         | 
| 305 | 
            +
                end
         | 
| 306 | 
            +
             | 
| 307 | 
            +
                def to_s
         | 
| 308 | 
            +
                  "<status:#{status}, type:#{type}, message:\'#{error_message}\'>"
         | 
| 309 | 
            +
                end
         | 
| 310 | 
            +
             | 
| 311 | 
            +
                def message
         | 
| 312 | 
            +
                  "#{self}"
         | 
| 313 | 
            +
                end
         | 
| 314 | 
            +
             | 
| 315 | 
            +
                attr_accessor :status
         | 
| 316 | 
            +
                attr_accessor :type
         | 
| 317 | 
            +
                attr_accessor :error_message
         | 
| 318 | 
            +
                attr_accessor :body
         | 
| 319 | 
            +
              end
         | 
| 320 | 
            +
             | 
| 321 | 
            +
              class NotFound < OnlineLabs::APIError
         | 
| 322 | 
            +
              end
         | 
| 323 | 
            +
             | 
| 324 | 
            +
             | 
| 325 | 
            +
             | 
| 326 | 
            +
              private
         | 
| 327 | 
            +
             | 
| 328 | 
            +
              def setup!
         | 
| 329 | 
            +
                options = {
         | 
| 330 | 
            +
                  :headers => {
         | 
| 331 | 
            +
                    'x-auth-token' => OnlineLabs.token,
         | 
| 332 | 
            +
                    'content-type' => 'application/json',
         | 
| 333 | 
            +
                  }
         | 
| 334 | 
            +
                }
         | 
| 335 | 
            +
             | 
| 336 | 
            +
                OnlineLabs.request = ::Faraday::Connection.new(options) do |builder|
         | 
| 337 | 
            +
                  builder.use     ::FaradayMiddleware::EncodeJson
         | 
| 338 | 
            +
                  builder.use     ::FaradayMiddleware::ParseJson
         | 
| 339 | 
            +
                  builder.use     ::FaradayMiddleware::FollowRedirects
         | 
| 340 | 
            +
                  builder.adapter ::Faraday.default_adapter
         | 
| 341 | 
            +
                end
         | 
| 342 | 
            +
              end
         | 
| 343 | 
            +
            end
         | 
    
        data/onlinelabs.gemspec
    ADDED
    
    | @@ -0,0 +1,27 @@ | |
| 1 | 
            +
            # -*- encoding: utf-8 -*-
         | 
| 2 | 
            +
            lib = File.expand_path('../lib', __FILE__)
         | 
| 3 | 
            +
            $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
         | 
| 4 | 
            +
            require 'onlinelabs/version'
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            Gem::Specification.new do |gem|
         | 
| 7 | 
            +
              gem.name          = "onlinelabs"
         | 
| 8 | 
            +
              gem.version       = OnlineLabs::VERSION
         | 
| 9 | 
            +
              gem.authors       = ["bchatelard"]
         | 
| 10 | 
            +
              gem.email         = ["chatel.bast@gmail.com"]
         | 
| 11 | 
            +
              gem.description   = %q{Ruby bindings for the Online Labs API.}
         | 
| 12 | 
            +
              gem.summary       = %q{Ruby bindings for the Online Labs API.}
         | 
| 13 | 
            +
              gem.homepage      = "http://github.com/bchatelard/onlinelabs-ruby"
         | 
| 14 | 
            +
             | 
| 15 | 
            +
              gem.add_dependency "faraday", "~> 0.9"
         | 
| 16 | 
            +
              gem.add_dependency "faraday_middleware", "~> 0.9"
         | 
| 17 | 
            +
              gem.add_dependency "recursive-open-struct", "~> 0.5"
         | 
| 18 | 
            +
             | 
| 19 | 
            +
              gem.add_development_dependency "rake", "~> 10.1"
         | 
| 20 | 
            +
              gem.add_development_dependency "rspec", "~> 3.1"
         | 
| 21 | 
            +
              gem.add_development_dependency "its", "~> 0.2"
         | 
| 22 | 
            +
             | 
| 23 | 
            +
              gem.files         = `git ls-files`.split($/)
         | 
| 24 | 
            +
              gem.executables   = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
         | 
| 25 | 
            +
              gem.test_files    = gem.files.grep(%r{^(test|spec|features)/})
         | 
| 26 | 
            +
              gem.require_paths = ["lib"]
         | 
| 27 | 
            +
            end
         | 
| @@ -0,0 +1,32 @@ | |
| 1 | 
            +
            require 'rubygems'
         | 
| 2 | 
            +
            require 'its'
         | 
| 3 | 
            +
            require 'onlinelabs'
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            describe OnlineLabs do
         | 
| 6 | 
            +
              subject(:OnlineLabs) { described_class }
         | 
| 7 | 
            +
             | 
| 8 | 
            +
              before do
         | 
| 9 | 
            +
                OnlineLabs.organization = organization
         | 
| 10 | 
            +
                OnlineLabs.token = token
         | 
| 11 | 
            +
              end
         | 
| 12 | 
            +
             | 
| 13 | 
            +
              describe "defaults" do
         | 
| 14 | 
            +
                let(:organization)   { nil }
         | 
| 15 | 
            +
                let(:token)          { nil }
         | 
| 16 | 
            +
             | 
| 17 | 
            +
                its(:compute_endpoint) { should eq "https://api.cloud.online.net" }
         | 
| 18 | 
            +
                its(:account_endpoint) { should eq "https://account.cloud.online.net" }
         | 
| 19 | 
            +
                its(:token)            { should eq "token_required" }
         | 
| 20 | 
            +
                its(:organization)     { should eq "organization_required" }
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                it { expect(OnlineLabs::VERSION).to eq "0.1.1" }
         | 
| 23 | 
            +
              end
         | 
| 24 | 
            +
             | 
| 25 | 
            +
              describe "test token and organization" do
         | 
| 26 | 
            +
                let(:organization)   { "organization_id" }
         | 
| 27 | 
            +
                let(:token)          { "token_id" }
         | 
| 28 | 
            +
             | 
| 29 | 
            +
                its(:organization)   { should eq "organization_id" }
         | 
| 30 | 
            +
                its(:token)          { should eq "token_id" }
         | 
| 31 | 
            +
              end
         | 
| 32 | 
            +
            end
         | 
| @@ -0,0 +1,60 @@ | |
| 1 | 
            +
            require 'rubygems'
         | 
| 2 | 
            +
            require 'its'
         | 
| 3 | 
            +
            require 'onlinelabs'
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            describe OnlineLabs::Server do
         | 
| 6 | 
            +
              subject(:server) { described_class }
         | 
| 7 | 
            +
             | 
| 8 | 
            +
              before do
         | 
| 9 | 
            +
                stubs = Faraday::Adapter::Test::Stubs.new do |stub|
         | 
| 10 | 
            +
                  stub.get('/servers')      { |env| [200, {}, {:servers => [test_server]}] }
         | 
| 11 | 
            +
                  stub.get('/servers/1234') { |env| [200, {}, {:server => test_server}] }
         | 
| 12 | 
            +
                  stub.get('/servers/not_found') { |env| [404, {}, {:type => 'not_found', :message => 'not found'}] }
         | 
| 13 | 
            +
                end
         | 
| 14 | 
            +
                OnlineLabs.request = Faraday.new do |builder|
         | 
| 15 | 
            +
                  builder.adapter :test, stubs
         | 
| 16 | 
            +
                end
         | 
| 17 | 
            +
              end
         | 
| 18 | 
            +
             | 
| 19 | 
            +
              describe "all" do
         | 
| 20 | 
            +
                let(:test_server)       { RecursiveOpenStruct.new({:name => 'hello', :id => '1234'}, :recurse_over_arrays => true) }
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                its(:all)               { should eq [test_server] }
         | 
| 23 | 
            +
              end
         | 
| 24 | 
            +
             | 
| 25 | 
            +
              describe "item" do
         | 
| 26 | 
            +
                let(:test_server)       { RecursiveOpenStruct.new({:name => 'hello', :id => '1234'}, :recurse_over_arrays => true) }
         | 
| 27 | 
            +
             | 
| 28 | 
            +
                its(:find, '1234')      { should eq test_server }
         | 
| 29 | 
            +
              end
         | 
| 30 | 
            +
             | 
| 31 | 
            +
              describe "not found" do
         | 
| 32 | 
            +
                let(:test_server)       { RecursiveOpenStruct.new({:name => 'hello', :id => '1234'}, :recurse_over_arrays => true) }
         | 
| 33 | 
            +
             | 
| 34 | 
            +
                it { expect{OnlineLabs::Server.find('not_found')}.to raise_error(OnlineLabs::NotFound) }
         | 
| 35 | 
            +
              end
         | 
| 36 | 
            +
             | 
| 37 | 
            +
            end
         | 
| 38 | 
            +
             | 
| 39 | 
            +
             | 
| 40 | 
            +
            describe OnlineLabs::Server do
         | 
| 41 | 
            +
              subject(:server) { described_class }
         | 
| 42 | 
            +
             | 
| 43 | 
            +
              before do
         | 
| 44 | 
            +
                stubs = Faraday::Adapter::Test::Stubs.new do |stub|
         | 
| 45 | 
            +
                  stub.get('/servers?state=running') { |env| [200, {}, {:servers => []}] }
         | 
| 46 | 
            +
                  stub.get('/servers?invalid_filter=42') { |env| [400, {}, {:type => 'invalid_filter', :message => 'invalid filter'}] }
         | 
| 47 | 
            +
                end
         | 
| 48 | 
            +
                OnlineLabs.request = Faraday.new do |builder|
         | 
| 49 | 
            +
                  builder.adapter :test, stubs
         | 
| 50 | 
            +
                end
         | 
| 51 | 
            +
              end
         | 
| 52 | 
            +
             | 
| 53 | 
            +
              describe "filter" do
         | 
| 54 | 
            +
                its(:all, state: 'running') { should eq [] }
         | 
| 55 | 
            +
              end
         | 
| 56 | 
            +
             | 
| 57 | 
            +
              describe "invalid filter" do
         | 
| 58 | 
            +
                it { expect{OnlineLabs::Server.all(invalid_filter: 42)}.to raise_error(OnlineLabs::APIError) }
         | 
| 59 | 
            +
              end
         | 
| 60 | 
            +
            end
         | 
    
        metadata
    ADDED
    
    | @@ -0,0 +1,141 @@ | |
| 1 | 
            +
            --- !ruby/object:Gem::Specification
         | 
| 2 | 
            +
            name: onlinelabs
         | 
| 3 | 
            +
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            +
              version: 0.1.1
         | 
| 5 | 
            +
            platform: ruby
         | 
| 6 | 
            +
            authors:
         | 
| 7 | 
            +
            - bchatelard
         | 
| 8 | 
            +
            autorequire: 
         | 
| 9 | 
            +
            bindir: bin
         | 
| 10 | 
            +
            cert_chain: []
         | 
| 11 | 
            +
            date: 2014-11-14 00:00:00.000000000 Z
         | 
| 12 | 
            +
            dependencies:
         | 
| 13 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 14 | 
            +
              name: faraday
         | 
| 15 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 16 | 
            +
                requirements:
         | 
| 17 | 
            +
                - - "~>"
         | 
| 18 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 19 | 
            +
                    version: '0.9'
         | 
| 20 | 
            +
              type: :runtime
         | 
| 21 | 
            +
              prerelease: false
         | 
| 22 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 23 | 
            +
                requirements:
         | 
| 24 | 
            +
                - - "~>"
         | 
| 25 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 26 | 
            +
                    version: '0.9'
         | 
| 27 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 28 | 
            +
              name: faraday_middleware
         | 
| 29 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 30 | 
            +
                requirements:
         | 
| 31 | 
            +
                - - "~>"
         | 
| 32 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 33 | 
            +
                    version: '0.9'
         | 
| 34 | 
            +
              type: :runtime
         | 
| 35 | 
            +
              prerelease: false
         | 
| 36 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 37 | 
            +
                requirements:
         | 
| 38 | 
            +
                - - "~>"
         | 
| 39 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 40 | 
            +
                    version: '0.9'
         | 
| 41 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 42 | 
            +
              name: recursive-open-struct
         | 
| 43 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 44 | 
            +
                requirements:
         | 
| 45 | 
            +
                - - "~>"
         | 
| 46 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 47 | 
            +
                    version: '0.5'
         | 
| 48 | 
            +
              type: :runtime
         | 
| 49 | 
            +
              prerelease: false
         | 
| 50 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 51 | 
            +
                requirements:
         | 
| 52 | 
            +
                - - "~>"
         | 
| 53 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 54 | 
            +
                    version: '0.5'
         | 
| 55 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 56 | 
            +
              name: rake
         | 
| 57 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 58 | 
            +
                requirements:
         | 
| 59 | 
            +
                - - "~>"
         | 
| 60 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 61 | 
            +
                    version: '10.1'
         | 
| 62 | 
            +
              type: :development
         | 
| 63 | 
            +
              prerelease: false
         | 
| 64 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 65 | 
            +
                requirements:
         | 
| 66 | 
            +
                - - "~>"
         | 
| 67 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 68 | 
            +
                    version: '10.1'
         | 
| 69 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 70 | 
            +
              name: rspec
         | 
| 71 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 72 | 
            +
                requirements:
         | 
| 73 | 
            +
                - - "~>"
         | 
| 74 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 75 | 
            +
                    version: '3.1'
         | 
| 76 | 
            +
              type: :development
         | 
| 77 | 
            +
              prerelease: false
         | 
| 78 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 79 | 
            +
                requirements:
         | 
| 80 | 
            +
                - - "~>"
         | 
| 81 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 82 | 
            +
                    version: '3.1'
         | 
| 83 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 84 | 
            +
              name: its
         | 
| 85 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 86 | 
            +
                requirements:
         | 
| 87 | 
            +
                - - "~>"
         | 
| 88 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 89 | 
            +
                    version: '0.2'
         | 
| 90 | 
            +
              type: :development
         | 
| 91 | 
            +
              prerelease: false
         | 
| 92 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 93 | 
            +
                requirements:
         | 
| 94 | 
            +
                - - "~>"
         | 
| 95 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 96 | 
            +
                    version: '0.2'
         | 
| 97 | 
            +
            description: Ruby bindings for the Online Labs API.
         | 
| 98 | 
            +
            email:
         | 
| 99 | 
            +
            - chatel.bast@gmail.com
         | 
| 100 | 
            +
            executables: []
         | 
| 101 | 
            +
            extensions: []
         | 
| 102 | 
            +
            extra_rdoc_files: []
         | 
| 103 | 
            +
            files:
         | 
| 104 | 
            +
            - ".gitignore"
         | 
| 105 | 
            +
            - ".travis.yml"
         | 
| 106 | 
            +
            - CHANGES.md
         | 
| 107 | 
            +
            - Gemfile
         | 
| 108 | 
            +
            - README.md
         | 
| 109 | 
            +
            - Rakefile
         | 
| 110 | 
            +
            - lib/onlinelabs.rb
         | 
| 111 | 
            +
            - lib/onlinelabs/version.rb
         | 
| 112 | 
            +
            - onlinelabs.gemspec
         | 
| 113 | 
            +
            - spec/onlinelabs_spec.rb
         | 
| 114 | 
            +
            - spec/servers_spec.rb
         | 
| 115 | 
            +
            homepage: http://github.com/bchatelard/onlinelabs-ruby
         | 
| 116 | 
            +
            licenses: []
         | 
| 117 | 
            +
            metadata: {}
         | 
| 118 | 
            +
            post_install_message: 
         | 
| 119 | 
            +
            rdoc_options: []
         | 
| 120 | 
            +
            require_paths:
         | 
| 121 | 
            +
            - lib
         | 
| 122 | 
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 123 | 
            +
              requirements:
         | 
| 124 | 
            +
              - - ">="
         | 
| 125 | 
            +
                - !ruby/object:Gem::Version
         | 
| 126 | 
            +
                  version: '0'
         | 
| 127 | 
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 128 | 
            +
              requirements:
         | 
| 129 | 
            +
              - - ">="
         | 
| 130 | 
            +
                - !ruby/object:Gem::Version
         | 
| 131 | 
            +
                  version: '0'
         | 
| 132 | 
            +
            requirements: []
         | 
| 133 | 
            +
            rubyforge_project: 
         | 
| 134 | 
            +
            rubygems_version: 2.2.2
         | 
| 135 | 
            +
            signing_key: 
         | 
| 136 | 
            +
            specification_version: 4
         | 
| 137 | 
            +
            summary: Ruby bindings for the Online Labs API.
         | 
| 138 | 
            +
            test_files:
         | 
| 139 | 
            +
            - spec/onlinelabs_spec.rb
         | 
| 140 | 
            +
            - spec/servers_spec.rb
         | 
| 141 | 
            +
            has_rdoc: 
         |