Documentation ¶
Overview ¶
Package device implements Device Management API interface.
Index ¶
- type DeleteDeviceRequest
- type DeleteDeviceResponse
- type FactoryInfo
- type Log
- type QueryDeviceDetailRequest
- type QueryDeviceDetailResponse
- type QueryDevicesRequest
- type QueryDevicesResponse
- type QueryFactoryInfoRequest
- type QueryFactoryInfoResponse
- type QueryLogsRequest
- type QueryLogsResponse
- type QuerySubDevicesRequest
- type QuerySubDevicesResponse
- type QueryUserDevicesRequest
- type QueryUserDevicesResponse
- type RestoreFactorySettingsRequest
- type RestoreFactorySettingsResponse
- type SubDevice
- type UpdateFunctionPointNameRequest
- type UpdateFunctionPointNameResponse
- type UserDevice
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeleteDeviceRequest ¶
type DeleteDeviceRequest struct {
DeviceID string `validate:"required"`
}
DeleteDeviceRequest to delete device.
func (*DeleteDeviceRequest) Method ¶
func (d *DeleteDeviceRequest) Method() string
Method for Request.Method()
type DeleteDeviceResponse ¶
type DeleteDeviceResponse bool
DeleteDeviceResponse shows success or not.
type FactoryInfo ¶
type FactoryInfo struct { ID string `json:"id"` UUID string `json:"uuid"` SN string `json:"sn"` MAC string `json:"mac"` }
FactoryInfo for device.
type Log ¶
type Log struct { Code string `json:"code"` Value interface{} `json:"value"` EventTime int64 `json:"event_time"` EventFrom string `json:"event_from"` EventID int `json:"event_id"` }
Log item
type QueryDeviceDetailRequest ¶
type QueryDeviceDetailRequest struct {
DeviceID string `validate:"required"`
}
QueryDeviceDetailRequest gets device details.
func (*QueryDeviceDetailRequest) Method ¶
func (q *QueryDeviceDetailRequest) Method() string
Method for Request.Method()
func (*QueryDeviceDetailRequest) URL ¶
func (q *QueryDeviceDetailRequest) URL() string
URL for Request.URL()
type QueryDeviceDetailResponse ¶
type QueryDeviceDetailResponse struct { ID string `json:"id"` UID string `json:"uid"` Category string `json:"category"` Sub bool `json:"sub"` UUID string `json:"uuid"` Online bool `json:"online"` Status []map[string]interface{} `json:"status"` LocalKey string `json:"local_key"` ProductID string `json:"product_id"` OwnerID string `json:"owner_id"` }
QueryDeviceDetailResponse returns device details.
type QueryDevicesRequest ¶
type QueryDevicesRequest struct { Schema string `url:"schema,omitempty"` ProductID string `url:"product_id,omitempty"` DeviceIDs string `url:"device_ids,omitempty"` PageNo int `validate:"required" url:"page_no"` PageSize int `validate:"required" url:"page_size"` }
QueryDevicesRequest gets the list of devices with(out) filters.
func (*QueryDevicesRequest) Method ¶
func (q *QueryDevicesRequest) Method() string
Method for Request.Method()
type QueryDevicesResponse ¶
type QueryDevicesResponse struct { Total int `json:"total"` Devices []QueryDeviceDetailResponse `json:"devices"` }
QueryDevicesResponse returns devices list.
type QueryFactoryInfoRequest ¶
type QueryFactoryInfoRequest struct {
DeviceIds string `url:"device_ids" validate:"required"`
}
QueryFactoryInfoRequest gets device factory information
func (*QueryFactoryInfoRequest) Method ¶
func (q *QueryFactoryInfoRequest) Method() string
Method for Request.Method()
func (*QueryFactoryInfoRequest) URL ¶
func (q *QueryFactoryInfoRequest) URL() string
URL for Request.URL()
type QueryFactoryInfoResponse ¶
type QueryFactoryInfoResponse []FactoryInfo
QueryFactoryInfoResponse returns factory information.
type QueryLogsRequest ¶
type QueryLogsRequest struct { DeviceID string `validate:"required" url:"-"` Type string `validate:"required" url:"type"` StartTime int64 `validate:"required" url:"start_time"` EndTime int64 `validate:"required" url:"end_time"` Codes string `url:"codes,omitempty"` StartRowKey string `url:"start_row_key,omitempty"` LastRowKey string `url:"last_row_key,omitempty"` LastEventTime int64 `url:"last_event_time,omitempty"` Size int `url:"size,omitempty"` QueryType int `url:"query_type,omitempty"` }
QueryLogsRequest gets device logs.
func (*QueryLogsRequest) Method ¶
func (q *QueryLogsRequest) Method() string
Method for Request.Method()
type QueryLogsResponse ¶
type QueryLogsResponse struct { Logs []Log `json:"logs"` DeviceID string `json:"device_id"` HasNext bool `json:"has_next"` CurrentRowKey string `json:"current_row_key"` NextRowKey string `json:"next_row_key"` }
QueryLogsResponse returns device logs.
type QuerySubDevicesRequest ¶
type QuerySubDevicesRequest struct {
DeviceID string `validate:"required"`
}
QuerySubDevicesRequest gets device for gateway.
func (*QuerySubDevicesRequest) Method ¶
func (q *QuerySubDevicesRequest) Method() string
Method for Request.Method()
func (*QuerySubDevicesRequest) URL ¶
func (q *QuerySubDevicesRequest) URL() string
URL for Request.URL()
type QuerySubDevicesResponse ¶
type QuerySubDevicesResponse []SubDevice
QuerySubDevicesResponse returns device list.
type QueryUserDevicesRequest ¶
type QueryUserDevicesRequest struct {
UID string `validate:"required"`
}
QueryUserDevicesRequest gets the list of devices under the user.
func (*QueryUserDevicesRequest) Method ¶
func (q *QueryUserDevicesRequest) Method() string
Method for Request.Method()
func (*QueryUserDevicesRequest) URL ¶
func (q *QueryUserDevicesRequest) URL() string
URL for Request.URL()
type QueryUserDevicesResponse ¶
type QueryUserDevicesResponse []UserDevice
QueryUserDevicesResponse returns devices.
type RestoreFactorySettingsRequest ¶
type RestoreFactorySettingsRequest struct {
DeviceID string `validate:"required"`
}
RestoreFactorySettingsRequest restores the factory settings
func (*RestoreFactorySettingsRequest) Method ¶
func (r *RestoreFactorySettingsRequest) Method() string
Method for Request.Method()
func (*RestoreFactorySettingsRequest) URL ¶
func (r *RestoreFactorySettingsRequest) URL() string
URL for Request.URL()
type RestoreFactorySettingsResponse ¶
type RestoreFactorySettingsResponse bool
RestoreFactorySettingsResponse shows success or not.
type SubDevice ¶
type SubDevice struct { ActiveTime int `json:"active_time"` Category string `json:"category"` ID string `json:"id"` Name string `json:"name"` Online bool `json:"online"` OwnerID string `json:"owner_id"` ProductID string `json:"product_id"` UpdateTime int `json:"update_time"` }
SubDevice for device for the gateway.
type UpdateFunctionPointNameRequest ¶
type UpdateFunctionPointNameRequest struct { DeviceID string `json:"-" validate:"required"` FunctionCode string `json:"-" validate:"required"` Name string `json:"name" validate:"required"` }
UpdateFunctionPointNameRequest modifies the function point name.
func (*UpdateFunctionPointNameRequest) Method ¶
func (u *UpdateFunctionPointNameRequest) Method() string
Method for Request.Method()
func (*UpdateFunctionPointNameRequest) URL ¶
func (u *UpdateFunctionPointNameRequest) URL() string
URL for Request.URL()
type UpdateFunctionPointNameResponse ¶
type UpdateFunctionPointNameResponse bool
UpdateFunctionPointNameResponse returns success or not.
type UserDevice ¶
type UserDevice struct { Sub bool `json:"sub"` CreateTime int `json:"create_time"` LocalKey string `json:"local_key"` OwnerID string `json:"owner_id"` IP string `json:"ip"` BizType int `json:"biz_type"` Icon string `json:"icon"` TimeZone string `json:"time_zone"` UUID string `json:"uuid"` ProductName string `json:"product_name"` ActiveTime int `json:"active_time"` UID string `json:"uid"` UpdateTime int `json:"update_time"` ProductID string `json:"product_id"` Name string `json:"name"` Online bool `json:"online"` ID string `json:"id"` Category string `json:"category"` Status map[string]interface{} `json:"status"` }
UserDevice for device of user.