Skip to content

Instantly share code, notes, and snippets.

@kognate
Created December 22, 2016 14:15
Show Gist options
  • Save kognate/4279b7a3091e5d20875b8ed079dd85c0 to your computer and use it in GitHub Desktop.
Save kognate/4279b7a3091e5d20875b8ed079dd85c0 to your computer and use it in GitHub Desktop.
I've add the source and a python notebook to get a config from discovery using the python sdk (version 0.23 has discovery)
import watson_developer_cloud
DISCOVERY_USERNAME='CHANGE_ME'
DISCOVERY_PASSWORD='CHANGE_ME'
ENVIRONMENT_NAME='CHANGE_ME'
CONFIGURATION_NAME='CHANGE_ME'
discovery = watson_developer_cloud.DiscoveryV1(
'2016-12-15',
username=DISCOVERY_USERNAME,
password=DISCOVERY_PASSWORD)
environments = discovery.get_environments()
target_environment = [x for x in environments['environments'] if x['name'] == ENVIRONMENT_NAME]
target_environment_id = target_environments[0]['environment_id']
configs = discovery.list_configurations(environment_id=target_environment_id)
target_config = [x for x in configs['configurations'] if x['name'] == CONFIGURATION_NAME]
target_config_id = target_config[0]['configuration_id']
config_data = discovery.get_configuration(environment_id=target_environment_id,
configuration_id=target_config_id)
print(config_data)
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment