API файловой системы
Транспорт
AgentBox exposes this service through the Connect protocol over HTTP. The AgentBox SDK supplies the routing and authorization headers automatically.
- Базовый URL:
https://sandbox.agentbox-runtime.ru - Полное имя сервиса:
filesystem.Filesystem - Шаблон URL RPC:
POST https://sandbox.agentbox-runtime.ru/filesystem.Filesystem/{RPC}
Заголовки запроса
Agentbox-Sandbox-Id· обязательно — Sandbox identifier.Agentbox-Sandbox-Port· обязательно — Envd port routed by the sandbox proxy. По умолчанию:49983.X-Access-Token· при наличии — Sandbox-scoped envd access token, when one was issued.
Stat
Public RPC exposed by envd.
- URL RPC:
POST https://sandbox.agentbox-runtime.ru/filesystem.Filesystem/Stat - Запрос:
StatRequest - Ответ:
StatResponse
MakeDir
Public RPC exposed by envd.
- URL RPC:
POST https://sandbox.agentbox-runtime.ru/filesystem.Filesystem/MakeDir - Запрос:
MakeDirRequest - Ответ:
MakeDirResponse
Move
Public RPC exposed by envd.
- URL RPC:
POST https://sandbox.agentbox-runtime.ru/filesystem.Filesystem/Move - Запрос:
MoveRequest - Ответ:
MoveResponse
ListDir
Public RPC exposed by envd.
- URL RPC:
POST https://sandbox.agentbox-runtime.ru/filesystem.Filesystem/ListDir - Запрос:
ListDirRequest - Ответ:
ListDirResponse
Remove
Public RPC exposed by envd.
- URL RPC:
POST https://sandbox.agentbox-runtime.ru/filesystem.Filesystem/Remove - Запрос:
RemoveRequest - Ответ:
RemoveResponse
WatchDir
Public RPC exposed by envd.
- URL RPC:
POST https://sandbox.agentbox-runtime.ru/filesystem.Filesystem/WatchDir - Запрос:
WatchDirRequest - Ответ:
stream WatchDirResponse
CreateWatcher
Non-streaming versions of WatchDir
- URL RPC:
POST https://sandbox.agentbox-runtime.ru/filesystem.Filesystem/CreateWatcher - Запрос:
CreateWatcherRequest - Ответ:
CreateWatcherResponse
GetWatcherEvents
Public RPC exposed by envd.
- URL RPC:
POST https://sandbox.agentbox-runtime.ru/filesystem.Filesystem/GetWatcherEvents - Запрос:
GetWatcherEventsRequest - Ответ:
GetWatcherEventsResponse
RemoveWatcher
Public RPC exposed by envd.
- URL RPC:
POST https://sandbox.agentbox-runtime.ru/filesystem.Filesystem/RemoveWatcher - Запрос:
RemoveWatcherRequest - Ответ:
RemoveWatcherResponse
Типы сообщений
MoveRequest
| Поле | Тип | Номер | Описание |
|---|---|---|---|
source | string | 1 | |
destination | string | 2 |
MoveResponse
| Поле | Тип | Номер | Описание |
|---|---|---|---|
entry | EntryInfo | 1 |
MakeDirRequest
| Поле | Тип | Номер | Описание |
|---|---|---|---|
path | string | 1 |
MakeDirResponse
| Поле | Тип | Номер | Описание |
|---|---|---|---|
entry | EntryInfo | 1 |
RemoveRequest
| Поле | Тип | Номер | Описание |
|---|---|---|---|
path | string | 1 |
RemoveResponse
StatRequest
| Поле | Тип | Номер | Описание |
|---|---|---|---|
path | string | 1 |
StatResponse
| Поле | Тип | Номер | Описание |
|---|---|---|---|
entry | EntryInfo | 1 |
EntryInfo
| Поле | Тип | Номер | Описание |
|---|---|---|---|
name | string | 1 | |
type | FileType | 2 | |
path | string | 3 | |
size | int64 | 4 | |
mode | uint32 | 5 | |
permissions | string | 6 | |
owner | string | 7 | |
group | string | 8 | |
modified_time | google.protobuf.Timestamp | 9 | |
symlink_target | optional string | 10 | If the entry is a symlink, this field contains the target of the symlink. |
metadata | map<string, string> | 11 | User-defined metadata stored as extended attributes (xattrs) on the file. Keys live under the user.agentbox. xattr namespace; the prefix is stripped here. Plain user.* xattrs written by other tooling are not reflected. |
ListDirRequest
| Поле | Тип | Номер | Описание |
|---|---|---|---|
path | string | 1 | |
depth | uint32 | 2 |
ListDirResponse
| Поле | Тип | Номер | Описание |
|---|---|---|---|
entries | repeated EntryInfo | 1 |
WatchDirRequest
| Поле | Тип | Номер | Описание |
|---|---|---|---|
path | string | 1 | |
recursive | bool | 2 | |
include_entry | bool | 3 | If true, each FilesystemEvent includes the EntryInfo of the affected entry, when available. |
allow_network_mounts | bool | 4 | If true, allows watching paths on network filesystem mounts (NFS, CIFS, SMB, FUSE). Events on network mounts may be unreliable or not delivered at all. |
FilesystemEvent
| Поле | Тип | Номер | Описание |
|---|---|---|---|
name | string | 1 | |
type | EventType | 2 | |
entry | optional EntryInfo | 3 | Info of the entry that triggered the event. Only populated when include_entry was requested and the entry could be stat-ed (e.g. not set for remove/rename-away events, where the entry no longer exists at this path). |
WatchDirResponse
| Поле | Тип | Номер | Oneof | Описание |
|---|---|---|---|---|
start | StartEvent | 1 | event | |
filesystem | FilesystemEvent | 2 | event | |
keepalive | KeepAlive | 3 | event |
WatchDirResponse.StartEvent
WatchDirResponse.KeepAlive
CreateWatcherRequest
| Поле | Тип | Номер | Описание |
|---|---|---|---|
path | string | 1 | |
recursive | bool | 2 | |
include_entry | bool | 3 | If true, each FilesystemEvent includes the EntryInfo of the affected entry, when available. |
allow_network_mounts | bool | 4 | If true, allows watching paths on network filesystem mounts (NFS, CIFS, SMB, FUSE). Events on network mounts may be unreliable or not delivered at all. |
CreateWatcherResponse
| Поле | Тип | Номер | Описание |
|---|---|---|---|
watcher_id | string | 1 |
GetWatcherEventsRequest
| Поле | Тип | Номер | Описание |
|---|---|---|---|
watcher_id | string | 1 |
GetWatcherEventsResponse
| Поле | Тип | Номер | Описание |
|---|---|---|---|
events | repeated FilesystemEvent | 1 |
RemoveWatcherRequest
| Поле | Тип | Номер | Описание |
|---|---|---|---|
watcher_id | string | 1 |
RemoveWatcherResponse
Типы перечислений
FileType
| Значение | Номер | Описание |
|---|---|---|
FILE_TYPE_UNSPECIFIED | 0 | |
FILE_TYPE_FILE | 1 | |
FILE_TYPE_DIRECTORY | 2 | |
FILE_TYPE_SYMLINK | 3 |
EventType
| Значение | Номер | Описание |
|---|---|---|
EVENT_TYPE_UNSPECIFIED | 0 | |
EVENT_TYPE_CREATE | 1 | |
EVENT_TYPE_WRITE | 2 | |
EVENT_TYPE_REMOVE | 3 | |
EVENT_TYPE_RENAME | 4 | |
EVENT_TYPE_CHMOD | 5 |