Environment

environment.File

Estimated reading: 21 minutes 451 views
Namespace: Environment
REST: https://[hoster-api-host]/1.0/environment/file/rest/{method-name}
Scripting: environment.file.{method-name}
The File Manager API service gives you access to the container’s home directory and your environment’s configuration files. You can read, write, create, delete, and adjust your application files and settings.

Methods

AddFavorite (envName, session, [nodeGroup], [nodeId], path, [keyword], [filter], [isDir] ) :

reates a new “Favorite” shortcut for quick access to the container’s file or directory when working via the dashboard’s built-in file manager.

URL

https://[hoster-api-host]/1.0/environment/file/rest/addfavorite

Parameters

  • envName : “string”

    target environment name.

  • session : “string”
  • nodeGroup : “string” (optional)

    unique identifier of the target node group (layer), e.g. “cp” for the default application server layer.

  • nodeId : “int” (optional)

    unique identifier of the target node (container).

  • path : “string”

    absolute path to the file or directory for quick access.

  • keyword : “string” (optional)

    custom name of the favorite shortcut.

  • filter : “string” (optional)

    regex expression to filter a list of files displayed via the shortcut (up to 255 characters).

  • isDir : “boolean” (optional)

    defines whether shortcut points to the directory (true) or file (false).

Example

Method: POST

https://[hoster-api-host]/1.0/environment/file/rest/addfavorite?filter=[string]&path=[string]&envName=[string]&session=[string]&keyword=[string]&nodeGroup=[string]&nodeId=[int]&isDir=[boolean]

Response

  • Response
    {
       "error": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

AddMountPointByGroup (envName, session, nodeGroup, path, [protocol], [sourceHost], sourcePath, [sourceNodeId], [name], [readOnly], [sourceAddressType] ) : 

Creates a new mount point to share data between nodes in the layer and remote instance (learn more in the documentation).

URL

https://[hoster-api-host]/1.0/environment/file/rest/addmountpointbygroup

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • nodeGroup : “string”

    unique identifier of the target node group (layer), e.g. “cp” for the default application server layer.

  • path : “string”

    absolute path to the local folder where remote data will be shown at.

  • protocol : “string” (optional)

    data sharing protocol (“NFS”, “NFS3”, “NFS4”, “LOCAL”, “WEBDAV”, “GLUSTER”).

  • sourceHost : “string” (optional)

    host or IP address of the remote server where the data is physically stored.

  • sourcePath : “string”

    absolute path to the files on your remote node/server where the data is physically stored.

  • sourceNodeId : “int” (optional)

    unique identifier of the remote node where the data is physically stored.

  • name : “string” (optional)

    custom name for the mount point (local folder name is used if not specified).

  • readOnly : “boolean” (optional)

    defines access rights for the mounted files – read only (true) or read and write (false).

  • sourceAddressType : “string” (optional)

    source address type (“IP” or 0 | “DOMAIN” or 1 | “NODE_GROUP” or 2).

Example

Method: POST

https://[hoster-api-host]/1.0/environment/file/rest/addmountpointbygroup?path=[string]&protocol=[string]&envName=[string]&session=[string]&sourceNodeId=[int]&sourceHost=[string]&name=[string]&readOnly=[boolean]&nodeGroup=[string]&sourcePath=[string]&sourceAddressType=[string]

Response

  • Response
    {
       "error": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

AddMountPointById (envName, session, nodeId, path, [protocol], [sourceHost], sourcePath, [sourceNodeId], [name], [readOnly], [sourceAddressType] ) :

Creates a new mount point to share data between two instances (learn more in the documentation).

URL

https://[hoster-api-host]/1.0/environment/file/rest/addmountpointbyid

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • nodeId : “int”

    unique identifier of the target node (container).

  • path : “string”

    absolute path to the local folder where remote data will be shown at.

  • protocol : “string” (optional)

    data sharing protocol (“NFS”, “NFS3”, “NFS4”, “LOCAL”, “WEBDAV”, “GLUSTER”).

  • sourceHost : “string” (optional)

    host or IP address of the remote server where the data is physically stored.

  • sourcePath : “string”

    absolute path to the files on your remote node/server where the data is physically stored.

  • sourceNodeId : “int” (optional)

    unique identifier of the remote node where the data is physically stored.

  • name : “string” (optional)

    custom name for the mount point (local folder name is used if not specified).

  • readOnly : “boolean” (optional)

    defines access rights for the mounted files – read only (true) or read and write (false).

  • sourceAddressType : “string” (optional)

    source address type (“IP” or 0 | “DOMAIN” or 1 | “NODE_GROUP” or 2).

Example

Method: POST

https://[hoster-api-host]/1.0/environment/file/rest/addmountpointbyid?path=[string]&protocol=[string]&envName=[string]&session=[string]&sourceNodeId=[int]&sourceHost=[string]&name=[string]&readOnly=[boolean]&nodeId=[int]&sourcePath=[string]&sourceAddressType=[string]

Response

  • Response
    {
       "error": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

Append (envName, session, path, [body], [nodeType], [nodeGroup], [masterOnly], [nodeid] ) :

Writes a text at the end of the specified file.

URL

https://[hoster-api-host]/1.0/environment/file/rest/append

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • path : “string”

    absolute path to the file, where the text should be added.

  • body : “string” (optional)

    text that should be added to the file.

  • nodeType : “string” (optional)

    unique identifier of the target node type (software stack), e.g. “tomcat11” for the Tomcat 11 stack.

  • nodeGroup : “string” (optional)

    unique identifier of the target node group (layer), e.g. “cp” for the default application server layer.

  • masterOnly : “boolean” (optional)

    defines whether to execute the command on the master/primary node only (true) or on all nodes in the layer (false).

  • nodeid : “int” (optional)

    unique identifier of the target node (container).

Example

Method: POST

https://[hoster-api-host]/1.0/environment/file/rest/append?path=[string]&envName=[string]&session=[string]&body=[string]&nodeType=[string]&masterOnly=[boolean]&nodeGroup=[string]&nodeid=[int]

Response

  • Response
    {
       "error": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

CheckCrossMount (envName, session, nodeId, sourceNodeId ) :

Checks for the cross-mount issues between the nodes. If a mount between nodes exists, a new mount in the opposite direction is restricted.

URL

https://[hoster-api-host]/1.0/environment/file/rest/checkcrossmount

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • nodeId : “int”

    unique identifier of the target node (container).

  • sourceNodeId : “int”

    unique identifier of the source node, where the data is physically stored.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/file/rest/checkcrossmount?envName=[string]&session=[string]&sourceNodeId=[int]&nodeId=[int]

Response

  • ObjectResponse
    {
       "error": "string",
       "name": "string",
       "object": "boolean",
       "reason": "int",
       "result": "int",
       "source": "string",
       "warnings": [
          "string",
          "..."
       ]
    }
    

Copy (envName, session, src, dest, [nodeType], [nodeGroup], [masterOnly], [nodeid] ) :

Makes a copy of the file from the source path to the destination path.

URL

https://[hoster-api-host]/1.0/environment/file/rest/copy

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • src : “string”

    absolute path to the source file that should be copied.

  • dest : “string”

    absolute path to the destination, where the file copy should be placed.

  • nodeType : “string” (optional)

    unique identifier of the target node type (software stack), e.g. “tomcat11” for the Tomcat 11 stack.

  • nodeGroup : “string” (optional)

    unique identifier of the target node group (layer), e.g. “cp” for the default application server layer.

  • masterOnly : “boolean” (optional)

    defines whether to execute the command on the master/primary node only (true) or on all nodes in the layer (false).

  • nodeid : “int” (optional)

    unique identifier of the target node (container).

Example

Method: POST

https://[hoster-api-host]/1.0/environment/file/rest/copy?src=[string]&envName=[string]&session=[string]&dest=[string]&nodeType=[string]&masterOnly=[boolean]&nodeGroup=[string]&nodeid=[int]

Response

  • Response
    {
       "error": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

Create (envName, session, path, [nodeType], [nodeGroup], [masterOnly], [isdir], [nodeid] ) :

Creates a new empty file or directory.

URL

https://[hoster-api-host]/1.0/environment/file/rest/create

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • path : “string”

    absolute path to the file that should be created.

  • nodeType : “string” (optional)

    unique identifier of the target node type (software stack), e.g. “tomcat11” for the Tomcat 11 stack.

  • nodeGroup : “string” (optional)

    unique identifier of the target node group (layer), e.g. “cp” for the default application server layer.

  • masterOnly : “boolean” (optional)

    defines whether to execute the command on the master/primary node only (true) or on all nodes in the layer (false).

  • isdir : “boolean” (optional)

    defines whether to create directory (true) or file (false).

  • nodeid : “int” (optional)

    unique identifier of the target node (container).

Example

Method: POST

https://[hoster-api-host]/1.0/environment/file/rest/create?path=[string]&envName=[string]&session=[string]&nodeType=[string]&masterOnly=[boolean]&nodeGroup=[string]&nodeid=[int]&isdir=[boolean]

Response

  • FilePermissionResponse
    {
       "error": "string",
       "isDirectory": "boolean",
       "path": "string",
       "permission": "string",
       "reason": "int",
       "responses": [
          {
             "errOut": "string",
             "error": "string",
             "exitStatus": "int",
             "name": "string",
             "nodeId": "int",
             "out": "string",
             "reason": "int",
             "result": "int",
             "source": "string"
          },
          "..."
       ],
       "result": "int",
       "source": "string",
       "user": "string"
    }
    

Delete (envName, session, path, [nodeType], [nodeGroup], [masterOnly], [nodeid] ) :

Deletes an existing file or directory.

URL

https://[hoster-api-host]/1.0/environment/file/rest/delete

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • path : “string”

    absolute path to the file that should be deleted.

  • nodeType : “string” (optional)

    unique identifier of the target node type (software stack), e.g. “tomcat11” for the Tomcat 11 stack.

  • nodeGroup : “string” (optional)

    unique identifier of the target node group (layer), e.g. “cp” for the default application server layer.

  • masterOnly : “boolean” (optional)

    defines whether to execute the command on the master/primary node only (true) or on all nodes in the layer (false).

  • nodeid : “int” (optional)

    unique identifier of the target node (container).

Example

Method: POST

https://[hoster-api-host]/1.0/environment/file/rest/delete?path=[string]&envName=[string]&session=[string]&nodeType=[string]&masterOnly=[boolean]&nodeGroup=[string]&nodeid=[int]

Response

  • NodeSSHResponses
    {
       "error": "string",
       "reason": "int",
       "responses": [
          {
             "errOut": "string",
             "error": "string",
             "exitStatus": "int",
             "name": "string",
             "nodeId": "int",
             "out": "string",
             "reason": "int",
             "result": "int",
             "source": "string"
          },
          "..."
       ],
       "result": "int",
       "source": "string"
    }
    

GetExportedList (envName, session, nodeId, [path] ) :

Returns a list of all external exports for the container (learn more in the documentation).

URL

https://[hoster-api-host]/1.0/environment/file/rest/getexportedlist

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • nodeId : “int”

    unique identifier of the target node (container).

  • path : “string” (optional)

    absolute path to the exported directory.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/file/rest/getexportedlist?path=[string]&envName=[string]&session=[string]&nodeId=[int]

Response

  • ArrayResponse
    {
       "array": [
          {
             "creator": "USER(0) | SYSTEM(1)",
             "name": "string",
             "nodeId": "int",
             "path": "string",
             "protocol": "string",
             "readOnly": "boolean",
             "sourceAddressType": "IP(0) | DOMAIN(1) | NODE_GROUP(2)",
             "sourceHost": "string",
             "sourceNodeId": "int",
             "sourcePath": "string",
             "type": "LOCAL(0) | INTERNAL(1) | EXTERNAL(2) | VIRTUAL(3)"
          },
          "..."
       ],
       "className": "Class",
       "error": "string",
       "name": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

GetFavorites (envName, session, [nodeGroup], [nodeId] ) :

Returns a list of “Favorite” shortcuts for quick access to the container’s files or directories.

URL

https://[hoster-api-host]/1.0/environment/file/rest/getfavorites

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • nodeGroup : “string” (optional)

    unique identifier of the target node group (layer), e.g. “cp” for the default application server layer.

  • nodeId : “int” (optional)

    unique identifier of the target node (container).

Example

Method: POST

https://[hoster-api-host]/1.0/environment/file/rest/getfavorites?envName=[string]&session=[string]&nodeGroup=[string]&nodeId=[int]

Response

  • FavoriteListResponse
    {
       "error": "string",
       "favoriteList": [
          {
             "filter": "string",
             "id": "int",
             "isDir": "boolean",
             "keyword": "string",
             "path": "string"
          },
          "..."
       ],
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

GetList (envName, session, [path], [nodeType], [nodeGroup], [nodeid], [filter] ) :

Returns a list of files in the specified directory.

URL

https://[hoster-api-host]/1.0/environment/file/rest/getlist

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • path : “string” (optional)

    absolute path to the directory with files.

  • nodeType : “string” (optional)

    unique identifier of the target node type (software stack), e.g. “tomcat11” for the Tomcat 11 stack.

  • nodeGroup : “string” (optional)

    unique identifier of the target node group (layer), e.g. “cp” for the default application server layer.

  • nodeid : “int” (optional)

    unique identifier of the target node (container).

  • filter : “string” (optional)

    regex expression to filter the list of returned files (up to 255 characters).

Example

Method: POST

https://[hoster-api-host]/1.0/environment/file/rest/getlist?filter=[string]&path=[string]&envName=[string]&session=[string]&nodeType=[string]&nodeGroup=[string]&nodeid=[int]

Response

  • FilesListResponse
    {
       "coreRootPath": "string",
       "directoryPathList": [
          "string",
          "..."
       ],
       "error": "string",
       "keywords": {
          "(key) string": "(value) [{\"absolutePath\":\"string\",\"fileType\":\"string\",\"isDir\":\"boolean\",\"isExported\":\"boolean\",\"isRoot\":\"boolean\",\"lastModified\":\"string\",\"length\":\"long\",\"name\":\"string\",\"permission\":\"string\",\"protocol\":\"string\",\"sourceHost\":\"string\",\"sourceNodeId\":\"int\",\"sourcePath\":\"string\"},\"...\"]",
          "...": "..."
       },
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

GetMountPoints (envName, session, [nodeId], [nodeGroup] ) :

Returns a list of all mount points for the container (learn more in the documentation).

URL

https://[hoster-api-host]/1.0/environment/file/rest/getmountpoints

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • nodeId : “int” (optional)

    unique identifier of the target node (container).

  • nodeGroup : “string” (optional)

    unique identifier of the target node group (layer), e.g. “cp” for the default application server layer.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/file/rest/getmountpoints?envName=[string]&session=[string]&nodeId=[int]&nodeGroup=[string]

Response

  • ArrayResponse
    {
       "array": [
          {
             "creator": "USER(0) | SYSTEM(1)",
             "name": "string",
             "nodeId": "int",
             "path": "string",
             "protocol": "string",
             "readOnly": "boolean",
             "sourceAddressType": "IP(0) | DOMAIN(1) | NODE_GROUP(2)",
             "sourceHost": "string",
             "sourceNodeId": "int",
             "sourcePath": "string",
             "type": "LOCAL(0) | INTERNAL(1) | EXTERNAL(2) | VIRTUAL(3)"
          },
          "..."
       ],
       "className": "Class",
       "error": "string",
       "name": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

Read (envName, session, path, [nodeType], [nodeGroup], [nodeid] ) :

Returns body (content) of a file.

URL

https://[hoster-api-host]/1.0/environment/file/rest/read

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • path : “string”

    absolute path to the target file.

  • nodeType : “string” (optional)

    unique identifier of the target node type (software stack), e.g. “tomcat11” for the Tomcat 11 stack.

  • nodeGroup : “string” (optional)

    unique identifier of the target node group (layer), e.g. “cp” for the default application server layer.

  • nodeid : “int” (optional)

    unique identifier of the target node (container).

Example

Method: POST

https://[hoster-api-host]/1.0/environment/file/rest/read?path=[string]&envName=[string]&session=[string]&nodeType=[string]&nodeGroup=[string]&nodeid=[int]

Response

  • FileReadResponse
    {
       "body": "string",
       "error": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

RemoveExport (envName, session, nodeId, path, clientNodeId, clientPath ) :

Unmounts external export from the container (learn more in the documentation).

URL

https://[hoster-api-host]/1.0/environment/file/rest/removeexport

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • nodeId : “int”

    unique identifier of the target node (container).

  • path : “string”

    absolute path to the directory with exported data.

  • clientNodeId : “int”

    unique identifier of the remote client node.

  • clientPath : “string”

    absolute path to the directory on the remote client node through which local files can be accessed.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/file/rest/removeexport?path=[string]&clientPath=[string]&envName=[string]&session=[string]&nodeId=[int]&clientNodeId=[int]

Response

  • Response
    {
       "error": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

RemoveFavorite (envName, session, [nodeGroup], [nodeId], path ) :

Removes the “Favorite” shortcut for quick access to the container’s files or directories from the node.

URL

https://[hoster-api-host]/1.0/environment/file/rest/removefavorite

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • nodeGroup : “string” (optional)

    unique identifier of the target node group (layer), e.g. “cp” for the default application server layer.

  • nodeId : “int” (optional)

    unique identifier of the target node (container).

  • path : “string”

    absolute path of the shortcut to be removed.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/file/rest/removefavorite?path=[string]&envName=[string]&session=[string]&nodeGroup=[string]&nodeId=[int]

Response

  • Response
    {
       "error": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

RemoveMountPointByGroup (envName, session, nodeGroup, path ) : 

Removes mount point from the layer (node group).

URL

https://[hoster-api-host]/1.0/environment/file/rest/removemountpointbygroup

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • nodeGroup : “string”

    unique identifier of the target node group (layer), e.g. “cp” for the default application server layer.

  • path : “string”

    absolute path of the mount point to be removed.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/file/rest/removemountpointbygroup?path=[string]&envName=[string]&session=[string]&nodeGroup=[string]

Response

  • Response
    {
       "error": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

RemoveMountPointById (envName, session, nodeId, path ) :

Removes mount point from the container (node).

URL

https://[hoster-api-host]/1.0/environment/file/rest/removemountpointbyid

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • nodeId : “int”

    unique identifier of the target node (container).

  • path : “string”

    absolute path of the mount point to be removed.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/file/rest/removemountpointbyid?path=[string]&envName=[string]&session=[string]&nodeId=[int]

Response

  • Response
    {
       "error": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

Rename (envName, session, oldPath, newPath, [nodeType], [nodeGroup], [masterOnly], [nodeid] ) :

Renames the target file.

URL

https://[hoster-api-host]/1.0/environment/file/rest/rename

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • oldPath : “string”

    absolute path to the file to be renamed.

  • newPath : “string”

    absolute path with the new filename.

  • nodeType : “string” (optional)

    unique identifier of the target node type (software stack), e.g. “tomcat11” for the Tomcat 11 stack.

  • nodeGroup : “string” (optional)

    unique identifier of the target node group (layer), e.g. “cp” for the default application server layer.

  • masterOnly : “boolean” (optional)

    defines whether to execute the command on the master/primary node only (true) or on all nodes in the layer (false).

  • nodeid : “int” (optional)

    unique identifier of the target node (container).

Example

Method: POST

https://[hoster-api-host]/1.0/environment/file/rest/rename?envName=[string]&session=[string]&oldPath=[string]&newPath=[string]&nodeType=[string]&masterOnly=[boolean]&nodeGroup=[string]&nodeid=[int]

Response

  • NodeSSHResponses
    {
       "error": "string",
       "reason": "int",
       "responses": [
          {
             "errOut": "string",
             "error": "string",
             "exitStatus": "int",
             "name": "string",
             "nodeId": "int",
             "out": "string",
             "reason": "int",
             "result": "int",
             "source": "string"
          },
          "..."
       ],
       "result": "int",
       "source": "string"
    }
    

ReplaceInBody (envName, session, path, pattern, replacement, [nth], [nodeType], [nodeGroup], [masterOnly], [nodeid] ) :

Finds and replaces a pattern in the file.

URL

https://[hoster-api-host]/1.0/environment/file/rest/replaceinbody

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • path : “string”

    absolute path to the target file.

  • pattern : “string”

    regex expression (in a SED-compatible format) to locate text for replacement.

  • replacement : “string”

    replacement text (in a plain text format).

  • nth : “int” (optional)

    maximum number of entries for replacement.

  • nodeType : “string” (optional)

    unique identifier of the target node type (software stack), e.g. “tomcat11” for the Tomcat 11 stack.

  • nodeGroup : “string” (optional)

    unique identifier of the target node group (layer), e.g. “cp” for the default application server layer.

  • masterOnly : “boolean” (optional)

    defines whether to execute the command on the master/primary node only (true) or on all nodes in the layer (false).

  • nodeid : “int” (optional)

    unique identifier of the target node (container).

Example

Method: POST

https://[hoster-api-host]/1.0/environment/file/rest/replaceinbody?path=[string]&nth=[int]&envName=[string]&session=[string]&pattern=[string]&nodeType=[string]&masterOnly=[boolean]&replacement=[string]&nodeGroup=[string]&nodeid=[int]

Response

  • Response
    {
       "error": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

UnpackById (envName, session, nodeId, sourcePath, destPath ) :

Extracts files from the archive on the node (container).

URL

https://[hoster-api-host]/1.0/environment/file/rest/unpackbyid

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • nodeId : “int”

    unique identifier of the target node (container).

  • sourcePath : “string”

    absolute path to the target archive file.

  • destPath : “string”

    absolute path to extract files to.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/file/rest/unpackbyid?envName=[string]&session=[string]&destPath=[string]&nodeId=[int]&sourcePath=[string]

Response

  • Response
    {
       "error": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

UnpackByType (envName, session, nodeType, sourcePath, destPath ) :

Extracts files from the archive on all the nodes of the specific type (stack).

URL

https://[hoster-api-host]/1.0/environment/file/rest/unpackbytype

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • nodeType : “string”

    unique identifier of the target node type (software stack), e.g. “tomcat11” for the Tomcat 11 stack.

  • sourcePath : “string”

    absolute path to the target archive file.

  • destPath : “string”

    absolute path to extract files to.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/file/rest/unpackbytype?envName=[string]&session=[string]&destPath=[string]&nodeType=[string]&sourcePath=[string]

Response

  • Response
    {
       "error": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

Upload (envName, session, sourcePath, destPath, [nodeType], [nodeGroup], [masterOnly], [nodeid], [overwrite] ) :

Uploads a file to the containers (nodes).

URL

https://[hoster-api-host]/1.0/environment/file/rest/upload

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • sourcePath : “string”

    URL of the target file to be uploaded.

  • destPath : “string”

    absolute path (on the target container) to save uploaded file at.

  • nodeType : “string” (optional)

    unique identifier of the target node type (software stack), e.g. “tomcat11” for the Tomcat 11 stack.

  • nodeGroup : “string” (optional)

    unique identifier of the target node group (layer), e.g. “cp” for the default application server layer.

  • masterOnly : “boolean” (optional)

    defines whether to execute the command on the master/primary node only (true) or on all nodes in the layer (false).

  • nodeid : “int” (optional)

    unique identifier of the target node (container).

  • overwrite : “boolean” (optional)

    defines whether to overwrite (true) or skip (false) file if it already exists at the destination directory.

Example

Method: POST

https://[hoster-api-host]/1.0/environment/file/rest/upload?envName=[string]&session=[string]&destPath=[string]&nodeType=[string]&masterOnly=[boolean]&nodeGroup=[string]&nodeid=[int]&overwrite=[boolean]&sourcePath=[string]

Response

  • NodeSSHResponses
    {
       "error": "string",
       "reason": "int",
       "responses": [
          {
             "errOut": "string",
             "error": "string",
             "exitStatus": "int",
             "name": "string",
             "nodeId": "int",
             "out": "string",
             "reason": "int",
             "result": "int",
             "source": "string"
          },
          "..."
       ],
       "result": "int",
       "source": "string"
    }
    

Write (envName, session, path, [body], [nodeType], [nodeGroup], [masterOnly], [nodeid], [isAppendMode] ) :

Writes specified text to the target file.

URL

https://[hoster-api-host]/1.0/environment/file/rest/write

Parameters

  • envName : “string”

    target environment name.

  • session : “string”

    user session or personal access token.

  • path : “string”

    absolute path to the file, where the text should be written.

  • body : “string” (optional)

    text that should be written to the file.

  • nodeType : “string” (optional)

    unique identifier of the target node type (software stack), e.g. “tomcat11” for the Tomcat 11 stack.

  • nodeGroup : “string” (optional)

    unique identifier of the target node group (layer), e.g. “cp” for the default application server layer.

  • masterOnly : “boolean” (optional)

    defines whether to execute the command on the master/primary node only (true) or on all nodes in the layer (false).

  • nodeid : “int” (optional)

    unique identifier of the target node (container).

  • isAppendMode : “boolean” (optional)

    defines whether to overwrite the file content (false) or append the existing text (false)

Example

Method: POST

https://[hoster-api-host]/1.0/environment/file/rest/write?path=[string]&isAppendMode=[boolean]&envName=[string]&session=[string]&body=[string]&nodeType=[string]&masterOnly=[boolean]&nodeGroup=[string]&nodeid=[int]

Response

  • Response
    {
       "error": "string",
       "reason": "int",
       "result": "int",
       "source": "string"
    }
    

Leave a Comment