codecraftai-restclient-kubernetes 1.2.0__py3-none-any.whl
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.
- ccai/restclient/kubernetes/__init__.py +0 -0
- ccai/restclient/kubernetes/apigroups/__init__.py +0 -0
- ccai/restclient/kubernetes/apigroups/appsv1group.py +221 -0
- ccai/restclient/kubernetes/apigroups/batchv1group.py +124 -0
- ccai/restclient/kubernetes/apigroups/corev1group.py +383 -0
- ccai/restclient/kubernetes/apigroups/networkingv1group.py +124 -0
- ccai/restclient/kubernetes/apigroups/resourcegroupbase.py +297 -0
- ccai/restclient/kubernetes/apigroups/versiongroup.py +48 -0
- ccai/restclient/kubernetes/apiobject.py +159 -0
- ccai/restclient/kubernetes/kubeconfigresolver.py +399 -0
- ccai/restclient/kubernetes/kubernetesapierror.py +48 -0
- ccai/restclient/kubernetes/kubernetesrestclient.py +240 -0
- codecraftai_restclient_kubernetes-1.2.0.dist-info/METADATA +53 -0
- codecraftai_restclient_kubernetes-1.2.0.dist-info/RECORD +16 -0
- codecraftai_restclient_kubernetes-1.2.0.dist-info/WHEEL +4 -0
- codecraftai_restclient_kubernetes-1.2.0.dist-info/licenses/LICENSE.md +204 -0
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"""
|
|
2
|
+
.. module:: appsv1group
|
|
3
|
+
:platform: Darwin, Linux, Unix, Windows
|
|
4
|
+
:synopsis: :class:`AppsV1Group` — the ``/apis/apps/v1`` api group.
|
|
5
|
+
|
|
6
|
+
.. moduleauthor:: Myron Walker <myron.walker@gmail.com>
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
__author__ = "Myron Walker"
|
|
10
|
+
__copyright__ = "Copyright 2026, Code Craft AI LLC"
|
|
11
|
+
__credits__ = []
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
from typing import Any, Dict, Optional
|
|
15
|
+
|
|
16
|
+
from ccai.restclient.kubernetes.apiobject import ApiObject
|
|
17
|
+
from ccai.restclient.kubernetes.apigroups.resourcegroupbase import (
|
|
18
|
+
ResourceGroupBase
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class AppsV1Group(ResourceGroupBase):
|
|
23
|
+
"""
|
|
24
|
+
The ``/apis/apps/v1`` api group.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
api_prefix: str = "/apis/apps/v1"
|
|
28
|
+
|
|
29
|
+
def create_namespaced_deployment(self, *, namespace: str,
|
|
30
|
+
body: Dict[str, Any],
|
|
31
|
+
timeout_seconds: Optional[float] = None
|
|
32
|
+
) -> ApiObject:
|
|
33
|
+
"""
|
|
34
|
+
Create a deployment in a namespace.
|
|
35
|
+
|
|
36
|
+
:param namespace: The namespace.
|
|
37
|
+
:param body: The resource manifest.
|
|
38
|
+
:param timeout_seconds: Optional request timeout.
|
|
39
|
+
|
|
40
|
+
:returns: The created resource.
|
|
41
|
+
"""
|
|
42
|
+
rtnval = self.create_namespaced(plural="deployments",
|
|
43
|
+
namespace=namespace, body=body,
|
|
44
|
+
timeout_seconds=timeout_seconds)
|
|
45
|
+
return rtnval
|
|
46
|
+
|
|
47
|
+
def read_namespaced_deployment(self, *, name: str, namespace: str,
|
|
48
|
+
timeout_seconds: Optional[float] = None
|
|
49
|
+
) -> ApiObject:
|
|
50
|
+
"""
|
|
51
|
+
Read a deployment.
|
|
52
|
+
|
|
53
|
+
:param name: The resource name.
|
|
54
|
+
:param namespace: The namespace.
|
|
55
|
+
:param timeout_seconds: Optional request timeout.
|
|
56
|
+
|
|
57
|
+
:returns: The resource.
|
|
58
|
+
"""
|
|
59
|
+
rtnval = self.read_namespaced(plural="deployments",
|
|
60
|
+
namespace=namespace, name=name,
|
|
61
|
+
timeout_seconds=timeout_seconds)
|
|
62
|
+
return rtnval
|
|
63
|
+
|
|
64
|
+
def list_namespaced_deployment(self, *, namespace: str,
|
|
65
|
+
label_selector: Optional[str] = None,
|
|
66
|
+
field_selector: Optional[str] = None,
|
|
67
|
+
timeout_seconds: Optional[float] = None
|
|
68
|
+
) -> ApiObject:
|
|
69
|
+
"""
|
|
70
|
+
List the deployments in a namespace.
|
|
71
|
+
|
|
72
|
+
:param namespace: The namespace.
|
|
73
|
+
:param label_selector: Optional label selector.
|
|
74
|
+
:param field_selector: Optional field selector.
|
|
75
|
+
:param timeout_seconds: Optional request timeout.
|
|
76
|
+
|
|
77
|
+
:returns: The list response, carrying ``items``.
|
|
78
|
+
"""
|
|
79
|
+
rtnval = self.list_namespaced(plural="deployments",
|
|
80
|
+
namespace=namespace,
|
|
81
|
+
label_selector=label_selector,
|
|
82
|
+
field_selector=field_selector,
|
|
83
|
+
timeout_seconds=timeout_seconds)
|
|
84
|
+
return rtnval
|
|
85
|
+
|
|
86
|
+
def patch_namespaced_deployment(self, *, name: str, namespace: str,
|
|
87
|
+
body: Dict[str, Any],
|
|
88
|
+
timeout_seconds: Optional[float] = None
|
|
89
|
+
) -> ApiObject:
|
|
90
|
+
"""
|
|
91
|
+
Patch a deployment.
|
|
92
|
+
|
|
93
|
+
:param name: The resource name.
|
|
94
|
+
:param namespace: The namespace.
|
|
95
|
+
:param body: The patch document.
|
|
96
|
+
:param timeout_seconds: Optional request timeout.
|
|
97
|
+
|
|
98
|
+
:returns: The patched resource.
|
|
99
|
+
"""
|
|
100
|
+
rtnval = self.patch_namespaced(plural="deployments",
|
|
101
|
+
namespace=namespace, name=name,
|
|
102
|
+
body=body,
|
|
103
|
+
timeout_seconds=timeout_seconds)
|
|
104
|
+
return rtnval
|
|
105
|
+
|
|
106
|
+
def delete_namespaced_deployment(self, *, name: str, namespace: str,
|
|
107
|
+
body: Optional[Dict[str, Any]] = None,
|
|
108
|
+
timeout_seconds: Optional[float] = None
|
|
109
|
+
) -> ApiObject:
|
|
110
|
+
"""
|
|
111
|
+
Delete a deployment.
|
|
112
|
+
|
|
113
|
+
:param name: The resource name.
|
|
114
|
+
:param namespace: The namespace.
|
|
115
|
+
:param body: Optional delete options.
|
|
116
|
+
:param timeout_seconds: Optional request timeout.
|
|
117
|
+
|
|
118
|
+
:returns: The delete response.
|
|
119
|
+
"""
|
|
120
|
+
rtnval = self.delete_namespaced(plural="deployments",
|
|
121
|
+
namespace=namespace, name=name,
|
|
122
|
+
body=body,
|
|
123
|
+
timeout_seconds=timeout_seconds)
|
|
124
|
+
return rtnval
|
|
125
|
+
|
|
126
|
+
def create_namespaced_stateful_set(self, *, namespace: str,
|
|
127
|
+
body: Dict[str, Any],
|
|
128
|
+
timeout_seconds: Optional[float] = None
|
|
129
|
+
) -> ApiObject:
|
|
130
|
+
"""
|
|
131
|
+
Create a stateful set in a namespace.
|
|
132
|
+
|
|
133
|
+
:param namespace: The namespace.
|
|
134
|
+
:param body: The resource manifest.
|
|
135
|
+
:param timeout_seconds: Optional request timeout.
|
|
136
|
+
|
|
137
|
+
:returns: The created resource.
|
|
138
|
+
"""
|
|
139
|
+
rtnval = self.create_namespaced(plural="statefulsets",
|
|
140
|
+
namespace=namespace, body=body,
|
|
141
|
+
timeout_seconds=timeout_seconds)
|
|
142
|
+
return rtnval
|
|
143
|
+
|
|
144
|
+
def read_namespaced_stateful_set(self, *, name: str, namespace: str,
|
|
145
|
+
timeout_seconds: Optional[float] = None
|
|
146
|
+
) -> ApiObject:
|
|
147
|
+
"""
|
|
148
|
+
Read a stateful set.
|
|
149
|
+
|
|
150
|
+
:param name: The resource name.
|
|
151
|
+
:param namespace: The namespace.
|
|
152
|
+
:param timeout_seconds: Optional request timeout.
|
|
153
|
+
|
|
154
|
+
:returns: The resource.
|
|
155
|
+
"""
|
|
156
|
+
rtnval = self.read_namespaced(plural="statefulsets",
|
|
157
|
+
namespace=namespace, name=name,
|
|
158
|
+
timeout_seconds=timeout_seconds)
|
|
159
|
+
return rtnval
|
|
160
|
+
|
|
161
|
+
def list_namespaced_stateful_set(self, *, namespace: str,
|
|
162
|
+
label_selector: Optional[str] = None,
|
|
163
|
+
field_selector: Optional[str] = None,
|
|
164
|
+
timeout_seconds: Optional[float] = None
|
|
165
|
+
) -> ApiObject:
|
|
166
|
+
"""
|
|
167
|
+
List the stateful sets in a namespace.
|
|
168
|
+
|
|
169
|
+
:param namespace: The namespace.
|
|
170
|
+
:param label_selector: Optional label selector.
|
|
171
|
+
:param field_selector: Optional field selector.
|
|
172
|
+
:param timeout_seconds: Optional request timeout.
|
|
173
|
+
|
|
174
|
+
:returns: The list response, carrying ``items``.
|
|
175
|
+
"""
|
|
176
|
+
rtnval = self.list_namespaced(plural="statefulsets",
|
|
177
|
+
namespace=namespace,
|
|
178
|
+
label_selector=label_selector,
|
|
179
|
+
field_selector=field_selector,
|
|
180
|
+
timeout_seconds=timeout_seconds)
|
|
181
|
+
return rtnval
|
|
182
|
+
|
|
183
|
+
def patch_namespaced_stateful_set(self, *, name: str, namespace: str,
|
|
184
|
+
body: Dict[str, Any],
|
|
185
|
+
timeout_seconds: Optional[float] = None
|
|
186
|
+
) -> ApiObject:
|
|
187
|
+
"""
|
|
188
|
+
Patch a stateful set.
|
|
189
|
+
|
|
190
|
+
:param name: The resource name.
|
|
191
|
+
:param namespace: The namespace.
|
|
192
|
+
:param body: The patch document.
|
|
193
|
+
:param timeout_seconds: Optional request timeout.
|
|
194
|
+
|
|
195
|
+
:returns: The patched resource.
|
|
196
|
+
"""
|
|
197
|
+
rtnval = self.patch_namespaced(plural="statefulsets",
|
|
198
|
+
namespace=namespace, name=name,
|
|
199
|
+
body=body,
|
|
200
|
+
timeout_seconds=timeout_seconds)
|
|
201
|
+
return rtnval
|
|
202
|
+
|
|
203
|
+
def delete_namespaced_stateful_set(self, *, name: str, namespace: str,
|
|
204
|
+
body: Optional[Dict[str, Any]] = None,
|
|
205
|
+
timeout_seconds: Optional[float] = None
|
|
206
|
+
) -> ApiObject:
|
|
207
|
+
"""
|
|
208
|
+
Delete a stateful set.
|
|
209
|
+
|
|
210
|
+
:param name: The resource name.
|
|
211
|
+
:param namespace: The namespace.
|
|
212
|
+
:param body: Optional delete options.
|
|
213
|
+
:param timeout_seconds: Optional request timeout.
|
|
214
|
+
|
|
215
|
+
:returns: The delete response.
|
|
216
|
+
"""
|
|
217
|
+
rtnval = self.delete_namespaced(plural="statefulsets",
|
|
218
|
+
namespace=namespace, name=name,
|
|
219
|
+
body=body,
|
|
220
|
+
timeout_seconds=timeout_seconds)
|
|
221
|
+
return rtnval
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"""
|
|
2
|
+
.. module:: batchv1group
|
|
3
|
+
:platform: Darwin, Linux, Unix, Windows
|
|
4
|
+
:synopsis: :class:`BatchV1Group` — the ``/apis/batch/v1`` api group.
|
|
5
|
+
|
|
6
|
+
.. moduleauthor:: Myron Walker <myron.walker@gmail.com>
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
__author__ = "Myron Walker"
|
|
10
|
+
__copyright__ = "Copyright 2026, Code Craft AI LLC"
|
|
11
|
+
__credits__ = []
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
from typing import Any, Dict, Optional
|
|
15
|
+
|
|
16
|
+
from ccai.restclient.kubernetes.apiobject import ApiObject
|
|
17
|
+
from ccai.restclient.kubernetes.apigroups.resourcegroupbase import (
|
|
18
|
+
ResourceGroupBase
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class BatchV1Group(ResourceGroupBase):
|
|
23
|
+
"""
|
|
24
|
+
The ``/apis/batch/v1`` api group.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
api_prefix: str = "/apis/batch/v1"
|
|
28
|
+
|
|
29
|
+
def create_namespaced_job(self, *, namespace: str,
|
|
30
|
+
body: Dict[str, Any],
|
|
31
|
+
timeout_seconds: Optional[float] = None
|
|
32
|
+
) -> ApiObject:
|
|
33
|
+
"""
|
|
34
|
+
Create a job in a namespace.
|
|
35
|
+
|
|
36
|
+
:param namespace: The namespace.
|
|
37
|
+
:param body: The resource manifest.
|
|
38
|
+
:param timeout_seconds: Optional request timeout.
|
|
39
|
+
|
|
40
|
+
:returns: The created resource.
|
|
41
|
+
"""
|
|
42
|
+
rtnval = self.create_namespaced(plural="jobs",
|
|
43
|
+
namespace=namespace, body=body,
|
|
44
|
+
timeout_seconds=timeout_seconds)
|
|
45
|
+
return rtnval
|
|
46
|
+
|
|
47
|
+
def read_namespaced_job(self, *, name: str, namespace: str,
|
|
48
|
+
timeout_seconds: Optional[float] = None
|
|
49
|
+
) -> ApiObject:
|
|
50
|
+
"""
|
|
51
|
+
Read a job.
|
|
52
|
+
|
|
53
|
+
:param name: The resource name.
|
|
54
|
+
:param namespace: The namespace.
|
|
55
|
+
:param timeout_seconds: Optional request timeout.
|
|
56
|
+
|
|
57
|
+
:returns: The resource.
|
|
58
|
+
"""
|
|
59
|
+
rtnval = self.read_namespaced(plural="jobs",
|
|
60
|
+
namespace=namespace, name=name,
|
|
61
|
+
timeout_seconds=timeout_seconds)
|
|
62
|
+
return rtnval
|
|
63
|
+
|
|
64
|
+
def list_namespaced_job(self, *, namespace: str,
|
|
65
|
+
label_selector: Optional[str] = None,
|
|
66
|
+
field_selector: Optional[str] = None,
|
|
67
|
+
timeout_seconds: Optional[float] = None
|
|
68
|
+
) -> ApiObject:
|
|
69
|
+
"""
|
|
70
|
+
List the jobs in a namespace.
|
|
71
|
+
|
|
72
|
+
:param namespace: The namespace.
|
|
73
|
+
:param label_selector: Optional label selector.
|
|
74
|
+
:param field_selector: Optional field selector.
|
|
75
|
+
:param timeout_seconds: Optional request timeout.
|
|
76
|
+
|
|
77
|
+
:returns: The list response, carrying ``items``.
|
|
78
|
+
"""
|
|
79
|
+
rtnval = self.list_namespaced(plural="jobs",
|
|
80
|
+
namespace=namespace,
|
|
81
|
+
label_selector=label_selector,
|
|
82
|
+
field_selector=field_selector,
|
|
83
|
+
timeout_seconds=timeout_seconds)
|
|
84
|
+
return rtnval
|
|
85
|
+
|
|
86
|
+
def patch_namespaced_job(self, *, name: str, namespace: str,
|
|
87
|
+
body: Dict[str, Any],
|
|
88
|
+
timeout_seconds: Optional[float] = None
|
|
89
|
+
) -> ApiObject:
|
|
90
|
+
"""
|
|
91
|
+
Patch a job.
|
|
92
|
+
|
|
93
|
+
:param name: The resource name.
|
|
94
|
+
:param namespace: The namespace.
|
|
95
|
+
:param body: The patch document.
|
|
96
|
+
:param timeout_seconds: Optional request timeout.
|
|
97
|
+
|
|
98
|
+
:returns: The patched resource.
|
|
99
|
+
"""
|
|
100
|
+
rtnval = self.patch_namespaced(plural="jobs",
|
|
101
|
+
namespace=namespace, name=name,
|
|
102
|
+
body=body,
|
|
103
|
+
timeout_seconds=timeout_seconds)
|
|
104
|
+
return rtnval
|
|
105
|
+
|
|
106
|
+
def delete_namespaced_job(self, *, name: str, namespace: str,
|
|
107
|
+
body: Optional[Dict[str, Any]] = None,
|
|
108
|
+
timeout_seconds: Optional[float] = None
|
|
109
|
+
) -> ApiObject:
|
|
110
|
+
"""
|
|
111
|
+
Delete a job.
|
|
112
|
+
|
|
113
|
+
:param name: The resource name.
|
|
114
|
+
:param namespace: The namespace.
|
|
115
|
+
:param body: Optional delete options.
|
|
116
|
+
:param timeout_seconds: Optional request timeout.
|
|
117
|
+
|
|
118
|
+
:returns: The delete response.
|
|
119
|
+
"""
|
|
120
|
+
rtnval = self.delete_namespaced(plural="jobs",
|
|
121
|
+
namespace=namespace, name=name,
|
|
122
|
+
body=body,
|
|
123
|
+
timeout_seconds=timeout_seconds)
|
|
124
|
+
return rtnval
|