Skip to content

Instantly share code, notes, and snippets.

@gowatana
Last active Dec 12, 2020
Embed
What would you like to do?
#!/bin/bash
LOGIN_CONFIG=$1
source $LOGIN_CONFIG
COOKIE=$(curl -k -s -D - \
-X POST \
-H "Content-Type: application/json" \
-u "$PRISM_USER:$PRISM_PASS" \
-d "{}" \
--url "https://$PC_ADDR:9440/api/nutanix/v3/clusters/list" | grep Set-Cookie: | sed "s/^Set-//" | sed "s/\;.*//")
eval curl -k -s \
-X POST \
-H \"Content-Type: application/json\" \
-H \"$COOKIE\" \
-d \'{}\' \
--url "https://$PC_ADDR:9440/karbon/acs/k8s/cluster/list"
@gowatana
Copy link
Author

gowatana commented Dec 12, 2020

Nutanix Karbon の Kubernetes クラスタ情報を取得する。

使用方法

下記のようなファイルを用意。

$ cat ./login.txt
PRISM_USER='Prism Central のユーザ'
PRISM_PASS='パスワード'
PC_ADDR='Prism Central のアドレス'

実行。

$ bash ./get_karbon_k8s.sh ./login.txt

@gowatana
Copy link
Author

gowatana commented Dec 12, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment