- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / common / extensions / api / networking_private.json
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 [
6   {
7     "namespace":"networkingPrivate",
8     "description": "none",
9     "compiler_options": {
10       "implemented_in": "chrome/browser/extensions/api/networking_private/networking_private_api.h"
11     },
12     "types" : [
13       {
14         "id": "NetworkProperties",
15         "type": "object",
16         "additionalProperties": { "type": "any" }
17       },
18       {
19         "id": "ManagedNetworkProperties",
20         "type": "object",
21         "additionalProperties": { "type": "any" }
22       },
23       {
24         "id": "VerificationProperties",
25         "type": "object",
26         "properties": {
27           "certificate": {
28             "type": "string",
29             "description": "A string containing a PEM-encoded X.509 certificate for use in verifying the signed data."
30           },
31           "publicKey": {
32             "type": "string",
33             "description": "A string containing a PEM-encoded RSA public key to be used to compare with the one in signedData"
34           },
35           "nonce": {
36             "type": "string",
37             "description": "A string containing a base64-encoded random binary data for use in verifying the signed data."
38           },
39           "signedData": {
40             "type": "string",
41             "description": "A string containing the identifying data string signed by the device."
42           },
43           "deviceSerial": {
44             "type": "string",
45             "description": "A string containing the serial number of the device."
46           },
47           "deviceSsid": {
48             "type": "string",
49             "description": "A string containing the SSID of the device.  Only set if the device has already been setup once."
50           },
51           "deviceBssid": {
52             "type": "string",
53             "description": "A string containing the BSSID of the device.  Only set if the device has already been setup."
54           }
55         }
56       },
57       {
58         "id": "NetworkType",
59         "type": "string",
60         "enum": ["Ethernet", "WiFi", "Cellular"]
61       }
62     ],
63     "functions": [
64       {
65         "name": "getProperties",
66         "description": "Gets all the properties of the network with id networkGuid.  Includes all properties of the network (read-only and read/write values).",
67         "parameters": [
68           {
69             "name": "networkGuid",
70             "type": "string",
71             "description": "The unique identifier of the network to get properties from."
72           },
73           {
74             "name": "callback",
75             "type": "function",
76             "parameters": [
77               {
78                 "name": "properties",
79                 "$ref": "NetworkProperties",
80                 "description": "Results of the query for network properties."
81               }
82             ]
83           }
84         ]
85       },
86       {
87         "name": "getManagedProperties",
88         "description": "Gets the merged properties of the network with id networkGuid from the sources: User settings, shared settings, user policy, device policy and the currently active settings.",
89         "parameters": [
90           {
91             "name": "networkGuid",
92             "type": "string",
93             "description": "The unique identifier of the network to get properties from."
94           },
95           {
96             "name": "callback",
97             "type": "function",
98             "parameters": [
99               {
100                 "name": "properties",
101                 "$ref": "ManagedNetworkProperties",
102                 "description": "Results of the query for managed network properties."
103               }
104             ]
105           }
106         ]
107       },
108       {
109         "name": "getState",
110         "description": "Gets the cached read-only properties of the network with id networkGuid.  This is meant to be a higher performance function than getProperties, which requires a round trip to query the networking subsystem.  It only returns a subset of the properties returned by getProperties.",
111         "parameters": [
112           {
113             "name": "networkGuid",
114             "type": "string",
115             "description": "The unique identifier of the network to set properties on."
116           },
117           {
118             "name": "callback",
119             "type": "function",
120             "parameters": [
121               {
122                 "name": "properties",
123                 "$ref": "NetworkProperties",
124                 "description": "Results of the query for network properties."
125               }
126             ]
127           }
128         ]
129       },
130       {
131         "name": "setProperties",
132         "description": "Sets the properties of the network with id networkGuid.",
133         "parameters": [
134           {
135             "name": "networkGuid",
136             "type": "string",
137             "description": "The unique identifier of the network to set properties on."
138           },
139           {
140             "name": "properties",
141             "$ref": "NetworkProperties",
142             "description": "The properties to set on the network."
143           },
144           {
145             "name": "callback",
146             "type": "function",
147             "parameters": []
148           }
149         ]
150       },
151       {
152         "name": "createNetwork",
153         "description": "Creates a new network configuration from propeties. If a matching configured network already exists, this will fail. Otherwise returns the guid of the new network.",
154         "parameters": [
155           {
156             "name": "shared",
157             "type": "boolean",
158             "description": "If true, share this network configuration with other users."
159           },
160           {
161             "name": "properties",
162             "$ref": "NetworkProperties",
163             "description": "The properties to configure the new network with."
164           },
165           {
166             "name": "callback",
167             "type": "function",
168             "parameters": [
169               {
170                 "name": "guid",
171                 "type": "string"
172               }
173             ]
174           }
175         ]
176       },
177       {
178         "name": "getVisibleNetworks",
179         "description": "Gets the list of visible networks, and returns a list of cached, read-only network properties for each.",
180         "parameters": [
181           {
182             "name": "type",
183             "type": "string",
184             "enum": ["Ethernet", "WiFi", "Bluetooth", "Cellular", "VPN", "All"],
185             "description": "The type of networks to return."
186           },
187           {
188             "name": "callback",
189             "type": "function",
190             "optional": true,
191             "parameters": [
192               {
193                 "name": "networkList",
194                 "type": "array",
195                 "items": { "$ref": "NetworkProperties" }
196               }
197             ]
198           }
199         ]
200       },
201       {
202         "name": "getEnabledNetworkTypes",
203         "description": "Returns a list of the enabled network type.",
204         "parameters": [
205           {
206             "name": "callback",
207             "type": "function",
208             "optional": true,
209             "parameters": [
210               {
211                 "name": "networkList",
212                 "type": "array",
213                 "items": { "$ref": "NetworkType" }
214               }
215             ]
216           }
217         ]
218       },
219       {
220         "name": "enableNetworkType",
221         "description": "Enable the specified network type.",
222         "parameters": [
223           {
224             "name": "networkType",
225             "$ref": "NetworkType"
226           }
227         ]
228       },
229       {
230         "name": "disableNetworkType",
231         "description": "Disable the specified network type.",
232         "parameters": [
233           {
234             "name": "networkType",
235             "$ref": "NetworkType"
236           }
237         ]
238       },
239       {
240         "name": "requestNetworkScan",
241         "description": "Requests that the networking subsystem scan for new networks and update the list returned by getVisibleNetworks.  This is only a request: the network subsystem can choose to ignore it.  If the list is updated, then the onNetworkListChanged event will be fired.",
242         "parameters": []
243       },
244       {
245         "name": "startConnect",
246         "description": "Starts a connection to the network with networkGuid.",
247         "parameters": [
248           {
249             "name": "networkGuid",
250             "type": "string",
251             "description": "The unique identifier of the network to connect to."
252           },
253           {
254             "name": "callback",
255             "type": "function",
256             "optional": true,
257             "parameters": [],
258             "description": "A callback function that indicates that a connection has been initiated."
259           }
260         ]
261       },
262       {
263         "name": "startDisconnect",
264         "description": "Starts a disconnect from the network with networkGuid.",
265         "parameters": [
266           {
267             "name": "networkGuid",
268             "type": "string",
269             "description": "The unique identifier of the network to disconnect from."
270           },
271           {
272             "name": "callback",
273             "type": "function",
274             "optional": true,
275             "parameters": [],
276             "description": "A callback function that indicates that a disconnect has been initiated."
277           }
278         ]
279       },
280       {
281         "name": "verifyDestination",
282         "description": "Verifies that the device is a trusted device.",
283         "parameters": [
284           {
285             "name": "properties",
286             "$ref": "VerificationProperties",
287             "description": "Properties of the destination to use in verifying that it is a trusted device."
288           },
289           {
290             "name": "callback",
291             "type": "function",
292             "parameters": [
293               {
294                 "name": "verified",
295                 "type": "boolean"
296               }
297             ],
298             "description": "A callback function that indicates whether or not the device is a trusted device."
299           }
300         ]
301       },
302       {
303         "name": "verifyAndEncryptCredentials",
304         "description": "Verifies that the device is a trusted device and retrieves encrypted network credentials.",
305         "parameters": [
306           {
307             "name": "properties",
308             "$ref": "VerificationProperties",
309             "description": "Properties of the destination to use in verifying that it is a trusted device."
310           },
311           {
312             "name": "guid",
313             "type": "string",
314             "description": "A string containing the unique identifier of the network to get credentials for."
315           },
316           {
317             "name": "callback",
318             "type": "function",
319             "parameters": [
320               {
321                 "name": "credentials",
322                 "type": "string"
323               }
324             ],
325             "description": "A callback function that receives base64-encoded encrypted credential data to send to a trusted device."
326           }
327         ]
328       },
329       {
330         "name": "verifyAndEncryptData",
331         "description": "Verifies that the device is a trusted device and encrypts supplied data with device public key.",
332         "parameters": [
333           {
334             "name": "properties",
335             "$ref": "VerificationProperties",
336             "description": "Properties of the destination to use in verifying that it is a trusted device."
337           },
338           {
339             "name": "data",
340             "type": "string",
341             "description": "A string containing the base64-encoded data to encrypt."
342           },
343           {
344             "name": "callback",
345             "type": "function",
346             "parameters": [
347               {
348                 "name": "encryptedData",
349                 "type": "string"
350               }
351             ],
352             "description": "A callback function that receives base64-encoded encrypted data to send to a trusted device."
353           }
354         ]
355       }
356     ],
357     "events": [
358       {
359         "name": "onNetworksChanged",
360         "type": "function",
361         "description": "Fired when the properties change on any of the networks.  Sends a list of identifiers for networks whose properties have changed.",
362         "parameters": [
363           {
364             "name": "changes",
365             "type": "array",
366             "items": { "type": "string" }
367           }
368         ]
369       },
370       {
371         "name": "onNetworkListChanged",
372         "type": "function",
373         "description": "Fired when the list of networks has changed.  Sends a complete list of identifiers for all the current networks.",
374         "parameters": [
375           {
376             "name": "changes",
377             "type": "array",
378             "items": { "type": "string" }
379           }
380         ]
381       }
382     ]
383   }
384 ]