File tree 3 files changed +45
-2
lines changed
automation_api_scripts/get-vcenter-cluster-info
3 files changed +45
-2
lines changed Original file line number Diff line number Diff line change 2
2
USER = "<CS_USER>"
3
3
PASSWORD = "<CS_PASSWORD>"
4
4
DOMAIN = "<CS_DOMAIN>"
5
-
6
5
VCENTER_DATASTORE = "<MY_DATASTORE>"
7
6
SANDBOX_ID = "<SANDBOX_ID>"
Original file line number Diff line number Diff line change 2
2
vcenter shell command reference
3
3
https://github.com/QualiSystems/VMware-vCenter-Cloud-Provider-Shell-2G/blob/166724df98e0d6c67b16c047f8fb58de431ea4b3/src/drivermetadata.xml#L46
4
4
"""
5
+ import json
6
+
5
7
from cloudshell .api .cloudshell_api import CloudShellAPISession , InputNameValue
6
8
import config
7
9
21
23
commandName = "get_cluster_usage" ,
22
24
commandInputs = command_inputs ,
23
25
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