-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathschema.graphql
More file actions
186 lines (165 loc) · 4.54 KB
/
schema.graphql
File metadata and controls
186 lines (165 loc) · 4.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# This file was generated based on ".graphqlconfig". Do not edit manually.
schema {
query: Query
mutation: Mutation
}
"Necessary data about and attribute of a device#"
type Attr {
label: String!
valueType: ValueType!
}
type Attributes {
"Timestamp of create date"
created: String
"Attribute ID"
id: Int
"Attribute Label"
label: String
"List of Metadatas associate to Attribute"
metadata: [Metadata]
"Value when type is Static"
static_value: String
"Primary key of a template "
template_id: String
"Can be static, dynamic, etc."
type: String
"Can be String, Integer, Float, Geo, etc."
value_type: String
}
"JSON that defines a dashboard's configuration retrieved from database and parsed as string"
type Config {
config: String!
}
"Necessary informations about device#"
type Device {
attrs: [Attr]
id: String!
label: String!
}
"A paginated list of Devices.#"
type DeviceListPage {
currentPage: Int!
devices: [Device]
totalPages: Int!
}
"Historical reading from device#"
type History {
attrs: [HistoryAttr]
deviceID: String!
label: String!
}
"Historical reading from an attribute#"
type HistoryAttr {
label: String!
timestamp: String!
value: String!
valueType: ValueType!
}
type MapStringToString {
"key"
key: String
"value"
value: String
}
type Metadata {
"Timestamp of create date"
created: String
"Metadata ID"
id: Int
"Metadata Label "
label: String
"Meta Value"
static_value: String
"Can be define by user. Like a unit"
type: String
"Timestamp of update date"
updated: String
"Can be String, Integer, Float, Geo, etc."
value_type: String
}
type Mutation {
"Updates existing information on database, or creates an entry if it doesn't exist. Returns success message if it works or error message if fails."
updateConfig(config: String!, tenant: String!, user: String): String
}
type Query {
"Retrieves dashboard configuration by user. Returns the information if successful or error message if it occurs."
getConfig(tenant: String!, user: String): String
"Finds device information by id"
getDeviceById(deviceId: String!): Device
"Returns historical data about devices' attributes chosen in the input"
getDeviceHistory(filter: HistoryInput!): [History]
"Returns historical data in the format used by the Dashboard"
getDeviceHistoryForDashboard(filter: HistoryInput!): String
"Returns a list of devices that can be divided in pages, and the information about how many pages there are in total, along with which page is being shown"
getDevices(filter: FilterDeviceInput, page: PageInput): DeviceListPage
"Get a template by Id"
template(id: Int!): Template
"""
Checks if templates has Image Firmware and return a array with objects key-value, where key is a id template and value is a boolean.
The value is true if the template has image firmware.
"""
templatesHasImageFirmware(templatesId: [Int]!): [MapStringToString]
}
type Template {
"List of Attributes"
attrs: [Attributes]
"List of Configuration Attributes"
config_attrs: [Attributes]
"Timestamp of create date"
created: String
"List of Data Attributes"
data_attrs: [Attributes]
"Template ID"
id: Int
"List of Image Attributes (Firmware)"
img_attrs: [Attributes]
"Template Label"
label: String!
}
"Value types used by the platform#"
enum ValueType {
BOOLEAN
GEO
NUMBER
STRING
UNDEFINED
}
"A stringified JSON that defines a dashboard's configuration"
input ConfigInput {
config: String!
}
"Return only devices that are named accordingly (prefix or suffix match)#"
input FilterDeviceInput {
label: String
}
"Parameters to identify from which device and which attributes to retrieve historical data from#"
input HistoryDeviceInput {
"attributes which readings are to be retrieved#"
attrs: [String]
"device selected#"
deviceID: String!
}
"""
Parameters to query historical device data#
operationType: 0 => get last N records#
operationType: 1 => get last minutes#
operationType: 2 => get last hours#
operationType: 3 => get last days#
operationType: 4 => get last months#
lastN will be used to obtain the values of minutes, hours, days and months when the operationType is non-zero#
"""
input HistoryInput {
dateFrom: String
dateTo: String
"list of devices which attributes will be retrieved#"
devices: [HistoryDeviceInput]!
lastN: Int
operationType: Int
}
"Determines which page to show and how many items#"
input PageInput {
"set the page number to be accessed (default 20) #"
number: Int
"set the number of elements to be shown in a page (default 1) #"
size: Int
}