日本熟妇hd丰满老熟妇,中文字幕一区二区三区在线不卡 ,亚洲成片在线观看,免费女同在线一区二区

消息通知

批量計算使用 MNS 來實現消息通知。您負責主題的創建、管理和訂閱,并在創建集群或提交作業時指定相關配置。批量計算會依據配置向指定的主題推送消息,您可在 MNS 控制臺配置 URL、隊列、郵件和短信四種方式獲取消息通知。

說明

支持的事件

目前批量計算支持兩類事件,您可以按需配置:

  • 集群事件:
    • 集群已刪除:OnClusterDeleted;
    • 實例已創建:OnInstanceCreated
    • 實例已運行:OnInstanceActive;
  • 作業事件:
    • 作業等待中:OnJobWaiting
    • 作業運行中:OnJobRunning;
    • 作業已停止:OnJobStopped;
    • 作業已結束:OnJobFinished;
    • 作業已失敗:OnJobFailed;
    • 任務等待中:OnTaskWaiting;
    • 任務運行中:OnTaskRunning
    • 任務停止中:OnTaskStopped;
    • 任務已結束:OnTaskFinished;
    • 任務已失敗:OnTaskFailed;
    • 實例等待中:OnInstanceWaiting
    • 實例運行中:OnInstanceRunning;
    • 實例已停止:OnInstanceStopped;
    • 實例已結束:OnInstanceFinished
    • 實例已失?。?code>OnInstanceFailed;
    • 優先級改變:OnPriorityChange

消息格式

適用于 OnClusterDeleted。

  1. {
  2. "Category": "Cluster",
  3. "ClusterId": "cls-hr2rbl6qt5gki7392b8001",
  4. "ClusterName": "test-cluster",
  5. "CreationTime": "2016-11-01T15:25:02.837728Z",
  6. "State": "Deleted",
  7. "Event": "OnClusterDeleted"
  8. }

適用于 OnInstanceCreatedOnInstanceActive。

  1. {
  2. "Category": "Cluster",
  3. "ClusterId": "cls-hr2rbl6qt5gki7392b8001",
  4. "Group": "group1",
  5. "InstanceId": "i-wz9c51g2s6zsrtnqi4fa",
  6. "InnerIpAddress": "10.45.168.26",
  7. "Hints": "",
  8. "State": "Starting",
  9. "CreationTime": "2016-11-01T15:25:02.837728Z",
  10. "Event": "OnInstanceCreated"
  11. }

適用于 OnJobWaiting、OnJobRunningOnJobStopped、OnJobFinishedOnJobFailed。

  1. {
  2. "Category": "Job",
  3. "JobId": "job-0000000058524720000077E900007257",
  4. "JobName": "test-job",
  5. "Event": "OnJobWaiting",
  6. "State": "Waiting",
  7. "CreationTime": "2016-11-01T15:25:02.837728Z",
  8. "StartTime": "2016-11-01T15:35:02.837728Z",
  9. "EndTime": "2016-11-01T15:45:02.837728Z",
  10. "Message": ""
  11. }

適用于 OnTaskWaiting、OnTaskRunning、OnTaskStoppedOnTaskFinished、OnTaskFailed。

  1. {
  2. "Category": "Job",
  3. "JobId": "job-0000000058524720000077E900007257",
  4. "Task": "Echo",
  5. "Event": "OnTaskWaiting",
  6. "State": "Waiting",
  7. "StartTime": "2016-11-01T15:35:02.837728Z",
  8. "EndTime": "2016-11-01T15:45:02.837728Z"
  9. }

適用于 OnInstanceWaiting、OnInstanceRunningOnInstanceStopped、OnInstanceFinished、OnInstanceFailed

  1. {
  2. "Category": "Job",
  3. "JobId": "job-0000000058524720000077E900007257",
  4. "Task": "Echo",
  5. "InstanceId": "0",
  6. "Event": "OnInstanceWaiting",
  7. "State": "Waiting",
  8. "StartTime": "2016-11-01T15:35:02.837728Z",
  9. "EndTime": "2016-11-01T15:45:02.837728Z",
  10. "RetryCount": "0",
  11. "Progress": "0",
  12. "StdoutRedirectPath": "oss://bucket/tests/a44c0ad8-a003-11e6-8f8e-fefec0a80e06/logs/stderr.job-0000000058184218000008150000000D.task.0",
  13. "StderrRedirectPath": "oss://bucket/tests/a44c0ad8-a003-11e6-8f8e-fefec0a80e06/logs/stdout.job-0000000058184218000008150000000D.task.0",
  14. "ExitCode": "0",
  15. "ErrorCode": "",
  16. "ErrorMessage": "",
  17. "Detail": ""
  18. }

適用于 OnPriorityChange。

  1. {
  2. "Category": "Job",
  3. "JobId": "job-0000000058524720000077E900007257",
  4. "JobName": "test-job",
  5. "Event": "OnPriorityChange",
  6. "State": "Waiting",
  7. "CreationTime": "2016-11-01T15:45:02.837728Z",
  8. "StartTime": "2016-11-01T15:55:02.837728Z",
  9. "EndTime": "2016-11-01T15:57:02.837728Z",
  10. "Message": "",
  11. "From": "10",
  12. "To": "20"
  13. }

使用

使用消息隊列必須同時指定 MNS 主題名稱 (Name)、MNS 私網 Endpoint (Endpoint) 和關注的事件 (Events)。

以下我們將展示通過 SDK 展示如何使用 MNS 消息隊列,其中 MNS 主題名稱為test,MNS私網 Endpoint 為http://xxx.mns.cn-beijing.aliyuncs.com/,關注的事件為OnClusterDeleted、OnInstanceCreatedOnInstanceActive。

SDK

  1. from batchcompute.resources import (
  2. ClusterDescription, Notification, Topic
  3. )
  4. cluster_desc = ClusterDescription()
  5. notification = Notification()
  6. topic = Topic()
  7. topic.Name = 'test'
  8. topic.Endpoint = 'http://xxx.mns.cn-beijing.aliyuncs.com/'
  9. topic.Events = ["OnClusterDeleted", "OnInstanceCreated", "OnInstanceActive"]
  10. notification.Topic = topic
  11. cluster_desc.Notification = notification