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

Response

Returns an FSFile!

Arguments
Name Description
nodePath - String!

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!

Arguments
Name Description
projectId - ID!
nodePath - String!

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

Response

Returns a String!

Arguments
Name Description
nodePath - String!

Example

Query
query fsReadFileContentAsString($nodePath: String!) {
  fsReadFileContentAsString(nodePath: $nodePath)
}
Variables
{"nodePath": "<string>"}
Response
{
  "data": {
    "fsReadFileContentAsString": "<string>"
  }
}

Mutations

fsCopy

Description

Copies file or folder to the specified parent path. Returns updated file info

Response

Returns an FSFile!

Arguments
Name Description
nodePath - String!
toParentNodePath - String!

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

Response

Returns an FSFile!

Arguments
Name Description
parentPath - String!
fileName - String!

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

Response

Returns an FSFile!

Arguments
Name Description
parentPath - String!
folderName - String!

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

Response

Returns a Boolean!

Arguments
Name Description
nodePath - String!

Example

Query
mutation fsDelete($nodePath: String!) {
  fsDelete(nodePath: $nodePath)
}
Variables
{"nodePath": "<string>"}
Response
{"data": {"fsDelete": "<boolean>"}}

fsMove

Description

Moves file or folder to the specified parent path. Returns updated file info

Response

Returns an FSFile!

Arguments
Name Description
nodePath - String!
toParentNodePath - String!

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

Response

Returns an FSFile!

Arguments
Name Description
nodePath - String!
newName - String!

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!

Arguments
Name Description
nodePath - String!
data - String!
forceOverwrite - Boolean!

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

Fields
Field Name Description
name - String! Name of the file or folder
length - Int! Length of the file in bytes
folder - Boolean! Flag indicating if the file is a folder
metaData - Object! Metadata of the file or folder
nodePath - String! Navigator tree node path
Example
{
  "name": "<string>",
  "length": "<int>",
  "folder": "<boolean>",
  "metaData": "<object>",
  "nodePath": "<string>"
}

FSFileSystem

Fields
Field Name Description
id - ID! File system ID
nodePath - String! Navigator tree node path
requiredAuth - String External auth provider ID if file system requires authentication
Example
{"id": "<id>", "nodePath": "<string>", "requiredAuth": "<string>"}

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>"