Closed katzy687 closed 3 years ago
to clarify I'm referring to the first code sample. SandboxDataKeyValue is a class to be imported from cloudshell api. The sample is confusing customers. Thanks, Natti
@katzy687 the code example seems clear to me. Is there anything you want to clarify in the documentation?
@katzy687 Hi Natti, is there anything we want to change in the sample?
Hi Steve,
I would change the first example to be consistent with the later samples how we import and use the SandboxDataKeyValue object.
better to explicitly import it each time and use directly, instead of importing entire api module like this import cloudshell.api.cloudshell_api as api
better to do: from cloudshell.api.cloudshell_api import CloudShellAPISession, SandboxDataKeyValue
in later samples of same page we do this and create instance of CloudShellAPISession in variable api, which is fine, I generally work like that too. So we should avoid importing the whole api into the same alias in the first sample because it's confusing
the first two should look something like this
from cloudshell.api.cloudshell_api import CloudShellAPISession, SandboxDataKeyValue
res_id = "<live_sandbox_id>"
sandbox_data_obj1 = SandboxDataKeyValue("my_key", "my_val")
sandbox_data_obj2 = SandboxDataKeyValue("my_key2", "my_va2l")
my_sandbox_data = [sandbox_data_obj1, sandbox_data_obj2]
set_data_response = api.SetSandboxData(res_id, my_sandbox_data)
Hi Natti,
Handling this ticket via support ticket: https://qualisystemscom.zendesk.com/agent/tickets/42732 closing...
SandboxDataKeyValue is an object, not an api method