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 +4 -4
- data/README.md +0 -12
- data/lib/GodaddyApi/mappings/image_mapping.rb +1 -1
- data/lib/GodaddyApi/mappings/key_mapping.rb +1 -1
- data/lib/GodaddyApi/mappings/limit_mapping.rb +1 -1
- data/lib/GodaddyApi/mappings/spec_mapping.rb +1 -1
- data/lib/GodaddyApi/resources/image_resource.rb +9 -9
- data/lib/GodaddyApi/resources/key_resource.rb +4 -4
- data/lib/GodaddyApi/resources/limit_resource.rb +1 -1
- data/lib/GodaddyApi/resources/server_resource.rb +7 -11
- data/lib/GodaddyApi/resources/spec_resource.rb +2 -2
- data/lib/GodaddyApi/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21880881f62b102080fcbcb001f5d5161700e271
|
4
|
+
data.tar.gz: 6698a9aa0e07446ee9c00ff98f6ced0ad0857483
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 )
|
@@ -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
|
@@ -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(
|
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
|
data/lib/GodaddyApi/version.rb
CHANGED
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.
|
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
|
+
date: 2015-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|