Skip to content

Commit

Permalink
PMM-12913 refactor empty proto messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ademidoff committed Feb 15, 2024
1 parent 958acbc commit a4e9545
Show file tree
Hide file tree
Showing 141 changed files with 7,949 additions and 16,763 deletions.
5 changes: 3 additions & 2 deletions agent/agentlocal/agent_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"sync"
"time"

"github.com/golang/protobuf/ptypes/empty"
grpc_gateway "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
Expand Down Expand Up @@ -184,7 +185,7 @@ func roundFloat(upTime float32, numAfterDot int) float32 {
}

// Reload reloads pmm-agent and its configuration.
func (s *Server) Reload(ctx context.Context, req *agentlocal.ReloadRequest) (*agentlocal.ReloadResponse, error) {
func (s *Server) Reload(_ context.Context, req *empty.Empty) (*empty.Empty, error) {
// sync errors with setup command

if _, err := s.cfg.Reload(s.l); err != nil {
Expand All @@ -196,7 +197,7 @@ func (s *Server) Reload(ctx context.Context, req *agentlocal.ReloadRequest) (*ag
})

// client may or may not receive this response due to server shutdown
return &agentlocal.ReloadResponse{}, nil
return &empty.Empty{}, nil
}

// runGRPCServer runs gRPC server until context is canceled, then gracefully stops it.
Expand Down
949 changes: 450 additions & 499 deletions api/actions/v1/actions.pb.go

Large diffs are not rendered by default.

102 changes: 0 additions & 102 deletions api/actions/v1/actions.pb.validate.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions api/actions/v1/actions.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ syntax = "proto3";
package actions.v1;

import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
import "validate/validate.proto";

Expand Down Expand Up @@ -275,8 +276,6 @@ message CancelActionRequest {
string action_id = 1 [(validate.rules).string.min_len = 1];
}

message CancelActionResponse {}

// Actions service provides public Management API methods for Actions.
service ActionsService {
// GetAction gets result of a given Action.
Expand Down Expand Up @@ -434,7 +433,7 @@ service ActionsService {
};
}
// CancelAction stops an Action.
rpc CancelAction(CancelActionRequest) returns (CancelActionResponse) {
rpc CancelAction(CancelActionRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/v1/actions/Cancel"
body: "*"
Expand Down
11 changes: 6 additions & 5 deletions api/actions/v1/actions_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a4e9545

Please sign in to comment.