Skip to content

Commit f6b06af

Browse files
committed
Merge branch 'refactor_tests' of github.com:hpe-container-platform-community/hpecp-python-library into refactor_tests
2 parents d189c15 + a2e7690 commit f6b06af

File tree

4 files changed

+41
-5
lines changed

4 files changed

+41
-5
lines changed

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,16 @@ Create k8s cluster:
9393
hpecp k8scluster create --name myclus1 --k8shosts-config /api/v2/worker/k8shost/1:master --k8s_version=1.17.0
9494
```
9595

96+
Get k8s available addons:
97+
```sh
98+
hpecp k8scluster get-available-addons --id $CLUSTER_ID
99+
```
100+
101+
Add k8s cluster addons:
102+
```sh
103+
hpecp k8scluster add-addons --id $CLUSTER_ID --addons [istio,harbor]
104+
```
105+
96106
List with columns parameter:
97107
```sh
98108
hpecp k8scluster list --columns [id,description,status]
@@ -108,9 +118,36 @@ List --query examples:
108118
hpecp tenant examples
109119
```
110120

121+
Tenant create:
122+
```sh
123+
TENANT_ID=$(hpecp tenant create --name tenant1 --description "dev tenant" --k8s-cluster-id $CLUSTER_ID --tenant-type k8s)
124+
hpecp tenant wait-for-status --id $TENANT_ID --status [ready] --timeout-secs 600
125+
```
126+
127+
Add LDAP role to Tenant:
128+
```sh
129+
ADMIN_GROUP="CN=DemoTenantAdmins,CN=Users,DC=samdom,DC=example,DC=com"
130+
ADMIN_ROLE=$(hpecp role list --query "[?label.name == 'Admin'][_links.self.href]" --output text)
131+
hpecp tenant add-external-user-group --tenant-id $TENANT_ID --group $ADMIN_GROUP --role-id $ADMIN_ROLE
132+
```
133+
134+
Add internal user to Tenant:
135+
136+
```sh
137+
ADMIN_USER_ID=$(hpecp user list --query "[?label.name == 'admin'][_links.self.href]" --output text)
138+
ADMIN_ROLE=$(hpecp role list --query "[?label.name == 'Admin'][_links.self.href]" --output text)
139+
hpecp tenant assign-user-to-role --tenant-id $TENANT_ID --role-id $ADMIN_ROLE --user-id $ADMIN_USER_ID
140+
```
141+
111142
Tenant kube config:
112143
```sh
113144
PROFILE=tenant1 hpecp tenant k8skubeconfig > tenant1_kube.conf
145+
146+
# get available Kubedirector apps
147+
kubectl --kubeconfig tenant1_kube.conf -n t1 get kubedirectorapps
148+
149+
# list running applications
150+
kubectl --kubeconfig tenant1_kube.conf -n t1 describe kubedirectorclusters
114151
```
115152

116153
Http call:

bin/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def bash(self,):
226226
return
227227
fi
228228
229-
# from: https://stackoverflow.com/a/58221008/1033422
229+
230230
231231
declare -A MODULE_COLUMNS=(
232232
{% for module_name in modules %}
@@ -247,7 +247,7 @@ def bash(self,):
247247
return
248248
fi
249249
250-
# FIXME: https://unix.stackexchange.com/questions/124539/bash-completion-for-comma-separated-values
250+
251251
252252
# '--columns' was the last word and user is entering column names
253253
if [[ "${COMP_WORDS[3]}" == "--columns"* && ${#COMP_WORDS[@]} -le 5 ]];

docs/README-INSTALL-HPECP-HOSTS.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ source ~/.bashrc
2121
pyenv virtualenv 3.6.10 my-3.6.10
2222
pyenv activate my-3.6.10
2323
24-
pip install --upgrade pip
25-
pip install --upgrade git+https://github.com/hpe-container-platform-community/hpecp-client@master
24+
pip install -U hpecp
2625
```
2726

2827
Whenever you run the hpecp cli activate python 3.6.10 first, I.e.

hpecp/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@
3535
)
3636
from .logger import Logger
3737

38-
__version__ = "0.7.1"
38+
__version__ = "0.7.11"

0 commit comments

Comments
 (0)