File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 26
26
from hpecp .k8s_worker import WorkerK8sStatus , WorkerK8s
27
27
from hpecp .cli import base
28
28
29
+ from textwrap import dedent
30
+
29
31
30
32
class K8sWorkerProxy (base .BaseProxy ):
31
33
"""Proxy object to :py:attr:`<hpecp.client.k8s_worker>`."""
@@ -35,6 +37,7 @@ def __dir__(self):
35
37
return [
36
38
"create_with_ssh_key" ,
37
39
"delete" ,
40
+ "examples" ,
38
41
"get" ,
39
42
"list" ,
40
43
"set_storage" ,
@@ -161,6 +164,19 @@ def create_with_ssh_key(
161
164
162
165
print (worker_id )
163
166
167
+ def examples (self ):
168
+ """Show examples for working with k8sclusters."""
169
+ print (
170
+ dedent (
171
+ """\
172
+ # Find id of k8s workers by ip address
173
+ $ hpecp k8sworker list --query "[*] | @[?contains('10.0.1.10 10.0.1.210', ipaddr)] | [*][_links.self.href]" --output text
174
+ /api/v2/worker/k8shost/5
175
+ /api/v2/worker/k8shost/7
176
+ """ # noqa: E501
177
+ )
178
+ )
179
+
164
180
# TODO: verify with engineering if setup_log is a valid parameter
165
181
# def get(self, id, setup_log=False):
166
182
# """Get a K8SWorker."""
You can’t perform that action at this time.
0 commit comments