mgmonteleone / python-atlasapi

python package for MongoDB Atlas Cloud provider
Apache License 2.0
21 stars 22 forks source link

FEDERATED_DATABASE_UPDATED not found in AtlasEventTypes enum #116

Closed jpinsolle-bc closed 1 year ago

jpinsolle-bc commented 2 years ago

Hello,

Is-it normal that FEDERATED_DATABASE_UPDATED doesn't exist in AtlasEventTypes enum?

I tried to retrieve events related to my project with the following method:

atlas.Events.since(min_date)

and I got this error KeyError: 'FEDERATED_DATABASE_UPDATED'.

In the list returned by the Atlas API I noticed an item with eventTypeName without matching in AtlasEventTypes enum:

{
    "apiKeyId": "XXX",
    "created": "2022-06-30T07:15:36Z",
    "eventTypeName": "FEDERATED_DATABASE_UPDATED",
    "groupId": "XXX",
    "id": "XXX",
    "isGlobalAdmin": false,
    "links": [{
        "href": "https://cloud.mongodb.com/api/atlas/v1.0/groups/XXX/events/XXX",
        "rel": "self"
    }],
    "publicKey": "XXX",
    "raw": {
        "_t": "NDS_AUDIT",
        "alertConfigId": null,
        "auditDescription": null,
        "auditLogDiff": null,
        "cid": "XXX",
        "cloudProvider": null,
        "cloudProviderAccessDiff": null,
        "clusterDescriptionDiff": null,
        "clusterName": null,
        "clusterUniqueId": null,
        "cre": "2022-06-30T07:15:36Z",
        "customDbRoleName": null,
        "dataLakeTenantId": null,
        "dbUserUsername": null,
        "description": "Federated Database Instance updated",
        "detailedLastError": null,
        "encryptionAtRestDiff": null,
        "et": "FEDERATED_DATABASE_UPDATED",
        "failureCode": null,
        "genericNDSItemDiff": null,
        "gn": null,
        "hidden": false,
        "hostMetadata": null,
        "hostname": null,
        "id": "XXX",
        "ingestionPipelineDiff": null,
        "ingestionPipelineName": null,
        "isMmsAdmin": false,
        "lastError": null,
        "limitName": null,
        "limitValue": null,
        "namespace": null,
        "networkPermissionListEntry": null,
        "notBefore": null,
        "operationalLimitMaxValue": null,
        "operationalLimitMinValue": null,
        "operationalLimitName": null,
        "orgId": null,
        "orgName": null,
        "osTunedFileOverridesDiff": null,
        "planId": null,
        "privateNetworkEndpointEntry": null,
        "processArgsDiff": null,
        "processType": null,
        "queryEngineTenantDiff": {
            "diffs": [{
                "id": "Federated Database Data Process Region",
                "name": null,
                "params": [{
                    "display": "Data Process Cloud Provider",
                    "new": "AWS",
                    "old": null,
                    "param": "cloudProvider"
                }, {
                    "display": "Data Process Region",
                    "new": "EU_WEST_1",
                    "old": null,
                    "param": "region"
                }],
                "status": "MODIFIED",
                "type": "NDS_FEDERATED_DATABASE_INSTANCE_DATA_PROCESS_REGION"
            }]
        },
        "queryEngineTenantName": "XXX",
        "realmAppId": null,
        "reason": null,
        "remoteAddr": "X.Y.Z.A",
        "severity": "WARNING",
        "source": "PUBLIC_API",
        "tenantClusterUniqueId": null,
        "typeScheduledEvent": null,
        "un": "iqpshcbr",
        "userApiKeyType": null,
        "userId": "XXX",
        "userSecurityDiff": null,
        "ut": "API",
        "vercelEnvVarName": null
    },
    "remoteAddress": "X.Y.Z.A"
}
jpinsolle-bc commented 1 year ago

Hello, any news ?

jpinsolle-bc commented 1 year ago

I created this PR to add missing federated database events https://github.com/mgmonteleone/python-atlasapi/pull/120

mgmonteleone commented 1 year ago

Thanks for your patience, @jpinsolle-betclic .

I merged your PR, as well as pulling all new events.

This has been released in 2.0.2.