File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 1+ from cloudshell .api .cloudshell_api import CloudShellAPISession
2+
3+ api = CloudShellAPISession (host = "localhost" ,
4+ username = "admin" ,
5+ password = "admin" ,
6+ domain = "Global" )
7+
8+ RESOURCE_NAME = "<MY_RESOURCE"
9+
10+ # the raw api calls
11+ sync_from_response = api .SyncResourceFromDevice (resourceFullPath = RESOURCE_NAME )
12+ sync_to_response = api .SyncResourceToDevice (resourceFullPath = RESOURCE_NAME )
13+
14+ # to sync child resources, use get resource details, then iterate over desired resources
15+ root_resource_details = api .GetResourceDetails (RESOURCE_NAME )
16+ child_resources = root_resource_details .ChildResources
17+
18+ for resource in child_resources :
19+ print ("syncing resource {}" .format (resource .Name ))
20+ api .SyncResourceFromDevice (resource .Name )
21+
22+ print ("done" )
You can’t perform that action at this time.
0 commit comments