Skip to content

Oms API GET service state

amc1999 edited this page Feb 7, 2024 · 10 revisions

GET web-service state.

This method return job service state: model runs queue, active runs and run history.

This is a beta version and may change in the future.

Method:

GET /api/service/state

Call examples:

http://localhost:4040/api/service/state

Example:

{
  "IsJobControl": true,
  "IsQueuePaused": false,
  "JobUpdateDateTime": "2022-09-13 19:51:57.436",
  "MpiRes": {
    "Cpu": 8,
    "Mem": 0
  },
  "ActiveTotalRes": {
    "Cpu": 8,
    "Mem": 0
  },
  "ActiveOwnRes": {
    "Cpu": 8,
    "Mem": 0
  },
  "QueueTotalRes": {
    "Cpu": 6,
    "Mem": 0
  },
  "QueueOwnRes": {
    "Cpu": 6,
    "Mem": 0
  },
  "MpiErrorRes": {
    "Cpu": 0,
    "Mem": 0
  },
  "LocalRes": {
    "Cpu": 4,
    "Mem": 0
  },
  "LocalActiveRes": {
    "Cpu": 0,
    "Mem": 0
  },
  "LocalQueueRes": {
    "Cpu": 0,
    "Mem": 0
  },
  "Queue": [
    {
      "SubmitStamp": "2022_09_13_19_51_25_588",
      "Pid": 0,
      "CmdPath": "",
      "ModelName": "RiskPaths",
      "ModelDigest": "d90e1e9a49a06d972ecf1d50e684c62b",
      "RunStamp": "",
      "Dir": "",
      "Opts": {
        "OpenM.BaseRunDigest": "66646f985fecfb1d59fd5ff81ee3b78a",
        "OpenM.LogRank": "true",
        "OpenM.MessageLanguage": "en-CA",
        "OpenM.NotOnRoot": "true",
        "OpenM.RunName": "RiskPaths_New-6-sub-values",
        "OpenM.SetName": "New_2022",
        "OpenM.SubValues": "6",
        "OpenM.Threads": "3"
      },
      "Env": {},
      "Threads": 3,
      "IsMpi": true,
      "Mpi": {
        "Np": 3,
        "IsNotOnRoot": true,
        "IsNotByJob": true
      },
      "Template": "mpi.ModelRun.template.txt",
      "Tables": [
        "T02_TotalPopulationByYear",
        "TG03_Union_Tables",
        "TG02_Birth_Tables"
      ],
      "RunNotes": [],
      "Res": {
        "Cpu": 6,
        "Mem": 0
      },
      "IsOverLimit": false,
      "QueuePos": 1,
      "LogFileName": "",
      "LogPath": ""
    }
  ],
  "Active": [
    {
      "SubmitStamp": "2022_09_13_19_50_35_815",
      "Pid": 0,
      "CmdPath": "",
      "ModelName": "RiskPaths",
      "ModelDigest": "d90e1e9a49a06d972ecf1d50e684c62b",
      "RunStamp": "2022_09_13_19_51_54_081",
      "Dir": "",
      "Opts": {
        "OpenM.BaseRunDigest": "66646f985fecfb1d59fd5ff81ee3b78a",
        "OpenM.LogRank": "true",
        "OpenM.MessageLanguage": "en-CA",
        "OpenM.NotOnRoot": "true",
        "OpenM.RunName": "RiskPaths 8 subValues",
        "OpenM.SetName": "New_2022",
        "OpenM.SubValues": "8",
        "OpenM.Threads": "4"
      },
      "Env": {},
      "Threads": 4,
      "IsMpi": true,
      "Mpi": {
        "Np": 3,
        "IsNotOnRoot": true,
        "IsNotByJob": true
      },
      "Template": "mpi.ModelRun.template.txt",
      "Tables": [
        "T02_TotalPopulationByYear",
        "TG03_Union_Tables",
        "TG02_Birth_Tables"
      ],
      "RunNotes": [],
      "Res": {
        "Cpu": 8,
        "Mem": 0
      },
      "IsOverLimit": false,
      "QueuePos": 0,
      "LogFileName": "RiskPaths.2022_09_13_19_51_54_081.console.log",
      "LogPath": ""
    }
  ],
  "History": [
    {
      "SubmitStamp": "2022_09_06_19_09_01_408",
      "ModelName": "RiskPaths",
      "ModelDigest": "d90e1e9a49a06d972ecf1d50e684c62b",
      "RunStamp": "no-run-time-stamp",
      "JobStatus": "error",
      "RunTitle": "RiskPaths_descr_tables"
    },
    {
      "SubmitStamp": "2022_09_06_23_29_01_463",
      "ModelName": "RiskPaths",
      "ModelDigest": "d90e1e9a49a06d972ecf1d50e684c62b",
      "RunStamp": "2022_09_06_23_29_05_344",
      "JobStatus": "error",
      "RunTitle": "RiskPaths_New_2022-mpi-2-descr-note"
    },
    {
      "SubmitStamp": "2022_09_06_23_30_15_733",
      "ModelName": "RiskPaths",
      "ModelDigest": "d90e1e9a49a06d972ecf1d50e684c62b",
      "RunStamp": "2022_09_06_23_30_17_893",
      "JobStatus": "success",
      "RunTitle": "RiskPaths_New_2022-mpi-2-descr-note-re-run"
    },
    {
      "SubmitStamp": "2022_09_06_23_36_48_977",
      "ModelName": "RiskPaths",
      "ModelDigest": "d90e1e9a49a06d972ecf1d50e684c62b",
      "RunStamp": "2022_09_06_23_38_38_040",
      "JobStatus": "success",
      "RunTitle": "RiskPaths next rate"
    },
    {
      "SubmitStamp": "2022_09_08_20_49_55_357",
      "ModelName": "RiskPaths",
      "ModelDigest": "d90e1e9a49a06d972ecf1d50e684c62b",
      "RunStamp": "2022_09_08_20_49_56_563",
      "JobStatus": "success",
      "RunTitle": "RiskPaths_descr_tables-2"
    }
  ],
  "ComputeState": [
    {
      "Name": "cpc-1",
      "State": "ready",
      "TotalRes": {
        "Cpu": 2,
        "Mem": 0
      },
      "UsedRes": {
        "Cpu": 2,
        "Mem": 0
      },
      "OwnRes": {
        "Cpu": 2,
        "Mem": 0
      },
      "ErrorCount": 0,
      "LastUsedTs": 1663113117436
    },
    {
      "Name": "cpc-2",
      "State": "ready",
      "TotalRes": {
        "Cpu": 2,
        "Mem": 0
      },
      "UsedRes": {
        "Cpu": 2,
        "Mem": 0
      },
      "OwnRes": {
        "Cpu": 2,
        "Mem": 0
      },
      "ErrorCount": 0,
      "LastUsedTs": 1663113117436
    },
    {
      "Name": "cpc-3",
      "State": "ready",
      "TotalRes": {
        "Cpu": 4,
        "Mem": 0
      },
      "UsedRes": {
        "Cpu": 4,
        "Mem": 0
      },
      "OwnRes": {
        "Cpu": 4,
        "Mem": 0
      },
      "ErrorCount": 0,
      "LastUsedTs": 1663113117436
    }
    ],
    "IsDiskUse": true,
    "IsDiskOver": false,
    "DiskScanMs": 11000,
    "Limit": 12884901888,
    "AllLimit": 85899345920
}

Home

Getting Started

Model development in OpenM++

Using OpenM++

Model Development Topics

OpenM++ web-service: API and cloud setup

Using OpenM++ from Python and R

Docker

OpenM++ Development

OpenM++ Design, Roadmap and Status

OpenM++ web-service API

GET Model Metadata

GET Model Extras

GET Model Run results metadata

GET Model Workset metadata: set of input parameters

Read Parameters, Output Tables or Microdata values

GET Parameters, Output Tables or Microdata values

GET Parameters, Output Tables or Microdata as CSV

GET Modeling Task metadata and task run history

Update Model Profile: set of key-value options

Update Model Workset: set of input parameters

Update Model Runs

Update Modeling Tasks

Run Models: run models and monitor progress

Download model, model run results or input parameters

Upload model runs or worksets (input scenarios)

Download and upload user files

User: manage user settings

Model run jobs and service state

Administrative: manage web-service state

Clone this wiki locally