Skip to content

Commit

Permalink
PMM-12836 restructure alerting api
Browse files Browse the repository at this point in the history
  • Loading branch information
ademidoff committed Feb 7, 2024
1 parent d3ad3cc commit a6eba44
Show file tree
Hide file tree
Showing 31 changed files with 1,329 additions and 618 deletions.
8 changes: 4 additions & 4 deletions Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ gen-api: ## Generate PMM API

bin/buf generate -v api

for API in api/agentlocal/v1 api/server/v1 api/inventory/v1 api/management/v1 api/management/v1/alerting api/management/v1/backup api/management/v1/dump api/management/v1/azure api/management/v1/role api/qan/v1beta1 api/management/v1/agent api/management/v1/node api/management/v1/service api/platform/v1 api/user/v1; do \
for API in api/agentlocal/v1 api/server/v1 api/inventory/v1 api/management/v1 api/alerting/v1 api/management/v1/backup api/management/v1/dump api/management/v1/azure api/management/v1/role api/qan/v1beta1 api/management/v1/agent api/management/v1/node api/management/v1/service api/platform/v1 api/user/v1; do \
set -x ; \
bin/swagger mixin $$API/json/header.json $$API/*.swagger.json --output=$$API/json/$$(basename $$API).json --keep-spec-order; \
bin/swagger flatten --with-flatten=expand --with-flatten=remove-unused $$API/json/$$(basename $$API).json --output=$$API/json/$$(basename $$API).json ; \
Expand All @@ -75,7 +75,7 @@ gen-api: ## Generate PMM API
api/user/v1/json/v1.json \
api/management/v1/json/v1.json \
api/management/v1/backup/json/backup.json \
api/management/v1/alerting/json/alerting.json
api/alerting/v1/json/alerting.json
bin/swagger validate api/swagger/swagger.json

bin/swagger-order --output=api/swagger/swagger.json api/swagger/swagger.json
Expand All @@ -87,7 +87,7 @@ gen-api: ## Generate PMM API
api/user/v1/json/v1.json \
api/inventory/v1/json/v1.json \
api/management/v1/json/v1.json \
api/management/v1/alerting/json/alerting.json \
api/alerting/v1/json/alerting.json \
api/management/v1/backup/json/backup.json \
api/management/v1/dump/json/dump.json \
api/management/v1/azure/json/azure.json \
Expand Down Expand Up @@ -124,7 +124,7 @@ clean: clean_swagger ## Remove generated files
find api -name '*.pb.gw.go' -print -delete
find api -name '*.validate.go' -print -delete

for API in api/agentlocal/v1 api/server/v1 api/inventory/v1 api/management/v1 api/management/v1/alerting api/management/v1/backup api/management/v1/dump api/management/v1/role api/management/v1/agent api/management/v1/node api/management/v1/service api/qan/v1beta1 api/platform/v1 ; do \
for API in api/agentlocal/v1 api/server/v1 api/inventory/v1 api/management/v1 api/alerting/v1 api/management/v1/backup api/management/v1/dump api/management/v1/role api/management/v1/agent api/management/v1/node api/management/v1/service api/qan/v1beta1 api/platform/v1 ; do \
rm -fr $$API/json/client $$API/json/models $$API/json/$$(basename $$API).json ; \
done
rm -f api/swagger/swagger.json api/swagger/swagger-dev.json
Expand Down
2 changes: 1 addition & 1 deletion api-tests/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ import (
"github.com/sirupsen/logrus"
"golang.org/x/sys/unix"

alertingClient "github.com/percona/pmm/api/alerting/v1/json/client"
inventoryClient "github.com/percona/pmm/api/inventory/v1/json/client"
alertingClient "github.com/percona/pmm/api/management/v1/alerting/json/client"
backupsClient "github.com/percona/pmm/api/management/v1/backup/json/client"
managementClient "github.com/percona/pmm/api/management/v1/json/client"
platformClient "github.com/percona/pmm/api/platform/v1/json/client"
Expand Down
4 changes: 2 additions & 2 deletions api-tests/management/alerting/alerting_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ import (
"gopkg.in/yaml.v3"

pmmapitests "github.com/percona/pmm/api-tests"
alertingClient "github.com/percona/pmm/api/management/v1/alerting/json/client"
alerting "github.com/percona/pmm/api/management/v1/alerting/json/client/alerting_service"
alertingClient "github.com/percona/pmm/api/alerting/v1/json/client"
alerting "github.com/percona/pmm/api/alerting/v1/json/client/alerting_service"
"github.com/percona/pmm/managed/services/grafana"
)

Expand Down
Loading

0 comments on commit a6eba44

Please sign in to comment.