-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
49 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
package io.openjob.server.openapi.request; | ||
|
||
import io.openjob.common.constant.ProtocolTypeEnum; | ||
import io.swagger.annotations.ApiModelProperty; | ||
import lombok.Data; | ||
|
||
import javax.validation.constraints.NotBlank; | ||
import javax.validation.constraints.Pattern; | ||
|
||
/** | ||
* @author zhenghongyang [email protected] | ||
|
@@ -13,24 +15,24 @@ | |
public class WorkerStartRequest { | ||
|
||
@NotBlank | ||
@ApiModelProperty("Worker key") | ||
@ApiModelProperty("Worker unique id.") | ||
private String workerKey; | ||
|
||
@NotBlank | ||
@ApiModelProperty("App name") | ||
private String appName; | ||
|
||
@NotBlank | ||
@Pattern(regexp = "^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}:\\d{1,5}$", message = "must be in format 'IP:PORT'") | ||
@ApiModelProperty("Worker address") | ||
private String address; | ||
|
||
@NotBlank | ||
@ApiModelProperty("Worker agent version") | ||
private String version; | ||
|
||
@NotBlank | ||
@ApiModelProperty("Worker current protocol type") | ||
private String protocolType; | ||
@ApiModelProperty("Worker current protocol type, http is default.") | ||
private String protocolType = ProtocolTypeEnum.HTTP.getType(); | ||
|
||
@ApiModelProperty("metric") | ||
private Metric metric; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
import lombok.Data; | ||
|
||
import javax.validation.constraints.NotBlank; | ||
import javax.validation.constraints.Pattern; | ||
|
||
/** | ||
* @author zhenghongyang [email protected] | ||
|
@@ -13,14 +14,15 @@ | |
public class WorkerStopRequest { | ||
|
||
@NotBlank | ||
@ApiModelProperty("Worker key") | ||
@ApiModelProperty("Worker unique id.") | ||
private String workerKey; | ||
|
||
@NotBlank | ||
@ApiModelProperty("App name") | ||
private String appName; | ||
|
||
@NotBlank | ||
@Pattern(regexp = "^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}:\\d{1,5}$", message = "must be in format 'IP:PORT'") | ||
@ApiModelProperty("worker address") | ||
private String address; | ||
} |
35 changes: 35 additions & 0 deletions
35
openjob-server/openjob-server-openapi/src/test/httptest/worker.http
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
### Worker start | ||
POST http://localhost:8080/openapi/worker/start | ||
Content-Type: application/json | ||
|
||
{ | ||
"address": "127.0.0.2:8088", | ||
"appName": "openjob", | ||
"metric": {}, | ||
"version": "1.0.6", | ||
"workerKey": "SZ2C7FNQRkktQdv" | ||
} | ||
|
||
### Worker start | ||
POST http://localhost:8080/openapi/worker/stop | ||
Content-Type: application/json | ||
|
||
{ | ||
"address": "127.0.0.2:8088", | ||
"appName": "openjob", | ||
"workerKey": "SZ2C7FNQRkktQdv" | ||
} | ||
|
||
|
||
### Worker heartbeat | ||
POST http://localhost:8080/openapi/worker/heartbeat | ||
Content-Type: application/json | ||
|
||
{ | ||
"address": "127.0.0.2:8088", | ||
"appId": 1, | ||
"appName": "openjob", | ||
"runningJobInstanceIds": [ | ||
], | ||
"version": "1.0.6" | ||
} |
2 changes: 1 addition & 1 deletion
2
openjob-server/openjob-server-starter/src/main/resources/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
openjob-worker/openjob-worker-core/src/main/java/io/openjob/worker/processor/TaskResult.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
package io.openjob.worker.processor; | ||
|
||
import io.openjob.common.constant.TaskStatusEnum; | ||
import lombok.Data; | ||
|
||
/** | ||
|