Lantronix EDS3000PS Command Reference - Page 46

File System Web API

Page 46 highlights

5: Configuration Using Web API ); request.send( " group=Interface&optionalGroupInstance=eth0&action=Renew " ); File System Web API The File System Web API is a RESTful cloud API that allows basic manipulation of file system nodes (files and directories). It is intended to support web-based file system access without the need of a browser, and as such can be used in scripts with HTTP programs such as cURL. Supported file system node operations are implemented via various HTTP request types. The File System Web API uses standard HTTP requests as well as HTTP extensions from the Web Distributed Authoring and Versioning (WebDAV) standard. Four principal HTTP requests are implemented by the API: GET, PUT, MKCOL, and DELETE. HTTP GET Used to read the contents of files and directories in the file system. URL: http:///fs/[node] Where node can be a file, in which case the file content is returned, or a directory, in which case an XML-formatted list of directory objects is returned. HTTP Response Codes: 200: Success 404: Node not found Example: # curl -s -u admin:PASSWORD http://192.168.0.1/fs/embedded ]> main 0 modem_emulation 0 monitor 0 ntp 0 EDS3000 Command Reference 46

  • 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

5: Configuration Using Web API
EDS3000 Command Reference
46
);
request.send(
" group=Interface&optionalGroupInstance=eth0&action=Renew "
);
File System Web API
The File System Web API is a RESTful cloud API that allows basic manipulation of file system
nodes (files and directories). It is intended to support web-based file system access without the
need of a browser, and as such can be used in scripts with HTTP programs such as cURL.
Supported file system node operations are implemented via various HTTP request types. The File
System Web API uses standard HTTP requests as well as HTTP extensions from the Web
Distributed Authoring and Versioning (WebDAV) standard.
Four principal HTTP requests are implemented by the API: GET, PUT, MKCOL, and DELETE.
HTTP GET
Used to read the contents of files and directories in the file system.
URL:
http://<hostname>/fs/[node]
Where node can be a file, in which case the file content is returned, or a directory, in which case
an XML-formatted list of directory objects is returned.
HTTP Response Codes:
200: Success
404: Node not found
Example:
# curl -s -u admin:PASSWORD http://192.168.0.1/fs/embedded
<!-- Automatically generated XML -->
<!DOCTYPE directorylist [
<!ELEMENT dentry (name,size)>
<!ELEMENT name (#CDATA)>
<!ELEMENT size (#CDATA)>
<!ATTLIST dentry type CDATA #IMPLIED>
<!ATTLIST directorylist path CDATA #IMPLIED>
]>
<directorylist path = "/embedded">
<dentry type = directory>
<name>main</name>
<size>0</size>
</dentry>
<dentry type = directory>
<name>modem_emulation</name>
<size>0</size>
</dentry>
<dentry type = directory>
<name>monitor</name>
<size>0</size>
</dentry>
<dentry type = directory>
<name>ntp</name>
<size>0</size>