-
Notifications
You must be signed in to change notification settings - Fork 0
WorkspaceFile REST API
Call | Example URL |
---|---|
Get a list of Workspace Files | /rest/workspacefiles /rest/workspacefiles?synced=true&owner=bob |
Get a Workspace File | /rest/workspacefiles/1234 |
Create WorkspaceFile | /rest/workspacefiles |
Update WorkspaceFile | /rest/workspacefiles/1234?size=2222 |
Delete a WorkspaceFile | /rest/workspacefiles/1234 |
Obtains a list of WorkspaceFiles in Json format.
- synced If set to true returns only WorkspaceFiles that have been synchronized to cluster (valid values true|false)
- owner Returns only files owned by that user
- isfailed If set to true only returns WorkspaceFiles whose Jobs have failed. If false only WorkspaceFiles whose Jobs succeeded. If calling to populate WorkspaceFiles for parameter input, set isfailed to false if allowFailedWorkspaceFile parameter in json is false otherwise omit this query parameter.
- type If set restricts WorkspaceFiles returned to those with types in comma delimited list passed in. If calling to populate WorkspaceFiles then set this value with the non null value from allowedWorkspaceFileTypes in json.
Return: Json representation of WorkspaceFiles
Example return
Example CURL call:
curl -X GET \
https://crbsworkflow.appspot.com/rest/workspacefiles?synced=true
Obtains a single WorkspaceFile in Json format. An optional parameter causes inclusion of upload URL that can be used to a upload a file, see Query Parameters below.
- adduploadurl Set to true will result in uploadurl to be set in resulting Json which can be POSTED to for file upload
Return: Json representation of WorkspaceFile
Example return
Example CURL call:
curl -X GET \
https://crbsworkflow.appspot.com/rest/workspacefiles/1?adduploadurl=true
Creates a new WorkspaceFile. Upon success a Json representation of the WorkspaceFile is returned with id set and depending on query parameters set the uploadURL is also set. The caller can then post the file to this url setting the id to workspace id. See for example
Json representation of WorkspaceFile. If create date is not set it is set to time of insert. The id is ignored at present
Return: Json representation of WorkspaceFile with id set
Example return
Example CURL call:
curl -X POST -H "Content-Type: application/json" \
-d '{"createDate" : null,"description" : "text about file","blobKey" : null,"md5" : null,"deleted" : false, "dir" : false, "sourceJobId" : null, "uploadURL" : null, "owner" : "bob", "id" : null, "type" : "png", "path" : null, "name" : "foo.png", "size" : 123123}' https://crbsworkflow.appspot.com/rest/workspacefiles
Updates an existing WorkspaceFile. At the moment update lets caller update the path via a query parameter
None
- path Set to path where file resides on cluster or null if file is not synchronized
- size Set to size of file or directory on cluster in bytes
- isfailed Set to true if WorkspaceFile is from a failed Job otherwise false or omit.
- deleted Set to true to set delete or false to undelete or omit to not touch it.
Return: Json representation of WorkspaceFile with path
Example return
Example CURL call:
curl -X POST -H "Content-Type: application/json" \
-d '{}' https://crbsworkflow.appspot.com/rest/workspacefiles/1?path=%2Fhome%2Ffoo%2Ffoo.png&size=5345345
Deletes a WorkspaceFile. Default operation is to perform a logical delete where deleted field is set to true. This method will return Json denoting outcome of operation. A WorkspaceFile can only be deleted if no Jobs are using it for input and if its not output of an existing Job.
- permanentlydelete If set to true then delete will completely remove WorkspaceFile from system, otherwise a logical delete will be performed if unset or false
Return: Json representation of a DeleteReport
Example return
Example Curl call:
curl -X DELETE \
https://crbsworkflow.appspot.com/rest/workspacefiles/12345