xstreamly 0.6.7 → 0.6.8

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.
Files changed (2) hide show
  1. data/lib/xstreamly.rb +39 -0
  2. metadata +3 -3
data/lib/xstreamly.rb CHANGED
@@ -141,6 +141,45 @@ module XStreamly
141
141
  raise RuntimeError, "Unknown error (status code #{response.code} ): #{response.body}"
142
142
  end
143
143
  end
144
+
145
+ def activeChannels()
146
+ req = Net::HTTP::Get.new(URI.encode('/api/v1.1/'+@appKey+'/activeChannels'), initheader = {'Content-Type' =>'application/json'})
147
+ req.basic_auth @email, @password
148
+ response = @http.request(req)
149
+
150
+ case response.code.to_i
151
+ when 200..299
152
+ return (JSON(response.body))['channels']
153
+ else
154
+ raise RuntimeError, "Unknown error (status code #{response.code} ): #{response.body}"
155
+ end
156
+ end
157
+
158
+ def usageConnections()
159
+ req = Net::HTTP::Get.new(URI.encode('/usage/connections'), initheader = {'Content-Type' =>'application/json'})
160
+ req.basic_auth @email, @password
161
+ response = @http.request(req)
162
+
163
+ case response.code.to_i
164
+ when 200..299
165
+ return (JSON(response.body))['data']
166
+ else
167
+ raise RuntimeError, "Unknown error (status code #{response.code} ): #{response.body}"
168
+ end
169
+ end
170
+
171
+ def usageMessages()
172
+ req = Net::HTTP::Get.new(URI.encode('/usage/messages'), initheader = {'Content-Type' =>'application/json'})
173
+ req.basic_auth @email, @password
174
+ response = @http.request(req)
175
+
176
+ case response.code.to_i
177
+ when 200..299
178
+ return (JSON(response.body))['data']
179
+ else
180
+ raise RuntimeError, "Unknown error (status code #{response.code} ): #{response.body}"
181
+ end
182
+ end
144
183
 
145
184
  end
146
185
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xstreamly
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 7
10
- version: 0.6.7
9
+ - 8
10
+ version: 0.6.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Brian Willard