Module: UnifiGem::Client::Sites
- Included in:
- UnifiGem::Client
- Defined in:
- lib/unifi_gem/client/sites.rb
Instance Method Summary collapse
- #add_site(description) ⇒ Object
- #delete_site(site_id) ⇒ Object
- #list_sites ⇒ Object
- #stat_sites ⇒ Object
- #stat_sysinfo ⇒ Object
Instance Method Details
#add_site(description) ⇒ Object
7 8 9 10 11 |
# File 'lib/unifi_gem/client/sites.rb', line 7 def add_site(description) body = { cmd: 'add-site', desc: description } response = self.class.post("/s/#{@site}/cmd/sitemgr", { body: body.to_json }) response.parsed_response end |
#delete_site(site_id) ⇒ Object
14 15 16 17 18 |
# File 'lib/unifi_gem/client/sites.rb', line 14 def delete_site(site_id) body = { site: site_id, cmd: 'delete-site' } response = self.class.post("/s/#{@site}/cmd/sitemgr", { body: body.to_json }) response.parsed_response end |
#list_sites ⇒ Object
20 21 22 23 |
# File 'lib/unifi_gem/client/sites.rb', line 20 def list_sites response = self.class.get("/self/sites") response.parsed_response end |
#stat_sites ⇒ Object
25 26 27 28 |
# File 'lib/unifi_gem/client/sites.rb', line 25 def stat_sites response = self.class.get("/stat/sites") response.parsed_response end |
#stat_sysinfo ⇒ Object
30 31 32 33 |
# File 'lib/unifi_gem/client/sites.rb', line 30 def stat_sysinfo response = self.class.get("/s/#{@site}/stat/sysinfo") response.parsed_response end |