---
updatedAt: 2025-07-02T08:17:11.000Z
agentTools:
  projectIndex: https://docs.vitro.io/llms.txt
---

# List datacenters by city

Returns a list of owned datacenters filtered by city name.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Astra HTTP API",
    "description": "API Specification for the ASTRA backend, which will expose datacenters and battery information for the UI application to construct dashboards. ",
    "contact": {
      "email": "rafal@kult.io"
    },
    "version": "1.0-BETA"
  },
  "servers": [
    {
      "url": "https://api.dev.vitro.link/api/",
      "description": "Development"
    }
  ],
  "tags": [
    {
      "name": "Standard"
    }
  ],
  "paths": {
    "/datacenter/findByCity": {
      "get": {
        "summary": "List datacenters by city",
        "description": "Returns a list of owned datacenters filtered by city name.",
        "operationId": "getDatacenterByCityName",
        "tags": [
          "Standard"
        ],
        "parameters": [
          {
            "name": "cityName",
            "in": "query",
            "description": "Name of a city to fetch datacenters by",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArrayOfDataCenters"
                }
              }
            }
          },
          "404": {
            "description": "City not found"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "DataCenter": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "example": 100000
          },
          "name": {
            "type": "string",
            "example": "DataCenterABC"
          },
          "companyId": {
            "type": "integer",
            "format": "int64",
            "example": 10
          },
          "countryCode": {
            "type": "string",
            "example": "US"
          },
          "cityName": {
            "type": "string",
            "example": "New York"
          },
          "groupName": {
            "type": "string",
            "example": "Manhattan"
          },
          "location": {
            "type": "string",
            "example": "37.926868, -78.024902"
          },
          "numberOfOffline": {
            "type": "integer",
            "example": 25,
            "format": "int64"
          },
          "numberOfAlerts": {
            "type": "integer",
            "example": 25,
            "format": "int64"
          },
          "numberOfWarnings": {
            "type": "integer",
            "example": 25,
            "format": "int64"
          },
          "numberOfStable": {
            "type": "integer",
            "example": 25,
            "format": "int64"
          }
        }
      },
      "ArrayOfDataCenters": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/DataCenter"
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ]
}
```