任务和工作流元数据

端点 描述 输入
GET /metadata/taskdefs 获取所有任务定义 N / A
GET /metadata/taskdefs/{taskType} 检索任务定义 任务名称
POST /metadata/taskdefs 注册新任务定义 任务清单清单
PUT /metadata/taskdefs 更新任务定义 一个任务定义
DELETE /metadata/taskdefs/{taskType} 删除任务定义 任务名称
     
GET /metadata/workflow 获取所有工作流定义 N / A
POST /metadata/workflow 注册新工作流程 工作流定义
PUT /metadata/workflow 注册/更新新工作流程 工作流定义列表
GET /metadata/workflow/{name}?version= 获取工作流定义 工作流名称,版本(可选)
     

启动一个工作流

仅使用输入

POST /workflow/{name}?version=&correlationId=
{
//JSON payload for workflow
}
参数 描述
可选的。如果未指定使用最新版本的工作流程
的correlationID 用户提供的可用于检索工作流的Id

输入

JSON有效载荷启动工作流。强制性。如果工作流不期望任何输入必须传递一个空的JSON{}

产量

工作流ID(GUID)

使用输入和任务域

POST /workflow
{
//JSON payload for Start workflow request
}

启动工作流程请求

JSON用于启动工作流请求

{
"name": "myWorkflow", // Name of the workflow
"version": 1, // Version
“correlatond”: “corr1” // correlation Id
"input": {
// Input map.
},
"taskToDomain": {
// Task to domain map
}
}

产量

工作流ID(GUID)

检索工作流程

端点 描述
GET /workflow/{workflowId}?includeTasks=true|false 通过工作流标识获取工作流状态。如果设置了includeTasks,那么还包括执行和调度的所有任务。
GET /workflow/running/{name} 获取给定类型的所有正在运行的工作流
GET /workflow/running/{name}/correlated/{correlationId}?includeClosed=true|false&includeTasks=true|false 获取所有正在运行的关联标识过滤的工作流。如果includeClosed被设置,还包括完成运行的工作流。
GET /workflow/search 搜索工作流。见下文。
   

搜索工作流程

指挥机构使用Elasticsearch对工作流执行进行索引,并被搜索API使用。

GET /workflow/search?start=&size=&sort=&freeText=&query=

参数 描述
开始 页码。默认为0
尺寸 要返回的结果数
分类 排序。格式是:ASC:<fieldname>DESC:<fieldname>按字段按升序或降序排序
FREETEXT Elasticsearch支持查询。例如workflowType:“name_of_workflow”
询问 SQL like where子句。例如workflowType ='name_of_workflow'。如果提供了freeText,则为可选项。

产量

搜索结果如下所示:

{
"totalHits": 0,
"results": [
{
"workflowType": "string",
"version": 0,
"workflowId": "string",
"correlationId": "string",
"startTime": "string",
"updateTime": "string",
"endTime": "string",
"status": "RUNNING",
"input": "string",
"output": "string",
"reasonForIncompletion": "string",
"executionTime": 0,
"event": "string"
}
]
}

管理工作流程

端点 描述
PUT /workflow/{workflowId}/pause 暂停。将不再安排进一步的工作,直到恢复。当前正在运行的任务不会暂停。
PUT /workflow/{workflowId}/resume 暂停后恢复正常操作。
POST /workflow/{workflowId}/rerun 见下文。
POST /workflow/{workflowId}/restart 从一开始重新启动工作流执行。当前执行历史被擦除。
POST /workflow/{workflowId}/retry 重试最后一个失败的任务。
PUT /workflow/{workflowId}/skiptask/{taskReferenceName} 见下文。
DELETE /workflow/{workflowId} 终止正在运行的工作流。
DELETE /workflow/{workflowId}/remove 从系统中删除工作流。谨慎使用。

重新运行

从特定任务重新运行完成的工作流。

POST /workflow/{workflowId}/rerun

{
"reRunFromWorkflowId": "string",
"workflowInput": {},
"reRunFromTaskId": "string",
"taskInput": {}
}

跳过任务

taskReferenceName在运行的工作流程中跳过任务执行(指定为参数),并继续前进。可选地更新任务的输入和输出,如有效载荷中指定的。 PUT /workflow/{workflowId}/skiptask/{taskReferenceName}?workflowId=&taskReferenceName=

{
"taskInput": {},
"taskOutput": {}
}

管理任务

端点 描述
GET /tasks/{taskId} 获取任务详情。
GET /tasks/queue/all 列出待处理的任务大小。
GET /tasks/queue/all/verbose 与上述相同,包括每个分片的大小
GET /tasks/queue/sizes?taskType=&taskType=&taskType 返回给定任务类型的待处理任务的大小
   

轮询,确认和更新任务

这些是用于轮询任务的关键端点,发送ack(轮询后),最后由工作人员更新任务结果。

端点 描述
GET /tasks/poll/{taskType}?workerid=&domain= 投票任务 workerid标识为作业轮询的工作者,并domain允许轮询器轮询特定域中的任务
GET /tasks/poll/batch/{taskType}?count=&timeout=&workerid=&domain 对由指定的批次中的任务进行轮询count。这是一个长时间的轮询,连接将等到timeout或至少有1个可用项目(以较先者为准)。workerid标识为作业轮询的工作者,并domain允许轮询器轮询特定域中的任务
POST /tasks 更新任务执行的结果。请参阅下面的模式。
POST /tasks/{taskId}/ack 承认工作人员投票后收到的任务。

更新任务结果的模式

{
"workflowInstanceId": "Workflow Instance Id",
"taskId": "ID of the task to be updated",
"reasonForIncompletion" : "If failed, reason for failure",
"callbackAfterSeconds": 0,
"status": "IN_PROGRESS|FAILED|COMPLETED",
"outputData": {
//JSON document representing Task execution output
} }

轮询后承认任务

如果工作人员在轮询后无法确认任务,则重新排队任务并将其放回队列中,并在后续轮询中可用。

获取running的workflow
curl -X GET --header 'Accept: application/json' 'http://192.168.9.137:8080/api/workflow/running/<name>?version=1'
终止workflow
curl -X DELETE --header 'Accept: application/json' 'http://192.168.9.137:8080/api/workflow/<workflowId>'

启动workflow

curl -X POST --header 'Content-Type: application/json' --header 'Accept: text/plain' -d '{}' 'http://localhost:8080/api/workflow/<name>'

conductor APIs的更多相关文章

  1. (转载)构建public APIs与CORS

    from: https://segmentfault.com/a/1190000000709909 理由:在操作层面详细的讲解了跨域的操作.尤其是对于option请求的详解.收藏. 在构建Public ...

  2. ECMAScript Web APIs node.js

    https://hacks.mozilla.org/2015/04/es6-in-depth-an-introduction/ What falls under the scope of ECMASc ...

  3. 【墙内备份】Android 6.0 APIs

    Android 6.0 APIs In this documentSHOW MORE Fingerprint Authentication Confirm Credential App Linking ...

  4. netflix:Conductor微服务编排引擎

    项目地址: https://github.com/Netflix/conductor Conductor 是 Netflix 受需要运行全球流媒体业务流程的启发,构建的基于云的微服务编排引擎. Con ...

  5. swagger:The World's Most Popular Framework for APIs.

    swagger官网:http://swagger.io/ swagger ui demo:http://petstore.swagger.io 让API文档总是与API定义同步更新,是一件非常有价值的 ...

  6. [译]Node.js : Building RESTful APIs using Loopback and MySQL

    国庆后可能就要使用StrongLoop那套东西来做项目了 原文:http://www.javabeat.net/loopback-mysql/ Loopback是什么? Loopback是一个开源的N ...

  7. URLRedirector 解决网页上无法访问 google CDN 的问题(fonts、ajax、themes、apis等)

    URLRedirector 解决网页上无法访问 google CDN 的问题(fonts.ajax.themes.apis等) 由于某些原因,在访问国外的网站时有时候会特别慢,像 stackoverf ...

  8. 谷歌正式发布Google APIs Client Library for .NET

    好消息,特大好消息! 英文原文:Google API library for .NET paves the way for Google services on Windows phone 本月 17 ...

  9. POSTMAN and HTTPie to test APIs

    http://blog.mashape.com/postman-httpie-test-apis/ We love working with APIs at Mashape, and we love ...

随机推荐

  1. Yii 用户登录验证

    http://blog.sina.com.cn/s/blog_685213e70101mo4i.html 1)首先在model文件夹中新建文件 LoginForm.php 代码如下 <?php ...

  2. poj 3046 Ant Counting(多重集组合数)

    Ant Counting Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 131072/65536K (Java/Other) Total ...

  3. Bootstrap:百科

    ylbtech-Bootstrap:百科 Bootstrap (Web框架) Bootstrap,来自 Twitter,是目前很受欢迎的前端框架.Bootstrap 是基于 HTML.CSS.Java ...

  4. 【整理总结】代码沉淀 - CefSharp - 比较流行的第三方内嵌浏览器组件

    .NET (WPF and Windows Forms) bindings for the Chromium Embedded Framework web: https://github.com/ce ...

  5. dubbo无法创建线程问题

    OutOfMemoryError: unable to create new native thread 决定当前用户程序能够创建多少线程由2个因素决定 1. 用户环境允许的线程数 cat /etc/ ...

  6. Vue引用其他组件,但组件某些部分不需要时的简单处理

    项目开发时,我们会把多个地方重复使用的模块抽象成组件,提供给大家一起使用,但是使用组件的时候偶尔会遇见一些问题,比如说组件里只有某些东西自己并不需要,这个时候我们可以对组件进行简单的修改,而不影响其他 ...

  7. [UE4]把枪抽象为一个类

  8. [UE4]集合:TSet容器

    一.TSet<T>是什么 UE4中,除了TArray动态数组外,还提供了各种各样的模板容器.这一节,我们就介绍集合容器——TSet<T>.类似于TArray<T>, ...

  9. javascript的事件流

    事件流包括三个阶段: 1.事件捕获阶段 2.处于目标阶段 3.事件冒泡阶段 1.事件捕获阶段 现在页面中有一个按钮. 如果单击这个按钮的话,在事件捕获过程中,document会首先接收到click事件 ...

  10. Select算法(最坏复杂度O(n))

    #include<iostream> #include <stdio.h> #include <stdlib.h> #include <algorithm&g ...