Module: Fog::Hetznercloud::RequestHelper
- Included in:
- Compute::Real
- Defined in:
- lib/fog/hetznercloud/request_helper.rb
Instance Method Summary collapse
- #create(path, body) ⇒ Object
- #delete(path) ⇒ Object
- #get(path, query = {}) ⇒ Object
- #update(path, body) ⇒ Object
Instance Method Details
#create(path, body) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/fog/hetznercloud/request_helper.rb', line 4 def create(path, body) request(method: :post, path: "/v1#{path}", body: body, expects: [201]) end |
#delete(path) ⇒ Object
25 26 27 28 29 |
# File 'lib/fog/hetznercloud/request_helper.rb', line 25 def delete(path) request(method: :delete, path: "/v1#{path}", expects: [200, 204]) end |
#get(path, query = {}) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/fog/hetznercloud/request_helper.rb', line 11 def get(path, query = {}) request(method: :get, path: "/v1#{path}", query: query, expects: [200]) end |
#update(path, body) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/fog/hetznercloud/request_helper.rb', line 18 def update(path, body) request(method: :put, path: "/v1#{path}", body: body, expects: [200]) end |