NAV
json

Overview

DeployR API - Reference Documentation

The DeployR application programing interface (API) exposes a wide range of R analytics services to client application developers. Using this API directly, developers can integrate R-based analytics into their client applications. The DeployR API is a fully standardized Web services interface using JSON over HTTP(S ). This means that any piece of software that is both capable of connecting to the server and parsing JSON can become a client. Learn more by reading this high level description of the DeployR APIs in the API Overview guide.

This API reference guide describes the complete set of DeployR Public API services provided for users, projects, jobs, repository-managed files and scripts and the event stream.

Note: To simplify making calls, encoding data, and handling the response markup on the API, DeployR also provides several client libraries available for Java, JavaScript and .NET developers.

Version information

Version : 8.0.5

Contact information

DeployR forum

License information

License : Microsoft 2016

URI scheme

Host : localhost:8050

BasePath : /deployr

Schemes: http, https

Consumes

Produces

Users

The User APIs exist principally to facilitate user authentication with the DeployR server. Additionally, the /r/user/autosave call can be used to enable or disable autosave semantics on persistent projects for the duration of the users HTTP session.

Read more about the User APIs in the API Overview guide.

/r/user/login

This call signs the user in by authenticating the credentials with the DeployR server.

If the login fails for any reason the errorCode property in the response markup will indicate the underlying cause. See the API Response Codes section of this document for details.

Example HTTP 200 response - /r/user/login

{
  "deployr": {
    "response": {
      "call": "/r/user/login",
      "success": true,
      "user": {
        "username": "george",
        "displayname": "George Best",
        "permissions": {
            "scriptManager": true,
            "powerUser": true,
            "packageManager": true,
            "administrator": false,
            "basicUser": true
        },
        "cookie": null
      },
      "limits": {
        "maxIdleLiveProjectTimeout": 1800,
        "maxConcurrentLiveProjectCount": 170,
        "maxFileUploadSize": 268435456
      },
      "uid": "UID-5CB911405DC6EB0F8E283990F7969E63",
      "X-XSRF-TOKEN": "53708abe-c5c2-4091-9ced-6314d49de0a3"
    }
  }
}

POST /r/user/login

Method

POST

Parameters:

Type Name Description Schema Default
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData username
required
specifies the username string
formData password
required
specifies the password string
formData disableautosave disables autosave semantics for persistent projects boolean

Responses

HTTP Code Description Schema
200 Success UserLoginResponse
400 Bad Request: invalid data on call string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
940 Credentials provided could not be authenticated. string
default Error ErrorResponse

Consumes

/r/user/logout

This call signs out the currently authenticated user.

Example HTTP 200 response - /r/user/logout

{
  "deployr": {
    "response": {
      "call": "/r/user/logout",
      "success": true,
      "uid": "UID-5CB911405DC6EB0F8E283990F7969E63"
    }
  }
}

POST /r/user/logout

Method

POST

Parameters:

Type Name Description Schema Default
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData usercookie when specified, value sets application-specific persistent user cookie, which is retrievable on response to /r/user/login call.
string

Responses

HTTP Code Description Schema
200 Success UserLogoutResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

Security

Type Name Description Scopes
header X-XSRF-TOKEN specifies the cross site request forgery (CSRF) token to be sent
header Cookie:JSESSIONID specifies the JSESSIONID cookie for cookie-based authentication management.

Example: JSESSIONID=3F7D4E68CE86DBA8EC95FE723821A7B1 |

/r/user/about

This call retrieves details about the currently authenticated user. The details returned in the response markup on this call are exactly the same details as those returned in the response markup on the /r/user/login call.

Example HTTP 200 response - /r/user/about

{
  "deployr": {
    "response": {
      "call": "/r/user/about",
      "success": true,
      "user": {
        "username": "george",
        "displayname": "George Best",
        "permissions": {
            "scriptManager": true,
            "powerUser": true,
            "packageManager": true,
            "administrator": false,
            "basicUser": true
        },
        "cookie": null
      },
      "limits": {
        "maxIdleLiveProjectTimeout": 1800,
        "maxConcurrentLiveProjectCount": 170,
        "maxFileUploadSize": 268435456
      },
      "uid": "UID-5CB911405DC6EB0F8E283990F7969E63",
      "X-XSRF-TOKEN": "53708abe-c5c2-4091-9ced-6314d49de0a3"  
    }
  }
}

POST /r/user/about

Method

POST

Parameters:

Type Name Description Schema Default
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)

Responses

HTTP Code Description Schema
200 Success UserAboutResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/user/autosave

This call enables or disables the autosave semantics on persistent projects for the duration of the current users HTTP session. By default, all live persistent projects are autosaved under the following conditions:

Example HTTP 200 response - /r/user/autosave

{
  "deployr": {
    "response": {
      "call": "/r/user/autosave",
      "success": true,
      "user": {
        "username": "george",
        "displayname": "George Best",
        "permissions": {
            "scriptManager": true,
            "powerUser": true,
            "packageManager": true,
            "administrator": false,
            "basicUser": true
        },
        "cookie": null
      },
      "limits": {
        "maxIdleLiveProjectTimeout": 1800,
        "maxConcurrentLiveProjectCount": 170,
        "maxFileUploadSize": 268435456
      },
      "uid": "UID-5CB911405DC6EB0F8E283990F7969E63"
    }
  }
}

POST /r/user/autosave

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData enable toggles autosave semantics for persistent projects. boolean

Responses

HTTP Code Description Schema
200 Success UserAutoSaveResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/user/release

This call releases server-wide grid resources held by the currently authenticated user.

Typically a call to /r/project/close is required to shutdown a specific live R session. Closing the project releases all grid resources associated with the project. However, that call requires the user to be connected on the same HTTP session where the project was originally created. In the event of a network connection failure, for example, in many cases the client will no longer be able to establish a connection on the original HTTP session. As such, the only way those grid resources will be released is when the idle timeout for the project is finally reached, at which point, the resources will be automatically reclaimed by the server.

As the idle timeout period can be arbitrarily long (per Admin Console Server Policies) this call is provided so client applications can take back control and actively release server-wide grid resources on demand. This is particularly useful when a user acquires a large amount of grid resources, for example, when using the /r/project/pool feature.

Example HTTP 200 response - /r/user/release

{
  "deployr": {
    "response": {
      "call": "/r/user/release",
      "success": true,
      "whoami": "george",
      "uid": "UID-5CB911405DC6EB0F8E283990F7969E63"
    }
  }
}

POST /r/user/release

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)

Responses

HTTP Code Description Schema
200 Success UserReleaseResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

Jobs

The Job APIs facilitate working with DeployR-managed jobs. Jobs support the execution of commands in the background on behalf of users. Jobs can be submitted for immediate background execution or scheduled for execution at some later date or on a recurring basis. Priorities can be set. And the you can query the status of your jobs and get job results using these APIs.

Read more about the Jobs APIs in the API Overview guide.

/r/job/list

This call lists jobs for the currently authenticated user.

The openonly parameter allows the caller to see only thosejobs in an open state. The set of job open states are shown here:

Example HTTP 200 response - /r/job/list

{
  "deployr": {
    "response": {
      "call": "/r/job/list",
      "success": true,
      "jobs": [
       {
            "job": "JOB-e202f4f3-e24f-4d5d-b0cf-fda8912fbaca",
            "name": "Scheduled Analysis",
            "descr": "Demonstrates job scheduling."
            "schedstart": 1378334640000,
            "schedrepeat": 0,
            "schedinterval": 60000,
            "onrepeat": 0,
            "priority": "medium",
            "tag": null,
            "timeStart": 0,
            "timeCode": 0,
            "timeTotal": 0,
            "status": "Scheduled",
            "statusMsg": null,
            "project": null
        },
        {
            "job": "JOB-91baaca8-574d-4703-b225-97e64ec63e70",
            "name": "Submitted Analysis",
            "descr": "Demonstrates job submission."
            "schedstart": 0,
            "schedrepeat": 0,
            "schedinterval": 0,
            "priority": "low",
            "onrepeat": 0,
            "tag": null,
            "timeStart": 1378327215176,
            "timeCode": 102,
            "timeTotal": 537,
            "status": "Completed",
            "statusMsg": "Job successfully executed to completion.",
            "project": "PROJECT-91baaca8-574d-4703-b225-97e64ec63e70"
        }                
      ],
      "uid": "5CB911405DC6EB0F8E283990F7969E63"
    }
  }
}

GET /r/job/list

Method

GET

Parameters:

Type Name Description Schema Default
query format
required
specifies markup encoding on call (json or xml). enum (json, xml)
query openonly if `true`, only jobs in an open-state are listed in the response markup.
boolean
query extended if `true`, additional data properties describing each job are listed in the response markup.
boolean

Responses

HTTP Code Description Schema
200 Success JobListResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/job/submit

This call submits a job for background execution on behalf of the user. To submit the execution of an arbitrary block of R code the caller must provide a value on the code parameter.

To submit the execution of a single repository-managed script the caller must provide parameter values for rscriptname, rscriptauthor and optionally rscriptdirectory and rscriptversion. To submit the execution of a chain of repository-managed scripts the caller must provide a comma-separated list of values on the rscriptname , rscriptauthor and optionally rscriptdirectory and rscriptversion parameters. To submit the execution of a single external script the caller must provide a valid URL or file path using the externalsource parameter. To submit the execution of a chain of external scripts the caller must provide a comma -separated list of values on the externalsource parameter. Note, to submit the execution of an external script the caller must have been granted the POWER_USER role.

Note: A chained execution executes each of the scripts identified on the call in a sequential fashion on the R session for the job, with execution occurring in the order specified on the parameter list.

Please see the Standard Execution Model section in this guide for further details about the parameters on this call.

Example HTTP 200 response - /r/job/submit

{
  "deployr": {
    "response": {
      "call": "/r/job/submit",
      "success": true,
      "job": {
        "job": "JOB-e202f4f3-e24f-4d5d-b0cf-fda8912fbaca",
        "name": "Scheduled Analysis",
        "descr": "Demonstrates job scheduling."
        "schedstart": 1378334640000,
        "schedrepeat": 0,
        "schedinterval": 60000,
        "onrepeat": 0,
        "priority": "medium",
        "tag": null,
        "timeStart": 0,
        "timeCode": 0,
        "timeTotal": 0,
        "status": "Scheduled",
        "statusMsg": null,
        "project": null
      },
      "uid": "5CB911405DC6EB0F8E283990F7969E63"
    }
  }
}

POST /r/job/submit

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData name
required
job name string
formData descr job description string
formData code R code to execute on job string
formData rscriptname comma-separated list of repository-managed script filenames to execute on job string
formData rscriptdirectory comma-separated list of repository-managed directories for scripts, defaults to root string
formData rscriptauthor comma-separated list of authors, one author per rscriptname string
formData rscriptversion comma-separated list of versions, one version per rscriptname string
formData externalsource comma-separated list of authors, one author per rscriptname string
formData inputs DeployR-encoded inputs string
formData csvinputs comma-separated list of primitive name/value inputs string
formData preloadbydirectory comma-separated list of repository directory names string
formData preloadfilename comma-separated list of repository filenames string
formData preloadfiledirectory comma-separated list of directories, one directory per preloadfilename string
formData preloadfileauthor comma-separated list of authors, one author per preloadfilename string
formData preloadfileversion comma-separated list of versions, one version per preloadfilename string
formData preloadobjectname comma-separated list of repository object (.rData) filenames string
formData preloadobjectdirectory comma-separated list of directories, one directory per preloadobjectname string
formData preloadobjectauthor comma-separated list of authors, one author per preloadobjectname string
formData preloadobjectversion comma-separated list of versions, one version per preloadobjectname string
formData adoptworkspace identifies project whose workspace is to be adopted string
formData adoptdirectory identifies project whose directory is to be adopted string
formData adoptpackages identifies project whose package dependencies are to be adopted string
formData cluster identifies a grid node cluster for targeted execution string
formData priority specifies the scheduling priority for the job low (default), medium or high string
formData tag specifies a tag that labels the execution string
formData echooff if `true` R commands will not appear in the console output saved on the project execution history for the job
boolean
formData consoleoff if `true` console output is not saved on the project execution history for the job
boolean
formData artifactsoff when enabled, artfiacts generated in the working directory are neither cached to the database nor reported in the response markup boolean
formData enableConsoleEvents if `true` console events are delivered on the event stream when the job executes
boolean
formData graphics specifies preferred R graphics device for execution (png or svg) string
formData graphicswidth specifies preferred width for R graphics device images integer
formData graphicsheight specifies preferred height for R graphics device images integer
formData storefile comma-separated list of working directory filenames string
formData storeobject comma-separated list of workspace object names string
formData storeworkspace filename (.rData) where workspace contents will be saved in the repository string
formData storedirectory repository directory for stored files and objects after the execution completes, defaults to root string
formData storenewversion if `true`, ensures each file stored in repository results in new version being created if needed
boolean
formData storepublic if `true`, publishes each file stored in the repository
boolean
formData storenoproject if `true`, no project persistence following job execution
boolean

Responses

HTTP Code Description Schema
200 Success JobSubmitResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/job/schedule

This call schedules a job for background execution on behalf of the user.

The schedstart parameter identifies the start time for the job. This parameter value is specified as UTC in milliseconds. The schedrepeat parameter indicates the number of times the job is to be repeated, and if omitted the job is executed just once. The schedinterval parameter indicates the interval, measured in milliseconds, between repeat executions.

To schedule the execution of an arbitrary block of R code the caller must provide a value on the code parameter.

To schedule the execution of a single repository-managed script the caller must provide parameter values for rscriptname , rscriptauthor and optionally rscriptdirectory and rscriptversion. To schedule the execution of a chain of repository-managed scripts the caller must provide a comma-separated list of values on the rscriptname, rscriptauthor and optionally rscriptdirectory and rscriptversion parameters.

To schedule the execution of a single external script the caller must provide a valid URL or file path using the externalsource parameter. To schedule the execution of a chain of external scripts the caller must provide a comma-separated list of values on the externalsource parameter. Note, to schedule the execution of an external script the caller must have been granted the POWER_USER role.

Note: A chained execution executes each of the scripts identified on the call in a sequential fashion on the R session for the job, with execution occurring in the order specified on the parameter list.

Please see the Standard Execution Model section in this guide for further details about the parameters on this call.

Example HTTP 200 response - /r/job/schedule

{
  "deployr": {
    "response": {
      "call": "/r/job/schedule",
      "success": true,
      "job": {
        "job": "JOB-91baaca8-574d-4703-b225-97e64ec63e70",
        "name": "Scheduled Analysis",
        "descr": "Demonstrates job scheduling."
        "schedstart": 1316751060000,
        "schedrepeat": 2,
        "schedinterval": 86400000,
        "onrepeat": 0,
        "priority": "low",
        "tag": null,
        "timeStart": 0,
        "timeCode": 0,
        "timeTotal": 0,
        "status": "Scheduled",
        "statusMsg": null,
        "project": null
      },
      "uid": "5CB911405DC6EB0F8E283990F7969E63"
    }
  }
}

POST /r/job/schedule

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData name
required
job name string
formData descr job description string
formData code R code to execute on job string
formData rscriptname comma-separated list of repository-managed script filenames to execute on job string
formData rscriptdirectory comma-separated list of repository-managed directories for scripts, defaults to root string
formData rscriptauthor comma-separated list of authors, one author per rscriptname string
formData rscriptversion comma-separated list of versions, one version per rscriptname string
formData externalsource comma-separated list of authors, one author per rscriptname string
formData inputs DeployR-encoded inputs string
formData csvinputs comma-separated list of primitive name/value inputs string
formData preloadbydirectory comma-separated list of repository directory names string
formData preloadfilename comma-separated list of repository filenames string
formData preloadfiledirectory comma-separated list of directories, one directory per preloadfilename string
formData preloadfileauthor comma-separated list of authors, one author per preloadfilename string
formData preloadfileversion comma-separated list of versions, one version per preloadfilename string
formData preloadobjectname comma-separated list of repository object (.rData) filenames string
formData preloadobjectdirectory comma-separated list of directories, one directory per preloadobjectname string
formData preloadobjectauthor comma-separated list of authors, one author per preloadobjectname string
formData preloadobjectversion comma-separated list of versions, one version per preloadobjectname string
formData adoptworkspace identifies project whose workspace is to be adopted string
formData adoptdirectory identifies project whose directory is to be adopted string
formData adoptpackages identifies project whose package dependencies are to be adopted string
formData cluster identifies a grid node cluster for targeted execution string
formData priority specifies the scheduling priority for the job low (default), medium or high string
formData tag specifies a tag that labels the execution string
formData echooff if `true` R commands will not appear in the console output saved on the project execution history for the job
boolean
formData consoleoff if `true` console output is not saved on the project execution history for the job
boolean
formData artifactsoff when enabled, artfiacts generated in the working directory are neither cached to the database nor reported in the response markup boolean
formData enableConsoleEvents if `true` console events are delivered on the event stream when the job executes
boolean
formData graphics specifies preferred R graphics device for execution (png or svg) string
formData graphicswidth specifies preferred width for R graphics device images integer
formData graphicsheight specifies preferred height for R graphics device images integer
formData storefile comma-separated list of working directory filenames string
formData storeobject comma-separated list of workspace object names string
formData storeworkspace filename (.rData) where workspace contents will be saved in the repository string
formData storedirectory repository directory for stored files and objects after the execution completes, defaults to root string
formData storenewversion if `true`, ensures each file stored in repository results in new version being created if needed
boolean
formData storepublic if `true`, publishes each file stored in the repository
boolean
formData storenoproject if `true`, no project persistence following job execution
boolean

Responses

HTTP Code Description Schema
200 Success JobScheduleResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/job/query

This call queries the job status. The status property will indicate one of the following values:

Example HTTP 200 response - /r/job/query

{
  "deployr": {
    "response": {
      "call": "/r/job/query",
      "success": true,
      "job": {
        "job": "JOB-91baaca8-574d-4703-b225-97e64ec63e70",
        "name": "Scheduled Analysis",
        "descr": "Demonstrates job scheduling."
        "schedstart": 1316751060000,
        "schedrepeat": 2,
        "schedinterval": 86400000,
        "onrepeat": 0,
        "priority": "low",
        "tag": null,
        "timeStart": 0,
        "timeCode": 0,
        "timeTotal": 0,
        "status": "Scheduled",
        "statusMsg": null,
        "project": null
      }
      "uid": "5CB911405DC6EB0F8E283990F7969E63"
    }
  }
}

GET /r/job/query

Method

GET

Parameters:

Type Name Description Schema Default
query format
required
specifies markup encoding on call (json or xml). enum (json, xml)
query job
required
specifies a comma-separated list of job identifiers. string
query extended if `true`, additional data properties describing each job are listed in the response markup.
boolean

Responses

HTTP Code Description Schema
200 Success JobQueryResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/job/cancel

This call cancels the specified job.

Only jobs in an open-state can be cancelled. The set of job open-states are shown here:

Example HTTP 200 response - /r/job/cancel

{
  "deployr": {
    "response": {
      "call": "/r/job/cancel",
      "success": true,
      "job": {
        "job": "JOB-91baaca8-574d-4703-b225-97e64ec63e70",
        "name": "Scheduled Analysis",
        "descr": "Demonstrates job scheduling."
        "schedstart": 1316751060000,
        "schedrepeat": 2,
        "schedinterval": 86400000,
        "onrepeat": 0,
        "priority": "low",
        "tag": null,
        "timeStart": 0,
        "timeCode": 0,
        "timeTotal": 0,
        "status": "Cancelled",
        "statusMsg": null,
        "project": null
      }
      "uid": "5CB911405DC6EB0F8E283990F7969E63"
    }
  }
}

POST /r/job/cancel

Method

POST

Parameters:

Type Name Description Schema Default
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData job
required
specifies a comma-separated list of job identifiers. string

Responses

HTTP Code Description Schema
200 Success JobCancelResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/job/delete

This call deletes the specified job.

Only jobs in one of the success, cancelled or incompleted states can be deleted. The set of states are shown here:

Jobs that are in an open-state can not be deleted.

Important! Deleting jobs will not delete the projects that resulted from those jobs.

Example HTTP 200 response - /r/job/delete

{
  "deployr": {
    "response": {
      "call": "/r/job/delete",
      "success": true
    }
  }
}

POST /r/job/delete

Method

POST

Parameters:

Type Name Description Schema Default
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData job
required
specifies a comma-separated list of job identifiers. string

Responses

HTTP Code Description Schema
200 Success JobDeleteResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

Projects

The Project APIs facilitate the management of authenticated projects and anonymous projects. There are several types of project APIs.

Read more about the Project APIs in the API Overview guide.

/r/project/create

This call creates a new project for the currently authenticated user. If the projectname parameter is specified on the call, then the newly created project will be a persistent project. If the projectname parameter is omitted on the call, then the newly created project will be a temporary project. The projectdescr parameter is ignored if the projectname parameter is omitted.

The blackbox parameter ensures that calls on the temporary project are limited to the User Blackbox API Controls.

Using the inputs, preloadfile, preloadobject and adopt parameters the project can be pre-initialized with data in the workspace and/or working directory.

The inputs parameter allows the caller to pass DeployR-encoded R object values as inputs. These inputs are turned into R objects in the workspace of the new R session before the call returns.

The csvinputs parameter allows the caller to pass R object primitive values as comma-separated name/value pairs. These inputs are turned into R objects in the workspace before the execution begins.

The preloadbydirectory parameter allows the caller to load all files within one or more repository-managed directories into the working directory before the call returns.

The set of preloadfile parameters allow the caller to load one or more files from the repository into the working directory of the new R session before the call returns.

The set of preloadobject parameters allow the caller to load one or more binary R objects (.rData) from the repository into the workspace of the new R session before the call returns.

The set of adopt parameters allow the caller to load a pre-existing project workspace, project working directory and/or project package dependencies into the new R session before the call returns.

Example HTTP 200 response - /r/project/create

{ 
  "deployr": { 
    "response": { 
      "success": true,
      "call: "/r/project/create",
      "uid": "UID-1e518408953d7920e1d7ae261694091c",
      "project": { 
        "project": "PROJECT-2dfb6321-dfa4-431c-88c2-7f7d144865b4",
        "name": null,
        "descr": null,
        "longdescr": null,
        "live": true,
        "shared": false,
        "cookie": null,
        "origin": "Project original.",
        "author": "testuser",
        "authors: [ "testuser" ],
        "lastmodified": 1466396262531 
      } 
    } 
  }
}

POST /r/project/create

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData cluster identifies a grid node cluster for targeted execution string
formData projectname names a new persistent project string
formData projectdescr describes a new persistent project string
formData blackbox when enabled, a temporary project is limited to user blackbox API controls boolean false
formData inputs DeployR-encoded inputs string
formData csvinputs comma-separated list of primitive name/value inputs string
formData preloadbydirectory comma-separated list of repository directory names string
formData preloadfilename comma-separated list of repository filenames string
formData preloadfiledirectory comma-separated list of directories, one directory per preloadfilename string
formData preloadfileauthor comma-separated list of authors, one author per preloadfilename string
formData preloadfileversion comma-separated list of versions, one version per preloadfilename string
formData preloadobjectname comma-separated list of repository object (.rData) filenames string
formData preloadobjectdirectory comma-separated list of directories, one directory per preloadobjectname string
formData preloadobjectauthor comma-separated list of authors, one author per preloadobjectname string
formData preloadobjectversion comma-separated list of versions, one version per preloadobjectname string
formData adoptworkspace identifies project from which workspace is to be adopted string
formData adoptdirectory identifies project from which directory is to be adopted string
formData adoptpackages identifies project from which package dependencies are to be adopted string

Responses

HTTP Code Description Schema
200 Success ProjectResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/pool

This call creates a pool of temporary projects for the currently authenticated user.

The blackbox parameter ensures that calls on each project in the pool are limited to the User Blackbox API Controls.

Using the inputs, preloadfile, preloadobject and adopt parameters each project in the pool can be pre-initialized with data in the workspace and/or working directory.

The inputs parameter allows the caller to pass DeployR-encoded R object values as inputs. These inputs are turned into R objects in the workspace of the new R session before the call returns.

The csvinputs parameter allows the caller to pass R object primitive values as comma-separated name/value pairs. These inputs are turned into R objects in the workspace before the execution begins.

The preloadbydirectory parameter allows the caller to load all files within one or more repository-managed directories into the working directory before the call returns.

The set of preloadfile parameters allow the caller to load one or more files from the repository into the working directory of the new R session before the call returns.

The set of preloadobject parameters allow the caller to load one or more binary R objects (.rData) from the repository into the workspace of the new R session before the call returns.

The set of adopt parameters allow the caller to load a pre-existing project workspace, project working directory and/or project package dependencies into the new R session before the call returns.

Example HTTP 200 response - /r/project/pool

{  
   "deployr":{  
      "response":{  
         "call":"/r/project/pool",
         "success":true,
         "projects":[  
            {  
               "project":"PROJECT-cc5434fc-3c8c-426d-a2a3-f2d9d8c978d5",
               "name":null,
               "descr":null,
               "longdescr":null,
               "author":"george",
               "authors":[  
                  "george"
               ],
               "shared":false,
               "lastmodified":1378586882974,
               "live":true,
               "cookie":null,
               "origin":"Project original."
            },
            {  
               "project":"PROJECT-5f4034f4-35d1-4020-8873-41186d71caa8",
               "name":null,
               "descr":null,
               "longdescr":null,
               "author":"george",
               "authors":[  
                  "george"
               ],
               "shared":false,
               "lastmodified":1378586883040,
               "live":true,
               "cookie":null,
               "origin":"Project original."
            },
            {  
               "project":"PROJECT-89004460-a4c8-40f1-98a9-d4cf4d423095",
               "name":null,
               "descr":null,
               "longdescr":null,
               "author":"george",
               "authors":[  
                  "george"
               ],
               "shared":false,
               "lastmodified":1378586883109,
               "live":true,
               "cookie":null,
               "origin":"Project original."
            }
         ],
         "httpcookie":"0873555DFCB6B083C61B6C4FECF2C3BA"
      }
   }
}

POST /r/project/pool

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData poolsize
required
the preferred size of the pool of temporary projects string
formData cluster identifies a grid node cluster for targeted execution string
formData blackbox when enabled, a temporary project is limited to user blackbox API controls boolean false
formData inputs DeployR-encoded inputs string
formData csvinputs comma-separated list of primitive name/value inputs string
formData preloadbydirectory comma-separated list of repository directory names string
formData preloadfilename comma-separated list of repository filenames string
formData preloadfiledirectory comma-separated list of directories, one directory per preloadfilename string
formData preloadfileauthor comma-separated list of authors, one author per preloadfilename string
formData preloadfileversion comma-separated list of versions, one version per preloadfilename string
formData preloadobjectname comma-separated list of repository object (.rData) filenames string
formData preloadobjectdirectory comma-separated list of directories, one directory per preloadobjectname string
formData preloadobjectauthor comma-separated list of authors, one author per preloadobjectname string
formData preloadobjectversion comma-separated list of versions, one version per preloadobjectname string
formData adoptworkspace identifies project from which workspace is to be adopted string
formData adoptdirectory identifies project from which directory is to be adopted string
formData adoptpackages identifies project from which package dependencies are to be adopted string

Responses

HTTP Code Description Schema
200 Success ProjectListResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/recycle

This call recycles the R session associated with the project by deleting all R objects from the workspace and all files from the working directory.

Recycling a project is a convenient and efficient alternative to starting over by closing an existing project and then creating a new project.

Example HTTP 200 response - /r/project/recycle

{ 
  "deployr": { 
    "response": { 
      "success": true,
      "call: "/r/project/recyle",
      "uid": "UID-1e518408953d7920e1d7ae261694091c",
      "project": { 
        "project": "PROJECT-2dfb6321-dfa4-431c-88c2-7f7d144865b4",
        "name": null,
        "descr": null,
        "longdescr": null,
        "live": true,
        "shared": false,
        "cookie": null,
        "origin": "Project original.",
        "author": "testuser",
        "authors: [ "testuser" ],
        "lastmodified": 1466396262531 
      } 
    } 
  }
}

POST /r/project/recycle

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData project
required
specifies the project identifier string
formData preserveworkspace if `true`, the objects in the workspace are preserved on refresh
boolean
formData preservedirectory if `true`, the files in the working directory are preserved on refresh
boolean

Responses

HTTP Code Description Schema
200 Success ProjectResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/list

This call lists all projects owned by the currently authenticated user and/or all projects shared by other users.

Shared projects are available as read-only projects to the caller. The shared or private nature of a project can be controlled using the /r/project/about/update call.

Example HTTP 200 response - /r/project/list

{
  "deployr": {
    "response": {
      "call": "/r/project/list",
      "success": true,
      "uid": "UID-1e518408953d7920e1d7ae261694091c",
      "projects": [ 
        {
            "project": "PROJECT-e2edd15f-dd67-42f6-8d82-90a2a5a669ca",
            "name": "Demo Analysis",
            "descr": "Predicting retail sales.",
            "longdescr": null,
            "author": "george",
            "authors": [
                "george"
            ],
            "shared": false,
            "lastmodified": 1378307321841,
            "live": false,
            "cookie": null,
            "origin": "Project original."
        },
        {
            "project": "PROJECT-8aaa65ab-db33-4a28-b351-579705f5ead9",
            "name": "Demo Graphics",
            "descr": null,
            "longdescr": null,
            "author": "george",
            "authors": [
                "george"
            ],
            "shared": false,
            "lastmodified": 1378307321842,
            "live": false,
            "cookie": null,
            "origin": "Project original."
        }
      ]
    }
  }
}

GET /r/project/list

Method

GET

Parameters:

Type Name Description Schema Default
query format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData sharedprojectsalso when `true`, the project response list contains the caller’s projects plus projects shared by other users
boolean
formData sharedprojectsonly when `true`, the project response list contains only projects shared by other users and not the users’s own projects
boolean
formData isordered when `true`, the project response list is ordered in a most-recently-modified first order. Otherwise the list is ordered chronologically by creation date
boolean

Responses

HTTP Code Description Schema
200 Success ProjectListResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/ping

This call pings the specified project to determine if the project is live on the DeployR grid.

Example HTTP 200 response - /r/project/ping

{
  "deployr": {
    "response": {
      "call": "/r/project/ping",
      "success": true,
      "uid": "UID-1e518408953d7920e1d7ae261694091c",
      "project": {
        "project": "PROJECT-e2edd15f-dd67-42f6-8d82-90a2a5a669ca",
        "name": "Demo Analysis",
        "descr": "Predicting retail sales."
        "longdescr": null,
        "author": "george",
        "authors": [
            "george"
        ],
        "shared": false,
        "lastmodified": 1378307626647,
        "live": false,
        "cookie": null,
        "origin": "Project original."
      }
    }
  }
}

GET /r/project/ping

Method

GET

Parameters:

Type Name Description Schema Default
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData project
required
specifies the project identifier string

Responses

HTTP Code Description Schema
200 Success ProjectResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/about

This call retrieves a set of properties that describe the specified project.

Example HTTP 200 response - /r/project/about

{
  "deployr": {
    "response": {
      "success": true,
      "call": "/r/project/about",
      "uid": "UID-1e518408953d7920e1d7ae261694091c",
      "project": {
        "project": "PROJECT-e2edd15f-dd67-42f6-8d82-90a2a5a669ca",
        "name": "Demo Analysis",
        "descr": "Predicting retail sales."
        "longdescr": null,
        "author": "george",
        "authors": [
          "george"
        ],
        "shared": false,
        "lastmodified": 1378307713478,
        "live": false,
        "cookie": null,
        "origin": "Project original."
      }
    }
  }
}

GET /r/project/about

Method

GET

Parameters:

Type Name Description Schema Default
query format
required
specifies markup encoding on call (json or xml). enum (json, xml)
query project
required
specifies the project identifier string

Responses

HTTP Code Description Schema
200 Success ProjectResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/about/update

This call updates a set of properties that describe the specified project.

Example HTTP 200 response - /r/project/about/update

{
  "deployr": {
    "response": {
      "success": true,
      "call": "/r/project/about/update",
      "uid": "UID-1e518408953d7920e1d7ae261694091c",
      "project": {
        "project": "PROJECT-e2edd15f-dd67-42f6-8d82-90a2a5a669ca",
        "name": "Demo Analysis",
        "descr": "Predicting retail sales, updated."
        "longdescr": null,
        "author": "george",
        "authors": [
          "george"
        ],
        "shared": false,
        "lastmodified": 1378307713478,
        "live": false,
        "cookie": null,
        "origin": "Project original."
      }
    }
  }
}

POST /r/project/about/update

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData project
required
specifies the project identifier string
formData name
required
specifies the project name string
formData descr specifies the project description string
formData longdescr specifies the project long description string
formData shared if `true`, specifies that the project is a shared project
boolean
formData projectcookie specifies a client-application specific project cookie string

Responses

HTTP Code Description Schema
200 Success ProjectResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/save

This call saves the persistent state of the specified project.

The set of drop parameters allows the caller to selectively drop aspects, such as workspace, working directory, or execution history of the project state when saving. The flushhistory parameter allows the caller to preserve the project execution history itself while destroying all generated console output and results associated with that history.

Example HTTP 200 response - /r/project/save

{
  "deployr": {
    "response": {
      "call": "/r/project/save",
      "success": true,
      "uid": "UID-1e518408953d7920e1d7ae261694091c",
      "project": {
        "project": "PROJECT-e2edd15f-dd67-42f6-8d82-90a2a5a669ca",
        "name": "Demo Analysis",
        "descr": "Predicting retail sales, saved."
        "longdescr": null,
        "author": "george",
        "authors": [
            "george"
        ],
        "shared": false,
        "lastmodified": 1378307626647,
        "live": false,
        "cookie": null,
        "origin": "Project original."
      }
    }
  }
}

POST /r/project/save

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData project
required
specifies project identifier string
formData descr specifies the project description string
formData longdescr specifies the project long description string
formData shared if `true`, specifies that the project is a shared project
boolean false
formData projectcookie specifies a client-application specific project cookie string
formData dropworkspace if `true`, the content of the project’s workspace is dropped on save
boolean false
formData dropdirectory if `true`, the content of the project’s working directory is dropped on save
boolean false
formData drophistory if `true`, the project’s execution history is dropped on save
boolean false
formData flushhistory if `true`, the project’s execution history is flushed on save
boolean false

Responses

HTTP Code Description Schema
200 Success ProjectResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/saveas

This call saves the persistent state of the specified project to a new persistent project. The set of drop parameters allows the caller to selectively drop aspects, such as workspace, working directory, or execution history of the project state when saving. The flushhistory parameter allows the caller to preserve the project execution history itself while destroying all generated console output and results associated with that history.

Example HTTP 200 response - /r/project/saveas

{
  "deployr": {
    "response": {
      "call": "/r/project/save",
      "success": true,
      "uid": "UID-1e518408953d7920e1d7ae261694091c",
      "project": {
        "project": "PROJECT-e2edd15f-dd67-42f6-8d82-90a2a5a669ca",
        "name": "Demo Analysis Snapshot",
        "descr": "Predicting retail sales, snapshot September 4, 2013."
        "longdescr": null,
        "author": "george",
        "authors": [
            "george"
        ],
        "shared": false,
        "lastmodified": 1378307626647,
        "live": false,
        "cookie": null,
        "origin": "Project copied from project named,  Demo Analysis."
      }
    }
  }
}

POST /r/project/saveas

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData project
required
specifies project identifier string
formData name
required
specifies the new project name string
formData descr specifies the project description string
formData longdescr specifies the project long description string
formData shared if `true`, specifies that the project is a shared project
boolean false
formData projectcookie specifies a client-application specific project cookie string
formData dropworkspace if `true`, the content of the project’s workspace is dropped when saving to the new project
boolean false
formData dropdirectory if `true`, the content of the project’s working directory is dropped when saving to the new project
boolean false
formData drophistory if `true`, the project’s execution history is dropped when saving to the new project
boolean false
formData flushhistory if `true`, the project’s execution history is flushed on saving to the new project
boolean false

Responses

HTTP Code Description Schema
200 Success ProjectResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/close

This call closes the specified project.

Closing a live project releases all resources associated with the project on the DeployR grid. If the specified project is a persistent project then the default autosave semantics will cause the project to be saved automatically. The caller can override that default behavior using the disableautosave parameter.

The set of drop parameters allow the caller to selectively drop aspects, such as workspace, working directory, or execution history, of the project state when closing. The flushhistory parameter allows the caller to preserve the project execution history itself while destroying all generated console output and results associated with that history

Example HTTP 200 response - /r/project/close

 {
     "deployr": {
         "response": {
             "call": "/r/project/close",
             "success": true,
             "uid": "UID-1e518408953d7920e1d7ae261694091c",
             "project": {
                 "project": "PROJECT-e2edd15f-dd67-42f6-8d82-90a2a5a669ca",
                 "name": "Demo Analysis",
                 "descr": "Predicting retail sales, updated."
                 "longdescr": null,
                 "author": "george",
                 "authors": [
                     "george"
                 ],
                 "shared": false,
                 "lastmodified": 1378307912517,
                 "cookie": null,
                 "origin": "Project original."
             }
         }
     }
 }       

POST /r/project/close

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData project
required
specifies project identifier string
formData disableautosave if `true`, the default autosave semantics for persistent projects are disabled
boolean false
formData dropworkspace if `true`, the content of the project’s workspace is dropped on close
boolean false
formData dropdirectory if `true`, the content of the project’s working directory is dropped on close
boolean false
formData drophistory if `true`, the project’s execution history is dropped on close
boolean false
formData flushhistory if `true`, the project’s execution history is flushed on close
boolean false

Responses

HTTP Code Description Schema
200 Success ProjectResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/grant

This call grants authorship of the specified project to other users.

Refer to the section Introducing Projects for a detailed description of project collaboration and the workflows facilitated by grants.

Example HTTP 200 response - /r/project/grant

{
  "deployr": {
    "response": {
      "call": "/r/project/grant",
      "success": true,
      "uid": "UID-1e518408953d7920e1d7ae261694091c",
      "project": {
        "project": "PROJECT-e2edd15f-dd67-42f6-8d82-90a2a5a669ca",
        "name": "Demo Analysis",
        "descr": "Predicting retail sales, updated."
        "longdescr": null,
        "author": "george",
        "authors": [
            "george"
        ],
        "shared": false,
        "lastmodified": 1378307626647,
        "live": false,
        "cookie": null,
        "origin": "Project original."
      }
    }
  }
}

POST /r/project/grant

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml) json
formData project
required
specifies project identifier string
formData newauthor
required
specifies a comma-separated list of usernames indicating the new owners string

Responses

HTTP Code Description Schema
200 Success ProjectResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/import

This call imports the specified project archive as a new persistent project.

Example HTTP 200 response - /r/project/import

{
  "deployr": {
    "response": {
      "call": "/r/project/import",
      "success": true,
      "uid": "UID-1e518408953d7920e1d7ae261694091c",
      "project": {
        "project": "PROJECT-e2edd15f-dd67-42f6-8d82-90a2a5a669ca",
        "name": "Sample Sales Projects (Import)",
        "descr": "Import of latests sales projections."
        "longdescr": null,
        "author": "george",
        "authors": [
            "george"
        ],
        "shared": false,
        "lastmodified": 1378307626647,
        "live": false,
        "cookie": null,
        "origin": "Project generated on import of project named,  Sample Sales Projects."
      }
    }
  }
}

POST /r/project/import

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData name
required
specifies the name of the project archive file string
formData descr specifies a description for the newly imported project string
formData file
required
specifies the file file

Responses

HTTP Code Description Schema
200 Success ProjectResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/export

This call exports a compressed archive file for the specified project.

The set of drop parameters allow the caller to selectively drop aspects, such as workspace, working directory, or execution history of the project state when generating the archive. The flushhistory parameter allows the caller to preserve the project execution history itself while excluding all generated console output and results associated with that history.

POST /r/project/export

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData project
required
specifies project identifier string
formData dropworkspace if true, the content of the project’s workspace is dropped on export. string
formData dropdirectory if true, the content of the project’s working directory is dropped on export. string
formData drophistory if true, the project’s execution history is dropped on export. string
formData flushhistory if true, the project’s execution history is flushed on export. string

Responses

HTTP Code Description Schema
200 Success string
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

Produces

/r/project/delete

This call deletes the specified project.

Deleting a project is a permanent operation that cannot be undone or recovered.

Refer to the section Introducing Projects for a detailed description of project collaboration and the workflows facilitated by grants.

Example HTTP 200 response - /r/project/delete

{
  "deployr": {
    "response": {
      "call": "/r/project/delete",
      "success": true,
      "uid": "UID-1e518408953d7920e1d7ae261694091c",
      "project": {
        "project": "PROJECT-e2edd15f-dd67-42f6-8d82-90a2a5a669ca",
        "name": "Demo Analysis",
        "descr": "Predicting retail sales, updated."
        "longdescr": null,
        "author": "george",
        "authors": [
            "george"
        ],
        "shared": false,
        "lastmodified": 1378307626647,
        "live": false,
        "cookie": null,
        "origin": "Project original."
      }
    }
  }
}

POST /r/project/delete

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)

Responses

HTTP Code Description Schema
200 Success ProjectResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/execute/code

This call executes a block of R code on the R session identified by the project parameter.

Please see the Standard Execution Model section in this guide for further details about the parameters on this call.

Some key data indicated in the response markup on this call:

Example HTTP 200 response - /r/project/execute/code

{
    "deployr": {
        "response": {
            "call": "/r/project/execute/code",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "interrupted": false,
            "project": {
                "project": "PROJECT-e2edd15f-dd67-42f6-8d82-90a2a5a669ca",
                "name": "Demo Analysis",
                "descr": "Predicting retail sales, updated."
                "longdescr": null,
                "author": "george",
                "authors": [
                    "george",
                    "testuser"
                ],
                "shared": false,
                "lastmodified": 1378308723041,
                "live": true,
                "cookie": null,
                "origin": "Project original."
            },
            "execution": {
                "code": "x <- c(1:50)rplot(x)rpng("namedPlot.png")rplot(x)",
                "execution": "EXEC-4d60922e-9ff8-44ec-9ac9-b358f6356c38",
                "tag": null,
                "timeStart": 1378315243221,
                "timeCode": 102,
                "timeTotal": 820,
                "actor": "george",
                "console": "n> x <- c(1:50)nn> plot(x)nn>
                png("namedPlot.png")nn> plot(x)n",
                "resultsAvailable": 1,
                "resultsGenerated": 1,
                "results": [
                    {
                        "execution": "EXEC-4d60922e-9ff8-44ec-9ac9-b358f6356c38",
                        "filename": "unnamedplot001.png",
                        "length": 6642,
                        "type": "image/png",
                        "sha256": "67ec8f704613be81c47af1bfc1c6bc5b",
                        "url": "http://184.106.178.37:7000/deployr/r/project/
                        execute/result/download/
                        PROJECT-e2edd15f-dd67-42f6-8d82-90a2a5a669ca/
                        EXEC-4d60922e-9ff8-44ec-9ac9-b358f6356c38/unnamedplot001.png"
                    }
                ],
                "artifacts": [
                    {
                        "filename": "namedPlot.png",
                        "descr": null,
                        "length": 6642,
                        "type": "image/png",
                        "project": "PROJECT-e2edd15f-dd67-42f6-8d82-90a2a5a669ca",
                        "category": "plot",
                        "lastmodified": 1378315300000
                        "url": "http://184.106.178.37:7000/deployr/r/project/
                        directory/download/
                        PROJECT-e2edd15f-dd67-42f6-8d82-90a2a5a669ca/namedPlot.png",
                    }
                ],
                "warnings": [],
                "info": [],
                "help": null,
                "interrupted": false
            },
            "workspace": {
                "objects": []
            },
            "repository": {
                "files": []
            }
        }
    }
}

POST /r/project/execute/code

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData project
required
specifies the project identifier string
formData code specifies the block of R code string
formData inputs DeployR-encoded inputs string
formData robject specifies a comma-separated list of objects for retrieval following the execution string
formData csvinputs comma-separated list of primitive name/value inputs string
formData preloadbydirectory comma-separated list of repository directory names string
formData preloadfilename comma-separated list of repository filenames string
formData preloadfiledirectory comma-separated list of directories, one directory per preloadfilename string
formData preloadfileauthor comma-separated list of authors, one author per preloadfilename string
formData preloadfileversion comma-separated list of versions, one version per preloadfilename string
formData preloadobjectname comma-separated list of repository object (.rData) filenames string
formData preloadobjectdirectory comma-separated list of directories, one directory per preloadobjectname string
formData preloadobjectauthor comma-separated list of authors, one author per preloadobjectname string
formData preloadobjectversion comma-separated list of versions, one version per preloadobjectname string
formData adoptworkspace identifies project whose workspace is to be adopted string
formData adoptdirectory identifies project whose directory is to be adopted string
formData adoptpackages identifies project whose package dependencies are to be adopted string
formData phantom if `true` the execution is treated as a phantom execution
boolean
formData tag specifies a tag that labels the execution string
formData echooff if `true` R commands will not appear in the console output saved on the project execution history for the job
boolean
formData consoleoff if `true` console output is not saved on the project execution history for the job
boolean
formData artifactsoff when enabled, artfiacts generated in the working directory are neither cached to the database nor reported in the response markup boolean
formData enableConsoleEvents if `true` console events are delivered on the event stream when the job executes
boolean
formData graphics specifies preferred R graphics device for execution (png or svg) string
formData graphicswidth specifies preferred width for R graphics device images integer
formData graphicsheight specifies preferred height for R graphics device images integer
formData storefile comma-separated list of working directory filenames string
formData storeobject comma-separated list of workspace object names string
formData storeworkspace filename (.rData) where workspace contents will be saved in the repository string
formData storedirectory repository directory for stored files and objects after the execution completes, defaults to root string
formData storenewversion if `true`, ensures each file stored in repository results in new version being created if needed
boolean
formData storepublic if `true`, publishes each file stored in the repository
boolean
formData infinity specifies custom value for Infinity appearing in R object data returned on call, otherwise Infinity is represented by 0x7ff0000000000000L
string
formData nan specifies custom value for `NaN` appearing in R object data returned on call, otherwise `NaN` is represented by `null`
string
formData encodeDataFramePrimitiveAsVector if `true`, data.frame primitives are encoded vectors in R object data returned on call
boolean

Responses

HTTP Code Description Schema
200 Success ProjectExecuteResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/execute/script

This call executes repository-managed scripts or external scripts on the R session identified by the project parameter.

To execute a single repository-managed script the caller must provide parameter values for filename, author and optionally directory and version. To execute a chain of repository-managed scripts the caller must provide a comma-separated list of values on the filename, author and optionally directory and version parameters.

To execute a single external script the caller must provide a valid URL or file path using the externalsource parameter. To execute a chain of external scripts the caller must provide a comma-separated list of values on the externalsource parameter. Note, that in order to execute an external script, the caller must have been granted the POWER_USER role.

Note: A chained execution executes each of the scripts identified on the call in a sequential fashion on the R session, with execution occurring in the order specified on the parameter list.

Please see the Standard Execution Model section in this guide for further details about the parameters on this call.

Some key data indicated in the response markup on this call:

Example HTTP 200 response - /r/project/execute/script

{
    "deployr": {
        "response": {
            "call": "/r/project/execute/script",
            "success": true
            "interrupted": false,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "project": {
                "project": "PROJECT-e2edd15f-dd67-42f6-8d82-90a2a5a669ca",
                "name": "Demo Analysis",
                "descr": "Predicting retail sales, updated."
                "longdescr": null,
                "author": "george",
                "authors": [
                    "george",
                    "testuser"
                ],
                "shared": false,
                "lastmodified": 1378308723041,
                "live": true,
                "cookie": null,
                "origin": "Project original.",
            },
            "execution": {
                "code": "# Create a vector of auto sales for each category
of vechicles. rn# The value contains the number of units sold each weekday:rn# (i.e. 1 car sold on Monday, 3 cars sold on Tuesday...)rn cars <- c(1, 3, 6, 4, 9)rntrucks <- c(2, 5, 4, 5, 12)rnsuvs <- c(4,4,6,6,16)rn rn# Create a table from the vectors.rnautos_data <- cbind(cars, trucks, suvs)rn rn# Show the the table.rn print(autos_data)rn rn# Send the plot to a file called histogram.png. rnpng("histogram.png")rn rn# Create a histogram of auto sales. rnbarplot(as.matrix(autos_data), main="Autos", ylab= "Total", beside=TRUE, col=rainbow(5))rn rn# Place the legend at the top-left corner with no frame, using rainbow colors.rnlegend("topleft", c("Mon","Tue","Wed","Thu","Fri"), cex=0.6, bty="n", fill=rainbow(5))rn# Restore the plot device.rndev.off()rn",
                "resultsAvailable": 0,
                "actor": "george",
                "tag": null,
                "interrupted": false,
                "timeStart": 1378316295608,
                "timeCode": 74
                "timeTotal": 373,
                "resultsGenerated": 0,
                "resultsAvailable": 0,
                "execution": "EXEC-38bc9824-9dc8-4d42-90d3-9cb5d9d366b1",
                "console": "n> # Create a vector of auto sales for each
category of vechicles. n> # The value contains the number of units sold each weekday:n> # (i.e. 1 car sold on Monday, 3 cars sold on Tuesday...)n> cars <- c(1, 3, 6, 4, 9)nn> trucks <- c(2, 5, 4, 5, 12)nn> suvs <- c(4,4,6,6,16)nn> # Create a table from the vectors.n> autos_data <- cbind(cars, trucks, suvs)nn> # Show the the table.n> print(autos_data)n     cars trucks suvsn[1,]    1      2    4n[2,]
    3      5    4n[3,]    6      4    6n[4,]    4      5    6n
[5,]    9     12   16nn> # Send the plot to a file called histogram.png. n> png("histogram.png")nn> # Create a histogram of auto sales.n> barplot(as.matrix(autos_data), main="Autos", ylab= "Total",  beside=TRUE, col=rainbow(5))nn> # Place the legend at the top-left corner with no frame, using rainbow colors.n> legend("topleft", c("Mon","Tue","Wed", "Thu","Fri"), cex=0.6, bty="n", fill=rainbow(5))nn> # Restore the plot device.n> dev.off()npng n  2 n",
                "results": [],
                "artifacts": [
                    {
                        "filename": "histogram.png",
                        "descr": null,
                        "length": 7285,
                        "type": "image/png",
                        "category": "plot",
                        "url": "http://184.106.178.37:7000/deployr/r/
                        project/directory/download/
                        PROJECT-e2edd15f-dd67-42f6-8d82-90a2a5a669ca/histogram.png",
                        "project": "PROJECT-e2edd15f-dd67-42f6-8d82-90a2a5a669ca",
                        "lastmodified": 1378316352000
                    }
                ],
                "warnings": [
                ]
            },
            "repository": {
                "files": []
            },
            "workspace": {
                "objects": []
            }
        }
    }
}        

POST /r/project/execute/script

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData project
required
specifies the project identifier string
formData filename comma-separated list of repository-managed script filenames string
formData directory comma-separated list of repository-managed directories for scripts, defaults to root string
formData author comma-separated list of authors, one author per filename string
formData version comma-separated list of versions, one version per filename string
formData externalsource comma-separated list of URLs or file paths to external scripts string
formData inputs DeployR-encoded inputs string
formData robject specifies a comma-separated list of objects for retrieval following the execution string
formData csvinputs comma-separated list of primitive name/value inputs string
formData preloadbydirectory comma-separated list of repository directory names string
formData preloadfilename comma-separated list of repository filenames string
formData preloadfiledirectory comma-separated list of directories, one directory per preloadfilename string
formData preloadfileauthor comma-separated list of authors, one author per preloadfilename string
formData preloadfileversion comma-separated list of versions, one version per preloadfilename string
formData preloadobjectname comma-separated list of repository object (.rData) filenames string
formData preloadobjectdirectory comma-separated list of directories, one directory per preloadobjectname string
formData preloadobjectauthor comma-separated list of authors, one author per preloadobjectname string
formData preloadobjectversion comma-separated list of versions, one version per preloadobjectname string
formData adoptworkspace identifies project whose workspace is to be adopted string
formData adoptdirectory identifies project whose directory is to be adopted string
formData adoptpackages identifies project whose package dependencies are to be adopted string
formData phantom if `true` the execution is treated as a phantom execution
boolean
formData tag specifies a tag that labels the execution string
formData echooff if `true` R commands will not appear in the console output saved on the project execution history for the job
boolean
formData consoleoff if `true` console output is not saved on the project execution history for the job
boolean
formData artifactsoff when enabled, artfiacts generated in the working directory are neither cached to the database nor reported in the response markup boolean
formData enableConsoleEvents if `true` console events are delivered on the event stream when the job executes
boolean
formData graphics specifies preferred R graphics device for execution (png or svg) string
formData graphicswidth specifies preferred width for R graphics device images integer
formData graphicsheight specifies preferred height for R graphics device images integer
formData storefile comma-separated list of working directory filenames string
formData storeobject comma-separated list of workspace object names string
formData storeworkspace filename (.rData) where workspace contents will be saved in the repository string
formData storedirectory repository directory for stored files and objects after the execution completes, defaults to root string
formData storenewversion if `true`, ensures each file stored in repository results in new version being created if needed
boolean
formData storepublic if `true`, publishes each file stored in the repository
boolean
formData infinity specifies custom value for Infinity appearing in R object data returned on call, otherwise Infinity is represented by 0x7ff0000000000000L
string
formData nan specifies custom value for `NaN` appearing in R object data returned on call, otherwise `NaN` is represented by `null`
string
formData encodeDataFramePrimitiveAsVector if `true`, data.frame primitives are encoded vectors in R object data returned on call
boolean

Responses

HTTP Code Description Schema
200 Success ProjectExecuteResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/execute/interrupt

This call interrupts the current execution on specified project.

Example HTTP 200 response - /r/project/execute/interrupt

{
  "deployr": {
    "response": {
      "call": "/r/project/execute/interrupt",
      "success": true,
      "uid": "UID-1e518408953d7920e1d7ae261694091c",
      "project": {
        "project": "PROJECT-e2edd15f-dd67-42f6-8d82-90a2a5a669ca",
        "name": "Demo Analysis",
        "descr": "Predicting retail sales, updated."
        "longdescr": null,
        "author": "george",
        "authors": [
            "george"
        ],
        "shared": false,
        "lastmodified": 1378307626647,
        "live": false,
        "cookie": null,
        "origin": "Project original."
      }
    }
  }
}

POST /r/project/execute/interrupt

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData project
required
specifies the project identifier string

Responses

HTTP Code Description Schema
200 Success ProjectResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/execute/console

This call retrieves the R console output for the latest execution on specified project.

Example HTTP 200 response - /r/project/execute/console

{
    "deployr": {
        "response": {
            "call": "/r/project/execute/console",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "project": {
                "project": "PROJECT-e2edd15f-dd67-42f6-8d82-90a2a5a669ca",
                "name": "Demo Analysis",
                "descr": "Predicting retail sales, updated.",
                "longdescr": null,
                "author": "george",
                "authors": [
                    "george",
                    "testuser"
                ],
                "shared": false,
                "lastmodified": 1378308723041,
                "live": true,
                "cookie": null,
                "origin": "Project original."
            },
            "execution": {
                "console": "n> x <- rnorm(5)n"
            }
        }
    }
}

GET /r/project/execute/console

Method

GET

Parameters:

Type Name Description Schema Default
query format
required
specifies markup encoding on call (json or xml). enum (json, xml)
query project
required
specifies the project identifier string

Responses

HTTP Code Description Schema
200 Success ProjectExecuteConsoleResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/execute/history

This call retrieves the execution history for the specified project.

Some of the key data indicated for each history item in the response markup on this call include:

Example HTTP 200 response - /r/project/execute/history


{
    "deployr": {
        "response": {
            "call": "/r/project/execute/history",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "project": {
                "project": "PROJECT-e2edd15f-dd67-42f6-8d82-90a2a5a669ca",
                "name": "Demo Analysis",
                "descr": "Predicting retail sales.",
                "longdescr": null,
                "author": "george",
                "authors": [
                    "george"
                ],
                "lastmodified": 1378319703711,
                "live": true,
                "shared": false,
                "cookie": null,
                "origin": "Project original.",
            },
            "execution": {
                "history": [
                    {
                        "code": "x <- rnorm(5)",
                        "actor": "george",
                        "tag": null,
                        "timeStart": 1378319697120,
                        "timeCode": 35,
                        "timeTotal": 106,
                        "resultsGenerated": 0,
                        "resultsAvailable": 0,
                        "resourceUsage": 17,
                        "console": "n> x <- rnorm(5)n",
                        "execution": "EXEC-82d99c82-8c26-4a71-9576-23d40d51b388",
                        "onDate": 1378319697231,
                        "success": true,
                        "interrupted": false,
                        "warnings": null,
                        "error": null,
                        "errorCode": null
                    },
                    {
                        "code": "plot(x)",
                        "actor": "george",
                        "tag": null,
                        "timeStart": 1378319702391,
                        "timeCode": 61,
                        "timeTotal": 266,
                        "resultsGenerated": 1,
                        "resultsAvailable": 1,
                        "resourceUsage": 3234,
                        "console": "n> plot(x)n",
                        "execution": "EXEC-0808900b-8dfb-43ac-a2ef-f697715b3c8f",
                        "onDate": 1378319702662,
                        "success": true,
                        "interrupted": false,
                        "warnings": null,
                        "error": null,
                        "errorCode": null
                    }
                ]
            }
        }
    }
}

GET /r/project/execute/history

Method

GET

Parameters:

Type Name Description Schema Default
query format
required
specifies markup encoding on call (json or xml). enum (json, xml)
query project
required
specifies the project identifier string
query filterdepth specifies the max number of executions to be returned in the history integer
query execution specifies the comma-separated list of execution identifiers on which to filter history string
query filtertag specifies the execution tag on which to filter history string
query reversed if true, the execution history is returned in a reverse-chronological order boolean

Responses

HTTP Code Description Schema
200 Success ProjectExecuteHistoryResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/execute/flush

This call flushes executions in the history on the specified project.

Flushing an execution deletes both the R console output and the generated results associated with that execution but does not remove the execution itself from the history. By omitting the execution parameter, the caller can flush every execution in the history on the specified project.

This flushing facility is provided to help users manage the levels of resource usage associated with their persistent projects.

Example HTTP 200 response - /r/project/execute/flush

{
  "deployr": {
    "response": {
      "call": "/r/project/execute/flush",
      "success": true,
      "uid": "UID-1e518408953d7920e1d7ae261694091c",
      "project": {
        "project": "PROJECT-e2edd15f-dd67-42f6-8d82-90a2a5a669ca",
        "name": "Demo Analysis",
        "descr": "Predicting retail sales."
        "longdescr": null,
        "author": "george",
        "authors": [
            "george"
        ],
        "shared": false,
        "lastmodified": 1378307626647,
        "live": false,
        "cookie": null,
        "origin": "Project original."
      }
    }
  }
}

POST /r/project/execute/flush

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData project
required
specifies the project identifier string
formData execution comma-separated list of execution identifiers string

Responses

HTTP Code Description Schema
200 Success ProjectResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/execute/result/list

This call lists the execution results for the specified project.

By specifying a value for the execution parameter the caller can limit the response to those results found on a specific execution or set of executions.

Important! The URLs returned in the response markup on this call remain valid for as long as the results remain part of the project.

Example HTTP 200 response - /r/project/execute/result/list

{
    "deployr": {
        "response": {
            "call": "/r/project/execute/result/list",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "project": {
                "name": "Demo Analysis",
                "project": "PROJECT-e2edd15f-dd67-42f6-8d82-90a2a5a669ca",
                "descr": "Predicting retail sales."
                "longdescr": null,
                "author": "george",
                "authors": [
                    "george"
                ],
                "shared": false,
                "lastmodified": 1378320574509,
                "live": true,
                "cookie": null,
                "origin": "Project original.",
            },
            "execution": {
                "results": [
                    {
                        "filename": "unnamedplot001.png",
                        "length": 3223,
                        "sha256": "b9e84e5690bcba3cbee03b73b0c9a9f7",
                        "execution": "EXEC-76b503a3-3c2f-4114-b4b2-e3b1b6f88657",
                        "url": "http://dhost:dport/deployr/r/project/execute
                        /result/download/
                        PROJECT-e2edd15f-dd67-42f6-8d82-90a2a5a669ca/
                        EXEC-76b503a3-3c2f-4114-b4b2-e3b1b6f88657/unnamedplot001.png",
                        "type": "image/png"
                    }
                ]
            }
        }
    }
}

GET /r/project/execute/result/list

Method

GET

Parameters:

Type Name Description Schema Default
query format
required
specifies markup encoding on call (json or xml). enum (json, xml) json
query project
required
specifies the project identifier string
query execution comma-separated list of execution identifiers string

Responses

HTTP Code Description Schema
200 Success ProjectExecuteResultListResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/execute/result/download

This call downloads the execution results for the specified project.

By specifying a value for the execution parameter the caller can download only results on the specified executions. By specifying a value for the filename parameter the caller can download a specific result on the specified execution.

GET /r/project/execute/result/download

Method

GET

Parameters:

Type Name Description Schema Default
query format
required
specifies markup encoding on call (json or xml). enum (json, xml)
query project
required
specifies project identifier string
query execution specifies a comma-separated list of execution identifiers string
query filename specifies a result file name string
query drophistory if true, the Content-Disposition response header indicating attachment is omitted boolean

Responses

HTTP Code Description Schema
200 Success string
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

Produces

/r/project/execute/result/delete

This call deletes the execution results for the specified project.

By specifying a value for the execution parameter the caller can delete only those results on the specified executions. By specifying a value for the filename parameter the caller can delete a specific result on the specified executions.

Example HTTP 200 response - /r/project/execute/result/delete

{
  "deployr": {
    "response": {
      "call": "/r/project/execute/result/delete",
      "success": true,
      "uid": "UID-1e518408953d7920e1d7ae261694091c",
      "project": {
        "project": "PROJECT-e2edd15f-dd67-42f6-8d82-90a2a5a669ca",
        "name": "Demo Analysis",
        "descr": "Predicting retail sales."
        "longdescr": null,
        "author": "george",
        "authors": [
            "george"
        ],
        "shared": false,
        "lastmodified": 1378307626647,
        "live": false,
        "cookie": null,
        "origin": "Project original."
      }
    }
  }
}

POST /r/project/execute/result/delete

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData project
required
specifies the project identifier string
formData execution comma-separated list of execution identifiers string
formData filename specifies a result file name string

Responses

HTTP Code Description Schema
200 Success ProjectResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/workspace/list

This call lists the objects in the workspace for the specified project.

Example HTTP 200 response - /r/project/workspace/list

{
  "deployr": {
    "response": {
      "call": "/r/project/workspace/list",
      "success": true,
      "uid": "5CB911405DC6EB0F8E283990F7969E63",
      "project": {
        "name": "Demo Analysis",
        "project": "PROJECT-4f9fe8bf-9425-4f2c-aa15-5d94818988f9",
        "descr": "Predicting retail sales.",
        "longdescr": null,
        "author": "george",
        "authors": [
          "george"
        ],
        "shared": false,
        "lastmodified": 1378321615345,
        "live": true,
        "cookie": null,
        "origin": "Project original."
      },
      "workspace": {
        "objects": [
          {
            "branch": false,
            "rclass": "character",
             "name": "x_character",
             "type": "primitive",
             "xdf": null
            },
            {
              "branch": true,
              "rclass": "data.frame",
              "name": "x_dataframe",
              "type": "dataframe",
              "xdf": null
            },
            {
              "branch": false,
              "rclass": "matrix",
              "name": "x_matrix",
              "type": "matrix",
              "xdf": null
            }
        ]
      }
    }
  }
}

GET /r/project/workspace/list

Method

GET

Parameters:

Type Name Description Schema Default
query format
required
specifies markup encoding on call (json or xml). enum (json, xml)
query project
required
specifies the project identifier. string
query root specifies the object graph root. string
query clazz specifies the R class based filter. string
query filter specifies the R object name based filter. string
query restrict if `true`, limits returned objects to object types with supported DeployR-encoding
boolean
query pagesize specifies the page size for paging results in response markup. integer
query pageoffset specifies the page offset for paging results in response markup. integer

Responses

HTTP Code Description Schema
200 Success ProjectWorkspaceResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/workspace/get

This call retrieves DeployR-encoded objects from the workspace for the specified project.

Example HTTP 200 response - /r/project/workspace/get

{
    "deployr": {
        "response": {
            "call": "/r/project/workspace/get",
            "success": true,
            "uid": "5CB911405DC6EB0F8E283990F7969E63",
            "project": {
                "name": "Demo Analysis",
                "project": "PROJECT-4f9fe8bf-9425-4f2c-aa15-5d94818988f9",
                "descr": "Predicting retail sales."
                "longdescr": null,
                "author": "george",
                "authors": [
                    "george"
                ],
                "shared": false,
                "lastmodified": 1378321946753,
                "live": true,
                "cookie": null,
                "origin": "Project original.",
            },
            "workspace": {
                "objects": [ {
                    "name": "x_matrix",
                    "type": "matrix",
                    "rclass": "matrix",
                    "value": [
                        [
                            1,
                            3,
                            12
                        ],
                        [
                            2,
                            11,
                            13
                        ]
                    ]
                } ]
            }
        }
    }
}

GET /r/project/workspace/get

Method

GET

Parameters:

Type Name Description Schema Default
query format
required
specifies markup encoding on call (json or xml). enum (json, xml)
query project
required
specifies the project identifier. string
query name
required
specifies a comma-separated list of object names. string
query root specifies the object graph root. string
query start specifies the offset into object data. string
query length specifies the segment of object data to retrieve. integer
query infinity specifies a custom value for Infinity appearing in R object data returned on the call, otherwise Infinity is represented by 0x7ff0000000000000L. boolean
query nan specifies custom value for `NaN` appearing in R object data returned on the call, otherwise `NaN` is represented by `null`.
integer
query encodeDataFramePrimitiveAsVector if `true`, `data.frame` primitives are encoded vectors in R object data returned on call.
integer

Responses

HTTP Code Description Schema
200 Success ProjectWorkspaceResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/workspace/upload

This call uploads a binary object from file into the workspace for the specified project.

Example HTTP 200 response - /r/project/workspace/upload

{
  "deployr": {
    "response": {
      "call": "/r/project/workspace/upload",
      "success": true,
      "uid": "UID-1e518408953d7920e1d7ae261694091c",
      "project": {
        "project": "PROJECT-e2edd15f-dd67-42f6-8d82-90a2a5a669ca",
        "name": "Sample Sales Projects (Import)",
        "descr": "Upload of latests sales projections."
        "longdescr": null,
        "author": "george",
        "authors": [
            "george"
        ],
        "shared": false,
        "lastmodified": 1378307626647,
        "live": false,
        "cookie": null,
        "origin": "Project original."
      }
    }
  }
}

POST /r/project/workspace/upload

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData project
required
specifies the project identifier string
formData name
required
specifies the name of the object file string
formData file
required
specifies the file file

Responses

HTTP Code Description Schema
200 Success ProjectResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/workspace/transfer

This call transfers a binary object from a URL into the workspace for the specified project.

Example HTTP 200 response - /r/project/workspace/transfer

{
  "deployr": {
    "response": {
      "call": "/r/project/workspace/transfer",
      "success": true,
      "uid": "UID-1e518408953d7920e1d7ae261694091c",
      "project": {
        "project": "PROJECT-e2edd15f-dd67-42f6-8d82-90a2a5a669ca",
        "name": "Sample Sales Projects (Import)",
        "descr": "Predicting retail sales."
        "longdescr": null,
        "author": "george",
        "authors": [
            "george"
        ],
        "shared": false,
        "lastmodified": 1378307626647,
        "live": false,
        "cookie": null,
        "origin": "Project original."
      }
    }
  }
}

POST /r/project/workspace/transfer

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml) json
formData project
required
specifies the project identifier string
formData name
required
specifies the name of the object file found on the URL string
formData url
required
specifies the URL string

Responses

HTTP Code Description Schema
200 Success ProjectResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/workspace/push

This call pushes a DeployR-encoded object into the workspace for the specified project.

Example HTTP 200 response - /r/project/workspace/push

{
  "deployr": {
    "response": {
      "call": "/r/project/workspace/push",
      "success": true,
      "uid": "UID-1e518408953d7920e1d7ae261694091c",
      "project": {
        "project": "PROJECT-e2edd15f-dd67-42f6-8d82-90a2a5a669ca",
        "name": "Sample Sales Projects (Import)",
        "descr": "Predicting retail sales."
        "longdescr": null,
        "author": "george",
        "authors": [
            "george"
        ],
        "shared": false,
        "lastmodified": 1378307626647,
        "live": false,
        "cookie": null,
        "origin": "Project original."
      }
    }
  }
}

POST /r/project/workspace/push

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml) json
formData project
required
specifies the project identifier string
formData inputs
required
DeployR-encoded object inputs string
formData csvinputs comma-separated list of primitive name/value inputs string

Responses

HTTP Code Description Schema
200 Success ProjectResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/workspace/save

This call saves the workspace to a file in the working directory for the specified project.

If the name parameter is specified on the call then only the named object is saved as a binary object file to the working directory. Otherwise the entire contents of the workspace are saved.

Example HTTP 200 response - /r/project/workspace/save

{
    "deployr": {
        "response": {
            "call": "/r/project/workspace/save",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "project": {
                "name": "Demo Analysis",
                "project": "PROJECT-4f9fe8bf-9425-4f2c-aa15-5d94818988f9",
                "descr": "Predicting retail sales."
                "longdescr": null,
                "author": "george",
                "authors": [
                    "george"
                ],
                "shared": false,
                "lastmodified": 1378321946753,
                "live": true,
                "cookie": null,
                "origin": "Project original.",
            },
            "directory": {
                "file": {
                    "filename": "x_matrix.rData",
                    "descr": "Saved matrix from workspace."
                    "length": 101,
                    "type": "application/octet-stream",
                    "category": "R",
                    "lastmodified": 1378322423000,
                    "url": "http://dhost:dport/deployr/r/project/
                    directory/download/
                    PROJECT-4f9fe8bf-9425-4f2c-aa15-5d94818988f9/x_matrix.rData"
                }
            }
        }
    }
}

POST /r/project/workspace/save

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml) json
formData project
required
specifies the project identifier string
formData name specifies a named object for saving string
formData descr specifies a description to accompany the saved file string
formData version if `true`, the new file will be renamed to avoid overwriting
string

Responses

HTTP Code Description Schema
200 Success ProjectWorkspaceSaveResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/workspace/store

This call stores a file from the working directory to the repository.

Example HTTP 200 response - /r/project/workspace/store

{
    "deployr": {
        "response": {
            "call": "/r/project/directory/store",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "project": {
                "name": "Demo Analysis",
                "authors": [
                    "testuser",
                    "sheri"
                ],
                "longdescr": null,
                "origin": "Project original.",
                "cookie": null,
                "lastmodified": 1344377536002,
                "live": true,
                "shared": false,
                "project": "PROJECT-4f9fe8bf-9425-4f2c-aa15-5d94818988f9",
                "author": "testuser",
                "descr": "Predicting retail sales, updated."
            },
           "repository": {
                "file": {
                    "filename": "hello.txt",
                    "author": "george",
                    "authors": [
                        "george"
                    ],
                    "version": null,
                    "versionmsg": null,
                    "descr": "Sample file stored from project directory."
                    "tags": null,
                    "length": 11,
                    "type": "text/plain",
                    "latestby": "george",
                    "category": "text",
                    "restricted": null,
                    "shared": false,
                    "published": false,
                    "access": "Private",
                    "sha256": "5eb63bbbe01eeed093cb22bb8f5acdc3",
                    "lastModified": 1378325607408,
                    "url": "http://dhost:dport/deployr/r/repository/
                    file/download/george/hello.txt"
                }
            }
        }
    }

POST /r/project/workspace/store

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml) json
formData project
required
specifies the project identifier string
formData filename specifies the file for storing string
formData descr specifies a description to accompany the saved file string
formData tags specifies tag words to associate with repository file string
formData restricted comma-separated list of role names, which makes the file visible to authenticated users with these roles
string
formData shared if `true`, the file will be shared, which makes the file visible to authenticated users
string
formData published if `true`, the file will be published, which makes the file visible to authenticated and anonymous users
string
formData newversion if `true`, the new file will be renamed to avoid overwriting
string

Responses

HTTP Code Description Schema
200 Success ProjectWorkspaceStoreResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/workspace/load

This call loads a binary object from a file in the repository into the workspace for the specified project.

Example HTTP 200 response - /r/project/workspace/load

{
    "deployr": {
        "response": {
            "call": "/r/project/workspace/load",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "project": {
                "name": "Demo Analysis",
                "project": "PROJECT-4f9fe8bf-9425-4f2c-aa15-5d94818988f9",
                "descr": "Predicting retail sales."
                "longdescr": null,
                "author": "george",
                "authors": [
                    "george"
                ],
                "shared": false,
                "lastmodified": 1378321946753,
                "live": true,
                "cookie": null,
                "origin": "Project original.",
            }
        }
    }
}

POST /r/project/workspace/load

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml) json
formData project
required
specifies the project identifier string
formData filename
required
specifies the repository file name string
formData author
required
specifies the repository file author string
formData version specifies the repository file version string

Responses

HTTP Code Description Schema
200 Success ProjectResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/workspace/delete

This call deletes an object from the workspace for the specified project.

Example HTTP 200 response - /r/project/workspace/delete

{
    "deployr": {
        "response": {
            "call": "/r/project/workspace/delete",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "project": {
                "name": "Demo Analysis",
                "project": "PROJECT-4f9fe8bf-9425-4f2c-aa15-5d94818988f9",
                "descr": "Predicting retail sales."
                "longdescr": null,
                "author": "george",
                "authors": [
                    "george"
                ],
                "shared": false,
                "lastmodified": 1378321946753,
                "live": true,
                "cookie": null,
                "origin": "Project original.",
            }
        }
    }
}

POST /r/project/workspace/delete

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml) json
formData project
required
specifies the project identifier string
formData name
required
specifies the object name string

Responses

HTTP Code Description Schema
200 Success ProjectResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/directory/list

This call lists working directory files for the specified project.

The filter parameter can be specified on the call to filter, the types of files returned according to their category. The following filter values are supported: - plot - files ending with a .png, .svg or .jpg extension - script - files ending with a .R or .r extension - R - files ending with a .rData or .rdata extension - data - files ending with a .csv or .xls extension - text - files ending with a .txt extension

Example HTTP 200 response - /r/project/directory/list

{
    "deployr": {
        "response": {
            "call": "/r/project/directory/list",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "project": {
                "name": "Demo Analysis",
                "project": "PROJECT-4f9fe8bf-9425-4f2c-aa15-5d94818988f9",
                "descr": "Predicting retail sales."
                "longdescr": null,
                "author": "george",
                "authors": [
                    "george"
                ],
                "shared": false,
                "lastmodified": 1378323912616,
                "live": true,
                "cookie": null,
                "origin": "Project original.",
            },
            "directory": {
                "files": [
                    {
                        "filename": "analyze.R",
                        "descr": null,
                        "length": 6,
                        "type": "text/plain",
                        "category": "script",
                        "lastmodified": 1378323935000,
                        "url": "http://dhost:dport/deployr/r/project/
                        directory/download/
                        PROJECT-4f9fe8bf-9425-4f2c-aa15-5d94818988f9/analyze.R",
                    },
                    {
                        "filename": "histogram.png",
                        "descr": null
                        "length": 3289,
                        "type": "image/png",
                        "category": "plot",
                        "lastmodified": 1378323952000,
                        "url": "http://dhost:dport/deployr/r/project/
                        directory/download/
                        PROJECT-4f9fe8bf-9425-4f2c-aa15-5d94818988f9/histogram.png"
                    }
                ]
            }
        }
    }
}

GET /r/project/directory/list

Method

GET

Parameters:

Type Name Description Schema Default
query format
required
specifies markup encoding on call (json or xml). enum (json, xml) json
query project
required
specifies the project identifier string
query filter specifies the filter by category value string

Responses

HTTP Code Description Schema
200 Success ProjectDirectoryListResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/directory/upload

This call uploads a file into the working directory for the specified project.

Example HTTP 200 response - /r/project/directory/upload

{
    "deployr": {
        "response": {
            "call": "/r/project/directory/upload",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "project": {
                "name": "Demo Analysis",
                "project": "PROJECT-4f9fe8bf-9425-4f2c-aa15-5d94818988f9",
                "descr": "Predicting retail sales."
                "longdescr": null,
                "author": "george",
                "authors": [
                    "george"
                ],
                "shared": false,
                "lastmodified": 1378323912616,
                "live": true,
                "cookie": null,
                "origin": "Project original.",
            },
            "directory": {
               "file": {
                    "filename": "SavedX.rData",
                    "descr": "Sample file.",
                    "length": 74,
                    "type": "application/octet-stream",
                    "category": "R",
                    "lastmodified": 1378324358000,
                    "url": "http://dhost:dport/deployr/r/project/
                    directory/download/
                    PROJECT-4f9fe8bf-9425-4f2c-aa15-5d94818988f9/SavedX.rData",
                }
            }
        }
    }
}

POST /r/project/directory/upload

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml) json
formData project
required
specifies the project identifier string
formData filename
required
specifies the name of the file string
formData file
required
specifies the file content file
formData descr specifies the description to be associated with the file string
formData overwrite if `true`, overwrites the existing file of same name
boolean

Responses

HTTP Code Description Schema
200 Success ProjectDirectoryResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/directory/transfer

This call transfers a file from a URL into the working directory for the specified project.

Example HTTP 200 response - /r/project/directory/transfer

{
    "deployr": {
        "response": {
            "call": "/r/project/directory/transfer",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "project": {
                "name": "Demo Analysis",
                "authors": [
                    "testuser",
                    "sheri"
                ],
                "longdescr": null,
                "origin": "Project original.",
                "cookie": null,
                "lastmodified": 1344377536002,
                "live": true,
                "shared": false,
                "project": "PROJECT-4f9fe8bf-9425-4f2c-aa15-5d94818988f9",
                "author": "testuser",
                "descr": "Predicting retail sales, updated."
            },
           "directory": {
                "file": {
                    "filename": "sample.pdf",
                    "descr": "Sample file.",
                    "length": 218882,
                    "type": "application/pdf",
                    "category": "pdf",
                    "lastmodified": 1378324718000,
                    "url": "http://dhost:dport/deployr/r/project/
                    directory/download/
                    PROJECT-4f9fe8bf-9425-4f2c-aa15-5d94818988f9/sample.pdf",
                }
            }
        }
    }
}

POST /r/project/directory/transfer

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml) json
formData project
required
specifies the project identifier string
formData filename
required
specifies the name of the file string
formData url
required
specifies the URL for the file string
formData descr specifies the description to be associated with the file string
formData overwrite if true, overwrites the existing file of same name boolean

Responses

HTTP Code Description Schema
200 Success ProjectDirectoryResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/directory/write

This call writes a text file into the working directory for the specified project.

Example HTTP 200 response - /r/project/directory/write

{
    "deployr": {
        "response": {
            "call": "/r/project/directory/write",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "project": {
                "name": "Demo Analysis",
                "authors": [
                    "testuser",
                    "sheri"
                ],
                "longdescr": null,
                "origin": "Project original.",
                "cookie": null,
                "lastmodified": 1344377536002,
                "live": true,
                "shared": false,
                "project": "PROJECT-4f9fe8bf-9425-4f2c-aa15-5d94818988f9",
                "author": "testuser",
                "descr": "Predicting retail sales, updated."
            },
            "directory": {
                "file": {
                    "filename": "hello.txt",
                    "descr": "Sample file.",
                    "length": 11,
                    "type": "text/plain",
                    "category": "text",
                    "lastmodified": 1378324957000,
                    "url": "http://dhost:dport/deployr/r/project/
                    directory/download/
                    PROJECT-4f9fe8bf-9425-4f2c-aa15-5d94818988f9/hello.txt"
                }
            }
        }
    }
}

POST /r/project/directory/write

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml) json
formData project
required
specifies the project identifier string
formData filename
required
specifies the name of the file string
formData text
required
specifies the text content for the file string
formData delimiter specifies a custom delimiter for text when writing multiple files, defaults to #,# string
formData descr specifies the description to be associated with the file string
formData overwrite if true, overwrites the existing file of same name boolean

Responses

HTTP Code Description Schema
200 Success ProjectDirectoryResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/directory/update

This call updates a file name and/or description in the working directory for the specified project.

Example HTTP 200 response - /r/project/directory/update

{
    "deployr": {
        "response": {
            "call": "/r/project/directory/update",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "project": {
                "name": "Demo Analysis",
                "authors": [
                    "testuser",
                    "sheri"
                ],
                "longdescr": null,
                "origin": "Project original.",
                "cookie": null,
                "lastmodified": 1344377536002,
                "live": true,
                "shared": false,
                "project": "PROJECT-4f9fe8bf-9425-4f2c-aa15-5d94818988f9",
                "author": "testuser",
                "descr": "Predicting retail sales, updated."
            },
            "directory": {
                "file": {
                    "filename": "hello.txt",
                    "descr": "Sample file, updated.",
                    "length": 11,
                    "type": "text/plain",
                    "category": "text",
                    "lastmodified": 1378325035000,
                    "url": "http://dhost:dport/deployr/r/project/
                    directory/download/
                    PROJECT-4f9fe8bf-9425-4f2c-aa15-5d94818988f9/hello.txt"
                }
            }
        }
    }
}

POST /r/project/directory/update

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml) json
formData project
required
specifies the project identifier string
formData filename
required
specifies the name of the file string
formData rename specifies the new name for the file string
formData descr specifies the description to be associated with the file string
formData overwrite if true, overwrites the existing file of same name boolean

Responses

HTTP Code Description Schema
200 Success ProjectDirectoryResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/directory/store

This call stores a file from the working directory to the repository.

Example HTTP 200 response - /r/project/directory/store

{
    "deployr": {
        "response": {
            "call": "/r/project/directory/store",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "project": {
                "name": "Demo Analysis",
                "authors": [
                    "testuser",
                    "sheri"
                ],
                "longdescr": null,
                "origin": "Project original.",
                "cookie": null,
                "lastmodified": 1344377536002,
                "live": true,
                "shared": false,
                "project": "PROJECT-4f9fe8bf-9425-4f2c-aa15-5d94818988f9",
                "author": "testuser",
                "descr": "Predicting retail sales, updated."
            },
           "repository": {
                "file": {
                    "filename": "hello.txt",
                    "author": "george",
                    "authors": [
                        "george"
                    ],
                    "version": null,
                    "versionmsg": null,
                    "descr": "Sample file stored from project directory."
                    "tags": null,
                    "length": 11,
                    "type": "text/plain",
                    "latestby": "george",
                    "category": "text",
                    "restricted": null,
                    "shared": false,
                    "published": false,
                    "access": "Private",
                    "sha256": "5eb63bbbe01eeed093cb22bb8f5acdc3",
                    "lastModified": 1378325607408,
                    "url": "http://dhost:dport/deployr/r/repository/
                    file/download/george/hello.txt"
                }
            }
        }
    }
}

POST /r/project/directory/store

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml) json
formData project
required
specifies the project identifier string
formData filename
required
specifies the name of the file string
formData descr specifies the description to be associated with the file string
formData tags specifies tag words to associate with repository file string
formData restricted comma-separated list of role names, which makes the file visible to authenticated users with these roles
string
formData shared if `true`, the file will be shared, which makes the file visible to authenticated users
boolean
formData published if `true`, the file will be published , which makes the file visible to authenticated and anonymous users
boolean
formData newversion if `true`, the new file will be renamed to avoid overwriting
boolean

Responses

HTTP Code Description Schema
200 Success ProjectDirectoryStoreResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/directory/load

This call loads a file from the repository into the working directory for the specified project.

Example HTTP 200 response - /r/project/directory/load


 {
    "deployr": {
        "response": {
            "call": "/r/project/directory/load",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "project": {
                "name": "Demo Analysis",
                "authors": [
                    "testuser",
                    "sheri"
                ],
                "longdescr": null,
                "origin": "Project original.",
                "cookie": null,
                "lastmodified": 1344377536002,
                "live": true,
                "shared": false,
                "project": "PROJECT-4f9fe8bf-9425-4f2c-aa15-5d94818988f9",
                "author": "testuser",
                "descr": "Predicting retail sales, updated."
            },
            "directory": {
                "file": {
                    "filename": "sample.csv",
                    "descr": null,
                    "length": 987,
                    "type": "text/plain",
                    "category": "data",
                    "lastmodified": 1378324957000,
                    "url": "http://dhost:dport/deployr/r/project/
                    directory/download/
                    PROJECT-4f9fe8bf-9425-4f2c-aa15-5d94818988f9/sample.csv"
                }
            }
        }
    }       
}

POST /r/project/directory/load

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml) json
formData project
required
specifies the project identifier string
formData filename
required
specifies the repository file name string
formData author
required
specifies the repository file author string
formData version specifies the repository file version string

Responses

HTTP Code Description Schema
200 Success ProjectDirectoryResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/directory/download

This call loads a file from the repository into the working directory for the specified project.

Example HTTP 200 response - /r/project/directory/download

If a single value for the filename parameter is specified on the call, then:

Content-Type: file/content-type

If multiple values for the filename parameter are specified or the parameter is omitted on the call, then:

Content-Type: application/zip

GET /r/project/directory/download

Method

GET

Parameters:

Type Name Description Schema Default
query format
required
specifies markup encoding on call (json or xml). enum (json, xml) json
query project
required
specifies the project identifier string
query filename
required
specifies comma-separated file names for download string
query inline if `true`, the Content-Disposition response header indicating attachment is omitted
boolean false

Responses

HTTP Code Description Schema
200 Success string
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

Produces

/r/project/directory/delete

This call deletes files from the working directory for the specified project.

Example HTTP 200 response - /r/project/directory/delete

{
    "deployr": {
        "response": {
            "call": "/r/project/directory/delete",
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "success": true,
            "project": {
                "name": "Demo Analysis",
                "authors": [
                    "testuser",
                    "sheri"
                ],
                "longdescr": null,
                "origin": "Project original.",
                "cookie": null,
                "lastmodified": 1344377536002,
                "live": true,
                "shared": false,
                "project": "PROJECT-4f9fe8bf-9425-4f2c-aa15-5d94818988f9",
                "author": "testuser",
                "descr": "Predicting retail sales, updated."
            }
        }
    }
}

POST /r/project/directory/delete

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml) json
formData project
required
specifies the project identifier string
formData filename
required
specifies a comma-separated list of file names for deletion string

Responses

HTTP Code Description Schema
200 Success ProjectResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/package/list

This call lists R package dependencies for the specified project.

Example HTTP 200 response - /r/project/package/list

{
    "deployr": {
        "response": {
            "call": "/r/project/package/list",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "project": {
                "name": "Demo Analysis",
                "project": "PROJECT-4f9fe8bf-9425-4f2c-aa15-5d94818988f9",
                "descr": "Predicting retail sales.",
                "longdescr": null,
                "author": "george",
                "authors": [
                    "george"
                ],
                "shared": false,
                "lastmodified": 1378321615345,
                "live": true,
                "cookie": null,
                "origin": "Project original."
            },
            "packages": [
                {
                    "status": "ok",
                    "attached": true,
                    "name": "base",
                    "version": "3.0.1",
                    "repo": "http://cran.us.r-project.org",
                    "descr": "The R Base Package"
                },
                {
                    "status": "ok",
                    "attached": true,
                    "name": "datasets",
                    "version": "3.0.1",
                    "repo": "http://cran.us.r-project.org",
                    "descr": "The R Datasets Package"
                },
                {
                    "status": "ok",
                    "attached": true,
                    "name": "graphics",
                    "version": "3.0.1",
                    "repo": "http://cran.us.r-project.org",
                    "descr": "The R Graphics Package"
                },
                {
                    "status": "ok",
                    "attached": true,
                    "name": "grDevices",
                    "version": "3.0.1",
                    "repo": "http://cran.us.r-project.org",
                    "descr": "The R Graphics Devices and Support for Colours and Fonts"
                },
                {
                    "status": "ok",
                    "attached": true,
                    "name": "methods",
                    "version": "3.0.1",
                    "repo": "http://cran.us.r-project.org",
                    "descr": "Formal Methods and Classes"
                },
                {
                    "status": "ok",
                    "attached": true,
                    "name": "msbase",
                    "version": "7.0.0",
                    "repo": "http://cran.us.r-project.org",
                    "descr": "Microsoft R Base Package"
                },
                {
                    "status": "ok",
                    "attached": true,
                    "name": "DeployrTools",
                    "version": "7.0-1",
                    "repo": "http://cran.us.r-project.org",
                    "descr": "DeployR Tools"
                },
                {
                    "status": "ok",
                    "attached": true,
                    "name": "msMods",
                    "version": "7.0.0",
                    "repo": "http://cran.us.r-project.org",
                    "descr": "R Functions Modified For Microsoft R"
                },
                {
                    "status": "ok",
                    "attached": true,
                    "name": "stats",
                    "version": "3.0.1",
                    "repo": "http://cran.us.r-project.org",
                    "descr": "The R Stats Package"
                },
                {
                    "status": "ok",
                    "attached": true,
                    "name": "utils",
                    "version": "3.0.1",
                    "repo": "http://cran.us.r-project.org",
                    "descr": "The R Utils Package"
                }
            ]
        }
    }
}        

GET /r/project/package/list

Method

GET

Parameters:

Type Name Description Schema Default
query format
required
specifies markup encoding on call (json or xml). enum (json, xml) json
query project
required
specifies the project identifier string
query installed
required
if `true`, the response lists all packages installed in the project environment
boolean true

Responses

HTTP Code Description Schema
200 Success ProjectPackageListResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/package/attach

This call attaches R package dependencies for the specified project.

Example HTTP 200 response - /r/project/package/attach

{
    "deployr": {
        "response": {
            "call": "/r/project/package/attach",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "project": {
                "name": "Demo Analysis",
                "project": "PROJECT-4f9fe8bf-9425-4f2c-aa15-5d94818988f9",
                "descr": "Predicting retail sales.",
                "longdescr": null,
                "author": "george",
                "authors": [
                    "george"
                ],
                "shared": false,
                "lastmodified": 1378321615345,
                "live": true,
                "cookie": null,
                "origin": "Project original."
            },
            "packages": [
                {
                    "name": "RevoScaleR",
                    "status": "success",
                    "repo": null
                }
            ]
        }
    }
}

POST /r/project/package/attach

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml) json
formData project
required
specifies the project identifier string
formData name
required
specifies a comma-separated list of R package names to attach boolean true
formData repo
required
specifies the R repository location for named packages boolean true

Responses

HTTP Code Description Schema
200 Success ProjectPackageAttachResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/project/package/detach

This call detaches R package dependencies for the specified project.

Example HTTP 200 response - /r/project/package/detach


 {
    "deployr": {
        "response": {
            "call": "/r/project/package/detach",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "project": {
                "name": "Demo Analysis",
                "project": "PROJECT-4f9fe8bf-9425-4f2c-aa15-5d94818988f9",
                "descr": "Predicting retail sales.",
                "longdescr": null,
                "author": "george",
                "authors": [
                    "george"
                ],
                "shared": false,
                "lastmodified": 1378321615345,
                "live": true,
                "cookie": null,
                "origin": "Project original."
            },
            "packages": [
                {
                    "name": "RevoScaleR",
                    "status": "success",
                }
            ]
        }
    }
}

POST /r/project/package/detach

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml) json
formData project
required
specifies the project identifier string
formData name
required
specifies a comma-separated list of R package names to detach boolean true

Responses

HTTP Code Description Schema
200 Success ProjectPackageDetachResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

Repository

The Repository APIs facilitate working with repository-managed files and directories. Each authenticated user has access to their own private repository store. The repository acts as a persistent store for user files of any type, including binary object files, plot image files, data files, simple text files and files containing blocks of R code, which are referred to as repository-managed scripts. By default, each private repository store exposes a single repository directory, known as the root directory. Users can store files in and retrieve files from their root directory. In addition, users can manage their own set of custom and archived directories.

There are several types of Repository APIs:

Read more about the Repository APIs in the API Overview guide.

/r/repository/directory/list

This call lists repository-managed directories. By default, a list of the caller’s user directories ( root and custom ) are returned in the response markup.

If the archived parameter is enabled then the list of the caller’s user directories will include the caller’s archived directories in the response markup.

A number of optional parameters are provided that allow the caller to request the addition of file lists for some or all directories:

If the userfiles parameter is enabled, the files in all of the caller’s user directories are listed in the response markup. Note, depending on the number of files owned by the caller, when this parameter is enabled the response markup returned on this call can be a verbose.

If the directory parameter is specified then only the files in the directory indicated are returned in the response markup.

If the shared parameter is enabled then the files found in the Restriced and Shared system directories are returned in the response markup. If the published parameter is enabled then the files found in the Public system directory are returned in the response markup.

The categoryFilter parameter can be used to filter the types of files returned on the response markup. The following values are supported on this parameter:

For example, using a combination of the categoryFilter and directory parameters, a call can request only binary R object files found in a specific directory: /r/repository/directory/list?categoryFilter=R&directory=example.

Note: The metadata property in the response markup on this call is provided as a convenience for client application developers. It provides a complete list fo the user directories available to the current caller.

Example HTTP 200 response - /r/repository/directory/list

{
    "deployr": {
        "response": {
            "call": "/r/repository/directory/list"
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "repository": {
                "directories": {
                    "user": [
                        {
                            "directory": "root",
                            "files": []
                        },
                        {
                            "directory": "demo",
                            "files": []
                        },
                        {
                            "directory": "projectX",
                            "files": [
                                {
                                    "directory": "projectX",
                                    "length": 74,
                                    "descr": "ProjectX model.",
                                    "authors": [
                                        "george"
                                    ],
                                    "shared": false,
                                    "restricted": null,
                                    "type": "application/octet-stream",
                                    "url": "http://dhost:dport/deployr/r/repository/
                                    file/download/george/projectX/SavedX.rData",
                                    "filename": "SavedX.rData",
                                    "access": "Private",
                                    "versionmsg": null,
                                    "author": "george",
                                    "lastModified": 1392732311973,
                                    "published": false,
                                    "category": "R",
                                    "tags": null,
                                    "sha256": "7083dd400b3345ebb75c4b8e41ad9d70",
                                    "latestby": "george",
                                    "version": null
                                },
                                {
                                    "directory": "projectX",
                                    "length": 6,
                                    "descr": "Script to score model.",
                                    "authors": [
                                        "george"
                                    ],
                                    "shared": false,
                                    "restricted": null,
                                    "type": "text/plain",
                                    "url": "http://dhost:dport/deployr/r/repository/
                                    file/download/george/projectX/score.R",
                                    "filename": "score.R",
                                    "access": "Private",
                                    "versionmsg": null,
                                    "author": "george",
                                    "lastModified": 1392732338343,
                                    "published": false,
                                    "category": "script",
                                    "tags": null,
                                    "sha256": "77d7c62ca2bc4ac236235020fa3cb319",
                                    "latestby": "george",
                                    "version": null
                                }
                            ]
                        },
                        {
                            "directory": "samples",
                            "files": [
                                {
                                    "directory": "samples",
                                    "length": 6,
                                    "descr": "Simple linear regression.",
                                    "authors": [
                                        "george"
                                    ],
                                    "shared": false,
                                    "restricted": null,
                                    "type": "text/plain",
                                    "url": "http://dhost:dport/deployr/r/repository/
                                    file/download/george/samples/regression.R",
                                    "filename": "regression.R",
                                    "access": "Private",
                                    "versionmsg": null,
                                    "author": "george",
                                    "lastModified": 1392732363652,
                                    "published": false,
                                    "category": "script",
                                    "tags": null,
                                    "sha256": "77d7c62ca2bc4ac236235020fa3cb319",
                                    "latestby": "george",
                                    "version": null
                                }
                            ]
                        },
                        {
                            "directory": "demo.archive",
                            "files": [
                                {
                                    "directory": "demo.archive",
                                    "length": 6,
                                    "descr": null,
                                    "authors": [
                                        "george"
                                    ],
                                    "shared": false,
                                    "restricted": null,
                                    "type": "text/plain",
                                    "url": "http://dhost:dport/deployr/r/repository/
                                    file/download/george/demo.archive/test.R",
                                    "filename": "test.R",
                                    "access": "Private",
                                    "versionmsg": "File archived from demo directory.",
                                    "author": "george",
                                    "lastModified": 1392732699820,
                                    "published": false,
                                    "category": "script",
                                    "tags": null,
                                    "sha256": "77d7c62ca2bc4ac236235020fa3cb319",
                                    "latestby": "george",
                                    "version": null
                                }
                            ]
                        }
                    ],
                    "system": [
                        {
                            "directory": "Restricted",
                            "files": []
                        },
                        {
                            "directory": "Shared",
                            "files": []
                        },
                        {
                            "directory": "Public",
                            "files": [
                                {
                                    "tags": null,
                                    "sha256": "47ca3f5c0186b66e0eefbd2e1dedccba",
                                    "length": 780,
                                    "descr": "Generate data and plot.",
                                    "version": null,
                                    "shared": false,
                                    "restricted": null,
                                    "type": "text/plain",
                                    "url": "http://dhost:dport/deployr/r/repository/
                                    file/download/testuser/root/Histogram+of+Auto+Sales.R",
                                    "filename": "Histogram of Auto Sales.R",
                                    "access": "Public",
                                    "versionmsg": "Script created on import.",
                                    "author": "testuser",
                                    "lastModified": 1377272257978,
                                    "published": true,
                                    "category": "script",
                                    "outputs": null,
                                    "directory": "root",
                                    "inputs": null,
                                    "latestby": "testuser",
                                    "authors": [
                                        "testuser"
                                    ]
                                }
                            ]
                        }
                    ],
                    "metadata": {
                        "custom": [
                            "projectX",
                            "root",
                            "samples"
                        ],
                        "archived": [
                            "demo.archive"
                        ]
                }
            }
        }
    }
}         


GET /r/repository/directory/list

Method

GET

Parameters:

Type Name Description Schema Default
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml) json
query archived if `true`, files found in archived directories are included in the response markup
boolean
query userfiles if `true`, files in all user directories are listed in the response markup
boolean
query directory when specified, only files in the user directory indicated are listed in response markup
boolean
query shared if true, files that are restricted but visible or shared by other users are included in the response markup
boolean
query published if `true`, files that are published by other users are included in the response markup
boolean
query categoryFilte when specified, the list of files in response markup is limited to category: R (rData), script ®, data (csv, xls), plot (png, jpg, svg), shell (sh, bat), pdf, text, other
boolean
query external if `true`, this call returns directories found in the external repository, otherwise returns files found in the default repository
boolean

Responses

HTTP Code Description Schema
200 Success RepositoryDirectoryListResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/repository/directory/create

This call creates a repository-managed custom directory.

If the name of the new custom directory is already in use by the caller the response markup will indicate an appropriate error.

Example HTTP 200 response - /r/repository/directory/create

{
    "deployr": {
        "response": {
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "call": "/r/repository/directory/create",
            "repository": {
                "directory": {
                    "directory": "demo",
                    "owner": "george"
                }
            }
        }
    }
}  

POST /r/repository/directory/create

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml) json
formData directory
required
specifies the name of the new custom directory
string

Responses

HTTP Code Description Schema
200 Success RepositoryDirectoryResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/repository/directory/rename

This call renames an existing repository-managed user directory ( custom or archived ).

When renaming a user directory, all files in the source directory are automatically moved to the destination directory. If the destination directory already exists the call will be rejected and the response markup will indicate an appropriate error.

You can use this call to convert an archived directory back into a custom directory, essentially unarchiving the archived directory.

Note: You can not rename the root directory. To move files from the root directory use the /r/repository/directory/move call.

Important:

This call will only move files that are owned by a single author to the destination directory. If a repository-managed file in the source directory has multiple authors, as a result of collaboration using the /r/repository/file/grant call, the file will not be moved to the destination directory and a warning to that affect will be indicated in the response markup.

Example HTTP 200 response - /r/repository/directory/rename

{
    "deployr": {
        "response": {
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "call": "/r/repository/directory/rename",
            "repository": {
                "directory": {
                    "directory": "demo",
                    "owner": "george"
                }
            }
        }
    }
}  

POST /r/repository/directory/rename

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml) json
formData directory
required
specifies the name of the new custom directory
string

Responses

HTTP Code Description Schema
200 Success RepositoryDirectoryResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/repository/directory/copy

This call copies one or more repository-managed files from a source user directory to a destination user directory. If the filename parameter is specified, only those files indicated on that parameter are copied. Otherwise, all files in the source directory are copied. To ensure copying files does not accidentally overwrite any existing files in the destination directory, all copied files are created as new versions in the destination directory.

Example HTTP 200 response - /r/repository/directory/copy

{
    "deployr": {
        "response": {
            "call": "/r/repository/directory/copy",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c"
        }
    }
}

POST /r/repository/directory/copy

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml) json
formData directory
required
specifies the name of the new custom directory
string
formData destination comma-separated list of filenames to be copied. If omitted, all files in the source directory are copied
string
formData filerename comma-separated list of new filenames for copied files identified on filename parameter
string

Responses

HTTP Code Description Schema
200 Success Response
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/repository/directory/move

This call moves one or more repository-managed files from a source user directory to a destination user directory.

If the filename parameter is specified, only those files indicated on that parameter are moved. Otherwise, all files in the source directory are moved.

To ensure moving files does not accidentally overwrite any existing files in the destination directory, all moved files are created as new versions in the destination directory.

Important:

This call will only move files that are owned by a single author to the destination directory. If a repository-managed file in the source directory has multiple authors, as result of collaboration using the /r/repository/file/grant call, the file will not be moved to the destination directory and a warning to that affect will be indicated in the response markup.

Example HTTP 200 response - /r/repository/directory/move

{
    "deployr": {
        "response": {
            "call": "/r/repository/directory/move",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c"
        }
    }
}

POST /r/repository/directory/move

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml) json
formData directory
required
specifies the name of the source user directory
string
formData destination
required
specifies the name of the destination user directory
string
formData filename comma-separated list of filenames to be moved. If omitted, all files in the source directory are moved
string

Responses

HTTP Code Description Schema
200 Success Response
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/repository/directory/update

This call updates repository-managed file access controls by directory. If the filename parameter is specified, only those files indicated on that parameter are updated. Otherwise, all files in the source directory are updated.

Example HTTP 200 response - /r/repository/directory/update

{
    "deployr": {
        "response": {
            "call": "/r/repository/directory/update",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c"
        }
    }
}

POST /r/repository/directory/update

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml) json
formData directory
required
specifies the name of the user directory, root or custom
string
formData filename comma-separated list of filenames to be updated. If omitted, all files in the source directory are updated
string
formData restricted comma-separated list of role names, making files visible to authenticated users with these roles
boolean
formData shared if `true`, files are shared and visible to authenticated users
boolean
formData published if `true`, files are published and visible to authenticated and anonymous users
boolean

Responses

HTTP Code Description Schema
200 Success Response
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/repository/directory/archive

This call archives one or more repository-managed files from a source user directory ( root or custom ) to an archive directory.

If the value of the archive parameter indicates an existing archive directory then the files in the source directory are added to the existing archive. Otherwise, a new archive directory is automatically created on behalf of the caller. Archived directories automatically have a .archive postfix appended to their name if it is not supplied on the archive parameter value.

If all of the files in the source directory are successfully archived, the source directory is automatically deleted from the repository. If the source directory was root , an empty root directory is preserved. If any of the files in the source directory are skipped or can not be archived (see following note), those files and the source directory are preserved.

Important:

This call will only archive files that are owned by a single author to the destination directory. If a repository-managed file in the source directory has multiple authors, as a result of collaboration using the /r/repository/file/grant call, the file will not be archived to the destination directory and a warning to that affect will be indicated in the response markup.

Example HTTP 200 response - /r/repository/directory/archive

{
    "deployr": {
        "response": {
            "success": true,
            "call": "/r/repository/directory/archive",
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "repository": {
                "directory": {
                    "directory": "savedExamples.archive",
                    "owner": "george"
                }
            }
        }
    }
}

POST /r/repository/directory/archive

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml) json
formData directory
required
specifies the name of the user directory, root or custom
string
formData archive
required
specifies the target name for the archived directory. If omitted, a .archive extension is automatically added
string
formData filename comma-separated list of filenames to be archived. If omitted all files in the source directory are archived
boolean

Responses

HTTP Code Description Schema
200 Success RepositoryDirectoryResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

/r/repository/directory/upload

This call uploads a set of files in a zip archive into an exist repository-managed user directory ( root , custom or archived ).

Example HTTP 200 response - /r/repository/directory/upload

{
    "deployr": {
        "response": {
            "call": "/r/repository/directory/upload",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c"
        }
    }
}

POST /r/repository/directory/upload

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData file
required
zip archive file content file
formData directory specifies the name of the user directory into which the files are to be uploaded string
formData desrc specifies a description to associate with the uploaded file string
formData tags specifies tag words to associate with the repository file string
formData restricted comma-separated list of role names, which makes the file visible to authenticated users with these roles
string
formData shared if `true`, the file will be shared which makes the file visible to authenticated users
boolean
formData published if `true`, the file will be published which makes the file visible to authenticated and anonymous users
boolean
formData newversion if `true`, the repository will create new version rather than overwrite
boolean
formData newversionmsg if newversion is `true`, message to associate with new version
boolean

Responses

HTTP Code Description Schema
200 Success Response
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

Produces

/r/repository/directory/download

This call downloads one or more repository-managed files from a directory in the repository. The response type on this call is a zip archive file.

If the filename parameter is specified, only those files indicated on that parameter are downloaded. Otherwise, all files in the source directory are downloaded.

GET /r/repository/directory/download

Method

GET

Parameters:

Type Name Description Schema Default
formData format
required
specifies markup encoding on call (json or xml) enum (json, xml)
query directory
required
specifies the name of the user directory to be downloaded
string
query filename comma-separated list of filenames to be copied. If omitted, all files in the source directory are copied
string

Responses

HTTP Code Description Schema
200 Success string
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

Produces

/r/repository/directory/delete

This call deletes a repository-managed user directory ( root , custom or archived ).

When deleting a user directory, all files in the directory are automatically deleted along with the directory. If the target directory is root , an empty root directory is preserved.

Example HTTP 200 response - /r/repository/directory/delete

{
    "deployr": {
        "response": {
            "call": "/r/repository/directory/delete"
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c"
        }
    }
}        

POST /r/repository/directory/delete

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData directory
required
specifies the name of the user directory to be deleted
string

Responses

HTTP Code Description Schema
200 Success Response
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

Produces

/r/repository/file/list

This call lists repository-managed files.

The categoryFilter parameter can be used to filter the types of files returned on the response markup. The following values are supported on this parameter:

For example, using a combination of the categoryFilter and directory parameters, a call can request only binary R object files found in a specific directory: /r/repository/file/list?categoryFilter=R&directory=example.

Example HTTP 200 response - /r/repository/file/list

{
    "deployr": {
        "response": {
            "call": "/r/repository/file/list",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "repository": {
                "files": [
                    {
                        "filename": "data.csv",
                        "directory": "root",
                        "descr": "Sample csv data."
                        "author": "george",
                        "authors": [
                            "george"
                        ],
                        "version": null,
                        "versionmsg": null,
                        "latestby": "george",
                        "type": "text/plain",
                        "category": "data",
                        "tags": null,
                        "length": 8,
                        "sha256": "ad5bbaaff7b8f27899b3471a41350b61",
                        "lastModified": 1378391545018,
                        "restricted": null,
                        "shared": false,
                        "published": true,
                        "access": "Public",
                        "url": "http://dhost:dport/deployr/r/repository/
                        file/download/george/data.csv"
                    },
                    {
                        "filename": "SavedX.rData",
                        "directory": "root",
                        "descr": "Sample binary R object."
                        "author": "george",
                        "authors": [
                            "george"
                        ],
                        "version": null,
                        "versionmsg": null,
                        "latestby": "george",
                        "type": "application/octet-stream",
                        "category": "R",
                        "tags": null,
                        "length": 74,
                        "sha256": "7083dd400b3345ebb75c4b8e41ad9d70",
                        "lastModified": 1378391505577,
                        "restricted": null,
                        "shared": false,
                        "published": false,
                        "access": "Private",
                        "url": "http://dhost:dport/deployr/r/repository/
                        file/download/george/SavedX.rData"
                    },
                    {
                        "filename": "demo.R",
                        "directory": "root",
                        "descr": "Sample R script.",
                        "author": "george",
                        "authors": [
                            "george"
                        ],
                        "version": null,
                        "versionmsg": null,
                        "latestby": "george",
                        "type": "text/plain",
                        "category": "script",
                        "tags": null,
                        "length": 6,
                        "sha256": "77d7c62ca2bc4ac236235020fa3cb319",
                        "lastModified": 1378391625616,
                        "restricted": "MARKETING",
                        "shared": true,
                        "published": false,
                        "access": "Restricted",
                        "url": "http://dhost:dport/deployr/r/repository/
                        file/download/george/demo.R"
                    }
                ]
            }
        }
    }
}        

GET /r/repository/file/list

Method

GET

Parameters:

Type Name Description Schema Default
query format
required
specifies markup encoding on call (json or xml). enum (json, xml)
query ilename when specified, call returns a list of file versions for the filename
string
query directory when specified, used in conjunction with filename parameter to identify specific file
string
query shared if `true`, files that are restricted but visible or shared by other users are included in the response markup
boolean
query published if `true`, files that are published by other users are included in the response markup
boolean
query categoryFilter when specified list of files in response markup is limited to category: R (rData), script ®, data (csv, xls), plot (png, jpg, svg), shell (sh, bat), pdf, text, other
string
query external if `true`, this call returns files found in the external repository, otherwise returns files found in the default repository
boolean

Responses

HTTP Code Description Schema
200 Success RepositoryFileListResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

Produces

/r/repository/file/fetch

This call fetches the latest meta-data on a file in the repository.

Example HTTP 200 response - /r/repository/file/fetch

{
    "deployr": {
        "response": {
            "call": "/r/repository/file/fetch",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "repository": {
                "file": {
                    "filename": "demo.R",
                    "directory": "root",
                    "descr": "Sample R script.",
                    "author": "george",
                    "authors": [
                        "george"
                    ],
                    "version": null,
                    "versionmsg": null,
                    "latestby": "george",
                    "type": "text/plain",
                    "category": "script",
                    "tags": null,
                    "length": 6,
                    "sha256": "77d7c62ca2bc4ac236235020fa3cb319",
                    "lastModified": 1378391625616,
                    "restricted": "MARKETING",
                    "shared": true,
                    "published": false,
                    "access": "Restricted",
                    "url": "http://dhost:dport/deployr/r/repository/
                    file/download/george/demo.R"
                }
            }
        }
    }
}

POST /r/repository/file/fetch

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData filename
required
specifies the repository file name
string
formData author
required
specifies the repository file author
string
formData directory specifies the target repository directory, defaults to root
string
formData version specifies the repository file version
string

Responses

HTTP Code Description Schema
200 Success RepositoryFileResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

Produces

/r/repository/file/upload

This call uploads a file from the user’s computer to the repository.

Example HTTP 200 response - /r/repository/file/upload

{
    "deployr": {
        "response": {
            "call": "/r/repository/file/upload",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "repository": {
                "file": {
                    "filename": "demo.R",
                    "directory": "root",
                    "descr": "Sample R script.",
                    "author": "george",
                    "authors": [
                        "george"
                    ],
                    "version": null,
                    "versionmsg": null,
                    "latestby": "george",
                    "type": "text/plain",
                    "category": "script",
                    "tags": null,
                    "length": 6,
                    "sha256": "77d7c62ca2bc4ac236235020fa3cb319",
                    "lastModified": 1378391625616,
                    "restricted": "MARKETING",
                    "shared": true,
                    "published": false,
                    "access": "Restricted",
                    "url": "http://dhost:dport/deployr/r/repository/file/download/george/demo.R"
                }
            }
        }
    }
}        

POST /r/repository/file/upload

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData filename
required
specifies the name of the file to upload string
formData file
required
file content file
formData directory specifies the target repository directory, defaults to root
string
formData desrc specifies a description to associate with the uploaded file
string
formData tags specifies tag words to associate with the repository file string
formData restricted comma-separated list of role names, which makes the file visible to authenticated users with these roles
string
formData shared if `true`, the file will be shared which makes the file visible to authenticated users
boolean
formData published if `true`, the file will be published which makes the file visible to authenticated and anonymous users
boolean
formData newversion if `true`, the repository will create new version rather than overwrite
boolean
formData newversionmsg if newversion is `true`, message to associate with new version
boolean
formData inputs specifies the inputs property on a repository-managed script
string
formData outputs specifies the outputs property on a repository-managed script
string

Responses

HTTP Code Description Schema
200 Success RepositoryFileResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

Produces

/r/repository/file/transfer

This call transfers a file from a URL to the repository.

Example HTTP 200 response - /r/repository/file/transfer

{
    "deployr": {
        "response": {
            "call": "/r/repository/file/transfer",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "repository": {
                "file": {
                    "filename": "demo.R",
                    "directory": "root",
                    "descr": "Sample R script.",
                    "author": "george",
                    "authors": [
                        "george"
                    ],
                    "version": null,
                    "versionmsg": null,
                    "latestby": "george",
                    "type": "text/plain",
                    "category": "script",
                    "tags": null,
                    "length": 6,
                    "sha256": "77d7c62ca2bc4ac236235020fa3cb319",
                    "lastModified": 1378391625616,
                    "restricted": "MARKETING",
                    "shared": true,
                    "published": false,
                    "access": "Restricted",
                    "url": "http://dhost:dport/deployr/r/repository/file/download/george/demo.R"
                }
            }
        }
    }
}        

POST /r/repository/file/transfer

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData filename
required
specifies the name of the file to upload string
formData url
required
specifies a url of the file to upload string
formData directory specifies the target repository directory, defaults to root
string
formData desrc specifies a description to associate with the uploaded file
string
formData tags specifies tag words to associate with the repository file string
formData restricted comma-separated list of role names, which makes the file visible to authenticated users with these roles
string
formData shared if `true`, the file will be shared which makes the file visible to authenticated users
boolean
formData published if `true`, the file will be published which makes the file visible to authenticated and anonymous users
boolean
formData newversion if `true`, the repository will create new version rather than overwrite
boolean
formData newversionmsg if newversion is `true`, message to associate with new version
boolean
formData inputs specifies the inputs property on a repository-managed script
string
formData outputs specifies the outputs property on a repository-managed script
string

Responses

HTTP Code Description Schema
200 Success RepositoryFileResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

Produces

/r/repository/file/write

This call writes a text file to the repository.

Example HTTP 200 response - /r/repository/file/write

{
    "deployr": {
        "response": {
            "call": "/r/repository/file/write",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "repository": {
                "file": {
                    "filename": "demo.R",
                    "directory": "root",
                    "descr": "Sample R script.",
                    "author": "george",
                    "authors": [
                        "george"
                    ],
                    "version": null,
                    "versionmsg": null,
                    "latestby": "george",
                    "type": "text/plain",
                    "category": "script",
                    "tags": null,
                    "length": 6,
                    "sha256": "77d7c62ca2bc4ac236235020fa3cb319",
                    "lastModified": 1378391625616,
                    "restricted": "MARKETING",
                    "shared": true,
                    "published": false,
                    "access": "Restricted",
                    "url": "http://dhost:dport/deployr/r/repository/file/download/george/demo.R"
                }
            }
        }
    }
}        

POST /r/repository/file/write

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData filename
required
specifies the name of the file to upload string
formData text
required
specifies the text content of the file to upload string
formData directory specifies the target repository directory, defaults to root
string
formData desrc specifies a description to associate with the uploaded file
string
formData tags specifies tag words to associate with the repository file string
formData restricted comma-separated list of role names, which makes the file visible to authenticated users with these roles
string
formData shared if `true`, the file will be shared which makes the file visible to authenticated users
boolean
formData published if `true`, the file will be published which makes the file visible to authenticated and anonymous users
boolean
formData newversion if `true`, the repository will create new version rather than overwrite
boolean
formData newversionmsg if newversion is `true`, message to associate with new version
boolean
formData inputs specifies the inputs property on a repository-managed script
string
formData outputs specifies the outputs property on a repository-managed script
string

Responses

HTTP Code Description Schema
200 Success RepositoryFileResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

Produces

/r/repository/file/update

This call updates the properties on a repository-managed file.

Example HTTP 200 response - /r/repository/file/update

{
    "deployr": {
        "response": {
            "call": "/r/repository/file/update",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "repository": {
                "file": {
                    "filename": "demo.R",
                    "directory": "root",
                    "descr": "Sample R script.",
                    "author": "george",
                    "authors": [
                        "george"
                    ],
                    "version": null,
                    "versionmsg": null,
                    "latestby": "george",
                    "type": "text/plain",
                    "category": "script",
                    "tags": null,
                    "length": 6,
                    "sha256": "77d7c62ca2bc4ac236235020fa3cb319",
                    "lastModified": 1378391625616,
                    "restricted": "MARKETING",
                    "shared": true,
                    "published": false,
                    "access": "Restricted",
                    "url": "http://dhost:dport/deployr/r/repository/file/download/george/demo.R"
                }
            }
        }
    }
}        

POST /r/repository/file/update

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData filename
required
pecifies the name of the repository file string
formData directory specifies the target repository directory, defaults to root
string
formData desrc specifies a description to associate with the repository file
string
formData tags specifies tag words to associate with the repository file
string
formData restricted comma-separated list of role names, which makes the file visible to authenticated users with these roles
string
formData shared if `true`, the file will be shared which makes the file visible to authenticated users
boolean
formData published if `true`, the file will be published which makes the file visible to authenticated and anonymous users
boolean
formData inputs specifies the inputs property on a repository-managed script
string
formData outputs specifies the outputs property on a repository-managed script
string

Responses

HTTP Code Description Schema
200 Success RepositoryFileResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

Produces

/r/repository/file/diff

This call generates a diff between the current working copy of a file and a specific version found in the files version history.

GET /r/repository/file/diff

Method

GET

Parameters:

Type Name Description Schema Default
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
query filename
required
specifies the name of the repository file string
query author
required
specifies the repository file author
string
query version
required
specifies the repository file version to diff against the current working copy
string
query directory specifies the target repository directory, defaults to root
string

Responses

HTTP Code Description Schema
200 Success string
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

Produces

/r/repository/file/revert

This call reverts the current working copy of a file to a specific version found in the files version history.

Example HTTP 200 response - /r/repository/file/revert

{
    "deployr": {
        "response": {
            "call": "/r/repository/file/revert",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "repository": {
                "file": {
                    "filename": "demo.R",
                    "directory": "root",
                    "descr": "Sample R script.",
                    "author": "george",
                    "authors": [
                        "george"
                    ],
                    "version": null,
                    "versionmsg": null,
                    "latestby": "george",
                    "type": "text/plain",
                    "category": "script",
                    "tags": null,
                    "length": 6,
                    "sha256": "77d7c62ca2bc4ac236235020fa3cb319",
                    "lastModified": 1378391625616,
                    "restricted": "MARKETING",
                    "shared": true,
                    "published": false,
                    "access": "Restricted",
                    "url": "http://dhost:dport/deployr/r/repository/file/download/george/demo.R"
                }
            }
        }
    }
}        

POST /r/repository/file/revert

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData filename
required
specifies the name of the repository file string
formData version
required
specifies the repository file version to revert into the current working copy
string
formData directory specifies the target repository directory, defaults to root
string
formData desrc specifies a description to associate with the repository file
string
formData restricted comma-separated list of role names, which makes the file visible to authenticated users with these roles
string
formData shared if `true`, the file will be shared which makes the file visible to authenticated users
boolean
formData published if `true`, the file will be published which makes the file visible to authenticated and anonymous users
boolean
formData newversion if `true`, the repository will create new version rather than overwrite
boolean
formData newversionmsg if newversion is `true`, message to associate with the new version
string
formData inputs specifies the inputs property on a repository-managed script
string
formData outputs specifies the outputs property on a repository-managed script
string

Responses

HTTP Code Description Schema
200 Success RepositoryFileResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

Produces

/r/repository/file/grant

This call grants and/or revokes ownership rights on a repository-managed file.

If the caller is an owner of the file, the caller can:

Grant ownership rights to one or more authenticated users and/or Revoke ownership rights for one or more owners. As this API call is provided to support collaborative workflows, it assumes fair not malicious usage by owners.

Revoking ownership rights is equivalent to the caller deleting the file on behalf of the owners indicated on the revokeauthor parameter. The caller can even revoke their own ownership on a file by specifying their own username on the revokeauthor parameter which is equivalent to calling the /repository/file/delete call.

Notes on parameters:

Example HTTP 200 response - /r/repository/file/grant

{
    "deployr": {
        "response": {
            "call": "/r/repository/file/grant",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "repository": {
                "file": {
                    "filename": "demo.R",
                    "directory": "root",
                    "descr": "Sample R script.",
                    "author": "george",
                    "authors": [
                        "george"
                    ],
                    "version": null,
                    "versionmsg": null,
                    "latestby": "george",
                    "type": "text/plain",
                    "category": "script",
                    "tags": null,
                    "length": 6,
                    "sha256": "77d7c62ca2bc4ac236235020fa3cb319",
                    "lastModified": 1378391625616,
                    "restricted": "MARKETING",
                    "shared": true,
                    "published": false,
                    "access": "Restricted",
                    "url": "http://dhost:dport/deployr/r/repository/file/download/george/demo.R"
                }
            }
        }
    }
}        

POST /r/repository/file/grant

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData filename
required
specifies the name of the repository file string
formData newauthor specifies a comma-separated list of grantee usernames
string
formData revokeauthor specifies a comma-separated list of revokee usernames
boolean
formData directory specifies the target repository directory, defaults to root
string

Responses

HTTP Code Description Schema
200 Success RepositoryFileResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

Produces

/r/repository/file/download

This call downloads one-or-more repository-managed files.

When two or more files are being downloaded, the response type on this call is a zip archive file.

GET /r/repository/file/download

Method

GET

Parameters:

Type Name Description Schema Default
query format
required
specifies markup encoding on call (json or xml). enum (json, xml)
query filename
required
comma-separated list of filenames to be downloaded
string
query author
required
comma-separated list of authors for named files
string
query directory
required
comma-separated list of directories for named files
string
query version comma-separated list of versions for named files
string

Responses

HTTP Code Description Schema
200 Success string
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

Produces

/r/repository/file/delete

This call deletes one-or-more files from the repository.

Example HTTP 200 response - /r/repository/file/delete

{
    "deployr": {
        "response": {
            "call": "/r/repository/file/delete",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c"
        }
    }
}

POST /r/repository/file/delete

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData filename
required
comma-separated list of filenames to be deleted
string
formData directory
required
comma-separated list of directories for named files
string

Responses

HTTP Code Description Schema
200 Success Response
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

Produces

/r/repository/file/copy

This call copies one or more repository-managed files to the destination directory.

If the destination directory already contains a filename matching an incoming filename, then a new version of the file is automatically created.

Example HTTP 200 response - /r/repository/file/copy

{
    "deployr": {
        "response": {
            "call": "/r/repository/file/copy",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c"
        }
    }
}

POST /r/repository/file/copy

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData filename
required
comma-separated list of filenames to be copied
string
formData directory
required
comma-separated list of directories for named files
string
formData destination
required
specifies the name of the destination user directory in the repository
string
formData version comma-separated list of versions for named files
string
formData filerename comma-separated list of new filenames for copied files identified on filename parameter
string

Responses

HTTP Code Description Schema
200 Success Response
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

Produces

/r/repository/file/move

This call moves one or more repository-managed files to the destination directory.

If the destination directory already contains a filename matching an incoming filename, then a new version of the file is automatically created.

Example HTTP 200 response - /r/repository/file/move

{
    "deployr": {
        "response": {
            "call": "/r/repository/file/move",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c"
        }
    }
}

POST /r/repository/file/move

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token. string
formData format
required
specifies markup encoding on call (json or xml). enum (json, xml)
formData filename
required
comma-separated list of filenames to be moved
string
formData directory
required
comma-separated list of directories for named files
string
formData destination
required
specifies the name of the destination user directory in the repository
string
formData version comma-separated list of versions for named files
string

Responses

HTTP Code Description Schema
200 Success Response
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

Produces

/r/repository/script/list

This call lists repository-managed scripts.

This call is available to authenticated and anonymous users. However, if the caller is an anonymous user then only published scripts will be returned in the response markup.

Example HTTP 200 response - /r/repository/script/list

{
    "deployr": {
        "response": {
            "call": "/r/repository/script/list",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "repository": {
                "scripts": [
                    {
                        "filename": "demo.R",
                        "descr": "Sample R script.",
                        "author": "george",
                        "authors": [
                            "george"
                        ],
                        "version": null,
                        "versionmsg": null,
                        "latestby": "george",
                        "type": "text/plain",
                        "category": "script",
                        "tags": null,
                        "length": 6,
                        "sha256": "77d7c62ca2bc4ac236235020fa3cb319",
                        "lastModified": 1378391625616,
                        "restricted": "MARKETING",
                        "shared": true,
                        "published": false,
                        "access": "Restricted",
                        "url": "http://dhost:dport/deployr/r/repository/
                        file/download/george/demo.R"
                    },
                    {
                        "filename": "sales.R",
                        "descr": "Sales analysis by region.",
                        "author": "susan",
                        "authors": [
                            "susan"
                        ],
                        "version": null,
                        "versionmsg": null,
                        "latestby": "susan",
                        "type": "text/plain",
                        "category": "script",
                        "tags": null,
                        "length": 674,
                        "sha256": "50d7c62ca2bc4ac236235020fa3cb913",
                        "lastModified": 1378391625616,
                        "restricted": null,
                        "shared": false,
                        "published": true,
                        "access": "Public",
                        "url": "http://dhost:dport/deployr/r/repository/
                        file/download/susan/sales.R"
                    }
                ]
            }
        }
    }
}        

GET /r/repository/script/list

Method

GET

Parameters:

Type Name Description Schema Default
query format
required
specifies markup encoding on call (json or xml). enum (json, xml)
query filename
required
when specified, call returns list of script versions for filename
string
query shared if `true`, scripts shared by other users are included in the response markup
boolean
query published if `true`, scripts published by other users are included in the response markup
boolean
query external if `true`, this call returns scripts found in the external repository, otherwise returns scripts found in the default repository
boolean

Responses

HTTP Code Description Schema
200 Success RepositoryScriptListResponse
400 Bad Request: invalid data on call string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

Produces

/r/repository/script/execute

This call executes repository-managed scripts or external scripts on an Anonymous Project.

To execute a single repository-managed script the caller must provide parameter values for filename, author and optionally version. To execute a chain of repository-managed scripts the caller must provide a comma-separated list of values on the filename, author and optionally version parameters.

To execute a single external script the caller must provide a valid URL or file path using the externalsource parameter. To execute a chain of external scripts the caller must provide a comma-separated list of values on the externalsource parameter. Note, to execute an external script the caller must have POWER_USER privileges so this feature is not available to anonymous users on this call.

Note: A chained execution executes each of the scripts identified on the call in a sequential fashion on the R session, with execution occuring in the order specified on the parameter list.

Please see the Standard Execution Model section for further details about the parameters on this call.

Some key data indicated in the response markup on this call: - console - indicates the R console output resulting from the execution - results - indicates the list of files generated by the R graphics device - artifacts - indicates the list of files generated or modified in the working directory - objects - indicates the list of R objects returned from the workspace - files - indicates the list of files and objects stored in the repository after the execution completes - interrupted - indicates the interrupted status of execution - error - on failure, indicates the reason for failure - errorCode - on failure, indicates the error code for failure

Example HTTP 200 response - /r/repository/script/execute

{
    "deployr": {
        "response": {
            "call": "/r/repository/script/execute",
            "success": true
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "project": {
                "project": "STATELESS-a818abcc-82a5-4df5-8604-01da26f85188",
                "name": "Project: Autosaved",
                "author": "STATELESS",
                "authors": [
                    "STATELESS"
                ],
                "descr": "Autosaved by DeployR."
                "longdescr": null,
                "shared": false,
                "lastmodified": 1378395562038,
                "live": true,
                "cookie": null,
                "origin": "Project original."
            },
            "interrupted": false,
            "execution": {
                "code": "# Create a vector of auto sales for each category
of vechicles. rn# The value contains the number of units sold each weekday:rn# (i.e. 1 car sold on Monday, 3 cars sold on Tuesday...)rn cars <- c(1, 3, 6, 4, 9)rntrucks <- c(2, 5, 4, 5, 12)rnsuvs <- c(4,4,6,6,16)rn rn# Create a table from the vectors.rnautos_data <- cbind(cars, trucks, suvs)rn rn# Show the the table.rn print(autos_data)rn rn# Send the plot to a file called histogram.png. rnpng("histogram.png")rn rn# Create a histogram of auto sales. rnbarplot(as.matrix(autos_data), main="Autos", ylab= "Total", beside=TRUE, col=rainbow(5))rn rn# Place the legend at the top-left corner with no frame, using rainbow colors.rnlegend("topleft", c("Mon","Tue","Wed","Thu","Fri"), cex=0.6, bty="n", fill=rainbow(5))rn# Restore the plot device.rndev.off()rn",
                "resultsAvailable": 0,
                "actor": "anonymous",
                "tag": null,
                "interrupted": false,
                "timeStart": 1378316295608,
                "timeCode": 74
                "timeTotal": 373,
                "resultsGenerated": 0,
                "resultsAvailable": 0,
                "execution": "EXEC-38bc9824-9dc8-4d42-90d3-9cb5d9d366b1",
                "console": "n> # Create a vector of auto sales for each
category of vechicles. n> # The value contains the number of units sold each weekday:n> # (i.e. 1 car sold on Monday, 3 cars sold on Tuesday...)n> cars <- c(1, 3, 6, 4, 9)nn> trucks <- c(2, 5, 4, 5, 12)nn> suvs <- c(4,4,6,6,16)nn> # Create a table from the vectors.n> autos_data <- cbind(cars, trucks, suvs)nn> # Show the the table.n> print(autos_data)n     cars trucks suvsn[1,]    1      2    4n[2,]
    3      5    4n[3,]    6      4    6n[4,]    4      5    6n
[5,]    9     12   16nn> # Send the plot to a file called histogram.png. n> png("histogram.png")nn> # Create a histogram of auto sales.n> barplot(as.matrix(autos_data), main="Autos", ylab= "Total",  beside=TRUE, col=rainbow(5))nn> # Place the legend at the top-left corner with no frame, using rainbow colors.n> legend("topleft", c("Mon","Tue","Wed", "Thu","Fri"), cex=0.6, bty="n", fill=rainbow(5))nn> # Restore the plot device.n> dev.off()npng n  2 n",
                "results": [],
                "artifacts": [
                    {
                        "filename": "histogram.png",
                        "descr": null,
                        "length": 7285,
                        "type": "image/png",
                        "category": "plot",
                        "project": "STATELESS-a818abcc-82a5-4df5-8604-01da26f85188",
                        "lastmodified": 1378395620000,
                        "url": "http://dhost:dport/deployr/r/repository/
                        script/directory/download/
                        STATELESS-a818abcc-82a5-4df5-8604-01da26f85188/histogram.png"
                    }
                ]
            },
                "warnings": [
                ]
            },
            "workspace": {
                "objects": []
            },
            "repository": {
                "files": []
            }
        }
    }
}      

POST /r/repository/script/execute

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token.
string
formData format
required
specifies markup encoding on call (json or xml).
enum (json, xml) json
formData filename comma-separated list of repository-managed script filenames
string
formData author
required
comma-separated list of authors, one author per filename
string
formData directory comma-separated list of repository-managed directories for scripts, defaults to root
string
formData version comma-separated list of versions, one version per filename
string
formData externalsource comma-separated list of URLs or file paths to external scripts
string
formData inputs DeployR-encoded inputs
string
formData csvinputs comma-separated list of primitive name/value inputs
string
formData preloadbydirectory comma-separated list of repository directory names
string
formData preloadfilename comma-separated list of repository filenames
string
formData preloadfiledirectory comma-separated list of directories, one directory per preloadfilename
string
formData preloadfileauthor comma-separated list of authors, one author per preloadfilename
string
formData preloadfileversion comma-separated list of versions, one version per preloadfilename
string
formData preloadobjectname comma-separated list of repository object (.rData) filenames
string
formData preloadobjectdirectory comma-separated list of directories, one directory per preloadobjectname string
formData preloadobjectauthor comma-separated list of authors, one author per preloadobjectname
string
formData preloadobjectversion comma-separated list of versions, one version per preloadobjectname
string
formData adoptworkspace identifies project whose workspace is to be adopted
string
formData adoptdirectory identifies project whose directory is to be adopted
string
formData adoptpackages identifies project whose package dependencies are to be adopted
string
formData blackbox if `true`, the execution will occur on the HTTP blackbox project for the current HTTP session
boolean
formData recycle if `true`, recycles the R session associated with the HTTP blackbox project on the current HTTP session
boolean
formData cluster specifies a grid node cluster for targeted execution
string
formData tag specifies a tag that labels the execution
string
formData echooff if `true` R commands will not appear in the console output saved on the project execution history for the job
boolean
formData consoleoff if `true` console output is not saved on the project execution history for the job
boolean
formData artifactsoff when enabled, artfiacts generated in the working directory are neither cached to the database nor reported in the response markup
boolean
formData enableConsoleEvents if `true` console events are delivered on the event stream when the job executes
boolean
formData graphics specifies preferred R graphics device for execution (png or svg)
string
formData graphicswidth specifies preferred width for R graphics device images
integer
formData graphicsheight specifies preferred height for R graphics device images
integer
formData robject specifies a comma-separated list of objects for retrieval following the execution string
string
formData storefile comma-separated list of working directory filenames
string
formData storeobject comma-separated list of workspace object names
string
formData storeworkspace filename (.rData) where workspace contents will be saved in the repository
string
formData storedirectory repository directory for stored files and objects after the execution completes, defaults to root
string
formData storenewversion if `true`, ensures each file stored in repository results in new version being created if needed
boolean
formData storepublic if `true`, publishes each file stored in the repository
boolean
formData infinity specifies custom value for Infinity appearing in R object data returned on call, otherwise Infinity is represented by `0x7ff0000000000000L`
string
formData nan specifies custom value for `NaN` appearing in R object data returned on call, otherwise `NaN` is represented by `null`
string
formData encodeDataFramePrimitiveAsVector if `true`, `data.frame` primitives are encoded `vectors` in R object data returned on call
boolean

Responses

HTTP Code Description Schema
200 Success RepositoryScriptExecuteResponse
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

Produces

/r/repository/script/render

This call executes repository-managed scripts or external scripts on an Anonymous Project and returns a simple HTML page that displays the results generated on the execution.

On a successful execution, the HTML page will display the following data when available on the response:

On a failed execution, the HTML page will display an error message indicating the cause of the failure and when available, R console output.

The API call makes it very simple to integrate outputs generated by DeployR-managed R scripts into any third-party application. It can also be used as a very simple test and debugging aid for R script and application developers.

To execute a single repository-managed script the caller must provide parameter values for filename , author and optionally version. To execute a chain of repository-managed scripts the caller must provide a comma-separated list of values on the filename , author and optionally version parameters.

To execute a single external script the caller must provide a valid URL or file path using the externalsource parameter. To execute a chain of external scripts the caller must provide a comma-separated list of values on the externalsource parameter. Note, to execute an external script the caller must have POWER_USER privileges so this feature is not available to anonymous users on this call.

Note: A chained execution executes each of the scripts identified on the call in a sequential fashion on the R session, with execution occuring in the order specified on the parameter list.

Please see the Standard Execution Model section for further details about the parameters on this call.

Some key data indicated in the response markup on this call:

GET /r/repository/script/render

Method

GET

Parameters:

Type Name Description Schema Default
query format if the inputs parameter if non-null, format must specifies the markup encoding on the call: json or xml
enum (json, xml) json
query project
required
specifies the project identifier
string
query filename comma-separated list of repository-managed script filenames
string
query author
required
comma-separated list of authors, one author per filename
string
query directory comma-separated list of repository-managed directories for scripts, defaults to root
string
query version comma-separated list of versions, one version per filename
string
query externalsource comma-separated list of URLs or file paths to external scripts
string
query inputs DeployR-encoded inputs
string
query csvinputs comma-separated list of primitive name/value inputs
string
query preloadbydirectory comma-separated list of repository directory names
string
query preloadfilename comma-separated list of repository filenames
string
query preloadfiledirectory comma-separated list of directories, one directory per preloadfilename
string
query preloadfileauthor comma-separated list of authors, one author per preloadfilename
string
query preloadfileversion comma-separated list of versions, one version per preloadfilename
string
query preloadobjectname comma-separated list of repository object (.rData) filenames
string
query preloadobjectdirectory comma-separated list of directories, one directory per preloadobjectname string
query preloadobjectauthor comma-separated list of authors, one author per preloadobjectname
string
query preloadobjectversion comma-separated list of versions, one version per preloadobjectname
string
query adoptworkspace identifies project whose workspace is to be adopted
string
query adoptdirectory identifies project whose directory is to be adopted
string
query adoptpackages identifies project whose package dependencies are to be adopted
string
query blackbox if `true`, the execution will occur on the HTTP blackbox project for the current HTTP session
boolean
query recycle if `true`, recycles the R session associated with the HTTP blackbox project on the current HTTP session
boolean
query cluster specifies a grid node cluster for targeted execution
string
query tag specifies a tag that labels the execution
string
query echooff if `true` R commands will not appear in the console output saved on the project execution history for the job
boolean
query consoleoff if `true` console output is not saved on the project execution history for the job
boolean
query artifactsoff when enabled, artfiacts generated in the working directory are neither cached to the database nor reported in the response markup
boolean
query enableConsoleEvents if `true` console events are delivered on the event stream when the job executes
boolean
query graphics specifies preferred R graphics device for execution (png or svg)
string
query graphicswidth specifies preferred width for R graphics device images
integer
query graphicsheight specifies preferred height for R graphics device images
integer
query robject specifies a comma-separated list of objects for retrieval following the execution
string
query storefile comma-separated list of working directory filenames
string
query storeobject comma-separated list of workspace object names
string
query storeworkspace filename (.rData) where workspace contents will be saved in the repository
string
query storedirectory repository directory for stored files and objects after the execution completes, defaults to root
string
query storenewversion if `true`, ensures each file stored in repository results in new version being created if needed
boolean
query storepublic if `true`, publishes each file stored in the repository
boolean
query infinity specifies custom value for Infinity appearing in R object data returned on call, otherwise Infinity is represented by `0x7ff0000000000000L`
string
query nan specifies custom value for `NaN` appearing in R object data returned on call, otherwise `NaN` is represented by `null`
string
query encodeDataFramePrimitiveAsVector if `true`, `data.frame` primitives are encoded `vectors` in R object data returned on call
boolean

Responses

HTTP Code Description Schema
200 Success string
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

Produces

/r/repository/script/interrupt

This call interrupts the current execution on the HTTP Blackbox project associated with the current HTTP session.

Example HTTP 200 response - /r/repository/script/interrupt

{
    "deployr": {
        "response": {
            "call": "/r/repository/script/interrupt",
            "success": true,
            "interrupted": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c"
        }
    }
}      

POST /r/repository/script/interrupt

Method

POST

Parameters:

Type Name Description Schema Default
header X-XSRF-TOKEN
required
specifies the CSRF token.
string
formData format
required
specifies markup encoding on call (json or xml).
enum (json, xml) json

Responses

HTTP Code Description Schema
200 Success Response
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
403 Forbidden Access: caller is unauthorized string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

Produces

EventStream

The event stream API is unique within the DeployR API as it supports push notifications from the DeployR server to client applications. Notifications correspond to discrete events that occur within the DeployR server. Rather than periodically polling the server for updates a client application can simply subscribe once to the event stream and then receive event notifications pushed by the server.

There are four distinct event categories:

/r/event/stream

This call connects to one of the following event streams: authenticated, anonymous, or management. Both the current authenticated status of the caller on this call and the parameters passed on the call determine the ultimate nature of the event stream connection.

By default, authenticated event streams deliver server-wide execution and job lifecycle events for the authenticated user. If the httpEventOnly parameter is specified then an authenticated event stream will see only execution events associated with the current HTTP session.

Example HTTP 200 response - /r/event/stream

// Event: streamConnectEvent
{
    "deployr": {
        "response": {
            "event": {
                "type": "streamConnectEvent",
                "context": "testuser",
                "whoami": "testuser",
                "uid": "UID-1e518408953d7920e1d7ae261694091c",
                "success": true
            },
            "whoami": "testuser",
            "call": "null",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c"
        }
    }
}
// Event: streamDisconnectEvent
{
    "deployr": {
        "response": {
            "event": {
                "type": "streamDisconnectEvent",
                "context": "testuser",
                "whoami": "testuser",
                "httpcookie": null,
                "success": true
            },
            "whoami": "testuser",
            "call": "null",
            "success": true
        }
    }
}
// Event: executionConsoleEvent
{
    "deployr": {
        "response": {
            "event": {
                "type": "executionConsoleEvent",
                "context": "PROJECT-53d17dec-07ad-4323-ae7a-e4219df4c300",
                "uid": "UID-1e518408953d7920e1d7ae261694091c"
                "output": "n> x <- rnorm(3)n",
                "object": null,
                "success": true,
                "error": null
            },
            "whoami": "testuser",
            "success": true,
            "call": "/r/event/stream",
            "uid": "UID-1e518408953d7920e1d7ae261694091c"
        }
    }
}
// Event: executionConsoleEvent (error)
{
    "deployr": {
        "response": {
            "event": {
                "type": "executionConsoleEvent",
                "context": "PROJECT-1b1ffafa-f6e8-468b-a4a1-1323743496b7",
                "http": "6A8C8D0B1CB161B8D140F78267363F87",
                "output": "object 'y' not found",
                "object": null,
                "success": false,
                "error": "object 'y' not found"
            },
            "whoami": "testuser",
            "call": "/r/event/stream",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c"
        }
    }
}

// Event: executionRevoEvent
{
    "deployr": {
        "response": {
            "event": {
                "type": "executionRevoEvent",
                "context": "PROJECT-53d17dec-07ad-4323-ae7a-e4219df4c300",
                "http": "7E25FE0FEB5E41454AB6A054FB697EA7",
                "output": "> revoEvent(x)n",
                "object": {
                    "rclass": "numeric",
                    "name": "x",
                    "value": [
                        0.6928559348535657,
                        -0.4710822416485657,
                        -0.5175046426793741
                    ],
                    "type": "vector"
                },
                "success": true,
                "error": null
            },
            "whoami": "testuser",
            "call": "/r/event/stream",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c"
        }
    }
}
// Event: executionErrorEvent
{
    "deployr": {
        "response": {
            "success": true,
            "call": "/r/event/stream",
            "whoami": "testuser",
            "uid": "UID-1e518408953d7920e1d7ae261694091c",
            "event": {
                "type": "executionErrorEvent",
                "context": "PROJECT-7656fec9-8882-4c0c-a366-10fca02df173",
                "http": "E56973C85A9E8A527CDC234958476152",
                "output": "unexpected symboln1: x yn ^",
                "object": null,
                "success": false,
                "error": "unexpected symboln1: x yn ^"
            }
        }
    }
}

// Event: jobLifecycleEvent
{
    "deployr": {
        "response": {
            "event": {
                "type": "jobLifecycleEvent",
                "context": "JOB-ef2d7ead-2278-48bb-a344-585febfad550",
                "jobname": "Sample Job",
                "jobowner": "testuser",
                "jobdescr": null,
                "jobpriority": "low",
                "jobstatus": "Completed",
                "jobstatusmsg": "Job successfully executed to completion.",
                "jobproject": "PROJECT-35e56b83-5b11-43b9-a494-635685923ede"
            },
            "whoami": "testuser",
            "success": true,
            "call": "/r/event/stream"
        }
    }
}
// Event: gridActivityEvent
{
    "deployr": {
        "response": {
            "event": {
                "type": "gridActivityEvent",
                "context": "PROJECT-ee994678-e0c4-4df4-bca4-72c4b31f032d",
                "activity": "Project: Sample Project",
                "owner": "testuser",
                "http": "2AEC4C4168B04FA5350A4C6924F46AC4",
                "node": "DeployR Default Node",
                "nodetype": "Authenticated",
                "isLive": true
            },
            "whoami": "testuser",
            "call": "/r/event/stream",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c"
        }
    }
}
// Event: gridWarningEvent
{
    "deployr": {
        "response": {
            "event": {
                "type": "gridWarningEvent",
                "context": "Concurrent authenticated project limit (1) reached for user testuser.",
                "error": "Concurrent authenticated project limit (1) reached for user testuser.",
                "errorcode": "910"
            },
            "whoami": "deployr",
            "call": "/r/event/stream",
            "success": true,
            "httpcookie": "grid"
        }
    }
}
// Event: gridHeartbeatEvent
{
    "deployr": {
        "response": {
            "success": true,
            "call": "/r/event/stream",
            "whoami": "deployr",
            "httpcookie": "grid",
            "event": {
                "type": "gridHeartbeatEvent",
                "context": "184.106.156.235:7000",
                "totalnodes": 2,
                "enablednodes": 2,
                "activenodes": 2,
                "totalslots": 200,
                "activeslots": 2,
                "nodes": [
                    {
                        "node": "NODE-1d02719e-c834-4033-8351-dd869afd79dc",
                        "name": "DeployR Default Node",
                        "description": "Default R processing node, mixed function.",
                        "type": "Mixed Mode",
                        "enabled": true,
                        "active": true,
                        "slotlimit": 100,
                        "slotcount": 1,
                        "slotactivity": [
                            {
                                "actor": "admin",
                                "activity": "PROJECT-421d6011-8b5c-4695-9da9-9bccbccca9c5",
                                "context": "Temporary Project",
                                "node": "DeployR Default Node",
                                "nodetype": "Authenticated",
                                "actorhttp": "D5C545B028A1A046FC80FC924084EA51",
                                "actorip": "75.147.180.59"
                            }
                        ]
                    },
                    {
                        "node": "NODE-77854d45-3a70-48f2-ba7f-2c91ca162935",
                        "name": "Auxiliary Node",
                        "description": "Remote R processing node, mixed function.",
                        "type": "Mixed Mode",
                        "enabled": true,
                        "active": true,
                        "slotlimit": 100,
                        "slotcount": 1,
                        "slotactivity": [
                            {
                                "actor": "testuser",
                                "activity": "JOB-55c6b4ff-a5b1-4c67-a886-b16cd976e54f",
                                "context": "Job: Demo Job.",
                                "node": "Auxiliary Node",
                                "nodetype": "Asynchronous",
                                "actorhttp": null,
                                "actorip": null
                            }
                        ]
                    }
                ]
            }
        }
    }
} // Event: securityLoginEvent
{
    "deployr": {
        "response": {
            "event": {
                "type": "securityLoginEvent",
                "context": "2B58D80182E3234940E201902017DD69",
                "http": "2B58D80182E3234940E201902017DD69",
                "username": "testuser",
                "displayname": "DeployR API Test Account",
                "error": null
            },
            "whoami": "testuser",
            "call": "/r/event/stream",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c"
        }
    }
}

// Event: securityLoginEvent (failure)
{
    "deployr": {
        "response": {
            "event": {
                "type": "securityLoginEvent",
                "context": "3AC5F8F978999C786E72FBC87BA4A273",
                "http": "3AC5F8F978999C786E72FBC87BA4A273",
                "username": "george",
                "displayname": null,
                "error": "User george could not be authenticated."
            },
            "whoami": "george",
            "call": "/r/event/stream",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c"
        }
    }
}

// Event: securityLogoutEvent
{
    "deployr": {
        "response": {
            "event": {
                "type": "securityLogoutEvent",
                "context": "15DBF1BF7F2A19EF535588B634342C98",
                "http": "15DBF1BF7F2A19EF535588B634342C98",
                "username": "testuser",
                "displayname": "DeployR API Test Account",
                "error": null
            }
            "whoami": "testuser",
            "call": "/r/event/stream",
            "success": true,
            "uid": "UID-1e518408953d7920e1d7ae261694091c"
        }
    }
}

POST /r/event/stream

Method

POST

Parameters:

Type Name Description Schema Default
formData managementEventOnly if specified, then event stream connection type is management
boolean false
formData httpEventOnly if specified, then execution events are limited to events associated with the current HTTP session
boolean false
formData revoEventOnly if specified, then execution executionConsoleEvent events are suppressed on the stream
boolean false

Responses

HTTP Code Description Schema
200 Success Response
400 Bad Request: invalid data on call string
401 Unauthorized Access: caller has insufficient privileges string
405 HTTP Method Disallowed: disallowed HTTP method on call string
503 Service Temporarily Unavailable: HTTP session temporarily invalidated string
default Error ErrorResponse

Consumes

Produces

Errors

When an API call returns an HTTP 200 status code the application should still test the success property in the response markup on each call to determine whether the DeployR server was able to successfully execute the service on behalf of the caller.

If the success property in the response markup indicates failure (with a value of false), then the application can inspect the error and errorCode properties in the response markup to determine the underlying cause of that failure.

The error property provides a plain text message describing the underlying failure. The errorCode property indicates the nature of the underlying error.

Possible values for the errorCode property are shown here:

Sample API (JSON) response markup indicating error on call

{
    "deployr": {
        "response": {
            "call": "/r/user/login",
            "success": false,
            "error": "Bad credentials",
            "errorCode": 900,
            "uid": "UID-2606B516198D7B2F62B43ADBA15F29C2"
        }
    }
}

API Change History

DeployR Enterprise for Microsoft R Server 2016 (v8.0.5)

The X-XSRF-TOKEN can be obtained from a successful authentication /r/user/login API call. The X-XSRF-TOKEN value can be retrieve from either the HTTP response header or the X-XSRF-TOKEN property in the response markup. The X-XSRF-TOKEN name|value must then be included in the HTTP request header for any future authenticated API calls, otherwise a HTTP 403 error will be given.

Example X-XSRF-TOKEN response property

    {
      "deployr": {
        "response": {
          "call": "/r/user/login",
          "success": true,
          "user": {
            "username": "george",
            "displayname": "George Best",
            "permissions": {
                "scriptManager": true,
                "powerUser": true,
                "packageManager": true,
                "administrator": false,
                "basicUser": true
            },
            "cookie": null
          },
          "limits": {
            "maxIdleLiveProjectTimeout": 1800,
            "maxConcurrentLiveProjectCount": 170,
            "maxFileUploadSize": 268435456
          },
          "uid": "UID-5CB911405DC6EB0F8E283990F7969E63",
          "X-XSRF-TOKEN": "53708abe-c5c2-4091-9ced-6314d49de0a3"
        }
      }
    }

Example uid response property


    {
        "deployr": {
            "response": {
                "call": "/r/user/release",
                "success": true,
                "whoami": "george",
                "uid": "UID-07D91F6C510E10ED84E6AC52CD0B6D1B"
            }
        }
    }

/r/repository/shell/execute has been removed