Class: WowzaRest::Client
- Inherits:
-
Object
- Object
- WowzaRest::Client
- Defined in:
- lib/wowza_rest/client.rb
Instance Attribute Summary collapse
-
#api_version ⇒ Object
Returns the value of attribute api_version.
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#host ⇒ Object
Returns the value of attribute host.
-
#password ⇒ Object
Returns the value of attribute password.
-
#port ⇒ Object
Returns the value of attribute port.
-
#server_name ⇒ Object
Returns the value of attribute server_name.
-
#username ⇒ Object
Returns the value of attribute username.
-
#vhost ⇒ Object
Returns the value of attribute vhost.
Instance Method Summary collapse
- #base_uri ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #server_path ⇒ Object
- #server_status ⇒ Object
Methods included from Publishers
#create_publisher, #delete_publisher
Methods included from Instances
#get_incoming_stream_stats, #get_instance, #instances
Methods included from Applications
#applications, #create_application, #delete_application, #get_application, #update_application
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
15 16 17 18 19 20 21 |
# File 'lib/wowza_rest/client.rb', line 15 def initialize( = {}) check_required_attrs() .each do |key, value| instance_variable_set("@#{key}", value) end @connection = WowzaRest::Connection.new(base_uri, @username, @password) end |
Instance Attribute Details
#api_version ⇒ Object
Returns the value of attribute api_version.
11 12 13 |
# File 'lib/wowza_rest/client.rb', line 11 def api_version @api_version end |
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
13 14 15 |
# File 'lib/wowza_rest/client.rb', line 13 def connection @connection end |
#host ⇒ Object
Returns the value of attribute host.
11 12 13 |
# File 'lib/wowza_rest/client.rb', line 11 def host @host end |
#password ⇒ Object
Returns the value of attribute password.
11 12 13 |
# File 'lib/wowza_rest/client.rb', line 11 def password @password end |
#port ⇒ Object
Returns the value of attribute port.
11 12 13 |
# File 'lib/wowza_rest/client.rb', line 11 def port @port end |
#server_name ⇒ Object
Returns the value of attribute server_name.
11 12 13 |
# File 'lib/wowza_rest/client.rb', line 11 def server_name @server_name end |
#username ⇒ Object
Returns the value of attribute username.
11 12 13 |
# File 'lib/wowza_rest/client.rb', line 11 def username @username end |
#vhost ⇒ Object
Returns the value of attribute vhost.
11 12 13 |
# File 'lib/wowza_rest/client.rb', line 11 def vhost @vhost end |
Instance Method Details
#base_uri ⇒ Object
46 47 48 |
# File 'lib/wowza_rest/client.rb', line 46 def base_uri "#{server_path}/vhosts/#{vhost}" end |
#server_path ⇒ Object
42 43 44 |
# File 'lib/wowza_rest/client.rb', line 42 def server_path "#{host}:#{port}/#{api_version}/servers/#{server_name}" end |
#server_status ⇒ Object
23 24 25 26 27 28 |
# File 'lib/wowza_rest/client.rb', line 23 def server_status response = connection.request(:get, '/status', base_uri: server_path) WowzaRest::Data::ServerStatus.new(response.parsed_response) rescue nil end |