wsc_sdk 1.3.1

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 (265) hide show
  1. checksums.yaml +7 -0
  2. data/.circleci/config.yml +146 -0
  3. data/.circleci/docker/build/Dockerfile +3 -0
  4. data/.circleci/helpers/add_preamble.rb +29 -0
  5. data/.circleci/helpers/build_docs.sh +5 -0
  6. data/.circleci/helpers/build_gem.sh +5 -0
  7. data/.circleci/helpers/debundle-context.sh +14 -0
  8. data/.circleci/helpers/finalize_release.sh +24 -0
  9. data/.circleci/helpers/publish_docs.sh +10 -0
  10. data/.circleci/helpers/release_gem.sh +8 -0
  11. data/.circleci/helpers/setup.sh +11 -0
  12. data/.circleci/helpers/setup_aws.sh +13 -0
  13. data/.circleci/helpers/setup_gem.sh +2 -0
  14. data/.circleci/helpers/setup_git.sh +27 -0
  15. data/.circleci/helpers/setup_rubygems.sh +15 -0
  16. data/.circleci/helpers/test_integration.sh +12 -0
  17. data/.circleci/helpers/test_unit.sh +6 -0
  18. data/.circleci/jobs/publish-production.sh +17 -0
  19. data/.circleci/jobs/publish-staging.sh +17 -0
  20. data/.circleci/jobs/release-production.sh +21 -0
  21. data/.circleci/jobs/test-integration.sh +9 -0
  22. data/.circleci/jobs/test-unit.sh +9 -0
  23. data/.circleci/tag_repo.rb +46 -0
  24. data/.gitignore +28 -0
  25. data/.rspec +2 -0
  26. data/.yard/config +2 -0
  27. data/.yard/template/default/fulldoc/html/css/custom.css +151 -0
  28. data/.yard/template/default/layout/html/footer.erb +0 -0
  29. data/.yard/template/default/layout/html/headers.erb +10 -0
  30. data/.yard/template/default/layout/html/layout.erb +45 -0
  31. data/.yard/template/default/layout/html/setup.rb +24 -0
  32. data/.yardopts +1 -0
  33. data/CODE_OF_CONDUCT.md +74 -0
  34. data/Gemfile +6 -0
  35. data/Gemfile.lock +99 -0
  36. data/LICENSE.txt +28 -0
  37. data/README.md +397 -0
  38. data/Rakefile +2 -0
  39. data/bin/console +14 -0
  40. data/bin/setup +8 -0
  41. data/doc/Hash.html +291 -0
  42. data/doc/WscSdk.html +570 -0
  43. data/doc/WscSdk/ApiResponse.html +242 -0
  44. data/doc/WscSdk/Attributes.html +128 -0
  45. data/doc/WscSdk/Attributes/Mode.html +191 -0
  46. data/doc/WscSdk/Attributes/Type.html +389 -0
  47. data/doc/WscSdk/Client.html +2677 -0
  48. data/doc/WscSdk/Configuration.html +595 -0
  49. data/doc/WscSdk/Endpoint.html +2974 -0
  50. data/doc/WscSdk/Endpoints.html +141 -0
  51. data/doc/WscSdk/Endpoints/CustomStreamTargets.html +383 -0
  52. data/doc/WscSdk/Endpoints/LiveStreams.html +197 -0
  53. data/doc/WscSdk/Endpoints/OutputStreamTargets.html +180 -0
  54. data/doc/WscSdk/Endpoints/Outputs.html +180 -0
  55. data/doc/WscSdk/Endpoints/StreamTargets.html +446 -0
  56. data/doc/WscSdk/Endpoints/Transcoders.html +197 -0
  57. data/doc/WscSdk/Endpoints/UllStreamTargets.html +383 -0
  58. data/doc/WscSdk/Endpoints/WowzaStreamTargets.html +383 -0
  59. data/doc/WscSdk/Enum.html +225 -0
  60. data/doc/WscSdk/Enums.html +321 -0
  61. data/doc/WscSdk/Enums/BillingMode.html +188 -0
  62. data/doc/WscSdk/Enums/BroadcastLocation.html +396 -0
  63. data/doc/WscSdk/Enums/BufferSize.html +301 -0
  64. data/doc/WscSdk/Enums/ClosedCaptionType.html +221 -0
  65. data/doc/WscSdk/Enums/CustomProvider.html +252 -0
  66. data/doc/WscSdk/Enums/DeliveryMethod.html +188 -0
  67. data/doc/WscSdk/Enums/DeliveryType.html +188 -0
  68. data/doc/WscSdk/Enums/Encoder.html +460 -0
  69. data/doc/WscSdk/Enums/Errors.html +555 -0
  70. data/doc/WscSdk/Enums/IdleTimeout.html +398 -0
  71. data/doc/WscSdk/Enums/ImagePosition.html +220 -0
  72. data/doc/WscSdk/Enums/ModelMode.html +175 -0
  73. data/doc/WscSdk/Enums/ModelType.html +373 -0
  74. data/doc/WscSdk/Enums/PlayerType.html +188 -0
  75. data/doc/WscSdk/Enums/Protocol.html +204 -0
  76. data/doc/WscSdk/Enums/TargetDeliveryProtocol.html +188 -0
  77. data/doc/WscSdk/Enums/TranscoderType.html +188 -0
  78. data/doc/WscSdk/Enums/UserRegion.html +383 -0
  79. data/doc/WscSdk/Enums/WowzaProvider.html +188 -0
  80. data/doc/WscSdk/Errors.html +683 -0
  81. data/doc/WscSdk/Loggable.html +346 -0
  82. data/doc/WscSdk/Model.html +3316 -0
  83. data/doc/WscSdk/ModelList.html +442 -0
  84. data/doc/WscSdk/ModelTemplate.html +267 -0
  85. data/doc/WscSdk/Models.html +141 -0
  86. data/doc/WscSdk/Models/CustomStreamTarget.html +192 -0
  87. data/doc/WscSdk/Models/Error.html +351 -0
  88. data/doc/WscSdk/Models/LiveStream.html +601 -0
  89. data/doc/WscSdk/Models/LiveStreamConnectionCode.html +192 -0
  90. data/doc/WscSdk/Models/LiveStreamState.html +200 -0
  91. data/doc/WscSdk/Models/LiveStreamStats.html +200 -0
  92. data/doc/WscSdk/Models/LiveStreamThumbnailUrl.html +200 -0
  93. data/doc/WscSdk/Models/Output.html +294 -0
  94. data/doc/WscSdk/Models/OutputStreamTarget.html +274 -0
  95. data/doc/WscSdk/Models/StreamTarget.html +273 -0
  96. data/doc/WscSdk/Models/Transcoder.html +793 -0
  97. data/doc/WscSdk/Models/TranscoderBooleanStat.html +278 -0
  98. data/doc/WscSdk/Models/TranscoderConnectionCode.html +192 -0
  99. data/doc/WscSdk/Models/TranscoderFloatStat.html +278 -0
  100. data/doc/WscSdk/Models/TranscoderIntegerStat.html +278 -0
  101. data/doc/WscSdk/Models/TranscoderState.html +196 -0
  102. data/doc/WscSdk/Models/TranscoderStats.html +196 -0
  103. data/doc/WscSdk/Models/TranscoderStreamTargetState.html +192 -0
  104. data/doc/WscSdk/Models/TranscoderStringStat.html +278 -0
  105. data/doc/WscSdk/Models/TranscoderThumbnailUrl.html +196 -0
  106. data/doc/WscSdk/Models/UllStreamTarget.html +360 -0
  107. data/doc/WscSdk/Models/WowzaStreamTarget.html +380 -0
  108. data/doc/WscSdk/Pagination.html +1277 -0
  109. data/doc/WscSdk/Schema.html +861 -0
  110. data/doc/WscSdk/SchemaAttribute.html +2400 -0
  111. data/doc/WscSdk/Templates.html +141 -0
  112. data/doc/WscSdk/Templates/CustomStreamTarget.html +1045 -0
  113. data/doc/WscSdk/Templates/LiveStream.html +1432 -0
  114. data/doc/WscSdk/Templates/Output.html +829 -0
  115. data/doc/WscSdk/Templates/Transcoder.html +699 -0
  116. data/doc/WscSdk/Templates/UllStreamTarget.html +411 -0
  117. data/doc/WscSdk/Templates/WowzaStreamTarget.html +447 -0
  118. data/doc/WscSdk/TranscoderSharedMethods.html +1113 -0
  119. data/doc/_index.html +705 -0
  120. data/doc/class_list.html +51 -0
  121. data/doc/css/bootstrap.css +5 -0
  122. data/doc/css/common.css +1 -0
  123. data/doc/css/custom.css +151 -0
  124. data/doc/css/full_list.css +58 -0
  125. data/doc/css/style.css +496 -0
  126. data/doc/file.README.html +570 -0
  127. data/doc/file_list.html +56 -0
  128. data/doc/frames.html +17 -0
  129. data/doc/images/wsc-ruby-1800x400.png +0 -0
  130. data/doc/index.html +570 -0
  131. data/doc/js/app.js +292 -0
  132. data/doc/js/full_list.js +216 -0
  133. data/doc/js/jquery.js +4 -0
  134. data/doc/method_list.html +1731 -0
  135. data/doc/top-level-namespace.html +182 -0
  136. data/examples/client.rb +40 -0
  137. data/examples/helpers.rb +100 -0
  138. data/examples/live_streams/create.rb +39 -0
  139. data/examples/live_streams/delete.rb +32 -0
  140. data/examples/live_streams/find.rb +22 -0
  141. data/examples/live_streams/flood.rb +126 -0
  142. data/examples/live_streams/list.rb +24 -0
  143. data/examples/live_streams/regenerate_connection_code.rb +29 -0
  144. data/examples/live_streams/reset.rb +32 -0
  145. data/examples/live_streams/reset_and_wait.rb +51 -0
  146. data/examples/live_streams/start.rb +33 -0
  147. data/examples/live_streams/start_and_wait.rb +51 -0
  148. data/examples/live_streams/state.rb +33 -0
  149. data/examples/live_streams/stats.rb +43 -0
  150. data/examples/live_streams/stop.rb +33 -0
  151. data/examples/live_streams/stop_and_wait.rb +51 -0
  152. data/examples/live_streams/thumbnail_url.rb +46 -0
  153. data/examples/live_streams/update.rb +43 -0
  154. data/examples/live_streams/workflow.rb +165 -0
  155. data/examples/output_stream_targets/create.rb +56 -0
  156. data/examples/output_stream_targets/delete.rb +45 -0
  157. data/examples/output_stream_targets/find.rb +37 -0
  158. data/examples/output_stream_targets/list.rb +36 -0
  159. data/examples/output_stream_targets/update.rb +56 -0
  160. data/examples/outputs/create.rb +49 -0
  161. data/examples/outputs/delete.rb +39 -0
  162. data/examples/outputs/find.rb +31 -0
  163. data/examples/outputs/list.rb +29 -0
  164. data/examples/outputs/update.rb +50 -0
  165. data/examples/stream_targets/custom/create.rb +42 -0
  166. data/examples/stream_targets/custom/delete.rb +31 -0
  167. data/examples/stream_targets/custom/find.rb +23 -0
  168. data/examples/stream_targets/custom/list.rb +24 -0
  169. data/examples/stream_targets/custom/update.rb +43 -0
  170. data/examples/stream_targets/list.rb +24 -0
  171. data/examples/stream_targets/ull/create.rb +41 -0
  172. data/examples/stream_targets/ull/delete.rb +31 -0
  173. data/examples/stream_targets/ull/find.rb +23 -0
  174. data/examples/stream_targets/ull/list.rb +24 -0
  175. data/examples/stream_targets/ull/update.rb +43 -0
  176. data/examples/stream_targets/wowza/create.rb +42 -0
  177. data/examples/stream_targets/wowza/delete.rb +31 -0
  178. data/examples/stream_targets/wowza/find.rb +23 -0
  179. data/examples/stream_targets/wowza/list.rb +23 -0
  180. data/examples/stream_targets/wowza/update.rb +43 -0
  181. data/examples/transcoders/create.rb +39 -0
  182. data/examples/transcoders/delete.rb +31 -0
  183. data/examples/transcoders/find.rb +23 -0
  184. data/examples/transcoders/list.rb +24 -0
  185. data/examples/transcoders/reset.rb +32 -0
  186. data/examples/transcoders/reset_and_wait.rb +48 -0
  187. data/examples/transcoders/start.rb +33 -0
  188. data/examples/transcoders/start_and_wait.rb +50 -0
  189. data/examples/transcoders/state.rb +33 -0
  190. data/examples/transcoders/stats.rb +43 -0
  191. data/examples/transcoders/stop.rb +33 -0
  192. data/examples/transcoders/stop_and_wait.rb +50 -0
  193. data/examples/transcoders/thumbnail_url.rb +46 -0
  194. data/examples/transcoders/update.rb +43 -0
  195. data/images/wsc-ruby-1800x400.png +0 -0
  196. data/lib/wsc_sdk.rb +81 -0
  197. data/lib/wsc_sdk/client.rb +417 -0
  198. data/lib/wsc_sdk/configuration.rb +21 -0
  199. data/lib/wsc_sdk/constants.rb +29 -0
  200. data/lib/wsc_sdk/endpoint.rb +492 -0
  201. data/lib/wsc_sdk/endpoints/custom_stream_targets.rb +44 -0
  202. data/lib/wsc_sdk/endpoints/live_streams.rb +34 -0
  203. data/lib/wsc_sdk/endpoints/output_stream_targets.rb +17 -0
  204. data/lib/wsc_sdk/endpoints/outputs.rb +17 -0
  205. data/lib/wsc_sdk/endpoints/stream_targets.rb +45 -0
  206. data/lib/wsc_sdk/endpoints/transcoders.rb +38 -0
  207. data/lib/wsc_sdk/endpoints/ull_stream_targets.rb +44 -0
  208. data/lib/wsc_sdk/endpoints/wowza_stream_targets.rb +44 -0
  209. data/lib/wsc_sdk/enums.rb +31 -0
  210. data/lib/wsc_sdk/enums/billing_mode.rb +20 -0
  211. data/lib/wsc_sdk/enums/broadcast_location.rb +58 -0
  212. data/lib/wsc_sdk/enums/buffer_size.rb +41 -0
  213. data/lib/wsc_sdk/enums/closed_caption_type.rb +26 -0
  214. data/lib/wsc_sdk/enums/custom_provider.rb +32 -0
  215. data/lib/wsc_sdk/enums/delivery_method.rb +20 -0
  216. data/lib/wsc_sdk/enums/delivery_type.rb +20 -0
  217. data/lib/wsc_sdk/enums/encoder.rb +71 -0
  218. data/lib/wsc_sdk/enums/idle_timeout.rb +50 -0
  219. data/lib/wsc_sdk/enums/image_position.rb +26 -0
  220. data/lib/wsc_sdk/enums/player_type.rb +20 -0
  221. data/lib/wsc_sdk/enums/protocol.rb +23 -0
  222. data/lib/wsc_sdk/enums/target_delivery_protocol.rb +20 -0
  223. data/lib/wsc_sdk/enums/transcoder_type.rb +20 -0
  224. data/lib/wsc_sdk/enums/wowza_provider.rb +20 -0
  225. data/lib/wsc_sdk/errors.rb +115 -0
  226. data/lib/wsc_sdk/model.rb +515 -0
  227. data/lib/wsc_sdk/model_list.rb +42 -0
  228. data/lib/wsc_sdk/model_template.rb +27 -0
  229. data/lib/wsc_sdk/models/custom_stream_target.rb +34 -0
  230. data/lib/wsc_sdk/models/error.rb +53 -0
  231. data/lib/wsc_sdk/models/live_stream.rb +130 -0
  232. data/lib/wsc_sdk/models/live_stream_connection_code.rb +31 -0
  233. data/lib/wsc_sdk/models/live_stream_state.rb +20 -0
  234. data/lib/wsc_sdk/models/live_stream_stats.rb +20 -0
  235. data/lib/wsc_sdk/models/live_stream_thumbnail_url.rb +20 -0
  236. data/lib/wsc_sdk/models/output.rb +61 -0
  237. data/lib/wsc_sdk/models/output_stream_target.rb +37 -0
  238. data/lib/wsc_sdk/models/stream_target.rb +29 -0
  239. data/lib/wsc_sdk/models/transcoder.rb +135 -0
  240. data/lib/wsc_sdk/models/transcoder_boolean_stat.rb +41 -0
  241. data/lib/wsc_sdk/models/transcoder_connection_code.rb +29 -0
  242. data/lib/wsc_sdk/models/transcoder_float_stat.rb +40 -0
  243. data/lib/wsc_sdk/models/transcoder_integer_stat.rb +40 -0
  244. data/lib/wsc_sdk/models/transcoder_state.rb +31 -0
  245. data/lib/wsc_sdk/models/transcoder_stats.rb +51 -0
  246. data/lib/wsc_sdk/models/transcoder_stream_target_state.rb +29 -0
  247. data/lib/wsc_sdk/models/transcoder_string_stat.rb +40 -0
  248. data/lib/wsc_sdk/models/transcoder_thumbnail_url.rb +29 -0
  249. data/lib/wsc_sdk/models/ull_stream_target.rb +54 -0
  250. data/lib/wsc_sdk/models/wowza_stream_target.rb +60 -0
  251. data/lib/wsc_sdk/modules/api_response.rb +24 -0
  252. data/lib/wsc_sdk/modules/loggable.rb +44 -0
  253. data/lib/wsc_sdk/modules/transcoder_shared_methods.rb +221 -0
  254. data/lib/wsc_sdk/pagination.rb +89 -0
  255. data/lib/wsc_sdk/schema.rb +140 -0
  256. data/lib/wsc_sdk/schema_attribute.rb +349 -0
  257. data/lib/wsc_sdk/templates/custom_stream_target.rb +154 -0
  258. data/lib/wsc_sdk/templates/live_stream.rb +234 -0
  259. data/lib/wsc_sdk/templates/output.rb +133 -0
  260. data/lib/wsc_sdk/templates/transcoder.rb +97 -0
  261. data/lib/wsc_sdk/templates/ull_stream_target.rb +49 -0
  262. data/lib/wsc_sdk/templates/wowza_stream_target.rb +57 -0
  263. data/lib/wsc_sdk/version.rb +7 -0
  264. data/wsc_sdk.gemspec +48 -0
  265. metadata +460 -0
@@ -0,0 +1,182 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Wowza Streaming Cloud - SDK Code Documentation</title>
7
+
8
+ <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
9
+
10
+ <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
11
+
12
+ <link rel="stylesheet" href="css/custom.css" type="text/css" charset="utf-8" />
13
+
14
+ <script type="text/javascript" charset="utf-8">
15
+ pathId = "";
16
+ relpath = '';
17
+ </script>
18
+
19
+
20
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
21
+
22
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
23
+
24
+
25
+ </head>
26
+ <body>
27
+ <div id="wowza-wrapper">
28
+ <header>
29
+ <div class="logo">
30
+ <a href="https://www.wowza.com">
31
+ <img src="https://cloud.wowza.com/apidocs/assets/logo.png" alt="Wowza Logo" />
32
+ </a>
33
+ <h1>Wowza Streaming Cloud<br/>SDK Code Documentation</h1>
34
+ <div class="clearfix"></div>
35
+ </div>
36
+ <div class="links">
37
+ <a href="https://www.wowza.com/">Wowza Home</a>
38
+ <a href="https://www.wowza.com/docs">Docs & APIS</a>
39
+ <a href="https://www.wowza.com/community/index.html">Forums</a>
40
+ <a href="https://www.wowza.com/support">Support</a>
41
+ </div>
42
+ <div class="clearfix"></div>
43
+ </header>
44
+
45
+ <div id="content">
46
+ <div class="nav_wrap">
47
+ <iframe id="nav" src="class_list.html?1"></iframe>
48
+ <div id="resizer"></div>
49
+ </div>
50
+
51
+ <div id="main" tabindex="-1">
52
+ <div id="header">
53
+ <div id="menu">
54
+
55
+ <a href="_index.html">Index</a> &raquo;
56
+
57
+
58
+ <span class="title">Top Level Namespace</span>
59
+
60
+ </div>
61
+
62
+ <div id="search">
63
+
64
+ <a class="full_list_link" id="class_list_link"
65
+ href="class_list.html">
66
+
67
+ <svg width="24" height="24">
68
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
69
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
70
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
71
+ </svg>
72
+ </a>
73
+
74
+ </div>
75
+ <div class="clear"></div>
76
+ </div>
77
+
78
+ <div id="content"><h1>Top Level Namespace
79
+
80
+
81
+
82
+ </h1>
83
+ <div class="box_info">
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ </div>
96
+
97
+ <h2>Defined Under Namespace</h2>
98
+ <p class="children">
99
+
100
+
101
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="WscSdk.html" title="WscSdk (module)">WscSdk</a></span>
102
+
103
+
104
+
105
+
106
+ </p>
107
+
108
+
109
+ <h2>
110
+ Constant Summary
111
+ <small><a href="#" class="constants_summary_toggle">collapse</a></small>
112
+ </h2>
113
+
114
+ <dl class="constants">
115
+
116
+ <dt id="WSC_SDK_ROOT_PATH-constant" class="">WSC_SDK_ROOT_PATH =
117
+ <div class="docstring">
118
+ <div class="discussion">
119
+
120
+ <p>The root path of the SDK code base.</p>
121
+
122
+
123
+ </div>
124
+ </div>
125
+ <div class="tags">
126
+
127
+
128
+ </div>
129
+ </dt>
130
+ <dd><pre class="code"><span style="color:#036;font-weight:bold">File</span>.expand_path(<span style="color:#036;font-weight:bold">File</span>.join(<span style="color:#036;font-weight:bold">File</span>.dirname(<span style="color:#069">__FILE__</span>), <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">&quot;</span><span style="color:#D20">..</span><span style="color:#710">&quot;</span></span>))</pre></dd>
131
+
132
+ <dt id="WSC_SDK_LIB_PATH-constant" class="">WSC_SDK_LIB_PATH =
133
+ <div class="docstring">
134
+ <div class="discussion">
135
+
136
+ <p>The ./lib path of the SDK code base</p>
137
+
138
+
139
+ </div>
140
+ </div>
141
+ <div class="tags">
142
+
143
+
144
+ </div>
145
+ </dt>
146
+ <dd><pre class="code"><span style="color:#036;font-weight:bold">File</span>.join(<span style="color:#036;font-weight:bold">WSC_SDK_ROOT_PATH</span>, <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">&quot;</span><span style="color:#D20">lib</span><span style="color:#710">&quot;</span></span>)</pre></dd>
147
+
148
+ <dt id="WSC_SDK_PATH-constant" class="">WSC_SDK_PATH =
149
+ <div class="docstring">
150
+ <div class="discussion">
151
+
152
+ <p>The ./lib/wsc_sdk path of the SDK code base</p>
153
+
154
+
155
+ </div>
156
+ </div>
157
+ <div class="tags">
158
+
159
+
160
+ </div>
161
+ </dt>
162
+ <dd><pre class="code"><span style="color:#036;font-weight:bold">File</span>.join(<span style="color:#036;font-weight:bold">WSC_SDK_LIB_PATH</span>, <span style="background-color:hsla(0,100%,50%,0.05)"><span style="color:#710">&quot;</span><span style="color:#D20">wsc_sdk</span><span style="color:#710">&quot;</span></span>)</pre></dd>
163
+
164
+ </dl>
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+ </div>
176
+
177
+
178
+ </div>
179
+ </div>
180
+ </div>
181
+ </body>
182
+ </html>
@@ -0,0 +1,40 @@
1
+ ####> This code and all components © 2015 – 2019 Wowza Media Systems, LLC. All rights reserved.
2
+ ####> This code is licensed pursuant to the BSD 3-Clause License.
3
+
4
+ # Establish a client with your API authentication information
5
+ #
6
+ # This uses environment variables to set the API key and access key. This
7
+ # approach is recommended to add a layer of protection against exposing your
8
+ # API keys.
9
+ #
10
+ raise "WSC_API_KEY environment variable is not set" unless ENV.has_key?('WSC_API_KEY')
11
+ raise "WSC_API_ACCESS_KEY environment variable is not set" unless ENV.has_key?('WSC_API_ACCESS_KEY')
12
+
13
+ # Logging is disabled by default, but you can turn on it on by uncommenting the
14
+ # logger.level line below.
15
+ logger = Logger.new(STDOUT)
16
+ # logger.level = Logger::Severity::UNKNOWN # Disable logging output
17
+ # logger.level = Logger::Severity::WARN # Enable logging output
18
+ logger.level = Logger::Severity::DEBUG # Enable logging output
19
+
20
+ WscSdk.configure do |config|
21
+ config.api_key = ENV['WSC_API_KEY']
22
+ config.access_key = ENV['WSC_API_ACCESS_KEY']
23
+ config.logger = logger
24
+
25
+ # This value is set to Production, but you can change it to
26
+ # WscSdk::SANDBOX_HOSTNAME if you want to test your code before incurring
27
+ # charges on your account.
28
+ #
29
+ # NOTE: You will need to update your keys if you switch between the Production
30
+ # and Sandbox hostnames.
31
+ #
32
+ config.hostname = WscSdk::PRODUCTION_HOSTNAME
33
+ end
34
+
35
+ $client = WscSdk::Client.new
36
+
37
+ logger.debug("Client Info:")
38
+ $client.info.each do |k, v|
39
+ logger.debug(" |> #{k.to_s.ljust(20)}: #{v}")
40
+ end
@@ -0,0 +1,100 @@
1
+ ####> This code and all components © 2015 – 2019 Wowza Media Systems, LLC. All rights reserved.
2
+ ####> This code is licensed pursuant to the BSD 3-Clause License.
3
+
4
+ # Generate usage output
5
+ def output_usage(filename, *args)
6
+ puts
7
+ puts "usage: bundle exec ruby #{filename} #{args.map{ |a| a.to_s}.join(" ")}"
8
+ puts
9
+ exit 1
10
+ end
11
+
12
+ def ask_for_argument(arg, default=nil, arg_width=20)
13
+ message = "Enter argument value | #{arg.ljust(arg_width)} : "
14
+ message += "[#{default}] " unless default.nil?
15
+
16
+ print ">> #{message}"
17
+ response = STDIN.gets.chomp.strip
18
+
19
+ response = default if response.nil? or (response.length == 0)
20
+ return response
21
+ end
22
+
23
+ # Ask for user input on any args not passed into the example script.
24
+ #
25
+ def ask_for_arguments(filename, args={})
26
+ responses = []
27
+ arg_index = 0
28
+ max_arg_width = args.keys.map{ |k| k.to_s.length }.max
29
+
30
+ puts ""
31
+ args.each do |arg, default|
32
+ value = ARGV[arg_index]
33
+ arg_index += 1
34
+
35
+ if value.nil? or (value.length == 0)
36
+ response = ask_for_argument(arg.to_s, default, max_arg_width)
37
+ else
38
+ response = value
39
+ end
40
+
41
+ response = response.to_s
42
+ output_usage(filename, args.keys) if response.length == 0
43
+
44
+ responses << response
45
+ end
46
+ responses
47
+ end
48
+
49
+ # Exits the example, unless the result is a success
50
+ def handle_api_error(result, message)
51
+ return if result.success?
52
+ output_model_attributes(result, "The API Generated an error: #{message}")
53
+ exit 1
54
+ end
55
+
56
+ # Outputs the attribute values of a model
57
+ #
58
+ # NOTE: This approach directly accesses the attributes for a model. This is
59
+ # okay for reading data out of a model, but data assignment should be done using
60
+ # the getter (model.attribute) and setter (model.attribute=value) methods that
61
+ # are built into the model. Otherwise you will be bypassing the structures
62
+ # necessary to validate the data, which may generate unwanted outcomes.
63
+ #
64
+ def output_model_attributes(model, title="Model Attributes")
65
+ puts ""
66
+ puts title
67
+ puts ""
68
+ max_attribute_width = model.attributes.keys.map{ |a| a.to_s.length }.max
69
+ model.attributes.each do |attribute, value|
70
+ puts " |> #{attribute.to_s.ljust(max_attribute_width)} : #{value}"
71
+ end
72
+ puts ""
73
+ end
74
+
75
+ # Outputs a list of models.
76
+ #
77
+ def output_model_list(list, title="Model List", include_pagination=false, attribute=:to_s)
78
+ puts ""
79
+ puts title
80
+ puts ""
81
+ list.each do |id, model|
82
+ puts " |> #{id.to_s.ljust(10)} : #{model.send(attribute)}"
83
+ end
84
+
85
+ if include_pagination
86
+ # Output pagination information
87
+ #
88
+ puts ""
89
+ puts "Showing records #{list.pagination.page_first_index+1} - #{list.pagination.page_last_index+1} of #{list.pagination.total_records}"
90
+ puts "Currently on page #{list.pagination.page} of #{list.pagination.total_pages}"
91
+ puts ""
92
+ puts " |> Is first page : #{list.pagination.first_page?}"
93
+ puts " |> First page # : #{list.pagination.first_page}"
94
+ puts " |> Next page : #{list.pagination.next_page}"
95
+ puts " |> Previous page : #{list.pagination.previous_page}"
96
+ puts " |> Is last page : #{list.pagination.last_page?}"
97
+ puts " |> Last page # : #{list.pagination.last_page}"
98
+ puts ""
99
+ end
100
+ end
@@ -0,0 +1,39 @@
1
+ ####> This code and all components © 2015 – 2019 Wowza Media Systems, LLC. All rights reserved.
2
+ ####> This code is licensed pursuant to the BSD 3-Clause License.
3
+
4
+ require "wsc_sdk"
5
+ require_relative "../client" # Include our client configuration
6
+ require_relative "../helpers" # Include some helpers to make the code more direct
7
+
8
+ # Ensure the args passed in are present.
9
+ arguments = ask_for_arguments(__FILE__, live_stream_name: nil, source_url: nil)
10
+
11
+ # Extract some data into convenience variables
12
+ live_streams = $client.live_streams
13
+
14
+ # Build a RTMP/pull live_stream using a predefined template
15
+ name = arguments[0]
16
+ source_url = arguments[1]
17
+ live_stream_data = WscSdk::Templates::LiveStream.rtmp_pull(name, 1920, 1080, source_url)
18
+
19
+ # Build the live_stream object
20
+ live_stream = live_streams.build(live_stream_data)
21
+
22
+ # If the live_stream is invalid, output the messages and exit
23
+ unless (live_stream.valid?)
24
+ puts "Live Stream is invalid:"
25
+
26
+ live_stream.errors.each do |field, message|
27
+ puts " - #{field}: #{message}"
28
+ end
29
+ exit
30
+ end
31
+
32
+ # Get the result of saving the object to the API
33
+ saved = live_stream.save
34
+
35
+ # Handle an API error (in the helpers.rb file)
36
+ handle_api_error(saved, "There was an error creating the live stream") unless saved.success?
37
+
38
+ # Defined in the helpers.rb file.
39
+ output_model_attributes(live_stream, "Live Stream: #{live_stream.name}")
@@ -0,0 +1,32 @@
1
+ ####> This code and all components © 2015 – 2019 Wowza Media Systems, LLC. All rights reserved.
2
+ ####> This code is licensed pursuant to the BSD 3-Clause License.
3
+
4
+ require "wsc_sdk"
5
+ require_relative "../client" # Get our client
6
+ require_relative "../helpers" # Include some helpers to make the code more direct
7
+
8
+ # Ensure the args passed in are present, if not ask for them.
9
+ arguments = ask_for_arguments(__FILE__, live_stream_id: nil)
10
+
11
+ # Extract some data into convenience variables
12
+ live_streams = $client.live_streams
13
+ live_stream_id = arguments[0]
14
+
15
+ # Request the live_stream object
16
+ live_stream = live_streams.find(live_stream_id)
17
+
18
+ # Handle an API error (in the helpers.rb file)
19
+ handle_api_error(live_stream, "There was an error finding the live stream") unless live_stream.success?
20
+
21
+ # Get the result of deleting the object from the API
22
+ deleted = live_stream.delete
23
+
24
+ # Handle an API error (in the helpers.rb file)
25
+ handle_api_error(deleted, "There was an error deleting the live stream") unless deleted.success?
26
+
27
+ # If we've successfully deleted the live_stream then output the details.
28
+ # Note that the data for the output still exists locally in the SDK, however the
29
+ # ID has been removed since it no longer references a valid record in the API.
30
+
31
+ # Defined in the helpers.rb file.
32
+ output_model_attributes(live_stream, "Live Stream: #{live_stream.name}")
@@ -0,0 +1,22 @@
1
+ ####> This code and all components © 2015 – 2019 Wowza Media Systems, LLC. All rights reserved.
2
+ ####> This code is licensed pursuant to the BSD 3-Clause License.
3
+
4
+ require "wsc_sdk"
5
+ require_relative "../client" # Get our client
6
+ require_relative "../helpers" # Include some helpers to make the code more direct
7
+
8
+ # Ensure the args passed in are present
9
+ arguments = ask_for_arguments(__FILE__, live_stream_id: nil)
10
+
11
+ # Extract some data into convenience variables
12
+ live_streams = $client.live_streams
13
+ live_stream_id = arguments[0]
14
+
15
+ # Request the live_stream object
16
+ live_stream = live_streams.find(live_stream_id)
17
+
18
+ # Handle an API error (in the helpers.rb file)
19
+ handle_api_error(live_stream, "There was an error finding the live stream") unless live_stream.success?
20
+
21
+ # Defined in the helpers.rb file.
22
+ output_model_attributes(live_stream, "Live Stream: #{live_stream.name}")
@@ -0,0 +1,126 @@
1
+ ####> This code and all components © 2015 – 2019 Wowza Media Systems, LLC. All rights reserved.
2
+ ####> This code is licensed pursuant to the BSD 3-Clause License.
3
+
4
+ require "wsc_sdk"
5
+ require_relative "../client" # Get our client
6
+ require_relative "../helpers" # Include some helpers to make the code more direct
7
+
8
+ # Ensure the args passed in are present, if not ask for them.
9
+ arguments = ask_for_arguments(__FILE__, { pagination_page: 1, pagination_per_page: 25 })
10
+
11
+ # Extract some data into convenience variables
12
+
13
+ page = arguments[0] # First argument is the page number (default: 1)
14
+ per_page = arguments[1] # Second argument is the items per page (default: 25, max: 1000)
15
+
16
+
17
+
18
+ mutex = Mutex.new
19
+
20
+ live_stream_thread = Thread.new {
21
+ list = nil
22
+
23
+ mutex.synchronize {
24
+ models = $client.live_streams
25
+ # Request the list of live_streams using pagination
26
+ list = models.list(pagination: { page: page.to_i, per_page: per_page.to_i })
27
+
28
+ # Handle an API error (in the helpers.rb file)
29
+ handle_api_error(list, "There was an error retrieving the list of live streams") unless list.success?
30
+ }
31
+
32
+ start = Time.now.to_f
33
+ last_request = nil
34
+ request_num = 1
35
+ list.each do |id, model|
36
+ model = nil
37
+ mutex.synchronize {
38
+ model = $client.live_streams.find(id)
39
+
40
+ # Handle an API error (in the helpers.rb file)
41
+ handle_api_error(model, "There was an error retrieving the live stream") unless model.success?
42
+ }
43
+
44
+ elapsed = Time.now.to_f - start
45
+ duration = Time.now.to_f - (last_request || Time.now.to_f)
46
+ last_request = $client.last_request_time
47
+ puts "Requested #{model.class.name.split("::").last}: #{id} | Name: #{model.name} | ##{request_num} | Duration: #{duration} | Elapsed: #{elapsed}"
48
+ request_num += 1
49
+ end
50
+ }
51
+
52
+
53
+ live_stream_state_thread = Thread.new {
54
+ begin
55
+ list = nil
56
+
57
+ mutex.synchronize {
58
+ models = $client.live_streams
59
+ # Request the list of live_streams using pagination
60
+ list = models.list(pagination: { page: page.to_i, per_page: per_page.to_i })
61
+
62
+ # Handle an API error (in the helpers.rb file)
63
+ handle_api_error(list, "There was an error retrieving the list of live streams") unless list.success?
64
+ }
65
+
66
+ puts "State!!!!"
67
+ start = Time.now.to_f
68
+ last_request = nil
69
+ request_num = 1
70
+ list.each do |id, model|
71
+ puts "ID: #{id}"
72
+ model = nil
73
+ mutex.synchronize {
74
+ begin
75
+ model = model.state
76
+ rescue Exception => e
77
+ puts "Live Stream State Error: #{exception.message} | #{exception.backtrace[0..8].join("\n")}"
78
+ end
79
+
80
+ # Handle an API error (in the helpers.rb file)
81
+ handle_api_error(model, "There was an error retrieving the live stream state") unless model.success?
82
+ }
83
+
84
+ elapsed = Time.now.to_f - start
85
+ duration = Time.now.to_f - (last_request || Time.now.to_f)
86
+ last_request = $client.last_request_time
87
+ puts "Requested #{model.class.name.split("::").last}: #{id} | STate: #{model.state} | ##{request_num} | Duration: #{duration} | Elapsed: #{elapsed}"
88
+ request_num += 1
89
+ end
90
+ rescue Exception => e
91
+ puts "Live Stream State Error: #{exception.message} | #{exception.backtrace[0..8].join("\n")}"
92
+ end
93
+ }
94
+
95
+ stream_target_thread = Thread.new {
96
+ list = nil
97
+ mutex.synchronize {
98
+ models = $client.stream_targets.wowza
99
+ # Request the list of live_streams using pagination
100
+ list = models.list(pagination: { page: page.to_i, per_page: per_page.to_i })
101
+
102
+ # Handle an API error (in the helpers.rb file)
103
+ handle_api_error(list, "There was an error retrieving the list of live streams") unless list.success?
104
+ }
105
+
106
+ start = Time.now.to_f
107
+ last_request = nil
108
+ request_num = 1
109
+ list.each do |id, model|
110
+ model = nil
111
+ mutex.synchronize {
112
+ model = $client.stream_targets.wowza.find(id)
113
+ # Handle an API error (in the helpers.rb file)
114
+ handle_api_error(model, "There was an error retrieving the wowza stream target") unless model.success?
115
+ }
116
+ elapsed = Time.now.to_f - start
117
+ duration = Time.now.to_f - (last_request || Time.now.to_f)
118
+ last_request = Time.now.to_f
119
+ puts "Requested #{model.class.name.split("::").last}: #{id} | Name: #{model.name} | ##{request_num} | Duration: #{duration} | Elapsed: #{elapsed}"
120
+ request_num += 1
121
+ end
122
+ }
123
+
124
+ live_stream_thread.join
125
+ live_stream_state_thread.join
126
+ stream_target_thread.join