py4cytoscape.sandbox.sandbox_remove

sandbox_remove(sandbox_name=None, base_url='http://127.0.0.1:1234/v1')[source]

Delete sandbox contents and remove its directory.

If the current sandbox is the entire file system on a Cytoscape workstation, trying to delete it is an error. Otherwise, deleting the current sandbox results in the default sandbox becoming the new current sandbox. When running on the same workstation as Cytoscape, the default sandbox is the entire file system on the Cytoscape workstation. When running in a remote server, the default sandbox is the ‘default_sandbox’ created automatically under the under the filetransfer directory in the CytoscapeConfiguration directory. If that sandbox is deleted, it will be re-created so that subsequent file operations can complete successfully.

Parameters
  • sandbox_name (str) – Name of sandbox to delete. None means to delete the current sandbox. If that sandbox is the default sandbox, it is automatically re-created.

  • base_url (str) – Ignore unless you need to specify a custom domain, port or version to connect to the CyREST API. Default is http://localhost:1234 and the latest version of the CyREST API supported by this version of py4cytoscape.

Returns

{‘sandboxPath’: <directory on Cytoscape workstation>, ‘existed’: <True if sandbox existed>}

Return type

dict

Raises

requests.exceptions.HTTPError – if can’t connect to Cytoscape, Cytoscape returns an error, or sandbox is invalid

Examples

>>> sandbox_remove() # Valid only when running in Notebook or remotely or when explicitly set sandbox is current
{'sandboxPath': 'C:\Users\CyDeveloper\CytoscapeConfiguration\filetransfer\default_sandbox', 'existed': True}
>>> sandbox_set('mySand')
{'sandboxPath': 'C:\Users\CyDeveloper\CytoscapeConfiguration\filetransfer\mySand', 'existed': True}

See also

Sandboxing in the Concepts section in the py4cytoscape User Manual.