cachet_api 1.0.0 → 1.0.2
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 +8 -8
- data/README.md +4 -2
- data/lib/cachet.rb +8 -5
- data/lib/cachet/rb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZGIxYWE0OGNhZDdjZTdiZDdhODExNzExYTM4NGI1YTI0YmY3MjY0Mw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Y2UwODhjYzZiM2ZhZjI3YWQ0NWEzNTc4Mzg2YTJjMDFiNzgzZjk1YQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZjcwYTc1MzI5ZmIzZWJlZWRhNGE5ODVhM2IzMjZmYmVmZDUxODQwMjFhOTlm
|
10
|
+
NmMzNGU5MDJjYWNiZGRjODBkOGUxYTAwNDljMWE3NTEyNDRjNzYxM2JkZmQ5
|
11
|
+
OTI5Y2Y5NjU3NDQxMWI3MzZkMjRmZWYzYTY0ZDU0MWJmOWFjODY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
Nzg5ZDNlOWNjNjYxMzk3YjExNGI0MjE2MTQyNjkyMzlkOTgwYWY5ODAxMjgx
|
14
|
+
Yzg3NDlmMjFiMzMxYjc5ZDJkYzAwYWI0NGI3YzJhNGEyNGI4Zjc3YTg5NzMz
|
15
|
+
OTE2YTRiZTE3M2JlNTA1NGIzNWM3ZTg5NDQ1YmY4NjgyOTNhMTg=
|
data/README.md
CHANGED
@@ -27,6 +27,8 @@ $ gem install cachet_api
|
|
27
27
|
```ruby
|
28
28
|
# Under your profile in Cachet, get your api_key from the API Token section. Base url is https://demo.cachethq.io/api/v1/ or https://cachet.yourdomain.com/api/v1/
|
29
29
|
|
30
|
+
require 'cachet' # have an issue open to fix this, will force v2.0.0
|
31
|
+
|
30
32
|
CachetClient = CachetClient.new(api_key, base_url)
|
31
33
|
CachetComponents = CachetComponents.new(api_key, base_url)
|
32
34
|
CachetIncidents = CachetIncidents.new(api_key, base_url)
|
@@ -49,7 +51,7 @@ get/ping | CachetClient.ping | N/A |
|
|
49
51
|
|
50
52
|
Cachet API | Ruby Library | Options/Params (R) == Required
|
51
53
|
:--------------------------- | :------------------------------ | :-------------------------------------------------------------------------------
|
52
|
-
get/components | CachetComponents.list |
|
54
|
+
get/components | CachetComponents.list | Options (hash) : id, name, status, group_id, enabled |
|
53
55
|
get/components/:id | CachetComponents.list_id | Options (hash) : id |
|
54
56
|
post/components | CachetComponents.create | Options (hash) : name(R), status(R), description, link, order, group_id, enabled |
|
55
57
|
put/components/:id | CachetComponents.update | Options (hash) : id(R), status(R), name(R), link, order, group_id, enabled |
|
@@ -64,7 +66,7 @@ delete/components/groups/:id | CachetComponents.groups_delete | Options (hash)
|
|
64
66
|
|
65
67
|
Cachet API | Ruby Library | Options/Params (R) == Required
|
66
68
|
:------------------- | :---------------------- | :--------------------------------------------------------------------------------------------------
|
67
|
-
get/incidents | CachetIncidents.list |
|
69
|
+
get/incidents | CachetIncidents.list | Options (hash) : id, component_id, name, status, visible |
|
68
70
|
get/incidents/:id | CachetIncidents.list_id | Options (hash) : id |
|
69
71
|
post/incidents | CachetIncidents.create | Options (hash) : name(R), message(R), status(R), visible(R), component_id, component_status, notify |
|
70
72
|
put/incidents/:id | CachetIncidents.update | Options (hash) : id(R), name, message, status, visible, component_id, component_status, notify |
|
data/lib/cachet.rb
CHANGED
@@ -66,7 +66,8 @@ class CachetClient
|
|
66
66
|
# @return object
|
67
67
|
|
68
68
|
def request(params)
|
69
|
-
|
69
|
+
headers = params[:headers] ? @headers.merge(params[:headers]) : @headers
|
70
|
+
response = RestClient::Request.execute(params.merge(headers: headers))
|
70
71
|
code = response.code
|
71
72
|
|
72
73
|
if response.code == 200
|
@@ -99,9 +100,10 @@ class CachetComponents < CachetClient
|
|
99
100
|
#
|
100
101
|
# @return object
|
101
102
|
|
102
|
-
def list
|
103
|
+
def list(options = nil)
|
103
104
|
request method: :get,
|
104
|
-
url: @base_url + 'components'
|
105
|
+
url: @base_url + 'components',
|
106
|
+
headers: {params: options}
|
105
107
|
end
|
106
108
|
|
107
109
|
##
|
@@ -232,9 +234,10 @@ class CachetIncidents < CachetClient
|
|
232
234
|
#
|
233
235
|
# @return object
|
234
236
|
|
235
|
-
def list
|
237
|
+
def list(options = nil)
|
236
238
|
request method: :get,
|
237
|
-
url: @base_url + 'incidents'
|
239
|
+
url: @base_url + 'incidents',
|
240
|
+
headers: {params: options}
|
238
241
|
end
|
239
242
|
|
240
243
|
##
|
data/lib/cachet/rb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cachet_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TheFynx
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: codeclimate-test-reporter
|