Class: CiscoWebex::Devices
- Inherits:
-
Object
- Object
- CiscoWebex::Devices
- Defined in:
- lib/Devices/Devices.rb
Direct Known Subclasses
Instance Method Summary collapse
- #configurations ⇒ Object
- #devices ⇒ Object
-
#get(uri, params = nil, limit = 50) ⇒ Object
access to REST API.
-
#head(uri, params = nil) ⇒ Object
access to REST API.
-
#initialize(token = nil) ⇒ Devices
constructor
initialize object with stored token.
-
#me ⇒ Object
shortcut for getting the profile associated with the token.
-
#post(uri, params = nil) ⇒ Object
access to REST API.
-
#put(uri, params = nil) ⇒ Object
access to REST API.
- #workspaces ⇒ Object
- #xapi ⇒ Object
Constructor Details
#initialize(token = nil) ⇒ Devices
initialize object with stored token
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/Devices/Devices.rb', line 7 def initialize(token=nil) if not token raise "Must provide API key" else @auth_token = token if token @org_id = me()['orgId'] rescue nil# test token and store users profile if @org_id == nil raise "CiscoWebex::Messaging - Bearer token not valid" else @devices = Endpoints.new(@auth_token) @workspaces = Workspaces.new(@auth_token) @xapi = Xapi.new(@auth_token) @configurations = Configurations.new(@auth_token) end end end |
Instance Method Details
#configurations ⇒ Object
62 63 64 |
# File 'lib/Devices/Devices.rb', line 62 def configurations() return @configurations end |
#devices ⇒ Object
50 51 52 |
# File 'lib/Devices/Devices.rb', line 50 def devices() return @devices end |
#get(uri, params = nil, limit = 50) ⇒ Object
access to REST API
25 26 27 |
# File 'lib/Devices/Devices.rb', line 25 def get(uri, params=nil, limit=50) return CiscoWebex::Rest.get(@auth_token, uri, params, limit) end |
#head(uri, params = nil) ⇒ Object
access to REST API
30 31 32 |
# File 'lib/Devices/Devices.rb', line 30 def head(uri, params=nil) return CiscoWebex::Rest.head(@auth_token, uri, params) end |
#me ⇒ Object
shortcut for getting the profile associated with the token
45 46 47 48 |
# File 'lib/Devices/Devices.rb', line 45 def me() return CiscoWebex::Rest.get(@auth_token, "/v1/people/me") end |
#post(uri, params = nil) ⇒ Object
access to REST API
35 36 37 |
# File 'lib/Devices/Devices.rb', line 35 def post(uri, params=nil) return CiscoWebex::Rest.post(@auth_token, uri, params) end |
#put(uri, params = nil) ⇒ Object
access to REST API
40 41 42 |
# File 'lib/Devices/Devices.rb', line 40 def put(uri, params=nil) return CiscoWebex::Rest.put(@auth_token, uri, params) end |
#workspaces ⇒ Object
54 55 56 |
# File 'lib/Devices/Devices.rb', line 54 def workspaces() return @workspaces end |
#xapi ⇒ Object
58 59 60 |
# File 'lib/Devices/Devices.rb', line 58 def xapi() return @xapi end |