This commit is contained in:
2
Makefile
2
Makefile
@ -2,7 +2,7 @@
|
||||
.PHONY: generate lint test check test-integration
|
||||
|
||||
# Variables
|
||||
SPEC_URL = "https://git.omukk.dev/wrenn/wrenn/raw/branch/main/internal/api/openapi.yaml"
|
||||
SPEC_URL = "https://raw.githubusercontent.com/wrennhq/wrenn/refs/heads/main/internal/api/openapi.yaml"
|
||||
SPEC_PATH = "api/openapi.yaml"
|
||||
|
||||
generate:
|
||||
|
||||
@ -2,7 +2,7 @@ openapi: "3.1.0"
|
||||
info:
|
||||
title: Wrenn API
|
||||
description: MicroVM-based code execution platform API.
|
||||
version: "0.1.0"
|
||||
version: "0.1.3"
|
||||
|
||||
servers:
|
||||
- url: http://localhost:8080
|
||||
@ -921,6 +921,38 @@ paths:
|
||||
"400":
|
||||
$ref: "#/components/responses/BadRequest"
|
||||
|
||||
/v1/capsules/usage:
|
||||
get:
|
||||
summary: Get daily CPU and RAM usage for your team
|
||||
operationId: getCapsuleUsage
|
||||
tags: [capsules]
|
||||
security:
|
||||
- apiKeyAuth: []
|
||||
parameters:
|
||||
- name: from
|
||||
in: query
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
format: date
|
||||
description: Start date (YYYY-MM-DD). Defaults to 30 days ago.
|
||||
- name: to
|
||||
in: query
|
||||
required: false
|
||||
schema:
|
||||
type: string
|
||||
format: date
|
||||
description: End date (YYYY-MM-DD). Defaults to today.
|
||||
responses:
|
||||
"200":
|
||||
description: Daily usage data for the team
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/UsageResponse"
|
||||
"400":
|
||||
$ref: "#/components/responses/BadRequest"
|
||||
|
||||
/v1/capsules/{id}:
|
||||
parameters:
|
||||
- name: id
|
||||
@ -2432,6 +2464,28 @@ components:
|
||||
after this duration of inactivity (no exec or ping). 0 means
|
||||
no auto-pause.
|
||||
|
||||
UsageResponse:
|
||||
type: object
|
||||
properties:
|
||||
from:
|
||||
type: string
|
||||
format: date
|
||||
to:
|
||||
type: string
|
||||
format: date
|
||||
points:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
properties:
|
||||
date:
|
||||
type: string
|
||||
format: date
|
||||
cpu_minutes:
|
||||
type: number
|
||||
ram_mb_minutes:
|
||||
type: number
|
||||
|
||||
CapsuleStats:
|
||||
type: object
|
||||
properties:
|
||||
|
||||
20
docs/.gitignore
vendored
20
docs/.gitignore
vendored
@ -1,20 +0,0 @@
|
||||
# Dependencies
|
||||
/node_modules
|
||||
|
||||
# Production
|
||||
/build
|
||||
|
||||
# Generated files
|
||||
.docusaurus
|
||||
.cache-loader
|
||||
|
||||
# Misc
|
||||
.DS_Store
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
@ -1,10 +1,11 @@
|
||||
[project]
|
||||
name = "wrenn"
|
||||
version = "0.1.0"
|
||||
description = "Add your description here"
|
||||
description = "Python SDK for Wrenn"
|
||||
readme = "README.md"
|
||||
authors = [
|
||||
{ name = "Tasnim Kabir Sadik", email = "tksadik92@gmail.com" }
|
||||
{ name = "Rafeed M. Bhuiyan", email = "rafeed@omukk.dev" }
|
||||
{ name = "Tasnim Kabir Sadik", email = "tksadik@omukk.dev" }
|
||||
]
|
||||
requires-python = ">=3.13"
|
||||
dependencies = [
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
# generated by datamodel-codegen:
|
||||
# filename: openapi.yaml
|
||||
# timestamp: 2026-04-16T20:32:20+00:00
|
||||
# timestamp: 2026-04-22T20:21:34+00:00
|
||||
|
||||
from __future__ import annotations
|
||||
from pydantic import AwareDatetime, BaseModel, EmailStr, Field
|
||||
from typing import Annotated
|
||||
from datetime import date as date_aliased
|
||||
from enum import StrEnum
|
||||
|
||||
|
||||
@ -69,6 +70,18 @@ class CreateCapsuleRequest(BaseModel):
|
||||
] = 0
|
||||
|
||||
|
||||
class Point(BaseModel):
|
||||
date: date_aliased | None = None
|
||||
cpu_minutes: float | None = None
|
||||
ram_mb_minutes: float | None = None
|
||||
|
||||
|
||||
class UsageResponse(BaseModel):
|
||||
from_: Annotated[date_aliased | None, Field(alias="from")] = None
|
||||
to: date_aliased | None = None
|
||||
points: list[Point] | None = None
|
||||
|
||||
|
||||
class Range(StrEnum):
|
||||
field_5m = "5m"
|
||||
field_1h = "1h"
|
||||
|
||||
Reference in New Issue
Block a user