From 63b23c4e6591083027b03be25258d4a3448cd0be Mon Sep 17 00:00:00 2001 From: Diptanu Choudhury Date: Tue, 15 Mar 2016 15:59:36 -0700 Subject: [PATCH] Added docs for the file system apis --- .../source/docs/http/client-fs-cat.html.md | 45 ++++++++++++++ website/source/docs/http/client-fs-ls.html.md | 58 +++++++++++++++++++ .../source/docs/http/client-fs-stat.html.md | 48 +++++++++++++++ 3 files changed, 151 insertions(+) create mode 100644 website/source/docs/http/client-fs-cat.html.md create mode 100644 website/source/docs/http/client-fs-ls.html.md create mode 100644 website/source/docs/http/client-fs-stat.html.md diff --git a/website/source/docs/http/client-fs-cat.html.md b/website/source/docs/http/client-fs-cat.html.md new file mode 100644 index 000000000..740481043 --- /dev/null +++ b/website/source/docs/http/client-fs-cat.html.md @@ -0,0 +1,45 @@ +--- +layout: "http" +page_title: "HTTP API: /v1/client/fs/cat" +sidebar_current: "docs-http-client-fs-cat" +description: |- + The '/1/client/fs/cat` endpoint is used to read the contents of a file in an + allocation directory. +--- + +# /v1/client/fs/cat + +The `fs/cat` endpoint is used to read the contents of a file in an allocation +directory. This API endpoint is hosted by the Nomad client and requests have to +be made to the Nomad client where the particular allocation is running. + +## GET + +
+
Description
+
+ Read contents of a file in an allocation directory. +
+ +
Method
+
GET
+ +
URL
+
`/v1/client/fs/cat`
+ +
Parameters
+
+ Path - The path relative to the root of the allocation directory. It + defaults to `/` +
+ +
Returns
+
+ ``` + 2016/03/15 15:40:56 [DEBUG] sylog-server: launching syslog server on addr: + /tmp/plugin096499590 + + ``` +
+ +
diff --git a/website/source/docs/http/client-fs-ls.html.md b/website/source/docs/http/client-fs-ls.html.md new file mode 100644 index 000000000..15f8c2d4f --- /dev/null +++ b/website/source/docs/http/client-fs-ls.html.md @@ -0,0 +1,58 @@ +--- +layout: "http" +page_title: "HTTP API: /v1/client/fs/ls" +sidebar_current: "docs-http-client-fs-ls" +description: |- + The '/1/client/fs/ls` endpoint is used to list files in an allocation + directory. +--- + +# /v1/client/fs/ls + +The `fs/ls` endpoint is used to list files in an allocation directory. This API +endpoint is hosted by the Nomad client and requests have to be made to the Nomad +client where the particular allocation is running. + +## GET + +
+
Description
+
+ List files in an allocation directory. +
+ +
Method
+
GET
+ +
URL
+
`/v1/client/fs/ls`
+ +
Parameters
+
+ Path - The path relative to the root of the allocation directory. It + defaults to `/` +
+ +
Returns
+
+ ```javascript + [ + { + "Name": "alloc", + "IsDir": true, + "Size": 4096, + "FileMode": "drwxrwxr-x", + "ModTime": "2016-03-15T15:40:00.414236712-07:00" + }, + { + "Name": "redis", + "IsDir": true, + "Size": 4096, + "FileMode": "drwxrwxr-x", + "ModTime": "2016-03-15T15:40:56.810238153-07:00" + } + ] + ``` +
+ +
diff --git a/website/source/docs/http/client-fs-stat.html.md b/website/source/docs/http/client-fs-stat.html.md new file mode 100644 index 000000000..661f5bbe2 --- /dev/null +++ b/website/source/docs/http/client-fs-stat.html.md @@ -0,0 +1,48 @@ +--- +layout: "http" +page_title: "HTTP API: /v1/client/fs/stat" +sidebar_current: "docs-http-client-fs-stat" +description: |- + The '/1/client/fs/stat` endpoint is used to stat a file in an allocation + directory. +--- + +# /v1/client/fs/stat + +The `fs/stat` endpoint is used to stat a file in an allocation directory. This +API endpoint is hosted by the Nomad client and requests have to be made to the +Nomad client where the particular allocation is running. + +## GET + +
+
Description
+
+ Stat a file in an allocation directory. +
+ +
Method
+
GET
+ +
URL
+
`/v1/client/fs/stat`
+ +
Parameters
+
+ Path - The path of the file relative to the root of the allocation directory. +
+ +
Returns
+
+ ```javascript + { + "Name": "redis-syslog-collector.out", + "IsDir": false, + "Size": 96, + "FileMode": "-rw-rw-r--", + "ModTime": "2016-03-15T15:40:56.822238153-07:00" + } + ``` +
+ +