Skip to content

Commit 97c87ad

Browse files
committed
debug sample
1 parent b66766c commit 97c87ad

3 files changed

Lines changed: 29 additions & 17 deletions

File tree

generic-orchestration-samples/setup/setup_call_health_check/update_script.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def zip_files():
8686
zip_details = get_zip_details()
8787
zip_file_name = zip_details["zip_file_name"]
8888
dirs_to_exclude = [".git"]
89-
files_to_exclude = [zip_file_name, "venv", ".idea", "update_script.py", "DEBUG.py"]
89+
files_to_exclude = [zip_file_name, "venv", ".idea", "update_script.py", "debug.py"]
9090
try:
9191
make_zipfile(output_filename=zip_file_name,
9292
source_dir=zip_details["parent_dir_path"],

utility/orch-script-utils/DEBUG.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

utility/orch-script-utils/debug.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"""
2+
Example how to use "attach_to_cloudshell" helper
3+
Take care not to commit cloudshell credentials to source control
4+
"""
5+
from cloudshell.workflow.orchestration.sandbox import Sandbox
6+
from cloudshell.helpers.scripts.cloudshell_dev_helpers import attach_to_cloudshell_as
7+
8+
9+
def custom_flow(sandbox, components=None):
10+
"""
11+
12+
:param Sandbox sandbox:
13+
:param components:
14+
:return:
15+
"""
16+
sandbox.automation_api.WriteMessageToReservationOutput(sandbox.id, "hello from debug")
17+
18+
19+
if __name__ == "__main__":
20+
LIVE_SANDBOX_ID = "bda46630-f777-401c-a27e-c055f6e6732b"
21+
attach_to_cloudshell_as(server_address="localhost",
22+
user="admin",
23+
password="admin",
24+
domain="Global",
25+
reservation_id=LIVE_SANDBOX_ID)
26+
27+
sandbox = Sandbox()
28+
custom_flow(sandbox)

0 commit comments

Comments
 (0)