Skip to content

Commit fd2af1a

Browse files
committed
jenkins sample|
1 parent 39c281d commit fd2af1a

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import json
2+
import sys
3+
import time
4+
5+
from cloudshell.sandbox_rest.sandbox_api import SandboxRestApiSession, InputParam
6+
7+
if len(sys.argv) < 2:
8+
raise ValueError("Sandbox Id not passed")
9+
10+
# sandbox ID is injected into script via command line argument
11+
sandbox_id = sys.argv[1]
12+
13+
# pull in api user credentials
14+
CS_SERVER = "localhost"
15+
CS_USER = "admin"
16+
CS_PASSWORD = "admin"
17+
CS_DOMAIN = "Global"
18+
19+
20+
api = SandboxRestApiSession(host=CS_SERVER, username=CS_USER, password=CS_PASSWORD, domain=CS_DOMAIN)
21+
components_response = api.get_sandbox_components(sandbox_id)
22+
print("===== GETTING COMPONENT DETAILS IN SANDBOX =====")
23+
print(f"total components in sandbox: {len(components_response)}")
24+
print(f"components response:\n{json.dumps(components_response, indent=4)}")
25+
26+
print(f"starting test on sandbox {sandbox_id}...")
27+
time.sleep(30)
28+
print("jenkins test done")

0 commit comments

Comments
 (0)