Skip to content

Commit

Permalink
PMM-12985 Create v3 API infra
Browse files Browse the repository at this point in the history
  • Loading branch information
ademidoff committed Aug 2, 2024
1 parent 85a01ce commit da25a0c
Show file tree
Hide file tree
Showing 32 changed files with 42 additions and 50 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ jobs:
sync:
name: Sync
runs-on: ubuntu-22.04
env:
VERSION: v2
ID: 626badcabbc59c02acc1a53f

steps:
- name: Check out code
Expand All @@ -32,12 +29,11 @@ jobs:
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "ID=$ID" >> $GITHUB_ENV
- name: API
uses: readmeio/rdme@v8
with:
rdme: openapi ./api/swagger/swagger.json --id=${{ env.ID }} --key=${{ secrets.README_TOKEN }}
- name: Provision rdme
run: npm install -g rdme

- name: Markdown docs
uses: readmeio/rdme@v8
with:
rdme: docs docs/api --version=${{ env.VERSION }} --key=${{ secrets.README_TOKEN }}
- name: Sync API spec
run: rdme openapi ./api/swagger/swagger.json --id=${{ env.ID }} --key=${{ secrets.README_TOKEN }}

- name: Sync Markdown docs
run: rdme docs docs/api --version=${{ env.VERSION }} --key=${{ secrets.README_TOKEN }}
4 changes: 1 addition & 3 deletions admin/commands/management/management.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
// Package management provides management commands.
package management

import (
"github.com/percona/pmm/api/inventory/v1/types"
)
import "github.com/percona/pmm/api/inventory/v1/types"

var (
allNodeTypes = map[string]string{
Expand Down
4 changes: 2 additions & 2 deletions api/swagger/header.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"swagger": "2.0",
"info": {
"title": "PMM API",
"version": "v2"
"version": "v3"
},
"schemes": [
"https",
Expand All @@ -26,5 +26,5 @@
"python"
]
},
"x-readme-id": "626badcabbc59c02acc1a53f"
"x-readme-id": "622892a957a7410330bc6184"
}
4 changes: 2 additions & 2 deletions api/swagger/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"swagger": "2.0",
"info": {
"title": "PMM API",
"version": "v2"
"version": "v3"
},
"paths": {
"/v1/actions/{action_id}": {
Expand Down Expand Up @@ -27172,5 +27172,5 @@
"python"
]
},
"x-readme-id": "626badcabbc59c02acc1a53f"
"x-readme-id": "622892a957a7410330bc6184"
}
2 changes: 1 addition & 1 deletion docs/api/access-control/access-control.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Access Control
slug: access-control
category: 64e49e26498dc6002b62ebf4
category: 66aca8d40bf230001846b567
---

## Overview
Expand Down
2 changes: 1 addition & 1 deletion docs/api/advisor-api/advisors-and-advisor-checks.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Percona Advisors and Advisors checks
slug: advisors-and-advisor-checks
category: 6291050b9400a1001ae1877d
category: 66acabbe485c6000126b0499
order: 1
hidden: 0
---
2 changes: 1 addition & 1 deletion docs/api/advisor-api/changing-advisor-checks.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Changing Advisors and Advisor checks
slug: changing-advisor-checks
category: 6291050b9400a1001ae1877d
category: 66acabbe485c6000126b0499
order: 3
hidden: 0
---
2 changes: 1 addition & 1 deletion docs/api/advisor-api/failed-checks.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: List of problems detected by Advisors
slug: failed-checks
category: 6291050b9400a1001ae1877d
category: 66acabbe485c6000126b0499
order: 2
hidden: 0
---
2 changes: 1 addition & 1 deletion docs/api/advisor-api/overview.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Overview
slug: pmm-advisors
category: 6291050b9400a1001ae1877d
category: 66acabbe485c6000126b0499
order: 0
---

Expand Down
2 changes: 1 addition & 1 deletion docs/api/backups/list-locations.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: List Locations
slug: listlocations
excerpt: ListLocations returns a list of all backup locations.
category: 66aa56507e69ed004a736efe
category: 66acac6024b4bc0022d980f3
---

The following API call will list all the available backup locations:
Expand Down
2 changes: 1 addition & 1 deletion docs/api/backups/overview.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Overview
slug: database-backups
category: 66aa56507e69ed004a736efe
category: 66acac6024b4bc0022d980f3
order: 0
---

Expand Down
2 changes: 1 addition & 1 deletion docs/api/backups/restore-backup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Restore from a backup
slug: restorebackup
excerpt: This endpoint allows to restore a database from a previously made backup.
category: 66aa56507e69ed004a736efe
category: 66acac6024b4bc0022d980f3
---

PMM can backup the monitored services.
Expand Down
2 changes: 1 addition & 1 deletion docs/api/backups/start-backup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Make a backup
slug: startbackup
excerpt: This endpoint allows to make an unscheduled, or ad-hoc, backup of a given service.
category: 66aa56507e69ed004a736efe
category: 66acac6024b4bc0022d980f3
---

PMM can backup the monitored services.
Expand Down
2 changes: 1 addition & 1 deletion docs/api/inventory/add-agent.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Add an Agent
slug: addagent
category: 626de009b977e3003179f7dd
category: 66aca9bf17142b005ad4e9fa
---

## Add an Agent
Expand Down
2 changes: 1 addition & 1 deletion docs/api/inventory/add-node.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Add a Node
slug: addnode
category: 626de009b977e3003179f7dd
category: 66aca9bf17142b005ad4e9fa
---

## Add a Node
Expand Down
2 changes: 1 addition & 1 deletion docs/api/inventory/add-service.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Add a Service
slug: addservice
category: 626de009b977e3003179f7dd
category: 66aca9bf17142b005ad4e9fa
---

## Add a Service
Expand Down
2 changes: 1 addition & 1 deletion docs/api/inventory/change-agent.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Change Agent Attributes
slug: changeagent
category: 626de009b977e3003179f7dd
category: 66aca9bf17142b005ad4e9fa
---

## Change Agent Attributes
Expand Down
2 changes: 1 addition & 1 deletion docs/api/inventory/list-nodes.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: List Nodes
slug: listnodes
category: 626de009b977e3003179f7dd
category: 66aca9bf17142b005ad4e9fa
---

## List Nodes
Expand Down
2 changes: 1 addition & 1 deletion docs/api/inventory/list-services.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: List Services
slug: listservices
category: 626de009b977e3003179f7dd
category: 66aca9bf17142b005ad4e9fa
---

## List Services
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: Create user accounts
slug: bulk-add-users
category: 626bd6a45c6ea70129427eff
parentDoc: 626be9a93ab1240284d0d27d
category: 66acab7b0bf230001846b5e2
parentDoc: 66acad52c21a1a0036295235
order: 1
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: Change the administrator's password
slug: change-admin-password
category: 626bd6a45c6ea70129427eff
parentDoc: 626be9a93ab1240284d0d27d
category: 66acab7b0bf230001846b5e2
parentDoc: 66acad52c21a1a0036295235
order: 0
---

Expand Down
2 changes: 1 addition & 1 deletion docs/api/pmm-server-config/overview.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Overview
slug: pmm-server-configuration
category: 626bd6a45c6ea70129427eff
category: 66acab7b0bf230001846b5e2
order: 0
---

Expand Down
2 changes: 1 addition & 1 deletion docs/api/pmm-server-config/pmm-server-settings.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: PMM Server Settings
slug: pmm-server-settings
category: 626bd6a45c6ea70129427eff
category: 66acab7b0bf230001846b5e2
order: 2
---

Expand Down
2 changes: 1 addition & 1 deletion docs/api/pmm-server-config/pmm-server-troubleshooting.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Troubleshooting
slug: pmm-server-troubleshooting
category: 626bd6a45c6ea70129427eff
category: 66acab7b0bf230001846b5e2
order: 4
hidden: 0
---
2 changes: 1 addition & 1 deletion docs/api/pmm-server-config/pmm-server-upgrade.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Upgrade your PMM Server
slug: pmm-server-upgrade
category: 626bd6a45c6ea70129427eff
category: 66acab7b0bf230001846b5e2
order: 3
---

Expand Down
2 changes: 1 addition & 1 deletion docs/api/pmm-server-config/troubleshooting/logs.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Logs
slug: "logs"
category: 626badcabbc59c02acc1a540
category: 66acab7b0bf230001846b5e2
---

Sometimes users need to troubleshoot an issue. PMM Server offers an ability to download the logs as well as configuration of its components.
Expand Down
2 changes: 1 addition & 1 deletion docs/api/pmm-server-config/user-account-management.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: User account management
slug: pmm-server-config-security
category: 626bd6a45c6ea70129427eff
category: 66acab7b0bf230001846b5e2
order: 1
---

Expand Down
2 changes: 1 addition & 1 deletion docs/api/welcome/authentication.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Authentication
slug: authentication
category: 651bd218baa868000c212203
category: 66aca6ddfd9bfe004c97cd48
order: 1
---

Expand Down
2 changes: 1 addition & 1 deletion docs/api/welcome/introduction.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Introduction
slug: introduction
category: 651bd218baa868000c212203
category: 66aca6ddfd9bfe004c97cd48
order: 0
---

Expand Down
2 changes: 1 addition & 1 deletion docs/api/welcome/monitoring.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Monitoring
slug: monitoring
category: 651bd218baa868000c212203
category: 66aca6ddfd9bfe004c97cd48
order: 2
---

Expand Down
3 changes: 1 addition & 2 deletions managed/cmd/pmm-managed/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,7 @@ func runHTTP1Server(ctx context.Context, deps *http1ServerDeps) {
proxyMux := grpc_gateway.NewServeMux(
grpc_gateway.WithMarshalerOption(grpc_gateway.MIMEWildcard, marshaller),
grpc_gateway.WithErrorHandler(pmmerrors.PMMHTTPErrorHandler),
grpc_gateway.WithRoutingErrorHandler(pmmerrors.PMMRoutingErrorHandler),
)
grpc_gateway.WithRoutingErrorHandler(pmmerrors.PMMRoutingErrorHandler))

opts := []grpc.DialOption{
grpc.WithTransportCredentials(insecure.NewCredentials()),
Expand Down
3 changes: 1 addition & 2 deletions qan-api2/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ func runJSONServer(ctx context.Context, grpcBindF, jsonBindF string) {

proxyMux := grpc_gateway.NewServeMux(
grpc_gateway.WithMarshalerOption(grpc_gateway.MIMEWildcard, marshaller),
grpc_gateway.WithRoutingErrorHandler(pmmerrors.PMMRoutingErrorHandler),
)
grpc_gateway.WithRoutingErrorHandler(pmmerrors.PMMRoutingErrorHandler))
opts := []grpc.DialOption{grpc.WithTransportCredentials(insecure.NewCredentials())}

type registrar func(context.Context, *grpc_gateway.ServeMux, string, []grpc.DialOption) error
Expand Down

0 comments on commit da25a0c

Please sign in to comment.