Chilkat Online Tools

Classic ASP / MongoDB Atlas / Get Network Peering Containers in One Project by Cloud Provider

Back to Collection Items

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
' This example assumes the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.

set http = Server.CreateObject("Chilkat_9_5_0.Http")

http.DigestAuth = 1
http.Login = "username"
http.Password = "password"

set queryParams = Server.CreateObject("Chilkat_9_5_0.JsonObject")
success = queryParams.UpdateString("providerName","AWS")

' resp is a Chilkat_9_5_0.HttpResponse
Set resp = http.QuickRequestParams("GET","https://domain.com/api/atlas/{{version}}/groups/{{ProjectID}}/containers",queryParams)
If (http.LastMethodSuccess = 0) Then
    Response.Write "<pre>" & Server.HTMLEncode( http.LastErrorText) & "</pre>"
    Response.End
End If

Response.Write "<pre>" & Server.HTMLEncode( resp.StatusCode) & "</pre>"
Response.Write "<pre>" & Server.HTMLEncode( resp.BodyStr) & "</pre>"


%>
</body>
</html>

Curl Command

curl -G -d "providerName=AWS"
	--digest -u 'username:password'
https://domain.com/api/atlas/{{version}}/groups/{{ProjectID}}/containers

Postman Collection Item JSON

{
  "name": "Get Network Peering Containers in One Project by Cloud Provider",
  "request": {
    "method": "GET",
    "header": [
    ],
    "url": {
      "raw": "{{base_url}}/api/atlas/{{version}}/groups/{{ProjectID}}/containers?providerName=AWS",
      "host": [
        "{{base_url}}"
      ],
      "path": [
        "api",
        "atlas",
        "{{version}}",
        "groups",
        "{{ProjectID}}",
        "containers"
      ],
      "query": [
        {
          "key": "providerName",
          "value": "AWS"
        }
      ]
    },
    "description": "https://docs.atlas.mongodb.com/reference/api/vpc-get-containers-list/"
  },
  "response": [
  ]
}