-
Notifications
You must be signed in to change notification settings - Fork 638
Expand file tree
/
Copy pathopenshell.datamodel.v1.rs
More file actions
146 lines (145 loc) · 6.09 KB
/
openshell.datamodel.v1.rs
File metadata and controls
146 lines (145 loc) · 6.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
// This file is @generated by prost-build.
/// Sandbox model stored by OpenShell.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Sandbox {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub namespace: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub spec: ::core::option::Option<SandboxSpec>,
#[prost(message, optional, tag = "5")]
pub status: ::core::option::Option<SandboxStatus>,
#[prost(enumeration = "SandboxPhase", tag = "6")]
pub phase: i32,
}
/// OpenShell-level sandbox spec.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SandboxSpec {
#[prost(string, tag = "1")]
pub log_level: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "5")]
pub environment:
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
#[prost(message, optional, tag = "6")]
pub template: ::core::option::Option<SandboxTemplate>,
/// Required sandbox policy configuration.
#[prost(message, optional, tag = "7")]
pub policy: ::core::option::Option<super::super::sandbox::v1::SandboxPolicy>,
/// Provider names to attach to this sandbox.
#[prost(string, repeated, tag = "8")]
pub providers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Sandbox template mapped onto Kubernetes pod template inputs.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SandboxTemplate {
#[prost(string, tag = "1")]
pub image: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub runtime_class_name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub agent_socket: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "4")]
pub labels:
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
#[prost(map = "string, string", tag = "5")]
pub annotations:
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
#[prost(map = "string, string", tag = "6")]
pub environment:
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
#[prost(message, optional, tag = "7")]
pub resources: ::core::option::Option<::prost_types::Struct>,
#[prost(message, optional, tag = "9")]
pub volume_claim_templates: ::core::option::Option<::prost_types::Struct>,
}
/// Sandbox status captured from Kubernetes.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SandboxStatus {
#[prost(string, tag = "1")]
pub sandbox_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub agent_pod: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub agent_fd: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub sandbox_fd: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "5")]
pub conditions: ::prost::alloc::vec::Vec<SandboxCondition>,
}
/// Sandbox condition mirrors Kubernetes conditions.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SandboxCondition {
#[prost(string, tag = "1")]
pub r#type: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub status: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub reason: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub message: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub last_transition_time: ::prost::alloc::string::String,
}
/// Provider model stored by OpenShell.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Provider {
#[prost(string, tag = "1")]
pub id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub name: ::prost::alloc::string::String,
/// Canonical provider type slug (for example: "claude", "gitlab").
#[prost(string, tag = "3")]
pub r#type: ::prost::alloc::string::String,
/// Secret values used for authentication.
#[prost(map = "string, string", tag = "4")]
pub credentials:
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
/// Non-secret provider configuration.
#[prost(map = "string, string", tag = "5")]
pub config:
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
}
/// High-level sandbox lifecycle phase.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SandboxPhase {
Unspecified = 0,
Provisioning = 1,
Ready = 2,
Error = 3,
Deleting = 4,
Unknown = 5,
}
impl SandboxPhase {
/// String value of the enum field names used in the ProtoBuf definition.
///
/// The values are not transformed in any way and thus are considered stable
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "SANDBOX_PHASE_UNSPECIFIED",
Self::Provisioning => "SANDBOX_PHASE_PROVISIONING",
Self::Ready => "SANDBOX_PHASE_READY",
Self::Error => "SANDBOX_PHASE_ERROR",
Self::Deleting => "SANDBOX_PHASE_DELETING",
Self::Unknown => "SANDBOX_PHASE_UNKNOWN",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SANDBOX_PHASE_UNSPECIFIED" => Some(Self::Unspecified),
"SANDBOX_PHASE_PROVISIONING" => Some(Self::Provisioning),
"SANDBOX_PHASE_READY" => Some(Self::Ready),
"SANDBOX_PHASE_ERROR" => Some(Self::Error),
"SANDBOX_PHASE_DELETING" => Some(Self::Deleting),
"SANDBOX_PHASE_UNKNOWN" => Some(Self::Unknown),
_ => None,
}
}
}