mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-14 12:56:30 +00:00
Document new APIs around network mounts (#1762)
This commit is contained in:
parent
0f799b6399
commit
dd6d3a0de4
@ -1739,6 +1739,94 @@ Returns a dict with selected keys from other `/*/info` endpoints.
|
|||||||
|
|
||||||
</ApiEndpoint>
|
</ApiEndpoint>
|
||||||
|
|
||||||
|
### Mounts
|
||||||
|
|
||||||
|
<ApiEndpoint path="/mounts" method="get">
|
||||||
|
Returns information about mounts configured in Supervisor
|
||||||
|
|
||||||
|
**Returned data:**
|
||||||
|
|
||||||
|
| key | type | description |
|
||||||
|
| ---------------- | ---------- | -------------------------------------------------- |
|
||||||
|
| mounts | list | A list of [Mounts](api/supervisor/models.md#mount) |
|
||||||
|
|
||||||
|
**Example response:**
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"mounts": [
|
||||||
|
{
|
||||||
|
"name": "my_share",
|
||||||
|
"usage": "media",
|
||||||
|
"type": "cifs",
|
||||||
|
"server": "server.local",
|
||||||
|
"share": "media",
|
||||||
|
"state": "active"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
</ApiEndpoint>
|
||||||
|
|
||||||
|
<ApiEndpoint path="/mounts" method="post">
|
||||||
|
Add a new mount in Supervisor and mount it
|
||||||
|
|
||||||
|
**Payload:**
|
||||||
|
|
||||||
|
Accepts a [Mount](api/supervisor/models.md#mount)
|
||||||
|
|
||||||
|
Value in `name` must be unique and can only consist of letters, numbers and underscores.
|
||||||
|
|
||||||
|
**Example payload:**
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"name": "my_share",
|
||||||
|
"usage": "media",
|
||||||
|
"type": "cifs",
|
||||||
|
"server": "server.local",
|
||||||
|
"share": "media",
|
||||||
|
"username": "admin",
|
||||||
|
"password": "password"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
</ApiEndpoint>
|
||||||
|
|
||||||
|
<ApiEndpoint path="/mounts/<name>" method="put">
|
||||||
|
Update an existing mount in Supervisor and remount it
|
||||||
|
|
||||||
|
**Payload:**
|
||||||
|
|
||||||
|
Accepts a [Mount](api/supervisor/models.md#mount).
|
||||||
|
|
||||||
|
The `name` field should be omitted. If included the value must match the existing
|
||||||
|
name, it cannot be changed. Delete and re-add the mount to change the name.
|
||||||
|
|
||||||
|
**Example payload:**
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"usage": "media",
|
||||||
|
"type": "nfs",
|
||||||
|
"server": "server.local",
|
||||||
|
"path": "/media/camera"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
</ApiEndpoint>
|
||||||
|
|
||||||
|
<ApiEndpoint path="/mounts/<name>" method="delete">
|
||||||
|
Unmount and delete an existing mount from Supervisor.
|
||||||
|
|
||||||
|
</ApiEndpoint>
|
||||||
|
|
||||||
|
<ApiEndpoint path="/mounts/<name>/reload" method="post">
|
||||||
|
Unmount and remount an existing mount in Supervisor using the same configuration.
|
||||||
|
|
||||||
|
</ApiEndpoint>
|
||||||
|
|
||||||
### Multicast
|
### Multicast
|
||||||
|
|
||||||
<ApiEndpoint path="/multicast/info" method="get">
|
<ApiEndpoint path="/multicast/info" method="get">
|
||||||
|
@ -266,3 +266,21 @@ The `content` key of a backup object contains the following keys:
|
|||||||
| size | int | Size of disk in bytes |
|
| size | int | Size of disk in bytes |
|
||||||
| id | string | Unique ID for the disk device (either UDisks2 drive ID or device path) |
|
| id | string | Unique ID for the disk device (either UDisks2 drive ID or device path) |
|
||||||
| dev_path | string | Device path for the disk device |
|
| dev_path | string | Device path for the disk device |
|
||||||
|
|
||||||
|
## Mount
|
||||||
|
|
||||||
|
| key | type | description | request/response |
|
||||||
|
| ---------- | -------------- | ---------------------------------------------------------------------- | ---------------- |
|
||||||
|
| name | string | Name of the mount | both |
|
||||||
|
| type | string | Type of the mount (cifs or nfs) | both |
|
||||||
|
| usage | string | Usage of the mount (backup or media) | both |
|
||||||
|
| server | string | IP address or hostname of the network share server | both |
|
||||||
|
| port | int | Port to use (if not using the standard one for the mount type) | both |
|
||||||
|
| path | string | (nfs mounts only) Path to mount from the network share | both |
|
||||||
|
| share | string | (cifs mounts only) Share to mount from the network share | both |
|
||||||
|
| username | string | (cifs mounts only) Username to use for authentication | request only |
|
||||||
|
| password | string | (cifs mounts only) Password to use for authentication | request only |
|
||||||
|
| state | string | Current state of the mount (active, failed, etc.) | response only |
|
||||||
|
|
||||||
|
Request only fields may be included in requests but will never be in responses.
|
||||||
|
Response only fields will be in responses but cannot be included in requests.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user