Added docs for the file system apis

This commit is contained in:
Diptanu Choudhury 2016-03-15 15:59:36 -07:00
parent a21805c3df
commit 63b23c4e65
3 changed files with 151 additions and 0 deletions

View file

@ -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
<dl>
<dt>Description</dt>
<dd>
Read contents of a file in an allocation directory.
</dd>
<dt>Method</dt>
<dd>GET</dd>
<dt>URL</dt>
<dd>`/v1/client/fs/cat`</dd>
<dt>Parameters</dt>
<dd>
Path - The path relative to the root of the allocation directory. It
defaults to `/`
</dd>
<dt>Returns</dt>
<dd>
```
2016/03/15 15:40:56 [DEBUG] sylog-server: launching syslog server on addr:
/tmp/plugin096499590
```
</dd>
</dl>

View file

@ -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
<dl>
<dt>Description</dt>
<dd>
List files in an allocation directory.
</dd>
<dt>Method</dt>
<dd>GET</dd>
<dt>URL</dt>
<dd>`/v1/client/fs/ls`</dd>
<dt>Parameters</dt>
<dd>
Path - The path relative to the root of the allocation directory. It
defaults to `/`
</dd>
<dt>Returns</dt>
<dd>
```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"
}
]
```
</dd>
</dl>

View file

@ -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
<dl>
<dt>Description</dt>
<dd>
Stat a file in an allocation directory.
</dd>
<dt>Method</dt>
<dd>GET</dd>
<dt>URL</dt>
<dd>`/v1/client/fs/stat`</dd>
<dt>Parameters</dt>
<dd>
Path - The path of the file relative to the root of the allocation directory.
</dd>
<dt>Returns</dt>
<dd>
```javascript
{
"Name": "redis-syslog-collector.out",
"IsDir": false,
"Size": 96,
"FileMode": "-rw-rw-r--",
"ModTime": "2016-03-15T15:40:56.822238153-07:00"
}
```
</dd>
</dl>