Skip to content

Commit 1171eb8

Browse files
committed
PMM-12913 migrate /v1/inventory/Agents/Get
1 parent 9d43851 commit 1171eb8

File tree

12 files changed

+10594
-10629
lines changed

12 files changed

+10594
-10629
lines changed

api-tests/management/helpers.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,7 @@ func assertPMMAgentCreated(t pmmapitests.TestingT, nodeID string, pmmAgentID str
9797
t.Helper()
9898

9999
agentOK, err := inventoryClient.Default.AgentsService.GetAgent(&agents.GetAgentParams{
100-
Body: agents.GetAgentBody{
101-
AgentID: pmmAgentID,
102-
},
100+
AgentID: pmmAgentID,
103101
Context: pmmapitests.Context,
104102
})
105103
assert.NoError(t, err)

api/MIGRATION_TO_V3.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ POST /v1/user/list GET /v1/users
2323
**AgentsService** **AgentsService**
2424
POST /v1/inventory/Agents/Add POST /v1/inventory/agents ✅
2525
POST /v1/inventory/Agents/Change PUT /v1/inventory/agents/{id} ✅
26-
POST /v1/inventory/Agents/Get GET /v1/inventory/agents/{id}
26+
POST /v1/inventory/Agents/Get GET /v1/inventory/agents/{id}
2727
POST /v1/inventory/Agents/List GET /v1/inventory/agents
2828
POST /v1/inventory/Agents/Remove DELETE /v1/inventory/agents/{id}
2929
POST /v1/inventory/Agents/GetLogs GET /v1/inventory/agents/{id}/logs

api/inventory/v1/agents.pb.go

+72-72
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/inventory/v1/agents.pb.gw.go

+35-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/inventory/v1/agents.pb.validate.go

+6-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/inventory/v1/agents.proto

+4-7
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ message ListAgentsResponse {
617617

618618
message GetAgentRequest {
619619
// Unique randomly generated instance identifier.
620-
string agent_id = 1 [(validate.rules).string.min_len = 1];
620+
string agent_id = 1 [(validate.rules).string.min_len = 36];
621621
}
622622

623623
message GetAgentResponse {
@@ -644,7 +644,7 @@ message GetAgentResponse {
644644

645645
message GetAgentLogsRequest {
646646
// Unique randomly generated instance identifier.
647-
string agent_id = 1 [(validate.rules).string.min_len = 1];
647+
string agent_id = 1 [(validate.rules).string.min_len = 36];
648648
// is less than this value. 0: no limit
649649
uint32 limit = 2;
650650
}
@@ -697,7 +697,7 @@ message AddAgentResponse {
697697
}
698698

699699
message ChangeAgentRequest {
700-
string agent_id = 1 [(validate.rules).string.min_len = 36];
700+
string agent_id = 1 [(validate.rules).string.min_len = 1];
701701

702702
oneof agent {
703703
// ChangePMMAgentParams pmm_agent = 1;
@@ -1325,10 +1325,7 @@ service AgentsService {
13251325
}
13261326
// GetAgent returns a single Agent by ID.
13271327
rpc GetAgent(GetAgentRequest) returns (GetAgentResponse) {
1328-
option (google.api.http) = {
1329-
post: "/v1/inventory/Agents/Get"
1330-
body: "*"
1331-
};
1328+
option (google.api.http) = {get: "/v1/inventory/agents/{agent_id}"};
13321329
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
13331330
summary: "Get Agent"
13341331
description: "Returns a single Agent by ID."

api/inventory/v1/json/client/agents_service/agents_service_client.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/inventory/v1/json/client/agents_service/get_agent_parameters.go

+14-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/inventory/v1/json/client/agents_service/get_agent_responses.go

+2-39
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)