runscope_statuspage 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f623754ab2431efc77d3156586e9428bf9c6a041
4
- data.tar.gz: da38e4e14eb39dd622305ace009acbc4a28e32cb
3
+ metadata.gz: 072d8026be2be560c5ea87d6a207440caade1bb6
4
+ data.tar.gz: fab756dc2cd925e61df9eaf4f8c63ce737b76a93
5
5
  SHA512:
6
- metadata.gz: 1645d2e82c35118601ed59b537a23245f8588b5a21ab78d95a01a6d2c882b364aad105ab1e8b9c681876d9b135a73b32785a8b8bcf3e25e519b19627ba00e227
7
- data.tar.gz: 00a5dab51f9214dedd4a334b6963b1db76e2f8ac0eb4a8d6cdcdbf885e45d08f1b72b66020c74656803aa239cff06fd2312252b3baaccd0a23c3986c1baf8fe7
6
+ metadata.gz: f87d62c2bfe99465ca9c4cca2c67cd5959eb5bc709fbb483edcf948c41698c485b6594eb4763d31719fe0b80f63ad3a6f701a60a6a18a0939406e775839b1318
7
+ data.tar.gz: f9c693e0c1c6272be2c8504c5222dd88e7f865016d20054895dcbfc1137158e2b31ebafb752e972116e98cda060448545feb754709983ef4d9212e8d278c654d
@@ -24,6 +24,12 @@ module RunscopeStatuspage
24
24
  end
25
25
  end
26
26
 
27
+ def bucket_id_by_name(name)
28
+ self.buckets.each do |bucket|
29
+ return bucket["key"] if bucket["name"] == name
30
+ end
31
+ end
32
+
27
33
  # Get list of radars for bucket
28
34
  def radars(bucket)
29
35
  radars = self.class.get("/buckets/#{bucket}/radar", @options)
@@ -59,6 +65,30 @@ module RunscopeStatuspage
59
65
  end
60
66
  end
61
67
  end
68
+
69
+ # Get latest messages
70
+ def messages(bucket, count)
71
+ messages = self.class.get("/buckets/#{bucket_id_by_name(bucket)}/messages?count=#{count}", @options)
72
+ if messages.has_key?('meta') and messages.has_key?('data')
73
+ if messages['meta']['status'] == 'success'
74
+ messages['data']
75
+ else
76
+ raise RunscopeAPIException.new, messages['error']
77
+ end
78
+ end
79
+ end
80
+
81
+ # Get message detail
82
+ def message_detail(bucket, message)
83
+ detail = self.class.get("/buckets/#{bucket}/messages/#{message}", @options)
84
+ if detail.has_key?('meta') and detail.has_key?('data')
85
+ if detail['meta']['status'] == 'success'
86
+ detail['data']
87
+ else
88
+ raise RunscopeAPIException.new, detail['error']
89
+ end
90
+ end
91
+ end
62
92
  end
63
93
 
64
94
  end
@@ -24,7 +24,7 @@ module RunscopeStatuspage
24
24
 
25
25
  # Publish data for a custom page metric
26
26
  def push_metric_data(page_id, metric_id, data, timestamp)
27
- self.class.post("/pages/#{page_id}/metrics/#{metric_id}/data.json", @options.merge!(data: {"data" => {
27
+ self.class.post("/pages/#{page_id}/metrics/#{metric_id}/data.json", @options.merge!(body: {"data" => {
28
28
  "value" => data,
29
29
  "timestamp" => timestamp
30
30
  }}))
@@ -1,3 +1,3 @@
1
1
  module RunscopeStatuspage
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runscope_statuspage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Stancu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-18 00:00:00.000000000 Z
11
+ date: 2015-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler