Initial version

Extracted from paultyng/terraform-provider-unifi@ef25893f14
This commit is contained in:
Paul Tyng
2020-01-10 14:31:12 -05:00
commit 435ecf9d6f
135 changed files with 6973 additions and 0 deletions

29
unifi/sites.go Normal file
View File

@@ -0,0 +1,29 @@
package unifi
type Site struct {
ID string `json:"_id,omitempty"`
// Hidden bool `json:"attr_hidden,omitempty"`
// HiddenID string `json:"attr_hidden_id,omitempty"`
// NoDelete bool `json:"attr_no_delete,omitempty"`
// NoEdit bool `json:"attr_no_edit,omitempty"`
Name string `json:"name"`
Description string `json:"desc"`
//Role string `json:"role"`
}
func (c *Client) ListSites() ([]Site, error) {
var respBody struct {
Meta meta `json:"meta"`
Data []Site `json:"data"`
}
err := c.do("GET", "self/sites", nil, &respBody)
if err != nil {
return nil, err
}
return respBody.Data, nil
}