{
  "swagger" : "2.0",
  "host" : "api.equinix.com",
  "info" : {
    "title" : "Smart View Environmental API",
    "description" : "Empower yourself with Environmental APIs. The API makes it possible to fetch current environmental data including humidity and temperature for a single sensor (identified by IBX code and sensor ID) or for all the sensors within an IBX (identified by IBX code) in a paginated way. When fetching all sensor readings you can apply additional sort criteria.",
    "version" : "2.0",
    "termsOfService" : "https://www.equinix.com/about/legal/terms",
    "contact" : {
      "name" : "Equinix API Support",
      "url" : "https://docs.equinix.com/api-support.htm"
    }
  },
  "produces" : [ "application/json" ],
  "consumes" : [ "application/json" ],
  "schemes" : [ "https" ],
  "paths" : {
    "/smartview/v2/environmental/ibxs/{ibx}/sensors/readings" : {
      "get" : {
        "tags": [
          "Smart View Environmental"
        ],
        "summary" : "IBX sensors current readings",
        "description" : "Returns current environmental (temperature and humidity) sensor readings for the given IBX code in a paginated way.",
        "parameters" : [ {
          "name" : "ibx",
          "in" : "path",
          "type" : "string",
          "description" : "IBX where the sensor is located.",
          "required" : true,
          "x-example" : "CH2"
        }, {
          "name" : "type",
          "in" : "query",
          "type" : "string",
          "description" : "Type of sensor data to display, e.g. specifying 'HUMIDITY' means only sensor readings with HUMIDITY value will be included",
          "required" : false,
          "x-example" : "HUMIDITY"
        }, {
          "name" : "zone",
          "in" : "query",
          "type" : "string",
          "description" : "Zone name. Adding this parameter limits the query to sensors in the specified zone",
          "required" : false,
          "x-example" : "CH2:1:06:ColoArea:1"
        }, {
          "name" : "offset",
          "in" : "query",
          "type" : "integer",
          "description" : "Results offset you want to retrieve (0..N)",
          "required" : false,
          "default" : 0
        }, {
          "name" : "limit",
          "in" : "query",
          "type" : "integer",
          "description" : "Number of records to retrieve per request.",
          "required" : false,
          "default" : 20
        }, {
          "$ref" : "#/parameters/authorizationHeader"
        } ],
        "produces" : [ "application/json" ],
        "operationId" : "getSensorReadings",
        "responses" : {
          "200" : {
            "description" : "OK",
            "schema" : {
              "$ref" : "#/definitions/SensorReadingsResponse"
            }
          },
          "400" : {
            "description" : "Bad request"
          },
          "401" : {
            "description" : "Unauthorized"
          },
          "403" : {
            "description" : "Forbidden"
          },
          "422" : {
            "description" : "Unprocessable entity"
          }
        }
      }
    },
    "/smartview/v2/environmental/ibxs/{ibx}/sensors/{sensorId}/readings" : {
      "get" : {
        "tags": [
          "Smart View Environmental"
        ],
        "summary" : "Single sensor current value(s)",
        "description" : "Returns current environmental sensor readings such as temperature and humidity for the given sensor ID and IBX code.",
        "parameters" : [ {
          "name" : "ibx",
          "in" : "path",
          "type" : "string",
          "description" : "IBX where the sensor is located.",
          "required" : true,
          "x-example" : "SV2"
        }, {
          "name" : "sensorId",
          "in" : "path",
          "type" : "string",
          "description" : "Id of sensor to read.",
          "required" : true,
          "x-example" : "CH2.Environmental.MbusColo3Mod5.MOD35.C3TS03"
        }, {
          "$ref" : "#/parameters/authorizationHeader"
        } ],
        "produces" : [ "application/json" ],
        "operationId" : "getSingleSensorReadings",
        "responses" : {
          "200" : {
            "description" : "OK",
            "schema" : {
              "$ref" : "#/definitions/Sensor reading"
            }
          },
          "400" : {
            "description" : "Bad request"
          },
          "401" : {
            "description" : "Unauthorized"
          },
          "403" : {
            "description" : "Forbidden"
          },
          "422" : {
            "description" : "Unprocessable entity"
          }
        }
      }
    }
  },
  "definitions" : {
    "Pagination" : {
      "type" : "object",
      "description" : "Represents pagination component of the paginated response",
      "required" : [ "limit", "offset", "total" ],
      "properties" : {
        "offset" : {
          "type" : "integer",
          "format" : "int64",
          "description" : "The number of elements to skip."
        },
        "limit" : {
          "type" : "integer",
          "format" : "int64",
          "description" : "The page size."
        },
        "total" : {
          "type" : "integer",
          "format" : "int64",
          "description" : "The total number of elements in the result set."
        },
        "next" : {
          "type" : "string",
          "description" : "Represents a relative link to the next page. This can be empty if there is no next page available."
        },
        "previous" : {
          "type" : "string",
          "description" : "Represents a relative link to the previous page. This can be empty if there is no previous page available."
        }
      }
    },
    "Sensor reading" : {
      "type" : "object",
      "description" : "Single environmental sensor reading.",
      "required" : [ "ibx", "sensorId", "zoneId" ],
      "properties" : {
        "sensorId" : {
          "type" : "string",
          "example" : "SV2.Environmental.Colo4-ZoneHumidity1",
          "description" : "The sensor identifier."
        },
        "zoneId" : {
          "type" : "string",
          "example" : "CH2:1:06:ColoArea:1",
          "description" : "The zone where the sensor is placed."
        },
        "ibx" : {
          "type" : "string",
          "example" : "SV2",
          "description" : "The ibx identifier where the sensor is placed."
        },
        "humidity" : {
          "example" : "{ value: 33.3, unit: \"%\" }",
          "description" : "Sensor reading: humidity",
          "$ref" : "#/definitions/ValueWithUnit"
        },
        "temperature" : {
          "example" : "{ value: 23.08, unit: \"CELSIUS\" }",
          "description" : "Sensor reading: temperature",
          "$ref" : "#/definitions/ValueWithUnit"
        }
      }
    },
    "SensorReadingsResponse" : {
      "type" : "object",
      "required" : [ "data", "pagination" ],
      "properties" : {
        "data" : {
          "type" : "array",
          "description" : "List of data objects",
          "items" : {
            "$ref" : "#/definitions/Sensor reading"
          }
        },
        "pagination" : {
          "description" : "Pagination metadata",
          "$ref" : "#/definitions/Pagination"
        }
      }
    },
    "ValueWithUnit" : {
      "type" : "object",
      "description" : "Single value with related unit (e.g. percentage for humidity or Celsius degree for temperature).",
      "required" : [ "unit", "value" ],
      "properties" : {
        "value" : {
          "type" : "object",
          "example" : "33.3",
          "description" : "Specific value, to be read together with unit."
        },
        "unit" : {
          "type" : "object",
          "example" : "CELSIUS",
          "description" : "Unit for value."
        }
      }
    },
    "ValueWithUnitDoubleHumidityUnit" : {
      "type" : "object",
      "description" : "Single value with related unit (e.g. percentage for humidity or Celsius degree for temperature).",
      "required" : [ "unit", "value" ],
      "properties" : {
        "value" : {
          "type" : "number",
          "format" : "double",
          "example" : 33.3,
          "description" : "Specific value, to be read together with unit."
        },
        "unit" : {
          "type" : "string",
          "example" : "CELSIUS",
          "description" : "Unit for value.",
          "enum" : [ "PERCENT" ]
        }
      }
    },
    "ValueWithUnitDoubleTemperatureUnit" : {
      "type" : "object",
      "description" : "Single value with related unit (e.g. percentage for humidity or Celsius degree for temperature).",
      "required" : [ "unit", "value" ],
      "properties" : {
        "value" : {
          "type" : "number",
          "format" : "double",
          "example" : 33.3,
          "description" : "Specific value, to be read together with unit."
        },
        "unit" : {
          "type" : "string",
          "example" : "CELSIUS",
          "description" : "Unit for value.",
          "enum" : [ "CELSIUS", "FAHRENHEIT" ]
        }
      }
    }
  },
  "parameters" : {
    "authorizationHeader" : {
      "name" : "Authorization",
      "in" : "header",
      "type" : "string",
      "description" : "The OAuth Bearer token. Please add the prefix 'Bearer ' before the token.",
      "required" : true,
      "x-prefix" : "Bearer "
    }
  }
}