Turso Cloud API 参考 接口资源 组织管理
组织用量
获取组织当前计费周期的用量。
GET
https://api.turso.tech/v1/organizations/{organizationSlug}/usage curl -L https://api.turso.tech/v1/organizations/{organizationSlug}/usage \
-H 'Authorization: Bearer TOKEN'
OpenAPI
openapi: 3.0.1
info:
title: Turso Platform API
description: API description here
license:
name: MIT
version: 0.1.0
servers:
- url: https://api.turso.tech
description: Turso's Platform API
security: []
paths:
/v1/organizations/{organizationSlug}/usage:
get:
summary: Organization Usage
description: Fetch current billing cycle usage for an organization.
operationId: getOrganizationUsage
parameters:
- $ref: '#/components/parameters/organizationSlug'
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
organization:
type: object
description: >-
The organization usage object, containing the total usage
for rows read and written, as well as the total storage
size (in bytes).
properties:
uuid:
type: string
description: The UUID of the organization.
example: fa72ba58-7db3-436b-bcab-14b83eb1dd88
usage:
type: object
description: The usage object for the organization.
properties:
rows_read:
type: integer
description: >-
The number of rows read allowed for the specific
plan.
example: 1000000000
rows_written:
type: integer
description: >-
The number of rows written allowed for the
specific plan.
example: 25000000
databases:
type: integer
description: >-
The number of databases allowed for the specific
plan.
example: 500
locations:
type: integer
description: >-
The number of locations allowed for the specific
plan.
example: 3
storage_bytes:
type: integer
description: >-
The amount of storage allowed for the specific
plan, in bytes.
example: 9000000000
groups:
type: integer
description: >-
The number of groups allowed for the specific
plan.
example: 1
bytes_synced:
type: integer
description: >-
The number of bytes synced allowed for the
specific plan, in bytes.
example: 3000000000
databases:
type: array
description: The databases for the organization and their usage.
items:
$ref: '#/components/schemas/DatabaseUsageOutput'
components:
parameters:
organizationSlug:
in: path
name: organizationSlug
required: true
schema:
type: string
description: The slug of the organization or user account.
schemas:
DatabaseUsageOutput:
type: object
properties:
uuid: 2c439770-a039-437c-b074-b92eb9f47cc0
instances:
type: array
description: The usage objects for instances of the current database.
items:
type: object
properties:
uuid:
type: string
description: The instance universal unique identifier (UUID).
example: cd831986-94e5-11ee-a6fe-7a52e1f7759a
usage:
$ref: '#/components/schemas/DatabaseUsageObject'
description: The usage for the current database instance.
example:
- uuid: cd831986-94e5-11ee-a6fe-7a52e1f7759a
usage:
rows_read: 0
rows_written: 0
storage_bytes: 4096
bytes_synced: 0
- uuid: 0be90471-6906-11ee-8553-eaa7715aeaf2
usage:
rows_read: 0
rows_written: 0
storage_bytes: 4096
bytes_synced: 0
total:
$ref: '#/components/schemas/DatabaseUsageObject'
description: The total usage for the database.
example:
rows_read: 0
rows_written: 0
storage_bytes: 8192
bytes_synced: 0
DatabaseUsageObject:
type: object
properties:
rows_read:
type: integer
example: 0
description: The total rows read in the time period.
rows_written:
type: integer
example: 0
description: The total rows written in the time period.
storage_bytes:
type: integer
example: 0
description: The total storage used.
bytes_synced:
type: integer
example: 0
description: The total bytes synced.
同步自官方 Turso 文档仓库 (
tursodatabase/turso-docs
· MIT 开源协议)
查看官方原文 ↗