GodaddyApi 0.2.0 → 0.3.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: 21880881f62b102080fcbcb001f5d5161700e271
4
- data.tar.gz: 6698a9aa0e07446ee9c00ff98f6ced0ad0857483
3
+ metadata.gz: a5939ed0c3daf94b61b90d345514ed6f88b61cbb
4
+ data.tar.gz: 6d439520091d365a428b2d065f2a39f2cee75897
5
5
  SHA512:
6
- metadata.gz: 8243bec9525412d956f99c469e1311652c3bc9769d2798ba7b41bfdfbc9e0811955eb4e1e2f83147eedf1911ed1b72fd27437d8718480720c078b2f08e509657
7
- data.tar.gz: e049681ee6c3a31561ce2f7020de7aa73bc7a8588e7f7ba4931a5d29b553ca9442d9179f4f75447b9b8ac97083908b543cfc6d729a902bb7ccb682fab0b51100
6
+ metadata.gz: e98c602de8410a515e505d312f34bf288ecc56d113a7f1c7eb3388105db7e140968a9d429c4aa936c98dcf47cd4b1120149c669bfb6d0cc4c7d7a0c045c9b940
7
+ data.tar.gz: 2af59e98eeac2be1e02d9e1edb4d2891b8c47280f6f45655f8c30eb9a69ebee8d394a27a9b8f61bf86a1359db203b4a98cfff3485c0ff064ff754369d5102b8e
data/Gemfile CHANGED
@@ -2,9 +2,4 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- gem "pry"
6
- gem 'faraday'
7
- gem 'kartograph'
8
- gem 'virtus'
9
- gem 'resource_kit'
10
- gem 'activesupport'
5
+ # gem "pry"
@@ -21,4 +21,11 @@ Gem::Specification.new do |spec|
21
21
 
22
22
  spec.add_development_dependency "bundler", "~> 1.8"
23
23
  spec.add_development_dependency "rake", "~> 10.0"
24
+ spec.add_development_dependency "pry"
25
+
26
+ spec.add_dependency "faraday"
27
+ spec.add_dependency "kartograph"
28
+ spec.add_dependency "virtus"
29
+ spec.add_dependency "resource_kit"
30
+ spec.add_dependency "activesupport"
24
31
  end
@@ -4,7 +4,6 @@ module GodaddyApi
4
4
 
5
5
  kartograph do
6
6
  mapping Server
7
- # TODO this ignores pagination
8
7
  root_key plural: 'results', scopes: [:read]
9
8
 
10
9
  property :serverId, scopes: [:read]
@@ -3,12 +3,6 @@ require 'virtus'
3
3
  module GodaddyApi
4
4
  class Base
5
5
  include Virtus.model
6
- # include Virtus::Equalizer.new(name || inspect)
7
-
8
- # def inspect
9
- # values = Hash[instance_variables.map { |name| [name, instance_variable_get(name)] } ]
10
- # "<#{self.class.name} #{values}>"
11
- # end
12
6
 
13
7
  # Shared by all json responses
14
8
  attribute :createdAt
@@ -5,11 +5,13 @@ module GodaddyApi
5
5
  attribute :spec
6
6
  attribute :privateIp
7
7
  attribute :username
8
+ attribute :password
8
9
  attribute :publicIp
9
10
  attribute :status
10
11
  attribute :taskState
11
12
  attribute :key
12
13
  attribute :hostname
13
14
  attribute :backups
15
+ attribute :bootScript
14
16
  end
15
17
  end
@@ -3,20 +3,18 @@ module GodaddyApi
3
3
  resources do
4
4
  default_handler { |response| raise "Unexpected response status #{response.status}... #{response.body}" }
5
5
 
6
- # TODO need to write this path version everywhere
7
6
  action :all, 'GET /v1/cloud/servers' do
8
- handler(200) { |response| GodaddyApi::ServerMapping.extract_collection(response.body, :read) }
7
+ handler(200) { |response| ServerMapping.extract_collection(response.body, :read) }
9
8
  end
10
9
 
11
10
  action :find, 'GET /v1/cloud/servers/:id' do
12
11
  handler(200) { |response| ServerMapping.extract_single(response.body, :read) }
12
+ handler(404) { |_| nil }
13
13
  end
14
14
 
15
- action :create, 'POST /v1/cloud/servers/servers' do
15
+ action :create, 'POST /v1/cloud/servers' do
16
16
  body { |object| ServerMapping.representation_for(:create, object) }
17
17
  handler(201) { |response| ServerMapping.extract_single(response.body, :read) }
18
- # Error handling
19
- # handler(422) { |response| ErrorMapping.fail_with(FailedCreate, response.body) }
20
18
  end
21
19
 
22
20
  action :actions, 'GET /v1/cloud/servers/:id/actions' do
@@ -24,15 +22,15 @@ module GodaddyApi
24
22
  end
25
23
 
26
24
  action :destroy, 'POST /v1/cloud/servers/:id/destroy' do
27
- handler(202) { |response| true }
25
+ handler(202) { |_| true }
28
26
  end
29
27
 
30
28
  action :start, 'POST /v1/cloud/servers/:id/start' do
31
- handler(200) { |response| true }
29
+ handler(202) { |_| true }
32
30
  end
33
31
 
34
32
  action :stop, 'POST /v1/cloud/servers/:id/stop' do
35
- handler(200) { |response| true }
33
+ handler(202) { |_| true }
36
34
  end
37
35
  end
38
36
  end
@@ -1,3 +1,3 @@
1
1
  module GodaddyApi
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.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.2.0
4
+ version: 0.3.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-13 00:00:00.000000000 Z
11
+ date: 2015-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,6 +38,90 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: pry
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: faraday
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: kartograph
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: virtus
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: resource_kit
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: activesupport
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
41
125
  description: A ruby library for interacting with the godaddy cloud api
42
126
  email:
43
127
  - c.liam.atherton@gmail.com