List Scripts

get

/api/r-scripts/v1/scripts

Lists the scripts to which the current user has access.

Request

There are no request parameters for this operation.

Back to Top

Response

Supported Media Types

200 Response

List of accessible r scripts.
Body ()
Root Schema : schema
Type: array
Show Source
Nested Schema : EmbedScript
Type: object
Show Source

500 Response

Problem connecting to Broker, executing job or other unexpected error.
Body ()
Root Schema : ComputeContainerException
Type: object
Show Source
Back to Top

Examples

The following example lists the available scripts in the Oracle Machine Learning for R (OML4R) script repository. In the example, five scripts are in the repository. All are owned by the user OML_USER.

curl -i -X GET --header "Authorization: Bearer ${token}" \
--header 'Accept: application/json' \
"<oml-cloud-service-location-url>/oml/api/r-scripts/v1/scripts"

Response Headers

The response headers are the following:

HTTP/1.1 200 OK
Date: Thu, 28 Jul 2022 21:04:18 GMT
Content-Type: application/json
Content-Length: 1820
Connection: keep-alive
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1;mode=block
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
Content-Security-Policy: frame-ancestors 'none'

Response Body

The response body in JSON format is the following:

{"result":[
{"OWNER":"RQSYS","SCRIPT":"function (index) \n{\n    set.seed(index)\n    x <- rnorm(10)\n    res <- mean(x)\n    res\n}","NAME":"compute.randomMean"},
{"OWNER":"RQSYS","SCRIPT":"function (dat) \n{\n    res <- aggregate(dat, by = list(dat$Species), FUN = length)\n    colnames(res)[1] <- \"Species\"\n    res\n}","NAME":"group.count"},
{"OWNER":"RQSYS","SCRIPT":"function (dat) \n{\n    ore.load(name = \"ds_regr\")\n    pred = cbind(PRED = predict(regr, newdata = dat, supplemental.cols = \"Sepal.Length\"), dat[\"Sepal.Length\"])\n    pred\n}","NAME":"my.predict"},
{"OWNER":"OMLUSER","SCRIPT":"function (divisor = 100) \n{\n    id <- 1:10\n    plot(1:100, rnorm(100), pch = 21, bg = \"red\", cex = 2)\n  data.frame(id = id, val = id/divisor)\n}","NAME":"RandomRedDots"}]}
Back to Top