一般社団法人 全国個人事業主支援協会

COLUMN コラム

Hinemosジョブ実行結果は、コマンド「Job_getJobHistoryList.py」で取得できます。※コマンドヘルプは末尾に記載

python Job_getJobHistoryList.py -H https://hinemosmanager:8443/HinemosWS/ -U hinemos -w password -s "2020/08/31 11:00:00" -S "2020/08/31 11:05:00"

-s :検索開始日時  -S:検索終了日時   -s ~ -S の間にジョブ開始したものを抽出

 

■実行例

(jobHistoryList){
   list[] =
      (jobHistory){
         endDate = "2020/08/31 11:00:06.253"
         endStatus = 0
         endValue = 0
         jobId = "JOB-001"
         jobName = "ジョブ_001"
         jobTriggerType = 1
         jobType = 0
         jobunitId = "JU-001"
         ownerRoleId = "ALL_USERS"
         scheduleDate = "2020/08/31 11:00:00.002"
         sessionId = "20200831110000-000"
         startDate = "2020/08/31 11:00:00.042"
         status = 300
         triggerInfo = "ジョブユニット_001_JOB001)"
      },
   ・・・

⇒縦長に表示されるので、多数のジョブを確認する場合、見づらい。。。

 

■CSV化しよう! pasteコマンドを活用 

python Job_getJobHistoryList.py -H https://hinemosmanager:8443/HinemosWS/ -U hinemos -w password -s "2020/08/31 11:00:00" -S "2020/08/31 11:05:00" |grep -e ' jobId ' -e ' jobName ' -e ' jobunitId ' -e ' startDate ' |paste -d , - - - -

※情報取得する列を絞っています

■実行例

         jobId = "JOB-0011",         jobName = "JOB-0011",         jobunitId = "JU-0011",         startDate = "2020/08/31 11:00:12.808"
         jobId = "JOB-0010",         jobName = "JOB-0010",         jobunitId = "JU-0010",         startDate = "2020/08/31 11:00:08.602"
         jobId = "JOB-022-N",         jobName = "JOB-022-N",         jobunitId = "JU-M-022",         startDate = "2020/08/31 11:00:06.502"
         ・・・

⇒awk等使えばさらに綺麗に整形できるはずです

 

#####

コマンドヘルプ

Usage: Job_getJobHistoryList.py [-H URL] [-U ID] [-w PASSWORD] [-d INT] [-s STRING] [-S STRING] \
[-e STRING] [-E STRING] [-I ID] [-T STRING] [-i STRING] [-t INT] [-R ID]
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-H URL, --url=URL Hinemos Manager URL (default:http://127.0.0.1:8080/HinemosWS/)
-U ID, --user=ID Login user (default: hinemos)
-w PASSWORD, --passwd=PASSWORD Login password (default: hinemos)
-d INT, --displayed=INT display number
-s STRING, --startFrom=STRING
       start from date = 'yyyy/mm/dd HH:mm:ss'
-S STRING, --startTo=STRING
       start to date = 'yyyy/mm/dd HH:mm:ss'
-e STRING, --endFrom=STRING
       end from date= 'yyyy/mm/dd HH:mm:ss'
-E STRING, --endTo=STRING
       end to date= 'yyyy/mm/dd HH:mm:ss'
-I ID, --jobID=ID job ID
-T STRING, --status=STRING
      status: TYPE_WAIT = 0,TYPE_RESERVING = 1,TYPE_SKIP = 2
      ,TYPE_RUNNING = 100,TYPE_STOPPING = 101,TYPE_SUSPEND= 200
      ,TYPE_STOP = 201,TYPE_END = 300,TYPE_MODIFIED = 301
      ,TYPE_END_UNMATCH = 302,TYPE_END_CALENDAR = 303
      ,RTYPE_END_SKIP = 304,TYPE_END_START_DELAY = 305
      ,TYPE_END_END_DELAY = 306,TYPE_ERROR = 400
-i STRING, --trginfo=STRING
      trigger information
-t INT, --trgtype=INT
      trigger type SCHEDULE = 1, MANUAL = 2, MONITOR = 3, FILE CHECK = 4
-R ID, --ownerRoleID=ID
      owerRoleID

この記事をシェアする

  • Twitterでシェア
  • Facebookでシェア
  • LINEでシェア