LoginSignup

This article is a Private article. Only a writer and users who know the URL can access it.
Please change open range to public in publish setting if you want to share this article with other users.

More than 5 years have passed since last update.

[RescaleAPI] JOBの詳細情報を取得する

Posted at

1. JOBの詳細情報を取得する

1.1 スクリプトの作成

このファイルを "rescale-specificjob.sh" という名前で保存します。

rescale-specificjob.shの作成
vi ${script}/rescale-specificjob.sh
source
#!/bin/sh

JOB_ID=$1
TOKEN="${RESCALE_API_TOKEN}"

curl -s -H "Authorization: Token ${TOKEN}" https://platform.rescale.jp/api/v2/jobs/${JOB_ID}/
実行権限付与
chmod +x ${script}/rescale-specificjob.sh

1.2 実行例

以下のように実行します。

実行方法
specificjobJson=$(rescale-specificjob.sh ${jobId})
echo ${specificjobJson} | jq .
結果例
{
  "monteCarloIterations": null,
  "paramFile": null,
  "name": "Hellow world",
  "includeNominalRun": false,
  "cluster": null,
  "jobanalyses": [
    {
      "envVars": {},
      "preProcessScriptCommand": "",
      "postProcessScriptCommand": "",
      "postProcessScript": null,
      "useRescaleLicense": false,
      "templateTasks": [],
      "analysis": {
        "version": "openmpi-1.6-el6",
        "code": "user_included_mpi",
        "name": "Bring Your Own MPI Software",
        "versionName": "Open MPI 1.6.4 on Enterprise Linux 6"
      },
      "hardware": {
        "coresPerSlot": 4,
        "isReusable": false,
        "coreType": "hpc-plus",
        "coreSummary": {
          "storagePerNode": 160000,
          "gpusPerNode": 0,
          "numberOfNodes": 1,
          "memoryPerNode": 15000
        },
        "slots": 1,
        "type": "compute",
        "walltime": 750
      },
      "command": "./sample.sh",
      "preProcessScript": null,
      "flags": {},
      "inputFiles": [
        {
          "pathParts": {
            "path": "user/user_QbQWc/sample-60459a75-c48c-4b2c-a0df-08b930688f20.sh",
            "container": "jpprod-rescale-platform"
          },
          "typeId": 1,
          "name": "sample.sh",
          "dateUploaded": "2017-02-12T14:31:49.668737Z",
          "relativePath": "sample.sh",
          "storage": {
            "storageType": "S3Storage",
            "id": "pCTMk",
            "connectionSettings": {
              "region": "ap-northeast-1"
            },
            "encryptionType": "default"
          },
          "decryptedSize": 39,
          "decompress": true,
          "downloadUrl": "https://platform.rescale.jp/api/v2/files/dSdSo/contents/",
          "sharedWith": [],
          "encodedEncryptionKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
          "owner": "daisuke@rescale.com",
          "path": "user/user_QbQWc/sample-60459a75-c48c-4b2c-a0df-08b930688f20.sh",
          "isUploaded": true,
          "viewInBrowser": true,
          "id": "dSdSo",
          "isDeleted": false,
          "md5": "598eb6c0c04498346cf3f375de358380"
        }
      ]
    }
  ],
  "projectId": null,
  "resourceFilters": [],
  "cidrRule": "0.0.0.0/0",
  "jobvariables": [],
  "publicKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX daisuke@Daisukes-MacBook-Pro.local",
  "sshPort": 22,
  "remoteVizConfig": null,
  "caseFile": null,
  "isLowPriority": true,
  "owner": "daisuke@rescale.com",
  "isTemplateDryRun": false,
  "expectedRuns": 1,
  "id": "zDQAo",
  "autoTerminateCluster": true,
  "archiveFilters": []
}
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up