{ "components": { "responses": {}, "schemas": { "DeploymentInfo": { "properties": { "deployed_at": { "format": "date-time", "nullable": true, "type": "string", "x-struct": null, "x-validate": null }, "garden_sid": { "type": "string", "x-struct": null, "x-validate": null }, "result": { "nullable": true, "type": "string", "x-struct": null, "x-validate": null }, "seeds": { "default": [], "items": { "$ref": "#/components/schemas/DeploymentSeedInfo" }, "type": "array", "x-struct": null, "x-validate": null }, "sid": { "type": "string", "x-struct": null, "x-validate": null }, "skipped": { "default": false, "description": "The request matched an existing deployment and no new one was created", "type": "boolean", "x-struct": null, "x-validate": null }, "state": { "type": "string", "x-struct": null, "x-validate": null } }, "required": [ "sid", "garden_sid", "state" ], "title": "DeploymentInfo", "type": "object", "x-struct": "Elixir.SowerClient.Orchestration.DeploymentInfo", "x-validate": null }, "DeploymentSeedInfo": { "properties": { "log": { "nullable": true, "type": "string", "x-struct": null, "x-validate": null }, "name": { "type": "string", "x-struct": null, "x-validate": null }, "result": { "nullable": true, "type": "string", "x-struct": null, "x-validate": null }, "seed_sid": { "type": "string", "x-struct": null, "x-validate": null }, "seed_type": { "type": "string", "x-struct": null, "x-validate": null }, "state": { "nullable": true, "type": "string", "x-struct": null, "x-validate": null } }, "required": [ "seed_sid", "name", "seed_type" ], "title": "DeploymentSeedInfo", "type": "object", "x-struct": "Elixir.SowerClient.Orchestration.DeploymentInfo.SeedInfo", "x-validate": null }, "DirectDeployment": { "properties": { "action": { "description": "Requested action: stage, activate, or restart. Defaults to activate unless overriding. Without override, the exact action must be permitted by the garden's direct policy, including windows and confirmation requirements; restart does not require override. Required explicitly when overriding policy.", "enum": [ "stage", "activate", "restart" ], "nullable": true, "type": "string", "x-struct": null, "x-validate": null }, "force": { "default": false, "description": "Deploy even when an identical closure was already deployed", "type": "boolean", "x-struct": null, "x-validate": null }, "garden": { "description": "Garden sid (grdn_…) or garden name", "example": "grdn_2f8b1c", "type": "string", "x-struct": null, "x-validate": null }, "override": { "default": false, "description": "Break glass: bypass deployment policy on both server and garden. Requires override permission, action, reason, and a connected garden advertising override support. Unsupported gardens are rejected with an upgrade-required error. Seed/action support and activator privileges still apply.", "type": "boolean", "x-struct": null, "x-validate": null }, "reason": { "description": "Why policy is being bypassed. Recorded in the audit trail.", "nullable": true, "type": "string", "x-struct": null, "x-validate": null }, "seed": { "description": "Seed sid to deploy", "example": "seed_9a3d21", "type": "string", "x-struct": null, "x-validate": null } }, "required": [ "garden", "seed" ], "title": "DirectDeployment", "type": "object", "x-struct": "Elixir.SowerClient.Orchestration.DirectDeployment", "x-validate": null }, "GardenRegistration": { "description": "HTTP registration request for a new garden", "properties": { "name": { "description": "Name of garden", "type": "string", "x-struct": null, "x-validate": null }, "public_key": { "description": "PEM-encoded RSA public key for private_key_jwt authentication", "type": "string", "x-struct": null, "x-validate": null } }, "required": [ "name", "public_key" ], "title": "GardenRegistration", "type": "object", "x-struct": "Elixir.SowerClient.GardenRegistration", "x-validate": null }, "Nix Cache": { "description": "A Nix binary cache", "example": { "public_key": "my.cache.org:1111111111111111", "sid": "example4ser3adju75ddusbr", "url": "https://my.cache.org" }, "properties": { "public_key": { "description": "Trusted public key for signed NARs", "type": "string", "x-struct": null, "x-validate": null }, "sid": { "description": "sid of the nix cache", "readOnly": true, "type": "string", "x-struct": null, "x-validate": null }, "url": { "description": "URL to binary cache", "type": "string", "x-struct": null, "x-validate": null } }, "required": [ "sid", "url", "public_key" ], "title": "Nix Cache", "type": "object", "x-struct": "Elixir.SowerClient.Nix.Cache", "x-validate": null }, "OAuthCredentials": { "description": "OAuth client registration returned to a garden after registration", "properties": { "client_id": { "description": "Boruta OAuth client ID", "type": "string", "x-struct": null, "x-validate": null } }, "required": [ "client_id" ], "title": "OAuthCredentials", "type": "object", "x-struct": "Elixir.SowerClient.Auth.OAuthCredentials", "x-validate": null }, "Seed": { "description": "A seed is an installable unit", "example": { "artifact": "/nix/store/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-nixos", "name": "myhost", "seed_type": "nixos", "sid": "example4ser3adju75ddusbr", "tags": [] }, "properties": { "artifact": { "description": "Artifact of the seed", "type": "string", "x-struct": null, "x-validate": null }, "name": { "description": "Name of the seed", "type": "string", "x-struct": null, "x-validate": null }, "seed_type": { "description": "Type of the seed", "enum": [ "nixos", "home-manager", "nix-darwin", "service" ], "type": "string", "x-struct": null, "x-validate": null }, "sid": { "description": "sid of the seed set by the server", "nullable": true, "readOnly": true, "type": "string", "x-struct": null, "x-validate": null }, "tags": { "default": [], "description": "Tags associated with the seed", "items": { "$ref": "#/components/schemas/SeedTag" }, "type": "array", "x-struct": null, "x-validate": null } }, "required": [ "name", "seed_type", "artifact" ], "title": "Seed", "type": "object", "x-struct": "Elixir.SowerClient.Seed", "x-validate": null }, "SeedTag": { "description": "A tag associated with a seed", "example": { "key": "environment", "value": "production" }, "properties": { "key": { "description": "Tag key", "type": "string", "x-struct": null, "x-validate": null }, "value": { "description": "Tag value", "type": "string", "x-struct": null, "x-validate": null } }, "required": [ "key", "value" ], "title": "SeedTag", "type": "object", "x-struct": "Elixir.SowerClient.SeedTag", "x-validate": null }, "TokenInfo": { "description": "Information about an authenticated access token", "example": { "description": "CI/CD token", "expires_at": "2025-12-31", "permissions": [ "seed:read", "seed:write" ], "sid": "example4ser3adju75ddusbr" }, "properties": { "description": { "description": "Human-readable token description", "type": "string", "x-struct": null, "x-validate": null }, "expires_at": { "description": "Token expiration date", "format": "date", "type": "string", "x-struct": null, "x-validate": null }, "permissions": { "description": "Permission roles (e.g., seed:read, seed:write)", "items": { "type": "string", "x-struct": null, "x-validate": null }, "type": "array", "x-struct": null, "x-validate": null }, "sid": { "description": "Token identifier", "type": "string", "x-struct": null, "x-validate": null } }, "required": [ "sid", "description", "permissions", "expires_at" ], "title": "TokenInfo", "type": "object", "x-struct": "Elixir.SowerClient.Auth.TokenInfo", "x-validate": null } }, "securitySchemes": { "authorization": { "bearerFormat": "sower", "description": "sower api token", "scheme": "bearer", "type": "http" } } }, "info": { "title": "sower", "version": "0.12.14" }, "openapi": "3.0.0", "paths": { "/api/v1/auth/verify": { "get": { "callbacks": {}, "description": "Validates the Bearer token and returns token metadata", "operationId": "VerifyToken", "parameters": [], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TokenInfo" } } }, "description": "Token info response" }, "401": { "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "x-struct": null, "x-validate": null } }, "type": "object", "x-struct": null, "x-validate": null } } }, "description": "Unauthorized" } }, "summary": "Verify access token", "tags": [] } }, "/api/v1/deployments": { "post": { "callbacks": {}, "operationId": "NewDeployment", "parameters": [], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DirectDeployment" } } }, "description": "Direct deployment params", "required": false }, "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeploymentInfo" } } }, "description": "Deployment response" }, "401": { "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "x-struct": null, "x-validate": null } }, "type": "object", "x-struct": null, "x-validate": null } } }, "description": "Unauthorized" }, "403": { "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "x-struct": null, "x-validate": null } }, "type": "object", "x-struct": null, "x-validate": null } } }, "description": "Denied by policy" }, "404": { "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "x-struct": null, "x-validate": null } }, "type": "object", "x-struct": null, "x-validate": null } } }, "description": "Garden or seed not found" }, "409": { "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "x-struct": null, "x-validate": null } }, "type": "object", "x-struct": null, "x-validate": null } } }, "description": "Ambiguous garden name or garden upgrade required" }, "422": { "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "x-struct": null, "x-validate": null } }, "type": "object", "x-struct": null, "x-validate": null } } }, "description": "Invalid request" } }, "summary": "Deploy a seed directly at a garden", "tags": [] } }, "/api/v1/deployments/{sid}": { "get": { "callbacks": {}, "operationId": "GetDeployment", "parameters": [ { "description": "Deployment SID", "example": "dply_example4ser3adju75d", "in": "path", "name": "sid", "required": true, "schema": { "type": "string", "x-struct": null, "x-validate": null } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeploymentInfo" } } }, "description": "Deployment response" }, "401": { "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "x-struct": null, "x-validate": null } }, "type": "object", "x-struct": null, "x-validate": null } } }, "description": "Unauthorized" }, "404": { "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "x-struct": null, "x-validate": null } }, "type": "object", "x-struct": null, "x-validate": null } } }, "description": "Deployment not found" } }, "summary": "Get a deployment", "tags": [] } }, "/api/v1/gardens/register": { "post": { "callbacks": {}, "operationId": "RegisterGarden", "parameters": [], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GardenRegistration" } } }, "description": "Garden registration params", "required": false }, "responses": { "201": { "content": { "application/json": { "schema": { "properties": { "oauth_credentials": { "$ref": "#/components/schemas/OAuthCredentials" }, "sid": { "description": "Garden SID", "type": "string", "x-struct": null, "x-validate": null } }, "required": [ "sid", "oauth_credentials" ], "type": "object", "x-struct": null, "x-validate": null } } }, "description": "Garden registration response" }, "401": { "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "x-struct": null, "x-validate": null } }, "type": "object", "x-struct": null, "x-validate": null } } }, "description": "Unauthorized" }, "422": { "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "x-struct": null, "x-validate": null } }, "type": "object", "x-struct": null, "x-validate": null } } }, "description": "Validation error" } }, "summary": "Register a new garden", "tags": [] } }, "/api/v1/gardens/{garden}/latest-seed": { "get": { "callbacks": {}, "operationId": "LatestGardenSeed", "parameters": [ { "description": "Garden SID or unambiguous name", "in": "path", "name": "garden", "required": true, "schema": { "type": "string", "x-struct": null, "x-validate": null } }, { "description": "Seed name", "in": "query", "name": "name", "required": true, "schema": { "type": "string", "x-struct": null, "x-validate": null } }, { "description": "Seed type", "in": "query", "name": "seed_type", "required": true, "schema": { "type": "string", "x-struct": null, "x-validate": null } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Seed" } } }, "description": "Latest matching seed" }, "204": { "description": "No matching subscription or seed" }, "401": { "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "x-struct": null, "x-validate": null } }, "type": "object", "x-struct": null, "x-validate": null } } }, "description": "Unauthorized" }, "404": { "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "x-struct": null, "x-validate": null } }, "type": "object", "x-struct": null, "x-validate": null } } }, "description": "Garden not found" }, "409": { "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "x-struct": null, "x-validate": null } }, "type": "object", "x-struct": null, "x-validate": null } } }, "description": "Garden name is ambiguous" } }, "summary": "Find the latest seed for a garden's oldest matching subscription", "tags": [] } }, "/api/v1/nix/caches": { "get": { "callbacks": {}, "operationId": "ListNixCaches", "parameters": [], "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/Nix Cache" }, "type": "array", "x-struct": null, "x-validate": null } } }, "description": "Nix Cache response" }, "401": { "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "x-struct": null, "x-validate": null } }, "type": "object", "x-struct": null, "x-validate": null } } }, "description": "Unauthorized" } }, "summary": "List Nix Caches", "tags": [] } }, "/api/v1/seeds": { "get": { "callbacks": {}, "operationId": "ListSeeds", "parameters": [ { "description": "Seed name", "example": "host1", "in": "query", "name": "name", "required": false, "schema": { "type": "string", "x-struct": null, "x-validate": null } }, { "description": "Seed type, one of [nixos, home-manager, nix-darwin, service]", "example": "nixos", "in": "query", "name": "seed_type", "required": false, "schema": { "type": "string", "x-struct": null, "x-validate": null } } ], "responses": { "200": { "content": { "application/json": { "schema": { "items": { "$ref": "#/components/schemas/Seed" }, "type": "array", "x-struct": null, "x-validate": null } } }, "description": "Seed response" }, "401": { "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "x-struct": null, "x-validate": null } }, "type": "object", "x-struct": null, "x-validate": null } } }, "description": "Unauthorized" }, "404": { "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "x-struct": null, "x-validate": null } }, "type": "object", "x-struct": null, "x-validate": null } } }, "description": "Seed error response" } }, "summary": "List Seeds", "tags": [] }, "post": { "callbacks": {}, "operationId": "NewSeed", "parameters": [ { "description": "Rename the seed if matching artifact found", "example": "true", "in": "query", "name": "rename", "required": false, "schema": { "type": "boolean", "x-struct": null, "x-validate": null } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Seed" } } }, "description": "Seed params", "required": false }, "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Seed" } } }, "description": "Seed response" }, "401": { "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "x-struct": null, "x-validate": null } }, "type": "object", "x-struct": null, "x-validate": null } } }, "description": "Unauthorized" }, "409": { "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "x-struct": null, "x-validate": null } }, "type": "object", "x-struct": null, "x-validate": null } } }, "description": "Seed conflict response" } }, "summary": "New Seed", "tags": [] } }, "/api/v1/seeds/latest": { "get": { "callbacks": {}, "operationId": "LatestSeed", "parameters": [ { "description": "Filter by tags (key=value format, can repeat)", "in": "query", "name": "tags", "required": false, "schema": { "items": { "type": "string", "x-struct": null, "x-validate": null }, "type": "array", "x-struct": null, "x-validate": null } }, { "description": "Seed name", "example": "host1", "in": "query", "name": "name", "required": false, "schema": { "type": "string", "x-struct": null, "x-validate": null } }, { "description": "Seed type", "example": "nixos", "in": "query", "name": "seed_type", "required": false, "schema": { "type": "string", "x-struct": null, "x-validate": null } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Seed" } } }, "description": "Seed response" }, "401": { "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "x-struct": null, "x-validate": null } }, "type": "object", "x-struct": null, "x-validate": null } } }, "description": "Unauthorized" }, "404": { "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "x-struct": null, "x-validate": null } }, "type": "object", "x-struct": null, "x-validate": null } } }, "description": "Seed error response" } }, "summary": "Find latest Seed", "tags": [] } }, "/api/v1/seeds/{sid}": { "get": { "callbacks": {}, "operationId": "GetSeed", "parameters": [ { "description": "Seed SID", "example": "example4ser3adju75ddusbr", "in": "path", "name": "sid", "required": true, "schema": { "type": "string", "x-struct": null, "x-validate": null } } ], "responses": { "200": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Seed" } } }, "description": "Seed response" }, "401": { "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "x-struct": null, "x-validate": null } }, "type": "object", "x-struct": null, "x-validate": null } } }, "description": "Unauthorized" }, "404": { "content": { "application/json": { "schema": { "properties": { "error": { "type": "string", "x-struct": null, "x-validate": null } }, "type": "object", "x-struct": null, "x-validate": null } } }, "description": "Seed error response" } }, "summary": "Get Seed", "tags": [] } } }, "security": [ { "authorization": [] } ], "servers": [ { "url": "http://localhost:4002" } ], "tags": [] }