├── .DS_Store ├── Atlas.postman_environment.json ├── MongoDB Atlas.postman_collection.json ├── README.md └── img ├── .DS_Store ├── 1-folder-structure.png ├── 2-documentation.png ├── 2.1-ProjectID.png ├── 3-Authentication.png ├── 4-folder-structure.png ├── 5-variables.png ├── 6-environment-variables.png ├── 7-api-call-list--clusters.png ├── 8-code-snippet-1.png └── 9-code-snippet-python.png /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cassianobein/mongodb-atlas-api-resources/4f66f3feac1cb890b184ec5facea9d266a9b377a/.DS_Store -------------------------------------------------------------------------------- /Atlas.postman_environment.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "eac76580-ecd2-46e1-a79d-b41e283e3bcf", 3 | "name": "Atlas", 4 | "values": [ 5 | { 6 | "key": "base_url", 7 | "value": "https://cloud.mongodb.com", 8 | "enabled": true 9 | }, 10 | { 11 | "key": "version", 12 | "value": "v1.0", 13 | "enabled": true 14 | }, 15 | { 16 | "key": "ProjectID", 17 | "value": "", 18 | "enabled": true 19 | }, 20 | { 21 | "key": "CLUSTER-NAME", 22 | "value": "", 23 | "enabled": true 24 | }, 25 | { 26 | "key": "databaseName", 27 | "value": "", 28 | "enabled": true 29 | }, 30 | { 31 | "key": "dbUser", 32 | "value": "", 33 | "enabled": true 34 | }, 35 | { 36 | "key": "ORG-ID", 37 | "value": "", 38 | "enabled": true 39 | }, 40 | { 41 | "key": "API-key-pwd", 42 | "value": "", 43 | "enabled": true 44 | }, 45 | { 46 | "key": "API-key-usr", 47 | "value": "", 48 | "enabled": true 49 | }, 50 | { 51 | "key": "INVITATION_ID", 52 | "value": "", 53 | "enabled": true 54 | }, 55 | { 56 | "key": "INVOICE-ID", 57 | "value": "", 58 | "enabled": true 59 | }, 60 | { 61 | "key": "PROJECT_NAME", 62 | "value": "", 63 | "enabled": true 64 | }, 65 | { 66 | "key": "TEAM-ID", 67 | "value": "", 68 | "enabled": true 69 | }, 70 | { 71 | "key": "USER-ID", 72 | "value": "", 73 | "enabled": true 74 | }, 75 | { 76 | "key": "PROJ-INVITATIO-ID", 77 | "value": "", 78 | "enabled": true 79 | }, 80 | { 81 | "key": "TEAM-NAME", 82 | "value": "", 83 | "enabled": true 84 | }, 85 | { 86 | "key": "SAMPLE-DATASET-ID", 87 | "value": "", 88 | "enabled": true 89 | }, 90 | { 91 | "key": "CLOUD-PROVIDER", 92 | "value": "", 93 | "enabled": true 94 | }, 95 | { 96 | "key": "CLUSTER-TIER", 97 | "value": "", 98 | "enabled": true 99 | }, 100 | { 101 | "key": "INSTANCE-NAME", 102 | "value": "", 103 | "enabled": true 104 | }, 105 | { 106 | "key": "ALERT-ID", 107 | "value": "", 108 | "enabled": true 109 | }, 110 | { 111 | "key": "ALERT-CONFIG-ID", 112 | "value": "", 113 | "enabled": true 114 | }, 115 | { 116 | "key": "DATABASE-NAME", 117 | "value": "", 118 | "enabled": true 119 | }, 120 | { 121 | "key": "COLLECTION-NAME", 122 | "value": "", 123 | "enabled": true 124 | }, 125 | { 126 | "key": "INDEX-ID", 127 | "value": "", 128 | "enabled": true 129 | }, 130 | { 131 | "key": "SNAPSHOT-ID", 132 | "value": "", 133 | "enabled": true 134 | }, 135 | { 136 | "key": "JOB-ID", 137 | "value": "", 138 | "enabled": true 139 | }, 140 | { 141 | "key": "RESTORE-JOB-ID", 142 | "value": "", 143 | "enabled": true 144 | }, 145 | { 146 | "key": "restoreJobId", 147 | "value": "", 148 | "enabled": true 149 | }, 150 | { 151 | "key": "TARGET-CLUSTER-NAME", 152 | "value": "", 153 | "enabled": true 154 | }, 155 | { 156 | "key": "TARGET-GROUP-ID", 157 | "value": "", 158 | "enabled": true 159 | }, 160 | { 161 | "key": "targetGroupId", 162 | "value": "", 163 | "enabled": true 164 | }, 165 | { 166 | "key": "clusterName", 167 | "value": "", 168 | "enabled": true 169 | }, 170 | { 171 | "key": "RESTORE-ID", 172 | "value": "", 173 | "enabled": true 174 | }, 175 | { 176 | "key": "ARCHIVE-ID", 177 | "value": "", 178 | "enabled": true 179 | }, 180 | { 181 | "key": "CONTAINER-ID", 182 | "value": "", 183 | "enabled": true 184 | }, 185 | { 186 | "key": "PEER-ID", 187 | "value": "", 188 | "enabled": true 189 | }, 190 | { 191 | "key": "ENDPOINT-SERVICE-ID", 192 | "value": "", 193 | "enabled": true 194 | }, 195 | { 196 | "key": "ENDPOINT-ID", 197 | "value": "", 198 | "enabled": true 199 | }, 200 | { 201 | "key": "API-KEY-ID", 202 | "value": "", 203 | "enabled": true 204 | }, 205 | { 206 | "key": "ACCESS-LIST-ENTRY", 207 | "value": "", 208 | "enabled": true 209 | }, 210 | { 211 | "key": "IP-ADDRESS", 212 | "value": "", 213 | "enabled": true 214 | }, 215 | { 216 | "key": "PROCESS-HOST", 217 | "value": "", 218 | "enabled": true 219 | }, 220 | { 221 | "key": "PROCESS-PORT", 222 | "value": "", 223 | "enabled": true 224 | }, 225 | { 226 | "key": "DISK-NAME", 227 | "value": "", 228 | "enabled": true 229 | }, 230 | { 231 | "key": "HOSTNAME", 232 | "value": "", 233 | "enabled": true 234 | }, 235 | { 236 | "key": "LOG-NAME", 237 | "value": "", 238 | "enabled": true 239 | }, 240 | { 241 | "key": "USER-NAME", 242 | "value": "", 243 | "enabled": true 244 | }, 245 | { 246 | "key": "ROLE-ID", 247 | "value": "", 248 | "enabled": true 249 | }, 250 | { 251 | "key": "EVENT-ID", 252 | "value": "", 253 | "enabled": true 254 | }, 255 | { 256 | "key": "DATA-LAKE-NAME", 257 | "value": "", 258 | "enabled": true 259 | }, 260 | { 261 | "key": "VALIDATION-ID", 262 | "value": "", 263 | "enabled": true 264 | }, 265 | { 266 | "key": "LIVE-MIGRATION-ID", 267 | "value": "", 268 | "enabled": true 269 | }, 270 | { 271 | "key": "ROLE-NAME", 272 | "value": "", 273 | "enabled": true 274 | } 275 | ], 276 | "_postman_variable_scope": "environment", 277 | "_postman_exported_at": "2021-09-08T14:57:59.868Z", 278 | "_postman_exported_using": "Postman/8.12.1" 279 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # mongodb-atlas-api-resources 2 | This repo contains a Postman project containing a full set of APIs calls to all resources provided by MongoDB Atlas. 3 | 4 | 5 | * [MongoDB Atlas API Resources Documentation](https://docs.atlas.mongodb.com/reference/api-resources/) - here you will find the most updated documentation of the the APIs resources. 6 | 7 | --- 8 | ## Description 9 | 10 | This is a repo with a Postman collection containing all avaiable API calls (as of August 2021) to help you understand and build automation/integration with MongoDB Atlas. 11 | 12 | --- 13 | ## Setup 14 | __1. Configure Laptop__ 15 | * [Download](https://www.postman.com/downloads/) and install Postman on your laptop 16 | * [Training](https://learning.postman.com/) on Postman is available and it has been chosen by its popularity 17 | 18 | 19 | 20 | __2. Configure MongoDB Atlas__ 21 | 22 | * Create a free [MongoDB Atlas account](https://account.mongodb.com/account/register) to have access to a free cluster to play around in. Make sure you create an organization and a project. Don't skip that step. Here is a coupon code **GOATLAS10** for some credits to explore more features (valid as of August 2021). Watch this [video] (https://www.youtube.com/watch?v=FxeQ5eck3tw) to learn how to add these credits to your account. 23 | * Create a dedicated [database deployment](https://docs.atlas.mongodb.com/create-database-deployment/#create-a-new-database-deployment) (cluster). Use a M10 tier or higher to have full access to all of the APIs resources*. Feel free to explore all of the other options, but the default options should be fine for this example. 24 | * Create an [API key](https://docs.atlas.mongodb.com/configure-api-access/) with Organization Owner privileges and save the public/private key to use when calling APIs. Also, don't forget to add your laptop/workstation IP to the API access list. 25 | * Navigate to your Project Settings and retrieve your Project ID so it can be used in one of our examples below. 26 | 27 | ![PROJ](img/2.1-ProjectID.png "PROJ") 28 | 29 | 30 | __3. Configure and use Postman__ 31 | * [Import](https://learning.postman.com/docs/getting-started/importing-and-exporting-data/#importing-data-into-postman) the MongoDB-Atlas.postman_collection.json collection and Atlas.postman_environment.json environment variables found in this repo into your Postman workspace. 32 | * Click on the MongoDB Atlas Collection. Under the Authorization tab, choose the Digest Auth Type and use the public key as the user and the private key as your password. 33 | 34 | ![AUTH](img/3-Authentication.png "AUTH") 35 | 36 | * Open up the **Get All Clusters** API call under the cluster folder. 37 | 38 | ![FOLDER](img/4-folder-structure.png "FOLDER") 39 | 40 | * Make sure you select the Atlas environment variables and [update the Postman variable](https://learning.postman.com/docs/sending-requests/variables/) ProjectID value to your Project ID captured in the previous steps. 41 | ![VARIABLES](img/5-variables.png "VARIABLES") 42 | ![ENV](img/6-environment-variables.png "ENV") 43 | 44 | * Execute the API call by hitting the Send button and you should get a response containing a list of all your clusters (database deployments) alongside the cluster details, like whether backup is enabled or the cluster is running. 45 | 46 | ![API](img/7-api-call-list--clusters "API") 47 | 48 | Now explore all the APIs available to create your own automation. 49 | 50 | 51 | ## Tips 52 | 53 | Once you have imported this collection you will notice that we have a folder sturcture following the order showed in the [MongoDB Atlas API Resources Documentation](https://docs.atlas.mongodb.com/reference/api-resources/). Inside the folders you will find all the APIs calls to that specific resource. Each call will have a sample request, but for more options on the same API call check the documentation. You can find the direct link to the documentation on the documentation section in Postman. 54 | 55 | 56 | *Folder structure* 57 | 58 | ![FOLDER](img/1-folder-structure.png "FOLDER") 59 | 60 | 61 | *Documentation link on the documentation section of Postman* 62 | ![DOCUMENTATION](img/2-documentation.png "DOCUMENTATION") 63 | 64 | 65 | 66 | One last tip: Once you have tested all your API calls to build your automation, Postman allows you to export that in code snippets in your favorite programming language. 67 | 68 | 69 | ![CODE1](img/8-code-snippet-1.png "CODE1") 70 | ![CODE2](img/9-code-snippet-python.png "CODE2") 71 | 72 | 73 | Please always refer to the [online documentation](https://docs.atlas.mongodb.com/reference/api-resources/) for any changes or new resources. Also, feel free to make pull requests to update the project with new API resources, fixes, and enhancements. 74 | 75 | -------------------------------------------------------------------------------- /img/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cassianobein/mongodb-atlas-api-resources/4f66f3feac1cb890b184ec5facea9d266a9b377a/img/.DS_Store -------------------------------------------------------------------------------- /img/1-folder-structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cassianobein/mongodb-atlas-api-resources/4f66f3feac1cb890b184ec5facea9d266a9b377a/img/1-folder-structure.png -------------------------------------------------------------------------------- /img/2-documentation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cassianobein/mongodb-atlas-api-resources/4f66f3feac1cb890b184ec5facea9d266a9b377a/img/2-documentation.png -------------------------------------------------------------------------------- /img/2.1-ProjectID.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cassianobein/mongodb-atlas-api-resources/4f66f3feac1cb890b184ec5facea9d266a9b377a/img/2.1-ProjectID.png -------------------------------------------------------------------------------- /img/3-Authentication.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cassianobein/mongodb-atlas-api-resources/4f66f3feac1cb890b184ec5facea9d266a9b377a/img/3-Authentication.png -------------------------------------------------------------------------------- /img/4-folder-structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cassianobein/mongodb-atlas-api-resources/4f66f3feac1cb890b184ec5facea9d266a9b377a/img/4-folder-structure.png -------------------------------------------------------------------------------- /img/5-variables.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cassianobein/mongodb-atlas-api-resources/4f66f3feac1cb890b184ec5facea9d266a9b377a/img/5-variables.png -------------------------------------------------------------------------------- /img/6-environment-variables.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cassianobein/mongodb-atlas-api-resources/4f66f3feac1cb890b184ec5facea9d266a9b377a/img/6-environment-variables.png -------------------------------------------------------------------------------- /img/7-api-call-list--clusters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cassianobein/mongodb-atlas-api-resources/4f66f3feac1cb890b184ec5facea9d266a9b377a/img/7-api-call-list--clusters.png -------------------------------------------------------------------------------- /img/8-code-snippet-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cassianobein/mongodb-atlas-api-resources/4f66f3feac1cb890b184ec5facea9d266a9b377a/img/8-code-snippet-1.png -------------------------------------------------------------------------------- /img/9-code-snippet-python.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cassianobein/mongodb-atlas-api-resources/4f66f3feac1cb890b184ec5facea9d266a9b377a/img/9-code-snippet-python.png --------------------------------------------------------------------------------