Created
September 25, 2017 14:21
-
-
Save gowatana/287e7d9bfae94d438d74077e262e09da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import requests | |
cvm_ip = 'NutanixクラスタVIP' | |
cvm_user = 'ユーザ' | |
cvm_pass = 'パスワード' | |
def main(): | |
base_url = 'https://' + cvm_ip + ':9440/PrismGateway/services/rest/v2.0/' | |
requests.packages.urllib3.disable_warnings() | |
s = requests.Session() | |
s.auth = (cvm_user, cvm_pass) | |
s.headers.update({'Content-Type': 'application/json; charset=utf-8'}) | |
data = s.get(base_url + 'health_checks', verify=False).json() | |
for e in data['entities']: | |
print e['id'] + ',' + e['name'] | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
下記の投稿むけ。
Nutanix CE の Health Check 項目の一覧を取得してみる。(Python 編)
http://blog.ntnx.jp/entry/2017/09/25/235225