Skip to content

Commit

Permalink
Add ApplyNamespaceRules intent and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ychebotarev committed Jan 28, 2025
1 parent 095bb20 commit 9349b13
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 32 deletions.
29 changes: 14 additions & 15 deletions openapi/openapiv2.json
Original file line number Diff line number Diff line change
Expand Up @@ -1123,8 +1123,9 @@
]
}
},
"/api/v1/namespaces/{namespace}/rules/apply/{ruleId}": {
"/api/v1/namespaces/{namespace}/rules/apply": {
"post": {
"summary": "ApplyNamespaceRule allows to apply rule to a certain workflow instance without creating a rule.\nThis is useful for one-off operations.",
"operationId": "ApplyNamespaceRule2",
"responses": {
"200": {
Expand All @@ -1147,12 +1148,6 @@
"required": true,
"type": "string"
},
{
"name": "ruleId",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
Expand Down Expand Up @@ -4313,8 +4308,9 @@
]
}
},
"/namespaces/{namespace}/rules/apply/{ruleId}": {
"/namespaces/{namespace}/rules/apply": {
"post": {
"summary": "ApplyNamespaceRule allows to apply rule to a certain workflow instance without creating a rule.\nThis is useful for one-off operations.",
"operationId": "ApplyNamespaceRule",
"responses": {
"200": {
Expand All @@ -4337,12 +4333,6 @@
"required": true,
"type": "string"
},
{
"name": "ruleId",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
Expand Down Expand Up @@ -6212,7 +6202,16 @@
}
},
"WorkflowServiceApplyNamespaceRuleBody": {
"type": "object"
"type": "object",
"properties": {
"workflowExecutionInfo": {
"$ref": "#/definitions/v1WorkflowExecutionInfo"
},
"rule": {
"$ref": "#/definitions/v1NamespaceRule",
"description": "The rule to apply. Rule will be applied only to the matching workflow."
}
}
},
"WorkflowServiceCreateNamespaceRuleBody": {
"type": "object",
Expand Down
28 changes: 14 additions & 14 deletions openapi/openapiv3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1023,22 +1023,20 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Status'
/api/v1/namespaces/{namespace}/rules/apply/{ruleId}:
/api/v1/namespaces/{namespace}/rules/apply:
post:
tags:
- WorkflowService
description: |-
ApplyNamespaceRule allows to apply rule to a certain workflow instance without creating a rule.
This is useful for one-off operations.
operationId: ApplyNamespaceRule
parameters:
- name: namespace
in: path
required: true
schema:
type: string
- name: ruleId
in: path
required: true
schema:
type: string
requestBody:
content:
application/json:
Expand Down Expand Up @@ -3838,22 +3836,20 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Status'
/namespaces/{namespace}/rules/apply/{ruleId}:
/namespaces/{namespace}/rules/apply:
post:
tags:
- WorkflowService
description: |-
ApplyNamespaceRule allows to apply rule to a certain workflow instance without creating a rule.
This is useful for one-off operations.
operationId: ApplyNamespaceRule
parameters:
- name: namespace
in: path
required: true
schema:
type: string
- name: ruleId
in: path
required: true
schema:
type: string
requestBody:
content:
application/json:
Expand Down Expand Up @@ -5528,8 +5524,12 @@ components:
properties:
namespace:
type: string
ruleId:
type: string
workflowExecutionInfo:
$ref: '#/components/schemas/WorkflowExecutionInfo'
rule:
allOf:
- $ref: '#/components/schemas/NamespaceRule'
description: The rule to apply. Rule will be applied only to the matching workflow.
ApplyNamespaceRuleResponse:
type: object
properties: {}
Expand Down
5 changes: 4 additions & 1 deletion temporal/api/workflowservice/v1/request_response.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2001,7 +2001,10 @@ message ListNamespaceRulesResponse {
message ApplyNamespaceRuleRequest {
string namespace = 1;

string rule_id = 2;
temporal.api.workflow.v1.WorkflowExecutionInfo workflow_execution_info = 2;

// The rule to apply. Rule will be applied only to the matching workflow.
temporal.api.namespace.v1.NamespaceRule rule = 3;
}

message ApplyNamespaceRuleResponse {
Expand Down
6 changes: 4 additions & 2 deletions temporal/api/workflowservice/v1/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1060,12 +1060,14 @@ service WorkflowService {
};
}

// ApplyNamespaceRule allows to apply rule to a certain workflow instance without creating a rule.
// This is useful for one-off operations.
rpc ApplyNamespaceRule(ApplyNamespaceRuleRequest) returns (ApplyNamespaceRuleResponse) {
option (google.api.http) = {
post: "/namespaces/{namespace}/rules/apply/{rule_id}"
post: "/namespaces/{namespace}/rules/apply"
body: "*"
additional_bindings {
post: "/api/v1/namespaces/{namespace}/rules/apply/{rule_id}"
post: "/api/v1/namespaces/{namespace}/rules/apply"
body: "*"
}
};
Expand Down

0 comments on commit 9349b13

Please sign in to comment.