Query Stored Data Analytics

Retrieves Workers KV stored data metrics for the given account.

/accounts/{account_identifier}/storage/analytics/stored

get

Workers KV Stored Data Analytics

workers-kv-stored-data-analytics-query-stored-data-analytics

Debug "planAvailability"

null

Debug "tokenPermissions"

null

Debug "parameters"

[
  {
    "in": "path",
    "name": "account_identifier",
    "required": true,
    "schema": {
      "description": "Identifier",
      "example": "023e105f4ecef8ad9ca31a8372d0c353",
      "maxLength": 32,
      "readOnly": true,
      "type": "string"
    }
  },
  {
    "in": "query",
    "name": "query",
    "schema": {
      "allOf": [
        {
          "description": "For specifying result metrics.",
          "properties": {
            "dimensions": {
              "default": "[]",
              "description": "Can be used to break down the data by given attributes.",
              "items": {
                "description": "For drilling down on metrics.",
                "type": "string"
              },
              "type": "array"
            },
            "filters": {
              "default": "\"\"",
              "description": "Used to filter rows by one or more dimensions. Filters can be combined using OR and AND boolean logic. AND takes precedence over OR in all the expressions. The OR operator is defined using a comma (,) or OR keyword surrounded by whitespace. The AND operator is defined using a semicolon (;) or AND keyword surrounded by whitespace. Note that the semicolon is a reserved character in URLs (rfc1738) and needs to be percent-encoded as %3B. Comparison options are: \n\nOperator                  | Name                            | URL Encoded\n--------------------------|---------------------------------|--------------------------\n==                        | Equals                          | %3D%3D\n!=                        | Does not equals                 | !%3D\n>                        | Greater Than                    | %3E\n<                         | Less Than                       | %3C\n>=                       | Greater than or equal to        | %3E%3D\n<=                        | Less than or equal to           | %3C%3D     .",
              "type": "string"
            },
            "limit": {
              "default": 10000,
              "description": "Limit number of returned metrics.",
              "type": "integer"
            },
            "metrics": {
              "description": "One or more metrics to compute.",
              "items": {
                "description": "A quantitative measurement of KV usage.",
                "type": "string"
              },
              "type": "array"
            },
            "since": {
              "default": "<6 hours ago>",
              "description": "Start of time interval to query, defaults to 6 hours before request received.",
              "example": "2019-01-02T02:20:00Z",
              "format": "date-time",
              "type": "string"
            },
            "sort": {
              "default": "[]",
              "description": "Array of dimensions or metrics to sort by, each dimension/metric may be prefixed by - (descending) or + (ascending).",
              "items": {},
              "type": "array"
            },
            "until": {
              "default": "<now>",
              "description": "End of time interval to query, defaults to current time.",
              "example": "2019-01-02T03:20:00Z",
              "format": "date-time",
              "type": "string"
            }
          },
          "type": "object"
        },
        {
          "properties": {
            "dimensions": {
              "example": [
                "namespaceId"
              ],
              "items": {
                "enum": [
                  "namespaceId"
                ]
              }
            },
            "filters": {
              "example": "namespaceId==a4e8cbb7-1b58-4990-925e-e026d40c4c64"
            },
            "metrics": {
              "default": "[\"storedBytes\"]",
              "example": [
                "storedBytes",
                "storedKeys"
              ],
              "items": {
                "enum": [
                  "storedBytes",
                  "storedKeys"
                ]
              }
            },
            "sort": {
              "example": [
                "+storedBytes",
                "-namespaceId"
              ]
            }
          }
        }
      ]
    }
  }
]

Debug "requestBody"

null

Debug "responses"

{
  "200": {
    "content": {
      "application/json": {
        "schema": {
          "allOf": [
            {
              "allOf": [
                {
                  "properties": {
                    "errors": {
                      "example": [],
                      "items": {
                        "properties": {
                          "code": {
                            "minimum": 1000,
                            "type": "integer"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ],
                        "type": "object",
                        "uniqueItems": true
                      },
                      "type": "array"
                    },
                    "messages": {
                      "example": [],
                      "items": {
                        "properties": {
                          "code": {
                            "minimum": 1000,
                            "type": "integer"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ],
                        "type": "object",
                        "uniqueItems": true
                      },
                      "type": "array"
                    },
                    "result": {
                      "anyOf": [
                        {
                          "type": "object"
                        },
                        {
                          "items": {},
                          "type": "array"
                        },
                        {
                          "type": "string"
                        }
                      ]
                    },
                    "success": {
                      "description": "Whether the API call was successful",
                      "enum": [
                        true
                      ],
                      "example": true,
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "success",
                    "errors",
                    "messages",
                    "result"
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "result": {
                      "anyOf": [
                        {
                          "type": "object"
                        },
                        {
                          "type": "string"
                        }
                      ]
                    }
                  }
                }
              ],
              "type": "object"
            },
            {
              "properties": {
                "result": {
                  "allOf": [
                    {
                      "description": "Metrics on Workers KV requests.",
                      "properties": {
                        "data": {
                          "items": {
                            "properties": {
                              "metrics": {
                                "description": "List of metrics returned by the query.",
                                "items": {},
                                "type": "array"
                              }
                            },
                            "required": [
                              "metrics"
                            ],
                            "type": "object"
                          },
                          "nullable": true,
                          "type": "array"
                        },
                        "data_lag": {
                          "description": "Number of seconds between current time and last processed event, i.e. how many seconds of data could be missing.",
                          "example": 0,
                          "minimum": 0,
                          "type": "number"
                        },
                        "max": {
                          "description": "Maximum results for each metric."
                        },
                        "min": {
                          "description": "Minimum results for each metric."
                        },
                        "query": {
                          "description": "For specifying result metrics.",
                          "properties": {
                            "dimensions": {
                              "default": "[]",
                              "description": "Can be used to break down the data by given attributes.",
                              "items": {
                                "description": "For drilling down on metrics.",
                                "type": "string"
                              },
                              "type": "array"
                            },
                            "filters": {
                              "default": "\"\"",
                              "description": "Used to filter rows by one or more dimensions. Filters can be combined using OR and AND boolean logic. AND takes precedence over OR in all the expressions. The OR operator is defined using a comma (,) or OR keyword surrounded by whitespace. The AND operator is defined using a semicolon (;) or AND keyword surrounded by whitespace. Note that the semicolon is a reserved character in URLs (rfc1738) and needs to be percent-encoded as %3B. Comparison options are: \n\nOperator                  | Name                            | URL Encoded\n--------------------------|---------------------------------|--------------------------\n==                        | Equals                          | %3D%3D\n!=                        | Does not equals                 | !%3D\n>                        | Greater Than                    | %3E\n<                         | Less Than                       | %3C\n>=                       | Greater than or equal to        | %3E%3D\n<=                        | Less than or equal to           | %3C%3D     .",
                              "type": "string"
                            },
                            "limit": {
                              "default": 10000,
                              "description": "Limit number of returned metrics.",
                              "type": "integer"
                            },
                            "metrics": {
                              "description": "One or more metrics to compute.",
                              "items": {
                                "description": "A quantitative measurement of KV usage.",
                                "type": "string"
                              },
                              "type": "array"
                            },
                            "since": {
                              "default": "<6 hours ago>",
                              "description": "Start of time interval to query, defaults to 6 hours before request received.",
                              "example": "2019-01-02T02:20:00Z",
                              "format": "date-time",
                              "type": "string"
                            },
                            "sort": {
                              "default": "[]",
                              "description": "Array of dimensions or metrics to sort by, each dimension/metric may be prefixed by - (descending) or + (ascending).",
                              "items": {},
                              "type": "array"
                            },
                            "until": {
                              "default": "<now>",
                              "description": "End of time interval to query, defaults to current time.",
                              "example": "2019-01-02T03:20:00Z",
                              "format": "date-time",
                              "type": "string"
                            }
                          },
                          "type": "object"
                        },
                        "rows": {
                          "description": "Total number of rows in the result.",
                          "example": 2,
                          "minimum": 0,
                          "type": "number"
                        },
                        "totals": {
                          "description": "Total results for metrics across all data."
                        }
                      },
                      "required": [
                        "rows",
                        "data",
                        "data_lag",
                        "min",
                        "max",
                        "totals",
                        "query"
                      ],
                      "type": "object"
                    },
                    {
                      "properties": {
                        "data": {
                          "example": [
                            {
                              "metrics": [
                                [
                                  2,
                                  4
                                ],
                                [
                                  16,
                                  32
                                ]
                              ]
                            }
                          ]
                        },
                        "max": {
                          "example": {
                            "storedBytes": 32,
                            "storedKeys": 4
                          }
                        },
                        "min": {
                          "example": {
                            "storedBytes": 16,
                            "storedKeys": 2
                          }
                        },
                        "query": {
                          "description": "For specifying result metrics.",
                          "properties": {
                            "dimensions": {
                              "default": "[]",
                              "description": "Can be used to break down the data by given attributes.",
                              "items": {
                                "description": "For drilling down on metrics.",
                                "type": "string"
                              },
                              "type": "array"
                            },
                            "filters": {
                              "default": "\"\"",
                              "description": "Used to filter rows by one or more dimensions. Filters can be combined using OR and AND boolean logic. AND takes precedence over OR in all the expressions. The OR operator is defined using a comma (,) or OR keyword surrounded by whitespace. The AND operator is defined using a semicolon (;) or AND keyword surrounded by whitespace. Note that the semicolon is a reserved character in URLs (rfc1738) and needs to be percent-encoded as %3B. Comparison options are: \n\nOperator                  | Name                            | URL Encoded\n--------------------------|---------------------------------|--------------------------\n==                        | Equals                          | %3D%3D\n!=                        | Does not equals                 | !%3D\n>                        | Greater Than                    | %3E\n<                         | Less Than                       | %3C\n>=                       | Greater than or equal to        | %3E%3D\n<=                        | Less than or equal to           | %3C%3D     .",
                              "type": "string"
                            },
                            "limit": {
                              "default": 10000,
                              "description": "Limit number of returned metrics.",
                              "type": "integer"
                            },
                            "metrics": {
                              "description": "One or more metrics to compute.",
                              "items": {
                                "description": "A quantitative measurement of KV usage.",
                                "type": "string"
                              },
                              "type": "array"
                            },
                            "since": {
                              "default": "<6 hours ago>",
                              "description": "Start of time interval to query, defaults to 6 hours before request received.",
                              "example": "2019-01-02T02:20:00Z",
                              "format": "date-time",
                              "type": "string"
                            },
                            "sort": {
                              "default": "[]",
                              "description": "Array of dimensions or metrics to sort by, each dimension/metric may be prefixed by - (descending) or + (ascending).",
                              "items": {},
                              "type": "array"
                            },
                            "until": {
                              "default": "<now>",
                              "description": "End of time interval to query, defaults to current time.",
                              "example": "2019-01-02T03:20:00Z",
                              "format": "date-time",
                              "type": "string"
                            }
                          },
                          "type": "object"
                        },
                        "totals": {
                          "example": {
                            "storedBytes": 48,
                            "storedKeys": 6
                          }
                        }
                      }
                    }
                  ]
                }
              },
              "type": "object"
            }
          ]
        }
      }
    },
    "description": "Query Stored Data Analytics response"
  },
  "4XX": {
    "content": {
      "application/json": {
        "schema": {
          "allOf": [
            {
              "allOf": [
                {
                  "allOf": [
                    {
                      "properties": {
                        "errors": {
                          "example": [],
                          "items": {
                            "properties": {
                              "code": {
                                "minimum": 1000,
                                "type": "integer"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ],
                            "type": "object",
                            "uniqueItems": true
                          },
                          "type": "array"
                        },
                        "messages": {
                          "example": [],
                          "items": {
                            "properties": {
                              "code": {
                                "minimum": 1000,
                                "type": "integer"
                              },
                              "message": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "code",
                              "message"
                            ],
                            "type": "object",
                            "uniqueItems": true
                          },
                          "type": "array"
                        },
                        "result": {
                          "anyOf": [
                            {
                              "type": "object"
                            },
                            {
                              "items": {},
                              "type": "array"
                            },
                            {
                              "type": "string"
                            }
                          ]
                        },
                        "success": {
                          "description": "Whether the API call was successful",
                          "enum": [
                            true
                          ],
                          "example": true,
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "success",
                        "errors",
                        "messages",
                        "result"
                      ],
                      "type": "object"
                    },
                    {
                      "properties": {
                        "result": {
                          "anyOf": [
                            {
                              "type": "object"
                            },
                            {
                              "type": "string"
                            }
                          ]
                        }
                      }
                    }
                  ],
                  "type": "object"
                },
                {
                  "properties": {
                    "result": {
                      "description": "Metrics on Workers KV requests.",
                      "properties": {
                        "data": {
                          "items": {
                            "properties": {
                              "metrics": {
                                "description": "List of metrics returned by the query.",
                                "items": {},
                                "type": "array"
                              }
                            },
                            "required": [
                              "metrics"
                            ],
                            "type": "object"
                          },
                          "nullable": true,
                          "type": "array"
                        },
                        "data_lag": {
                          "description": "Number of seconds between current time and last processed event, i.e. how many seconds of data could be missing.",
                          "example": 0,
                          "minimum": 0,
                          "type": "number"
                        },
                        "max": {
                          "description": "Maximum results for each metric."
                        },
                        "min": {
                          "description": "Minimum results for each metric."
                        },
                        "query": {
                          "description": "For specifying result metrics.",
                          "properties": {
                            "dimensions": {
                              "default": "[]",
                              "description": "Can be used to break down the data by given attributes.",
                              "items": {
                                "description": "For drilling down on metrics.",
                                "type": "string"
                              },
                              "type": "array"
                            },
                            "filters": {
                              "default": "\"\"",
                              "description": "Used to filter rows by one or more dimensions. Filters can be combined using OR and AND boolean logic. AND takes precedence over OR in all the expressions. The OR operator is defined using a comma (,) or OR keyword surrounded by whitespace. The AND operator is defined using a semicolon (;) or AND keyword surrounded by whitespace. Note that the semicolon is a reserved character in URLs (rfc1738) and needs to be percent-encoded as %3B. Comparison options are: \n\nOperator                  | Name                            | URL Encoded\n--------------------------|---------------------------------|--------------------------\n==                        | Equals                          | %3D%3D\n!=                        | Does not equals                 | !%3D\n>                        | Greater Than                    | %3E\n<                         | Less Than                       | %3C\n>=                       | Greater than or equal to        | %3E%3D\n<=                        | Less than or equal to           | %3C%3D     .",
                              "type": "string"
                            },
                            "limit": {
                              "default": 10000,
                              "description": "Limit number of returned metrics.",
                              "type": "integer"
                            },
                            "metrics": {
                              "description": "One or more metrics to compute.",
                              "items": {
                                "description": "A quantitative measurement of KV usage.",
                                "type": "string"
                              },
                              "type": "array"
                            },
                            "since": {
                              "default": "<6 hours ago>",
                              "description": "Start of time interval to query, defaults to 6 hours before request received.",
                              "example": "2019-01-02T02:20:00Z",
                              "format": "date-time",
                              "type": "string"
                            },
                            "sort": {
                              "default": "[]",
                              "description": "Array of dimensions or metrics to sort by, each dimension/metric may be prefixed by - (descending) or + (ascending).",
                              "items": {},
                              "type": "array"
                            },
                            "until": {
                              "default": "<now>",
                              "description": "End of time interval to query, defaults to current time.",
                              "example": "2019-01-02T03:20:00Z",
                              "format": "date-time",
                              "type": "string"
                            }
                          },
                          "type": "object"
                        },
                        "rows": {
                          "description": "Total number of rows in the result.",
                          "example": 2,
                          "minimum": 0,
                          "type": "number"
                        },
                        "totals": {
                          "description": "Total results for metrics across all data."
                        }
                      },
                      "required": [
                        "rows",
                        "data",
                        "data_lag",
                        "min",
                        "max",
                        "totals",
                        "query"
                      ],
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              ]
            },
            {
              "properties": {
                "errors": {
                  "allOf": [
                    {
                      "example": [],
                      "items": {
                        "properties": {
                          "code": {
                            "minimum": 1000,
                            "type": "integer"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ],
                        "type": "object",
                        "uniqueItems": true
                      },
                      "type": "array"
                    }
                  ],
                  "example": [
                    {
                      "code": 7003,
                      "message": "No route for the URI"
                    }
                  ],
                  "minLength": 1
                },
                "messages": {
                  "allOf": [
                    {
                      "example": [],
                      "items": {
                        "properties": {
                          "code": {
                            "minimum": 1000,
                            "type": "integer"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "code",
                          "message"
                        ],
                        "type": "object",
                        "uniqueItems": true
                      },
                      "type": "array"
                    }
                  ],
                  "example": []
                },
                "result": {
                  "enum": [
                    null
                  ],
                  "nullable": true,
                  "type": "object"
                },
                "success": {
                  "description": "Whether the API call was successful",
                  "enum": [
                    false
                  ],
                  "example": false,
                  "type": "boolean"
                }
              },
              "required": [
                "success",
                "errors",
                "messages",
                "result"
              ],
              "type": "object"
            }
          ]
        }
      }
    },
    "description": "Query Stored Data Analytics response failure"
  }
}

Debug "security"

[
  {
    "api_token": []
  },
  {
    "api_email": [],
    "api_key": []
  }
]