mackerel-rb 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 13f0b4c3384020b047ec6db18cf400ebc1f1f50a
4
- data.tar.gz: 5469963d923aa7dd9a43e7f2440d4ee75be5c29f
3
+ metadata.gz: c19b31d7c050515215a8986ad56b16a661d5babf
4
+ data.tar.gz: 0a56d5763b6faace8a6decaa397d03b4bf4beb31
5
5
  SHA512:
6
- metadata.gz: 04c0dcadaf22f81dfe419a87b9bdd4fa0afe7d1b518321686739ef9f65a074ecc1e8ac006987bd364a772e789af37caaa92e9f7aed185813ea97faae06cc1d25
7
- data.tar.gz: ac7c4952fd42d3544231ccae3a3d14dd4082a91a88f95a942ce1096b80a87e7226163579654d126664dd38b1a2fc594a83534aba3395de9ec1ac7c20e590bbe5
6
+ metadata.gz: 5ef2a13aabee093941ce19a7238674915021043c81a7284e6581f9fdb39c2b23382480e56de5ca6da3a7e1f5d45c0a7334680e7c06727546f5c54176a8d70e2e
7
+ data.tar.gz: 380144103d2be2a38bbf750446cc4279622e56f16cd8390efe64799dffca241d3e9cacf7a35af840bc72498ad0494dab96a8e427043a0196ad9728d6fd573f44
data/README.md CHANGED
@@ -71,10 +71,10 @@ end
71
71
 
72
72
  #### Dashboards
73
73
 
74
- - [ ] Creating Dashboards - `POST/api/v0/dashboards`
74
+ - [x] Creating Dashboards - `POST/api/v0/dashboards`
75
75
  - [x] Getting Dashboards - `GET/api/v0/dashboards/<dashboardId>`
76
- - [ ] Updating Dashboards - `PUT/api/v0/dashboards/<dashboardId>`
77
- - [ ] Deleting Dashboards - `DELETE/api/v0/dashboards/<dashboardId>`
76
+ - [x] Updating Dashboards - `PUT/api/v0/dashboards/<dashboardId>`
77
+ - [x] Deleting Dashboards - `DELETE/api/v0/dashboards/<dashboardId>`
78
78
  - [x] List of Dashboards - `GET/api/v0/dashboards`
79
79
 
80
80
  ## Contributing
@@ -7,7 +7,22 @@ module Mackerel
7
7
  end
8
8
 
9
9
  def dashboard(id)
10
- response = get 'dashboards', id
10
+ response = get "dashboards/#{id}"
11
+ response.body
12
+ end
13
+
14
+ def create_dashboard(params)
15
+ response = post 'dashboards', params
16
+ response.body
17
+ end
18
+
19
+ def update_dashboard(id, params)
20
+ response = put "dashboards/#{id}", params
21
+ response.body
22
+ end
23
+
24
+ def delete_dashboard(id)
25
+ response = delete "dashboards/#{id}"
11
26
  response.body
12
27
  end
13
28
  end
@@ -15,6 +15,19 @@ module Mackerel
15
15
  end
16
16
  end
17
17
 
18
+ def put(url, params = {})
19
+ connection.put(url) do |req|
20
+ req.headers['Content-Type'] = 'application/json'
21
+ req.body = params.to_json
22
+ end
23
+ end
24
+
25
+ def delete(url)
26
+ connection.delete(url) do |req|
27
+ req.headers['Content-Type'] = 'application/json'
28
+ end
29
+ end
30
+
18
31
  def request(method, url, params = {})
19
32
  connection.send(method, url, params)
20
33
  end
@@ -1,3 +1,3 @@
1
1
  module Mackerel
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mackerel-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - mizokami