package unipede import "net/http" type ( // DeviceInfo defines the data struct returned from the GET /devices/{deviceId} // Unipede call. DeviceInfo struct { ID int `json:"id"` Dc string `json:"dc"` Hostname string `json:"hostname"` ManagementIP string `json:"management_ip"` Created string `json:"created"` Updated string `json:"updated"` ChassisModel string `json:"chassis_model"` ZenossUID string `json:"zenoss_uid"` ZenossState string `json:"zenoss_state"` OsVersion string `json:"os_version"` CoreID int `json:"core_id"` PathNorth string `json:"path_north"` Depth int `json:"depth"` ZenossUUID string `json:"zenoss_uuid"` Role string `json:"role"` Service string `json:"service"` Cabinet string `json:"cabinet"` Os string `json:"os"` Address string `json:"address"` SysPeriod struct { Begin string `json:"begin"` End string `json:"end"` ExcludeBegin bool `json:"exclude_begin"` ExcludeEnd bool `json:"exclude_end"` } `json:"sys_period"` ManagementStatus string `json:"management_status"` Authority string `json:"authority"` CoreAccount int `json:"core_account"` CoreServer int `json:"core_server"` Errors []string `json:"errors"` } ) // Device method calls the Unipede API to get basic device information about a model that is // Unipede has collected on. // See: https://unipede.rackspace.net/docs/api/#/devices/get_devices__deviceId_ func (u *Client) Device(id string, refresh *int, options ...*UnipedeOptions) (DeviceInfo, error) { var retVlan DeviceInfo o := processOptions(refresh, nil, options...) req, err := u.newRequest(unipedeURL+"devices/"+id, http.MethodGet, o, nil) if err != nil { return retVlan, err } if _, err = u.do(req, o, &retVlan); err != nil { return retVlan, err } return retVlan, err }