Skip to content

Instantly share code, notes, and snippets.

@gowatana
Created September 25, 2017 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gowatana/287e7d9bfae94d438d74077e262e09da to your computer and use it in GitHub Desktop.
Save gowatana/287e7d9bfae94d438d74077e262e09da to your computer and use it in GitHub Desktop.
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()
@gowatana
Copy link
Author

下記の投稿むけ。

Nutanix CE の Health Check 項目の一覧を取得してみる。(Python 編)
http://blog.ntnx.jp/entry/2017/09/25/235225

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