QualiSystems / devguide_source

This repository hosts the source code of the CloudShell developer guide.
https://devguide.quali.com
2 stars 8 forks source link

New suggestion for /reference/2020.1.0/working-with-sandbox-metadata.html #274

Closed katzy687 closed 4 years ago

katzy687 commented 4 years ago

SandboxDataKeyValue is an object, not an api method

katzy687 commented 4 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

Shnitselon commented 4 years ago

@katzy687 the code example seems clear to me. Is there anything you want to clarify in the documentation?

Shnitselon commented 4 years ago

@katzy687 Hi Natti, is there anything we want to change in the sample?

katzy687 commented 4 years ago

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)
Shnitselon commented 4 years ago

Hi Natti,

Handling this ticket via support ticket: https://qualisystemscom.zendesk.com/agent/tickets/42732 closing...