Created
December 22, 2016 14:15
-
-
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment