cachet_api 1.0.0 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MGEwZDNlNDRhMTIzOGEzNTAyNzZiMDg0ODkwOGNjNzhhZWQ2YWU4Ng==
4
+ ZGIxYWE0OGNhZDdjZTdiZDdhODExNzExYTM4NGI1YTI0YmY3MjY0Mw==
5
5
  data.tar.gz: !binary |-
6
- ZDJiMjlkOTU4MTBlYmYyMDM2MGExNzMyOTg3NGVlNTAyM2YwNDk2Ng==
6
+ Y2UwODhjYzZiM2ZhZjI3YWQ0NWEzNTc4Mzg2YTJjMDFiNzgzZjk1YQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NTcxYzVhNTJhYjkzZDcxYWZkNTkxN2NlMzIyMDZjMjY0NDFhYzJiYjkzMWM0
10
- MDBiYWI0MzRlZWNjNWJkM2NjZjc1YjVhMTA2NDRkMTE2NWZkZTgzNjMzNWI0
11
- ZWU0MDNiOTFjYzcwODlmNjA0ZWQwZjY2MTM1NmE1YmRkMzI2MmQ=
9
+ ZjcwYTc1MzI5ZmIzZWJlZWRhNGE5ODVhM2IzMjZmYmVmZDUxODQwMjFhOTlm
10
+ NmMzNGU5MDJjYWNiZGRjODBkOGUxYTAwNDljMWE3NTEyNDRjNzYxM2JkZmQ5
11
+ OTI5Y2Y5NjU3NDQxMWI3MzZkMjRmZWYzYTY0ZDU0MWJmOWFjODY=
12
12
  data.tar.gz: !binary |-
13
- NmNlOWU5ZDk0NTU4YjNlYzM4Zjc4NTJlYTFkM2ZlNmNkZDFkOWMwMzVlZTk3
14
- OWU4N2ZlMTQxZGFiMjFkMGMzMmI2MzcyMjkxNzFmMGI2MTU0MjVkMTVlMzli
15
- MDRjMDI5MjdlN2MxNGMzOWM1NWU0MWYxYmFiMmM0NzZkNTVjODk=
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 | N/A |
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 | N/A |
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 |
@@ -66,7 +66,8 @@ class CachetClient
66
66
  # @return object
67
67
 
68
68
  def request(params)
69
- response = RestClient::Request.execute(params.merge(headers: @headers))
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
  ##
@@ -3,5 +3,5 @@
3
3
  class CachetClient
4
4
  ##
5
5
  # Sets Version of gem
6
- VERSION = '1.0.0'
6
+ VERSION = '1.0.2'
7
7
  end
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.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-03-01 00:00:00.000000000 Z
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