@cofy-x/axern-sdk 0.2.0-bootstrap.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.
- package/README.md +169 -0
- package/dist/client/index.d.ts +63 -0
- package/dist/client/index.js +213 -0
- package/dist/config/index.d.ts +15 -0
- package/dist/config/index.js +65 -0
- package/dist/errors/index.d.ts +46 -0
- package/dist/errors/index.js +123 -0
- package/dist/generated/proto.d.ts +10 -0
- package/dist/generated/proto.js +80 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +13 -0
- package/dist/node/archive.d.ts +9 -0
- package/dist/node/archive.js +41 -0
- package/dist/node/attached_process.d.ts +10 -0
- package/dist/node/attached_process.js +60 -0
- package/dist/node/capabilities.d.ts +8 -0
- package/dist/node/capabilities.js +51 -0
- package/dist/node/client.d.ts +44 -0
- package/dist/node/client.js +96 -0
- package/dist/node/computer_use.d.ts +12 -0
- package/dist/node/computer_use.js +81 -0
- package/dist/node/context.d.ts +22 -0
- package/dist/node/context.js +37 -0
- package/dist/node/exec.d.ts +12 -0
- package/dist/node/exec.js +93 -0
- package/dist/node/files.d.ts +18 -0
- package/dist/node/files.js +101 -0
- package/dist/node/process.d.ts +36 -0
- package/dist/node/process.js +144 -0
- package/dist/node/streams.d.ts +8 -0
- package/dist/node/streams.js +70 -0
- package/dist/proto/axern/common/file/v1/file.proto +31 -0
- package/dist/proto/axern/control/admin/v1/allocation_lifecycle.proto +91 -0
- package/dist/proto/axern/control/admin/v1/audit.proto +53 -0
- package/dist/proto/axern/control/admin/v1/node.proto +49 -0
- package/dist/proto/axern/control/admin/v1/reliability.proto +184 -0
- package/dist/proto/axern/control/admin/v1/service.proto +18 -0
- package/dist/proto/axern/control/admin/v1/storage.proto +81 -0
- package/dist/proto/axern/control/agentprofile/v1/agent_profile.proto +169 -0
- package/dist/proto/axern/control/catalog/v1/catalog.proto +127 -0
- package/dist/proto/axern/control/common/v1/common.proto +171 -0
- package/dist/proto/axern/control/environment/v1/environment.proto +94 -0
- package/dist/proto/axern/control/function/v1/function.proto +130 -0
- package/dist/proto/axern/control/function/v1/function_types.proto +233 -0
- package/dist/proto/axern/control/gateway/v1/gateway.proto +60 -0
- package/dist/proto/axern/control/namespace/v1/namespace.proto +52 -0
- package/dist/proto/axern/control/node/v1/node_control.proto +302 -0
- package/dist/proto/axern/control/quota/v1/quota.proto +113 -0
- package/dist/proto/axern/control/rollout/v1/rollout.proto +344 -0
- package/dist/proto/axern/control/run/v1/run.proto +88 -0
- package/dist/proto/axern/control/secret/v1/secret.proto +75 -0
- package/dist/proto/axern/control/service/v1/service.proto +96 -0
- package/dist/proto/axern/control/service/v1/service_event.proto +47 -0
- package/dist/proto/axern/control/service/v1/service_replica.proto +74 -0
- package/dist/proto/axern/control/service/v1/service_types.proto +155 -0
- package/dist/proto/axern/control/storage/v1/storage.proto +107 -0
- package/dist/proto/axern/control/storage/v1/storage_types.proto +125 -0
- package/dist/proto/axern/control/tunnel/v1/tunnel.proto +195 -0
- package/dist/proto/axern/data/artifact/v1/artifact.proto +19 -0
- package/dist/proto/axern/node/sandbox/v1/node.proto +652 -0
- package/dist/proto/axern/tunnel/v1/tunnel.proto +50 -0
- package/dist/resources.d.ts +13 -0
- package/dist/resources.js +107 -0
- package/dist/sandbox/archive.d.ts +8 -0
- package/dist/sandbox/archive.js +228 -0
- package/dist/sandbox/index.d.ts +86 -0
- package/dist/sandbox/index.js +204 -0
- package/dist/sandbox/lifecycle.d.ts +11 -0
- package/dist/sandbox/lifecycle.js +57 -0
- package/dist/tunnel/connector.d.ts +34 -0
- package/dist/tunnel/connector.js +141 -0
- package/dist/tunnel/control.d.ts +22 -0
- package/dist/tunnel/control.js +91 -0
- package/dist/tunnel/debug.d.ts +6 -0
- package/dist/tunnel/debug.js +19 -0
- package/dist/tunnel/relay.d.ts +17 -0
- package/dist/tunnel/relay.js +41 -0
- package/dist/tunnel/runtime.d.ts +34 -0
- package/dist/tunnel/runtime.js +118 -0
- package/dist/tunnel/session.d.ts +25 -0
- package/dist/tunnel/session.js +95 -0
- package/dist/tunnel/target.d.ts +7 -0
- package/dist/tunnel/target.js +28 -0
- package/dist/tunnel/types.d.ts +25 -0
- package/dist/tunnel/types.js +6 -0
- package/dist/types.d.ts +219 -0
- package/dist/types.js +8 -0
- package/dist/validation.d.ts +10 -0
- package/dist/validation.js +37 -0
- package/dist/version.d.ts +7 -0
- package/dist/version.js +9 -0
- package/package.json +57 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package axern.control.common.v1;
|
|
4
|
+
|
|
5
|
+
option go_package = "github.com/cofy-x/axern/sdk/go/gen/axern/control/common/v1;commonv1";
|
|
6
|
+
|
|
7
|
+
import "google/protobuf/timestamp.proto";
|
|
8
|
+
import "axern/control/storage/v1/storage_types.proto";
|
|
9
|
+
|
|
10
|
+
message ResourceQuantity {
|
|
11
|
+
int64 cpu_milli = 1;
|
|
12
|
+
int64 memory_bytes = 2;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
message ResourceSpec {
|
|
16
|
+
ResourceQuantity requests = 1;
|
|
17
|
+
ResourceQuantity limits = 2;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
enum PortProtocol {
|
|
21
|
+
PORT_PROTOCOL_UNSPECIFIED = 0;
|
|
22
|
+
PORT_PROTOCOL_TCP = 1;
|
|
23
|
+
PORT_PROTOCOL_UDP = 2;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
message PortSpec {
|
|
27
|
+
string name = 1;
|
|
28
|
+
PortProtocol protocol = 2;
|
|
29
|
+
int32 container_port = 3;
|
|
30
|
+
int32 host_port = 4;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
enum NetworkMode {
|
|
34
|
+
NETWORK_MODE_UNSPECIFIED = 0;
|
|
35
|
+
NETWORK_MODE_DEFAULT = 1;
|
|
36
|
+
NETWORK_MODE_ISOLATED = 2;
|
|
37
|
+
NETWORK_MODE_HOST = 3;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
message NetworkSpec {
|
|
41
|
+
NetworkMode mode = 1;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
message CapabilityRequirement {
|
|
45
|
+
string name = 1;
|
|
46
|
+
string value = 2;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
message PlacementConstraints {
|
|
50
|
+
map<string, string> node_selector = 1;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
message SecretEnvVar {
|
|
54
|
+
string name = 1;
|
|
55
|
+
string secret_id = 2;
|
|
56
|
+
string key = 3;
|
|
57
|
+
bool optional = 4;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
message SecretFile {
|
|
61
|
+
string path = 1;
|
|
62
|
+
string secret_id = 2;
|
|
63
|
+
string key = 3;
|
|
64
|
+
uint32 mode = 4;
|
|
65
|
+
bool optional = 5;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
message ServiceVolumeMount {
|
|
69
|
+
string name = 1;
|
|
70
|
+
string target = 2;
|
|
71
|
+
bool readonly = 3;
|
|
72
|
+
repeated string options = 4;
|
|
73
|
+
axern.control.storage.v1.VolumeReclaimPolicy reclaim_policy = 5;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
message ImageMount {
|
|
77
|
+
string image = 1;
|
|
78
|
+
string target = 2;
|
|
79
|
+
bool readonly = 3;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
message WorkspaceImageVariant {
|
|
83
|
+
string format = 1;
|
|
84
|
+
string image = 2;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
message WorkspaceImageSource {
|
|
88
|
+
repeated WorkspaceImageVariant variants = 1;
|
|
89
|
+
string source_path = 2;
|
|
90
|
+
string target = 3;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// WorkspacePreparationFacts records the node-observed preparation result for
|
|
94
|
+
// one allocation's immutable TaskSet workspace. These facts describe the
|
|
95
|
+
// variant that was actually selected by the node, not the variant preference
|
|
96
|
+
// declared by the client.
|
|
97
|
+
message WorkspacePreparationFacts {
|
|
98
|
+
string payload_format = 1;
|
|
99
|
+
string payload_digest = 2;
|
|
100
|
+
bool cache_hit = 3;
|
|
101
|
+
int64 image_resolve_ms = 4;
|
|
102
|
+
int64 image_pull_ms = 5;
|
|
103
|
+
int64 cow_prepare_ms = 6;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
message ExecutionConfig {
|
|
107
|
+
repeated string argv = 1;
|
|
108
|
+
map<string, string> env = 2;
|
|
109
|
+
string cwd = 3;
|
|
110
|
+
ResourceSpec resources = 4;
|
|
111
|
+
repeated PortSpec ports = 5;
|
|
112
|
+
NetworkSpec network = 6;
|
|
113
|
+
repeated CapabilityRequirement capability_requirements = 7;
|
|
114
|
+
PlacementConstraints placement = 8;
|
|
115
|
+
repeated SecretEnvVar secret_env = 9;
|
|
116
|
+
repeated SecretFile secret_files = 10;
|
|
117
|
+
repeated ServiceVolumeMount volume_mounts = 11;
|
|
118
|
+
string runtime_class = 12;
|
|
119
|
+
repeated ImageMount image_mounts = 13;
|
|
120
|
+
WorkspaceImageSource workspace_image = 14;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
enum AllocationStatus {
|
|
124
|
+
ALLOCATION_STATUS_UNSPECIFIED = 0;
|
|
125
|
+
ALLOCATION_STATUS_RESERVED = 1;
|
|
126
|
+
ALLOCATION_STATUS_BOUND = 2;
|
|
127
|
+
ALLOCATION_STATUS_STARTING = 3;
|
|
128
|
+
ALLOCATION_STATUS_RUNNING = 4;
|
|
129
|
+
ALLOCATION_STATUS_EXITED = 5;
|
|
130
|
+
ALLOCATION_STATUS_FAILED = 6;
|
|
131
|
+
ALLOCATION_STATUS_RELEASING = 7;
|
|
132
|
+
ALLOCATION_STATUS_RELEASED = 8;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
enum WorkloadDiagnosticCode {
|
|
136
|
+
WORKLOAD_DIAGNOSTIC_CODE_UNSPECIFIED = 0;
|
|
137
|
+
WORKLOAD_DIAGNOSTIC_CODE_SECRET_PROJECTION_ERROR = 1;
|
|
138
|
+
WORKLOAD_DIAGNOSTIC_CODE_REGISTRY_AUTH_ERROR = 2;
|
|
139
|
+
WORKLOAD_DIAGNOSTIC_CODE_IMAGE_RESOLUTION_ERROR = 3;
|
|
140
|
+
WORKLOAD_DIAGNOSTIC_CODE_NODE_SELECTION_ERROR = 4;
|
|
141
|
+
WORKLOAD_DIAGNOSTIC_CODE_RUNTIME_START_ERROR = 5;
|
|
142
|
+
WORKLOAD_DIAGNOSTIC_CODE_PROCESS_EXITED = 6;
|
|
143
|
+
WORKLOAD_DIAGNOSTIC_CODE_LIVENESS_PROBE_FAILED = 7;
|
|
144
|
+
WORKLOAD_DIAGNOSTIC_CODE_ADMISSION_BLOCKED = 8;
|
|
145
|
+
WORKLOAD_DIAGNOSTIC_CODE_STORAGE_TOPOLOGY_UNSATISFIED = 9;
|
|
146
|
+
WORKLOAD_DIAGNOSTIC_CODE_STORAGE_RESERVE_ERROR = 10;
|
|
147
|
+
WORKLOAD_DIAGNOSTIC_CODE_VOLUME_PUBLISH_ERROR = 11;
|
|
148
|
+
WORKLOAD_DIAGNOSTIC_CODE_VOLUME_RELEASE_ERROR = 12;
|
|
149
|
+
WORKLOAD_DIAGNOSTIC_CODE_VOLUME_SPEC_CONFLICT = 13;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
enum LeaseType {
|
|
153
|
+
LEASE_TYPE_UNSPECIFIED = 0;
|
|
154
|
+
LEASE_TYPE_RUN = 1;
|
|
155
|
+
LEASE_TYPE_SERVICE = 2;
|
|
156
|
+
LEASE_TYPE_INVOKE = 3;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
message ExecutionLease {
|
|
160
|
+
string lease_id = 1;
|
|
161
|
+
string allocation_id = 2;
|
|
162
|
+
string node_id = 3;
|
|
163
|
+
int64 attempt = 4;
|
|
164
|
+
LeaseType lease_type = 5;
|
|
165
|
+
string plaintext_token = 6;
|
|
166
|
+
int64 revision = 7;
|
|
167
|
+
google.protobuf.Timestamp expires_at = 8;
|
|
168
|
+
bool revoked = 9;
|
|
169
|
+
string node_target = 10;
|
|
170
|
+
string validation_token_hash = 11;
|
|
171
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package axern.control.environment.v1;
|
|
4
|
+
|
|
5
|
+
option go_package = "github.com/cofy-x/axern/sdk/go/gen/axern/control/environment/v1;environmentv1";
|
|
6
|
+
|
|
7
|
+
import "axern/control/catalog/v1/catalog.proto";
|
|
8
|
+
import "google/protobuf/timestamp.proto";
|
|
9
|
+
|
|
10
|
+
message EnvironmentImageSource {
|
|
11
|
+
string ref = 1;
|
|
12
|
+
string digest = 2;
|
|
13
|
+
bool rootfs_readonly = 3;
|
|
14
|
+
string registry_credential_id = 4;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
message EnvironmentSpec {
|
|
18
|
+
string namespace = 1;
|
|
19
|
+
string template_id = 2;
|
|
20
|
+
string template_version = 3;
|
|
21
|
+
EnvironmentImageSource image = 4;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
enum EnvironmentStatus {
|
|
25
|
+
ENVIRONMENT_STATUS_UNSPECIFIED = 0;
|
|
26
|
+
ENVIRONMENT_STATUS_PENDING = 1;
|
|
27
|
+
ENVIRONMENT_STATUS_READY = 2;
|
|
28
|
+
ENVIRONMENT_STATUS_FAILED = 3;
|
|
29
|
+
ENVIRONMENT_STATUS_DELETING = 4;
|
|
30
|
+
ENVIRONMENT_STATUS_DELETED = 5;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
message Environment {
|
|
34
|
+
string id = 1;
|
|
35
|
+
string namespace = 2;
|
|
36
|
+
EnvironmentStatus status = 3;
|
|
37
|
+
EnvironmentSpec spec = 4;
|
|
38
|
+
string spec_hash = 5;
|
|
39
|
+
axern.control.catalog.v1.RuntimeTemplate resolved_template = 6;
|
|
40
|
+
map<string, string> labels = 7;
|
|
41
|
+
int64 version = 8;
|
|
42
|
+
google.protobuf.Timestamp created_at = 9;
|
|
43
|
+
google.protobuf.Timestamp updated_at = 10;
|
|
44
|
+
string message = 11;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
message ListFilter {
|
|
48
|
+
string namespace = 1;
|
|
49
|
+
repeated EnvironmentStatus statuses = 2;
|
|
50
|
+
map<string, string> labels = 3;
|
|
51
|
+
string cursor = 4;
|
|
52
|
+
int32 page_size = 5;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
message CreateEnvironmentRequest {
|
|
56
|
+
EnvironmentSpec spec = 1;
|
|
57
|
+
map<string, string> labels = 2;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
message CreateEnvironmentResponse {
|
|
61
|
+
Environment environment = 1;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
message GetEnvironmentRequest {
|
|
65
|
+
string environment_id = 1;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
message GetEnvironmentResponse {
|
|
69
|
+
Environment environment = 1;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
message ListEnvironmentsRequest {
|
|
73
|
+
ListFilter filter = 1;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
message ListEnvironmentsResponse {
|
|
77
|
+
repeated Environment environments = 1;
|
|
78
|
+
string next_cursor = 2;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
message DeleteEnvironmentRequest {
|
|
82
|
+
string environment_id = 1;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
message DeleteEnvironmentResponse {
|
|
86
|
+
Environment environment = 1;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
service EnvironmentControl {
|
|
90
|
+
rpc CreateEnvironment(CreateEnvironmentRequest) returns (CreateEnvironmentResponse) {}
|
|
91
|
+
rpc GetEnvironment(GetEnvironmentRequest) returns (GetEnvironmentResponse) {}
|
|
92
|
+
rpc ListEnvironments(ListEnvironmentsRequest) returns (ListEnvironmentsResponse) {}
|
|
93
|
+
rpc DeleteEnvironment(DeleteEnvironmentRequest) returns (DeleteEnvironmentResponse) {}
|
|
94
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package axern.control.function.v1;
|
|
4
|
+
|
|
5
|
+
option go_package = "github.com/cofy-x/axern/sdk/go/gen/axern/control/function/v1;functionv1";
|
|
6
|
+
|
|
7
|
+
import "axern/control/function/v1/function_types.proto";
|
|
8
|
+
import "google/protobuf/duration.proto";
|
|
9
|
+
|
|
10
|
+
message UploadFunctionBundleOpen {
|
|
11
|
+
string namespace = 1;
|
|
12
|
+
string name = 2;
|
|
13
|
+
string digest = 3;
|
|
14
|
+
string media_type = 4;
|
|
15
|
+
int64 size_bytes = 5;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
message UploadFunctionBundleRequest {
|
|
19
|
+
oneof request {
|
|
20
|
+
UploadFunctionBundleOpen open = 1;
|
|
21
|
+
bytes chunk = 2;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
message UploadFunctionBundleResponse {
|
|
26
|
+
FunctionBundleSource bundle = 1;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
message DeployFunctionRequest {
|
|
30
|
+
string namespace = 1;
|
|
31
|
+
string name = 2;
|
|
32
|
+
FunctionSpec spec = 3;
|
|
33
|
+
FunctionSource source = 4;
|
|
34
|
+
map<string, string> labels = 5;
|
|
35
|
+
bool wait_ready = 6;
|
|
36
|
+
google.protobuf.Duration ready_timeout = 7;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
message DeployFunctionResponse {
|
|
40
|
+
Function function = 1;
|
|
41
|
+
FunctionRevision revision = 2;
|
|
42
|
+
FunctionDeployment deployment = 3;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
message GetFunctionRequest {
|
|
46
|
+
string function_id = 1;
|
|
47
|
+
string namespace = 2;
|
|
48
|
+
string name = 3;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
message GetFunctionResponse {
|
|
52
|
+
Function function = 1;
|
|
53
|
+
FunctionRevision active_revision = 2;
|
|
54
|
+
FunctionDeployment deployment = 3;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
message ListFunctionsRequest {
|
|
58
|
+
FunctionListFilter filter = 1;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
message ListFunctionsResponse {
|
|
62
|
+
repeated Function functions = 1;
|
|
63
|
+
string next_cursor = 2;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
message DeleteFunctionRequest {
|
|
67
|
+
string function_id = 1;
|
|
68
|
+
string namespace = 2;
|
|
69
|
+
string name = 3;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
message DeleteFunctionResponse {
|
|
73
|
+
Function function = 1;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
message InvokeFunctionRequest {
|
|
77
|
+
string namespace = 1;
|
|
78
|
+
string name = 2;
|
|
79
|
+
string function_id = 3;
|
|
80
|
+
string revision_id = 4;
|
|
81
|
+
FunctionInvocationMode mode = 5;
|
|
82
|
+
FunctionPayload payload = 6;
|
|
83
|
+
google.protobuf.Duration timeout = 7;
|
|
84
|
+
string request_id = 8;
|
|
85
|
+
map<string, string> labels = 9;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
message InvokeFunctionResponse {
|
|
89
|
+
FunctionInvocation invocation = 1;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
message GetFunctionInvocationRequest {
|
|
93
|
+
string invocation_id = 1;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
message GetFunctionInvocationResponse {
|
|
97
|
+
FunctionInvocation invocation = 1;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
message ListFunctionInvocationsRequest {
|
|
101
|
+
FunctionInvocationListFilter filter = 1;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
message ListFunctionInvocationsResponse {
|
|
105
|
+
repeated FunctionInvocation invocations = 1;
|
|
106
|
+
string next_cursor = 2;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
message ListFunctionEventsRequest {
|
|
110
|
+
string function_id = 1;
|
|
111
|
+
string invocation_id = 2;
|
|
112
|
+
string revision_id = 3;
|
|
113
|
+
int32 limit = 4;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
message ListFunctionEventsResponse {
|
|
117
|
+
repeated FunctionEvent events = 1;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
service FunctionControl {
|
|
121
|
+
rpc UploadFunctionBundle(stream UploadFunctionBundleRequest) returns (UploadFunctionBundleResponse) {}
|
|
122
|
+
rpc DeployFunction(DeployFunctionRequest) returns (DeployFunctionResponse) {}
|
|
123
|
+
rpc GetFunction(GetFunctionRequest) returns (GetFunctionResponse) {}
|
|
124
|
+
rpc ListFunctions(ListFunctionsRequest) returns (ListFunctionsResponse) {}
|
|
125
|
+
rpc DeleteFunction(DeleteFunctionRequest) returns (DeleteFunctionResponse) {}
|
|
126
|
+
rpc InvokeFunction(InvokeFunctionRequest) returns (InvokeFunctionResponse) {}
|
|
127
|
+
rpc GetFunctionInvocation(GetFunctionInvocationRequest) returns (GetFunctionInvocationResponse) {}
|
|
128
|
+
rpc ListFunctionInvocations(ListFunctionInvocationsRequest) returns (ListFunctionInvocationsResponse) {}
|
|
129
|
+
rpc ListFunctionEvents(ListFunctionEventsRequest) returns (ListFunctionEventsResponse) {}
|
|
130
|
+
}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package axern.control.function.v1;
|
|
4
|
+
|
|
5
|
+
option go_package = "github.com/cofy-x/axern/sdk/go/gen/axern/control/function/v1;functionv1";
|
|
6
|
+
|
|
7
|
+
import "axern/control/common/v1/common.proto";
|
|
8
|
+
import "axern/control/environment/v1/environment.proto";
|
|
9
|
+
import "google/protobuf/duration.proto";
|
|
10
|
+
import "google/protobuf/timestamp.proto";
|
|
11
|
+
|
|
12
|
+
enum FunctionStatus {
|
|
13
|
+
FUNCTION_STATUS_UNSPECIFIED = 0;
|
|
14
|
+
FUNCTION_STATUS_DEPLOYING = 1;
|
|
15
|
+
FUNCTION_STATUS_READY = 2;
|
|
16
|
+
FUNCTION_STATUS_DEGRADED = 3;
|
|
17
|
+
FUNCTION_STATUS_FAILED = 4;
|
|
18
|
+
FUNCTION_STATUS_DELETING = 5;
|
|
19
|
+
FUNCTION_STATUS_DELETED = 6;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
enum FunctionDeploymentStatus {
|
|
23
|
+
FUNCTION_DEPLOYMENT_STATUS_UNSPECIFIED = 0;
|
|
24
|
+
FUNCTION_DEPLOYMENT_STATUS_PENDING = 1;
|
|
25
|
+
FUNCTION_DEPLOYMENT_STATUS_WARMING = 2;
|
|
26
|
+
FUNCTION_DEPLOYMENT_STATUS_READY = 3;
|
|
27
|
+
FUNCTION_DEPLOYMENT_STATUS_SCALED_TO_ZERO = 4;
|
|
28
|
+
FUNCTION_DEPLOYMENT_STATUS_DEGRADED = 5;
|
|
29
|
+
FUNCTION_DEPLOYMENT_STATUS_FAILED = 6;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
enum FunctionInvocationStatus {
|
|
33
|
+
FUNCTION_INVOCATION_STATUS_UNSPECIFIED = 0;
|
|
34
|
+
FUNCTION_INVOCATION_STATUS_ACCEPTED = 1;
|
|
35
|
+
FUNCTION_INVOCATION_STATUS_QUEUED = 2;
|
|
36
|
+
FUNCTION_INVOCATION_STATUS_RUNNING = 3;
|
|
37
|
+
FUNCTION_INVOCATION_STATUS_SUCCEEDED = 4;
|
|
38
|
+
FUNCTION_INVOCATION_STATUS_FAILED = 5;
|
|
39
|
+
FUNCTION_INVOCATION_STATUS_CANCELLED = 6;
|
|
40
|
+
FUNCTION_INVOCATION_STATUS_TIMED_OUT = 7;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
enum FunctionInvocationMode {
|
|
44
|
+
FUNCTION_INVOCATION_MODE_UNSPECIFIED = 0;
|
|
45
|
+
FUNCTION_INVOCATION_MODE_SYNC = 1;
|
|
46
|
+
FUNCTION_INVOCATION_MODE_ASYNC = 2;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
enum FunctionEventType {
|
|
50
|
+
FUNCTION_EVENT_TYPE_UNSPECIFIED = 0;
|
|
51
|
+
FUNCTION_EVENT_TYPE_DEPLOY_STARTED = 1;
|
|
52
|
+
FUNCTION_EVENT_TYPE_REVISION_CREATED = 2;
|
|
53
|
+
FUNCTION_EVENT_TYPE_REVISION_ACTIVATED = 3;
|
|
54
|
+
FUNCTION_EVENT_TYPE_WARM_POOL_READY = 4;
|
|
55
|
+
FUNCTION_EVENT_TYPE_INVOCATION_STARTED = 5;
|
|
56
|
+
FUNCTION_EVENT_TYPE_INVOCATION_SUCCEEDED = 6;
|
|
57
|
+
FUNCTION_EVENT_TYPE_INVOCATION_FAILED = 7;
|
|
58
|
+
FUNCTION_EVENT_TYPE_SCALING_DECISION = 8;
|
|
59
|
+
FUNCTION_EVENT_TYPE_CLEANUP = 9;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
message Function {
|
|
63
|
+
string id = 1;
|
|
64
|
+
string namespace = 2;
|
|
65
|
+
string name = 3;
|
|
66
|
+
string active_revision_id = 4;
|
|
67
|
+
FunctionSpec spec = 5;
|
|
68
|
+
FunctionStatus status = 6;
|
|
69
|
+
FunctionDeploymentStatus deployment_status = 7;
|
|
70
|
+
map<string, string> labels = 8;
|
|
71
|
+
int64 version = 9;
|
|
72
|
+
google.protobuf.Timestamp created_at = 10;
|
|
73
|
+
google.protobuf.Timestamp updated_at = 11;
|
|
74
|
+
string message = 12;
|
|
75
|
+
axern.control.common.v1.WorkloadDiagnosticCode diagnostic_code = 13;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
message FunctionRevision {
|
|
79
|
+
string id = 1;
|
|
80
|
+
string function_id = 2;
|
|
81
|
+
string namespace = 3;
|
|
82
|
+
string name = 4;
|
|
83
|
+
int64 revision_number = 5;
|
|
84
|
+
FunctionSpec spec = 6;
|
|
85
|
+
FunctionSource source = 7;
|
|
86
|
+
string source_digest = 8;
|
|
87
|
+
string manifest_digest = 9;
|
|
88
|
+
map<string, string> labels = 10;
|
|
89
|
+
google.protobuf.Timestamp created_at = 11;
|
|
90
|
+
string created_by = 12;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
message FunctionDeployment {
|
|
94
|
+
string function_id = 1;
|
|
95
|
+
string active_revision_id = 2;
|
|
96
|
+
FunctionDeploymentStatus status = 3;
|
|
97
|
+
FunctionScalingSpec scaling = 4;
|
|
98
|
+
int32 desired_replicas = 5;
|
|
99
|
+
int32 ready_replicas = 6;
|
|
100
|
+
int32 active_invocations = 7;
|
|
101
|
+
google.protobuf.Timestamp updated_at = 8;
|
|
102
|
+
string message = 9;
|
|
103
|
+
axern.control.common.v1.WorkloadDiagnosticCode diagnostic_code = 10;
|
|
104
|
+
string worker_service_id = 11;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
message FunctionInvocation {
|
|
108
|
+
string id = 1;
|
|
109
|
+
string function_id = 2;
|
|
110
|
+
string function_name = 3;
|
|
111
|
+
string namespace = 4;
|
|
112
|
+
string revision_id = 5;
|
|
113
|
+
FunctionInvocationStatus status = 6;
|
|
114
|
+
FunctionInvocationMode mode = 7;
|
|
115
|
+
FunctionPayload payload = 8;
|
|
116
|
+
FunctionResult result = 9;
|
|
117
|
+
FunctionError error = 10;
|
|
118
|
+
google.protobuf.Duration timeout = 11;
|
|
119
|
+
google.protobuf.Duration duration = 12;
|
|
120
|
+
string request_id = 13;
|
|
121
|
+
map<string, string> labels = 14;
|
|
122
|
+
google.protobuf.Timestamp created_at = 15;
|
|
123
|
+
google.protobuf.Timestamp started_at = 16;
|
|
124
|
+
google.protobuf.Timestamp completed_at = 17;
|
|
125
|
+
string message = 18;
|
|
126
|
+
axern.control.common.v1.WorkloadDiagnosticCode diagnostic_code = 19;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
message FunctionEvent {
|
|
130
|
+
string id = 1;
|
|
131
|
+
string function_id = 2;
|
|
132
|
+
string invocation_id = 3;
|
|
133
|
+
string revision_id = 4;
|
|
134
|
+
FunctionEventType type = 5;
|
|
135
|
+
string message = 6;
|
|
136
|
+
map<string, string> details = 7;
|
|
137
|
+
google.protobuf.Timestamp created_at = 8;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
message FunctionSpec {
|
|
141
|
+
string runtime = 1;
|
|
142
|
+
string handler = 2;
|
|
143
|
+
string initializer = 3;
|
|
144
|
+
FunctionSourceSpec source = 4;
|
|
145
|
+
google.protobuf.Duration timeout = 5;
|
|
146
|
+
axern.control.common.v1.ExecutionConfig config = 6;
|
|
147
|
+
FunctionScalingSpec scaling = 7;
|
|
148
|
+
FunctionRetentionPolicy retention = 8;
|
|
149
|
+
FunctionWorkerSource worker_source = 9;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
message FunctionWorkerSource {
|
|
153
|
+
oneof source {
|
|
154
|
+
string environment_id = 1;
|
|
155
|
+
axern.control.environment.v1.EnvironmentSpec environment = 2;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
message FunctionSourceSpec {
|
|
160
|
+
oneof source {
|
|
161
|
+
FunctionBundleSource bundle = 1;
|
|
162
|
+
FunctionImageSource image = 2;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
message FunctionSource {
|
|
167
|
+
oneof source {
|
|
168
|
+
FunctionBundleSource bundle = 1;
|
|
169
|
+
FunctionImageSource image = 2;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
message FunctionBundleSource {
|
|
174
|
+
string digest = 1;
|
|
175
|
+
string media_type = 2;
|
|
176
|
+
int64 size_bytes = 3;
|
|
177
|
+
string storage_uri = 4;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
message FunctionImageSource {
|
|
181
|
+
string ref = 1;
|
|
182
|
+
string digest = 2;
|
|
183
|
+
string registry_credential_id = 3;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
message FunctionScalingSpec {
|
|
187
|
+
int32 min_replicas = 1;
|
|
188
|
+
int32 max_replicas = 2;
|
|
189
|
+
int32 concurrency = 3;
|
|
190
|
+
google.protobuf.Duration idle_timeout = 4;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
message FunctionRetentionPolicy {
|
|
194
|
+
google.protobuf.Duration invocation_retention = 1;
|
|
195
|
+
int32 max_invocations = 2;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
message FunctionPayload {
|
|
199
|
+
string content_type = 1;
|
|
200
|
+
bytes data = 2;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
message FunctionResult {
|
|
204
|
+
string content_type = 1;
|
|
205
|
+
bytes data = 2;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
message FunctionError {
|
|
209
|
+
string code = 1;
|
|
210
|
+
string message = 2;
|
|
211
|
+
string type = 3;
|
|
212
|
+
string stack_trace = 4;
|
|
213
|
+
map<string, string> details = 5;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
message FunctionListFilter {
|
|
217
|
+
string namespace = 1;
|
|
218
|
+
repeated FunctionStatus statuses = 2;
|
|
219
|
+
map<string, string> labels = 3;
|
|
220
|
+
string cursor = 4;
|
|
221
|
+
int32 page_size = 5;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
message FunctionInvocationListFilter {
|
|
225
|
+
string namespace = 1;
|
|
226
|
+
string function_id = 2;
|
|
227
|
+
string function_name = 3;
|
|
228
|
+
string revision_id = 4;
|
|
229
|
+
repeated FunctionInvocationStatus statuses = 5;
|
|
230
|
+
map<string, string> labels = 6;
|
|
231
|
+
string cursor = 7;
|
|
232
|
+
int32 page_size = 8;
|
|
233
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package axern.control.gateway.v1;
|
|
4
|
+
|
|
5
|
+
option go_package = "github.com/cofy-x/axern/sdk/go/gen/axern/control/gateway/v1;gatewayv1";
|
|
6
|
+
|
|
7
|
+
import "axern/control/common/v1/common.proto";
|
|
8
|
+
import "axern/control/service/v1/service_types.proto";
|
|
9
|
+
|
|
10
|
+
message ResolveServiceRouteRequest {
|
|
11
|
+
string namespace = 1;
|
|
12
|
+
string service_id = 2;
|
|
13
|
+
string port_ref = 3;
|
|
14
|
+
int64 ttl_seconds = 4;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
message ServiceRoutePort {
|
|
18
|
+
string name = 1;
|
|
19
|
+
axern.control.common.v1.PortProtocol protocol = 2;
|
|
20
|
+
int32 container_port = 3;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
message ServiceRouteEndpoint {
|
|
24
|
+
string allocation_id = 1;
|
|
25
|
+
string node_id = 2;
|
|
26
|
+
string node_target = 3;
|
|
27
|
+
int64 attempt = 4;
|
|
28
|
+
int32 container_port = 5;
|
|
29
|
+
axern.control.common.v1.PortProtocol protocol = 6;
|
|
30
|
+
bool ready = 7;
|
|
31
|
+
axern.control.common.v1.ExecutionLease lease = 8;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
message ResolveServiceRouteResponse {
|
|
35
|
+
string service_id = 1;
|
|
36
|
+
string namespace = 2;
|
|
37
|
+
axern.control.service.v1.ServiceStatus service_status = 3;
|
|
38
|
+
ServiceRoutePort port = 4;
|
|
39
|
+
repeated ServiceRouteEndpoint endpoints = 5;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
message ResolveAllocationTerminalRequest {
|
|
43
|
+
string allocation_id = 1;
|
|
44
|
+
int64 ttl_seconds = 2;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
message ResolveAllocationTerminalResponse {
|
|
48
|
+
string allocation_id = 1;
|
|
49
|
+
string owner_type = 2;
|
|
50
|
+
string owner_id = 3;
|
|
51
|
+
string node_id = 4;
|
|
52
|
+
string node_target = 5;
|
|
53
|
+
int64 attempt = 6;
|
|
54
|
+
axern.control.common.v1.ExecutionLease lease = 7;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
service GatewayControl {
|
|
58
|
+
rpc ResolveServiceRoute(ResolveServiceRouteRequest) returns (ResolveServiceRouteResponse) {}
|
|
59
|
+
rpc ResolveAllocationTerminal(ResolveAllocationTerminalRequest) returns (ResolveAllocationTerminalResponse) {}
|
|
60
|
+
}
|