description:'offset, in bytes, from the start. If not specified 0 must be assumed'
required:false
schema:
type:integer
format:int64
get:
tags:
- fs
summary:Opens the named file for reading
operationId:open
responses:
'200':
description:successful operation
content:
'*/*':
schema:
type:string
format:binary
401:
$ref:'#/components/responses/Unauthorized'
403:
$ref:'#/components/responses/Forbidden'
404:
$ref:'#/components/responses/NotFound'
500:
$ref:'#/components/responses/InternalServerError'
501:
$ref:'#/components/responses/NotImplemented'
default:
$ref:'#/components/responses/DefaultResponse'
/create/{name}:
parameters:
- name:name
in:path
description:object name
required:true
schema:
type:string
- name:flags
in:query
description: 'flags to use for opening the file, if omitted O_RDWR|O_CREATE|O_TRUNC must be assumed. Supported flags:https://pkg.go.dev/os#pkg-constants'
required:false
schema:
type:integer
format:int32
post:
tags:
- fs
summary:Creates or opens the named file for writing
operationId:create
requestBody:
content:
'*/*':
schema:
type:string
format:binary
required:true
responses:
201:
$ref:'#/components/responses/OKResponse'
401:
$ref:'#/components/responses/Unauthorized'
403:
$ref:'#/components/responses/Forbidden'
404:
$ref:'#/components/responses/NotFound'
500:
$ref:'#/components/responses/InternalServerError'
501:
$ref:'#/components/responses/NotImplemented'
default:
$ref:'#/components/responses/DefaultResponse'
/rename/{name}:
parameters:
- name:name
in:path
description:object name
required:true
schema:
type:string
- name:target
in:query
description:target name
required:true
schema:
type:string
patch:
tags:
- fs
summary:Renames (moves) source to target
operationId:rename
responses:
200:
$ref:'#/components/responses/OKResponse'
401:
$ref:'#/components/responses/Unauthorized'
403:
$ref:'#/components/responses/Forbidden'
404:
$ref:'#/components/responses/NotFound'
500:
$ref:'#/components/responses/InternalServerError'
501:
$ref:'#/components/responses/NotImplemented'
default:
$ref:'#/components/responses/DefaultResponse'
/remove/{name}:
parameters:
- name:name
in:path
description:object name
required:true
schema:
type:string
delete:
tags:
- fs
summary:Removes the named file or (empty) directory.
operationId:delete
responses:
200:
$ref:'#/components/responses/OKResponse'
401:
$ref:'#/components/responses/Unauthorized'
403:
$ref:'#/components/responses/Forbidden'
404:
$ref:'#/components/responses/NotFound'
500:
$ref:'#/components/responses/InternalServerError'
501:
$ref:'#/components/responses/NotImplemented'
default:
$ref:'#/components/responses/DefaultResponse'
/mkdir/{name}:
parameters:
- name:name
in:path
description:object name
required:true
schema:
type:string
post:
tags:
- fs
summary:Creates a new directory with the specified name
operationId:mkdir
responses:
200:
$ref:'#/components/responses/OKResponse'
401:
$ref:'#/components/responses/Unauthorized'
403:
$ref:'#/components/responses/Forbidden'
404:
$ref:'#/components/responses/NotFound'
500:
$ref:'#/components/responses/InternalServerError'
501:
$ref:'#/components/responses/NotImplemented'
default:
$ref:'#/components/responses/DefaultResponse'
/chmod/{name}:
parameters:
- name:name
in:path
description:object name
required:true
schema:
type:string
- name:mode
in:query
required:true
schema:
type:integer
patch:
tags:
- fs
summary:Changes the mode of the named file
operationId:chmod
responses:
200:
$ref:'#/components/responses/OKResponse'
401:
$ref:'#/components/responses/Unauthorized'
403:
$ref:'#/components/responses/Forbidden'
404:
$ref:'#/components/responses/NotFound'
500:
$ref:'#/components/responses/InternalServerError'
501:
$ref:'#/components/responses/NotImplemented'
default:
$ref:'#/components/responses/DefaultResponse'
/chtimes/{name}:
parameters:
- name:name
in:path
description:object name
required:true
schema:
type:string
- name:access_time
in:query
required:true
schema:
type:string
format:date-time
- name:modification_time
in:query
required:true
schema:
type:string
format:date-time
patch:
tags:
- fs
summary:Changes the access and modification time of the named file
operationId:chtimes
responses:
200:
$ref:'#/components/responses/OKResponse'
401:
$ref:'#/components/responses/Unauthorized'
403:
$ref:'#/components/responses/Forbidden'
404:
$ref:'#/components/responses/NotFound'
500:
$ref:'#/components/responses/InternalServerError'
501:
$ref:'#/components/responses/NotImplemented'
default:
$ref:'#/components/responses/DefaultResponse'
/truncate/{name}:
parameters:
- name:name
in:path
description:object name
required:true
schema:
type:string
- name:size
in:query
required:true
description:'new file size in bytes'
schema:
type:integer
format:int64
patch:
tags:
- fs
summary:Changes the size of the named file
operationId:truncate
responses:
200:
$ref:'#/components/responses/OKResponse'
401:
$ref:'#/components/responses/Unauthorized'
403:
$ref:'#/components/responses/Forbidden'
404:
$ref:'#/components/responses/NotFound'
500:
$ref:'#/components/responses/InternalServerError'
501:
$ref:'#/components/responses/NotImplemented'
default:
$ref:'#/components/responses/DefaultResponse'
/readdir/{name}:
parameters:
- name:name
in:path
description:object name
required:true
schema:
type:string
get:
tags:
- fs
summary:Reads the named directory and returns the contents
operationId:readdir
responses:
200:
description:successful operation
content:
application/json:
schema:
type:array
items:
$ref:'#/components/schemas/FileInfo'
401:
$ref:'#/components/responses/Unauthorized'
403:
$ref:'#/components/responses/Forbidden'
404:
$ref:'#/components/responses/NotFound'
500:
$ref:'#/components/responses/InternalServerError'
501:
$ref:'#/components/responses/NotImplemented'
default:
$ref:'#/components/responses/DefaultResponse'
/dirsize/{name}:
parameters:
- name:name
in:path
description:object name
required:true
schema:
type:string
get:
tags:
- fs
summary:Returns the number of files and the size for the named directory including any sub-directory
operationId:dirsize
responses:
200:
description:successful operation
content:
application/json:
schema:
type:object
properties:
files:
type:integer
description:'Total number of files'
size:
type:integer
format:int64
description:'Total size of files'
401:
$ref:'#/components/responses/Unauthorized'
403:
$ref:'#/components/responses/Forbidden'
404:
$ref:'#/components/responses/NotFound'
500:
$ref:'#/components/responses/InternalServerError'
501:
$ref:'#/components/responses/NotImplemented'
default:
$ref:'#/components/responses/DefaultResponse'
/mimetype/{name}:
parameters:
- name:name
in:path
description:object name
required:true
schema:
type:string
get:
tags:
- fs
summary:Returns the mime type for the named file
operationId:mimetype
responses:
200:
description:successful operation
content:
application/json:
schema:
type:object
properties:
mime:
type:string
401:
$ref:'#/components/responses/Unauthorized'
403:
$ref:'#/components/responses/Forbidden'
404:
$ref:'#/components/responses/NotFound'
500:
$ref:'#/components/responses/InternalServerError'
501:
$ref:'#/components/responses/NotImplemented'
default:
$ref:'#/components/responses/DefaultResponse'
/statvfs/{name}:
parameters:
- name:name
in:path
description:object name
required:true
schema:
type:string
get:
tags:
- fs
summary:Returns the VFS stats for the specified path
operationId:statvfs
responses:
200:
description:successful operation
content:
application/json:
schema:
$ref:'#/components/schemas/StatVFS'
401:
$ref:'#/components/responses/Unauthorized'
403:
$ref:'#/components/responses/Forbidden'
404:
$ref:'#/components/responses/NotFound'
500:
$ref:'#/components/responses/InternalServerError'
501:
$ref:'#/components/responses/NotImplemented'
default:
$ref:'#/components/responses/DefaultResponse'
components:
responses:
OKResponse:
description:successful operation
content:
application/json:
schema:
$ref:'#/components/schemas/ApiResponse'
BadRequest:
description:Bad Request
content:
application/json:
schema:
$ref:'#/components/schemas/ApiResponse'
Unauthorized:
description:Unauthorized
content:
application/json:
schema:
$ref:'#/components/schemas/ApiResponse'
Forbidden:
description:Forbidden
content:
application/json:
schema:
$ref:'#/components/schemas/ApiResponse'
NotFound:
description:Not Found
content:
application/json:
schema:
$ref:'#/components/schemas/ApiResponse'
NotImplemented:
description:Not Implemented
content:
application/json:
schema:
$ref:'#/components/schemas/ApiResponse'
Conflict:
description:Conflict
content:
application/json:
schema:
$ref:'#/components/schemas/ApiResponse'
RequestEntityTooLarge:
description:Request Entity Too Large, max allowed size exceeded
content:
application/json:
schema:
$ref:'#/components/schemas/ApiResponse'
InternalServerError:
description:Internal Server Error
content:
application/json:
schema:
$ref:'#/components/schemas/ApiResponse'
DefaultResponse:
description:Unexpected Error
content:
application/json:
schema:
$ref:'#/components/schemas/ApiResponse'
schemas:
ApiResponse:
type:object
properties:
message:
type:string
description:'message, can be empty'
error:
type:string
description:error description if any
FileInfo:
type:object
properties:
name:
type:string
description:base name of the file
size:
type:integer
format:int64
description:length in bytes for regular files; system-dependent for others
mode:
type:integer
description:|
File mode and permission bits. More details here:https://golang.org/pkg/io/fs/#FileMode.