GodaddyApi 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 744fbeef295434d8087b2b74c28ad054f4d28a36
4
- data.tar.gz: 5df7d3913ffdbe9e65085d09a664d6c13a897674
3
+ metadata.gz: 21880881f62b102080fcbcb001f5d5161700e271
4
+ data.tar.gz: 6698a9aa0e07446ee9c00ff98f6ced0ad0857483
5
5
  SHA512:
6
- metadata.gz: 433b5e657ae1fc9affa10b6afbf130fdfac8fe21d55d797caa775921cad13a103b4b8de89111c829a9ab447e4efb837b452eb65c4a79fd448e2929f057e0c529
7
- data.tar.gz: 5e89cf2b42db0e0d56169573134416bf6345c934b61ab6ea3d92bdea648b61cc38054a8a79a084fd1e919b14f029e24a2cf12ecaaf7eeac4a942aed6efa9b1e7
6
+ metadata.gz: 8243bec9525412d956f99c469e1311652c3bc9769d2798ba7b41bfdfbc9e0811955eb4e1e2f83147eedf1911ed1b72fd27437d8718480720c078b2f08e509657
7
+ data.tar.gz: e049681ee6c3a31561ce2f7020de7aa73bc7a8588e7f7ba4931a5d29b553ca9442d9179f4f75447b9b8ac97083908b543cfc6d729a902bb7ccb682fab0b51100
data/README.md CHANGED
@@ -1,9 +1,5 @@
1
1
  # GodaddyApi
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/GodaddyApi`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
6
-
7
3
  ## Installation
8
4
 
9
5
  Add this line to your application's Gemfile:
@@ -22,14 +18,6 @@ Or install it yourself as:
22
18
 
23
19
  ## Usage
24
20
 
25
- TODO: Write usage instructions here
26
-
27
- ## Development
28
-
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
30
-
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
-
33
21
  ## Contributing
34
22
 
35
23
  1. Fork it ( https://github.com/[my-github-username]/GodaddyApi/fork )
@@ -4,7 +4,7 @@ module GodaddyApi
4
4
 
5
5
  kartograph do
6
6
  mapping Image
7
- root_key plural: 'images', singular: 'image', scopes: [:read]
7
+ root_key plural: 'results', scopes: [:read]
8
8
 
9
9
  property :imageId, scopes: [:read]
10
10
  property :version, scopes: [:read]
@@ -4,7 +4,7 @@ module GodaddyApi
4
4
 
5
5
  kartograph do
6
6
  mapping Key
7
- root_key plural: 'keys', singular: 'key', scopes: [:read]
7
+ root_key plural: 'results', scopes: [:read]
8
8
 
9
9
  property :keyId, scopes: [:read]
10
10
  property :name, scopes: [:read]
@@ -4,7 +4,7 @@ module GodaddyApi
4
4
 
5
5
  kartograph do
6
6
  mapping Limit
7
- root_key plural: 'limits', singular: 'limits', scopes: [:read]
7
+ root_key plural: 'results', scopes: [:read]
8
8
 
9
9
  property :servers, scopes: [:read]
10
10
  property :snapshots, scopes: [:read]
@@ -4,7 +4,7 @@ module GodaddyApi
4
4
 
5
5
  kartograph do
6
6
  mapping Spec
7
- root_key plural: 'specs', singular: 'spec', scopes: [:read]
7
+ root_key plural: 'results', scopes: [:read]
8
8
 
9
9
  property :specId, scopes: [:read]
10
10
  property :name, scopes: [:read]
@@ -1,26 +1,26 @@
1
1
  module GodaddyApi
2
2
  class ImageResource < ResourceKit::Resource
3
3
  resources do
4
- action :all, 'GET /images' do
5
- handler(200) { |response| ImageMapping.extract_collection(response.body, :read) }
4
+ action :all, 'GET /v1/cloud/images' do
5
+ handler(200) { |response| GodaddyApi::ImageMapping.extract_collection(response.body, :read) }
6
6
  end
7
7
 
8
- action :find, 'GET /images/:id' do
9
- handler(200) { |response| ImageMapping.extract_single(response.body, :read) }
8
+ action :find, 'GET /v1/cloud/images/:id' do
9
+ handler(200) { |response| GodaddyApi::ImageMapping.extract_single(response.body, :read) }
10
10
  end
11
11
 
12
- action :create, 'POST /images' do
13
- body { |object| ImageMapping.representation_for(:create, object) }
14
- handler(201) { |response| ImageMapping.extract_single(response.body, :read) }
12
+ action :create, 'POST /v1/cloud/images' do
13
+ body { |object| GodaddyApi::ImageMapping.representation_for(:create, object) }
14
+ handler(201) { |response| GodaddyApi::ImageMapping.extract_single(response.body, :read) }
15
15
  # Error handling
16
16
  # handler(422) { |response| ErrorMapping.fail_with(FailedCreate, response.body) }
17
17
  end
18
18
 
19
- action :actions, 'GET /images/:id/actions' do
19
+ action :actions, 'GET /v1/cloud/images/:id/actions' do
20
20
  handler(200) { |response| ActionMapping.extract_collection(response.body, :read) }
21
21
  end
22
22
 
23
- action :destroy, 'POST /images/:id/destroy' do
23
+ action :destroy, 'POST /v1/cloud/images/:id/destroy' do
24
24
  handler(204) { |response| true }
25
25
  end
26
26
  end
@@ -1,22 +1,22 @@
1
1
  module GodaddyApi
2
2
  class KeyResource < ResourceKit::Resource
3
3
  resources do
4
- action :all, 'GET /keys' do
4
+ action :all, 'GET /v1/cloud/keys' do
5
5
  handler(200) { |response| KeyMapping.extract_collection(response.body, :read) }
6
6
  end
7
7
 
8
- action :find, 'GET /keys/:id' do
8
+ action :find, 'GET /v1/cloud/keys/:id' do
9
9
  handler(200) { |response| KeyMapping.extract_single(response.body, :read) }
10
10
  end
11
11
 
12
- action :create, 'POST /keys' do
12
+ action :create, 'POST /v1/cloud/keys' do
13
13
  body { |object| KeyMapping.representation_for(:create, object) }
14
14
  handler(201) { |response| KeyMapping.extract_single(response.body, :read) }
15
15
  # Error handling
16
16
  # handler(422) { |response| ErrorMapping.fail_with(FailedCreate, response.body) }
17
17
  end
18
18
 
19
- action :destroy, 'DELETE /keys/:id' do
19
+ action :destroy, 'DELETE /v1/cloud/keys/:id' do
20
20
  handler(204) { |response| true }
21
21
  end
22
22
  end
@@ -1,7 +1,7 @@
1
1
  module GodaddyApi
2
2
  class LimitResource < ResourceKit::Resource
3
3
  resources do
4
- action :all, 'GET /limits' do
4
+ action :all, 'GET /v1/cloud/limits' do
5
5
  handler(200) { |response| LimitMapping.extract_single(response.body, :read) }
6
6
  end
7
7
  end
@@ -8,36 +8,32 @@ module GodaddyApi
8
8
  handler(200) { |response| GodaddyApi::ServerMapping.extract_collection(response.body, :read) }
9
9
  end
10
10
 
11
- action :find, 'GET servers/:id' do
11
+ action :find, 'GET /v1/cloud/servers/:id' do
12
12
  handler(200) { |response| ServerMapping.extract_single(response.body, :read) }
13
13
  end
14
14
 
15
- action :create, 'POST servers' do
15
+ action :create, 'POST /v1/cloud/servers/servers' do
16
16
  body { |object| ServerMapping.representation_for(:create, object) }
17
17
  handler(201) { |response| ServerMapping.extract_single(response.body, :read) }
18
18
  # Error handling
19
19
  # handler(422) { |response| ErrorMapping.fail_with(FailedCreate, response.body) }
20
20
  end
21
21
 
22
- action :actions, 'GET servers/:id/actions' do
22
+ action :actions, 'GET /v1/cloud/servers/:id/actions' do
23
23
  handler(200) { |response| ActionMapping.extract_collection(response.body, :read) }
24
24
  end
25
25
 
26
- action :destroy, 'POST servers/:id/destroy' do
27
- handler(204) { |response| true }
26
+ action :destroy, 'POST /v1/cloud/servers/:id/destroy' do
27
+ handler(202) { |response| true }
28
28
  end
29
29
 
30
- action :start, 'POST servers/:id/start' do
30
+ action :start, 'POST /v1/cloud/servers/:id/start' do
31
31
  handler(200) { |response| true }
32
32
  end
33
33
 
34
- action :stop, 'POST servers/:id/stop' do
34
+ action :stop, 'POST /v1/cloud/servers/:id/stop' do
35
35
  handler(200) { |response| true }
36
36
  end
37
37
  end
38
-
39
- # def all(*args)
40
- # GodaddyApi::PaginatedResource.new(action(:all), self, *args)
41
- # end
42
38
  end
43
39
  end
@@ -1,11 +1,11 @@
1
1
  module GodaddyApi
2
2
  class SpecResource < ResourceKit::Resource
3
3
  resources do
4
- action :all, 'GET /specs' do
4
+ action :all, 'GET /v1/cloud/specs' do
5
5
  handler(200) { |response| SpecMapping.extract_collection(response.body, :read) }
6
6
  end
7
7
 
8
- action :find, 'GET /specs/:id' do
8
+ action :find, 'GET /v1/cloud/specs/:id' do
9
9
  handler(200) { |response| SpecMapping.extract_single(response.body, :read) }
10
10
  end
11
11
  end
@@ -1,3 +1,3 @@
1
1
  module GodaddyApi
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: GodaddyApi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Connor Atherton
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-04-11 00:00:00.000000000 Z
11
+ date: 2015-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler