スクリプトのリスト

GET

/api/r-scripts/v1/scripts

現在のユーザーがアクセスできるスクリプトをリストします。

リクエスト

この操作にはリクエスト・パラメータはありません。

先頭に戻る

レスポンス

サポートされているメディア・タイプ

200レスポンス

アクセス可能なRスクリプトのリスト。
本文()
ルート・スキーマ: schema
型: array
ソースの表示
ネストされたスキーマ: EmbedScript
型: object
ソースの表示

500レスポンス

ブローカへの接続中、ジョブの実行中に問題が発生したか、または他の予期しないエラーが発生しました。
本文()
ルート・スキーマ: ComputeContainerException
型: object
ソースの表示
先頭に戻る

次の例では、Oracle Machine Learning for R (OML4R)スクリプト・リポジトリで使用可能なスクリプトをリストします。この例では、リポジトリに5つのスクリプトがあります。すべてがユーザー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"

レスポンス・ヘッダー

レスポンス・ヘッダーは次のとおりです。

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'

レスポンス本文

JSON形式のレスポンス本文は次のとおりです。

{"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"}]}
先頭に戻る