Skip to content

Commit 4940812

Browse files
committed
Add worker visibility API - heartbeat and list worker satus
1 parent 9ef7069 commit 4940812

5 files changed

Lines changed: 668 additions & 0 deletions

File tree

openapi/openapiv2.json

Lines changed: 319 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2115,6 +2115,46 @@
21152115
]
21162116
}
21172117
},
2118+
"/api/v1/namespaces/{namespace}/worker-heartbeat": {
2119+
"post": {
2120+
"summary": "WorkerHeartbeat receive heartbeat request from the worker.",
2121+
"operationId": "WorkerHeartbeat2",
2122+
"responses": {
2123+
"200": {
2124+
"description": "A successful response.",
2125+
"schema": {
2126+
"$ref": "#/definitions/v1WorkerHeartbeatResponse"
2127+
}
2128+
},
2129+
"default": {
2130+
"description": "An unexpected error response.",
2131+
"schema": {
2132+
"$ref": "#/definitions/rpcStatus"
2133+
}
2134+
}
2135+
},
2136+
"parameters": [
2137+
{
2138+
"name": "namespace",
2139+
"description": "Namespace of the workflow which scheduled this activity.",
2140+
"in": "path",
2141+
"required": true,
2142+
"type": "string"
2143+
},
2144+
{
2145+
"name": "body",
2146+
"in": "body",
2147+
"required": true,
2148+
"schema": {
2149+
"$ref": "#/definitions/WorkflowServiceWorkerHeartbeatBody"
2150+
}
2151+
}
2152+
],
2153+
"tags": [
2154+
"WorkflowService"
2155+
]
2156+
}
2157+
},
21182158
"/api/v1/namespaces/{namespace}/worker-task-reachability": {
21192159
"get": {
21202160
"summary": "Deprecated. Use `DescribeTaskQueue`.",
@@ -2184,6 +2224,57 @@
21842224
]
21852225
}
21862226
},
2227+
"/api/v1/namespaces/{namespace}/workers": {
2228+
"get": {
2229+
"summary": "ListWorkerStatus is a visibility API to list worker status information in a specific namespace.",
2230+
"operationId": "ListWorkerStatus2",
2231+
"responses": {
2232+
"200": {
2233+
"description": "A successful response.",
2234+
"schema": {
2235+
"$ref": "#/definitions/v1ListWorkerStatusResponse"
2236+
}
2237+
},
2238+
"default": {
2239+
"description": "An unexpected error response.",
2240+
"schema": {
2241+
"$ref": "#/definitions/rpcStatus"
2242+
}
2243+
}
2244+
},
2245+
"parameters": [
2246+
{
2247+
"name": "namespace",
2248+
"in": "path",
2249+
"required": true,
2250+
"type": "string"
2251+
},
2252+
{
2253+
"name": "pageSize",
2254+
"in": "query",
2255+
"required": false,
2256+
"type": "integer",
2257+
"format": "int32"
2258+
},
2259+
{
2260+
"name": "nextPageToken",
2261+
"in": "query",
2262+
"required": false,
2263+
"type": "string",
2264+
"format": "byte"
2265+
},
2266+
{
2267+
"name": "query",
2268+
"in": "query",
2269+
"required": false,
2270+
"type": "string"
2271+
}
2272+
],
2273+
"tags": [
2274+
"WorkflowService"
2275+
]
2276+
}
2277+
},
21872278
"/api/v1/namespaces/{namespace}/workflow-count": {
21882279
"get": {
21892280
"summary": "CountWorkflowExecutions is a visibility API to count of workflow executions in a specific namespace.",
@@ -5624,6 +5715,46 @@
56245715
]
56255716
}
56265717
},
5718+
"/namespaces/{namespace}/worker-heartbeat": {
5719+
"post": {
5720+
"summary": "WorkerHeartbeat receive heartbeat request from the worker.",
5721+
"operationId": "WorkerHeartbeat",
5722+
"responses": {
5723+
"200": {
5724+
"description": "A successful response.",
5725+
"schema": {
5726+
"$ref": "#/definitions/v1WorkerHeartbeatResponse"
5727+
}
5728+
},
5729+
"default": {
5730+
"description": "An unexpected error response.",
5731+
"schema": {
5732+
"$ref": "#/definitions/rpcStatus"
5733+
}
5734+
}
5735+
},
5736+
"parameters": [
5737+
{
5738+
"name": "namespace",
5739+
"description": "Namespace of the workflow which scheduled this activity.",
5740+
"in": "path",
5741+
"required": true,
5742+
"type": "string"
5743+
},
5744+
{
5745+
"name": "body",
5746+
"in": "body",
5747+
"required": true,
5748+
"schema": {
5749+
"$ref": "#/definitions/WorkflowServiceWorkerHeartbeatBody"
5750+
}
5751+
}
5752+
],
5753+
"tags": [
5754+
"WorkflowService"
5755+
]
5756+
}
5757+
},
56275758
"/namespaces/{namespace}/worker-task-reachability": {
56285759
"get": {
56295760
"summary": "Deprecated. Use `DescribeTaskQueue`.",
@@ -5693,6 +5824,57 @@
56935824
]
56945825
}
56955826
},
5827+
"/namespaces/{namespace}/workers": {
5828+
"get": {
5829+
"summary": "ListWorkerStatus is a visibility API to list worker status information in a specific namespace.",
5830+
"operationId": "ListWorkerStatus",
5831+
"responses": {
5832+
"200": {
5833+
"description": "A successful response.",
5834+
"schema": {
5835+
"$ref": "#/definitions/v1ListWorkerStatusResponse"
5836+
}
5837+
},
5838+
"default": {
5839+
"description": "An unexpected error response.",
5840+
"schema": {
5841+
"$ref": "#/definitions/rpcStatus"
5842+
}
5843+
}
5844+
},
5845+
"parameters": [
5846+
{
5847+
"name": "namespace",
5848+
"in": "path",
5849+
"required": true,
5850+
"type": "string"
5851+
},
5852+
{
5853+
"name": "pageSize",
5854+
"in": "query",
5855+
"required": false,
5856+
"type": "integer",
5857+
"format": "int32"
5858+
},
5859+
{
5860+
"name": "nextPageToken",
5861+
"in": "query",
5862+
"required": false,
5863+
"type": "string",
5864+
"format": "byte"
5865+
},
5866+
{
5867+
"name": "query",
5868+
"in": "query",
5869+
"required": false,
5870+
"type": "string"
5871+
}
5872+
],
5873+
"tags": [
5874+
"WorkflowService"
5875+
]
5876+
}
5877+
},
56965878
"/namespaces/{namespace}/workflow-count": {
56975879
"get": {
56985880
"summary": "CountWorkflowExecutions is a visibility API to count of workflow executions in a specific namespace.",
@@ -8349,6 +8531,18 @@
83498531
},
83508532
"description": "Keep the parameters in sync with:\n - temporal.api.batch.v1.BatchOperationUpdateWorkflowExecutionOptions.\n - temporal.api.workflow.v1.PostResetOperation.UpdateWorkflowOptions."
83518533
},
8534+
"WorkflowServiceWorkerHeartbeatBody": {
8535+
"type": "object",
8536+
"properties": {
8537+
"identity": {
8538+
"type": "string",
8539+
"description": "The identity of the client who initiated this request."
8540+
},
8541+
"workerStatus": {
8542+
"$ref": "#/definitions/v1WorkerStatus"
8543+
}
8544+
}
8545+
},
83528546
"apicommonv1Link": {
83538547
"type": "object",
83548548
"properties": {
@@ -11167,6 +11361,23 @@
1116711361
}
1116811362
}
1116911363
},
11364+
"v1ListWorkerStatusResponse": {
11365+
"type": "object",
11366+
"properties": {
11367+
"workerStatus": {
11368+
"type": "array",
11369+
"items": {
11370+
"type": "object",
11371+
"$ref": "#/definitions/v1WorkerStatus"
11372+
}
11373+
},
11374+
"nextPageToken": {
11375+
"type": "string",
11376+
"format": "byte",
11377+
"title": "Next page token"
11378+
}
11379+
}
11380+
},
1117011381
"v1ListWorkflowExecutionsResponse": {
1117111382
"type": "object",
1117211383
"properties": {
@@ -15046,6 +15257,114 @@
1504615257
"default": "WORKER_DEPLOYMENT_VERSION_STATUS_UNSPECIFIED",
1504715258
"description": "Specify the status of a Worker Deployment Version.\nExperimental. Worker Deployments are experimental and might significantly change in the future.\n\n - WORKER_DEPLOYMENT_VERSION_STATUS_INACTIVE: The Worker Deployment Version has been created inside the Worker Deployment but is not used by any\nworkflow executions. These Versions can still have workflows if they have an explicit Versioning Override targeting\nthis Version. Such Versioning Override could be set at workflow start time, or at a later time via `UpdateWorkflowExecutionOptions`.\n - WORKER_DEPLOYMENT_VERSION_STATUS_CURRENT: The Worker Deployment Version is the current version of the Worker Deployment. All new workflow executions \nand tasks of existing unversioned or AutoUpgrade workflows are routed to this version.\n - WORKER_DEPLOYMENT_VERSION_STATUS_RAMPING: The Worker Deployment Version is the ramping version of the Worker Deployment. A subset of new Pinned workflow executions are \nrouted to this version. Moreover, a portion of existing unversioned or AutoUpgrade workflow executions are also routed to this version.\n - WORKER_DEPLOYMENT_VERSION_STATUS_DRAINING: The Worker Deployment Version is not used by new workflows but is still used by\nopen pinned workflows. The version cannot be decommissioned safely.\n - WORKER_DEPLOYMENT_VERSION_STATUS_DRAINED: The Worker Deployment Version is not used by new or open workflows, but might be still needed by\nQueries sent to closed workflows. The version can be decommissioned safely if user does\nnot query closed workflows. If the user does query closed workflows for some time x after\nworkflows are closed, they should decommission the version after it has been drained for that duration."
1504815259
},
15260+
"v1WorkerHeartbeatResponse": {
15261+
"type": "object"
15262+
},
15263+
"v1WorkerStatus": {
15264+
"type": "object",
15265+
"properties": {
15266+
"namespaceId": {
15267+
"type": "string"
15268+
},
15269+
"workerId": {
15270+
"type": "string"
15271+
},
15272+
"hostId": {
15273+
"type": "string"
15274+
},
15275+
"taskQueue": {
15276+
"type": "string"
15277+
},
15278+
"deploymentName": {
15279+
"type": "string"
15280+
},
15281+
"buildId": {
15282+
"type": "string"
15283+
},
15284+
"sdkName": {
15285+
"type": "string"
15286+
},
15287+
"sdkVersion": {
15288+
"type": "string"
15289+
},
15290+
"workerIdentity": {
15291+
"type": "string"
15292+
},
15293+
"workerStatus": {
15294+
"type": "integer",
15295+
"format": "int32"
15296+
},
15297+
"uptime": {
15298+
"type": "string"
15299+
},
15300+
"lastHeartbeatTime": {
15301+
"type": "string",
15302+
"format": "date-time"
15303+
},
15304+
"workflowTaskStatus": {
15305+
"$ref": "#/definitions/v1WorkerTaskStatus"
15306+
},
15307+
"activityTaskStatus": {
15308+
"$ref": "#/definitions/v1WorkerTaskStatus"
15309+
},
15310+
"nexusTaskStatus": {
15311+
"$ref": "#/definitions/v1WorkerTaskStatus"
15312+
},
15313+
"cpuUsagePercent": {
15314+
"type": "number",
15315+
"format": "float"
15316+
},
15317+
"memoryUsageBytes": {
15318+
"type": "string",
15319+
"format": "int64"
15320+
},
15321+
"cacheHitRatio": {
15322+
"type": "number",
15323+
"format": "float"
15324+
},
15325+
"cacheSize": {
15326+
"type": "number",
15327+
"format": "float"
15328+
}
15329+
}
15330+
},
15331+
"v1WorkerTaskStatus": {
15332+
"type": "object",
15333+
"properties": {
15334+
"lastSuccessfulTaskPollTime": {
15335+
"type": "string",
15336+
"format": "date-time"
15337+
},
15338+
"taskPollers": {
15339+
"type": "integer",
15340+
"format": "int32"
15341+
},
15342+
"slotsAvailable": {
15343+
"type": "integer",
15344+
"format": "int32"
15345+
},
15346+
"slotsUsed": {
15347+
"type": "integer",
15348+
"format": "int32"
15349+
},
15350+
"processedTasks": {
15351+
"type": "integer",
15352+
"format": "int32"
15353+
},
15354+
"failedTasks": {
15355+
"type": "integer",
15356+
"format": "int32"
15357+
},
15358+
"processRateMin": {
15359+
"type": "number",
15360+
"format": "float"
15361+
},
15362+
"failureRateMin": {
15363+
"type": "number",
15364+
"format": "float"
15365+
}
15366+
}
15367+
},
1504915368
"v1WorkerVersionCapabilities": {
1505015369
"type": "object",
1505115370
"properties": {

0 commit comments

Comments
 (0)