ISSUE-1444: Additional params added to connector restart endpoint to be able to… (#1445)
* Additional params added to connector restart endpoint to be able to restart not only connector instance, but all its tasks * RESTARTING state added to ConnectorTaskStatus * Restart connector button rename Co-authored-by: iliax <ikuramshin@provectus.com>
This commit is contained in:
parent
79442a7e82
commit
f85a340b79
6 changed files with 28 additions and 10 deletions
|
@ -266,7 +266,8 @@ public class KafkaConnectService {
|
|||
switch (action) {
|
||||
case RESTART:
|
||||
kafkaClientCall =
|
||||
connect -> KafkaConnectClients.withBaseUrl(connect).restartConnector(connectorName);
|
||||
connect -> KafkaConnectClients.withBaseUrl(connect)
|
||||
.restartConnector(connectorName, true, false);
|
||||
break;
|
||||
case PAUSE:
|
||||
kafkaClientCall =
|
||||
|
|
|
@ -169,7 +169,7 @@ paths:
|
|||
post:
|
||||
tags:
|
||||
- KafkaConnectClient
|
||||
summary: restart the connector
|
||||
summary: restart the connector and its tasks
|
||||
operationId: restartConnector
|
||||
parameters:
|
||||
- name: connectorName
|
||||
|
@ -177,6 +177,21 @@ paths:
|
|||
required: true
|
||||
schema:
|
||||
type: string
|
||||
- name: includeTasks
|
||||
in: query
|
||||
required: false
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
description: Specifies whether to restart the connector instance and task instances or just the connector instance
|
||||
- name: onlyFailed
|
||||
in: query
|
||||
required: false
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
description: Specifies whether to restart just the instances with a FAILED status or all instances
|
||||
|
||||
responses:
|
||||
200:
|
||||
description: OK
|
||||
|
@ -406,6 +421,7 @@ components:
|
|||
- RUNNING
|
||||
- FAILED
|
||||
- PAUSED
|
||||
- RESTARTING
|
||||
- UNASSIGNED
|
||||
worker_id:
|
||||
type: string
|
||||
|
|
|
@ -2396,6 +2396,7 @@ components:
|
|||
- RUNNING
|
||||
- FAILED
|
||||
- PAUSED
|
||||
- RESTARTING
|
||||
- UNASSIGNED
|
||||
|
||||
ConnectorState:
|
||||
|
|
|
@ -126,7 +126,7 @@ const Actions: React.FC<ActionsProps> = ({
|
|||
<span>
|
||||
<i className="fas fa-sync-alt" />
|
||||
</span>
|
||||
<span>Restart All Tasks</span>
|
||||
<span>Restart Connector</span>
|
||||
</Button>
|
||||
<Button
|
||||
buttonSize="M"
|
||||
|
|
|
@ -148,7 +148,7 @@ describe('Actions', () => {
|
|||
it('calls restartConnector when restart button clicked', () => {
|
||||
const restartConnector = jest.fn();
|
||||
const wrapper = mount(setupWrapper({ restartConnector }));
|
||||
wrapper.find({ children: 'Restart All Tasks' }).simulate('click');
|
||||
wrapper.find({ children: 'Restart Connector' }).simulate('click');
|
||||
expect(restartConnector).toHaveBeenCalledTimes(1);
|
||||
expect(restartConnector).toHaveBeenCalledWith(
|
||||
clusterName,
|
||||
|
|
|
@ -141,7 +141,7 @@ exports[`Actions view matches snapshot 1`] = `
|
|||
/>
|
||||
</span>
|
||||
<span>
|
||||
Restart All Tasks
|
||||
Restart Connector
|
||||
</span>
|
||||
</button>
|
||||
<a
|
||||
|
@ -334,7 +334,7 @@ exports[`Actions view matches snapshot when deleting connector 1`] = `
|
|||
/>
|
||||
</span>
|
||||
<span>
|
||||
Restart All Tasks
|
||||
Restart Connector
|
||||
</span>
|
||||
</button>
|
||||
<a
|
||||
|
@ -512,7 +512,7 @@ exports[`Actions view matches snapshot when failed 1`] = `
|
|||
/>
|
||||
</span>
|
||||
<span>
|
||||
Restart All Tasks
|
||||
Restart Connector
|
||||
</span>
|
||||
</button>
|
||||
<a
|
||||
|
@ -705,7 +705,7 @@ exports[`Actions view matches snapshot when paused 1`] = `
|
|||
/>
|
||||
</span>
|
||||
<span>
|
||||
Restart All Tasks
|
||||
Restart Connector
|
||||
</span>
|
||||
</button>
|
||||
<a
|
||||
|
@ -898,7 +898,7 @@ exports[`Actions view matches snapshot when running connector action 1`] = `
|
|||
/>
|
||||
</span>
|
||||
<span>
|
||||
Restart All Tasks
|
||||
Restart Connector
|
||||
</span>
|
||||
</button>
|
||||
<a
|
||||
|
@ -1076,7 +1076,7 @@ exports[`Actions view matches snapshot when unassigned 1`] = `
|
|||
/>
|
||||
</span>
|
||||
<span>
|
||||
Restart All Tasks
|
||||
Restart Connector
|
||||
</span>
|
||||
</button>
|
||||
<a
|
||||
|
|
Loading…
Add table
Reference in a new issue