We need to have a placeholder ({braincube-name}) in braincube_base_url, to replace it with the name of the braincube, in order to be able to specify a path to a specific braincube.
{braincube-name} would be dynamically replaced by the name of the braincube. If there is no {braincube-name} placeholder, then we keep our current URL build method.
##################################################
# Using domain
##################################################
client.get_instance(config_dict={"domain":"mybraincube.com"})
bc = braincube.get_braincube("demo") # calls https://api.mybraincube.com/braincube/demo
##################################################
# Using braincube_base_url without placeholder
##################################################
client.get_instance(config_dict={"braincube_base_url":"https://api.mybraincube.com"})
bc = braincube.get_braincube("demo") # calls https://api.mybraincube.com/braincube/demo
##################################################
# Using braincube_base_url with placeholder
##################################################
client.get_instance(config_dict={"braincube_base_url":"https://api.mybraincube.com/braincube/{braincube-name}"})
bc = braincube.get_braincube("demo") # calls https://api.mybraincube.com/braincube/demo
We need to have a placeholder (
{braincube-name}) inbraincube_base_url, to replace it with the name of the braincube, in order to be able to specify a path to a specific braincube.{braincube-name}would be dynamically replaced by the name of the braincube. If there is no{braincube-name}placeholder, then we keep our current URL build method.