Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
 
Answered
How can I create a single User with multiple Logins in the Sandbox?

I am able to create a new user in the Sandbox for testing with the command q2 create_online_user. For a User that I create, I need to ensure that at least one of them has multiple Logins for testing purposes. In the documentation, I cannot find a way to assign a second Login to a single User. Is there some way to do this inside of the SDK Sandbox?

Posted 3 years ago
Votes Newest

Answers


Hey Ethan,

I don't see that we have a CLI command for adding an additional user logon. You could import some of the DbObjects to accomplish this, however.

from q2_sdk.hq import api_helpers
from q2_sdk.hq.hq_api.q2_api import AddUserLogon
from q2_sdk.hq.models.password_policy import PasswordPolicy

    password_policy = PasswordPolicy()
    await password_policy.populate_from_hq(logger, ui_source_id=1, hq_credentials=hq_credentials)
    random_password = api_helpers.generate_user_logon_password(password_policy)
    new_user_logon_xml = api_helpers.build_add_user_logon_xml(user_id, 'login_name',
                                                              password=random_password, skiptac=True)

    add_user_logon_parameters = AddUserLogon.ParamsObj(logger, new_user_logon_xml, hq_credentials=hq_credentials)
    response = await AddUserLogon.execute(add_user_logon_parameters, use_json=True)

An alternative would be to install Central and point it to your sandbox environment.

https://docs.q2developer.com/support/central_quick_reference.html#central-quick-reference

Posted 3 years ago
Jason Herbert
104 × 1 Administrator