Skip to content

Commit fdc0268

Browse files
committed
execute command sample|
1 parent 7ec949f commit fdc0268

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from cloudshell.api.cloudshell_api import CloudShellAPISession, InputNameValue
2+
3+
api = CloudShellAPISession(host="localhost", username="admin", password="admin", domain="Global")
4+
5+
SANDBOX_ID = "20054710-42cb-4d04-bab0-214f93380b72"
6+
RESOURCE_NAME = "<MY_CLOUDSHELL_RESOURCE>"
7+
COMMAND_NAME = "<RESOURCE_COMMAND_NAME>"
8+
COMMAND_INPUTS = [InputNameValue("Param1", "Value1"),
9+
InputNameValue("Param2", "Value2")]
10+
11+
output = api.ExecuteCommand(reservationId=SANDBOX_ID,
12+
targetName=RESOURCE_NAME,
13+
targetType="Resource",
14+
commandName=COMMAND_NAME,
15+
commandInputs=COMMAND_INPUTS,
16+
printOutput=True).Output
17+
18+
print(f"command output: {output}")

0 commit comments

Comments
 (0)