@cofy-x/axern-sdk 0.5.1 → 0.7.0

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.
Files changed (62) hide show
  1. package/README.md +39 -52
  2. package/dist/client/index.d.ts +12 -11
  3. package/dist/client/index.js +64 -65
  4. package/dist/config/index.d.ts +0 -1
  5. package/dist/config/index.js +2 -4
  6. package/dist/generated/proto.js +0 -1
  7. package/dist/index.d.ts +6 -5
  8. package/dist/index.js +2 -2
  9. package/dist/network-policy.d.ts +41 -0
  10. package/dist/network-policy.js +132 -0
  11. package/dist/node/attached_process.d.ts +1 -2
  12. package/dist/node/attached_process.js +12 -26
  13. package/dist/node/client.d.ts +4 -6
  14. package/dist/node/client.js +2 -9
  15. package/dist/node/exec.d.ts +1 -3
  16. package/dist/node/exec.js +0 -43
  17. package/dist/proto/axern/control/admin/v1/access.proto +12 -5
  18. package/dist/proto/axern/control/admin/v1/audit.proto +14 -16
  19. package/dist/proto/axern/control/admin/v1/node.proto +23 -67
  20. package/dist/proto/axern/control/admin/v1/reliability.proto +11 -78
  21. package/dist/proto/axern/control/capability/v1/capability.proto +35 -90
  22. package/dist/proto/axern/control/common/v1/common.proto +72 -102
  23. package/dist/proto/axern/control/environment/v1/environment.proto +42 -26
  24. package/dist/proto/axern/control/gateway/v1/gateway.proto +18 -59
  25. package/dist/proto/axern/control/identity/v1/identity.proto +1 -1
  26. package/dist/proto/axern/control/namespace/v1/namespace.proto +2 -3
  27. package/dist/proto/axern/control/quota/v1/quota.proto +22 -32
  28. package/dist/proto/axern/control/run/v1/run.proto +26 -22
  29. package/dist/proto/axern/control/secret/v1/secret.proto +1 -3
  30. package/dist/proto/axern/control/tunnel/v1/tunnel.proto +18 -25
  31. package/dist/proto/axern/node/sandbox/v1/node.proto +59 -375
  32. package/dist/sandbox/index.d.ts +5 -9
  33. package/dist/sandbox/index.js +14 -22
  34. package/dist/sandbox/lifecycle.d.ts +1 -1
  35. package/dist/sandbox/lifecycle.js +55 -17
  36. package/dist/tunnel/connector.js +1 -1
  37. package/dist/tunnel/control.d.ts +0 -1
  38. package/dist/tunnel/control.js +0 -1
  39. package/dist/tunnel/runtime.d.ts +0 -1
  40. package/dist/tunnel/runtime.js +0 -1
  41. package/dist/tunnel/types.d.ts +0 -1
  42. package/dist/types.d.ts +4 -21
  43. package/dist/types.js +1 -3
  44. package/dist/version.d.ts +1 -1
  45. package/dist/version.js +1 -1
  46. package/package.json +1 -1
  47. package/dist/proto/axern/control/admin/v1/allocation_lifecycle.proto +0 -91
  48. package/dist/proto/axern/control/admin/v1/service.proto +0 -18
  49. package/dist/proto/axern/control/admin/v1/storage.proto +0 -81
  50. package/dist/proto/axern/control/agentprofile/v1/agent_profile.proto +0 -169
  51. package/dist/proto/axern/control/catalog/v1/catalog.proto +0 -127
  52. package/dist/proto/axern/control/function/v1/function.proto +0 -130
  53. package/dist/proto/axern/control/function/v1/function_types.proto +0 -233
  54. package/dist/proto/axern/control/node/v1/node_control.proto +0 -443
  55. package/dist/proto/axern/control/rollout/v1/rollout.proto +0 -344
  56. package/dist/proto/axern/control/service/v1/service.proto +0 -96
  57. package/dist/proto/axern/control/service/v1/service_event.proto +0 -47
  58. package/dist/proto/axern/control/service/v1/service_replica.proto +0 -78
  59. package/dist/proto/axern/control/service/v1/service_types.proto +0 -155
  60. package/dist/proto/axern/control/storage/v1/storage.proto +0 -107
  61. package/dist/proto/axern/control/storage/v1/storage_types.proto +0 -125
  62. package/dist/proto/axern/data/artifact/v1/artifact.proto +0 -19
@@ -6,13 +6,13 @@
6
6
  import { SandboxStateError } from "../errors/index.js";
7
7
  import { startTunnelRuntime, tunnelMetadata } from "../tunnel/runtime.js";
8
8
  import { directoryArchiveChunks, extractDirectoryArchive } from "./archive.js";
9
- import { defaultSandboxArgv, sandboxLabels, sandboxMetadata, validateSandboxOptions, waitReadyReplica } from "./lifecycle.js";
9
+ import { defaultSandboxArgv, sandboxLabels, sandboxMetadata, validateSandboxOptions, waitRunningRun } from "./lifecycle.js";
10
10
  export class Sandbox {
11
11
  client;
12
12
  options;
13
13
  createdEnvironment = false;
14
14
  environmentId = "";
15
- serviceId = "";
15
+ runId = "";
16
16
  currentState;
17
17
  currentMetadata;
18
18
  tunnelRuntime;
@@ -52,15 +52,14 @@ export class Sandbox {
52
52
  this.environmentId = environmentId;
53
53
  this.createdEnvironment = true;
54
54
  }
55
- const service = await this.client.createService({
55
+ const run = await this.client.createRun({
56
56
  namespace: this.options.namespace,
57
57
  environmentId,
58
58
  argv: this.options.argv ?? defaultSandboxArgv,
59
59
  env: this.options.env,
60
60
  cwd: this.options.cwd,
61
- runtimeClass: this.options.runtimeClass,
61
+ networkPolicy: this.options.networkPolicy,
62
62
  extensionCapabilities: this.options.extensionCapabilities,
63
- volumes: this.options.volumes,
64
63
  requestCpu: this.options.requestCpu,
65
64
  requestMemory: this.options.requestMemory,
66
65
  requestEphemeralStorage: this.options.requestEphemeralStorage,
@@ -69,14 +68,13 @@ export class Sandbox {
69
68
  limitEphemeralStorage: this.options.limitEphemeralStorage,
70
69
  labels: sandboxLabels(this.options.labels),
71
70
  });
72
- this.serviceId = String(service.id ?? "");
73
- const replica = await waitReadyReplica(this.serviceId, this.options.readyTimeoutMs ?? 180_000, (serviceId) => this.client.listServiceReplicas(serviceId));
71
+ this.runId = String(run.id ?? "");
72
+ const runningRun = await waitRunningRun(this.runId, this.options.readyTimeoutMs ?? 180_000, (runId, signal) => this.client.watchRun(runId, { signal }));
74
73
  this.currentState = {
75
74
  environmentId,
76
- serviceId: this.serviceId,
77
- allocationId: String(replica.id ?? ""),
78
- nodeId: String(replica.node_id ?? ""),
79
- attempt: Number(replica.attempt ?? 0),
75
+ runId: this.runId,
76
+ allocationId: String(runningRun.allocation_id ?? ""),
77
+ nodeId: String(runningRun.node_id ?? ""),
80
78
  startedAt: new Date(),
81
79
  };
82
80
  this.currentMetadata = sandboxMetadata(this.options, this.currentState);
@@ -100,17 +98,17 @@ export class Sandbox {
100
98
  }
101
99
  }
102
100
  async close() {
103
- const serviceId = this.serviceId;
101
+ const runId = this.runId;
104
102
  const tunnelRuntime = this.tunnelRuntime;
105
- this.serviceId = "";
103
+ this.runId = "";
106
104
  this.tunnelRuntime = undefined;
107
105
  this.currentState = undefined;
108
106
  this.currentMetadata = undefined;
109
107
  if (tunnelRuntime !== undefined) {
110
108
  await tunnelRuntime.stop().catch(() => undefined);
111
109
  }
112
- if (serviceId !== "") {
113
- await this.client.deleteService(serviceId).catch(() => undefined);
110
+ if (runId !== "") {
111
+ await this.client.cancelRun(runId).catch(() => undefined);
114
112
  }
115
113
  if (this.createdEnvironment && this.environmentId !== "") {
116
114
  const environmentId = this.environmentId;
@@ -125,12 +123,6 @@ export class Sandbox {
125
123
  async process(command, options = {}) {
126
124
  return this.nodeClient().process(command, options);
127
125
  }
128
- async execImage(image, command, options = {}) {
129
- return this.nodeClient().execImage(image, command, options);
130
- }
131
- async processImage(image, command, options = {}) {
132
- return this.nodeClient().processImage(image, command, options);
133
- }
134
126
  async capabilityStatus(options = {}) {
135
127
  return this.nodeClient().capabilityStatus(options);
136
128
  }
@@ -202,6 +194,6 @@ export class Sandbox {
202
194
  if (this.currentState === undefined) {
203
195
  throw new SandboxStateError("sandbox is not started");
204
196
  }
205
- return this.client.nodeSandbox(this.currentState.allocationId);
197
+ return this.client.allocation(this.currentState.allocationId);
206
198
  }
207
199
  }
@@ -8,4 +8,4 @@ export declare const defaultSandboxArgv: string[];
8
8
  export declare function validateSandboxOptions(options: SandboxOptions): void;
9
9
  export declare function sandboxLabels(labels: Record<string, string> | undefined): Record<string, string>;
10
10
  export declare function sandboxMetadata(options: SandboxOptions, state: SandboxState): SandboxMetadata;
11
- export declare function waitReadyReplica(serviceId: string, timeoutMs: number, listReplicas: (serviceId: string) => Promise<Record<string, unknown>[]>): Promise<Record<string, unknown>>;
11
+ export declare function waitRunningRun(runId: string, timeoutMs: number, watchRun: (runId: string, signal: AbortSignal) => AsyncIterable<Record<string, unknown>>): Promise<Record<string, unknown>>;
@@ -5,6 +5,12 @@
5
5
  */
6
6
  import { SandboxTimeoutError, SandboxValidationError } from "../errors/index.js";
7
7
  export const defaultSandboxArgv = ["/bin/sh", "-lc", "sleep infinity"];
8
+ const runStatus = {
9
+ running: 3,
10
+ succeeded: 4,
11
+ failed: 5,
12
+ cancelled: 6,
13
+ };
8
14
  export function validateSandboxOptions(options) {
9
15
  const sourceCount = [options.templateId, options.image, options.environmentId].filter((source) => source !== undefined && source !== "").length;
10
16
  if (sourceCount !== 1) {
@@ -21,27 +27,62 @@ export function sandboxMetadata(options, state) {
21
27
  return {
22
28
  ...state,
23
29
  namespace: options.namespace ?? "default",
24
- runtimeClass: options.runtimeClass ?? "",
25
30
  labels: sandboxLabels(options.labels),
26
31
  source: sandboxSource(options),
27
32
  };
28
33
  }
29
- export async function waitReadyReplica(serviceId, timeoutMs, listReplicas) {
34
+ export async function waitRunningRun(runId, timeoutMs, watchRun) {
30
35
  const deadline = Date.now() + timeoutMs;
31
- let lastReplicas = [];
32
- while (Date.now() < deadline) {
33
- lastReplicas = await listReplicas(serviceId);
34
- const candidate = lastReplicas.find((replica) => replica.ready === true &&
35
- replica.ended !== true &&
36
- replica.outdated !== true &&
37
- Number(replica.status ?? 0) === 4);
38
- if (candidate !== undefined) {
39
- return candidate;
36
+ let lastRun;
37
+ const controller = new AbortController();
38
+ const iterator = watchRun(runId, controller.signal)[Symbol.asyncIterator]();
39
+ try {
40
+ for (;;) {
41
+ const remainingMs = deadline - Date.now();
42
+ if (remainingMs <= 0)
43
+ break;
44
+ const result = await nextBeforeDeadline(iterator, remainingMs);
45
+ if (result === undefined || result.done)
46
+ break;
47
+ const run = result.value;
48
+ lastRun = run;
49
+ const status = Number(run.status ?? 0);
50
+ if (status === runStatus.running && String(run.allocation_id ?? "") !== "") {
51
+ return run;
52
+ }
53
+ if (status === runStatus.succeeded || status === runStatus.failed || status === runStatus.cancelled) {
54
+ throw new Error(`run ${runId} became ${String(run.status ?? "")} before its sandbox allocation was running: ${String(run.message ?? "")}`);
55
+ }
40
56
  }
41
- await sleep(2_000);
42
57
  }
43
- const details = lastReplicas.map((replica) => `${String(replica.id ?? "")}:${String(replica.status ?? "")}`).join(", ");
44
- throw new SandboxTimeoutError(`service ${serviceId} did not produce a ready sandbox replica: ${details}`);
58
+ finally {
59
+ controller.abort();
60
+ try {
61
+ const close = iterator.return?.();
62
+ if (close !== undefined)
63
+ void close.catch(() => undefined);
64
+ }
65
+ catch {
66
+ // The readiness result owns the error surface; stream cleanup is best effort.
67
+ }
68
+ }
69
+ const details = lastRun === undefined ? "no state observed" : `${String(lastRun.status ?? "")}: ${String(lastRun.message ?? "")}`;
70
+ throw new SandboxTimeoutError(`run ${runId} did not reach a running sandbox allocation: ${details}`);
71
+ }
72
+ async function nextBeforeDeadline(iterator, timeoutMs) {
73
+ let timer;
74
+ try {
75
+ return await Promise.race([
76
+ iterator.next(),
77
+ new Promise((resolve) => {
78
+ timer = setTimeout(resolve, timeoutMs);
79
+ }),
80
+ ]);
81
+ }
82
+ finally {
83
+ if (timer !== undefined)
84
+ clearTimeout(timer);
85
+ }
45
86
  }
46
87
  function sandboxSource(options) {
47
88
  if (options.templateId !== undefined && options.templateId !== "") {
@@ -52,6 +93,3 @@ function sandboxSource(options) {
52
93
  }
53
94
  return "environment";
54
95
  }
55
- function sleep(ms) {
56
- return new Promise((resolve) => setTimeout(resolve, ms));
57
- }
@@ -26,7 +26,7 @@ export class TunnelConnector {
26
26
  this.config = config;
27
27
  }
28
28
  async start() {
29
- const target = this.config.session.client_edge_target || this.config.session.edge_target;
29
+ const target = this.config.session.client_edge_target;
30
30
  if (target === undefined || target === "") {
31
31
  throw new Error(`tunnel session ${this.config.session.session_id ?? ""} has no relay target`);
32
32
  }
@@ -10,7 +10,6 @@ export declare class TunnelControlClient {
10
10
  constructor(client: grpc.Client);
11
11
  createSession(options: {
12
12
  allocationId: string;
13
- upstream: string;
14
13
  proxyPort: number;
15
14
  ttlSeconds: number;
16
15
  readyTimeoutMs: number;
@@ -16,7 +16,6 @@ export class TunnelControlClient {
16
16
  const response = await unary(this.client, "CreateTunnelSession", {
17
17
  allocation_id: required("allocationId", options.allocationId),
18
18
  remote_port: options.proxyPort,
19
- local_target: required("upstream", options.upstream),
20
19
  ttl: duration(options.ttlSeconds * 1000),
21
20
  wait_ready: true,
22
21
  ready_timeout: duration(options.readyTimeoutMs),
@@ -14,7 +14,6 @@ export interface TunnelConnectorRunner {
14
14
  export interface TunnelControl {
15
15
  createSession(options: {
16
16
  allocationId: string;
17
- upstream: string;
18
17
  proxyPort: number;
19
18
  ttlSeconds: number;
20
19
  readyTimeoutMs: number;
@@ -15,7 +15,6 @@ export async function startTunnelRuntime(options) {
15
15
  const proxyPort = options.tunnel.proxyPort ?? defaultProxyPort;
16
16
  const result = await options.control.createSession({
17
17
  allocationId: options.allocationId,
18
- upstream: options.tunnel.upstream,
19
18
  proxyPort,
20
19
  ttlSeconds,
21
20
  readyTimeoutMs: options.tunnel.readyTimeoutMs ?? defaultReadyTimeoutMs,
@@ -6,7 +6,6 @@
6
6
  export interface TunnelSession {
7
7
  session_id?: string;
8
8
  allocation_id?: string;
9
- edge_target?: string;
10
9
  client_edge_target?: string;
11
10
  bound_addr?: string;
12
11
  remote_port?: number;
package/dist/types.d.ts CHANGED
@@ -24,22 +24,6 @@ export interface ExecResult {
24
24
  stdoutText(encoding?: BufferEncoding): string;
25
25
  stderrText(encoding?: BufferEncoding): string;
26
26
  }
27
- export interface ImageProcessMount {
28
- sandboxPath: string;
29
- targetPath: string;
30
- readonly?: boolean;
31
- options?: readonly string[];
32
- }
33
- export interface VolumeMount {
34
- name: string;
35
- target: string;
36
- readonly?: boolean;
37
- options?: readonly string[];
38
- }
39
- export declare function workspaceMount(path?: string): ImageProcessMount;
40
- export interface ImageExecOptions extends ExecOptions {
41
- mounts?: readonly ImageProcessMount[];
42
- }
43
27
  export type ProcessEvent = {
44
28
  kind: "ready";
45
29
  } | {
@@ -54,9 +38,8 @@ export type ProcessEvent = {
54
38
  message: string;
55
39
  };
56
40
  export interface ProcessOptions extends Omit<ExecOptions, "check"> {
57
- }
58
- export interface ImageProcessOptions extends ProcessOptions {
59
- mounts?: readonly ImageProcessMount[];
41
+ initialCols?: number;
42
+ initialRows?: number;
60
43
  }
61
44
  export interface ProcessResult {
62
45
  exitCode: number;
@@ -134,7 +117,7 @@ export interface TunnelMetadata {
134
117
  upstream: string;
135
118
  proxyPort: number;
136
119
  }
137
- export interface CapabilityDependencyStatus {
120
+ export interface CapabilityProviderDependencyStatus {
138
121
  name: string;
139
122
  available: boolean;
140
123
  reason: string;
@@ -146,7 +129,7 @@ export interface CapabilityProviderStatus {
146
129
  capabilities: string[];
147
130
  backend: string;
148
131
  reason: string;
149
- dependencies: CapabilityDependencyStatus[];
132
+ dependencies: CapabilityProviderDependencyStatus[];
150
133
  }
151
134
  export interface CapabilityProviderSummary {
152
135
  total: number;
package/dist/types.js CHANGED
@@ -3,6 +3,4 @@
3
3
  * Copyright 2026 cofy-x
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- export function workspaceMount(path = "/workspace") {
7
- return { sandboxPath: path, targetPath: path };
8
- }
6
+ export {};
package/dist/version.d.ts CHANGED
@@ -3,5 +3,5 @@
3
3
  * Copyright 2026 cofy-x
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- export declare const AXERN_VERSION = "0.5.1";
6
+ export declare const AXERN_VERSION = "0.7.0";
7
7
  export declare function platformName(): string;
package/dist/version.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Copyright 2026 cofy-x
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- export const AXERN_VERSION = "0.5.1";
6
+ export const AXERN_VERSION = "0.7.0";
7
7
  export function platformName() {
8
8
  return "axern";
9
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cofy-x/axern-sdk",
3
- "version": "0.5.1",
3
+ "version": "0.7.0",
4
4
  "description": "TypeScript SDK for Axern agentic infrastructure and isolated sandboxes",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -1,91 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package axern.control.admin.v1;
4
-
5
- option go_package = "github.com/cofy-x/axern/sdk/go/gen/axern/control/admin/v1;adminv1";
6
-
7
- import "google/protobuf/timestamp.proto";
8
-
9
- enum AllocationLifecycleRetryOwnerType {
10
- ALLOCATION_LIFECYCLE_RETRY_OWNER_TYPE_UNSPECIFIED = 0;
11
- ALLOCATION_LIFECYCLE_RETRY_OWNER_TYPE_RUN = 1;
12
- ALLOCATION_LIFECYCLE_RETRY_OWNER_TYPE_SERVICE = 2;
13
- }
14
-
15
- enum AllocationLifecycleRetryReason {
16
- ALLOCATION_LIFECYCLE_RETRY_REASON_UNSPECIFIED = 0;
17
- ALLOCATION_LIFECYCLE_RETRY_REASON_CREATE = 1;
18
- ALLOCATION_LIFECYCLE_RETRY_REASON_DELETE = 2;
19
- }
20
-
21
- message AllocationLifecycleRetry {
22
- string allocation_id = 1;
23
- string owner_id = 2;
24
- AllocationLifecycleRetryOwnerType owner_type = 3;
25
- string environment_id = 4;
26
- AllocationLifecycleRetryReason reason = 5;
27
- string node_id = 6;
28
- string node_target = 7;
29
- int64 attempt = 8;
30
- int32 reconcile_attempts = 9;
31
- string last_error = 10;
32
- google.protobuf.Timestamp next_run_at = 11;
33
- google.protobuf.Timestamp created_at = 12;
34
- google.protobuf.Timestamp updated_at = 13;
35
- int64 age_seconds = 14;
36
- bool due = 15;
37
- bool clearable = 16;
38
- string clear_blocked_reason = 17;
39
- }
40
-
41
- message AllocationLifecycleRetryFilter {
42
- AllocationLifecycleRetryOwnerType owner_type = 1;
43
- AllocationLifecycleRetryReason reason = 2;
44
- bool due_only = 3;
45
- }
46
-
47
- message ListAllocationLifecycleRetriesRequest {
48
- AllocationLifecycleRetryFilter filter = 1;
49
- int32 limit = 2;
50
- }
51
-
52
- message ListAllocationLifecycleRetriesResponse {
53
- repeated AllocationLifecycleRetry retries = 1;
54
- }
55
-
56
- message ForceAllocationLifecycleRetryRequest {
57
- string allocation_id = 1;
58
- AllocationLifecycleRetryReason reason = 2;
59
- string operator_reason = 3;
60
- }
61
-
62
- message ForceAllocationLifecycleRetryResponse {
63
- AllocationLifecycleRetry retry = 1;
64
- }
65
-
66
- message FailAllocationLifecycleRetryRequest {
67
- string allocation_id = 1;
68
- AllocationLifecycleRetryReason reason = 2;
69
- string operator_reason = 3;
70
- }
71
-
72
- message FailAllocationLifecycleRetryResponse {
73
- AllocationLifecycleRetry failed_retry = 1;
74
- }
75
-
76
- message ClearAllocationLifecycleRetryRequest {
77
- string allocation_id = 1;
78
- AllocationLifecycleRetryReason reason = 2;
79
- string operator_reason = 3;
80
- }
81
-
82
- message ClearAllocationLifecycleRetryResponse {
83
- AllocationLifecycleRetry cleared_retry = 1;
84
- }
85
-
86
- service AllocationLifecycleAdmin {
87
- rpc ListAllocationLifecycleRetries(ListAllocationLifecycleRetriesRequest) returns (ListAllocationLifecycleRetriesResponse) {}
88
- rpc ForceAllocationLifecycleRetry(ForceAllocationLifecycleRetryRequest) returns (ForceAllocationLifecycleRetryResponse) {}
89
- rpc FailAllocationLifecycleRetry(FailAllocationLifecycleRetryRequest) returns (FailAllocationLifecycleRetryResponse) {}
90
- rpc ClearAllocationLifecycleRetry(ClearAllocationLifecycleRetryRequest) returns (ClearAllocationLifecycleRetryResponse) {}
91
- }
@@ -1,18 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package axern.control.admin.v1;
4
-
5
- option go_package = "github.com/cofy-x/axern/sdk/go/gen/axern/control/admin/v1;adminv1";
6
-
7
- message PurgeServiceRequest {
8
- string service_id = 1;
9
- string operator_reason = 2;
10
- }
11
-
12
- message PurgeServiceResponse {
13
- string service_id = 1;
14
- }
15
-
16
- service ServiceAdmin {
17
- rpc PurgeService(PurgeServiceRequest) returns (PurgeServiceResponse) {}
18
- }
@@ -1,81 +0,0 @@
1
- syntax = "proto3";
2
-
3
- package axern.control.admin.v1;
4
-
5
- option go_package = "github.com/cofy-x/axern/sdk/go/gen/axern/control/admin/v1;adminv1";
6
-
7
- import "axern/control/storage/v1/storage_types.proto";
8
- import "google/protobuf/timestamp.proto";
9
-
10
- message StorageBinding {
11
- string binding_id = 1;
12
- string claim_id = 2;
13
- string namespace = 3;
14
- string claim_name = 4;
15
- string workload_id = 5;
16
- string workload_type = 6;
17
- string allocation_id = 7;
18
- string node_id = 8;
19
- axern.control.storage.v1.VolumeStatus status = 9;
20
- string message = 10;
21
- google.protobuf.Timestamp created_at = 11;
22
- google.protobuf.Timestamp updated_at = 12;
23
- google.protobuf.Timestamp published_at = 13;
24
- google.protobuf.Timestamp released_at = 14;
25
- }
26
-
27
- message StorageBindingFilter {
28
- repeated axern.control.storage.v1.VolumeStatus statuses = 1;
29
- string namespace = 2;
30
- string claim_name = 3;
31
- string workload_id = 4;
32
- string allocation_id = 5;
33
- string node_id = 6;
34
- }
35
-
36
- message ListStorageBindingsRequest {
37
- StorageBindingFilter filter = 1;
38
- int32 limit = 2;
39
- }
40
-
41
- message ListStorageBindingsResponse {
42
- repeated StorageBinding bindings = 1;
43
- }
44
-
45
- message RetryStorageBindingRequest {
46
- string binding_id = 1;
47
- string operator_reason = 2;
48
- }
49
-
50
- message RetryStorageBindingResponse {
51
- StorageBinding binding = 1;
52
- }
53
-
54
- message StorageReclaim {
55
- string claim_id = 1;
56
- string namespace = 2;
57
- string claim_name = 3;
58
- string service_id = 4;
59
- string node_id = 5;
60
- int64 attempt = 6;
61
- google.protobuf.Timestamp next_retry_at = 7;
62
- string last_error = 8;
63
- google.protobuf.Timestamp updated_at = 9;
64
- }
65
-
66
- message ListStorageReclaimsRequest {
67
- string namespace = 1;
68
- string service_id = 2;
69
- string node_id = 3;
70
- int32 limit = 4;
71
- }
72
-
73
- message ListStorageReclaimsResponse {
74
- repeated StorageReclaim reclaims = 1;
75
- }
76
-
77
- service StorageAdmin {
78
- rpc ListStorageBindings(ListStorageBindingsRequest) returns (ListStorageBindingsResponse) {}
79
- rpc RetryStorageBinding(RetryStorageBindingRequest) returns (RetryStorageBindingResponse) {}
80
- rpc ListStorageReclaims(ListStorageReclaimsRequest) returns (ListStorageReclaimsResponse) {}
81
- }