Module: Mackerel::REST::Metadata
- Included in:
- Client
- Defined in:
- lib/mackerel/metadata.rb
Instance Method Summary collapse
- #delete_metadata(host_id, namespace) ⇒ Object
- #get_metadata(host_id, namespace) ⇒ Object
- #list_metadata(host_id) ⇒ Object
- #update_metadata(host_id, namespace, metadata) ⇒ Object
Instance Method Details
#delete_metadata(host_id, namespace) ⇒ Object
20 21 22 23 |
# File 'lib/mackerel/metadata.rb', line 20 def (host_id, namespace) command = ApiCommand.new(:delete, "/api/v0/hosts/#{host_id}/metadata/#{namespace}", @api_key) command.execute(client) end |
#get_metadata(host_id, namespace) ⇒ Object
4 5 6 7 |
# File 'lib/mackerel/metadata.rb', line 4 def (host_id, namespace) command = ApiCommand.new(:get, "/api/v0/hosts/#{host_id}/metadata/#{namespace}", @api_key) command.execute(client) end |
#list_metadata(host_id) ⇒ Object
9 10 11 12 |
# File 'lib/mackerel/metadata.rb', line 9 def (host_id) command = ApiCommand.new(:get, "/api/v0/hosts/#{host_id}/metadata", @api_key) command.execute(client) end |
#update_metadata(host_id, namespace, metadata) ⇒ Object
14 15 16 17 18 |
# File 'lib/mackerel/metadata.rb', line 14 def (host_id, namespace, ) command = ApiCommand.new(:put, "/api/v0/hosts/#{host_id}/metadata/#{namespace}", @api_key) command.body = .to_json command.execute(client) end |