Module: UnifiGem::Client::Sites

Included in:
UnifiGem::Client
Defined in:
lib/unifi_gem/client/sites.rb

Instance Method Summary collapse

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_sitesObject



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_sitesObject



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_sysinfoObject



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