Introduction
Overview
The Rescale REST API provides a programmatic interface for interacting with Rescale’s multi-cloud platform. Rescale’s platform helps you solve the most challenging engineering and scientific problems with unprecedented speed by abstracting away infrastructure, applications, and middleware.
What is a REST API?
An API is an application programming interface - in short, it’s a set of rules that lets programs talk to each other, exposing data and functionality across the internet in a consistent format.
REST stands for Representational State Transfer. This is an architectural pattern that describes how distributed systems can expose a consistent interface. When people use the term ‘REST API,’ they are generally referring to an API accessed via HTTP protocol at a predefined set of URLs.
These URLs represent various resources - any information or content accessed at that location, which can be returned as JSON, HTML, audio files, or images. Often, resources have one or more methods that can be performed on them over HTTP, like GET, POST, PUT, PATCH and DELETE.
What can I use the Rescale API for?
- Cloud-bursting job submission from an on-premise scheduler to any cloud provider
- Managing simulation input / output files and archival flow
- Launching and connecting to cloud-based VDI instances
- Built-in software vendor application integrations for running jobs in the cloud
- Integrating with user management solutions to automate user on-boarding
- Keeping project budgets up-to-date with system of record
Instructions
Endpoint Formatting
- All request paths must use the corresponding platform URL for your user account (e.g.
platform.rescale.com
,eu.rescale.com
,platform.rescale.jp
, …). - All request paths must include the trailing slash (e.g.
/api/v2/jobs/
instead of/api/v2/jobs
). - All request paths should include a version identifier immediately after the
/api/
prefix (e.g,/api/v2/jobs/
instead of/api/jobs/
).
Versioning
Currently only v2
of the following outlined endpoints are officially supported and maintained. Requests that do not include a version identifier will use v1
of the API by default and may be deprecated without notice.
Authentication
The Rescale API uses authentication tokens to authentication each request. The API requires all requests to be authenticated by passing an https header of the form:
Authorization: Token <api-token>
If you don’t have an api key, you can generate one here.
curl -H "Authorization: Token <api-token>" https://platform.rescale.com/api/v2/jobs/
import requests
requests.get(
'https://platform.rescale.com/api/v2/jobs/',
headers={'Authorization': 'Token <api-token>'}
)
Pagination
curl -H "Authorization: Token <api-token>" "https://platform.rescale.com/api/v2/jobs/?page_size=2&page=4"
import requests
requests.get(
'https://platform.rescale.com/api/v2/jobs/',
params={'page_size': 2, 'page': 4},
headers={'Authorization': 'Token <api-token>'}
)
{
"count":123,
"prev":null,
"results": [
],
"next":"https://platform.rescale.com/api/v2/jobs/?page_size=2&page=5"
}
All API requests for lists of objects will return paginated results. The page
and page_size
query parameters can be used to control pagination.
page_size
indicates the maximum number of results to return for a page. The
page
value starts at 1.
User API
Resources
The Rescale API provides several top-level endpoints that provide information about options available in the system as a whole.
Coretypes
GET https://platform.rescale.com/api/v2/coretypes/
curl -H "Authorization: Token <api-token>" https://platform.rescale.com/api/v2/coretypes/
import requests
requests.get(
'https://platform.rescale.com/api/v2/coretypes/',
headers={'Authorization': 'Token <api-token>'}
)
Sample Response
{
"count":14,
"previous":null,
"results":[
{
"hasSsd":true,
"code":"standard-plus",
"compute":"3.00",
"name":"Marble",
"isDeprecated":false,
"price":0.1,
"remoteVizAllowed":true,
"storage":40,
"lowPriorityPrice":"0.050",
"walltimeRequired":false,
"displayOrder":1,
"io":"Standard",
"memory":3750,
"cores":[
1,
2,
4,
8
],
"isPrimary":true,
"processorInfo":"Intel Xeon E5-2670 v2 (Ivy Bridge) - single threaded",
"storageIo":"2 GB/s read, 1GB/s write",
"description":"Standard"
},
{
"hasSsd":false,
"code":"test",
"compute":"1.00",
"name":"HPC Test",
"isDeprecated":false,
"price":0.25,
"remoteVizAllowed":false,
"storage":0,
"lowPriorityPrice":"0.100",
"walltimeRequired":false,
"displayOrder":null,
"io":"",
"memory":1500,
"cores":[
1
],
"isPrimary":false,
"processorInfo":"",
"storageIo":"",
"description":""
}
],
"next":"https://platform.rescale.com/api/v2/coretypes?page=2"
}
This endpoint lists informations on all coretypes available in the
Rescale API. The code
property can be used in subsequent requests to
submit jobs.
Response Properties
Property | Type | Description |
---|---|---|
hasSsd | boolean | Indicates whether this coretype has SSD drives |
code | String | A unique identifier for this coretype, used in other requests |
compute | String | TODO |
name | String | The display name |
isDeprecated | boolean | Indicates if this coretype is deprecated. If true, it cannot be used to submit jobs |
price | Decimal | Price per core hour for on-demand jobs |
storage | Integer | The amount of per-core storage in GB |
lowPriorityPrice | String | The price per core hour for low priority jobs |
walltimeRequired | boolean | Indicates if jobs submitted with this coretype must specify a maximum walltime |
displayOrder | Integer | An integer for sorting coretype displays |
io | String | Indicates the amount of IO available on this coretype, e.g. 10 GB/s |
memory | Integer | The amount of per-core memory in MB |
cores | Array<Integer> | The number of cores on instances of this coretype, with an entry for each instance size |
isPrimary | boolean | Indicates if this is a primary (default) coretype |
processorInfo | String | Processor Information |
storageIo | String | Same as storage |
description | String | A description of this coretype |
Analyses
GET https://platform.rescale.com/api/v2/analyses/
curl -H "Authorization: Token <api-token>" https://platform.rescale.com/api/v2/analyses/
import requests
requests.get(
'https://platform.rescale.com/api/v2/analyses/',
headers={'Authorization': 'Token <api-token>'}
)
Sample Response
{
"count":88,
"previous":null,
"results":[
{
"industries":[
{
"name":"Aerospace",
"icon":null
},
{
"name":"Automotive",
"icon":null
}
],
"code":"abaqus",
"description":"<p><b>Abaqus FEA</b> is a software suite for finite element analysis and computer-aided engineering. The Abaqus product suite consists of four core software products. <i>Abaqus/CAE</i>, <i>Abaqus/CFD</i>, <i>Abaqus/Standard</i>, and <i>Abaqus/Explicit</i>.</p><p><i>Abaqus CAE</i> is a software application used for both pre-processing and visualizing finite element analysis results. <i>Abaqus/CFD</i> provides computational fluid dynamics capabilities, while <i>Abaqus/Standard</i> and <i>Abaqus/Explicit</i> are finite element analyzers that employ implicit and explicit integration schemes, respectively.</p>",
"versions":[
{
"eula":null,
"allowedCoreTypes":[
"gpu-kepler",
"gpu-tesla",
"hi-io",
"hi-mem",
"hi-mem-hpc",
"hpc",
"hpc-3",
"hpc-plus",
"lo-mem",
"standard",
"standard-plus",
"test"
],
"stdCommand":"abaqus job=<job> interactive",
"version":"6.14-1",
"mpiCommand":"abaqus job=<job> cpus=<mpi-ranks> mp_mode=mpi interactive",
"versionCode":"6.14.1-pcmpi",
"smpCommand":"abaqus job=<job> cpus=<smp-ranks> interactive"
},
{
"eula":null,
"allowedCoreTypes":[
"gpu-kepler",
"gpu-tesla",
"hi-io",
"hi-mem",
"hi-mem-hpc",
"hpc",
"hpc-3",
"hpc-plus",
"lo-mem",
"standard",
"standard-plus",
"test"
],
"stdCommand":"abaqus job=<job> interactive",
"version":"6.13-5",
"mpiCommand":"abaqus job=<job> cpus=<mpi-ranks> mp_mode=mpi interactive",
"versionCode":"6.13.5-ibm",
"smpCommand":"abaqus job=<job> cpus=<smp-ranks> interactive"
},
{
"eula":null,
"allowedCoreTypes":[
"gpu-kepler",
"gpu-tesla",
"hi-io",
"hi-mem",
"hi-mem-hpc",
"hpc",
"hpc-3",
"hpc-plus",
"lo-mem",
"standard",
"standard-plus",
"test"
],
"stdCommand":"abaqus job=<job> interactive",
"version":"6.12-1",
"mpiCommand":"abaqus job=<job> cpus=<mpi-ranks> mp_mode=mpi interactive",
"versionCode":"6.12.0-ibm",
"smpCommand":"abaqus job=<job> cpus=<smp-ranks> interactive"
},
{
"eula":null,
"allowedCoreTypes":[
"gpu-kepler",
"gpu-tesla",
"hi-io",
"hi-mem",
"hi-mem-hpc",
"hpc",
"hpc-3",
"hpc-plus",
"lo-mem",
"standard",
"standard-plus",
"test"
],
"stdCommand":"abaqus job=<job> interactive",
"version":"6.12-1-asca",
"mpiCommand":"abaqus job=<job> cpus=<mpi-ranks> mp_mode=mpi interactive",
"versionCode":"6.12.0-asca",
"smpCommand":"abaqus job=<job> cpus=<smp-ranks> interactive"
}
],
"supportDesks":[
{
"code":"rescale",
"displayName":"Rescale Support",
"email":"support@example.com"
}
],
"hasRescaleLicense":true,
"vendorName":"",
"pricing":"",
"hasShortTermLicense":false,
"licenseSettings":[
{
"isServer":true,
"licenseType":"Flex",
"helpText":"The address of the FlexNet license server to use. ([port]@hostname)",
"name":"LM_LICENSE_FILE",
"label":"License"
},
{
"isServer":true,
"licenseType":"Flex",
"helpText":"The address of the Autodesk Simulation Composite Analysis License Server [port]@hostname",
"name":"ADSKFLEX_LICENSE_FILE",
"label":"ASCA License Server"
}
],
"optimizerType":null,
"thumbnail":"/static/img/analyses_images/abaqus.png",
"resources":[
{
"url":"https://www.rescale.com/resources/software/abaqus/example/",
"name":"Basic Example"
}
],
"name":"Abaqus"
}
],
"next":"https://platform.rescale.com/api/v2/analyses/?page=2"
}
This endpoint lists all the software available to your user on Rescale.
Response Properties
Property | Type | Description |
---|---|---|
industries | Array<Object> | The industries this analysis is used by |
code | String | A unique identifier for this analysis |
description | String | Describes this analysis |
versions | Array<Object> | Describes all of the verions available for this analysis |
supportDesks | Array<Object> | Describes all the support desks that can provide support for this analysis |
vendorName | String | The name of the analysis vendor |
pricing | String | The cost of this analysis |
hasShortTermLicense | boolean | Indicates if a short term license can be purchased to run this analysis |
licenseSettings | Array<Object> | The required license settings for running this analysis |
optimizerType | Object | TODO |
thumbnail | String | A path to the image used to represent this analsyis |
resources | Array<Object> | Tutorial resources for this analysis |
name | String | The name of this analysis |
Jobs
List All Jobs
GET https://platform.rescale.com/api/v2/jobs/
curl -H "Authorization: Token <api-token>" https://platform.rescale.com/api/v2/jobs/
# filtering
curl -H "Authorization: token <api-token>" https://platform.rescale.com/api/v2/jobs/ \
--get --data-urlencode "q=#tag or project:myproject"
import requests
requests.get(
'https://platform.rescale.com/api/v2/jobs/',
headers={'Authorization': 'Token <api-token>'}
)
requests.get(
'https://platform.rescale.com/api/v2/jobs/?state=not_completed',
headers={'Authorization': 'Token <api-token>'}
)
# filtering
from urllib.parse import quote
requests.get(
'https://platform.rescale.com/api/v2/jobs/?q=' + quote('#tag or project:myproject'),
headers={'Authorization': 'Token <api-token>'}
)
Sample Response
{
"count": 3,
"next": null,
"previous": null,
"results": [
{
"analysisNames": [
"OpenFOAM"
],
"clusterStatusDisplay": {
"content": "Stopped",
"labelClass": "",
"useLabel": false
},
"dateInserted": "2015-03-13T23:43:21.223052Z",
"id": "OsKBd",
"isVisible": true,
"jobStatus": {
"content": "Completed",
"labelClass": "",
"useLabel": false
},
"name": "the FOAM 2",
"owner": "mark@rescale.com",
"sharedWith": [],
"storage": 8014908
},
{
"analysisNames": [
"OpenFOAM"
],
"clusterStatusDisplay": {
"content": "Stopped",
"labelClass": "",
"useLabel": false
},
"dateInserted": "2015-02-07T01:57:14.332984Z",
"id": "XZFQV",
"isVisible": true,
"jobStatus": {
"content": "Completed",
"labelClass": "",
"useLabel": false
},
"name": "the FOAM",
"owner": "mark@rescale.com",
"sharedWith": [
"someoneelse@example.com"
],
"storage": 8014906
},
{
"analysisNames": [
"Custom User-Defined MPI Software"
],
"clusterStatusDisplay": {
"content": "",
"labelClass": "",
"useLabel": false
},
"dateInserted": "2014-10-09T23:00:36.198759Z",
"id": "kikcT",
"isVisible": true,
"jobStatus": {
"content": "",
"labelClass": "",
"useLabel": false
},
"name": "MPI Hello",
"owner": "mark@rescale.com",
"sharedWith": [],
"storage": 0
}
]
}
By default this endpoint retrieves all the jobs owned by the authenticated user
(you). To see shared jobs, use the f
query parameter (see below).
Query Parameters
Following query parameters are accepted by this endpoint, which will filter out the user’s jobs.
Query Parameter | Type | Accepted Values | Description |
---|---|---|---|
job_status |
String | The job status of interest. Must be one of PENDING , QUEUED , STARTED , VALIDATED , EXECUTING , COMPLETED , STOPPING , WAITING_FOR_CLUSTER , FORCE_STOP , WAITING_FOR_QUEUE . |
Filter out the jobs based on the exact status. |
state |
String | completed , not_completed |
Filters out the jobs based on complete and other non-complete status. |
f |
String | The visiblity status of the jobs. Must be one of 0 , 1 , 2 . |
Filters out the jobs based on the visibility level (where f=0 is all jobs, f=1 is owned jobs [DEFAULT], and f=2 is shared jobs). |
q |
String | Text search, which can contain some structured elements (see below) |
Text Search
For the q
parameter, plain text and “quote terms” are matched inside the job’s name or the name of analyses used with the job.
Additionally, there are some other job facets that can be matched:
Facet | Matches |
---|---|
%23tagname |
Jobs that are tagged with “tagname”, and jobs that have associated files with “tagname” (%23 is the URI encoding for # ) |
owner:user@example.com |
Jobs with a given owner, useful for shared jobs |
comment:"some text" |
Jobs with comments matching “some text” |
project:myproject |
Jobs assigned to myproject |
software:FooWare |
Jobs that use the “FooWare” analysis |
version:1.2.3 |
Jobs that use version 1.2.3 of an analysis |
All of these facets can be combined with logical and
, or
and not
operators (case-insensitive) and parentheses to structure specific conditions, e.g.:
#hastag and (not owner:user@example.com or project:myproject)
Response Properties
Property | Type | Description |
---|---|---|
clusterStatusDisplay | Object | Describes the current status of the job’s compute clusters |
dateInserted | String | The date this job was created |
name | String | The name of this job |
analysisNames | Array<String> | The names all the analyses being run for the job |
jobStatus | Object | Describes the current status of the job |
sharedWith | Array<String> | Email addresses of the users this job has been shared with |
isVisible | Boolean | Always true if you can retrieve the job |
owner | String | The email address of the owner of the job |
id | String | A unique identifier for the job |
storage | Integer | Number of bytes used for the input and output files of this job |
Get a Specific Job
GET https://platform.rescale.com/api/v2/jobs/{job_id}/
curl -H "Authorization: Token <api-token>" https://platform.rescale.com/api/v2/jobs/aabbcc/
import requests
req = requests.get(
'https://platform.rescale.com/api/v2/jobs/aabbcc',
headers={'Authorization': 'Token <api-token>'}
)
{
"archiveFilters": [],
"billingPriorityValue": null,
"caseFile": null,
"expectedRuns": 3,
"id": "aabbcc",
"includeNominalRun": false,
"isLowPriority": true,
"isTemplateDryRun": false,
"jobanalyses": [
{
"analysis": {
"code": "openfoam",
"name": "OpenFOAM",
"version": "2.3.1-openmpi",
"versionName": "2.3.1"
},
"command": "./airFoil2D_DOE/Allrun",
"envVars": {},
"flags": {},
"hardware": {
"coreSummary": {
"memoryPerNode": 3750,
"numberOfNodes": 1.0,
"storagePerNode": 4000
},
"coreType": "standard-plus",
"coresPerSlot": 1,
"slots": 1,
"walltime": null
},
"inputFiles": [
{
"dateUploaded": "2015-03-26T23:08:33.700457Z",
"decryptedSize": 655816,
"downloadUrl": "https://platform.rescale.com/api/v2/files/duMEdg/contents/",
"encodedEncryptionKey": "NYhibURTMAMKNWmWiDuUZxn+oUaRwp8iExaECpU6Dwo=",
"id": "duMEdg",
"isDeleted": false,
"isUploaded": true,
"md5": "60c6492014f73ad0c08da866b4ce9160",
"name": "airfoid2d_doe.tar.gz",
"owner": "mark@rescale.com",
"path": "user/user_KBdkT/airfoid2d_doe.tar.gz-12f94e2222a0feafea96d31e634af2c6",
"relativePath": "airfoid2d_doe.tar.gz",
"sharedWith": [],
"typeId": 1,
"viewInBrowser": false
}
],
"postProcessScript": null,
"postProcessScriptCommand": "",
"preProcessScript": null,
"preProcessScriptCommand": "",
"templateTasks": [
{
"processedFilename": "airFoil2D_DOE/0/U",
"templateFile": {
"dateUploaded": "2015-03-26T23:09:46.256315Z",
"decryptedSize": 1344,
"downloadUrl": "https://platform.rescale.com/api/v2/files/qEMEdg/contents/",
"encodedEncryptionKey": "olx6Kn7vde1siRKoDqBRTkaT25k1x8P9IYy3PdhmFhk=",
"id": "qEMEdg",
"isDeleted": false,
"isUploaded": true,
"md5": "b4ae5cb300c8b3d1410231e8fd474110",
"name": "utemplate",
"owner": "mark@rescale.com",
"path": "user/user_KBdkT/utemplate-2f3c3004f5909acf0b7cc2a56c5be35c",
"relativePath": "utemplate",
"sharedWith": [],
"typeId": 2,
"viewInBrowser": true
}
}
],
"useRescaleLicense": false
}
],
"jobvariables": [
{
"displayOrder": 0,
"name": "Xvelocity",
"valueGeneratorSettings": {},
"valueGeneratorType": "",
"variableType": "Param"
},
{
"displayOrder": 1,
"name": "Yvelocity",
"valueGeneratorSettings": {},
"valueGeneratorType": "",
"variableType": "Param"
}
],
"customFields": {
"Deadline": {
"meta": {
"name": "Deadline",
"valueType": "date",
"enumOptions": [],
"placeholder": "Date",
"helpText": "Enter the date you expect the study to be completed.",
"isMultiple": false,
"isRequired": false,
"allowOther": false
},
"user": "example@rescale.com",
"value": "2023/12/05"
},
"Development Status": {
"meta": {
"name": "Development Status",
"valueType": "select",
"enumOptions": [
"Exploration",
"Development",
"Maintenance"
],
"placeholder": "",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
},
"user": "example@rescale.com",
"value": "Exploration"
},
"Study": {
"meta": {
"name": "Study",
"valueType": "text",
"enumOptions": [],
"placeholder": "Study Name",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
},
"user": "example@rescale.com",
"value": "test study"
}
},
"userTags": [{ "name": "example tag", "normalizedName": "exampletag" }]
"monteCarloIterations": null,
"name": "Untitled Job",
"optimizer": null,
"owner": "mark@rescale.com",
"paramFile": {
"dateUploaded": "2015-03-26T23:09:25.532849Z",
"decryptedSize": 55,
"downloadUrl": "https://platform.rescale.com/api/v2/files/sWErpg/contents/",
"encodedEncryptionKey": "6kvS7Y3M6HXFcHos0rLUcEf4hNyupzn8x1j7CUU3qko=",
"id": "sWErpg",
"isDeleted": false,
"isUploaded": true,
"md5": "9ba0663810a4568dece19b67533e2759",
"name": "freestreamvalue.csv",
"owner": "mark@rescale.com",
"path": "user/user_KBdkT/freestreamvalue.csv-5ebf0b8ddbf834ec2e8e7e727de91c82",
"relativePath": "freestreamvalue.csv",
"sharedWith": [],
"typeId": 3,
"viewInBrowser": true
},
"projectId": null,
"remoteVizConfig": null,
"resourceFilters": []
}
Retrieve the details of a saved job.
Response Properties
Property | Type | Description |
---|---|---|
archiveFilters | Array<String> | Filters on job visibility related to whether it is archived |
billingPriorityValue | String | Priority for job hardware. Options are: ‘INSTANT’ for On Demand Priority, 'ON_DEMAND’ for On Demand Economy, 'RESERVED’ for On Demand Reserved. |
caseFile | Object | File with case variables for DOE job |
expectedRuns | Integer | Number of runs for a DOE, will be 1 for basic jobs |
id | String | Job identifier |
includeNominalRun | Boolean | Whether to include a nominal baseline run for a DOE job |
isLowPriority | Boolean | Is this a low priority job? |
isTemplateDryRun | Boolean | Run this job in “dry run” mode to check DOE templates |
jobanalyses | Array<Object> | List of analyses for the job. Details below |
jobvariables | Array<Object> | List of job variables for DOE job. Details below |
monteCarloIterations | Integer | Number of iterations for Monte Carlo optimization job |
name | String | Name of job |
optimizer | Object | Job analysis representing optimizer used for optimization jobs |
owner | String | Email address of job owner |
paramFile | Object | CSV file with DOE parameters (DOE job only) |
projectId | String | External project ID. This field is optional and will be null for jobs not assigned to projects. |
resourceFilters | Array<Object> | Filters on file resources |
resourceFilters | Default filters | No |
List Job Output Files
GET https://platform.rescale.com/api/v2/jobs/{job_id}/files/
curl -H "Authorization: Token <api-token>" https://platform.rescale.com/api/v2/jobs/aabbcc/files/
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"dateUploaded": "2015-03-13T23:56:37.184619Z",
"decryptedSize": 1680,
"downloadUrl": "https://platform.rescale.com/api/v2/files/xTyjeg/contents/",
"encodedEncryptionKey": "VkAWWRkKR9xJIDJTdkVK42O/7+Xo3M4LOaGvP6HjHMA=",
"id": "xTyjeg",
"isDeleted": false,
"isUploaded": true,
"md5": "8632d6580e922bd9f8691cc2d6ea3443",
"name": "fvSchemes",
"owner": "mark@rescale.com",
"path": "user/user_KBdkT/output/job_OsKBd/run1/airFoil2D/system/fvSchemes",
"relativePath": "airFoil2D/system/fvSchemes",
"sharedWith": [],
"typeId": 5,
"viewInBrowser": true
}
]
}
List output files for a given job
This will return a paginated list of all output files in the job. There are some querystring arguments that can be used to filter the returned files:
Argument | Type | Description |
---|---|---|
search | String | Limits the returned output files to the ones that contain this value. |
page | int | The results page to return. Starts at 1. |
page_size | int | The number of results to include on a single page. |
For example: To return results 1-10 for all files that contain the string 'residuals’:
GET https://platform.rescale.com/api/v2/jobs/{job_id}/files/?search=residuals&page=1&page_size=10
Response Properties
Property | Type | Description |
---|---|---|
dateUploaded | DateTime | Date file was uploaded to Rescale by job |
decryptedSize | Integer | File size in bytes |
downloadUrl | URL | URL for retrieving file |
encodedEncryptionKey | String | Key to decrypt file |
id | String | Id of file |
isDeleted | Boolean | Whether file has been marked deleted |
isUploaded | Boolean | Whether file has finished uploading (false means upload is in progress or failed) |
md5 | String | MD5 string for file contents |
name | String | Name of file |
owner | String | Email address of file owner |
path | String | Path for file in Rescale storage |
relativePath | String | Path for file relative to job run |
sharedWith | Array<String> | List of email address the file was shared with |
typeId | Integer | Type of file (input, output, template, etc.), should be 5=output in this case |
viewInBrowser | Boolean | Whether the file can be viewed directly on Rescale using a browser |
Create a Job
POST https://platform.rescale.com/api/v2/jobs/
Basic job, no input files
curl -H "Authorization: Token <api-token>" -H "Content-Type: application/json" "https://platform.rescale.com/api/v2/jobs/" -d '
{
"name": "Example Job",
"jobanalyses": [
{
"analysis": {
"code": "user_included",
"version": "0"
},
"command": "echo \"Hello world\"",
"hardware": {
"coreType": "standard-plus",
"coresPerSlot": 1
}
}
]
}
'
import requests
requests.post(
'https://platform.rescale.com/api/v2/jobs/',
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'},
json={
'name': 'Example Job',
'jobanalyses': [
{
'analysis': {
'code': 'user_included',
'version': '0'
},
'command': 'echo "Hello world"',
'hardware': {
'coreType': 'standard-plus',
'coresPerSlot': 1
}
}
]
}
)
Response
{
"archiveFilters": [],
"billingPriorityValue": null,
"caseFile": null,
"expectedRuns": null,
"id": "LeeKa",
"includeNominalRun": false,
"isLowPriority": false,
"isTemplateDryRun": false,
"jobanalyses": [
{
"analysis": {
"code": "user_included",
"name": "Custom User-Defined Software",
"version": "0",
"versionName": ""
},
"command": "echo \"Hello world\"",
"envVars": {},
"flags": {},
"hardware": {
"coreSummary": {
"memoryPerNode": 3750,
"numberOfNodes": 1.0,
"storagePerNode": 4000
},
"coreType": "standard-plus",
"coresPerSlot": 1,
"slots": 1,
"walltime": null
},
"inputFiles": [],
"postProcessScript": null,
"postProcessScriptCommand": "",
"preProcessScript": null,
"preProcessScriptCommand": "",
"templateTasks": [],
"useRescaleLicense": false
}
],
"jobvariables": [],
"monteCarloIterations": null,
"name": "Jobbo",
"optimizer": null,
"owner": "mark@rescale.com",
"paramFile": null,
"remoteVizConfig": null,
"resourceFilters": []
}
Submitting a Core Type Set job
curl -H "Authorization: Token <api-token>" -H "Content-Type: application/json" "https://platform.rescale.com/api/v2/jobs/" -d '
{
"name": "Example Job",
"jobanalyses": [
{
"analysis": {
"code": "user_included",
"version": "0"
},
"command": "echo \"Hello world\"",
"hardware": {
"coreClass": {
"code": "coretype1-od-coretype2-od",
},
"coresPerSlot": 1
}
}
]
}
'
import requests
requests.post(
'https://platform.rescale.com/api/v2/jobs/',
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'},
json={
'name': 'Example Job',
'jobanalyses': [
{
'analysis': {
'code': 'user_included',
'version': '0'
},
'command': 'echo "Hello world"',
'hardware': {
'coreClass': {
'code': 'coretype1-od-coretype2-od'
},
'coresPerSlot': 1
}
}
]
}
)
Response for Coretype Set Job
{
"archiveFilters": [],
"billingPriorityValue": null,
"caseFile": null,
"expectedRuns": null,
"id": "LeeKa",
"includeNominalRun": false,
"isLowPriority": false,
"isTemplateDryRun": false,
"jobanalyses": [
{
"analysis": {
"code": "user_included",
"name": "Custom User-Defined Software",
"version": "0",
"versionName": ""
},
"command": "echo \"Hello world\"",
"envVars": {},
"flags": {},
"hardware": {
"coreSummary": {
"memoryPerNode": 3750,
"numberOfNodes": 1.0,
"storagePerNode": 4000
},
"coreClass": {
"acronym": "SP",
"code": "coretype1-od-coretype2-od",
"coreTypeConfigs": [
{
"coreType": "coretype-1",
"name": "Coretype 1",
"order": 0,
"priority": "od"
},
{
"coreType": "coretype-2",
"name": "Coretype 2",
"order": 1,
"priority": "od"
}
]
},
"coresPerSlot": 1,
"slots": 1,
"walltime": null
},
"inputFiles": [],
"postProcessScript": null,
"postProcessScriptCommand": "",
"preProcessScript": null,
"preProcessScriptCommand": "",
"templateTasks": [],
"useRescaleLicense": false
}
],
"jobvariables": [],
"monteCarloIterations": null,
"name": "Jobbo",
"optimizer": null,
"owner": "mark@rescale.com",
"paramFile": null,
"remoteVizConfig": null,
"resourceFilters": []
}
Creates and saves a job, DOES NOT start job, see submit below.
Job level fields
Field | Default | Required | Description |
---|---|---|---|
name | None | Yes | Human friendly name for this job. |
paramFile | None | No | File with parameter variables. |
caseFile | None | No | File with case variables. |
jobvariables | None | No | List of job variables for this job. See details below. |
jobanalyses | None | Yes | List of analyses for this job. See details below. |
resourceFilters | Default filters | No | List of filtering rules for output files. |
isTemplateDryRun | False | No | Run this job in “dry run” mode. |
includeNominalRun | False | No | Include the run with nominal variables. |
monteCarloIterations | None | No | Number of iterations in case the variables use a monteCarlo generator type. |
billingPriorityValue | None | No | Priority for job hardware. Options are: 'INSTANT’ for On Demand Priority, 'ON_DEMAND’ for On Demand Economy, 'RESERVED’ for On Demand Reserved. |
JobVariables
A job may contain one or more variables. You might find this field useful in setting up a classic Design of Experiments job with Rescale.
Field | Default | Required | Description |
---|---|---|---|
name | None | Yes | Name for the the variable. |
variableType | None | Yes | Options are: 'Param’, 'Design’, 'Output’, 'Case’, 'Constraint’ & 'Objective’ |
displayOrder | None | Yes | Order in which the variables appear in the Rescale UI |
variableGeneratorType | None | Yes | Options are: 'Normal’, 'Uniform’, 'Linspace’, 'FixedRange’, 'Triangular’ & 'LogNormal’ |
valueGeneratorSettings | None | Yes | JSON blob describing the generator |
JobAnalyses
A job needs at least one analysis. You can use analyses endpoint to get a list of current Analyses available on Rescale and the sample JSON schema for a particular analysis, which could help you in constructing your JSON blob.
Field | Default | Required | Description |
---|---|---|---|
analysis | None | Yes | Analysis to use. This field is a JSON blob with schema {“code”, “version”}. A GET call to /api/analyses/ end point should get you the code for software package you want. “version” is an optional parameter. |
command | None | Yes | Command to run this analysis with. |
useMpi | False | No | Whether you want to spin up an mpi cluster. |
envVars | Empty dict | No | Dictionary of environment variables for this analysis. |
hardware | None | Yes | Hardware settings for this analysis. Takes a JSON blob with schema {"coreType", "coresPerSlot"} OR {"coreClass", "coresPerSlot"} . |
inputFiles | None | No | List of input files for this analysis. |
useRescaleLicense | False | No | If the analysis has an option for using a Rescale provided license, set this field to True. |
templateTasks | None | No | The template file for this analysis. |
preProcessScript | None | No | Pre-processing script for this analysis. |
preProcessScriptCommand | None | No | Command to kick off the pre-processing script. |
postProcessScript | None | No | Post-processing script for this analysis. |
postProcessScriptCommand | None | No | Command to kick off the post-processing script. |
onDemandLicenseSeller | None | No | A dictionary with the schema of {"code", "name"} where code and name are the license provider’s code and name, respectively. Note that you should either pass this option or userDefinedLicenseSettings . |
userDefinedLicenseSettings | None | No | User-defined license settings for the analysis is a definition of multiple sets of license feature counts that the user expects the analysis to use for running the job. It is expected that only one of the specified featureSets will be used, based on which set has all necessary features available. Takes a JSON blob with the schema of { featureSets } where featureSets takes an array of features with the schema of {name , features }. features in the latter takes an array of dictionaries with {name , count } schema. |
Submitting a job with user-defined license settings for an analysis
import requests
requests.post(
'https://platform.rescale.com/api/v2/jobs/',
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'},
json={
"name": "Example Job",
"jobanalyses": [
{
"analysis": {
"code": "ls_dyna",
"version": "13.0.0"
},
"command": "ls-dyna -i <input> -p <precision>",
"hardware": {
"coreType": "emerald",
"coresPerSlot": 1,
"slots": 1,
"type": "compute",
"walltime": 24
},
"envVars": {
"LSTC_LICENSE_SERVER": "25678@172.00.00.000"
},
"onDemandLicenseSeller": None,
"userDefinedLicenseSettings": {
"featureSets": [
{
"name": "USER_SPECIFIED",
"features": [
{
"name": "MPPDYNA_971",
"count": 1
},
{
"name": "LS-DYNA",
"count": 1
}
]
}
]
}
}
]
}
)
Submit a Saved Job
POST https://platform.rescale.com/api/v2/jobs/{job_id}/submit/
curl -H "Authorization: Token <api-token>" https://platform.rescale.com/api/v2/jobs/LeeKa/submit/ -X POST
Submits a saved job to run. No data returned.
Update a Job
PUT https://platform.rescale.com/api/v2/jobs/{job_id}
PATCH https://platform.rescale.com/api/v2/jobs/{job_id}
Change the name
curl -H "Authorization: Token <api-token>" -H "Content-Type:application/json" "https://platform.rescale.com/api/v2/jobs/LeeKa/" -X PATCH -d '
{
"name": "Jobster"
}
'
Response
{
"id": "LeeKa",
"isLowPriority": false,
"name": "Jobster"
}
Delete a Job
DELETE https://platform.rescale.com/api/v2/jobs/{job_id}/
Note that jobs that are currently executing cannot be deleted. You will need to stop the job first.
curl -H 'Authorization: Token <api-token>' -H 'Content-Type: application/json' https://platform.rescale.com/api/v2/jobs/gVWWdb/ -X DELETE
import requests
requests.delete(
'https://platform.rescale.com/api/v2/jobs/gVWWdb/',
headers={'Authorization': 'Token <api-token>'}
)
Allowed request body fields:
Field | Type | Default | Required | Description |
---|---|---|---|---|
deleteInputFiles | Boolean | false |
No | If set to true , the input files associated with the job will be deleted as well. |
A 204 response code is returned upon a successful delete. No data returned.
Delete Multiple Jobs
DELETE https://platform.rescale.com/api/v2/jobs/
You can delete multiple jobs at once by passing a list of job ids to the body of the HTTP request.
Note that jobs that are currently executing cannot be deleted. You will need to stop the job first.
curl -H 'Authorization: Token <api-token>' -H 'Content-Type: application/json' https://platform.rescale.com/api/v2/jobs/ -X DELETE
import requests
requests.delete(
'https://platform.rescale.com/api/v2/jobs/',
headers={'Authorization': 'Token <api-token>'}
)
Allowed request body fields:
Field | Type | Default | Required | Description |
---|---|---|---|---|
jobIds | Array | None | Yes | List of job ids to delete. |
deleteInputFiles | Boolean | false |
No | If set to true , the input files associated with the job ids will be deleted as well. |
Stop a Job
POST https://platform.rescale.com/api/v2/jobs/{job_id}/stop/
Submits a request to stop a running job. Poll the job/cluster status endpoints to monitor the exact time when the job is stopped.
curl -H 'Authorization: Token <api-token>' -H 'Content-Type: application/json' https://platform.rescale.com/api/v2/jobs/SsdkT/stop/ -X POST
import requests
requests.post(
'https://platform.rescale.com/api/v2/jobs/SsdkT/stop/',
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'}
)
A 202 response code is returned if the stop request was successfully submitted. No data returned.
The above stop request will do several things:
- Send a graceful termination to the application the job is running and wait some time before killing the application
- Save all job output files to Rescale Files If you are interested in skipping parts of this lifecycle on shutdown, there are a number of more forceful termination requests:
POST https://platform.rescale.com/api/v2/jobs/{job_id}/force_stop/
This will SIGTERM the application and skip graceful application shutdown, job output files will STILL be saved.
If you also want to skip output file saving as well and immediately terminate the job:
POST https://platform.rescale.com/api/v2/jobs/{job_id}/shutdown/
If you use this last method, all job output data will be lost and unrecoverable. Use with caution.
Share a Job
POST https://platform.rescale.com/api/v2/jobs/{job_id}/share/
Share a job with another user. If your user is associated with an organization, you will only be allowed to share your job with another user in your organization or an ISV support desk.
curl -H "Authorization: Token <api-token>" -H "Content-Type: application/json" "https://platform.rescale.com/api/v2/jobs/LeeKa/share/" -X POST -d '
{
"email": "support@rescale.com",
"message": "This job is not converging as quickly as I was expecting"
}
'
import requests
requests.post(
'https://platform.rescale.com/api/v2/jobs/LeeKa/share/',
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'},
json={
"email": "support@rescale.com",
"message": "This job is not converging as quickly as I was expecting"
}
)
Sample Response
{
"recipient":"support@rescale.com",
"supportDesk":null
}
List Job status history
GET https://platform.rescale.com/api/v2/jobs/{job_id}/statuses/
curl -H 'Authorization: Token <api-token>' -H 'Content-Type: application/json' https://platform.rescale.com/api/v2/jobs/cHDtgb/statuses/
import requests
requests.get(
'https://platform.rescale.com/api/v2/jobs/cHDtgb/statuses/',
headers={'Authorization': 'Token <api-token>'}
)
Sample Response
{
"count": 6,
"previous": null,
"results": [
{
"status": "Completed",
"statusDate": "2016-04-21T17:24:34.898495Z",
"statusReason": "Completed successfully"
},
{
"status": "Executing",
"statusDate": "2016-04-21T17:15:59.012000Z",
"statusReason": null
},
{
"status": "Validated",
"statusDate": "2016-04-21T17:07:18.088000Z",
"statusReason": null
},
{
"status": "Started",
"statusDate": "2016-04-21T17:07:15.153000Z",
"statusReason": null
},
{
"status": "Queued",
"statusDate": "2016-04-21T17:07:04.761050Z",
"statusReason": null
},
{
"status": "Pending",
"statusDate": "2016-04-21T17:06:32.086507Z",
"statusReason": null
}
],
"next": null
}
Response Properties
Property | Type | Description |
---|---|---|
status | String | A job status code |
statusDate | Date | ISO8601 encoded date of when the job status changed |
statusReason | String | (Optional) Extra context for the status. Eg, a failure reason |
List Cluster Status History for a Job
GET https://platform.rescale.com/api/v2/jobs/{job_id}/cluster_statuses/
curl -H 'Authorization: Token <api-token>' -H 'Content-Type: application/json' https://platform.rescale.com/api/v2/jobs/cHDtgb/cluster_statuses/
import requests
requests.get(
'https://platform.rescale.com/api/v2/jobs/cHDtgb/cluster_statuses/',
headers={'Authorization': 'Token <api-token>'}
)
Sample Response
{
"count": 6,
"previous": null,
"results": [
{
"status": "Stopped",
"statusDate": "2016-04-21T17:25:20.717000Z",
"statusReason": null
},
{
"status": "Stopping",
"statusDate": "2016-04-21T17:24:38.158000Z",
"statusReason": null
},
{
"status": "Stop Requested",
"statusDate": "2016-04-21T17:24:35.260585Z",
"statusReason": null
},
{
"status": "Started",
"statusDate": "2016-04-21T17:15:47.790000Z",
"statusReason": null
},
{
"status": "Starting",
"statusDate": "2016-04-21T17:07:25.127000Z",
"statusReason": null
},
{
"status": "Not Started",
"statusDate": "2016-04-21T17:07:04.719293Z",
"statusReason": null
}
]
}
Response Properties
Property | Type | Description |
---|---|---|
status | String | A cluster status code |
statusDate | Date | ISO8601 encoded date of when the cluster status changed |
statusReason | String | (Optional) Extra context for the status. Eg, a failure reason |
List Job extended logs
GET https://platform.rescale.com/api/v2/jobs/{job_id}/extendedlogs/
Gets extended logs for a job. Extended logs are the combination of the user logs seen on a job and the statuses of a job. The job statuses are reformatted to match the log format and sorted by date along with the logs.
curl -H 'Authorization: Token <api-token>' -H 'Content-Type: application/json' https://platform.rescale.com/api/v2/jobs/cHDtgb/extendedlogs/
import requests
requests.get(
'https://platform.rescale.com/api/v2/jobs/cHDtgb/extendedlogs/',
headers={'Authorization': 'Token <api-token>'}
)
Sample Response
[
{
"displayTimestamp": "2023-04-28T04:53:05.100317+00:00",
"id": "hxzXS",
"level": "status",
"message": "Pending",
"source": "scheduler",
"timestamp": 1682657585100
},
{
"displayTimestamp": "2023-04-28T04:53:25.618000Z",
"id": "bLCOdb",
"level": "INFO",
"message": "Verifying job submission preconditions.",
"source": "scheduler",
"timestamp": 1682657605618
},
{
"displayTimestamp": "2023-04-28T04:53:26.877000Z",
"id": "GXJbT",
"level": "INFO",
"message": "Preconditions have been satisfied.",
"source": "scheduler",
"timestamp": 1682657606877
},
{
"displayTimestamp": "2023-04-28T04:53:26.943829+00:00",
"id": "wZsKdb",
"level": "status",
"message": "Waiting for Queue",
"source": "scheduler",
"timestamp": 1682657606943
},
{
"displayTimestamp": "2023-04-28T04:53:27.105712+00:00",
"id": "yXJbT",
"level": "status",
"message": "Queued",
"source": "scheduler",
"timestamp": 1682657607105
},
{
"displayTimestamp": "2023-04-28T04:54:05.435000+00:00",
"id": "NzCOdb",
"level": "status",
"message": "Started",
"source": "scheduler",
"timestamp": 1682657645435
},
{
"displayTimestamp": "2023-04-28T04:54:08.188000+00:00",
"id": "LhKbT",
"level": "status",
"message": "Validated",
"source": "scheduler",
"timestamp": 1682657648188
},
{
"displayTimestamp": "2023-04-28T04:54:08.535000Z",
"id": "VzCOdb",
"level": "INFO",
"message": "Starting server(s)",
"source": "Basalt, On Demand Priority",
"timestamp": 1682657648535
},
{
"displayTimestamp": "2023-04-28T05:24:27.368000Z",
"id": "ThKbT",
"level": "INFO",
"message": "Server(s) Started",
"source": "Basalt, On Demand Priority",
"timestamp": 1682659467368
},
{
"displayTimestamp": "2023-04-28T05:24:32.034000+00:00",
"id": "ZKCOdb",
"level": "status",
"message": "Executing",
"source": "scheduler",
"timestamp": 1682659472034
},
{
"displayTimestamp": "2023-04-28T05:24:37.035000Z",
"id": "hLCOdb",
"level": "DEBUG",
"message": "Running workflow...",
"source": "Basalt, On Demand Priority",
"timestamp": 1682659477035
},
{
"displayTimestamp": "2023-04-28T05:25:58.851000Z",
"id": "JXJbT",
"level": "INFO",
"message": "Saving files...",
"source": "Basalt, On Demand Priority",
"timestamp": 1682659558851
},
{
"displayTimestamp": "2023-04-28T05:26:02.260000Z",
"id": "XzCOdb",
"level": "INFO",
"message": "Finished saving files.",
"source": "Basalt, On Demand Priority",
"timestamp": 1682659562260
},
{
"displayTimestamp": "2023-04-28T05:26:05.072000Z",
"id": "VhKbT",
"level": "INFO",
"message": "Job Finished",
"source": "unknown",
"timestamp": 1682659565072
},
{
"displayTimestamp": "2023-04-28T05:26:05.080218+00:00",
"id": "AXJbT",
"level": "status",
"message": "Completed",
"source": "scheduler",
"timestamp": 1682659565080
},
{
"displayTimestamp": "2023-04-28T05:26:06.422000Z",
"id": "fQTMk",
"level": "INFO",
"message": "Shutting down cluster ...",
"source": "Basalt, On Demand Priority",
"timestamp": 1682659566422
},
{
"displayTimestamp": "2023-04-28T05:27:08.513000Z",
"id": "Gcaaa",
"level": "INFO",
"message": "Cluster stopped",
"source": "Basalt, On Demand Priority",
"timestamp": 1682659628513
},
{
"displayTimestamp": "2023-06-26T19:03:40.163000Z",
"id": "zpdRk",
"level": "INFO",
"message": "CLUSTER UPTIME SUMMARY",
"source": "platform",
"timestamp": 1687806220163
},
{
"displayTimestamp": "2023-06-26T19:03:40.181000Z",
"id": "xXjea",
"level": "INFO",
"message": "(uptime metered by computing resource start/end time per node)",
"source": "platform",
"timestamp": 1687806220181
},
{
"displayTimestamp": "2023-06-26T19:03:40.243000Z",
"id": "MzdRk",
"level": "INFO",
"message": "Compute node 1 dev-wquinn-cluster0199-cs-compute0-0 uptime: 3.7667 core-hours",
"source": "platform",
"timestamp": 1687806220243
},
{
"displayTimestamp": "2023-06-26T19:03:40.249000Z",
"id": "nNjea",
"level": "INFO",
"message": "------------------------------------------------------------",
"source": "platform",
"timestamp": 1687806220249
},
{
"displayTimestamp": "2023-06-26T19:03:40.254000Z",
"id": "BpdRk",
"level": "INFO",
"message": "Total Billable Uptime: 3.7667 core-hours",
"source": "platform",
"timestamp": 1687806220254
}
]
Response Properties
Property | Type | Description |
---|---|---|
displayTimestamp | String | Timestamp of log |
id | String | Id of log |
level | String | Category of log eg INFO, ERROR |
message | String | Log message |
source | String | Where log was sent from |
timestamp | String | Timestamp of log in Unix format |
List Custom Fields in Your Workspace
Beta API endpoints may change without notice, and this document may not reflect their current behavior.
Get the current list of custom fields that apply to compute and workstation jobs in your workspace:
GET https://platform.rescale.com/api/v2/organizations/{company_code}/workspaces/{workspace_id}/custom-fields/
curl -H 'Authorization: Token <api-token>' https://platform.rescale.com/api/v2/organizations/rescale/workspaces/03-066880176/custom-fields/
import requests
requests.get(
'https://platform.rescale.com/api/v2/organizations/rescale/workspaces/03-066880176/custom-fields/',
headers={'Authorization': 'Token <api-token>'}
)
Sample Response
{
"fields": {
"compute": {
"Context": [
{
"name": "Study",
"valueType": "text",
"enumOptions": [],
"placeholder": "Study Name",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
},
{
"name": "Deadline",
"valueType": "date",
"enumOptions": [],
"placeholder": "Date",
"helpText": "Enter the date you expect the study to be completed.",
"isMultiple": false,
"isRequired": false,
"allowOther": false
},
{
"name": "Development Status",
"valueType": "select",
"enumOptions": [
"Exploration",
"Development",
"Maintenance"
],
"placeholder": "",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
},
{
"name": "CAD Part Number",
"valueType": "text",
"enumOptions": [],
"placeholder": "",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
},
{
"name": "Cost Center",
"valueType": "text",
"enumOptions": [],
"placeholder": "",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
}
],
"Findings": [
{
"name": "Simulation Outcome",
"valueType": "select",
"enumOptions": [
"Successful",
"Failure"
],
"placeholder": "",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
},
{
"name": "Recommendations",
"valueType": "text",
"enumOptions": [],
"placeholder": "",
"helpText": "Learnings from this job.",
"isMultiple": false,
"isRequired": false,
"allowOther": false
}
],
"Inputs": [
{
"name": "Design Version",
"valueType": "text",
"enumOptions": [],
"placeholder": "",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
},
{
"name": "Load Case",
"valueType": "text",
"enumOptions": [],
"placeholder": "",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
},
{
"name": "Material Property",
"valueType": "select",
"enumOptions": [
"Aluminum",
"Titanium",
"Tungsten"
],
"placeholder": "",
"helpText": "",
"isMultiple": true,
"isRequired": false,
"allowOther": true
},
{
"name": "Material Validation",
"valueType": "select",
"enumOptions": [
"Plasticity Specified (check if yes)",
"Johson-cook model used (check if yes)",
"Yield criteria specified (check if yes)"
],
"placeholder": "",
"helpText": "",
"isMultiple": true,
"isRequired": false,
"allowOther": true
},
{
"name": "Crank Length",
"valueType": "number",
"enumOptions": [],
"placeholder": "",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
}
]
},
"workstation": {}
},
"isEnabled": true
}
Response Properties
Property | Type | Description |
---|---|---|
fields | Object | Keys with “compute” or “workstation” corresponding to the job type, with each containing keys for each section which has at least one field of “Inputs”, “Context”, or “Findings” |
isEnabled | Boolean | Whether the interface to collect custom fields is enabled, and whether missing required fields can block a job’s submission |
Field Properties
Property | Type | Description |
---|---|---|
name | String | The name of the field, which is also the name you use when POST-ing a value for a job to identify it |
valueType | Enum | text, number, select, date, file, or user (see “Submit Custom Fields on a Job” below for information on how to format each type) |
enumOptions | Array |
For only the select type, the pre-defined options |
allowOther | Boolean | For only the select type, whether the enumOptions are exhaustive or if users may provide a response of their own |
placeholder | String | The label the input for this field shows when it’s blank, which may provide formatting or usage hints |
helpText | String | Extended description or context for the field, if any |
isMultiple | Boolean | Whether the response is expected to be a single value or an array |
isRequired | Boolean | Whether the response must be provided before the job can be submitted. Required fields become locked after the job starts running. |
Assign Custom Fields to a Job
Beta API endpoints may change without notice, and this document may not reflect their current behavior.
Custom fields can be assigned to a single job, allowing users to create additional custom fields specific to that job. The shape of the request is documented below in the request properties section
POST https://platform.rescale.com/api/v2/jobs/{job_id}/custom-fields/assigned/
curl -H 'Authorization: Token <api-token>' -H 'Content-Type: application/json' https://platform.rescale.com/api/v2/jobs/cHDtgb/custom-fields/assigned/ -d '{
"fields": { ... }
}'
import requests
requests.post(
'https://platform.rescale.com/api/v2/jobs/cHDtgb/custom-fields/assigned/',
headers={'Authorization': 'Token <api-token>'},
json={
"fields": { ... },
}
)
Sample Response
{
"fields": {
"Context": [
{
"name": "Study",
"valueType": "text",
"enumOptions": [],
"placeholder": "Study Name",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
},
{
"name": "Deadline",
"valueType": "date",
"enumOptions": [],
"placeholder": "Date",
"helpText": "Enter the date you expect the study to be completed.",
"isMultiple": false,
"isRequired": false,
"allowOther": false
},
{
"name": "Development Status",
"valueType": "select",
"enumOptions": [
"Exploration",
"Development",
"Maintenance"
],
"placeholder": "",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
},
{
"name": "CAD Part Number",
"valueType": "text",
"enumOptions": [],
"placeholder": "",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
},
{
"name": "Cost Center",
"valueType": "text",
"enumOptions": [],
"placeholder": "",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
}
],
"Findings": [
{
"name": "Simulation Outcome",
"valueType": "select",
"enumOptions": [
"Successful",
"Failure"
],
"placeholder": "",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
},
{
"name": "Recommendations",
"valueType": "text",
"enumOptions": [],
"placeholder": "",
"helpText": "Learnings from this job.",
"isMultiple": false,
"isRequired": false,
"allowOther": false
}
],
"Inputs": [
{
"name": "Design Version",
"valueType": "text",
"enumOptions": [],
"placeholder": "",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
},
{
"name": "Load Case",
"valueType": "text",
"enumOptions": [],
"placeholder": "",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
},
{
"name": "Material Property",
"valueType": "select",
"enumOptions": [
"Aluminum",
"Titanium",
"Tungsten"
],
"placeholder": "",
"helpText": "",
"isMultiple": true,
"isRequired": false,
"allowOther": true
},
{
"name": "Material Validation",
"valueType": "select",
"enumOptions": [
"Plasticity Specified (check if yes)",
"Johson-cook model used (check if yes)",
"Yield criteria specified (check if yes)"
],
"placeholder": "",
"helpText": "",
"isMultiple": true,
"isRequired": false,
"allowOther": true
},
{
"name": "Crank Length",
"valueType": "number",
"enumOptions": [],
"placeholder": "",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
}
]
}
}
Request Properties
Property | Type | Description |
---|---|---|
fields | Object | Keys with “Context”, “Inputs”, and “Findings” corresponding to |
Fields Properties
Property | Type | Description |
---|---|---|
Context | Array | An array of custom fields that belong in the context category |
Inputs | Array | An array of custom fields that belong in the inputs category |
Findings | Array | An array of custom fields that belong in the findings category |
Custom Field Properties
Property | Type | Description |
---|---|---|
name | String | The name of the field, which is also the name you use when POST-ing a value for a job to identify it |
valueType | Enum | text, number, select, date, file, or user (see “Submit Custom Fields on a Job” below for information on how to format each type) |
enumOptions | Array |
For only the select type, the pre-defined options |
allowOther | Boolean | For only the select type, whether the enumOptions are exhaustive or if users may provide a response of their own |
placeholder | String | The label the input for this field shows when it’s blank, which may provide formatting or usage hints |
helpText | String | Extended description or context for the field, if any |
isMultiple | Boolean | Whether the response is expected to be a single value or an array |
isRequired | Boolean | Whether the response must be provided before the job can be submitted. Required fields become locked after the job starts running. |
Response Properties
Property | Type | Description |
---|---|---|
fields | Object | Keys with “Context”, “Inputs”, and “Findings” corresponding to the category in which the custom fields are assigned. |
Field Properties
Property | Type | Description |
---|---|---|
name | String | The name of the field, which is also the name you use when POST-ing a value for a job to identify it |
valueType | Enum | text, number, select, date, file, or user (see “Submit Custom Fields on a Job” below for information on how to format each type) |
enumOptions | Array |
For only the select type, the pre-defined options |
allowOther | Boolean | For only the select type, whether the enumOptions are exhaustive or if users may provide a response of their own |
placeholder | String | The label the input for this field shows when it’s blank, which may provide formatting or usage hints |
helpText | String | Extended description or context for the field, if any |
isMultiple | Boolean | Whether the response is expected to be a single value or an array |
isRequired | Boolean | Whether the response must be provided before the job can be submitted. Required fields become locked after the job starts running. |
List Custom Fields Assigned to a Job
Beta API endpoints may change without notice, and this document may not reflect their current behavior.
Custom fields that have been assigned to a job can be fetched with a GET
request.
GET https://platform.rescale.com/api/v2/jobs/{job_id}/custom-fields/assigned/
curl -H 'Authorization: Token <api-token>' https://platform.rescale.com/api/v2/jobs/cHDtgb/custom-fields/assigned/
import requests
requests.get(
'https://platform.rescale.com/api/v2/jobs/cHDtgb/custom-fields/assigned/',
headers={'Authorization': 'Token <api-token>'}
)
Sample Response
{
"fields": {
"Context": [
{
"name": "Study",
"valueType": "text",
"enumOptions": [],
"placeholder": "Study Name",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
},
{
"name": "Deadline",
"valueType": "date",
"enumOptions": [],
"placeholder": "Date",
"helpText": "Enter the date you expect the study to be completed.",
"isMultiple": false,
"isRequired": false,
"allowOther": false
},
{
"name": "Development Status",
"valueType": "select",
"enumOptions": [
"Exploration",
"Development",
"Maintenance"
],
"placeholder": "",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
},
{
"name": "CAD Part Number",
"valueType": "text",
"enumOptions": [],
"placeholder": "",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
},
{
"name": "Cost Center",
"valueType": "text",
"enumOptions": [],
"placeholder": "",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
}
],
"Findings": [
{
"name": "Simulation Outcome",
"valueType": "select",
"enumOptions": [
"Successful",
"Failure"
],
"placeholder": "",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
},
{
"name": "Recommendations",
"valueType": "text",
"enumOptions": [],
"placeholder": "",
"helpText": "Learnings from this job.",
"isMultiple": false,
"isRequired": false,
"allowOther": false
}
],
"Inputs": [
{
"name": "Design Version",
"valueType": "text",
"enumOptions": [],
"placeholder": "",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
},
{
"name": "Load Case",
"valueType": "text",
"enumOptions": [],
"placeholder": "",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
},
{
"name": "Material Property",
"valueType": "select",
"enumOptions": [
"Aluminum",
"Titanium",
"Tungsten"
],
"placeholder": "",
"helpText": "",
"isMultiple": true,
"isRequired": false,
"allowOther": true
},
{
"name": "Material Validation",
"valueType": "select",
"enumOptions": [
"Plasticity Specified (check if yes)",
"Johson-cook model used (check if yes)",
"Yield criteria specified (check if yes)"
],
"placeholder": "",
"helpText": "",
"isMultiple": true,
"isRequired": false,
"allowOther": true
},
{
"name": "Crank Length",
"valueType": "number",
"enumOptions": [],
"placeholder": "",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
}
]
}
}
Response Properties
Property | Type | Description |
---|---|---|
fields | Object | Keys with “Context”, “Inputs”, and “Findings” corresponding to the category in which the custom fields are assigned. |
Field Properties
Property | Type | Description |
---|---|---|
name | String | The name of the field, which is also the name you use when POST-ing a value for a job to identify it |
valueType | Enum | text, number, select, date, file, or user (see “Submit Custom Fields on a Job” below for information on how to format each type) |
enumOptions | Array |
For only the select type, the pre-defined options |
allowOther | Boolean | For only the select type, whether the enumOptions are exhaustive or if users may provide a response of their own |
placeholder | String | The label the input for this field shows when it’s blank, which may provide formatting or usage hints |
helpText | String | Extended description or context for the field, if any |
isMultiple | Boolean | Whether the response is expected to be a single value or an array |
isRequired | Boolean | Whether the response must be provided before the job can be submitted. Required fields become locked after the job starts running. |
List Custom Fields on a Job
Beta API endpoints may change without notice, and this document may not reflect their current behavior.
Custom fields that are defined on a job are included as part of the response to the “Get a Specific Job” endpoint above.
You can also get them separately:
GET https://platform.rescale.com/api/v2/jobs/{job_id}/custom-fields/
curl -H 'Authorization: Token <api-token>' https://platform.rescale.com/api/v2/jobs/cHDtgb/custom-fields/
import requests
requests.get(
'https://platform.rescale.com/api/v2/jobs/cHDtgb/custom-fields/',
headers={'Authorization': 'Token <api-token>'}
)
Sample Response
{
"Deadline": {
"meta": {
"name": "Deadline",
"valueType": "date",
"enumOptions": [],
"placeholder": "Date",
"helpText": "Enter the date you expect the study to be completed.",
"isMultiple": false,
"isRequired": false,
"allowOther": false
},
"user": "example@rescale.com",
"value": "2023/12/05"
},
"Development Status": {
"meta": {
"name": "Development Status",
"valueType": "select",
"enumOptions": [
"Exploration",
"Development",
"Maintenance"
],
"placeholder": "",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
},
"user": "example@rescale.com",
"value": "Exploration"
},
"Study": {
"meta": {
"name": "Study",
"valueType": "text",
"enumOptions": [],
"placeholder": "Study Name",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
},
"user": "example@rescale.com",
"value": "test study"
}
}
Each custom field which has a value for the job is represented as a value of the response object with the key corresponding to the field’s name:
Field Properties
Property | Type | Description |
---|---|---|
meta | Object | The definition and validation properties of the field. The structure of this document is explained above in “List Custom Fields in Your Workspace” |
user | String | The email address of the user that set this field’s value. |
value | Mixed | The value submitted for the field. See below in “Submit Custom Fields for a Job” for information on formatting values for each field type |
Submit Custom Fields on a Job
Beta API endpoints may change without notice, and this document may not reflect their current behavior.
Attach values for custom fields on a saved job. Fields that are required must be submitted before the job is run and cannot be changed after. Optional fields may be added or amended at any time.
POST https://platform.rescale.com/api/v2/jobs/{job_id}/custom-fields/
curl -H "Authorization: Token <api-token>" -H "Content-Type: application/json" "https://platform.rescale.com/api/v2/jobs/{job_id}/custom-fields/" -d '{
"Study": "my study"
}'
import requests
requests.post(
'https://platform.rescale.com/api/v2/jobs/{job_id}/custom-fields/',
headers={'Content-Type': 'application/json', 'Authorization': 'Token <api-token>'},
json={
'Study': 'my study',
}
)
Sample Response
{
"Study": {
"meta": {
"name": "Study",
"valueType": "text",
"enumOptions": [],
"placeholder": "Study Name",
"helpText": "",
"isMultiple": false,
"isRequired": false,
"allowOther": false
},
"user": "example@rescale.com",
"value": "my study"
}
}
Keys in the response correspond to field names with values:
Field Properties
Property | Type | Description |
---|---|---|
meta | Object | The definition and validation properties of the field. The structure of this document is explained above in “List Custom Fields in Your Workspace” |
value | Mixed | The value submitted for the field. |
Formatting Values
If the field’s definition specifies isMultiple
, the value must be submitted as an array, even if it contains one or zero items. Each individual item is formatted according to the valueType
:
valueType | Format |
---|---|
text | "any string" , quoted in JSON |
number | e.g., 42 , 4.2 , or with scientific/engineering notation 4.2e-10 . Do not quote numbers in JSON. |
select | A string listed in enumOptions , or, if allowOther , any string. (If both allowOther and isMultiple , only one value in the array may be a custom string that does not appear in enumOptions ) |
date | Dates are normalized as YYYY/MM/DD . You may submit them in this format, or use any well-known date or datetime format, though note that any time portion will be truncated. |
user | It is recommended but not required to use an email address for this field. |
file | The string identifier for a Rescale file, for which the submitting user must have at least read access. |
Add a Tag to a Job
POST https://platform.rescale.com/api/v2/jobs/{job_id}/tags/
Add a new or existing tag to a job.
curl -H "Authorization: Token <api-token>" -H "Content-Type: application/json" "https://platform.rescale.com/api/v2/jobs/{job_id}/tags/" -X POST -d '
{
"name": "new - tag _ 1"
}
'
import requests
requests.post(
'https://platform.rescale.com/api/v2/jobs/{job_id}/tags/',
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'},
json={
"name": "new - tag _ 1"
}
)
Sample Response
{
"name":"new - tag _ 1",
"normalizedName": "newtag1"
}
Get a list of Tags on a Job
GET https://platform.rescale.com/api/v2/jobs/{job_id}/tags/
curl -H "Authorization: Token <api-token>" -H "Content-Type: application/json" "https://platform.rescale.com/api/v2/jobs/{job_id}/tags/" -X GET
import requests
requests.get(
'https://platform.rescale.com/api/v2/jobs/{job_id}/tags/',
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'}
)
Sample Response
[
{
"name":"new - tag _ 1",
"normalizedName": "newtag1"
},
{
"name":"new - tag _ 2",
"normalizedName": "newtag2"
}
]
Response Properties
Property | Type | Description |
---|---|---|
name | String | The displayed name of the tag |
normalizedName | String | The name of the tag with spaces, dashes, and underscores removed |
Remove a Tag from a Job
DELETE https://platform.rescale.com/api/v2/jobs/{job_id}/tags/
curl -H "Authorization: Token <api-token>" -H "Content-Type: application/json" "https://platform.rescale.com/api/v2/jobs/{job_id}/tags/" -X DELETE -d '
{
"name": "new - tag _ 1"
}
'
import requests
requests.delete(
'https://platform.rescale.com/api/v2/jobs/{job_id}/tags/',
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'},
json={
"name": "new - tag _ 1"
}
)
List Job Instances
GET https://platform.rescale.com/api/v2/jobs/{job_id}/instances/
curl -H "Authorization: Token <api-token>" -H "Content-Type: application/json" "https://platform.rescale.com/api/v2/jobs/{job_id}/instances/"
import requests
requests.get(
'https://platform.rescale.com/api/v2/jobs/{job_id}/instances/',
headers={'Content-Type': 'application/json', 'Authorization': 'Token <api-token>'}
)
Sample Response
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": "PbKoeg",
"clusterId": "bUMOb",
"instanceGroup": "compute0",
"role": "CUSTOM",
"publicIp": "34.227.67.116",
"privateIp": "10.25.14.159",
"privateHostname": "ip-10-25-14-159",
"publicHostname": "ec2-34-227-67-116.compute-1.amazonaws.com",
"dateStarted": "2023-12-07T17:47:25Z",
"supportedServices": [
"ssh"
],
"username": "uprod_OvTpU",
"isBehindNat": false,
"sshPort": 22,
"tenancy": "default"
}
]
}
List VM instances for a given job. Note that some of the fields are for internal use, and thus undocumented.
Field Properties
Property | Type | Description |
---|---|---|
id | String | Id of instance |
clusterId | String | Id of instance’s cluster |
instanceGroup | String | Id of instance’s group |
publicIp | String | The instance’s public IP |
privateIp | String | The instance’s private IP |
privateHostname | String | The instance’s private hostname |
publicHostname | String | The instance’s public hostname |
dateStarted | DateTime | The instance’s start date |
supportedServices | Array |
List of supported remote access options, such as “ssh”, “rdp”, “vnc” |
username | String | The instance’s expected jobuser account name |
isBehindNat | Boolean | Whether the instance is behind a NAT |
sshPort | Integer | Port number for ssh access |
List All Jobs in a Project
GET https://platform.rescale.com/api/v2/organizations/{organization}/projects/{projectId}/jobs/
curl -H "Authorization: Token <api-token>" https://platform.rescale.com/api/v2/organizations/{organization}/projects/{projectId}/jobs/
import requests
requests.get(
'https://platform.rescale.com/api/v2/organizations/{organization}/projects/{projectId}/jobs/',
headers={'Authorization': 'Token <api-token>'}
)
Sample Response
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"dateInserted": "2023-11-16T17:32:40.943867Z",
"dateSubmitted": "2023-11-16T17:32:59.411076Z",
"id": "coCnZb",
"name": "Untitled Job",
"owner": "wquinn@rescale.com",
"workspace": {
"id": "04-875358043",
"name": "Eng Team 🦄🚀🤯",
"configuredName": "Eng Team 🦄🚀🤯",
"description": "Workspace for the Unicorn... Engineering Team",
"isDefault": false,
"jobProjectRequired": false,
"showBillingItems": true,
"preventUsersCreatingTemplates": false,
"preventUsersCreatingUntemplatedJobs": false,
"rescaleAuthEnabled": true,
"hardwarePriority": "odp",
"isPartner": false,
"priceSchema": "2021r1",
"autoshareJobsWithWorkspaceAdministrators": false
},
"project": {
"projectId": "duOxgb",
"projectName": "ProjectZ",
"posixUid": null,
"posixGid": null
},
"status": "Completed",
"statusReason": "Completed successfully",
"visibility": "Active",
"isTemplate": false,
"clonedFrom": null,
"templatedFrom": null,
"queuePriority": null,
"userHasAccess": true,
"billingPriorityValue": "ON_DEMAND",
"hardwareSettings": [
{
"coresPerSlot": 36,
"slots": 1,
"walltime": 8,
"coreType": "Emerald Max",
"coreTypeProperties": {
"acronym": "E",
"color": "#50c878"
},
"hardwareType": "compute"
}
],
"dateStarted": "2023-11-16T17:37:24.309135Z",
"remoteViz": null,
"jobAnalyses": [
{
"isOptimizer": false,
"analysisName": "Bring Your Own Software",
"analysisType": "compute",
"analysisVersion": "CPU"
}
],
"isSuspended": null,
"hoursSuspended": null,
"isOnPersistentCluster": false
}
]
}
This endpoint retrieves all the jobs visible to the authenticated user associated with the specified projectId
Response Properties
Property | Type | Description |
---|---|---|
dateInserted | String | The date this job was inserted |
dateSubmitted | String | The date this job was created |
id | String | A unique identifier for the job |
name | String | The name of this job |
owner | String | Email address of job owner |
workspace | Array<Object> | Workspace this job was run in |
project | Array<Object> | Project this job is associated with |
status | String | Status of the job |
statusReason | String | Status reason of the job |
visibility | String | Visibility of this job |
isTemplate | Boolean | Whether or not this job is a template |
clonedFrom | String | Where this job was cloned from if cloned |
templatedFrom | String | What this job was templated from if templated |
queuePriority | String | Queue Priority of this job |
userHasAccess | Boolean | Wthere or not user has access to this job |
billingPriorityValue | String | Priority for job hardware. Options are: ‘INSTANT’ for On Demand Priority, 'ON_DEMAND’ for On Demand Economy, 'RESERVED’ for On Demand Reserved. |
hardwareSettings | Array<Object> | Hardware settings of this job |
dateStarted | String | The date this job was started |
remoteViz | String | RemoteViz for this job |
jobAnalyses | Array<Object> | List of analyses for the job. |
List Project Job is Assigned To
GET https://platform.rescale.com/api/v2/organizations/{organization}/jobs/{job_id}/project-assignment/
curl -H "Authorization: Token <api-token>" -H "Content-Type: application/json" "https://platform.rescale.com/api/v2/organizations/{organization}/jobs/{job_id}/project-assignment/"
import requests
requests.get(
'https://platform.rescale.com/api/v2/organizations/{organization}/jobs/{job_id}/project-assignment/',
headers={'Content-Type': 'application/json', 'Authorization': 'Token <api-token>'}
)
Sample Response
{"projectId":"duOxgb"}
List the project ID of the project that a job is assigned to.
Field Properties
Property | Type | Description |
---|---|---|
projectId | String | Id of project |
Update Project Job is Assigned To
POST https://platform.rescale.com/api/v2/organizations/{organization}/jobs/{job_id}/project-assignment/
curl -H "Authorization: Token <api-token>" -H "Content-Type: application/json" "https://platform.rescale.com/api/v2/organizations/{organization}/jobs/{job_id}/project-assignment/" -X POST -d '
{
"projectId": "duOxgb"
}
'
import requests
requests.post(
'https://platform.rescale.com/api/v2/organizations/{organization}/jobs/{job_id}/project-assignment/',
headers={'Content-Type': 'application/json', 'Authorization': 'Token <api-token>'},
json={'projectId': 'duOxgb'}
)
Sample Response
{"projectId":"duOxgb"}
Update the project ID of the project that a job is assigned to.
Field Properties
Property | Type | Description |
---|---|---|
projectId | String | Id of project |
Runs
A single execution of your workflow is called a run in Rescale parlance.
List Runs for a Job
GET https://platform.rescale.com/api/v2/jobs/{job_id}/runs/
curl -X GET -H 'Authorization: Token \<token\>'
https://platform.rescale.com/api/v2/jobs/XXXXXX/runs/
import requests
requests.get(
'https://platform.rescale.com/api/v2/jobs/XXXXXX/runs/',
headers={'Authorization': 'Token <api-token>'}
)
Sample Response
{
"count": 121,
"next": "https://platform.rescale.com/api/v2/jobs/XXXXXX/runs/?page=2",
"previous": null,
"results": [
{
"dateCompleted": "2015-02-18T03:09:14.667000Z",
"dateStarted": "2015-02-18T03:08:49.117000Z",
"displayOrder": 1,
"id": "1",
"isOptimal": false,
"outputFileCount": 66,
"outputFileSize": 8018226,
"parent": null,
"type": 3,
"variables": [
{
"displayValue": "20",
"isRelative": false,
"name": "x_velocity",
"value": 20.0
},
{
"displayValue": "3",
"isRelative": false,
"name": "y_velocity",
"value": 3.0
},
{
"displayValue": "-0.0187556",
"isRelative": false,
"name": "Cd",
"value": -0.0187556
},
{
"displayValue": "0.140742",
"isRelative": false,
"name": "Cl",
"value": 0.140742
}
]
},
{
"dateCompleted": "2015-02-18T03:07:13.049000Z",
"dateStarted": "2015-02-18T03:06:46.477000Z",
"displayOrder": 2,
"id": "2",
"isOptimal": false,
"outputFileCount": 72,
"outputFileSize": 8805863,
"parent": null,
"type": 3,
"variables": [
{
"displayValue": "20",
"isRelative": false,
"name": "x_velocity",
"value": 20.0
},
{
"displayValue": "3.5",
"isRelative": false,
"name": "y_velocity",
"value": 3.5
},
{
"displayValue": "-0.0248332",
"isRelative": false,
"name": "Cd",
"value": -0.0248332
},
{
"displayValue": "0.157982",
"isRelative": false,
"name": "Cl",
"value": 0.157982
}
]
}
]
}
This call allows you to retrieve the first page of runs associated with job-id.
Response Properties
Property | Type | Description |
---|---|---|
count | Integer | The total number of runs in the job |
next | String | The URL that will return the next page of results. |
previous | String | The URL that will return the previous page of results |
results | Array<Object> | An array of Run objects |
Get a Run
GET https://platform.rescale.com/api/v2/jobs/{job_id}/runs/{run_id}/
curl -X GET -H 'Authorization: Token \<token\>'
https://platform.rescale.com/api/v2/jobs/XXXXXX/runs/1/
import requests
requests.get(
'https://platform.rescale.com/api/v2/jobs/XXXXXX/runs/1/',
headers={'Authorization': 'Token <api-token>'}
)
Sample Response
{
"dateCompleted": "2015-02-18T03:09:14.667000Z",
"dateStarted": "2015-02-18T03:08:49.117000Z",
"displayOrder": 1,
"id": "1",
"isOptimal": false,
"outputFileCount": 66,
"outputFileSize": 8018226,
"parent": null,
"type": 3,
"variables": [
{
"displayValue": "20",
"isRelative": false,
"name": "x_velocity",
"value": 20.0
},
{
"displayValue": "3",
"isRelative": false,
"name": "y_velocity",
"value": 3.0
},
{
"displayValue": "-0.0187556",
"isRelative": false,
"name": "Cd",
"value": -0.0187556
},
{
"displayValue": "0.140742",
"isRelative": false,
"name": "Cl",
"value": 0.140742
}
]
}
Response Properties
Property | Type | Description |
---|---|---|
dateCompleted | String | The ISO8601 encoded date of when the run finished. |
dateInserted | String | The ISO8601 encoded date of when the run started. |
displayOrder | Integer | Used for sorting a collection of runs into their canonical order. |
id | String | The unique identifier of the run within a job. |
isOptimal | Boolean | True if the optimizer or analysis code has designated this as a run of interest. |
outputFileCount | Integer | The number of output files associated with this run |
outputFileSize | Integer | The total size in bytes of all output files associated with this run |
parent | String | The identifier of the parent run. |
type | Integer | 1 = Optimization, 2 = Iteration, 3 = Case |
variables | List<Variable> | See below |
Variable Properties
Property | Type | Description |
---|---|---|
displayValue | String | The value that will be inserted into the template |
isRelative | Boolean | True if the variable values are relative to a default value entered into the template placeholder. |
name | String | The variable name |
value | Float | The floating point representation of the variable value |
This call allows you to retrieve details for a single run within a job.
Stop a Run
POST https://platform.rescale.com/api/v2/jobs/{job_id}/runs/{run_id}/stop/
curl -X POST -H 'Authorization: Token \<token\>'
https://platform.rescale.com/api/v2/jobs/XXXXX/runs/1/stop/
import requests
requests.post(
'https://platform.rescale.com/api/v2/jobs/XXXXX/runs/1/stop/',
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'}
)
Sample Response
{}
Stops an in-progress run. The workflow processes will be killed and any available output files will be uploaded to Rescale Cloud Storage.
Take a Snapshot
Taking a snapshot is a multi-step process. To do so, you’ll need to make the following API calls:
GET https://platform.rescale.com/api/v3/jobs/{job_id}/clusters/?is_started=false
POST https://platform.rescale.com/api/v3/clusters/{cluster_id}/tasks/
GET https://platform.rescale.com/api/v3/clusters/{cluster_id}/tasks/{task_id}
GET https://platform.rescale.com/api/v3/clusters/{cluster_id}/tasks/{task_id}/results
To download the file:
5. GET https://platform.rescale.com/api/v3/files/{file_id}/contents/
Snapshots only apply to runs that are currently in-progress. A snapshot is an archive of all files that currently exist in the working directory. After the archive is created, it is uploaded to Rescale Cloud Storage and is made available as a run output file.
curl -X GET -H 'Authorization: Token \<token\>'
https://platform.rescale.com/api/v3/jobs/YYYYY/clusters/?is_started=false
curl -H 'Authorization: Token <api-token>' -H 'Content-Type: application/json' 'https://platform.rescale.com/api/v3/clusters/XXXXX/tasks/' -X POST -d '
{
"type": "Snapshot",
"run":{
"job": XXXXX,
"id": "1"
}
}
curl -X GET -H 'Authorization: Token \<token\>'
https://platform.rescale.com/api/v3/clusters/YYYYY/tasks/ZZZZZ
curl -X GET -H 'Authorization: Token \<token\>'
https://platform.rescale.com/api/v3/clusters/YYYYYY/tasks/ZZZZZ/results
curl -X GET -H 'Authorization: Token \<token\>'
https://platform.rescale.com/api/v3/files/FFFFF/contents/
import time
import requests
headers = {
'Content-Type': 'application/json',
'Authorization': 'Token YOUR_API_TOKEN'
}
job_id = 'XXXXX'
response = requests.get(
f'https://platform.rescale.com/api/v3/jobs/{job_id}/clusters/?is_started=false',
headers=headers
)
# Note: A Job may have multiple active clusters associated with it
cluster_ids = [d['id'] for d in response.json()['results']]
# Need JobId and Run number for snapshotting
for_snapshot = {
"type": "Snapshot",
"run":{
"job": f"{job_id}",
"id": "1"
}
}
# For each Cluster associated w/ Job, trigger a snapshotting task and wait for the result
results = []
for cluster_id in cluster_ids:
response = requests.post(
f'https://platform.rescale.com/api/v3/clusters/{cluster_id}/tasks/',
headers=headers, json=for_snapshot
)
is_complete = response.json()['isComplete']
task_url = response.json()['urls']['details']
# Don't poll this until isComplete == True
results_url = response.json()['urls']['results']
# Wait for completion
while is_complete is False:
response_data = requests.get(task_url, headers=headers).json()
is_complete = response_data['isComplete']
time.sleep(2)
result = requests.get(results_url, headers=headers)
results.append(result)
Sample Response for #1
{
'count': 1,
'next': None,
'previous': None,
'results': [{
'id': 'HZkKc',
'name': 'job_to_snapshot'
}]
}
Response Properties
Property | Type | Description |
---|---|---|
results.id | Integer | Cluster Id. |
results.name | Integer | Name of Job. |
Sample Response for #2, #3
{
'id': 'kodRk',
'isComplete': False,
'run': {'id': '1', 'job': 'hNxZk'},
'type': 'Snapshot',
'urls': {
'details': 'https://platform.rescale.com/api/v2/clusters/HZkKc/tasks/kodRk/',
'results': 'https://platform.rescale.com/api/v2/clusters/HZkKc/tasks/kodRk/results/',
'statuses': 'https://platform.rescale.com/api/clusters/HZkKc/tasks/kodRk/statuses/',
'stop': 'https://platform.rescale.com/api/clusters/HZkKc/tasks/kodRk/stop-request/'
}
}
Response Properties
Property | Type | Description |
---|---|---|
id | String | Cluster snapshot task Id. |
isComplete | Boolean | True/False whether snapshot task has completed. |
type | String | Type of Cluster task. |
urls | Object | Various URLs for different aspects of the task state/actions |
Sample Response for 4.
{
'file': {
'dateUploaded': '2021-04-23T23:55:49.294210Z',
'decryptedSize': 979,
'downloadUrl': 'https://platform.rescale.com/api/v2/files/OTVia/contents/',
'encodedEncryptionKey': '12345EnCoDedKey678956rtzx',
'fileChecksums': [{
'fileHash': 'REEEEEEEALLLYLONGALPHANUMERICFILEHASH',
'hashFunction': 'sha512'
}],
'id': 'OTVia',
'isDeleted': False,
'isUploaded': True,
'name': 'rescale-snapshot-2021-04-23T23:55:48.316132Z.zip',
'owner': 'person@rescale.com',
'path': 'user/user_pCTMk/output/job_hNxZk/run1/rescale-snapshot-2021-04-23T23:55:48.316132Z.zip',
'pathParts': {
'container': 'platform',
'path': 'user/user_pCTMk/output/job_hNxZk/run1/rescale-snapshot-2021-04-23T23:55:48.316132Z.zip'
},
'relativePath': 'rescale-snapshot-2021-04-23T23:55:48.316132Z.zip',
'sharedWith': [],
'storage': {
'connectionSettings': {'region': 'us-east-1'},
'encryptionType': 'default',
'id': 'pCTMk',
'storageType': 'S3Storage'
},
'typeId': 5,
'viewInBrowser': False
},
'type': 'Snapshot'
}
Response Properties
Property | Type | Description |
---|---|---|
file | Object | File object containing metadata w.r.t snapshot. |
type | String | Rescale File type. |
List Output Files
GET https://platform.rescale.com/api/v2/jobs/{job_id}/runs/{run_id}/files/
curl -X GET -H 'Authorization: Token \<token\>'
https://platform.rescale.com/api/v2/jobs/XXXXX/runs/1/files/
import requests
requests.get(
'https://platform.rescale.com/api/v2/jobs/XXXXX/runs/1/files/',
headers={'Authorization': 'Token <api-token>'}
)
Sample Response
{
"count": 63,
"previous": null,
"results": [
{
"typeId": 5,
"name": "nut",
"dateUploaded": "2014-11-12T22:56:50.641761Z",
"relativePath": "airFoil2D/0/nut",
"encodedEncryptionKey": "5BBRrtu98/BwNNTkPnJtgaHS2VZ0IzUwgQ+fFqc5rhk=",
"sharedWith": [],
"decryptedSize": 1278,
"owner": "demouser@rescale.com",
"path": "user/user_OvdRk/output/job_XXXXX/run1/airFoil2D/0/nut",
"isUploaded": true,
"viewInBrowser": true,
"id": "dmpTse",
"md5": "c2e31d85a3af9272841a8b00f3c07498"
},
{
"typeId": 5,
"name": "nuTilda",
"dateUploaded": "2014-11-12T22:56:50.550979Z",
"relativePath": "airFoil2D/0/nuTilda",
"encodedEncryptionKey": "dQ3xMn6zAZkUx84ClH3ATmKumeaNJfWGna2k/89/V/s=",
"sharedWith": [],
"decryptedSize": 1268,
"owner": "demouser@rescale.com",
"path": "user/user_OvdRk/output/job_XXXXX/run1/airFoil2D/0/nuTilda",
"isUploaded": true,
"viewInBrowser": true,
"id": "fDhFDe",
"md5": "24af84107af3a306e117b866b27b9c55"
},
{
"typeId": 5,
"name": "p",
"dateUploaded": "2014-11-12T22:56:50.714078Z",
"relativePath": "airFoil2D/0/p",
"encodedEncryptionKey": "ZHE2IT4ADwAJjfJYnYL4oBwp7YJ9cQr02nS3djnCHGA=",
"sharedWith": [],
"decryptedSize": 1166,
"owner": "demouser@rescale.com",
"path": "user/user_OvdRk/output/job_XXXXX/run1/airFoil2D/0/p",
"isUploaded": true,
"viewInBrowser": true,
"id": "sOhFDe",
"md5": "dfff0408d9e75c8f81dadeec9b248a46"
},
{
"typeId": 5,
"name": "U",
"dateUploaded": "2014-11-12T22:56:50.465184Z",
"relativePath": "airFoil2D/0/U",
"encodedEncryptionKey": "NxEzQf+pChx9716FY4cdSb+UIw9ow64BimupkxaExYA=",
"sharedWith": [],
"decryptedSize": 1298,
"owner": "demouser@rescale.com",
"path": "user/user_OvdRk/output/job_XXXXX/run1/airFoil2D/0/U",
"isUploaded": true,
"viewInBrowser": true,
"id": "RapTse",
"md5": "66aa52fa89123a8f6c3751d935b919d5"
},
{
"typeId": 5,
"name": "nut",
"dateUploaded": "2014-11-12T22:56:50.931594Z",
"relativePath": "airFoil2D/100/nut",
"encodedEncryptionKey": "M+X0Sxys9icqpXmdUreDnqg2TmLVL7B7vs68JiJDEU4=",
"sharedWith": [],
"decryptedSize": 100195,
"owner": "demouser@rescale.com",
"path": "user/user_OvdRk/output/job_XXXXX/run1/airFoil2D/100/nut",
"isUploaded": true,
"viewInBrowser": true,
"id": "fmpTse",
"md5": "84597f0bc96aaefd338109e6ddbe3493"
},
{
"typeId": 5,
"name": "nuTilda",
"dateUploaded": "2014-11-12T22:56:50.862457Z",
"relativePath": "airFoil2D/100/nuTilda",
"encodedEncryptionKey": "yg6l0x1NkYkXOPT3TRoxTnXVC3x9C/SaB+tLSX+6M+U=",
"sharedWith": [],
"decryptedSize": 99221,
"owner": "demouser@rescale.com",
"path": "user/user_OvdRk/output/job_XXXXX/run1/airFoil2D/100/nuTilda",
"isUploaded": true,
"viewInBrowser": true,
"id": "hDhFDe",
"md5": "489cb134eb1c14f6f5df760d9a421825"
},
{
"typeId": 5,
"name": "p",
"dateUploaded": "2014-11-12T22:56:51.005975Z",
"relativePath": "airFoil2D/100/p",
"encodedEncryptionKey": "cwQWYQLRl7+IIU462hGELzwz9iVxpf/CfgYUEQVndB4=",
"sharedWith": [],
"decryptedSize": 86615,
"owner": "demouser@rescale.com",
"path": "user/user_OvdRk/output/job_XXXXX/run1/airFoil2D/100/p",
"isUploaded": true,
"viewInBrowser": true,
"id": "uOhFDe",
"md5": "fb5df9fdf2fd6de74a0f38998831b252"
},
{
"typeId": 5,
"name": "phi",
"dateUploaded": "2014-11-12T22:56:51.079312Z",
"relativePath": "airFoil2D/100/phi",
"encodedEncryptionKey": "5fWxJl5KR7G3oVUYJjjYMzbSveYLAYF6AW8xFDahZtk=",
"sharedWith": [],
"decryptedSize": 190707,
"owner": "demouser@rescale.com",
"path": "user/user_OvdRk/output/job_XXXXX/run1/airFoil2D/100/phi",
"isUploaded": true,
"viewInBrowser": true,
"id": "wMyXse",
"md5": "2fb30c6d0e3ea1125a361ce069c46a80"
},
{
"typeId": 5,
"name": "U",
"dateUploaded": "2014-11-12T22:56:50.787838Z",
"relativePath": "airFoil2D/100/U",
"encodedEncryptionKey": "gHfNzchETji3v69TfeeyhBe0+owGJhNcX7PAzgmJha8=",
"sharedWith": [],
"decryptedSize": 298228,
"owner": "demouser@rescale.com",
"path": "user/user_OvdRk/output/job_XXXXX/run1/airFoil2D/100/U",
"isUploaded": true,
"viewInBrowser": true,
"id": "TapTse",
"md5": "0cc541d092ceda7e299ecb736c7905ee"
},
{
"typeId": 5,
"name": "time",
"dateUploaded": "2014-11-12T22:56:51.222466Z",
"relativePath": "airFoil2D/100/uniform/time",
"encodedEncryptionKey": "F3HkdyuOCnxO6NwIJbv6Zg+xzKTFZKxrc6NvuneB2QE=",
"sharedWith": [],
"decryptedSize": 968,
"owner": "demouser@rescale.com",
"path": "user/user_OvdRk/output/job_XXXXX/run1/airFoil2D/100/uniform/time",
"isUploaded": true,
"viewInBrowser": true,
"id": "LosKDe",
"md5": "62ac76eb8aae234370613d7350ac8685"
}
],
"next": "https://platform.rescale.com/api/v2/jobs/XXXXX/runs/1/files/?page=2"
}
This call allows you to fetch the metadata regarding all the files associated with run-id. You can then use the file-id to download each individual file.
Another, endpoint that is helpful in fetching files is, /api/jobs/< job-id >/files/ which will return all the files related to a particular job, including the output of all the runs.
Note: Output files are available only after a run has completed. If you want to retrieve a list of files for a run that is currently in progress, you should use the /api/jobs/< job-id >/runs/< run-id >/directory-contents/ endpoint.
List Directory Contents
GET https://platform.rescale.com/api/v2/jobs/{job_id}/runs/{run_id}/directory-contents/
curl -X GET -H 'Authorization: Token \<token\>'
https://platform.rescale.com/api/v2/jobs/XXXXX/runs/1/directory-contents/
import requests
requests.get(
'https://platform.rescale.com/api/v2/jobs/XXXXX/runs/1/directory-contents/',
headers={'Authorization': 'Token <api-token>'}
)
Sample Response
[
{
"path": "airFoil2D/0/U",
"resource": "/api/jobs/XXXXX/runs/1/tail/airFoil2D/0/U"
},
{
"path": "airFoil2D/0/nuTilda",
"resource": "/api/jobs/XXXXX/runs/1/tail/airFoil2D/0/nuTilda"
},
{
"path": "airFoil2D/0/nut",
"resource": "/api/jobs/XXXXX/runs/1/tail/airFoil2D/0/nut"
}
]
Response Properties
Property | Type | Description |
---|---|---|
path | String | The relative path to a file in the run’s working directory |
resource | String | The API url that can be used to retrieve the file’s contents |
This call returns a list of files from the specified run’s working directory.
Note: This endpoint only applies to runs that are currently in-progress. After a run completes, all files in the working directory are uploaded to Rescale Cloud Storage and are made available as output files. Use the /api/jobs/< job-id >/runs/< run-id >/files/ endpoint to retrieve them.
Tail File Content
GET https://platform.rescale.com/api/v2/jobs/{job_id}/runs/{run_id}/tail/{path}/
Field | Default | Required | Description |
---|---|---|---|
lines | None | No | The number of lines to retrieve from the specified file. If omitted, the raw binary contents of the file will be returned in the response. |
curl -v -X GET -H 'Authorization: Token \<token\>'
https://platform.rescale.com/api/v2/jobs/XXXXX/runs/1/tail/airFoil2D/0/U?lines=100
import requests
requests.get(
'https://platform.rescale.com/api/v2/jobs/XXXXX/runs/1/tail/airFoil2D/0/U',
headers={'Authorization': 'Token <api-token>'},
params={'lines': 100}
)
Sample Response
{
"fileType": "/home/job_fNjea/work/airFoil2D/0/U: ASCII English text",
"lines": [
"/*--------------------------------*- C++ -*----------------------------------*\\",
"| ========= | |",
"| \\\\ / F ield | OpenFOAM: The Open Source CFD Toolbox |",
"| \\\\ / O peration | Version: 2.0.1 |",
"| \\\\ / A nd | Web: www.OpenFOAM.com |",
"| \\\\/ M anipulation | |",
"\\*---------------------------------------------------------------------------*/",
"FoamFile",
"{",
" version 2.0;",
" format ascii;",
" class volVectorField;",
" object U;",
"}",
"// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //",
"",
"dimensions [0 1 -1 0 0 0 0];",
"",
"internalField uniform (25.75 3.62 0);",
"",
"boundaryField",
"{",
" inlet",
" {",
" type freestream;",
" freestreamValue uniform (25.75 3.62 0);",
" }",
"",
" outlet",
" {",
" type freestream;",
" freestreamValue uniform (25.75 3.62 0);",
" }",
"",
" wall",
" {",
" type fixedValue;",
" value uniform (0 0 0);",
" }",
"",
" frontAndBack",
" {",
" type empty;",
" }",
"}",
"",
"// ************************************************************************* //"
]
}
Response Properties
Property | Type | Description |
---|---|---|
fileType | String | The file type as determined by the *NIX file command. |
lines | Array<String> | An array containing the last N lines of the requested file where N is the value of the lines querystring argument. |
This method can be used to retrieve the last N lines within a file or to stream back the entire file to the caller.
The path argument of the url corresponds to the path property returned in the List Output Files endpoint.
Note: This endpoint only applies to runs that are currently in-progress. After a run has completed, the /api/files/< file-id >/contents/ endpoint can be used to download the output file.
Files
All file related operations are listed here.
NOTE: While you can upload and download files direcly using the endpoints described below, we highly recommend the use of Rescale CLI instead as it provides a more efficient and reliable way to transfer data from and to Rescale’s Platform.
List all Files
GET https://platform.rescale.com/api/v2/files/
curl -X GET -H 'Authorization: Token \<token\>'
https://platform.rescale.com/api/v2/files/
import requests
requests.get(
'https://platform.rescale.com/api/v2/files/',
headers={'Authorization': 'Token <api-token>'}
)
Sample Response
{
"count": 365,
"previous": null,
"results": [
{
"typeId": 1,
"name": "Crash_input.pc.gz",
"dateUploaded": "2015-03-12T17:56:20.925043-07:00",
"relativePath": "Crash_input.pc.gz",
"encodedEncryptionKey": "LkkPk2L2mwuc4OibUs3kJe2RIQrzXbfdWXp9xJhoX0s=",
"downloadUrl": "https://platform.rescale.com/api/v2/files/WvNKdb/contents/",
"sharedWith": [],
"decryptedSize": 56425931,
"owner": "demouser@rescale.com",
"path": "user/user_OvdRk/Crash_input.pc.gz-0a87694a180172023d8a37f0c8aac965",
"isUploaded": true,
"viewInBrowser": false,
"id": "WvNKdb",
"isDeleted": false,
"md5": "a3bc423552cf5457b2fcf4fad87e451d"
},
{
"typeId": 5,
"name": "fsi.in",
"dateUploaded": "2015-01-27T11:06:57.418023-08:00",
"relativePath": "fsi.in",
"encodedEncryptionKey": "MQfYDI0UttkgN+N2K71N0/nodyTZi/GjNY1z/Jnmh88=",
"downloadUrl": "https://platform.rescale.com/api/v2/files/oHyEm/contents/",
"sharedWith": [
"shareduser@rescale.com"
],
"decryptedSize": 2744,
"owner": "demouser@rescale.com",
"path": "user/user_OvdRk/output/job_RJFSc/run1/fsi.in",
"isUploaded": true,
"viewInBrowser": true,
"id": "oHyEm",
"isDeleted": false,
"md5": "2deba2076c80c89e96749e58a26c0d99"
},
{
"typeId": 5,
"name": "post.echo",
"dateUploaded": "2015-01-27T11:06:57.310163-08:00",
"relativePath": "post.echo",
"encodedEncryptionKey": "wmB+YNh2IDdZURd79NJjOiAnAGxl8mzPVlwS8kLPGnc=",
"downloadUrl": "https://platform.rescale.com/api/v2/files/ZeFSa/contents/",
"sharedWith": [
"shareduser@rescale.com"
],
"decryptedSize": 248,
"owner": "demouser@rescale.com",
"path": "user/user_OvdRk/output/job_RJFSc/run1/post.echo",
"isUploaded": true,
"viewInBrowser": true,
"id": "ZeFSa",
"isDeleted": false,
"md5": "6796616b942ff5eaa5b68041871b4a0b"
},
{
"typeId": 5,
"name": "therm.dat",
"dateUploaded": "2015-01-27T11:06:57.205175-08:00",
"relativePath": "therm.dat",
"encodedEncryptionKey": "eQ2twVf8T8J+/lwK7FQNa2Q2PROzlTj2DIyeUPTnuW8=",
"downloadUrl": "https://platform.rescale.com/api/v2/files/XgpAm/contents/",
"sharedWith": [
"shareduser@rescale.com"
],
"decryptedSize": 201624,
"owner": "demouser@rescale.com",
"path": "user/user_OvdRk/output/job_RJFSc/run1/therm.dat",
"isUploaded": true,
"viewInBrowser": true,
"id": "XgpAm",
"isDeleted": false,
"md5": "d133bafb80e2ebd460efd6cf13f0c42b"
},
{
"typeId": 5,
"name": "inputs.in",
"dateUploaded": "2015-01-27T11:06:57.103260-08:00",
"relativePath": "inputs.in",
"encodedEncryptionKey": "4FY1kB/Ejq9r3n+Jz1um7yS+F/rXskAzlnDWFABr1HM=",
"downloadUrl": "https://platform.rescale.com/api/v2/files/JEvOa/contents/",
"sharedWith": [
"shareduser@rescale.com"
],
"decryptedSize": 13959,
"owner": "demouser@rescale.com",
"path": "user/user_OvdRk/output/job_RJFSc/run1/inputs.in",
"isUploaded": true,
"viewInBrowser": true,
"id": "JEvOa",
"isDeleted": false,
"md5": "a5d397df07e6b435d5d1f26eb9ebd4b2"
},
{
"typeId": 5,
"name": "process_output.log",
"dateUploaded": "2015-01-27T11:06:57.006959-08:00",
"relativePath": "process_output.log",
"encodedEncryptionKey": "haLrcqy/ePGyy7mJjr1J2ApBRQlEaH1UKvB49tNaflE=",
"downloadUrl": "https://platform.rescale.com/api/v2/files/LWoAm/contents/",
"sharedWith": [
"shareduser@rescale.com"
],
"decryptedSize": 1262,
"owner": "demouser@rescale.com",
"path": "user/user_OvdRk/output/job_RJFSc/run1/process_output.log",
"isUploaded": true,
"viewInBrowser": true,
"id": "LWoAm",
"isDeleted": false,
"md5": "7f2b5ba96aa67cb067193b2e44cbd91d"
},
{
"typeId": 5,
"name": "post.in",
"dateUploaded": "2015-01-27T11:06:56.901907-08:00",
"relativePath": "post.in",
"encodedEncryptionKey": "TRHGVF0LrDgJ+x6x/hzwYKG34ITfGWTvlhs2a/n1FP0=",
"downloadUrl": "https://platform.rescale.com/api/v2/files/wuvOa/contents/",
"sharedWith": [
"shareduser@rescale.com"
],
"decryptedSize": 593,
"owner": "demouser@rescale.com",
"path": "user/user_OvdRk/output/job_RJFSc/run1/post.in",
"isUploaded": true,
"viewInBrowser": true,
"id": "wuvOa",
"isDeleted": false,
"md5": "4fdf0c787bd84d4b4b6bf7bf35df1690"
},
{
"typeId": 5,
"name": "restart0001.rst",
"dateUploaded": "2015-01-27T11:06:56.801151-08:00",
"relativePath": "restart0001.rst",
"encodedEncryptionKey": "iHom7vaSMIVItK0RX1s+gLb6z+vxMn3MwKMLSjvkeCY=",
"downloadUrl": "https://platform.rescale.com/api/v2/files/VgpAm/contents/",
"sharedWith": [
"shareduser@rescale.com"
],
"decryptedSize": 625449464,
"owner": "demouser@rescale.com",
"path": "user/user_OvdRk/output/job_RJFSc/run1/restart0001.rst",
"isUploaded": true,
"viewInBrowser": false,
"id": "VgpAm",
"isDeleted": false,
"md5": "61a8a7e517ee579d329f7ce56b865e97"
},
{
"typeId": 5,
"name": "dynamic.out",
"dateUploaded": "2015-01-27T11:06:56.703897-08:00",
"relativePath": "dynamic.out",
"encodedEncryptionKey": "213UMp+Rp2+d6wPzDCxge4X9pV9sIAYft+6WgdAq29M=",
"downloadUrl": "https://platform.rescale.com/api/v2/files/GEvOa/contents/",
"sharedWith": [
"shareduser@rescale.com"
],
"decryptedSize": 14226,
"owner": "demouser@rescale.com",
"path": "user/user_OvdRk/output/job_RJFSc/run1/dynamic.out",
"isUploaded": true,
"viewInBrowser": true,
"id": "GEvOa",
"isDeleted": false,
"md5": "82116340362aba67bb0c3b58d4ced65f"
},
{
"typeId": 5,
"name": "equiv_ratio_bin.out",
"dateUploaded": "2015-01-27T11:06:56.602278-08:00",
"relativePath": "equiv_ratio_bin.out",
"encodedEncryptionKey": "hJ2qEY9k5PiVXyAlxHZt4/Qwv3xXWygKefer9Kn23wE=",
"downloadUrl": "https://platform.rescale.com/api/v2/files/JWoAm/contents/",
"sharedWith": [
"shareduser@rescale.com"
],
"decryptedSize": 37210,
"owner": "demouser@rescale.com",
"path": "user/user_OvdRk/output/job_RJFSc/run1/equiv_ratio_bin.out",
"isUploaded": true,
"viewInBrowser": true,
"id": "JWoAm",
"isDeleted": false,
"md5": "1a2a0b8b3879726b9035cdd1b9308fd9"
}
],
"next": "https://platform.rescale.com/api/v2/files/?page=2"
}
This call allows you to retrieve the first page of files owned by the current user.
Query String Arguments
Argument | Type | Required | Description |
---|---|---|---|
search | String | No | The (partial) file name to search for. |
owner | Integer | No | Specify owner=1 to exclude files that have been shared with the current user. |
Response Properties
Property | Type | Description |
---|---|---|
count | Integer | The total number of files owned by the current user. |
next | String | The URL that will return the next page of results. |
previous | String | The URL that will return the previous page of results |
results | Array<Object> | An array of File objects |
Upload a File
PUT/POST https://platform.rescale.com/api/v2/files/contents/
NOTE: While you can upload files direcly using this endpoint, we highly recommend the use of Rescale CLI instead as it provides a more efficient and reliable way to upload files.
curl -X POST -H 'Content-Type:multipart/form-data'
-H 'Authorization: Token \<token\>'
-F 'file=@file_to_upload.txt'
https://platform.rescale.com/api/v2/files/contents/
import requests
# Simple input file upload
requests.post(
'https://platform.rescale.com/api/v2/files/contents/',
headers={'Content-Type': 'multipart/form-data',
'Authorization': 'Token \<token\>'},
files={'file': open('file_to_upload.txt', 'rb')}
)
# Upload with new file name and different file type
type_id = 1 # file type
new_name = 'new_file.txt' # new file name
requests.post(
'https://platform.rescale.com/api/v2/files/contents/',
headers={'Content-Type': 'application/json',
'Authorization': 'Token \<token\>'},
files={'file': (new_name, open('file_to_upload.txt', 'rb'), {'type_id': type_id})}
)
Sample Response
{
"typeId": 1,
"name": "testInput.txt",
"dateUploaded": "2015-03-16T19:43:21.679246Z",
"relativePath": "testInput.txt",
"encodedEncryptionKey": "j/nYgAlnGIywZHyDwwzv+FxYVIlmKveMkY7qxAOuRhY=",
"downloadUrl": "https://platform.rescale.com/api/v2/files/iCdseg/contents/",
"sharedWith":[],
"decryptedSize":22,
"owner": "demouser@rescale.com",
"path": "user/user_OvdRk/testInput-e034314d-2c8e-432a-9c28-079bfbd8bcdd.txt",
"isUploaded":true,
"viewInBrowser":true,
"id": "iCdseg",
"isDeleted":false,
"md5": "cf78c029dc496e9c789db1463a4a84de"
}
This call allows you to upload a file from local file system to Rescale. It is recommended to not use this API for uploading very large files exceeding a few MB especially if your connection bandwidth is very low. Instead prefer to use the Rescale CLI that provides better performance and upload speeds.
Response Properties
Same as Get Metadata of a File
Delete a File
DELETE https://platform.rescale.com/api/v2/files/{file_id}/
curl -X DELETE -H 'Authorization: Token \<token\>'
https://platform.rescale.com/api/v2/files/{file_id}/
import requests
requests.delete(
'https://platform.rescale.com/api/v2/files/{file_id}/',
headers={'Authorization': 'Token \<token\>'}
)
This call allows you to delete a file from Rescale.
Response
The response body has no content if the delete is successful.
Download a File
GET https://platform.rescale.com/api/v2/files/{file_id}/contents/
NOTE: While you can download files direcly using this endpoint, we highly recommend the use of Rescale CLI instead as it provides a more efficient and reliable way to download files.
curl -X GET -H 'Authorization: Token \<token\>'
-o 'download_file.txt' https://platform.rescale.com/api/v2/files/{file_id}/contents/
import requests
response = requests.get(
'https://platform.rescale.com/api/v2/files/{file_id}/',
headers={'Authorization': 'Token \<token\>'}
)
with open('file_to_download', 'wb') as fd:
for chunk in response.iter_content(chunk_size):
fd.write(chunk)
Download a file from Rescale.
Standard HTTP (i.e. RFC7233-compliant) Range requests are supported. A subtlety to note here is that the standard does not stipulate that all GET requests will accept a Range request, but instead just that a HEAD request would indicate whether a GET would accept a Range request. Rescale allows itself the flexibility to choose (potentially dynamically) which specific files it would allow a Range request for and which not.
Response
The response body contains the file contents.
Get Plaintext Content of a File
GET https://platform.rescale.com/api/v2/files/{file_id}/lines/
curl -X GET -H 'Authorization: Token \<token\>'
https://platform.rescale.com/api/v2/files/{file_id}/lines/
import requests
requests.get(
'https://platform.rescale.com/api/v2/files/{file_id}/lines',
headers={'Authorization': 'Token <api-token>'}
)
Sample Response
{
"lines": [
"This is line 1.\n",
"This is line 2.\n",
"This is line 3.\n",
"This is line 4.\n",
"This is line 5.\n"]
}
Response Properties
Property | Type | Description |
---|---|---|
lines | List<String> | A list of strings of the file. |
This call allows you to retrieve the file contents in lines for a plain text file.
Get Metadata of a File
GET https://platform.rescale.com/api/v2/files/{file_id}/
curl -X GET -H 'Authorization: Token \<token\>'
https://platform.rescale.com/api/v2/files/{file_id}/
import requests
requests.get(
'https://platform.rescale.com/api/v2/files/{file_id}/',
headers={'Authorization': 'Token <api-token>'}
)
Sample Response
{
"typeId": 1,
"name": "Crash_input.pc.gz",
"dateUploaded": "2015-03-12T17:56:20.925043-07:00",
"relativePath": "Crash_input.pc.gz",
"encodedEncryptionKey": "LkkPk2L2mwuc4OibUs3kJe2RIQrzXbfdWXp9xJhoX0s=",
"downloadUrl": "https://platform.rescale.com/api/v2/files/WvNKdb/contents/",
"sharedWith": [],
"decryptedSize": 56425931,
"owner": "demouser@rescale.com",
"path": "user/user_OvdRk/Crash_input.pc.gz-0a87694a180172023d8a37f0c8aac965",
"isUploaded": true,
"viewInBrowser": false,
"id": "WvNKdb",
"isDeleted": false,
"md5": "a3bc423552cf5457b2fcf4fad87e451d",
"userTags": [{ "name": "example tag", "normalizedName": "exampletag" }]
}
Response Properties
Property | Type | Description |
---|---|---|
typeId | Integer | 1 = inpute file, 2 = template file, 3 = parameter file, 4 = script file, 5 = output file, 7 = design variable file, 8 = case file, 9 = optimizer file, 10 = temporary file |
name | String | The name of the file. |
dateUploaded | String | The ISO8601 encoded date of when the file is uploaded. |
relativePath | String | For output files (typeId = 5), the relative path is the path relative to the root output folder(user/{user_id}/output/{job_id}/{run_id}/{relative_path}). |
encodedEncryptionKey | String | The key used to encrypt the files. |
downloadUrl | String | The download URL of the file. |
sharedWith | List<String> | A list of users of the file shared with. |
decryptedSize | Integer | The decrypted file size in byte. |
owner | String | The owner of the file. |
path | String | The absolute path of the file being stored. |
isUploaded | Boolean | If the file is already uploaded. |
viewInBrowser | Boolean | If the file can be viewed in browser. |
id | String | The unique identifier of the file. |
isDelelted | Boolean | If the file is already deleted. |
md5 | String | The md5 hash of the file. |
This call allows you to retrieve details for a single file.
Update Metadata of a File
PATCH https://platform.rescale.com/api/v2/files/{file_id}/
curl -X PATCH -H 'Content-Type: application/json'
-H 'Authorization: Token \<token\>' --data
'{
"typeId": 4,
"name": "new_script.txt",
"dateUploaded": "2015-03-17T00:24:39.531384Z",
"relativePath": "new_script.txt",
"encodedEncryptionKey": "83TFwNf5QxFaCOmluBQBnJ/L0yAC/2Z9MPs2pKZuUi4=",
"downloadUrl": "https://platform.rescale.com/api/v2/files/dNEXtf/contents/",
"sharedWith": [],
"decryptedSize": 112,
"owner": "demouser@rescale.com",
"path": "user/user_OvdRk/testLines-9425c8a5-08a6-4249-939a-2f060a4d0f25.txt",
"isUploaded": true,
"viewInBrowser": true,
"id": "dNEXtf",
"isDeleted": false,
"md5": "4d479b49d26318068d3e23aa9d81e9ee",
"userTags": [{ "name": "example tag", "normalizedName": "exampletag" }]
}'
https://platform.rescale.com/api/v2/files/{file_id}/
import requests
requests.patch(
'https://platform.rescale.com/api/files/{file_id}/',
{
"typeId": 4,
"name": "new_script.txt",
"dateUploaded": "2015-03-17T00:24:39.531384Z",
"relativePath": "new_script.txt",
"encodedEncryptionKey": "83TFwNf5QxFaCOmluBQBnJ/L0yAC/2Z9MPs2pKZuUi4=",
"downloadUrl": "https://platform.rescale.com/api/files/dNEXtf/contents/",
"sharedWith": [],
"decryptedSize": 112,
"owner": "demouser@rescale.com",
"path": "user/user_OvdRk/testLines-9425c8a5-08a6-4249-939a-2f060a4d0f25.txt",
"isUploaded": true,
"viewInBrowser": true,
"id": "dNEXtf",
"isDeleted": false,
"md5": "4d479b49d26318068d3e23aa9d81e9ee"
},
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'}
)
Sample Response
{
"typeId": 4,
"name": "new_script.txt",
"dateUploaded": "2015-03-17T00:24:39.531384Z",
"relativePath": "new_script.txt",
"encodedEncryptionKey": "83TFwNf5QxFaCOmluBQBnJ/L0yAC/2Z9MPs2pKZuUi4=",
"downloadUrl": "https://platform.rescale.com/api/files/dNEXtf/contents/",
"sharedWith": [],
"decryptedSize": 112,
"owner": "demouser@rescale.com",
"path": "user/user_OvdRk/testLines-9425c8a5-08a6-4249-939a-2f060a4d0f25.txt",
"isUploaded": true,
"viewInBrowser": true,
"id": "dNEXtf",
"isDeleted": false,
"md5": "4d479b49d26318068d3e23aa9d81e9ee"
}
Response Properties
Same as Get Metadata of a File
This call allows you to update meta data of an existing file.
Add a Tag to a File
POST https://platform.rescale.com/api/v2/files/{file_id}/tags/
Add a new or existing tag to a file.
curl -H "Authorization: Token <api-token>" -H "Content-Type: application/json" "https://platform.rescale.com/api/v2/files/{file_id}/tags/" -X POST -d '
{
"name": "new - tag _ 1"
}
'
import requests
requests.post(
'https://platform.rescale.com/api/v2/files/{file_id}/tags/',
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'},
json={
"name": "new - tag _ 1"
}
)
Sample Response
{
"name":"new - tag _ 1",
"normalizedName": "newtag1"
}
Get a list of Tags on a File
GET https://platform.rescale.com/api/v2/files/{file_id}/tags/
curl -H "Authorization: Token <api-token>" -H "Content-Type: application/json" "https://platform.rescale.com/api/v2/files/{file_id}/tags/" -X GET
import requests
requests.get(
'https://platform.rescale.com/api/v2/files/{file_id}/tags/',
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'}
)
Sample Response
[
{
"name":"new - tag _ 1",
"normalizedName": "newtag1"
},
{
"name":"new - tag _ 2",
"normalizedName": "newtag2"
}
]
Response Properties
Property | Type | Description |
---|---|---|
name | String | The displayed name of the tag |
normalizedName | String | The name of the tag with spaces, dashes, and underscores removed |
Remove a Tag from a File
DELETE https://platform.rescale.com/api/v2/files/{job_id}/tags/
curl -H "Authorization: Token <api-token>" -H "Content-Type: application/json" "https://platform.rescale.com/api/v2/files/{file_id}/tags/" -X DELETE -d '
{
"name": "new - tag _ 1"
}
'
import requests
requests.delete(
'https://platform.rescale.com/api/v2/files/{file_id}/tags/',
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'},
json={
"name": "new - tag _ 1"
}
)
Tasks
Poll a Running Task
GET https://platform.rescale.com/api/v2/tasks/{token}/
Storage Devices
List All Storage Devices
GET https://platform.rescale.com/api/v2/storage-devices/
curl -H "Authorization: Token <api-token>" https://platform.rescale.com/api/v2/storage-devices/
import requests
requests.get(
'https://platform.rescale.com/api/v2/storage-devices/',
headers={'Authorization': 'Token <api-token>'}
)
Sample Response
{
"count": 3,
"previous": null,
"results": [
{
"dateInserted": "2018-12-10T13:16:30.764554-08:00",
"name": "Sample Storage One",
"autoextend": true,
"region": {
"id": "pCTMk",
"name": "us-east-1"
},
"hardware": {
"coresPerSlot": 18,
"coreType": {
"code": "hpc-3",
"features": [
"low_priority",
"cluster_status"
],
"color": "#ff4242",
"requiresTempSshAuth": false,
"io": "10 Gb/s",
"isPrimary": true,
"processorInfo": "Intel Xeon E5-2666 v3 (Haswell)",
"displayOrder": 1,
"hasSsd": true,
"storage": 36,
"lowPriorityPrice": "0.1200",
"memory": 3750,
"isDefault": true,
"defaultWalltime": null,
"description": "HPC++",
"acronym": "O",
"price": "0.1700",
"gpuCounts": [
0,
0,
0,
0,
0
],
"mustBeRequested": false,
"isLowPriorityBeta": false,
"compute": "7.33",
"name": "Onyx",
"baseClockSpeed": "2.9",
"walltimeRequired": false,
"remoteVizAllowed": true,
"cores": [
1,
2,
4,
8,
18
],
"storageIo": "2 GB/s read, 1GB/s write"
},
"coreSummary": {
"storagePerNode": 648,
"gpusPerNode": 0,
"numberOfNodes": 1,
"memoryPerNode": 60000
},
"slots": 1,
"type": "mountable_storage",
"walltime": 5
},
"owner": "support@rescale.com",
"secondAlert": 90,
"urls": {
"start": "https://platform.rescale.com/api/v2/storage-devices/BNTMk/submit/",
"fileDownload": "https://platform.rescale.com/api/v2/storage-devices/BNTMk/file-downloads/",
"statuses": "https://platform.rescale.com/api/v2/storage-devices/BNTMk/statuses/"
},
"storageSize": 120,
"absoluteMountPoint": "~/storage_BNTMk",
"availableSpace": 0,
"id": "BNTMk",
"firstAlert": 60,
"sshConnection": "uprod.xnXAo@35.153.144.221"
},
{
"dateInserted": "2018-12-10T18:38:06.096877-08:00",
"name": "Sample Storage Two",
"autoextend": false,
"region": {
"id": "pCTMk",
"name": "us-east-1"
},
"hardware": {
"coresPerSlot": 18,
"coreType": {
"code": "hpc-3",
"features": [
"low_priority",
"cluster_status"
],
"color": "#ff4242",
"requiresTempSshAuth": false,
"io": "10 Gb/s",
"isPrimary": true,
"processorInfo": "Intel Xeon E5-2666 v3 (Haswell)",
"displayOrder": 1,
"hasSsd": true,
"storage": 36,
"lowPriorityPrice": "0.1200",
"memory": 3750,
"isDefault": true,
"defaultWalltime": null,
"description": "HPC++",
"acronym": "O",
"price": "0.1700",
"gpuCounts": [
0,
0,
0,
0,
0
],
"mustBeRequested": false,
"isLowPriorityBeta": false,
"compute": "7.33",
"name": "Onyx",
"baseClockSpeed": "2.9",
"walltimeRequired": false,
"remoteVizAllowed": true,
"cores": [
1,
2,
4,
8,
18
],
"storageIo": "2 GB/s read, 1GB/s write"
},
"coreSummary": {
"storagePerNode": 648,
"gpusPerNode": 0,
"numberOfNodes": 1,
"memoryPerNode": 60000
},
"slots": 1,
"type": "mountable_storage",
"walltime": 20
},
"owner": "support@rescale.com",
"secondAlert": 90,
"urls": {
"start": "https://platform.rescale.com/api/v2/storage-devices/caaaa/submit/",
"fileDownload": "https://platform.rescale.com/api/v2/storage-devices/caaaa/file-downloads/",
"statuses": "https://platform.rescale.com/api/v2/storage-devices/caaaa/statuses/"
},
"storageSize": 200,
"absoluteMountPoint": "~/storage_caaaa",
"availableSpace": 0,
"id": "caaaa",
"firstAlert": 60,
"sshConnection": "uprod.GPfam@34.227.30.123"
},
{
"dateInserted": "2018-12-11T15:12:11.154340-08:00",
"name": "Sample Storage Three",
"autoextend": false,
"region": {
"id": "pCTMk",
"name": "us-east-1"
},
"hardware": {
"coresPerSlot": 18,
"coreType": {
"code": "hpc-3",
"features": [
"low_priority",
"cluster_status"
],
"color": "#ff4242",
"requiresTempSshAuth": false,
"io": "10 Gb/s",
"isPrimary": true,
"processorInfo": "Intel Xeon E5-2666 v3 (Haswell)",
"displayOrder": 1,
"hasSsd": true,
"storage": 36,
"lowPriorityPrice": "0.1200",
"memory": 3750,
"isDefault": true,
"defaultWalltime": null,
"description": "HPC++",
"acronym": "O",
"price": "0.1700",
"gpuCounts": [
0,
0,
0,
0,
0
],
"mustBeRequested": false,
"isLowPriorityBeta": false,
"compute": "7.33",
"name": "Onyx",
"baseClockSpeed": "2.9",
"walltimeRequired": false,
"remoteVizAllowed": true,
"cores": [
1,
2,
4,
8,
18
],
"storageIo": "2 GB/s read, 1GB/s write"
},
"coreSummary": {
"storagePerNode": 648,
"gpusPerNode": 0,
"numberOfNodes": 1,
"memoryPerNode": 60000
},
"slots": 1,
"type": "mountable_storage",
"walltime": 48
},
"owner": "support@rescale.com",
"secondAlert": 90,
"urls": {
"start": "https://platform.rescale.com/api/v2/storage-devices/rCTMk/submit/",
"fileDownload": "https://platform.rescale.com/api/v2/storage-devices/rCTMk/file-downloads/",
"statuses": "https://platform.rescale.com/api/v2/storage-devices/rCTMk/statuses/"
},
"storageSize": 1024,
"absoluteMountPoint": "~/storage_rCTMk",
"availableSpace": 0,
"id": "rCTMk",
"firstAlert": 60,
"sshConnection": null
}
],
"next": null
}
This endpoint retrieves all the storage devices visible to the authenticated user, whether they are owned by, or shared with, that user.
Query String Arguments
Argument | Type | Description |
---|---|---|
active | Boolean | When set to true, this endpoint returns only non-terminated storage devices (Defaults to false) |
Response Properties
Property | Type | Description |
---|---|---|
id | String | A unique identifier for the storage device |
name | String | The name given to the storage device |
owner | String | The email address of the storage device owner |
region | Object | Specifies the region the storage device is launched in |
hardware | Object | Specifies the hardware settings for storage device |
storageSize | Integer | The total disk space allocated to the storage device in GiB |
availableSize | Integer | The available disk space on the storage device in GiB |
absoluteMountPoint | String | The path at which this storage device will be mounted on any cluster it is attached |
sshConnection | String | The string required to connect to this storage device using SSH |
firstAlert | Integer | The percentage of disk full at which to trigger the first email alert |
secondAlert | Integer | The percentage of disk full at which to trigger the second email alert |
autoextend | Boolean | Whether this storage device has the auto-extend feature enabled or not |
autoextendPercent | Integer | The percentage of disk space full at which to trigger the auto-extend feature |
dateInserted | String | The date this storage device was created |
Get a Specific Storage Device
GET https://platform.rescale.com/api/v2/storage-devices/{storage_device_id}/
curl -H "Authorization: Token <api-token>" https://platform.rescale.com/api/v2/storage-devices/rCTMk/
import requests
req = requests.get(
'https://platform.rescale.com/api/v2/storage-devices/rCTMk',
headers={'Authorization': 'Token <api-token>'}
)
{
"dateInserted": "2018-12-11T15:12:11.154340-08:00",
"name": "Sample Storage Three",
"autoextend": false,
"region": {
"id": "pCTMk",
"name": "us-east-1"
},
"hardware": {
"coresPerSlot": 18,
"coreType": {
"code": "hpc-3",
"features": [
"low_priority",
"cluster_status"
],
"color": "#ff4242",
"requiresTempSshAuth": false,
"io": "10 Gb/s",
"isPrimary": true,
"processorInfo": "Intel Xeon E5-2666 v3 (Haswell)",
"displayOrder": 1,
"hasSsd": true,
"storage": 36,
"lowPriorityPrice": "0.1200",
"memory": 3750,
"isDefault": true,
"defaultWalltime": null,
"description": "HPC++",
"acronym": "O",
"price": "0.1700",
"gpuCounts": [
0,
0,
0,
0,
0
],
"mustBeRequested": false,
"isLowPriorityBeta": false,
"compute": "7.33",
"name": "Onyx",
"baseClockSpeed": "2.9",
"walltimeRequired": false,
"remoteVizAllowed": true,
"cores": [
1,
2,
4,
8,
18
],
"storageIo": "2 GB/s read, 1GB/s write"
},
"coreSummary": {
"storagePerNode": 648,
"gpusPerNode": 0,
"numberOfNodes": 1,
"memoryPerNode": 60000
},
"slots": 1,
"type": "mountable_storage",
"walltime": 48
},
"owner": "support@rescale.com",
"secondAlert": 90,
"urls": {
"start": "https://platform.rescale.com/api/v2/storage-devices/rCTMk/submit/",
"fileDownload": "https://platform.rescale.com/api/v2/storage-devices/rCTMk/file-downloads/",
"statuses": "https://platform.rescale.com/api/v2/storage-devices/rCTMk/statuses/"
},
"storageSize": 1024,
"absoluteMountPoint": "~/storage_rCTMk",
"availableSpace": 0,
"id": "rCTMk",
"firstAlert": 60,
"sshConnection": null
}
Retrieve the details of a saved storage device.
List Storage Device Statuses
GET https://platform.rescale.com/api/v2/storage-devices/{storage_device_id}/statuses/
curl -H "Authorization: Token <api-token>" https://platform.rescale.com/api/v2/storage-devices/rCTMk/statuses/
{
"count": 3,
"previous": null,
"results": [
{
"status": "Started",
"statusDate": "2018-12-11T15:15:22.527000-08:00",
"id": "kbbaac",
"statusReason": null
},
{
"status": "Starting",
"statusDate": "2018-12-11T15:12:12.631000-08:00",
"id": "WyhoPb",
"statusReason": null
},
{
"status": "Not Started",
"statusDate": "2018-12-11T15:12:10.610686-08:00",
"id": "FzuDXb",
"statusReason": null
}
],
"next": null
}
This endpoint returns an ordered list of available storage device statuses. The first returned status is always the storage device’s latest (current) status.
List Storage Device Files
GET https://platform.rescale.com/api/v2/storage-devices/{storage_device_id}/files/{path}
curl -H "Authorization: Token <api-token>" https://platform.rescale.com/api/v2/storage-devices/rCTMk/files/
{
"count": 4,
"nextUrl": null,
"results": [
{
"name": "blue",
"path": "blue",
"fileType": "DIRECTORY",
"label": null,
"createdTime": "2018-12-12T21:05:47Z",
"fileSize": 4096,
"owner": "uprod.jWVVk",
"lastModifiedTime": "2018-12-12T21:05:47Z"
},
{
"name": "green.txt",
"path": "green.txt",
"fileType": "REGULAR_FILE",
"label": null,
"createdTime": "2018-12-12T21:05:52Z",
"fileSize": 125375,
"owner": "uprod.jWVVk",
"lastModifiedTime": "2018-12-12T21:05:52Z"
},
{
"name": "shared",
"path": "shared",
"fileType": "DIRECTORY",
"label": null,
"createdTime": "2018-12-11T23:15:09Z",
"fileSize": 4096,
"owner": "uprod.jWVVk",
"lastModifiedTime": "2018-12-11T23:15:09Z"
},
{
"name": "tmp",
"path": "tmp",
"fileType": "DIRECTORY",
"label": null,
"createdTime": "2018-12-11T23:15:20Z",
"fileSize": 4096,
"owner": "root",
"lastModifiedTime": "2018-12-11T23:15:20Z"
}
]
}
curl -H "Authorization: Token <api-token>" https://platform.rescale.com/api/v2/storage-devices/rCTMk/files/blue/
{
"count": 2,
"nextUrl": null,
"results": [
{
"name": "baby-blue.txt",
"path": "blue/baby-blue.txt",
"fileType": "REGULAR_FILE",
"label": null,
"createdTime": "2018-12-12T21:05:47Z",
"fileSize": 3596,
"owner": "uprod.jWVVk",
"lastModifiedTime": "2018-12-12T21:05:47Z"
},
{
"name": "navy.txt",
"path": "blue/navy.txt",
"fileType": "REGULAR_FILE",
"label": null,
"createdTime": "2018-12-12T21:05:52Z",
"fileSize": 1275,
"owner": "uprod.jWVVk",
"lastModifiedTime": "2018-12-12T21:05:52Z"
},
]
}
List files and directories for a given storage device.
This will return a paginated list of all files and directories under the specified {path}
on the storage device. Each file/directory will have the following properties.
Response Properties
Property | Type | Description |
---|---|---|
name | String | Name of file/directory |
path | String | Full path to file/directory relative to the work directory |
fileType | String | Either DIRECTORY or REGULAR_FILE |
fileSize | String | The file size in bytes |
createdTime | String | Date and time the file/directory was created |
lastModifiedTime | String | Date and time the file/directory was last modified |
List Available Regions
GET https://platform.rescale.com/api/v2/storage-devices/available-regions/
curl -H "Authorization: Token <api-token>" https://platform.rescale.com/api/v2/storage-devices/available-regions/
[
{
"id": "pCTMk",
"name": "us-east-1"
}
]
This endpoint returns a list of regions available to create a storage device.
Create a Storage Device
POST https://platform.rescale.com/api/v2/storage-devices/
curl -H "Authorization: Token <api-token>" -H "Content-Type: application/json" "https://platform.rescale.com/api/v2/storage-devices/" -d '
{
"name": "Sample Storage Four",
"storageSize": 1024,
"hardware": {
"walltime": 48,
},
"firstAlert": 60,
"secondAlert": 90,
"autoextend": true,
"autoextendPercent": 80,
"region": {
"id": "pCTMk"
},
}
'
import requests
requests.post(
'https://platform.rescale.com/api/v2/storage-devices/',
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'},
json={
"name": "Sample Storage Four",
"storageSize": 1024,
"hardware": {
"walltime": 48,
},
"firstAlert": 60,
"secondAlert": 90,
"autoextend": true,
"autoextendPercent": 80,
"region": {
"id": "pCTMk"
},
}
)
Sample Response
{
"dateInserted": "2018-12-11T15:12:11.154340-08:00",
"name": "Sample Storage Four",
"autoextend": true,
"autoextendPercent": 80,
"region": {
"id": "pCTMk",
"name": "us-east-1"
},
"hardware": {
"walltime": 48,
},
"owner": "support@rescale.com",
"secondAlert": 90,
"urls": {
"start": "https://platform.rescale.com/api/v2/storage-devices/GnHtk/submit/",
"fileDownload": "https://platform.rescale.com/api/v2/storage-devices/GnHtk/file-downloads/",
"statuses": "https://platform.rescale.com/api/v2/storage-devices/GnHtk/statuses/"
},
"storageSize": 1024,
"absoluteMountPoint": "~/storage_GnHtk",
"availableSpace": 0,
"id": "GnHtk",
"firstAlert": 60,
"sshConnection": null
}
Creates and saves the storage device and its details.
Fields
Field | Default | Required | Description |
---|---|---|---|
name | None | Yes | Human-friendly name for the storage device |
storageSize | None | Yes | The total disk space to allocate to the storage device in GiB |
firstAlert | 60 | No | The percentage of disk full at which to trigger the first email alert |
secondAlert | 90 | No | The percentage of disk full at which to trigger the second email alert |
autoextend | False | No | Whether to enable the disk space auto-extend feature or not |
autoextendPercent | 60 | No | The percentage of disk space full at which to trigger the auto-extend feature |
region | None | No | The provider region in which to launch the storage device (Object with nested id field. See above to retrieve regions available to launch the storage device) |
hardware | None | Yes | The hardware settings of the storage device (Object with nested walltime , coreType , coresPerSlot ) |
Submit a Storage Device
POST https://platform.rescale.com/api/v2/storage-devices/{storage_device_id}/submit/
curl -H "Authorization: Token <api-token>" https://platform.rescale.com/api/v2/storage-devices/GnHtk/submit/ -X POST
Submits and starts a saved storage device.
Update a Storage Device
PATCH https://platform.rescale.com/api/v2/storage-devices/{storage_device_id}/
curl -H "Authorization: Token <api-token>" -H "Content-Type:application/json" "https://platform.rescale.com/api/v2/storage-devices/GnHtk/" -X PATCH -d '
{
"name": "Storagey McStorageFace"
}
'
Updates editable details for a saved storage device.
Terminate a Storage Device
POST https://platform.rescale.com/api/v2/storage-devices/{storage_device_id}/shutdown/
curl -H "Authorization: Token <api-token>" https://platform.rescale.com/api/v2/storage-devices/GnHtk/shutdown/ -X POST
Sends a request to backup files and terminate a started storage device.
A 202 response code is returned upon a successful termination request.
Forcefully Terminate a Storage Device
POST https://platform.rescale.com/api/v3/storage-devices/{storage_device_id}/force-shutdown/
curl -H "Authorization: Token <api-token>" https://platform.rescale.com/api/v3/storage-devices/GnHtk/force-shutdown/ -X POST
Sends a request to forcefully shutdown a started storage device: files will NOT be backed up and any jobs attached to the storage device may not complete successfully. Any data on the storage device will be lost and unrecoverable. Use with caution.
Attach a Storage Device to a Job
POST https://platform.rescale.com/api/v2/jobs/{job_id}/storage-devices/
Mount storage device
curl -H "Authorization: Token <api-token>" -H "Content-Type:application/json" "https://platform.rescale.com/api/v2/jobs/LeeKa/storage-devices/" -X POST -d '
{
"storageDevice": { "id": "GnHtk" }
}
'
import requests
requests.post(
'https://platform.rescale.com/api/v2/jobs/LeeKa/storage-devices/',
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'},
json={
"storageDevice": { "id": "GnHtk" }
}
)
Sample Response
{
"storageDevice": {
"dateInserted": "2018-12-11T15:12:11.154340-08:00",
"name": "Sample Storage Four",
"autoextend": true,
"autoextendPercent": 80,
"region": {
"id": "pCTMk",
"name": "us-east-1"
},
"hardware": {
"coresPerSlot": 18,
"coreType": {
"code": "hpc-3",
"features": [
"low_priority",
"cluster_status"
],
"color": "#ff4242",
"requiresTempSshAuth": false,
"io": "10 Gb/s",
"isPrimary": true,
"processorInfo": "Intel Xeon E5-2666 v3 (Haswell)",
"displayOrder": 1,
"hasSsd": true,
"storage": 36,
"lowPriorityPrice": "0.1200",
"memory": 3750,
"isDefault": true,
"defaultWalltime": null,
"description": "HPC++",
"acronym": "O",
"price": "0.1700",
"gpuCounts": [
0,
0,
0,
0,
0
],
"mustBeRequested": false,
"isLowPriorityBeta": false,
"compute": "7.33",
"name": "Onyx",
"baseClockSpeed": "2.9",
"walltimeRequired": false,
"remoteVizAllowed": true,
"cores": [
1,
2,
4,
8,
18
],
"storageIo": "2 GB/s read, 1GB/s write"
},
"coreSummary": {
"storagePerNode": 648,
"gpusPerNode": 0,
"numberOfNodes": 1,
"memoryPerNode": 60000
},
"slots": 1,
"type": "mountable_storage",
"walltime": 48
},
"owner": "support@rescale.com",
"secondAlert": 90,
"urls": {
"start": "https://platform.rescale.com/api/v2/storage-devices/GnHtk/submit/",
"fileDownload": "https://platform.rescale.com/api/v2/storage-devices/GnHtk/file-downloads/",
"statuses": "https://platform.rescale.com/api/v2/storage-devices/GnHtk/statuses/"
},
"storageSize": 1024,
"absoluteMountPoint": "~/storage_GnHtk",
"availableSpace": 0,
"id": "GnHtk",
"firstAlert": 60,
"sshConnection": null
},
"jobanalyses": []
}
Mount storage device and stage files/directories to job’s work directory
curl -H "Authorization: Token <api-token>" -H "Content-Type:application/json" "https://platform.rescale.com/api/v2/jobs/LeeKa/storage-devices/" -X POST -d '
{
"storageDevice": { "id": "GnHtk" },
"jobanalyses": [
{
"order": 0,
"inputFiles": [
{
"name": "green.zip",
"inputFileType": "COPY",
"sourcePath": "colors/green.zip",
"outputPath": "",
"decompress": true
},
{
"name": "blue",
"inputFileType": "SYMLINK",
"sourcePath": "colors/blue",
"outputPath": ""
}
]
}
],
}
'
import requests
requests.post(
'https://platform.rescale.com/api/v2/jobs/LeeKa/storage-devices/',
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'},
json={
"storageDevice": { "id": "GnHtk" },
"jobanalyses": [
{
"order": 0,
"inputFiles": [
{
"name": "green.zip",
"inputFileType": "COPY",
"sourcePath": "colors/green.zip",
"outputPath": "",
"decompress": true
},
{
"name": "blue",
"inputFileType": "SYMLINK",
"sourcePath": "colors/blue",
"outputPath": "",
}
]
}
],
}
)
Sample Response
{
"storageDevice": {
"dateInserted": "2018-12-11T15:12:11.154340-08:00",
"name": "Sample Storage Four",
"autoextend": true,
"autoextendPercent": 80,
"region": {
"id": "pCTMk",
"name": "us-east-1"
},
"hardware": {
"coresPerSlot": 18,
"coreType": {
"code": "hpc-3",
"features": [
"low_priority",
"cluster_status"
],
"color": "#ff4242",
"requiresTempSshAuth": false,
"io": "10 Gb/s",
"isPrimary": true,
"processorInfo": "Intel Xeon E5-2666 v3 (Haswell)",
"displayOrder": 1,
"hasSsd": true,
"storage": 36,
"lowPriorityPrice": "0.1200",
"memory": 3750,
"isDefault": true,
"defaultWalltime": null,
"description": "HPC++",
"acronym": "O",
"price": "0.1700",
"gpuCounts": [
0,
0,
0,
0,
0
],
"mustBeRequested": false,
"isLowPriorityBeta": false,
"compute": "7.33",
"name": "Onyx",
"baseClockSpeed": "2.9",
"walltimeRequired": false,
"remoteVizAllowed": true,
"cores": [
1,
2,
4,
8,
18
],
"storageIo": "2 GB/s read, 1GB/s write"
},
"coreSummary": {
"storagePerNode": 648,
"gpusPerNode": 0,
"numberOfNodes": 1,
"memoryPerNode": 60000
},
"slots": 1,
"type": "mountable_storage",
"walltime": 48
},
"owner": "support@rescale.com",
"secondAlert": 90,
"urls": {
"start": "https://platform.rescale.com/api/v2/storage-devices/GnHtk/submit/",
"fileDownload": "https://platform.rescale.com/api/v2/storage-devices/GnHtk/file-downloads/",
"statuses": "https://platform.rescale.com/api/v2/storage-devices/GnHtk/statuses/"
},
"storageSize": 1024,
"absoluteMountPoint": "~/storage_GnHtk",
"availableSpace": 0,
"id": "GnHtk",
"firstAlert": 60,
"sshConnection": null
},
"jobanalyses": [
{
"order": 0,
"inputFiles": [
{
"name": "green.zip",
"inputFileType": "COPY",
"sourcePath": "colors/green.zip",
"outputPath": "",
"decompress": true
},
{
"name": "blue",
"inputFileType": "SYMLINK",
"sourcePath": "colors/blue",
"outputPath": "",
"decompress": false
}
]
}
]
}
Attaches a started storage device to a saved job. Optionally, stages files/directories from the storage device to the job’s work directory.
The attached storage device will always be mounted and accessible on the job cluster at the specified absoluteMountPoint
returned in the response.
Fields
Field | Default | Required | Description |
---|---|---|---|
storageDevice | None | Yes | The storage device to be attached (Object with nested id field) |
jobanalyses | None | No | Job analyses corresponding to those on the job (Array<jobanalysis> as outlined below) |
jobanalysis Level Fields
This level specifies the job analyses and the corresponding files/directories to stage from the storage device to the job’s work directory.
Field | Default | Required | Description |
---|---|---|---|
order | None | Yes | Integer zero-based order of the analysis to which to make these inputFiles available |
inputFiles | None | Yes | The files/directories (Array<inputFile> as outlined below) |
inputFile Level Fields
This level specifies the files/directories to be staged from the storage device to the job’s work directory and whether to copy or symlink them.
Field | Default | Required | Description |
---|---|---|---|
name | None | Yes | The file/directory name (Array<inputFile> as outlined below) |
sourcePath | None | Yes | The source path of the file/directory on the storage device |
outputPath | None | Yes | The output path of the file/directory under the job’s work directory |
inputFileType | None | Yes | Whether to COPY or SYMLINK the specified file from the storage device to the job’s work directory |
decompress | None | No | Whether or not to decompress the staged file (Boolean) |
List All Storage Devices in a Project
GET https://platform.rescale.com/api/v2/organizations/{organization}/projects/{projectId}/storage-devices/
curl -H "Authorization: Token <api-token>" -H "Content-Type: application/json" "https://platform.rescale.com/api/v2/organizations/{organization}/projects/{projectId}/storage-devices/"
import requests
requests.get(
'https://platform.rescale.com/api/v2/organizations/{organization}/projects/{projectId}/storage-devices/',
headers={'Authorization': 'Token <api-token>'}
)
Sample Response
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": "nkaaa",
"clusterId": "fFvOc",
"storageSize": 1024,
"dateInserted": "2024-02-17T05:45:45.398153Z",
"owner": "wquinn@rescale.com",
"urls": {
"statuses": "",
"start": "",
"fileDownload": ""
},
"sshConnection": null,
"name": "Sample Storage Four",
"firstAlert": null,
"secondAlert": null,
"walltimeAlert": null,
"walltimeAlertHours": null,
"periodicAlertHours": null,
"toSharedUsers": null,
"toWorkspaceAdmins": null,
"autoextend": false,
"autoextendPercent": 80,
"region": {
"id": "caaaa",
"name": "N. Virginia"
},
"availableSpace": 0,
"mountPoint": "storage_nkaaa",
"absoluteMountPoint": "~/storage_nkaaa",
"runLowPriority": false,
"hardware": {
"slots": 1,
"coresPerSlot": 18,
"coreType": {
"code": "hpc-3",
"compute": null,
"io": 10,
"memory": 3750,
"name": "Onyx",
"storage": 36,
"storageIo": "2 GB/s read, 1GB/s write",
"cores": [
1,
2,
4,
8,
18
],
"storagePerNodeGib": 648,
"description": "HPC++",
"displayOrder": 50,
"isPrimary": true,
"hasSsd": true,
"processorInfo": "Intel Xeon E5-2666 v3 (Haswell)",
"remoteVizAllowed": true,
"features": [
"ssh",
"cluster_status"
],
"mustBeRequested": false,
"acronym": "O",
"color": "#ff4242",
"isLowPriorityBeta": false,
"isDefault": true,
"baseClockSpeed": "2.9",
"boostClockSpeed": null,
"gpuCounts": [
0,
0,
0,
0,
0
],
"gpuInfo": "",
"requiresTempSshAuth": false,
"permitPriorityCompute": true,
"permitLowPriorityCompute": true,
"permitReservedCompute": true,
"categoryCodes": [],
"networkInformation": null,
"networkBandwidthGbps": "10.00",
"networkLatencyUs": null,
"memoryPerCoreGb": "3.75",
"instructionSet": null,
"storageInformation": "2 GB/s read, 1GB/s write",
"isEbsBacked": true,
"supportsSuspension": true
},
"coreSummary": {
"numberOfNodes": 1,
"memoryPerNode": 60000,
"storagePerNode": 648,
"gpusPerNode": 0
},
"walltime": 48,
"coreClass": null,
"type": "mountable_storage",
"scheduler": {},
"rceConnector": {},
"autosuspend": true,
"instanceType": {
"apiName": "c4.8xlarge"
}
},
"analyses": [
{
"code": "user_included",
"name": "Bring Your Own Software",
"version": "0",
"versionName": "CPU",
"thumbnail": "/static/img/icon-tools.png",
"type": "compute",
"osFamily": "linux"
}
],
"projectId": "nkaaa",
"workspace": {
"id": "00-046880176",
"name": "Rescale",
"configuredName": "",
"description": "",
"isDefault": true,
"jobProjectRequired": false,
"showBillingItems": true,
"preventUsersCreatingTemplates": false,
"preventUsersCreatingUntemplatedJobs": false,
"rescaleAuthEnabled": true,
"hardwarePriority": "odp",
"isPartner": false,
"priceSchema": "2019r1",
"autoshareJobsWithWorkspaceAdministrators": false
},
"sharedWith": []
}
]
}
This endpoint retrieves all the storage-devices visible to the authenticated user associated with the specified projectId
List Project Storage Device is Assigned To
GET https://platform.rescale.com/api/v2/organizations/{organization}/storage-devices/{storage_device_id}/project-assignment/
curl -H "Authorization: Token <api-token>" -H "Content-Type: application/json" "https://platform.rescale.com/api/v2/organizations/{organization}/storage-devices/{storage_device_id}/project-assignment/"
import requests
requests.get(
'https://platform.rescale.com/api/v2/organizations/{organization}/storage-devices/{storage_device_id}/project-assignment/',
headers={'Content-Type': 'application/json', 'Authorization': 'Token <api-token>'}
)
Sample Response
{"projectId":"duOxgb"}
List the project ID of the project that a storage device is assigned to.
Field Properties
Property | Type | Description |
---|---|---|
projectId | String | Id of project |
Update Project Storage Device is Assigned To
POST https://platform.rescale.com/api/v2/organizations/{organization}/storage-devices/{job_id}/project-assignment/
curl -H "Authorization: Token <api-token>" -H "Content-Type: application/json" "https://platform.rescale.com/api/v2/organizations/{organization}/storage-devices/{storage_device_id}/project-assignment/" -X POST -d '
{
"projectId": "duOxgb"
}
'
import requests
requests.post(
'https://platform.rescale.com/api/v2/organizations/{organization}/storage-devices/{storage_device_id}/project-assignment/',
headers={'Content-Type': 'application/json', 'Authorization': 'Token <api-token>'},
json={'projectId': 'duOxgb'}
)
Sample Response
{"projectId":"duOxgb"}
Update the project ID of the project that a storage device is assigned to.
Field Properties
Property | Type | Description |
---|---|---|
projectId | String | Id of project |
Prices
All Pricing related endpoints are listed here.
List All Compute Prices
GET https://platform.rescale.com/api/v2/billing/computeprices/
This endpoint retrieves all the compute prices available to the user. A valid API token is required to make a successful request.
import requests
requests.get(
'https://platform.rescale.com/api/v2/billing/computeprices/',
headers={'Authorization': 'Token <api-token>'}
)
Sample Response
[
{
"coreType": "sapphire",
"os": "windows",
"planType": "2021-on-demand-pro",
"planName": "2021-on-demand-pro",
"value": {
"currency": "USD",
"amount": "0.3231",
"symbol": "$"
},
"isActive": true
},
{
"coreType": "sapphire",
"os": "windows",
"planType": "2021-on-demand",
"planName": "2021-on-demand",
"value": {
"currency": "USD",
"amount": "0.3231",
"symbol": "$"
},
"isActive": true
},
{
"coreType": "sapphire",
"os": "linux",
"planType": "2021-on-demand-pro",
"planName": "2021-on-demand-pro",
"value": {
"currency": "USD",
"amount": "0.1789",
"symbol": "$"
},
"isActive": true
},
{
"coreType": "sapphire",
"os": "linux",
"planType": "2021-on-demand",
"planName": "2021-on-demand",
"value": {
"currency": "USD",
"amount": "0.0806",
"symbol": "$"
},
"isActive": true
},
{
"coreType": "emerald_max",
"os": "linux",
"planType": "2021-on-demand",
"planName": "2021-on-demand",
"value": {
"currency": "USD",
"amount": "0.0543",
"symbol": "$"
},
"isActive": true
},
{
"coreType": "emerald_max",
"os": "linux",
"planType": "2021-on-demand-pro",
"planName": "2021-on-demand-pro",
"value": {
"currency": "USD",
"amount": "0.0673",
"symbol": "$"
},
"isActive": true
}
]
Response Properties
Property | Type | Description |
---|---|---|
coreType | String | The coretype’s code |
os | String | The operating system type |
planType | String | The billing plan type |
planName | String | The billing plan name |
value | Dict | The coretype’s price |
isActive | Boolean | Whether or not the price can be used for billing purposes |
Projects
List projects available to your user
GET https://platform.rescale.com/api/v2/users/me/projects/
This endpoint lists all projects available to the current user. The available projects are those associated with the groups you are a member of, which in turn is configured by your organization or workspace administrator. A valid API token is required to make a successful request.
curl -H "Authorization: Token <api-token>" https://platform.rescale.com/api/v2/users/me/projects/
import requests
requests.get(
'https://platform.rescale.com/api/v2/users/me/projects/',
headers={'Authorization': 'Token <api-token>'}
)
Sample Response
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"id": "pCTMk",
"isDefault": true,
"name": "Project without a budget",
"remainingAmounts": [
"(no budget)"
]
},
{
"id": "BNTMk",
"isDefault": false,
"name": "Project with a budget",
"remainingAmounts": [
"All: My budget ($100.00 available)"
]
}
]
}
Data Access
Data Access endpoints supporting Rescale Data products are listed here.
List All Jobs Metadata
Beta API endpoints may change without notice, and this document may not reflect their current behavior.
GET https://platform.rescale.com/api/v2/data/jobs
curl -H "Authorization: Token <api-token>" https://platform.rescale.com/api/v2/data/jobs/
import requests
requests.get(
'https://platform.rescale.com/api/v2/jobs/',
headers={'Authorization': 'Token <api-token>'}
)
# All parameters example
requests.get(
'https://platform.rescale.com/api/v2/data/jobs/?limit=5&offset=2&fields=job_internal_id,name,owner,job_id&createdBefore=2023-11-15',
headers={'Authorization': 'Token <api-token>'}
)
Sample Response
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"dateInserted": "2024-10-10T06:23:07.506696Z",
"name": "Design-34",
"status": {
"status": "Completed",
"statusDate": "2024-07-09T02:31:36.546513+00:00",
"statusReason": "Completed successfully"
},
"owner": "bob.sears@acme-global.co (Account: 04-000265286)",
"project": "id: wMTMk, name: Project EV-Battery-4079",
"hardware": {
"slots": 1,
"coretype": {
"name": "Emerald S Max",
"acronym": "Es"
},
"walltime": 48,
"autosuspend": true,
"coresPerSlot": 8,
"clusterStartTime": "2024-07-09T02:22:16+00:00"
},
"jobAnalyses": [
{
"analysisName": "ANSYS LS-DYNA",
"analysisType": "compute",
"analysisVersion": "2024 R1"
}
],
"priority": "odp",
"tags": [
{
"name": "P79-3",
"normalizedName": "p793"
}
],
"customValues": {
"System": "Cooling System",
"Subsystem": "Lower Cover",
"Part Number": "CS-CP-D0034",
"PeakStress(Mpa)": 255,
"PressureDrop(Pa)": 557.48,
"PeakTemperature(K)": 392.38
},
"jobId": "hhJmYb",
"studyName": null,
"studyShortName": null,
"studyDescription": null
},
{
"dateInserted": "2024-10-10T06:23:07.502429Z",
"name": "Design-16",
"status": {
"status": "Completed",
"statusDate": "2024-07-09T02:31:30.807487+00:00",
"statusReason": "Completed successfully"
},
"owner": "bob.sears@acme-global.co (Account: 04-000265286)",
"project": "id: wMTMk, name: Project EV-Battery-4079",
"hardware": {
"slots": 1,
"coretype": {
"name": "Emerald S Max",
"acronym": "Es"
},
"walltime": 48,
"autosuspend": true,
"coresPerSlot": 8,
"clusterStartTime": "2024-07-09T02:22:11+00:00"
},
"jobAnalyses": [
{
"analysisName": "ANSYS LS-DYNA",
"analysisType": "compute",
"analysisVersion": "2024 R1"
}
],
"priority": "odp",
"tags": [
{
"name": "P79-3",
"normalizedName": "p793"
}
],
"customValues": {
"System": "Cooling System",
"Subsystem": "Lower Cover",
"Part Number": "CS-CP-D0016",
"PeakStress(Mpa)": 240,
"PressureDrop(Pa)": 536.76,
"PeakTemperature(K)": 407.61
},
"jobId": "CeFvNb",
"studyName": null,
"studyShortName": null,
"studyDescription": null
}
]
}
By default this endpoint retrieves all of the jobs metadata objects visible to the permissions level of the authenticated user (you).
Query Parameters
Following query parameters are accepted by this endpoint, which will filter out the user’s jobs.
Query Parameter | Type | Accepted Values | Description |
---|---|---|---|
fields |
String | date_inserted , name , status , owner , project , hardware , job_analyses , priority , tags , custom_values , job_id , study_name , study_short_name , study_description |
Comma-separated list of fields to include in response. |
createdBefore |
String | YYYY-MM-DD |
Filter for resources created before this timestamp. |
createdAfter |
String | YYYY-MM-DD |
Filter for resources created after this timestamp. |
limit |
Integer | 0-10000 default=100 |
Limits the number of records returned. |
Response Properties
Property | Type | Description |
---|---|---|
dateInserted | String | Date time for the workload creation |
name | String | Name of the workload |
status | JSONB | JSON of the latest workload status; Contains status, status date time, and status reason |
owner | String | Workload owner’s email and workspace external ID |
project | String | Project code and name |
hardware | JSON | Hardware configuration for the workload; Contains slots, cores per slot, coretype, walltime, auto-suspend settings, and cluster start datetime |
jobAnalyses | JSONB | Software(s) name and version for the workload |
priority | String | Billing priority for the workload |
tags | JSONB | Tags assigned to the workload |
jobId | String | The external obfuscated public job identifier |
studyName | String | The name of the study the job is attached to, or null. |
studyShortName | String | The 4 character project name the study is attached to and the hyphenated study number of the project. |
studyDescription | String | The markdown description of the study |
List Jobs metadata Fields
Beta API endpoints may change without notice, and this document may not reflect their current behavior.
GET https://platform.rescale.com/api/v2/data/jobs/fields
curl -H "Authorization: Token <api-token>" https://platform.rescale.com/api/v2/data/jobs/fields
import requests
requests.get(
'https://platform.rescale.com/api/v2/data/jobs/fields',
headers={'Authorization': 'Token <api-token>'}
)
Sample Response
{
"fields": [
"date_inserted",
"name",
"status",
"owner",
"project",
"hardware",
"job_analyses",
"priority",
"tags",
"custom_values",
"job_id",
"study_name",
"study_short_name",
"study_description"
]
}
This endpoint lists all of the fields provided by the jobs endpoint of the Jobs metadata summary objects.
Admin API
In order to be able to access the following endpoints, the API token used must belong to an organization or workspace admin.
Members
List All Workspace Members
GET https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/members/
curl -H "Authorization: Token <api-token>" https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/members/
import requests
requests.get(
'https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/members/',
headers={'Authorization': 'Token <api-token>'}
)
Sample Response
[
{
"userId": "yCXPT",
"email":"ada@example.com",
"fullName":"Ada Lovelace",
"status":"active",
"groups": [],
"hasApiKey": false,
"isOrganizationAdmin": true,
"isWorkspaceAdmin": false,
"dateJoined":"2020-09-21T15:45:55.861897Z",
"lastLogin": "2020-09-08T16:09:37.729164Z",
"status": "active"
},...
]
This endpoint retrieves all users in the specified workspace.
Invite Members to a Workspace
POST https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/invites/
curl -H "Authorization: Token <api-token>" -H "Content-Type: application/json" "https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/invites/" -X POST -d '
[{"email":"ada@example.com", "fullName": "Ada Lovelace","groupId":""},...]
'
import requests
requests.post(
'https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/invites/',
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'},
json=[{"email": "ada@example.com", "fullName": "Ada Lovelace", "groupId": ""}, ...]
)
Sample Response
[
{
"email":"ada@example.com",
"fullName":"Ada Lovelace",
"dateInvited":"2020-09-21T15:45:55.861897-07:00",
"status":"invited"
},...
]
Creates a record and sends an invite to the specified member emails to join the organization.
Fields
Field | Default | Required | Description |
---|---|---|---|
None | Yes | User email | |
fullName | None | No | The full name to be pre-populated into the user’s profile |
groupId | None | No | The group the user should be assigned to once signed up |
Groups
List Groups
GET https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/groups/
curl -H "Authorization: Token <api-token>" https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/groups/
import requests
requests.get(
'https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/groups/',
headers={'Authorization': 'Token <api-token>'}
)
Sample Response
[
{
"id": "yCXPT",
"name": "Aero Team",
"memberCount": 3,
"hardwareFilter": null
},...
]
This endpoint retrieves all groups in the specified workspace.
Create Group
POST https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/groups/
curl -H "Authorization: Token <api-token>" -H "Content-Type: application/json" "https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/groups/" -X POST -d '
{"name": "Structural Team"}
'
import requests
requests.post(
'https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/groups/',
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'},
json={"name": "Structural Team"}
)
Sample Response
{
"id": "iaKbt",
"name": "Structural Team",
"memberCount": 0,
"hardwareFilter": null
}
Creates a group with the specified name.
Fields
Field | Default | Required | Description |
---|---|---|---|
name | None | Yes | Group name |
Add Members
POST https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/groups/<group-id>/members/
curl -H "Authorization: Token <api-token>" -H "Content-Type: application/json" "https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/groups/<group-id>/members/" -X POST -d '
{"email": "ada@example.com"}
'
import requests
requests.post(
'https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/groups/<group-id>/members/',
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'},
json={"email": "ada@example.com"}
)
Sample Response
{
"email": "ada@example.com",
"groupId": "iaKbt",
"groupName": "Structural Team",
"isGroupAdmin": false
}
Adds a member to the specified group.
Fields
Field | Default | Required | Description |
---|---|---|---|
None | Yes | Email of workspace member to be added to the specified group | |
isGroupAdmin | False | No | Whether this user should be an admin for this group (Boolean) |
Remove Members
DELETE https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/groups/<group-id>/members/<member-email>/
Removes the member with the specified email from the specified group.
Assign Hardware Filter
PATCH https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/groups/<group-id>/
curl -H "Authorization: Token <api-token>" -H "Content-Type: application/json" "https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/groups/<group-id>/" -X PATCH -d '
{"hardwareFilter": {"id": "GbQWc"}}
'
import requests
requests.patch(
'https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/groups/<group-id>/',
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'},
json={"hardwareFilter": {"id": "GbQWc"}}
)
Sample Response
{
"id": "iaKbt",
"name": "Structural Team",
"memberCount": 3,
"hardwareFilter": {
"id": "GbQWc",
"name":"High Clock-speed Only",
"filteredCoreTypes":[
{
"code":"luna",
"name":"Luna",
"processorInfo":"Intel Xeon Platinum P-8124 @ 3.00GHz (Skylake)",
"allowLowPriority": true,
"allowPriority": false
},...
],
"filteredCoreTypeSets": []
}
}
Assigns a hardware filter to the specified group.
Fields
Field | Default | Required | Description |
---|---|---|---|
hardwareFilter | None | Yes | The hardware filter to be applied, Object with nested id field required |
Hardware Filters
List Hardware Filters
GET https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/hardware-filters/
Sample Response
[
{
"id":"GbQWc",
"name":"High Clock-speed Only",
"filteredCoreTypes": [
{
"code":"luna",
"name":"Luna",
"processorInfo":"Intel Xeon Platinum P-8124 @ 3.00GHz (Skylake)",
"allowLowPriority": true,
"allowLowPriority": false
},
...
],
"filteredCoreTypeSets": [
{
"code": "coretype-set-plus",
"name": "Coretype Set Plus",
"coretypeConfigs": [
{
"coreType": "coretype-1",
"name": "Coretype 1",
"priority": "od",
"order": 0
},
{
"coreType": "coretype-2",
"name": "Coretype 2",
"priority": "od",
"order": 1
}
]
},
...
]
},
]
Create Hardware Filter
POST https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/hardware-filters/
curl -H "Authorization: Token <api-token>" -H "Content-Type: application/json" "https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/hardware-filters/" -X POST -d '
{
"name": "High Clock-speed Only",
"filteredCoreTypes": [
{
"code": "luna",
"name": "Luna",
"processorInfo": "Intel Xeon Platinum CPU",
"allowLowPriority": true,
"allowPriority": true
},
{
"code": "carbon",
"name": "Carbon",
"processorInfo": "Intel Xeon Platinum CPU",
"allowLowPriority": true,
"allowPriority": false
}
],
"filteredCoreTypeSets": []
}
'
import requests
requests.post(
'https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/hardware-filters/',
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'},
json={
"name": "High Clock-speed Only",
"filteredCoreTypes": [
{
"code": "luna",
"name": "Luna",
"processorInfo": "Intel Xeon Platinum CPU",
"allowLowPriority": true,
"allowPriority": true
},
{
"code": "carbon",
"name": "Carbon",
"processorInfo": "Intel Xeon Platinum CPU",
"allowLowPriority": true,
"allowPriority": false
}
],
"filteredCoreTypeSets": []
}
)
Sample Response
{
"id":"GbQWc",
"name":"High Clock-speed Only",
"filteredCoreTypes": [
{
"code": "luna",
"name": "Luna",
"processorInfo": "Intel Xeon Platinum CPU",
"allowLowPriority": true,
"allowPriority": true
}
{
"code": "carbon",
"name": "Carbon",
"processorInfo": "Intel Xeon Platinum CPU",
"allowLowPriority": true,
"allowPriority": false
}
],
"filteredCoreTypeSets": []
}
Creates a hardware filter that can be applied to any group in the workspace.
Fields
Field | Default | Required | Description |
---|---|---|---|
name | None | Yes | Name for this hardware filter |
filteredCoreTypes | None | No | The coretypes to add to this hardware filter (Array of Coretype Objects) |
filteredCoreTypeSets | None | No | The coretype sets to add to this hardware filter (Array of Coretype Set Objects) |
Coretype Object Fields
Field | Default | Required | Description |
---|---|---|---|
code | None | Yes | Code for the coretype to be modified |
allowLowPriority | None | Yes | whether to allow for On Demand Economy pricing |
allowPriority | None | Yes | whether to allow for On Demand Priority pricing |
name | None | no | name of the coretype object |
processorInfo | None | no | processor info of the coretype |
Coretype Set Object Fields
Field | Default | Required | Description |
---|---|---|---|
code | None | Yes | Code for the coretype set to be included in the filter |
name | None | No | Id for the hardware filter to be assigned |
coretypeConfigs | None | No | Array of Coretypes within the Coretype Set configuration {coreType, name, order} |
NOTE: either a Coretype Set or Coretype must be included in every hardware filter
Software Restrictions
View All Available Software
GET https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/available-analyses/
Sample Response
[
{
"name": "Abaqus",
"code": "abaqus",
"versions": [
{
"version": "2020 (FlexNet Licensing)",
"versionCode": "2020"
},...
]
},...
]
Returns a list of all available software analyses and their versions.
View Software Restrictions
GET https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/analysis-versions/
Sample Response
{
"hasRestrictions": true,
"analysisVersions":[
{
"code": "abaqus",
"name": "Abaqus",
"version": "2020",
"versionName": "2020 (FlexNet Licensing)"
},...
]
}
Returns a list of all analysis versions allowed for this workspace.
Update Software Restrictions
PATCH https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/analysis-versions/
curl -H "Authorization: Token <api-token>" -H "Content-Type: application/json" "https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/analysis-versions/" -X PATCH -d '
{
"analysisVersions":[
{
"code": "abaqus",
"version": "2020",
},...
]
}
'
import requests
requests.patch(
'https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/analysis-versions/',
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'},
json={
"analysisVersions":[
{
"code": "abaqus",
"version": "2020"
},...
]
}
)
Sample Response
{
"hasRestrictions": true,
"analysisVersions":[
{
"code": "abaqus",
"name": "Abaqus",
"version": "2020",
"versionName": "2020 (FlexNet Licensing)"
},...
]
}
Update the set of software analyses and versions available to the workspace.
Fields
Field | Default | Required | Description |
---|---|---|---|
analysisVersions | None | Yes | The analysis versions to be enabled for the workspace (Array of Analysis Version Objects) |
Analysis Version Object Fields
Field | Default | Required | Description |
---|---|---|---|
code | None | Yes | Software analysis code |
version | None | Yes | Software analysis version code (not name) |
Billing
View Workspace Billing Summary
GET https://platform.rescale.com/api/v2/organizations/<organization-code>/workspaces/<workspace-id>/billing/
Sample Response
{
"jobs": 12900,
"hardwareCharge": 23573.02,
"softwareCharge": 0,
"storageCharge": 500.25,
"transferCharge": 0,
"connectionsCharge": 0,
"deposits": 0,
"appliedCredit": 0,
"appliedDeposit": -24070.78,
"totalCharge": 2.49,
"hardwareUsage": 540882,
"storageUsage": 0,
"transferUsage": 0,
"id": "04-0468913198",
"label": "Acme Co.",
"activeUsers": 3,
"csvUrl": "/organizations/acme/workspaces/04-0468913198/billing/csv/?startYear=2020&startMonth=9&endYear=2020&endMonth=9"
}
Returns a summary of workspace charges for the specified period.
Query String Arguments
Argument | Description |
---|---|
startYear | Year for start of period |
startMonth | Numeric month for start period |
endYear | Year for end of period |
endMonth | Numeric month for end of period |
View Project Billing Summary
GET https://platform.rescale.com/api/v2/organizations/{organization}/workspaces/{workspace}/billing/projects/{projectId}/csv/
This endpoint returns a csv summary of charges for a specified project by line item.
curl -H "Authorization: Token <api-token>" -H "Content-Type: application/json" "https://platform.rescale.com/api/v2/organizations/{organization}/workspaces/{workspace}/billing/projects/{projectId}/csv/"
import requests
requests.get(
'https://platform.rescale.com/api/v2/organizations/{organization}/workspaces/{workspace}/billing/projects/{projectId}/csv/',
headers={'Authorization': 'Token <api-token>'}
)
Sample Response
Workspace ID,User,Type,ID,Name,Custom Fields,Project ID,Project Name,Software,Rescale On-Demand License,License Settings,Month,Submit Date,Start Date,Stop Date,Description,Billing Priority,Cores,Unit Hours,Unit Charge/Hour,Charge,SKU,Job Type,Walltime
{workspace},{user},Compute,mjXbT,New Storage Device,,duOxgb,ProjectZ,,,,2024-02,"Feb 13, 2024 23:28:37","Feb 13, 2024 23:35:23",,High Performance Storage: 4-core storage cluster,,,29.37778,$0.0968,$2.85,HW-04US01-EM1-I21-L00,,
{workspace},{user},Storage,mjXbT,New Storage Device,,duOxgb,ProjectZ,,,,2024-02,"Feb 13, 2024 23:28:37","Feb 13, 2024 23:35:23",,High Performance Storage: 0.009765625 tb storage,,,0.071723090,$0.4842,$0.04,ST-04US01-BLK-00,,
{workspace},{user},Rescale Platform,mjXbT,New Storage Device,,duOxgb,ProjectZ,,,,2024-02,"Feb 13, 2024 23:28:37","Feb 13, 2024 23:35:23",,Rescale Platform,,,29.377777778,$0.0000,$0.00,,,
,,,,,,,,,,,,,,Total,,,,,$2.89,,,
Projects
List projects available to a workspace
GET https://platform.rescale.com/api/v2/organizations/{organization_code}/workspaces/{workspace_id}/projects/
This endpoint lists all projects available to the designated workspace. The response includes which groups are assigned to the project (if any), whether the project is the default in the workspace, the number of jobs and storage devices related to the project, and whether auto-share behavior is enabled for users in the project.
curl -H 'Authorization: Token <api-token>' https://platform.rescale.com/api/v2/organizations/rescale/workspaces/00-046880176/projects/
import requests
requests.get(
'https://platform.rescale.com/api/v2/organizations/rescale/workspaces/00-046880176/projects/',
headers={'Authorization': 'Token <api-token>'}
)
Sample Response
[
{
"autoShareJobs": false,
"groups": [
{
"groupId": "nkaaa",
"groupName": "Test group",
"projectId": "pCTMk",
"priorityQueueManagement": false
}
],
"id": "pCTMk",
"jobCount": 1,
"storageDeviceCount": 0,
"name": "Test project",
"maxConcurrentCores": 42,
"isDefault": true,
"workspaceId": "00-046880176"
},
{
"autoShareJobs": true,
"groups": [],
"id": "BNTMk",
"jobCount": 0,
"storageDeviceCount": 0,
"name": "Real project",
"maxConcurrentCores": null,
"isDefault": false,
"workspaceId": "00-046880176"
}
]
Get a specific project
GET https://platform.rescale.com/api/v2/organizations/{organization_code}/workspaces/{workspace_id}/projects/{project_id}/
Retrieve information about the given project, including which groups are assigned to the project, if any, whether the project is the default in the workspace, the number of jobs and storage devices related to the project, and whether auto-share behavior is enabled for users in the project.
curl -H 'Authorization: Token <api-token>' https://platform.rescale.com/api/v2/organizations/rescale/workspaces/00-046880176/projects/pCTMk/
import requests
requests.get(
'https://platform.rescale.com/api/v2/organizations/rescale/workspaces/00-046880176/projects/pCTMk/',
headers={'Authorization': 'Token <api-token>'}
)
Sample Response
{
"autoShareJobs": false,
"groups": [
{
"groupId": "nkaaa",
"groupName": "Test group",
"projectId": "pCTMk",
"priorityQueueManagement": false
}
],
"id": "pCTMk",
"jobCount": 1,
"storageDeviceCount": 0,
"name": "Test project",
"maxConcurrentCores": 42,
"isDefault": true,
"workspaceId": "00-046880176"
}
Create a project
POST https://platform.rescale.com/api/v2/organizations/{organization_code}/workspaces/{workspace_id}/projects/
Add a new project in the given workspace, and return a description of the new project.
Project
Field | Default | Required | Description |
---|---|---|---|
name | None | Yes | A unique name within the workspace. |
isDefault | False | No | Whether the project is the default in the workspace, may only be True if a default does not already exist. |
autoShareJobs | False | No | Desired auto-sharing behavior. |
maxConcurrentCores | False | None | Desired concurrent core limitation, if any. |
curl -H 'Authorization: Token <api-token>' -H 'Content-Type: application/json' https://platform.rescale.com/api/v2/organizations/rescale/workspaces/00-046880176/projects/ -d '
{
"name": "New project",
"isDefault": false,
"autoShareJobs": false,
"maxConcurrentCores": 42
}
'
import requests
requests.post(
'https://platform.rescale.com/api/v2/organizations/rescale/workspaces/00-046880176/projects/',
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'},
json={
'name': 'New project',
'isDefault': False,
'autoShareJobs': False,
'maxConcurrentCores': 42
}
)
Sample Response
{
"autoShareJobs": false,
"groups": [],
"id": "pkaaa",
"jobCount": 0,
"storageDeviceCount": 0,
"name": "New project",
"maxConcurrentCores": 42,
"isDefault": false,
"workspaceId": "00-046880176"
}
Update a project
PATCH https://platform.rescale.com/api/v2/organizations/{organization_code}/workspaces/{workspace_id}/projects/{project_id}/
Change the settings for a given project, and return a description of the updated project.
Project
Field | Default | Required | Description |
---|---|---|---|
name | None | Yes | A unique name within the workspace. |
isDefault | False | No | Whether the project is the default in the workspace, may only be True if a default does not already exist. |
autoShareJobs | False | No | Desired auto-sharing behavior. |
maxConcurrentCores | False | None | Desired concurrent core limitation, if any. |
curl -H 'Authorization: Token <api-token>' -H 'Content-Type: application/json' https://platform.rescale.com/api/v2/organizations/rescale/workspaces/00-046880176/projects/pCTMk/ -X PATCH -d '
{
"name": "Updated project name",
"isDefault": false,
"autoShareJobs": false,
"maxConcurrentCores": null
}
'
import requests
requests.patch(
'https://platform.rescale.com/api/v2/organizations/rescale/workspaces/00-046880176/projects/pCTMk/',
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'},
json={
'name': 'Updated project name',
'isDefault': False,
'autoShareJobs': False,
'maxConcurrentCores': None
}
)
Sample Response
{
"autoShareJobs": false,
"groups": [],
"id": "pkaaa",
"jobCount": 0,
"storageDeviceCount": 0,
"name": "Updated project name",
"maxConcurrentCores": null,
"isDefault": false,
"workspaceId": "00-046880176"
}
Delete a project
DELETE https://platform.rescale.com/api/v2/organizations/{organization_code}/workspaces/{workspace_id}/projects/{project_id}/
Remove a project in the workspace.
curl -H 'Authorization: Token <api-token>' https://platform.rescale.com/api/v2/organizations/rescale/workspaces/00-046880176/projects/pCTMk/ -X DELETE
import requests
requests.delete(
'https://platform.rescale.com/api/v2/organizations/rescale/workspaces/00-046880176/projects/pCTMk/',
headers={'Authorization': 'Token <api-token>'}
)
Assign a group to a project
POST https://platform.rescale.com/api/v2/organizations/{organization_code}/workspaces/{workspace_id}/projects/{project_id}/groups/
Associate the given group and project, allowing group members to create jobs under the project.
Field | Default | Required | Description |
---|---|---|---|
groupId | None | Yes | Identifier of the group to associate. |
curl -H 'Authorization: Token <api-token>' -H 'Content-Type: application/json' https://platform.rescale.com/api/v2/organizations/rescale/workspaces/00-046880176/projects/pCTMk/groups/ -d '
{
"groupId": "pkaaa"
}
'
import requests
requests.post(
'https://platform.rescale.com/api/v2/organizations/rescale/workspaces/00-046880176/projects/pCTMk/groups/',
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'},
json={
'groupId': 'pkaaa'
}
)
Sample Response
{
"groupId": "pkaaa",
"groupName": "A group",
"projectId": "pCTMk",
"priorityQueueManagement": false
}
Remove a group from a project
DELETE https://platform.rescale.com/api/v2/organizations/{organization_code}/workspaces/{workspace_id}/projects/{project_id}/groups/{group_id}/
Remove the association between a group and a project. Users in the group will no longer be able to submit jobs to the project, unless they are members of another group that still has an association.
curl -H 'Authorization: Token <api-token>' https://platform.rescale.com/api/v2/organizations/rescale/workspaces/00-046880176/projects/pCTMk/groups/pkaaa/ -X DELETE
import requests
requests.delete(
'https://platform.rescale.com/api/v2/organizations/rescale/workspaces/00-046880176/projects/pCTMk/groups/pkaaa/',
headers={'Authorization': 'Token <api-token>'}
)
Tutorials
Job Creation
In this tutorial we are going to create a basic job as described on the resources using the API.
Uploading your data
curl -X POST -H 'Content-Type:multipart/form-data' \
-H 'Authorization: Token <api-token>' \
-F "file=@airfoil2d.zip" \
https://platform.rescale.com/api/v2/files/contents/
requests.post(
'https://platform.rescale.com/api/v2/files/contents/',
data=None,
files={'file': open('airfoil2d.zip')},
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'}
)
HTTP 201 CREATED
{
"typeId": 1,
"name": "airfoil2d.zip",
"dateUploaded": "2014-11-12T22:20:09.596996Z",
"relativePath": "airfoil2d.zip",
"encodedEncryptionKey": "3VgE0Ql/6hGwGNOF+TXMHNsthAdae9C+8tiIfuoDpPA=",
"sharedWith": [],
"decryptedSize": 663368,
"owner": "demouser@example.com",
"path": "user/user_OvdRk/airfoil2d-06feda72-6b3d-4f24-86e2-cd56722d1a42.zip",
"isUploaded": true,
"viewInBrowser": false,
"id": "XkpTse",
"md5": "0b66f3069732b02fe6c132f4cbd2f5b8"
}
In order to upload your files to the platform, you need to send them as
a multipart HTTP POST requests to the API. The form should contain a
file
field which is the file you want to upload.
Once the file is uploaded, the server should return a JSON blob which contains amongst other things, the id of the File you just uploaded. This field is going to come in handy when referring to this particular file in all the other calls to the API.
Choosing an analysis
curl -H "Authorization: Token <api-token>" https://platform.rescale.com/api/v2/analyses/
import requests
requests.get(
'https://platform.rescale.com/api/v2/analyses/',
headers={'Authorization': 'Token <api-token>'}
)
HTTP 200 OK
{
"industries": [
{
"name": "Aerospace",
"icon": "https://d1n0dfo9fhokwf.cloudfront.net/thumbnails/tools-aero_1.png"
},
{
"name": "Automotive",
"icon": "https://d1n0dfo9fhokwf.cloudfront.net/thumbnails/tools-auto_1.png"
}
],
"code": "openfoam",
"description": "<p><b>OpenFOAM</b> (<b>Open</b>-source <b>F</b>ield <b>O</b>peration <b>A</b>nd <b>M</b>anipulation is a C++ toolbox for the development of customized numerical solvers, and pre-/post-processing utilities for the solution of continuum mechanics problems, including computational fluid dynamics (CFD).</p>",
"versions": [
{
"eula": null,
"allowedCoreTypes": [
"hi-io",
"hi-io-plus",
"hi-mem",
"hi-mem-hpc",
"hpc",
"hpc-plus",
"lo-mem",
"standard",
"standard-plus"
],
"stdCommand": "foamExec <module> <input-file>",
"version": "2.3.0",
"mpiCommand": "mpirun -np <mpi-ranks> foamExec <module> <input-file> -parallel",
"versionCode": "2.3.0-openmpi",
"smpCommand": "mpirun -np <smp-ranks> foamExec <module> <input-file> -parallel"
},
{
"eula": null,
"allowedCoreTypes": [
"hi-io",
"hi-io-plus",
"hi-mem",
"hi-mem-hpc",
"hpc",
"hpc-plus",
"lo-mem",
"standard",
"standard-plus"
],
"stdCommand": "foamExec <module> <input-file>",
"version": "2.2.2",
"mpiCommand": "mpirun -np <mpi-ranks> foamExec <module> <input-file> -parallel",
"versionCode": "2.2.2-openmpi",
"smpCommand": "mpirun -np <smp-ranks> foamExec <module> <input-file> -parallel"
},
{
"eula": null,
"allowedCoreTypes": [
"hi-io",
"hi-io-plus",
"hi-mem",
"hi-mem-hpc",
"hpc",
"hpc-plus",
"lo-mem",
"standard",
"standard-plus"
],
"stdCommand": "foamExec <module> <input-file>",
"version": "2.2.0",
"mpiCommand": "mpirun -np <mpi-ranks> foamExec <module> <input-file> -parallel",
"versionCode": "2.2.0-openmpi",
"smpCommand": "mpirun -np <smp-ranks> foamExec <module> <input-file> -parallel"
},
{
"eula": null,
"allowedCoreTypes": [
"hi-io",
"hi-io-plus",
"hi-mem",
"hi-mem-hpc",
"hpc",
"hpc-plus",
"lo-mem",
"standard",
"standard-plus"
],
"stdCommand": "foamExec <module> <input-file>",
"version": "2.1.1",
"mpiCommand": "mpirun -np <mpi-ranks> foamExec <module> <input-file> -parallel",
"versionCode": "2.1.1-openmpi",
"smpCommand": "mpirun -np <smp-ranks> foamExec <module> <input-file> -parallel"
}
],
"supportDesks": [
{
"code": "rescale",
"displayName": "Rescale Support",
"email": "support@rescale.com"
}
],
"hasRescaleLicense": false,
"vendorName": "",
"pricing": "",
"licenseSettings": [],
"optimizerType": null,
"thumbnail": "https://d1n0dfo9fhokwf.cloudfront.net/thumbnails/openfoam_m.png",
"resources": [],
"name": "OpenFOAM"
}
A Rescale job is composed of one or more analyses (software packages).
A GET call to the analysis endpoint lists out all the analyses available on the platform.
A single analysis may have multiple versions. You can use the code
and versionCode
returned here to select the analysis while creating a Job.
Additionally the meta data returned by this call is instructive for expected values in the “command” string for a given analysis. In this example we’ll
use OpenFOAM.
Setting up your Rescale Job
cat <<EOF > data.json
{
"name": "Basic Job",
"jobanalyses": [
{
"useMpi": false,
"command": "./airFoil2D/Allrun",
"analysis": {
"code": "openfoam",
"version": "2.3.0-openmpi"
},
"hardware": {
"coresPerSlot": 1,
"slots": 1,
"coreType": "standard-plus"
},
"inputFiles": [
{
"id": "XkpTse"
}
]
}
]
}
EOF
curl -X POST --data @data.json \
-H "Authorization: Token <api-token>" \
-H "Content-Type: application/json" \
https://platform.rescale.com/api/v2/jobs/
import requests
requests.post(
'https://platform.rescale.com/api/v2/jobs/',
data={
'name': 'Basic Job',
'jobanalyses': [
{
'useMpi': false,
'command': './airFoil2D/Allrun',
'analysis': {
'code': 'openfoam',
'version': '2.3.0-openmpi'
},
'hardware': {
'coresPerSlot': 1,
'slots': 1,
'coreType': 'standard-plus'
},
'inputFiles': [
{
'id': 'XkpTse'
}
]
}
]
},
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'}
)
HTTP 201 CREATED
{
"monteCarloIterations": null,
"paramFile": null,
"name": "Basic Job",
"includeNominalRun": false,
"jobanalyses": [
{
"envVars": null,
"useMpi": false,
"postProcessScriptCommand": "",
"preProcessScriptCommand": "",
"useRescaleLicense": false,
"templateTasks": [],
"analysis": {
"code": "openfoam",
"version": "2.3.0-openmpi"
},
"hardware": {
"coreSummary": {
"storagePerNode": 4000,
"numberOfNodes": 1,
"memoryPerNode": 3750
},
"coresPerSlot": 1,
"slots": 1,
"coreType": "standard-plus"
},
"command": "./airFoil2D/Allrun",
"preProcessScript": null,
"postProcessScript": null,
"inputFiles": [
{
"typeId": 1,
"name": "airfoil2d.zip",
"dateUploaded": "2014-11-12T22:20:09.596996Z",
"relativePath": "airfoil2d.zip",
"encodedEncryptionKey": "3VgE0Ql/6hGwGNOF+TXMHNsthAdae9C+8tiIfuoDpPA=",
"sharedWith": [],
"decryptedSize": 663368,
"owner": "demouser@rescale.com",
"path": "user/user_OvdRk/airfoil2d-06feda72-6b3d-4f24-86e2-cd56722d1a42.zip",
"isUploaded": true,
"viewInBrowser": false,
"id": "XkpTse",
"md5": "0b66f3069732b02fe6c132f4cbd2f5b8"
}
]
}
],
"resourceFilters": [
{
"caseSensitive": false,
"include": true,
"filterType": "Analysis generated files",
"selector": "Analysis generated files"
},
{
"caseSensitive": false,
"include": true,
"filterType": "Completed templates",
"selector": "Completed templates"
},
{
"caseSensitive": false,
"include": true,
"filterType": "Input files",
"selector": "Input files"
}
],
"jobvariables": [],
"isTemplateDryRun": false,
"remoteVizConfig": null,
"caseFile": null,
"isLowPriority": false,
"owner": "demouser@rescale.com",
"optimizer": null,
"expectedRuns": null,
"id": "QTVia",
"archiveFilters": []
}
A Rescale Job is composed of one or more software packages which we refer to as analyses. Thus the properties can be either at the Job level (i.e Global) or on a JobAnalysis level. See the job endpoint for information on the fields available.
Submitting your job
curl -X POST -H 'Authorization: Token <api-token>' \
https://platform.rescale.com/api/v2/jobs/QTVia/submit/
import requests
requests.post(
'https://platform.rescale.com/api/v2/jobs/QTVia/submit/',
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'}
)
If the job creation was successful, server should respond back with the full schema of the job as stored on the backend. Contained within the JSON response is the job id. We will use this id to submit, monitor and get the results from the job.
Monitoring your job
curl -H 'Authorization: Token <api-token>' https://platform.rescale.com/api/v2/jobs/QTVia/statuses/
import requests
requests.get(
'https://platform.rescale.com/api/v2/jobs/QTVia/statuses/',
headers={'Content-Type': 'application/json',
'Authorization': 'Token <api-token>'}
)
HTTP 200 OK
{
"count": 5,
"previous": null,
"results": [
{
"status": "Executing",
"statusDate": "2014-11-12T22:55:45.804000Z",
"statusReason": null
},
{
"status": "Validated",
"statusDate": "2014-11-12T22:52:12.065000Z",
"statusReason": null
},
{
"status": "Started",
"statusDate": "2014-11-12T22:52:11.456000Z",
"statusReason": null
},
{
"status": "Queued",
"statusDate": "2014-11-12T22:52:11.073170Z",
"statusReason": null
},
{
"status": "Pending",
"statusDate": "2014-11-12T22:52:10.125011Z",
"statusReason": null
}
],
"next": null
}
A GET call to this endpoint returns all the statuses associated with the specified job in order of their recency.
Getting results
curl -H 'Authorization: Token <api-token>' https://platform.rescale.com/api/v2/jobs/QTVia/runs/
import requests
requests.get(
'https://platform.rescale.com/api/v2/jobs/QTVia/runs/',
headers={'Authorization': 'Token <api-token>'}
)
HTTP 200 OK
{
"count": 1,
"previous": null,
"results": [
{
"dateCompleted": null,
"parent": null,
"variables": [],
"outputFileSize": null,
"outputFileCount": 0,
"dateStarted": "2014-11-12T22:55:56.659000Z",
"type": 3,
"id": "1",
"displayOrder": 1,
"isOptimal": false
}
],
"next": null
}
A single execution of your workflow is called a run in Rescale parlance. When a job is in either “Completed” or “Executing” state, you can query the job runs endpoint for a list of finished runs.
This is a basic job and therefore has 1 run. DOE jobs would have multiple runs, which could be queried individually by sending a request to the run endpoint with the run id in the path.
File download
curl -H 'Authorization: Token <api-token>' \
https://platform.rescale.com/api/v2/files/iudjqe/contents/ > process_output.log
import requests
from contextlib import closing
url='https://platform.rescale.com/api/v2/files/iudjqe/contents/'
headers={'Authorization': 'Token <api-token>'}
with closing(requests.get(url, headers=headers, stream=True)) as r:
with open('process_output.log', 'rw') as f:
for chunk in r.iter_content(chunk_size=100):
f.write(chunk)
We can list all the output files for the job by sending a request to the output files endpoint. With those ids, we can download files by issuing a GET call to the file download endpoint.