From a2cfd005154ae43ec6c9f0301bb5a5c9abbca5ba Mon Sep 17 00:00:00 2001 From: Alex Demidoff Date: Tue, 12 Mar 2024 12:42:54 +0000 Subject: [PATCH] PMM-12913 all endpoints begin with `/v1` --- api/MIGRATION_TO_V3.md | 271 ++++++++++++++++++++--------------------- 1 file changed, 135 insertions(+), 136 deletions(-) diff --git a/api/MIGRATION_TO_V3.md b/api/MIGRATION_TO_V3.md index ecd2e2b741..3cfc00be64 100644 --- a/api/MIGRATION_TO_V3.md +++ b/api/MIGRATION_TO_V3.md @@ -1,167 +1,166 @@ ## Migrations of API endpoints to make them more RESTful -| Current (v2) | Migrate to (v3) | Comments | -| ----------------------------------------------- | -------------------------------------------- | ------------------------------- | +| Current (v2) | Migrate to (v3) | Comments | +| ----------------------------------------------- | ---------------------------------------------- | ------------------------------- | **ServerService** **ServerService** -GET /logz.zip GET /api/server/v1/logs.zip redirect to /logs.zip in swagger -GET /v1/version GET /api/server/v1/version ✅ redirect to /v1/version in swagger -POST /v1/readyz GET /api/server/v1/readyz ✅ redirect to /v1/readyz in swagger -POST /v1/AWSInstanceCheck GET /api/server/v1/AWSInstance -POST /v1/leaderHealthCheck GET /api/server/v1/leaderHealthCheck -POST /v1/settings/Change PUT /api/server/v1/settings -POST /v1/settings/Get GET /api/server/v1/settings -POST /v1/updates/Check GET /api/server/v1/updates -POST /v1/updates/Start POST /api/server/v1/updates:start !!! -POST /v1/updates/Status GET /api/server/v1/updates/status pass "auth_token" via headers, ?log_offset=200 +GET /logz.zip GET /v1/server/logs.zip redirect to /logs.zip in swagger +GET /v1/version GET /v1/server/version ✅ redirect to /v1/version in swagger +POST /v1/readyz GET /v1/server/readyz ✅ redirect to /v1/readyz in swagger +POST /v1/AWSInstanceCheck GET /v1/server/AWSInstance +POST /v1/leaderHealthCheck GET /v1/server/leaderHealthCheck +POST /v1/settings/Change PUT /v1/server/settings +POST /v1/settings/Get GET /v1/server/settings +POST /v1/updates/Check GET /v1/server/updates +POST /v1/updates/Start POST /v1/server/updates:start +POST /v1/updates/Status GET /v1/server/updates/status pass "auth_token" via headers, ?log_offset=200 **UserService** **UserService** -GET /v1/user GET /api/users/v1/me needs no {id} in path -PUT /v1/user PUT /api/users/v1/me needs no {id} in path -POST /v1/user/list GET /api/users/v1/users +GET /v1/user GET /v1/users/me needs no {id} in path +PUT /v1/user PUT /v1/users/me needs no {id} in path +POST /v1/user/list GET /v1/users/users **AgentsService** **AgentsService** -POST /v1/inventory/Agents/Add POST /api/inventory/v1/agents -POST /v1/inventory/Agents/Change PUT /api/inventory/v1/agents/{id} -POST /v1/inventory/Agents/Get GET /api/inventory/v1/agents/{id} -POST /v1/inventory/Agents/List GET /api/inventory/v1/agents -POST /v1/inventory/Agents/Remove DELETE /api/inventory/v1/agents/{id} -POST /v1/inventory/Agents/GetLogs GET /api/inventory/v1/agents/{id}/logs +POST /v1/inventory/Agents/Add POST /v1/inventory/agents +POST /v1/inventory/Agents/Change PUT /v1/inventory/agents/{id} +POST /v1/inventory/Agents/Get GET /v1/inventory/agents/{id} +POST /v1/inventory/Agents/List GET /v1/inventory/agents +POST /v1/inventory/Agents/Remove DELETE /v1/inventory/agents/{id} +POST /v1/inventory/Agents/GetLogs GET /v1/inventory/agents/{id}/logs **NodesService** **NodesService** -POST /v1/inventory/Nodes/Add POST /api/inventory/v1/nodes -POST /v1/inventory/Nodes/Get GET /api/inventory/v1/nodes/{id} -POST /v1/inventory/Nodes/Delete DELETE /api/inventory/v1/nodes/{id} -POST /v1/inventory/Nodes/List GET /api/inventory/v1/nodes +POST /v1/inventory/Nodes/Add POST /v1/inventory/nodes +POST /v1/inventory/Nodes/Get GET /v1/inventory/nodes/{id} +POST /v1/inventory/Nodes/Delete DELETE /v1/inventory/nodes/{id} +POST /v1/inventory/Nodes/List GET /v1/inventory/nodes **ServicesService** **ServicesService** -POST /v1/inventory/Services/Add POST /api/management/v1/services -POST /v1/inventory/Services/Change PUT /api/inventory/v1/services/{id} -POST /v1/inventory/Servicse/Get GET /api/inventory/v1/services/{id} -POST /v1/inventory/Services/List GET /api/inventory/v1/services -POST /v1/inventory/Services/Remove DELETE /api/inventory/v1/services/{id} pass ?force=true to remove service with agents -POST /v1/inventory/Services/ListTypes GET /api/inventory/v1/services/types -POST /v1/inventory/Services/CustomLabels/Add POST /api/inventory/v1/services/{id}/custom_labels !!! remove and refactore in favor of PUT /api/inventory/v1/services/{id} -POST /v1/inventory/Services/CustomLabels/Remove DELETE /api/inventory/v1/services/{id}/custom_labels !!! remove and refactore in favor of PUT /api/inventory/v1/services/{id} +POST /v1/inventory/Services/Add POST /v1/inventory/services +POST /v1/inventory/Services/Change PUT /v1/inventory/services/{id} +POST /v1/inventory/Servicse/Get GET /v1/inventory/services/{id} +POST /v1/inventory/Services/List GET /v1/inventory/services +POST /v1/inventory/Services/Remove DELETE /v1/inventory/services/{id} pass ?force=true to remove service with agents +POST /v1/inventory/Services/ListTypes GET /v1/inventory/services/types +POST /v1/inventory/Services/CustomLabels/Add POST /v1/inventory/services/{id}/custom_labels !!! remove and refactor in favor of PUT /v1/inventory/services/{id} +POST /v1/inventory/Services/CustomLabels/Remove DELETE /v1/inventory/services/{id}/custom_labels !!! remove and refactor in favor of PUT /v1/inventory/services/{id} **ManagementService** **ManagementService** -POST /v1/management/Annotations/Add POST /api/management/v1/annotations -POST /v1/management/Node/Register POST /api/management/v1/nodes -POST /v1/management/External/Add POST /api/management/v1/services pass a service type in body -POST /v1/management/HAProxy/Add POST /api/management/v1/services pass a service type in body -POST /v1/management/MongoDB/Add POST /api/management/v1/services pass a service type in body -POST /v1/management/MySQL/Add POST /api/management/v1/services pass a service type in body -POST /v1/management/PostgreSQL/Add POST /api/management/v1/services pass a service type in body -POST /v1/management/ProxySQL/Add POST /api/management/v1/services pass a service type in body -POST /v1/management/RDS/Add POST /api/management/v1/services pass a service type in body -POST /v1/management/RDS/Discover POST /api/management/v1/services:discoverRDS -POST /v1/management/Service/Remove DELETE /api/management/v1/services/{id} ({service_id} or {service_name}) and optional {service_type} - +POST /v1/management/Annotations/Add POST /v1/management/annotations +POST /v1/management/Node/Register POST /v1/management/nodes +POST /v1/management/External/Add POST /v1/management/services pass a service type in body +POST /v1/management/HAProxy/Add POST /v1/management/services pass a service type in body +POST /v1/management/MongoDB/Add POST /v1/management/services pass a service type in body +POST /v1/management/MySQL/Add POST /v1/management/services pass a service type in body +POST /v1/management/PostgreSQL/Add POST /v1/management/services pass a service type in body +POST /v1/management/ProxySQL/Add POST /v1/management/services pass a service type in body +POST /v1/management/RDS/Add POST /v1/management/services pass a service type in body +POST /v1/management/RDS/Discover POST /v1/management/services:discoverRDS +POST /v1/management/Service/Remove DELETE /v1/management/services/{id} ({service_id} or {service_name}) and optional {service_type} **ActionsService** **ActionService** -POST /v1/actions/Cancel POST /api/actions/v1/actions:cancel -POST /v1/actions/Get GET /api/actions/v1/actions/{id} -POST /v1/actions/StartMongoDBExplain POST /api/actions/v1/actions:startServiceAction -POST /v1/actions/StartMySQLExplain POST /api/actions/v1/actions:startServiceAction -POST /v1/actions/StartMySQLExplainJSON POST /api/actions/v1/actions:startServiceAction -POST /v1/actions/StartMySQLExplainTraditionalJSON POST /api/actions/v1/actions:startServiceAction -POST /v1/actions/StartMySQLShowCreateTable POST /api/actions/v1/actions:startServiceAction -POST /v1/actions/StartMySQLShowIndex POST /api/actions/v1/actions:startServiceAction -POST /v1/actions/StartMySQLShowTableStatus POST /api/actions/v1/actions:startServiceAction -POST /v1/actions/StartPTMongoDBSummary POST /api/actions/v1/actions:startServiceAction -POST /v1/actions/StartPTMySQLSummary POST /api/actions/v1/actions:startServiceAction -POST /v1/actions/StartPTPgSummary POST /api/actions/v1/actions:startServiceAction -POST /v1/actions/StartPostgreSQLShowCreateTable POST /api/actions/v1/actions:startServiceAction -POST /v1/actions/StartPostgreSQLShowIndex POST /api/actions/v1/actions:startServiceAction -POST /v1/actions/StartPTSummary POST /api/actions/v1/actions:startNodeAction +POST /v1/actions/Cancel POST /v1/actions:cancel +POST /v1/actions/Get GET /v1/actions/{id} +POST /v1/actions/StartMongoDBExplain POST /v1/actions:startServiceAction NOTE: several similar actions are merged into one +POST /v1/actions/StartMySQLExplain POST /v1/actions:startServiceAction +POST /v1/actions/StartMySQLExplainJSON POST /v1/actions:startServiceAction +POST /v1/actions/StartMySQLExplainTraditionalJSON POST /v1/actions:startServiceAction +POST /v1/actions/StartMySQLShowCreateTable POST /v1/actions:startServiceAction +POST /v1/actions/StartMySQLShowIndex POST /v1/actions:startServiceAction +POST /v1/actions/StartMySQLShowTableStatus POST /v1/actions:startServiceAction +POST /v1/actions/StartPTMongoDBSummary POST /v1/actions:startServiceAction +POST /v1/actions/StartPTMySQLSummary POST /v1/actions:startServiceAction +POST /v1/actions/StartPTPgSummary POST /v1/actions:startServiceAction +POST /v1/actions/StartPostgreSQLShowCreateTable POST /v1/actions:startServiceAction +POST /v1/actions/StartPostgreSQLShowIndex POST /v1/actions:startServiceAction +POST /v1/actions/StartPTSummary POST /v1/actions:startNodeAction **AlertingService** **AlertingService** -POST /v1/alerting/Rules/Create POST /api/alerting/v1/rules -POST /v1/alerting/Templates/Create POST /api/alerting/v1/templates -POST /v1/alerting/Templates/Update PUT /api/alerting/v1/templates/{name} !!! pass yaml in body -POST /v1/alerting/Templates/List GET /api/alerting/v1/templates -POST /v1/alerting/Templates/Delete DELETE /api/alerting/v1/templates/{name} +POST /v1/alerting/Rules/Create POST /v1/alerting/rules +POST /v1/alerting/Templates/Create POST /v1/alerting/templates +POST /v1/alerting/Templates/Update PUT /v1/alerting/templates/{name} !!! pass yaml in body +POST /v1/alerting/Templates/List GET /v1/alerting/templates +POST /v1/alerting/Templates/Delete DELETE /v1/alerting/templates/{name} **AdvisorService** **AdvisorService** -POST /v1/advisors/Change POST /api/advisors/v1/checks:batchChange !!! exception: updates multiple checks - -POST /v1/advisors/FailedChecks GET /api/advisors/v1/checks/failedChecks ex: ?service_id=/service_id/1234-5678-abcd-efgh&page_params.page_size=100&page_params.index=1 -POST /v1/advisors/List GET /api/advisors/v1/advisors -POST /v1/advisors/ListChecks GET /api/advisors/v1/checks -POST /v1/advisors/StartChecks POST /api/advisors/v1/checks:start -POST /v1/advisors/ListFailedServices GET /api/advisors/v1/failedServices - -**ArtifactsService** **ArtifactsService** TODO: merge to BackupService -POST /v1/backup/Artifacts/List GET /api/backups/v1/artifacts -POST /v1/backup/Artifacts/Delete DELETE /api/backups/v1/artifacts/{id} ?remove_files=true -POST /v1/backup/Artifacts/PITRTimeranges GET /api/backups/v1/artifacts/{id}/pitr_timeranges - -**BackupsService** **BackupService** TODO: rename to singular -POST /v1/backup/Backups/ChangeScheduled PUT /api/backups/v1/backups:changeScheduled -POST /v1/backup/Backups/GetLogs GET /api/backups/v1/backups/{id}/logs -POST /v1/backup/Backups/ListArtifactCompatibleServices GET /api/backups/v1/backups/{id}/services Could also be /compatible_services -POST /v1/backup/Backups/ListScheduled GET /api/backups/v1/backups/scheduled -POST /v1/backup/Backups/RemoveScheduled GET /api/backups/v1/backups/scheduled/{id} - -POST /v1/backup/Backups/Schedule POST /api/backups/v1/backups:schedule -POST /v1/backup/Backups/Start POST /api/backups/v1/backups:start +POST /v1/advisors/Change POST /v1/advisors/checks:batchChange !!! exception: updates multiple checks + +POST /v1/advisors/FailedChecks GET /v1/advisors/checks/failedChecks ex: ?service_id=/service_id/1234-5678-abcd-efgh&page_params.page_size=100&page_params.index=1 +POST /v1/advisors/List GET /v1/advisors +POST /v1/advisors/ListChecks GET /v1/advisors/checks +POST /v1/advisors/StartChecks POST /v1/advisors/checks:start +POST /v1/advisors/ListFailedServices GET /v1/advisors/failedServices + +**ArtifactsService** **ArtifactsService** TODO: merge to BackupService +POST /v1/backup/Artifacts/List GET /v1/backups/artifacts +POST /v1/backup/Artifacts/Delete DELETE /v1/backups/artifacts/{id} ?remove_files=true +POST /v1/backup/Artifacts/PITRTimeranges GET /v1/backups/artifacts/{id}/pitr_timeranges + +**BackupsService** **BackupService** TODO: rename to singular +POST /v1/backup/Backups/ChangeScheduled PUT /v1/backups:changeScheduled +POST /v1/backup/Backups/GetLogs GET /v1/backups/{id}/logs +POST /v1/backup/Backups/ListArtifactCompatibleServices GET /v1/backups/{id}/services Could also be /compatible_services +POST /v1/backup/Backups/ListScheduled GET /v1/backups/scheduled +POST /v1/backup/Backups/RemoveScheduled GET /v1/backups/scheduled/{id} + +POST /v1/backup/Backups/Schedule POST /v1/backups:schedule +POST /v1/backup/Backups/Start POST /v1/backups:start **LocationsService** **LocationsService** -POST /v1/backup/Locations/Add POST /api/backups/v1/locations -POST /v1/backup/Locations/Change PUT /api/backups/v1/locations/{id} Extract the location_id from the body to {id} -POST /v1/backup/Locations/List GET /api/backups/v1/locations -POST /v1/backup/Locations/Remove DELETE /api/backups/v1/locations/{id} ?force=true -POST /v1/backup/Locations/TestConfig POST /api/backups/v1/locations:testConfig +POST /v1/backup/Locations/Add POST /v1/backups/locations +POST /v1/backup/Locations/Change PUT /v1/backups/locations/{id} Extract the location_id from the body to {id} +POST /v1/backup/Locations/List GET /v1/backups/locations +POST /v1/backup/Locations/Remove DELETE /v1/backups/locations/{id} ?force=true +POST /v1/backup/Locations/TestConfig POST /v1/backups/locations:testConfig **RestoreHistoryService** **RestoreService** -POST /v1/backup/RestoreHistory/List GET /api/backups/v1/restores Note: could also be restore_history -POST /v1/backup/Backups/Restore POST /api/backups/v1/restores:start - -**DumpsService** **DumpService** TODO: rename to singular -POST /v1/dump/List GET /api/dumps/v1/dumps -POST /v1/dump/Delete POST /api/dumps/v1/dumps:batchDelete accepts an array in body -POST /v1/dump/GetLogs GET /api/dumps/v1/dumps/{id}/logs ?offset=10,limit=100 -POST /v1/dump/Start POST /api/dumps/v1/dumps:start -POST /v1/dump/Upload POST /api/dumps/v1/dumps:upload - -**RoleService** **AccessControlService** TODO: rename to AccessControlService -POST /v1/role/Assign POST /api/accesscontrol/v1/roles:assign -POST /v1/role/Create POST /api/accesscontrol/v1/roles -POST /v1/role/Delete DELETE /api/accesscontrol/v1/roles/{id} ?replacement_role_id=id -POST /v1/role/Get GET /api/accesscontrol/v1/roles/{id} -POST /v1/role/List GET /api/accesscontrol/v1/roles -POST /v1/role/SetDefault POST /api/accesscontrol/v1/roles:setDefault -POST /v1/role/Update PUT /api/accesscontrol/v1/roles/{id} Extract the role_id from the body to {id} - -**MgmtService** **ManagementV1Beta1Service** TODO: promote to v1 -POST /v1/management/Agent/List GET /api/management/v1/agents -POST /v1/management/Node/Get GET /api/management/v1/nodes/{id} -POST /v1/management/Node/List GET /api/management/v1/nodes -POST /v1/management/AzureDatabase/Add POST /api/management/v1/services/azure -POST /v1/management/AzureDatabase/Discover POST /api/management/v1/services/azure:discover -POST /v1/management/Service/List GET /api/management/v1/services +POST /v1/backup/RestoreHistory/List GET /v1/backups/restores Note: could also be restore_history +POST /v1/backup/Backups/Restore POST /v1/backups/restores:start + +**DumpsService** **DumpService** TODO: rename to singular +POST /v1/dump/List GET /v1/dumps +POST /v1/dump/Delete POST /v1/dumps:batchDelete accepts an array in body +POST /v1/dump/GetLogs GET /v1/dumps/{id}/logs ?offset=10,limit=100 +POST /v1/dump/Start POST /v1/dumps:start +POST /v1/dump/Upload POST /v1/dumps:upload + +**RoleService** **AccessControlService** TODO: rename to AccessControlService +POST /v1/role/Assign POST /v1/accesscontrol/roles:assign +POST /v1/role/Create POST /v1/accesscontrol/roles +POST /v1/role/Delete DELETE /v1/accesscontrol/roles/{id} ?replacement_role_id=id +POST /v1/role/Get GET /v1/accesscontrol/roles/{id} +POST /v1/role/List GET /v1/accesscontrol/roles +POST /v1/role/SetDefault POST /v1/accesscontrol/roles:setDefault +POST /v1/role/Update PUT /v1/accesscontrol/roles/{id} Extract the role_id from the body to {id} + +**MgmtService** **ManagementV1Beta1Service** NOTE: promoted to v1 from v1beta1 +POST /v1/management/Agent/List GET /v1/management/agents +POST /v1/management/Node/Get GET /v1/management/nodes/{id} +POST /v1/management/Node/List GET /v1/management/nodes +POST /v1/management/AzureDatabase/Add POST /v1/management/services/azure +POST /v1/management/AzureDatabase/Discover POST /v1/management/services/azure:discover +POST /v1/management/Service/List GET /v1/management/services **QANService** **QANService** -POST /v1/qan/Filters/Get POST /api/qan/v1/metrics:getFilters accepts a bunch of params, incl. an array -POST /v1/qan/GetMetricsNames POST /api/qan/v1/metrics:getNames Note: it accepts no params, but hard to make it a GET -POST /v1/qan/GetReport POST /api/qan/v1/metrics:getReport -POST /v1/qan/ObjectDetails/ExplainFingerprintByQueryId POST /api/qan/v1/data:explainFingerprint -POST /v1/qan/ObjectDetails/GetHistogram POST /api/qan/v1/data:histogram -POST /v1/qan/ObjectDetails/GetLables POST /api/qan/v1/data:labels -POST /v1/qan/ObjectDetails/GetMetrics POST /api/qan/v1/data:metrics -POST /v1/qan/ObjectDetails/GetQueryExample POST /api/qan/v1/query:getExample !!! Need to revisit the endpoint design -POST /v1/qan/ObjectDetails/GetQueryPlan GET /api/qan/v1/query/{query_id}/plan -POST /v1/qan/ObjectDetails/QueryExists GET /api/qan/v1/query/{query_id} !!! Return query_id, fingerptint -POST /v1/qan/ObjectDetails/SchemaByQueryId POST /api/qan/v1/query:getSchema +POST /v1/qan/Filters/Get POST /v1/qan/metrics:getFilters accepts a bunch of params, incl. an array +POST /v1/qan/GetMetricsNames POST /v1/qan/metrics:getNames Note: it accepts no params, but hard to make it a GET +POST /v1/qan/GetReport POST /v1/qan/metrics:getReport +POST /v1/qan/ObjectDetails/ExplainFingerprintByQueryId POST /v1/qan:explainFingerprint +POST /v1/qan/ObjectDetails/GetHistogram POST /v1/qan:getHistogram +POST /v1/qan/ObjectDetails/GetLables POST /v1/qan:getLabels +POST /v1/qan/ObjectDetails/GetMetrics POST /v1/qan:getMetrics +POST /v1/qan/ObjectDetails/GetQueryExample POST /v1/qan/query:getExample !!! Need to revisit the endpoint design +POST /v1/qan/ObjectDetails/GetQueryPlan GET /v1/qan/query/{query_id}/plan +POST /v1/qan/ObjectDetails/QueryExists GET /v1/qan/query/{query_id} !!! Return query_id, fingerptint +POST /v1/qan/ObjectDetails/SchemaByQueryId POST /v1/qan/query:getSchema **PlatformService** **PlatformService** -POST /v1/platform/Connect POST /api/platform/v1/platform:connect -POST /v1/platform/Disconnect POST /api/platform/v1/platform:disconnect -POST /v1/platform/GetContactInformation GET /api/platform/v1/contact -POST /v1/platform/SearchOganizationEntitlemenets GET /api/platform/v1/organization/entitlements -POST /v1/platform/SearchOganizationTickets GET /api/platform/v1/organization/tickets -POST /v1/platform/ServerInfo GET /api/platform/v1/server -POST /v1/platform/UserInfo GET /api/platform/v1/user +POST /v1/platform/Connect POST /v1/platform:connect +POST /v1/platform/Disconnect POST /v1/platform:disconnect +POST /v1/platform/GetContactInformation GET /v1/platform/contact +POST /v1/platform/SearchOganizationEntitlemenets GET /v1/platform/organization/entitlements +POST /v1/platform/SearchOganizationTickets GET /v1/platform/organization/tickets +POST /v1/platform/ServerInfo GET /v1/platform/server +POST /v1/platform/UserInfo GET /v1/platform/user // TODO: rename `period_start_from` to `start_from` and `period_start_to` to `start_to`