Skip to content

Commit 8bea18e

Browse files
authored
fix(k8scluster): add examples
1 parent 20ff807 commit 8bea18e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

hpecp/cli/k8scluster.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def __dir__(self):
4848
"dashboard_url",
4949
"dashboard_token",
5050
"delete",
51+
"examples",
5152
"get",
5253
"get_available_addons",
5354
"get_installed_addons",
@@ -157,6 +158,18 @@ def dashboard_token(
157158
else:
158159
print(base64.b64decode(token.encode()).decode("utf-8"))
159160

161+
def examples(self):
162+
"""Show examples for working with k8sclusters."""
163+
print(
164+
dedent(
165+
"""\
166+
# retrieve id of k8s cluster with name 'c1'
167+
$ hpecp k8scluster list --query "[?label.name == 'c1'] | [0] | [_links.self.href]" --output text
168+
/api/v2/k8scluster/1
169+
""" # noqa: E501
170+
)
171+
)
172+
160173
@base.intercept_exception
161174
def k8smanifest(self):
162175
"""Retrieve the k8smanifest."""

0 commit comments

Comments
 (0)