Format for connectors in SetConnectorsInReservation #114
-
|
As per the documentation I setup the connectors as a list; connectors = ['SourceResourceFullPath', 'TargetResourceFullPath', 'Direction', 'Alias'] api_session.SetConnectorsInReservation(reservationId=reservation_id, connectors=connectors) But when the command is executed there is no connection shown on the sandbox and the help tip on "connectors=connectors" is; Expected type:'List[SetConnectorRequest]', got 'List[str]' instead. Comdate Support (qsportal@comdate.com.au) - 07/13/2018 05:57 AM
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Thanks for asking about this, we'll update the document to make it more clear - in this case the example in the api guide is wrong. In this case, as the error says, you need to provide a list of SetConnectorRequest objects, but you provided a list of strings. You should use the following (for each connector add another SetConnectorRequest to the list): connectors = [SetConnectorRequest('SourceResourceFullPath', 'TargetResourceFullPath', 'Direction', 'Alias')]
BTW, one more place that you can always look for examples is our 2 github organizations: https://github.com/QualiSystemsLab https://github.com/QualiSystems Search for any code part that you need and see if we already used it in any of our public projects - in most cases, you'll find a few examples. In this case, this is a relevant example: https://github.com/QualiSystems/cloudshell-tg-virtual-trex/blob/dev/src/driver.py#L165 Yaniv Yaniv Kalsky (Yaniv.K) - 07/13/2018 07:07 AM
|
Beta Was this translation helpful? Give feedback.
-
|
Thank you Yaniv. Comdate Support (qsportal@comdate.com.au) - 07/15/2018 11:12 AM
|
Beta Was this translation helpful? Give feedback.
Hi qsportal@comdate.com.au
Thanks for asking about this, we'll update the document to make it more clear - in this case the example in the api guide is wrong.
In this case, as the error says, you need to provide a list of SetConnectorRequest objects, but you provided a list of strings.
You should use the following (for each connector add another SetConnectorRequest to the list):
connectors = [SetConnectorRequest('SourceResourceFullPath', 'TargetResourceFullPath', 'Direction', 'Alias')]BTW, one more place that you can always look for examples is our 2 github organizations:
https://github.com/QualiSystemsLab
https://github.com/QualiSystems
Search for any code part that you need and see if …