Why should the Topology Folder matter for api.ActivateTopology(reservation_id,Blueprint_name) #192
-
|
So I created a simple Python script to activate our L1 connections at reservation start and it was working fine but then someone did not like all our BluePrints showing up in Resource Manager at the root of the tree. We currently, only use, the Global domain. So we added a folder called Global Topologies and added this as the topology folder for the global domain and my L1 Python script ceased to work. It could no longer find the current BluePrint in the reservation even though it had the correct BluePrint/Sandbox name. So it was failing in the call to ActivateTopology, yet it had the correct Blueprint name. As soon as we moved the Blueprint back to the root of the folder tree in Resource Manager, it started working again. It is as if the API could not see the Blueprints in the Global Topologies folder, even though that folder was set to be the Topology folder for the Global Domain. This seems to be a problem to me. As long as the Blueprint name is unique why should the folder structure matter to the API? And if it should matter then why didn't the call to: helpers.get_reservation_context_details().environment_name return the entire path? thanks, Marcus Porterfield Attachments:
Marcus Porterfield (mporterf) - 09/26/2017 04:58 PM
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
Hi mporterf The API documentation states that this should be the environment full path and not just the name. You might want to open an idea to improve this behavior in the future. Also, as of CloudShell 8.1, you also have a new property that returns the environment full path: helpers.get_reservation_context_details().environment_path Before 8.1, there is no simple way to do that, besides going over the active topologies and the full path from there: from os.path import basename
<br>blueprint_name = helpers.get_reservation_context_details().environment_name
full_path = None<br>tp = self.api_session.GetActiveTopologyNames()
for value in tp.Topologies:
topo_name = basename(value) <br> if topo_name == blueprint_name: <br> full_path = value <br> break<br>
if full_path: <br> blueprint_details = self.api_session.GetTopologyDetails(full_path)I hope that it helps. Yaniv Yaniv Kalsky (Yaniv.K) - 09/26/2017 06:54 AM
|
Beta Was this translation helpful? Give feedback.
-
|
Hi Yaniv.K Ok that makes sense, and I should have read the documentation first :) thanks, Marcus Marcus Porterfield (mporterf) - 09/26/2017 07:03 AM
|
Beta Was this translation helpful? Give feedback.

Hi mporterf
The API documentation states that this should be the environment full path and not just the name.
You might want to open an idea to improve this behavior in the future.
Also, as of CloudShell 8.1, you also have a new property that returns the environment full path:
helpers.get_reservation_context_details().environment_path
Before 8.1, there is no simple way to do that, besides going over the active topologies and the full path from there:
from os.path import basename <br>blueprint_name = helpers.get_reservation_context_details().environment_name full_path = None<br>tp = self.api_session.GetActiveTopologyNames() for value in tp.Topologies: topo_name = basename(value) <br> …