ring0-sdk 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ring0_sdk-0.1.0/LICENSE +21 -0
- ring0_sdk-0.1.0/PKG-INFO +84 -0
- ring0_sdk-0.1.0/README.md +69 -0
- ring0_sdk-0.1.0/pyproject.toml +22 -0
- ring0_sdk-0.1.0/ring0_sdk/__init__.py +76 -0
- ring0_sdk-0.1.0/ring0_sdk/client.py +765 -0
- ring0_sdk-0.1.0/ring0_sdk/models.py +729 -0
- ring0_sdk-0.1.0/ring0_sdk.egg-info/PKG-INFO +84 -0
- ring0_sdk-0.1.0/ring0_sdk.egg-info/SOURCES.txt +11 -0
- ring0_sdk-0.1.0/ring0_sdk.egg-info/dependency_links.txt +1 -0
- ring0_sdk-0.1.0/ring0_sdk.egg-info/top_level.txt +1 -0
- ring0_sdk-0.1.0/setup.cfg +4 -0
- ring0_sdk-0.1.0/tests/test_client.py +943 -0
ring0_sdk-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ring0.run
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
ring0_sdk-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ring0-sdk
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Zero-dependency typed Python 3.10+ SDK for the ring0.run microVM Control Plane API.
|
|
5
|
+
Author: ring0.run
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://ring0.run
|
|
8
|
+
Project-URL: Repository, https://github.com/ring0run/sdk-python
|
|
9
|
+
Project-URL: Documentation, https://ring0.run/docs
|
|
10
|
+
Keywords: ring0,sandbox,microvm,ai-agents,bare-metal,sdk
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Dynamic: license-file
|
|
15
|
+
|
|
16
|
+
# `ring0-sdk` (Python)
|
|
17
|
+
|
|
18
|
+
Zero-dependency typed Python 3.10+ SDK for the [`ring0.run`](https://ring0.run) bare-metal Linux microVM Control Plane API (`/api/v1`). Built exclusively on the Python standard library (`urllib.request`, `dataclasses`, `json`, `base64`) with typed response models and structured `Ring0Error` exceptions.
|
|
19
|
+
|
|
20
|
+
## Using with AI Agents
|
|
21
|
+
|
|
22
|
+
If you are using an AI coding agent with this repository, point it to [`AGENTS.md`](./AGENTS.md) and the live platform reference rather than relying on static README lists:
|
|
23
|
+
|
|
24
|
+
- Concise index: [`https://ring0.run/llms.txt`](https://ring0.run/llms.txt)
|
|
25
|
+
- Full platform reference: [`https://ring0.run/llms-full.txt`](https://ring0.run/llms-full.txt)
|
|
26
|
+
- Interactive docs: [`https://ring0.run/docs`](https://ring0.run/docs)
|
|
27
|
+
|
|
28
|
+
## Highlights
|
|
29
|
+
|
|
30
|
+
- **Zero third-party runtime dependencies:** Runs anywhere Python 3.10+ is available.
|
|
31
|
+
- **Production defaults built in:** Automatically targets `https://api.ring0.run` and `https://on.ring0.run` unless overridden via arguments or `RING0_API_URL` / `RING0_EDGE_URL`.
|
|
32
|
+
- **Typed dataclasses and errors:** All payloads deserialize into typed `dataclass` models, and non-2xx responses raise `Ring0Error` with HTTP `status` and API error `code`.
|
|
33
|
+
|
|
34
|
+
## Installation
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install ring0-sdk
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Quick Start
|
|
41
|
+
|
|
42
|
+
Set `RING0_API_KEY` in your environment:
|
|
43
|
+
|
|
44
|
+
```python
|
|
45
|
+
import os
|
|
46
|
+
from ring0_sdk import CredentialRule, NetworkPolicy, Ring0Client
|
|
47
|
+
|
|
48
|
+
client = Ring0Client(api_key=os.environ["RING0_API_KEY"])
|
|
49
|
+
|
|
50
|
+
sbx = client.create_sandbox(
|
|
51
|
+
name="py-agent",
|
|
52
|
+
size="default",
|
|
53
|
+
network_policy=NetworkPolicy(
|
|
54
|
+
outbound="allow",
|
|
55
|
+
allow_domains=["api.openai.com"],
|
|
56
|
+
credentials=[
|
|
57
|
+
CredentialRule(
|
|
58
|
+
domain="api.openai.com",
|
|
59
|
+
header_name="Authorization",
|
|
60
|
+
placeholder="Bearer_DUMMY",
|
|
61
|
+
secret_ref="secret:OPENAI_API_KEY",
|
|
62
|
+
)
|
|
63
|
+
],
|
|
64
|
+
),
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
res = client.exec(sbx.id, "python3 --version")
|
|
68
|
+
print(res.stdout)
|
|
69
|
+
|
|
70
|
+
client.hibernate_sandbox(sbx.id)
|
|
71
|
+
print("Wake-on-HTTP preview:", client.preview_url(sbx.id, 3000))
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
For the full `/api/v1` method and endpoint reference (lifecycle, file I/O, Safe YOLO egress policies, approvals, secrets vault, virtual desktop, snapshots, schedules, and audit logs), see [`https://ring0.run/docs`](https://ring0.run/docs) and [`https://ring0.run/llms.txt`](https://ring0.run/llms.txt).
|
|
75
|
+
|
|
76
|
+
## Sizing Tiers
|
|
77
|
+
|
|
78
|
+
Supported sizing tiers are `micro`, `small`, `default`, `large`, and `xlarge`. See [`ring0.run`](https://ring0.run) for hardware specs and current pricing.
|
|
79
|
+
|
|
80
|
+
## Development
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
python3 -m unittest discover -s tests -v
|
|
84
|
+
```
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# `ring0-sdk` (Python)
|
|
2
|
+
|
|
3
|
+
Zero-dependency typed Python 3.10+ SDK for the [`ring0.run`](https://ring0.run) bare-metal Linux microVM Control Plane API (`/api/v1`). Built exclusively on the Python standard library (`urllib.request`, `dataclasses`, `json`, `base64`) with typed response models and structured `Ring0Error` exceptions.
|
|
4
|
+
|
|
5
|
+
## Using with AI Agents
|
|
6
|
+
|
|
7
|
+
If you are using an AI coding agent with this repository, point it to [`AGENTS.md`](./AGENTS.md) and the live platform reference rather than relying on static README lists:
|
|
8
|
+
|
|
9
|
+
- Concise index: [`https://ring0.run/llms.txt`](https://ring0.run/llms.txt)
|
|
10
|
+
- Full platform reference: [`https://ring0.run/llms-full.txt`](https://ring0.run/llms-full.txt)
|
|
11
|
+
- Interactive docs: [`https://ring0.run/docs`](https://ring0.run/docs)
|
|
12
|
+
|
|
13
|
+
## Highlights
|
|
14
|
+
|
|
15
|
+
- **Zero third-party runtime dependencies:** Runs anywhere Python 3.10+ is available.
|
|
16
|
+
- **Production defaults built in:** Automatically targets `https://api.ring0.run` and `https://on.ring0.run` unless overridden via arguments or `RING0_API_URL` / `RING0_EDGE_URL`.
|
|
17
|
+
- **Typed dataclasses and errors:** All payloads deserialize into typed `dataclass` models, and non-2xx responses raise `Ring0Error` with HTTP `status` and API error `code`.
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install ring0-sdk
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
26
|
+
|
|
27
|
+
Set `RING0_API_KEY` in your environment:
|
|
28
|
+
|
|
29
|
+
```python
|
|
30
|
+
import os
|
|
31
|
+
from ring0_sdk import CredentialRule, NetworkPolicy, Ring0Client
|
|
32
|
+
|
|
33
|
+
client = Ring0Client(api_key=os.environ["RING0_API_KEY"])
|
|
34
|
+
|
|
35
|
+
sbx = client.create_sandbox(
|
|
36
|
+
name="py-agent",
|
|
37
|
+
size="default",
|
|
38
|
+
network_policy=NetworkPolicy(
|
|
39
|
+
outbound="allow",
|
|
40
|
+
allow_domains=["api.openai.com"],
|
|
41
|
+
credentials=[
|
|
42
|
+
CredentialRule(
|
|
43
|
+
domain="api.openai.com",
|
|
44
|
+
header_name="Authorization",
|
|
45
|
+
placeholder="Bearer_DUMMY",
|
|
46
|
+
secret_ref="secret:OPENAI_API_KEY",
|
|
47
|
+
)
|
|
48
|
+
],
|
|
49
|
+
),
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
res = client.exec(sbx.id, "python3 --version")
|
|
53
|
+
print(res.stdout)
|
|
54
|
+
|
|
55
|
+
client.hibernate_sandbox(sbx.id)
|
|
56
|
+
print("Wake-on-HTTP preview:", client.preview_url(sbx.id, 3000))
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
For the full `/api/v1` method and endpoint reference (lifecycle, file I/O, Safe YOLO egress policies, approvals, secrets vault, virtual desktop, snapshots, schedules, and audit logs), see [`https://ring0.run/docs`](https://ring0.run/docs) and [`https://ring0.run/llms.txt`](https://ring0.run/llms.txt).
|
|
60
|
+
|
|
61
|
+
## Sizing Tiers
|
|
62
|
+
|
|
63
|
+
Supported sizing tiers are `micro`, `small`, `default`, `large`, and `xlarge`. See [`ring0.run`](https://ring0.run) for hardware specs and current pricing.
|
|
64
|
+
|
|
65
|
+
## Development
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
python3 -m unittest discover -s tests -v
|
|
69
|
+
```
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "ring0-sdk"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Zero-dependency typed Python 3.10+ SDK for the ring0.run microVM Control Plane API."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [{ name = "ring0.run" }]
|
|
13
|
+
keywords = ["ring0", "sandbox", "microvm", "ai-agents", "bare-metal", "sdk"]
|
|
14
|
+
dependencies = []
|
|
15
|
+
|
|
16
|
+
[project.urls]
|
|
17
|
+
Homepage = "https://ring0.run"
|
|
18
|
+
Repository = "https://github.com/ring0run/sdk-python"
|
|
19
|
+
Documentation = "https://ring0.run/docs"
|
|
20
|
+
|
|
21
|
+
[tool.setuptools.packages.find]
|
|
22
|
+
include = ["ring0_sdk*"]
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"""ring0-sdk: Zero-dependency typed Python 3.10+ SDK for ring0.run."""
|
|
2
|
+
|
|
3
|
+
from .client import DEFAULT_API_URL, DEFAULT_EDGE_URL, Ring0Client, Ring0Error
|
|
4
|
+
from .models import (
|
|
5
|
+
ApprovalRule,
|
|
6
|
+
AuditLogRecord,
|
|
7
|
+
BalanceSummary,
|
|
8
|
+
BudgetRule,
|
|
9
|
+
ConsoleBillingSummary,
|
|
10
|
+
ConsoleOverview,
|
|
11
|
+
CredentialRule,
|
|
12
|
+
DesktopInputResult,
|
|
13
|
+
DesktopStartResult,
|
|
14
|
+
DesktopStopResult,
|
|
15
|
+
EnvironmentView,
|
|
16
|
+
ExecResult,
|
|
17
|
+
HealthStatus,
|
|
18
|
+
HibernateResult,
|
|
19
|
+
LedgerEntry,
|
|
20
|
+
NetworkPolicy,
|
|
21
|
+
NetworkPolicyResult,
|
|
22
|
+
NodeInfo,
|
|
23
|
+
PendingApproval,
|
|
24
|
+
ReadFileResult,
|
|
25
|
+
ResolveApprovalResult,
|
|
26
|
+
Sandbox,
|
|
27
|
+
SandboxUsage,
|
|
28
|
+
Schedule,
|
|
29
|
+
ScreenshotResult,
|
|
30
|
+
SecretView,
|
|
31
|
+
Snapshot,
|
|
32
|
+
SshKeyView,
|
|
33
|
+
StopResult,
|
|
34
|
+
WakeResult,
|
|
35
|
+
WebhookTestResult,
|
|
36
|
+
WriteFileResult,
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
__all__ = [
|
|
40
|
+
"ApprovalRule",
|
|
41
|
+
"AuditLogRecord",
|
|
42
|
+
"BalanceSummary",
|
|
43
|
+
"BudgetRule",
|
|
44
|
+
"ConsoleBillingSummary",
|
|
45
|
+
"ConsoleOverview",
|
|
46
|
+
"CredentialRule",
|
|
47
|
+
"DEFAULT_API_URL",
|
|
48
|
+
"DEFAULT_EDGE_URL",
|
|
49
|
+
"DesktopInputResult",
|
|
50
|
+
"DesktopStartResult",
|
|
51
|
+
"DesktopStopResult",
|
|
52
|
+
"EnvironmentView",
|
|
53
|
+
"ExecResult",
|
|
54
|
+
"HealthStatus",
|
|
55
|
+
"HibernateResult",
|
|
56
|
+
"LedgerEntry",
|
|
57
|
+
"NetworkPolicy",
|
|
58
|
+
"NetworkPolicyResult",
|
|
59
|
+
"NodeInfo",
|
|
60
|
+
"PendingApproval",
|
|
61
|
+
"ReadFileResult",
|
|
62
|
+
"ResolveApprovalResult",
|
|
63
|
+
"Ring0Client",
|
|
64
|
+
"Ring0Error",
|
|
65
|
+
"Sandbox",
|
|
66
|
+
"SandboxUsage",
|
|
67
|
+
"Schedule",
|
|
68
|
+
"ScreenshotResult",
|
|
69
|
+
"SecretView",
|
|
70
|
+
"Snapshot",
|
|
71
|
+
"SshKeyView",
|
|
72
|
+
"StopResult",
|
|
73
|
+
"WakeResult",
|
|
74
|
+
"WebhookTestResult",
|
|
75
|
+
"WriteFileResult",
|
|
76
|
+
]
|