File system API schema
service.fs.graphqls
To authenticate API requests, you’ll need an API token. Learn how to generate an access token.
See usage examples in the cloudbeaver-graphql-examples repository.
You can try queries in the built-in GraphQL console, available on your server at https://your-server-address/api/gql/console. This tool lets you test requests directly from your browser.
For a live example, see the demo GraphQL console.
API Endpoints
https://your-server-address/api/gql
Queries
fsFile
Description
Returns file info for the specified node path
Example
Query
query fsFile($nodePath: String!) {
fsFile(nodePath: $nodePath) {
name
length
folder
metaData
nodePath
}
}
Variables
{"nodePath": "<string>"}
Response
{
"data": {
"fsFile": {
"name": "<string>",
"length": "<int>",
"folder": "<boolean>",
"metaData": "<object>",
"nodePath": "<string>"
}
}
}
fsFileSystem
Description
Returns file system information for the specified project and node path
Response
Returns an FSFileSystem!
Example
Query
query fsFileSystem(
$projectId: ID!,
$nodePath: String!
) {
fsFileSystem(
projectId: $projectId,
nodePath: $nodePath
) {
id
nodePath
requiredAuth
}
}
Variables
{"projectId": "<id>", "nodePath": "<string>"}
Response
{
"data": {
"fsFileSystem": {
"id": "<id>",
"nodePath": "<string>",
"requiredAuth": "<string>"
}
}
}
fsListFileSystems
Description
Returns available file systems for the specified project
Response
Returns [FSFileSystem!]!
Arguments
| Name | Description |
|---|---|
projectId - ID!
|
Example
Query
query fsListFileSystems($projectId: ID!) {
fsListFileSystems(projectId: $projectId) {
id
nodePath
requiredAuth
}
}
Variables
{"projectId": "<id>"}
Response
{
"data": {
"fsListFileSystems": [
{"id": "<id>", "nodePath": "<string>", "requiredAuth": "<string>"}
]
}
}
fsListFiles
Description
Returns list of files and folders in the specified folder path
Response
Returns [FSFile!]!
Arguments
| Name | Description |
|---|---|
folderPath - String!
|
Example
Query
query fsListFiles($folderPath: String!) {
fsListFiles(folderPath: $folderPath) {
name
length
folder
metaData
nodePath
}
}
Variables
{"folderPath": "<string>"}
Response
{
"data": {
"fsListFiles": [
{
"name": "<string>",
"length": "<int>",
"folder": "<boolean>",
"metaData": "<object>",
"nodePath": "<string>"
}
]
}
}
fsReadFileContentAsString
Description
Reads file contents as string in UTF-8
Mutations
fsCopy
Description
Copies file or folder to the specified parent path. Returns updated file info
Response
Returns an FSFile!
Example
Query
mutation fsCopy(
$nodePath: String!,
$toParentNodePath: String!
) {
fsCopy(
nodePath: $nodePath,
toParentNodePath: $toParentNodePath
) {
name
length
folder
metaData
nodePath
}
}
Variables
{"nodePath": "<string>", "toParentNodePath": "<string>"}
Response
{
"data": {
"fsCopy": {
"name": "<string>",
"length": "<int>",
"folder": "<boolean>",
"metaData": "<object>",
"nodePath": "<string>"
}
}
}
fsCreateFile
Description
Creates a new file in the specified parent path
Example
Query
mutation fsCreateFile(
$parentPath: String!,
$fileName: String!
) {
fsCreateFile(
parentPath: $parentPath,
fileName: $fileName
) {
name
length
folder
metaData
nodePath
}
}
Variables
{"parentPath": "<string>", "fileName": "<string>"}
Response
{
"data": {
"fsCreateFile": {
"name": "<string>",
"length": "<int>",
"folder": "<boolean>",
"metaData": "<object>",
"nodePath": "<string>"
}
}
}
fsCreateFolder
Description
Creates a new folder in the specified parent path
Example
Query
mutation fsCreateFolder(
$parentPath: String!,
$folderName: String!
) {
fsCreateFolder(
parentPath: $parentPath,
folderName: $folderName
) {
name
length
folder
metaData
nodePath
}
}
Variables
{"parentPath": "<string>", "folderName": "<string>"}
Response
{
"data": {
"fsCreateFolder": {
"name": "<string>",
"length": "<int>",
"folder": "<boolean>",
"metaData": "<object>",
"nodePath": "<string>"
}
}
}
fsDelete
Description
Deletes file or folder by node path. Returns true if file was deleted, false if file not found
fsMove
Description
Moves file or folder to the specified parent path. Returns updated file info
Response
Returns an FSFile!
Example
Query
mutation fsMove(
$nodePath: String!,
$toParentNodePath: String!
) {
fsMove(
nodePath: $nodePath,
toParentNodePath: $toParentNodePath
) {
name
length
folder
metaData
nodePath
}
}
Variables
{"nodePath": "<string>", "toParentNodePath": "<string>"}
Response
{
"data": {
"fsMove": {
"name": "<string>",
"length": "<int>",
"folder": "<boolean>",
"metaData": "<object>",
"nodePath": "<string>"
}
}
}
fsRename
Description
Renames file or folder by node path. Returns updated file info
Example
Query
mutation fsRename(
$nodePath: String!,
$newName: String!
) {
fsRename(
nodePath: $nodePath,
newName: $newName
) {
name
length
folder
metaData
nodePath
}
}
Variables
{"nodePath": "<string>", "newName": "<string>"}
Response
{
"data": {
"fsRename": {
"name": "<string>",
"length": "<int>",
"folder": "<boolean>",
"metaData": "<object>",
"nodePath": "<string>"
}
}
}
fsWriteFileStringContent
Description
Writes string content to the file. If forceOverwrite is true then overwrites existing file, otherwise throws an error if file already exists
Response
Returns an FSFile!
Example
Query
mutation fsWriteFileStringContent(
$nodePath: String!,
$data: String!,
$forceOverwrite: Boolean!
) {
fsWriteFileStringContent(
nodePath: $nodePath,
data: $data,
forceOverwrite: $forceOverwrite
) {
name
length
folder
metaData
nodePath
}
}
Variables
{"nodePath": "<string>", "data": "<string>", "forceOverwrite": "<boolean>"}
Response
{
"data": {
"fsWriteFileStringContent": {
"name": "<string>",
"length": "<int>",
"folder": "<boolean>",
"metaData": "<object>",
"nodePath": "<string>"
}
}
}
Types
Boolean
Description
The Boolean scalar type represents true or false.
Example
"<boolean>"
FSFile
Example
{
"name": "<string>",
"length": "<int>",
"folder": "<boolean>",
"metaData": "<object>",
"nodePath": "<string>"
}
FSFileSystem
ID
Description
The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.
Example
"<id>"
Int
Description
The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.
Example
"<int>"
Object
Description
Any object (JSON)
Example
"<object>"
String
Description
The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.
Example
"<string>"