File tree Expand file tree Collapse file tree 3 files changed +45
-2
lines changed
automation_api_scripts/get-vcenter-cluster-info Expand file tree Collapse file tree 3 files changed +45
-2
lines changed Original file line number Diff line number Diff line change 22USER = "<CS_USER>"
33PASSWORD = "<CS_PASSWORD>"
44DOMAIN = "<CS_DOMAIN>"
5-
65VCENTER_DATASTORE = "<MY_DATASTORE>"
76SANDBOX_ID = "<SANDBOX_ID>"
Original file line number Diff line number Diff line change 22vcenter shell command reference
33https://github.com/QualiSystems/VMware-vCenter-Cloud-Provider-Shell-2G/blob/166724df98e0d6c67b16c047f8fb58de431ea4b3/src/drivermetadata.xml#L46
44"""
5+ import json
6+
57from cloudshell .api .cloudshell_api import CloudShellAPISession , InputNameValue
68import config
79
2123 commandName = "get_cluster_usage" ,
2224 commandInputs = command_inputs ,
2325 printOutput = True ).Output
24- print (cluster_details )
26+ data = json .loads (cluster_details )
27+ print (json .dumps (data , indent = 4 ))
Original file line number Diff line number Diff line change 1+ # Get Vcenter Cluster Info
2+
3+ Debug script to test vcenter shell command
4+
5+ ## Usage
6+
7+ Add config data to config.py
8+
9+ ``` python
10+ SERVER = " <CS_HOST>"
11+ USER = " <CS_USER>"
12+ PASSWORD = " <CS_PASSWORD>"
13+ DOMAIN = " <CS_DOMAIN>"
14+ VCENTER_DATASTORE = " <MY_DATASTORE>"
15+ SANDBOX_ID = " <SANDBOX_ID>"
16+ ```
17+
18+ ## Sample Response
19+
20+ ``` json
21+ {
22+ "datastore" : {
23+ "capacity" : " 5.46 TB" ,
24+ "used" : " 4.32 TB" ,
25+ "free" : " 4.32 TB" ,
26+ "used_percentage" : " 79"
27+ },
28+ "cpu" : {
29+ "capacity" : " 35.20 GHz" ,
30+ "used" : " 5.85 GHz" ,
31+ "free" : " 29.35 GHz" ,
32+ "used_percentage" : " 17"
33+ },
34+ "ram" : {
35+ "capacity" : " 383.94 GB" ,
36+ "used" : " 52.21 GB" ,
37+ "free" : " 331.73 GB" ,
38+ "used_percentage" : " 14"
39+ }
40+ }
41+ ```
You can’t perform that action at this time.
0 commit comments