Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions openapi/openapiv2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2190,6 +2190,44 @@
]
}
},
"/api/v1/namespaces/{namespace}/worker-count": {
"get": {
"summary": "CountWorkers is a visibility API to count workers in a specific namespace.",
"operationId": "CountWorkers2",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1CountWorkersResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "namespace",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "query",
"description": "Query to filter workers before counting.\nSupported filter fields are the same as in ListWorkersRequest.",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
"WorkflowService"
]
}
},
"/api/v1/namespaces/{namespace}/worker-deployment-versions/{deploymentVersion.deploymentName}/{deploymentVersion.buildId}": {
"get": {
"summary": "Describes a worker deployment version.\nExperimental. This API might significantly change or be removed in a future release.",
Expand Down Expand Up @@ -6690,6 +6728,44 @@
]
}
},
"/namespaces/{namespace}/worker-count": {
"get": {
"summary": "CountWorkers is a visibility API to count workers in a specific namespace.",
"operationId": "CountWorkers",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1CountWorkersResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "namespace",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "query",
"description": "Query to filter workers before counting.\nSupported filter fields are the same as in ListWorkersRequest.",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
"WorkflowService"
]
}
},
"/namespaces/{namespace}/worker-deployment-versions/{deploymentVersion.deploymentName}/{deploymentVersion.buildId}": {
"get": {
"summary": "Describes a worker deployment version.\nExperimental. This API might significantly change or be removed in a future release.",
Expand Down Expand Up @@ -11954,6 +12030,16 @@
}
}
},
"v1CountWorkersResponse": {
"type": "object",
"properties": {
"count": {
"type": "string",
"format": "int64",
"description": "Approximate number of workers matching the query."
}
}
},
"v1CountWorkflowExecutionsResponse": {
"type": "object",
"properties": {
Expand Down
70 changes: 70 additions & 0 deletions openapi/openapiv3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1958,6 +1958,38 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Status'
/api/v1/namespaces/{namespace}/worker-count:
get:
tags:
- WorkflowService
description: CountWorkers is a visibility API to count workers in a specific namespace.
operationId: CountWorkers
parameters:
- name: namespace
in: path
required: true
schema:
type: string
- name: query
in: query
description: |-
Query to filter workers before counting.
Supported filter fields are the same as in ListWorkersRequest.
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/CountWorkersResponse'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
/api/v1/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}:
get:
tags:
Expand Down Expand Up @@ -5991,6 +6023,38 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Status'
/namespaces/{namespace}/worker-count:
get:
tags:
- WorkflowService
description: CountWorkers is a visibility API to count workers in a specific namespace.
operationId: CountWorkers
parameters:
- name: namespace
in: path
required: true
schema:
type: string
- name: query
in: query
description: |-
Query to filter workers before counting.
Supported filter fields are the same as in ListWorkersRequest.
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/CountWorkersResponse'
default:
description: Default error response
content:
application/json:
schema:
$ref: '#/components/schemas/Status'
/namespaces/{namespace}/worker-deployment-versions/{deployment_version.deployment_name}/{deployment_version.build_id}:
get:
tags:
Expand Down Expand Up @@ -9100,6 +9164,12 @@ components:
$ref: '#/components/schemas/Payload'
count:
type: string
CountWorkersResponse:
type: object
properties:
count:
type: string
description: Approximate number of workers matching the query.
CountWorkflowExecutionsResponse:
type: object
properties:
Expand Down
12 changes: 12 additions & 0 deletions temporal/api/workflowservice/v1/request_response.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2684,6 +2684,18 @@ message DescribeWorkerResponse {
temporal.api.worker.v1.WorkerInfo worker_info = 1;
}

message CountWorkersRequest {
string namespace = 1;
// Query to filter workers before counting.
// Supported filter fields are the same as in ListWorkersRequest.
string query = 2;
}

message CountWorkersResponse {
// Approximate number of workers matching the query.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More detail on why this is approximate is always useful in this sort of comment

int64 count = 1;
}

// Request to pause a workflow execution.
message PauseWorkflowExecutionRequest {
// Namespace of the workflow to pause.
Expand Down
10 changes: 10 additions & 0 deletions temporal/api/workflowservice/v1/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,16 @@ service WorkflowService {
};
}

// CountWorkers is a visibility API to count workers in a specific namespace.
rpc CountWorkers (CountWorkersRequest) returns (CountWorkersResponse) {
option (google.api.http) = {
get: "/namespaces/{namespace}/worker-count"
additional_bindings {
get: "/api/v1/namespaces/{namespace}/worker-count"
}
};
}

// Updates task queue configuration.
// For the overall queue rate limit: the rate limit set by this api overrides the worker-set rate limit,
// which uncouples the rate limit from the worker lifecycle.
Expand Down
Loading