From 94cccadf0580e886ed3b6d51e5a5239eb3da7e20 Mon Sep 17 00:00:00 2001 From: Filipe C Menezes Date: Tue, 11 Feb 2025 18:09:26 +0000 Subject: [PATCH 1/5] CLOUDP-297413 Annotate current watchers --- tools/api-generator/overlays/watchers.yaml | 104 +++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 tools/api-generator/overlays/watchers.yaml diff --git a/tools/api-generator/overlays/watchers.yaml b/tools/api-generator/overlays/watchers.yaml new file mode 100644 index 0000000000..b785ee995a --- /dev/null +++ b/tools/api-generator/overlays/watchers.yaml @@ -0,0 +1,104 @@ +overlay: 1.0.0 +info: + title: Add watchers + version: 1.0.0 +actions: + - target: $.paths['/api/atlas/v2/groups/{groupId}/clusters'].post + update: + x-xgen-atlascli: + watcher: + get: + version: 2024-10-23 + operation-id: getCluster + params: + clusterName: body:$.name + groupId: body:$.groupId + expect: + match: + path: $.stateName + values: + - IDLE + - target: $.paths['/api/atlas/v2/groups/{groupId}/clusters/{clusterName}'].delete + update: + x-xgen-atlascli: + watcher: + get: + version: 2024-10-23 + operation-id: getCluster + params: + clusterName: input:clusterName + groupId: input:groupId + expect: + http-code: 404 + - target: $.paths['/api/atlas/v2/groups/{groupId}/clusters/{clusterName}'].patch + update: + x-xgen-atlascli: + watcher: + get: + version: 2024-10-23 + operation-id: getCluster + params: + clusterName: input:clusterName + groupId: input:groupId + expect: + match: + path: $.stateName + values: + - IDLE + - target: $.paths['/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment']['post','patch'] + update: + x-xgen-atlascli: + watcher: + get: + version: 2024-05-30 + operation-id: getAtlasSearchDeployment + params: + clusterName: input:clusterName + groupId: input:groupId + expect: + match: + path: $.stateName + values: + - IDLE + - target: $.paths['/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/search/deployment'].delete + update: + x-xgen-atlascli: + watcher: + get: + version: 2024-05-30 + operation-id: getAtlasSearchDeployment + params: + clusterName: input:clusterName + groupId: input:groupId + expect: + http-code: 404 + - target: $.paths['/api/atlas/v2/groups/{groupId}/backupCompliancePolicy']['put','delete'] + update: + x-xgen-atlascli: + watcher: + get: + version: 2023-10-01 + operation-id: getDataProtectionSettings + params: + groupId: input:groupId + expect: + match: + path: $.state + values: + - ACTIVE + - target: $.paths['/api/atlas/v2/groups/{groupId}/userSecurity/ldap/verify'].post + update: + x-xgen-atlascli: + watcher: + get: + version: 2023-01-01 + operation-id: getLdapConfigurationStatus + params: + groupId: input:groupId + requestId: body:$.requestId + expect: + match: + path: $.status + values: + - FAILED + - SUCCESS From 36b9a546914721b85b6db6ce14d10555d87f160e Mon Sep 17 00:00:00 2001 From: Filipe C Menezes Date: Wed, 12 Feb 2025 12:03:10 +0000 Subject: [PATCH 2/5] drive-by --- .github/workflows/autoupdate-spec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/autoupdate-spec.yaml b/.github/workflows/autoupdate-spec.yaml index 011ce372bf..18e93e0196 100644 --- a/.github/workflows/autoupdate-spec.yaml +++ b/.github/workflows/autoupdate-spec.yaml @@ -4,7 +4,7 @@ on: - cron: 30 8 * * TUE workflow_dispatch: jobs: - update-sdk: + update-api: runs-on: ubuntu-latest steps: - uses: GitHubSecurityLab/actions-permissions/monitor@v1 From 728caa2d90c957497642ea5f40f8a0dc4c04daa4 Mon Sep 17 00:00:00 2001 From: Filipe C Menezes Date: Wed, 12 Feb 2025 14:00:09 +0000 Subject: [PATCH 3/5] add more watchers --- tools/api-generator/overlays/watchers.yaml | 249 ++++++++++++++++++++- 1 file changed, 242 insertions(+), 7 deletions(-) diff --git a/tools/api-generator/overlays/watchers.yaml b/tools/api-generator/overlays/watchers.yaml index b785ee995a..95ada6dae8 100644 --- a/tools/api-generator/overlays/watchers.yaml +++ b/tools/api-generator/overlays/watchers.yaml @@ -8,7 +8,7 @@ actions: x-xgen-atlascli: watcher: get: - version: 2024-10-23 + version: "2024-10-23" operation-id: getCluster params: clusterName: body:$.name @@ -23,7 +23,7 @@ actions: x-xgen-atlascli: watcher: get: - version: 2024-10-23 + version: "2024-10-23" operation-id: getCluster params: clusterName: input:clusterName @@ -35,7 +35,7 @@ actions: x-xgen-atlascli: watcher: get: - version: 2024-10-23 + version: "2024-10-23" operation-id: getCluster params: clusterName: input:clusterName @@ -50,7 +50,7 @@ actions: x-xgen-atlascli: watcher: get: - version: 2024-05-30 + version: "2024-05-30" operation-id: getAtlasSearchDeployment params: clusterName: input:clusterName @@ -65,7 +65,7 @@ actions: x-xgen-atlascli: watcher: get: - version: 2024-05-30 + version: "2024-05-30" operation-id: getAtlasSearchDeployment params: clusterName: input:clusterName @@ -77,7 +77,7 @@ actions: x-xgen-atlascli: watcher: get: - version: 2023-10-01 + version: "2023-10-01" operation-id: getDataProtectionSettings params: groupId: input:groupId @@ -91,7 +91,7 @@ actions: x-xgen-atlascli: watcher: get: - version: 2023-01-01 + version: "2023-01-01" operation-id: getLdapConfigurationStatus params: groupId: input:groupId @@ -102,3 +102,238 @@ actions: values: - FAILED - SUCCESS + - target: $.paths['/api/atlas/v2/groups/{groupId}/serverless'].post + update: + x-xgen-atlascli: + watcher: + get: + version: "2023-01-01" + operation-id: getFlexCluster + params: + groupId: input:groupId + name: body:$.name + expect: + match: + path: $.status + values: + - IDLE + - target: $.paths['/api/atlas/v2/groups/{groupId}/serverless/{name}'].patch + update: + x-xgen-atlascli: + watcher: + get: + version: "2023-01-01" + operation-id: getFlexCluster + params: + groupId: input:groupId + name: input:name + expect: + match: + path: $.status + values: + - IDLE + - target: $.paths['/api/atlas/v2/groups/{groupId}/serverless/{name}'].delete + update: + x-xgen-atlascli: + watcher: + get: + version: "2023-01-01" + operation-id: getFlexCluster + params: + groupId: input:groupId + name: input:name + expect: + http-code: 404 + - target: $.paths['/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots'].post + update: + x-xgen-atlascli: + watcher: + get: + version: "2023-01-01" + operation-id: getReplicaSetBackup + params: + groupId: input:groupId + clusterName: input:clusterName + snapshotId: body:$.id + expect: + match: + path: $.status + values: + - completed + - failed + - target: $.paths['/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots/{snapshotId}'].patch + update: + x-xgen-atlascli: + watcher: + get: + version: "2023-01-01" + operation-id: getReplicaSetBackup + params: + groupId: input:groupId + clusterName: input:clusterName + snapshotId: input:snapshotId + expect: + match: + path: $.status + values: + - completed + - failed + - target: $.paths['/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/snapshots/{snapshotId}'].delete + update: + x-xgen-atlascli: + watcher: + get: + version: "2023-01-01" + operation-id: getReplicaSetBackup + params: + groupId: input:groupId + clusterName: input:clusterName + snapshotId: input:snapshotId + expect: + http-code: 404 + - target: $.paths['/api/atlas/v2/groups/{groupId}/flexClusters'].post + update: + x-xgen-atlascli: + watcher: + get: + version: "2024-11-13" + operation-id: getFlexCluster + params: + name: body:$.name + groupId: body:$.groupId + expect: + match: + path: $.stateName + values: + - IDLE + - target: $.paths['/api/atlas/v2/groups/{groupId}/flexClusters'].post + update: + x-xgen-atlascli: + watcher: + get: + version: "2024-11-13" + operation-id: getFlexCluster + params: + name: body:$.name + groupId: input:groupId + expect: + match: + path: $.stateName + values: + - IDLE + - target: $.paths['/api/atlas/v2/groups/{groupId}/flexClusters/{name}'].patch + update: + x-xgen-atlascli: + watcher: + get: + version: "2024-11-13" + operation-id: getFlexCluster + params: + name: input:name + groupId: input:groupId + expect: + match: + path: $.stateName + values: + - IDLE + - target: $.paths['/api/atlas/v2/groups/{groupId}/flexClusters/{name}'].delete + update: + x-xgen-atlascli: + watcher: + get: + version: "2024-11-13" + operation-id: getFlexCluster + params: + name: input:name + groupId: input:groupId + expect: + http-code: 404 + - target: $.paths['/api/atlas/v2/groups/{groupId}/flexClusters/{name}/backup/restoreJobs'].post + update: + x-xgen-atlascli: + watcher: + get: + version: "2024-11-13" + operation-id: getFlexBackupRestoreJob + params: + name: input:name + groupId: input:groupId + restoreJobId: body:$.id + expect: + match: + path: $.status + values: + - COMPLETED + - FAILED + - target: $.paths['/api/atlas/v2/groups/{groupId}/privateEndpoint/endpointService'].post + update: + x-xgen-atlascli: + watcher: + get: + version: "2023-01-01" + operation-id: getPrivateEndpointService + params: + cloudProvider: body:$.cloudProvider + groupId: input:groupId + endpointServiceId: body:$.id + expect: + match: + path: $.status + values: + - WAITING_FOR_USER + - FAILED + - target: $.paths['/api/atlas/v2/groups/{groupId}/privateEndpoint/{cloudProvider}/endpointService/{endpointServiceId}'].delete + update: + x-xgen-atlascli: + watcher: + get: + version: "2023-01-01" + operation-id: getPrivateEndpointService + params: + cloudProvider: body:$.cloudProvider + groupId: input:groupId + endpointServiceId: body:$.id + expect: + http-code: 404 + - target: $.paths['/api/atlas/v2/groups/{groupId}/pipelines'].post + update: + x-xgen-atlascli: + watcher: + get: + version: "2023-01-01" + operation-id: getPipeline + params: + groupId: input:groupId + pipelineName: body:$.name + expect: + match: + path: $.state + values: + - ACTIVE + - target: $.paths['/api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}'].patch + update: + x-xgen-atlascli: + watcher: + get: + version: "2023-01-01" + operation-id: getPipeline + params: + groupId: input:groupId + pipelineName: input:pipelineName + expect: + match: + path: $.state + values: + - ACTIVE + - target: $.paths['/api/atlas/v2/groups/{groupId}/pipelines/{pipelineName}'].delete + update: + x-xgen-atlascli: + watcher: + get: + version: "2023-01-01" + operation-id: getPipeline + params: + groupId: input:groupId + pipelineName: input:pipelineName + expect: + http-code: 404 From 366ffc8f78e96fcb405be58284ee12892865c70a Mon Sep 17 00:00:00 2001 From: Filipe C Menezes Date: Wed, 12 Feb 2025 18:35:02 +0000 Subject: [PATCH 4/5] add more watchers --- tools/api-generator/overlays/watchers.yaml | 87 ++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/tools/api-generator/overlays/watchers.yaml b/tools/api-generator/overlays/watchers.yaml index 95ada6dae8..709892dc8f 100644 --- a/tools/api-generator/overlays/watchers.yaml +++ b/tools/api-generator/overlays/watchers.yaml @@ -337,3 +337,90 @@ actions: pipelineName: input:pipelineName expect: http-code: 404 + - target: $.paths['/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/backup/exports'].post + update: + x-xgen-atlascli: + watcher: + get: + version: "2023-01-01" + operation-id: getBackupExportJob + params: + groupId: input:groupId + clusterName: input:clusterName + exportId: body:$.id + expect: + match: + path: $.state + values: + - Successful + - Failed + - Cancelled + - target: $.paths['/api/atlas/v2/groups/{groupId}/sampleDatasetLoad/{name}'].post + update: + x-xgen-atlascli: + watcher: + get: + version: "2023-01-01" + operation-id: getSampleDatasetLoadStatus + params: + groupId: input:groupId + sampleDatasetId: body:$.id + expect: + match: + path: $.state + values: + - COMPLETED + - FAILED + - target: $.paths['/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/onlineArchives'].post + update: + x-xgen-atlascli: + watcher: + get: + version: "2023-01-01" + operation-id: getOnlineArchive + params: + groupId: input:groupId + clusterName: input:clusterName + archiveId: body:$.id + expect: + match: + path: $.state + values: + - IDLE + - PAUSED + - ORPHANED + - DELETED + - ACTIVE + - target: $.paths['/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/onlineArchives/{archiveId}'].patch + update: + x-xgen-atlascli: + watcher: + get: + version: "2023-01-01" + operation-id: getOnlineArchive + params: + groupId: input:groupId + clusterName: input:clusterName + archiveId: input:archiveId + expect: + match: + path: $.state + values: + - IDLE + - PAUSED + - ORPHANED + - DELETED + - ACTIVE + - target: $.paths['/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/onlineArchives/{archiveId}'].delete + update: + x-xgen-atlascli: + watcher: + get: + version: "2023-01-01" + operation-id: getOnlineArchive + params: + groupId: input:groupId + clusterName: input:clusterName + archiveId: input:archiveId + expect: + http-code: 404 From a869ffa25de954fcaa2d6be616790183602d5aa3 Mon Sep 17 00:00:00 2001 From: Filipe C Menezes Date: Wed, 12 Feb 2025 18:46:19 +0000 Subject: [PATCH 5/5] add more watchers --- tools/api-generator/overlays/watchers.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tools/api-generator/overlays/watchers.yaml b/tools/api-generator/overlays/watchers.yaml index 709892dc8f..0303de89c3 100644 --- a/tools/api-generator/overlays/watchers.yaml +++ b/tools/api-generator/overlays/watchers.yaml @@ -424,3 +424,20 @@ actions: archiveId: input:archiveId expect: http-code: 404 + - target: $.paths['/api/atlas/v2/groups/{groupId}/serverless/{clusterName}/backup/snapshots'].post + update: + x-xgen-atlascli: + watcher: + get: + version: "2023-01-01" + operation-id: getServerlessBackup + params: + groupId: input:groupId + clusterName: input:clusterName + snapshotId: body:$.id + expect: + match: + path: $.status + values: + - completed + - failed