From 63b23c4e6591083027b03be25258d4a3448cd0be Mon Sep 17 00:00:00 2001 From: Diptanu Choudhury Date: Tue, 15 Mar 2016 15:59:36 -0700 Subject: [PATCH 1/2] 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" + } + ``` +
+ +
From 8e81dc7ff8a8b9fd5d679ceae02660955049abac Mon Sep 17 00:00:00 2001 From: captainill Date: Tue, 15 Mar 2016 16:55:59 -0700 Subject: [PATCH 2/2] update sidebar. change layout specified in http/index --- website/Gemfile.lock | 3 --- website/source/docs/http/client-fs-cat.html.md | 18 +++++++++++++----- website/source/docs/http/client-fs-ls.html.md | 18 +++++++++++++----- .../source/docs/http/client-fs-stat.html.md | 16 ++++++++++++---- website/source/docs/http/index.html.md | 3 --- website/source/layouts/http.erb | 16 ++++++++++++++++ 6 files changed, 54 insertions(+), 20 deletions(-) diff --git a/website/Gemfile.lock b/website/Gemfile.lock index 033f93252..7358619d0 100644 --- a/website/Gemfile.lock +++ b/website/Gemfile.lock @@ -188,6 +188,3 @@ PLATFORMS DEPENDENCIES middleman-hashicorp! - -BUNDLED WITH - 1.10.6 diff --git a/website/source/docs/http/client-fs-cat.html.md b/website/source/docs/http/client-fs-cat.html.md index 740481043..b7abedf38 100644 --- a/website/source/docs/http/client-fs-cat.html.md +++ b/website/source/docs/http/client-fs-cat.html.md @@ -9,9 +9,9 @@ description: |- # /v1/client/fs/cat -The `fs/cat` endpoint is used to read the contents of a file in an allocation +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. +be made to the Nomad client where the particular allocation was placed. ## GET @@ -25,21 +25,29 @@ be made to the Nomad client where the particular allocation is running.
GET
URL
-
`/v1/client/fs/cat`
+
`/v1/client/fs/cat/`
Parameters
- Path - The path relative to the root of the allocation directory. It - defaults to `/` +
    +
  • + path + required + 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 index 15f8c2d4f..fc6598519 100644 --- a/website/source/docs/http/client-fs-ls.html.md +++ b/website/source/docs/http/client-fs-ls.html.md @@ -9,9 +9,9 @@ description: |- # /v1/client/fs/ls -The `fs/ls` endpoint is used to list files in an allocation directory. This API +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. +client where the particular allocation was placed. ## GET @@ -25,16 +25,23 @@ client where the particular allocation is running.
GET
URL
-
`/v1/client/fs/ls`
+
`/v1/client/fs/ls/`
Parameters
- Path - The path relative to the root of the allocation directory. It - defaults to `/` +
    +
  • + path + required + The path relative to the root of the allocation directory. It + defaults to `/`, the root of the allocation directory. +
  • +
Returns
+ ```javascript [ { @@ -53,6 +60,7 @@ client where the particular allocation is running. } ] ``` +
diff --git a/website/source/docs/http/client-fs-stat.html.md b/website/source/docs/http/client-fs-stat.html.md index 661f5bbe2..8fe428667 100644 --- a/website/source/docs/http/client-fs-stat.html.md +++ b/website/source/docs/http/client-fs-stat.html.md @@ -9,9 +9,9 @@ description: |- # /v1/client/fs/stat -The `fs/stat` endpoint is used to stat a file in an allocation directory. This +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. +Nomad client where the particular allocation was placed. ## GET @@ -25,15 +25,22 @@ Nomad client where the particular allocation is running.
GET
URL
-
`/v1/client/fs/stat`
+
`/v1/client/fs/stat/`
Parameters
- Path - The path of the file relative to the root of the allocation directory. +
    +
  • + path + required + The path of the file relative to the root of the allocation directory. +
  • +
Returns
+ ```javascript { "Name": "redis-syslog-collector.out", @@ -43,6 +50,7 @@ Nomad client where the particular allocation is running. "ModTime": "2016-03-15T15:40:56.822238153-07:00" } ``` +
diff --git a/website/source/docs/http/index.html.md b/website/source/docs/http/index.html.md index 7ed3f0dbd..85a691638 100644 --- a/website/source/docs/http/index.html.md +++ b/website/source/docs/http/index.html.md @@ -91,6 +91,3 @@ appropriate region. By default, the output of all HTTP API requests is minimized JSON. If the client passes `pretty` on the query string, formatted JSON will be returned. - - - diff --git a/website/source/layouts/http.erb b/website/source/layouts/http.erb index bca83a2aa..36c523f75 100644 --- a/website/source/layouts/http.erb +++ b/website/source/layouts/http.erb @@ -88,6 +88,22 @@ + > + Client + + > Regions