Skip to content

Commit 8d8d8e4

Browse files
Bump to up elastic agents v3.
1 parent 31b8790 commit 8d8d8e4

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/main/java/cd/go/contrib/elasticagent/Constants.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ public interface Constants {
2828
String EXTENSION_TYPE = "elastic-agent";
2929

3030
// The extension point API version that this plugin understands
31-
String API_VERSION = "2.0";
31+
String PROCESSOR_API_VERSION = "1.0";
32+
String EXTENSION_API_VERSION = "3.0";
3233
String SERVER_INFO_API_VERSION = "1.0";
3334

3435
// the identifier of this plugin
35-
GoPluginIdentifier PLUGIN_IDENTIFIER = new GoPluginIdentifier(EXTENSION_TYPE, Collections.singletonList(API_VERSION));
36+
GoPluginIdentifier PLUGIN_IDENTIFIER = new GoPluginIdentifier(EXTENSION_TYPE, Collections.singletonList(EXTENSION_API_VERSION));
3637

3738
// requests that the plugin makes to the server
3839
String REQUEST_SERVER_PREFIX = "go.processor";

src/main/java/cd/go/contrib/elasticagent/PluginRequest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public ServerInfo getSeverInfo() throws ServerRequestFailedException {
4646
}
4747

4848
public PluginSettings getPluginSettings() throws ServerRequestFailedException {
49-
DefaultGoApiRequest request = new DefaultGoApiRequest(Constants.REQUEST_SERVER_GET_PLUGIN_SETTINGS, API_VERSION, PLUGIN_IDENTIFIER);
49+
DefaultGoApiRequest request = new DefaultGoApiRequest(Constants.REQUEST_SERVER_GET_PLUGIN_SETTINGS, PROCESSOR_API_VERSION, PLUGIN_IDENTIFIER);
5050
GoApiResponse response = accessor.submit(request);
5151

5252
if (response.responseCode() != 200) {
@@ -62,7 +62,7 @@ public PluginSettings getPluginSettings() throws ServerRequestFailedException {
6262
}
6363

6464
public Agents listAgents() throws ServerRequestFailedException {
65-
DefaultGoApiRequest request = new DefaultGoApiRequest(Constants.REQUEST_SERVER_LIST_AGENTS, API_VERSION, PLUGIN_IDENTIFIER);
65+
DefaultGoApiRequest request = new DefaultGoApiRequest(Constants.REQUEST_SERVER_LIST_AGENTS, PROCESSOR_API_VERSION, PLUGIN_IDENTIFIER);
6666
GoApiResponse response = accessor.submit(request);
6767

6868
if (response.responseCode() != 200) {
@@ -78,7 +78,7 @@ public void disableAgents(Collection<Agent> toBeDisabled) throws ServerRequestFa
7878
return;
7979
}
8080

81-
DefaultGoApiRequest request = new DefaultGoApiRequest(Constants.REQUEST_SERVER_DISABLE_AGENT, API_VERSION, PLUGIN_IDENTIFIER);
81+
DefaultGoApiRequest request = new DefaultGoApiRequest(Constants.REQUEST_SERVER_DISABLE_AGENT, PROCESSOR_API_VERSION, PLUGIN_IDENTIFIER);
8282
request.setRequestBody(Agent.toJSONArray(toBeDisabled));
8383

8484
GoApiResponse response = accessor.submit(request);
@@ -94,7 +94,7 @@ public void deleteAgents(Collection<Agent> toBeDeleted) throws ServerRequestFail
9494
return;
9595
}
9696

97-
DefaultGoApiRequest request = new DefaultGoApiRequest(Constants.REQUEST_SERVER_DELETE_AGENT, API_VERSION, PLUGIN_IDENTIFIER);
97+
DefaultGoApiRequest request = new DefaultGoApiRequest(Constants.REQUEST_SERVER_DELETE_AGENT, PROCESSOR_API_VERSION, PLUGIN_IDENTIFIER);
9898
request.setRequestBody(Agent.toJSONArray(toBeDeleted));
9999
GoApiResponse response = accessor.submit(request);
100100

0 commit comments

Comments
 (0)