v0.1.5 #13

Merged
pptx704 merged 56 commits from dev into main 2026-05-22 23:01:46 +00:00
49 changed files with 2051 additions and 15172 deletions
Showing only changes of commit 61bc040098 - Show all commits

View File

@ -2,7 +2,7 @@
.PHONY: generate lint test check test-integration .PHONY: generate lint test check test-integration
# Variables # 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" SPEC_PATH = "api/openapi.yaml"
generate: generate:

View File

@ -2,7 +2,7 @@ openapi: "3.1.0"
info: info:
title: Wrenn API title: Wrenn API
description: MicroVM-based code execution platform API. description: MicroVM-based code execution platform API.
version: "0.1.0" version: "0.1.3"
servers: servers:
- url: http://localhost:8080 - url: http://localhost:8080
@ -921,6 +921,38 @@ paths:
"400": "400":
$ref: "#/components/responses/BadRequest" $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}: /v1/capsules/{id}:
parameters: parameters:
- name: id - name: id
@ -2432,6 +2464,28 @@ components:
after this duration of inactivity (no exec or ping). 0 means after this duration of inactivity (no exec or ping). 0 means
no auto-pause. 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: CapsuleStats:
type: object type: object
properties: properties:

20
docs/.gitignore vendored
View File

@ -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*

View File

@ -1,10 +1,11 @@
[project] [project]
name = "wrenn" name = "wrenn"
version = "0.1.0" version = "0.1.0"
description = "Add your description here" description = "Python SDK for Wrenn"
readme = "README.md" readme = "README.md"
authors = [ 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" requires-python = ">=3.13"
dependencies = [ dependencies = [

View File

@ -1,10 +1,11 @@
# generated by datamodel-codegen: # generated by datamodel-codegen:
# filename: openapi.yaml # filename: openapi.yaml
# timestamp: 2026-04-16T20:32:20+00:00 # timestamp: 2026-04-22T20:21:34+00:00
from __future__ import annotations from __future__ import annotations
from pydantic import AwareDatetime, BaseModel, EmailStr, Field from pydantic import AwareDatetime, BaseModel, EmailStr, Field
from typing import Annotated from typing import Annotated
from datetime import date as date_aliased
from enum import StrEnum from enum import StrEnum
@ -69,6 +70,18 @@ class CreateCapsuleRequest(BaseModel):
] = 0 ] = 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): class Range(StrEnum):
field_5m = "5m" field_5m = "5m"
field_1h = "1h" field_1h = "1h"