def getService(app): idadb = IdaDataBase(dsn=IBMCloudEnv.getString('dashdb_jdbcurl')) content = {'idadb': idadb, 'idadf': IdaDataFrame} return 'dashdb-json', content
def getService(app): config = {} SERVER_URL = IBMCloudEnv.getString('appid_oauth_server_url') PUBLIC_KEY_URL = SERVER_URL + "/publickey" TOKEN_PATH = SERVER_URL + "/token" INTROSPECTION_URL = SERVER_URL + "/introspect" AUTH_URL = SERVER_URL + "/authorization" content = urllib2.urlopen(PUBLIC_KEY_URL).read() publicKeyJson = content parsed = json.loads(publicKeyJson) pem = pemFromModExp(parsed['n'], parsed['e']) config['appid-public-key'] = publicKeyJson config['appid-pem'] = pem config['appid-context'] = 'APPID_AUTH_CONTEXT' config['appid-client-id'] = IBMCloudEnv.getString('appid_client_id') config['appid-authorization-endpoint'] = AUTH_URL config['appid-secret'] = IBMCloudEnv.getString('appid_secret') config['appid-token-path'] = TOKEN_PATH config['appid-introspect-path'] = INTROSPECTION_URL return 'appid', config
from ibm_cloud_env import IBMCloudEnv from watson_developer_cloud import SpeechToTextV1 speech_to_text = SpeechToTextV1( username=IBMCloudEnv.getString('watson_speech_to_text_username'), password=IBMCloudEnv.getString('watson_speech_to_text_password'), x_watson_learning_opt_out=True) def getService(app): return 'watson-speech-to-text', speech_to_text
from ibm_cloud_env import IBMCloudEnv from watson_developer_cloud import DocumentConversionV1 document_conversion = DocumentConversionV1( username=IBMCloudEnv.getString('watson_document_conversion_username'), password=IBMCloudEnv.getString('watson_document_conversion_password'), version='2016-02-10') def getService(app): return 'watson-document-conversion', document_conversion
from ibm_cloud_env import IBMCloudEnv from watson_developer_cloud import ToneAnalyzerV3 tone_analyzer = ToneAnalyzerV3( username=IBMCloudEnv.getString('watson_tone_analyzer_username'), password=IBMCloudEnv.getString('watson_tone_analyzer_password'), version='2016-05-19') def getService(app): return 'watson-tone-analyzer', tone_analyzer
from ibm_cloud_env import IBMCloudEnv import swiftclient authurl = IBMCloudEnv.getString('object_storage_auth_url') if not '/v3' in authurl: authurl += '/v3' user = IBMCloudEnv.getString('object_storage_user_id') key = IBMCloudEnv.getString('object_storage_password') os_options = { 'project_id': IBMCloudEnv.getString('object_storage_project_id'), 'user_id': IBMCloudEnv.getString('object_storage_user_id'), 'region_name': IBMCloudEnv.getString('object_storage_region') } def getService(app): objectStorage = swiftclient.Connection(authurl=authurl, user=user, key=key, os_options=os_options, auth_version='3') return 'object-storage', objectStorage
from ibm_cloud_env import IBMCloudEnv from watson_developer_cloud import RetrieveAndRankV1 retrieve_and_rank = RetrieveAndRankV1( username=IBMCloudEnv.getString('watson_retrieve_and_rank_username'), password=IBMCloudEnv.getString('watson_retrieve_and_rank_password')) def getService(app): return 'watson-retrieve-and-rank', retrieve_and_rank
from ibm_cloud_env import IBMCloudEnv from watson_developer_cloud import LanguageTranslatorV2 language_translator = LanguageTranslatorV2( username=IBMCloudEnv.getString('watson_language_translator_username'), password=IBMCloudEnv.getString('watson_language_translator_password')) def getService(app): return 'watson-language-translator', language_translator
from ibm_cloud_env import IBMCloudEnv from watson_developer_cloud import DiscoveryV1 discovery = DiscoveryV1( username=IBMCloudEnv.getString('watson_discovery_username'), password=IBMCloudEnv.getString('watson_discovery_password'), version='2016-12-01') def getService(app): return 'watson-discovery', discovery
from ibm_cloud_env import IBMCloudEnv config = { 'url' : IBMCloudEnv.getString('alert_notification_url') if True else https://ibmnotifybm.mybluemix.net/api/alerts/v1', 'name': IBMCloudEnv.getString('alert_notification_name') if True else '', 'password': IBMCloudEnv.getString('alert_notification_password') if True else '' } def getService(app): return 'alert-notification', config
from ibm_cloud_env import IBMCloudEnv from watson_developer_cloud import ConversationV1 conversation = ConversationV1( username=IBMCloudEnv.getString('watson_conversation_username'), password=IBMCloudEnv.getString('watson_conversation_password'), version='2017-05-26') def getService(app): return 'watson-conversation', conversation
from ibm_cloud_env import IBMCloudEnv from watson_developer_cloud import VisualRecognitionV3 visual_recognition = VisualRecognitionV3( api_key=IBMCloudEnv.getString('watson_visual_recognition_api_key'), version='2016-05-20') def getService(app): return 'watson-visual-recognition', visual_recognition
from ibm_cloud_env import IBMCloudEnv from watson_developer_cloud import NaturalLanguageClassifierV1 natural_language_classifier = NaturalLanguageClassifierV1( username=IBMCloudEnv.getString( 'watson_natural_language_classifier_username'), password=IBMCloudEnv.getString( 'watson_natural_language_classifier_password')) def getService(app): return 'watson-natural-language-classifier', natural_language_classifier
from ibm_cloud_env import IBMCloudEnv from watson_developer_cloud import NaturalLanguageUnderstandingV1 natural_language_understanding = NaturalLanguageUnderstandingV1( username=IBMCloudEnv.getString( 'watson_natural_language_understanding_username'), password=IBMCloudEnv.getString( 'watson_natural_language_understanding_password'), version='2017-02-27') def getService(app): return 'watson-natural-language-understanding', natural_language_understanding
from ibm_cloud_env import IBMCloudEnv from cloudant.client import Cloudant cloudant = Cloudant(IBMCloudEnv.getString('cloudant_url')) def getService(app): return 'cloudant', cloudant
from ibm_cloud_env import IBMCloudEnv import swiftclient credentials = { 'auth_version': '3', 'os_options': { 'project_id': IBMCloudEnv.getString("object_storage_project_id"), 'user_id': IBMCloudEnv.getString("object_storage_user_id"), 'region_name': IBMCloudEnv.getString("object_storage_region") } } def getService(app): objectStorage = swiftclient.Connection(credentials) return 'object-storage', objectStorage
from ibm_cloud_env import IBMCloudEnv config = { 'url': IBMCloudEnv.getString('alert_notification_url') if True else 'https://ibmnotifybm.mybluemix.net/api/alerts/v1', 'name': IBMCloudEnv.getString('alert_notification_name') if True else '', 'password': IBMCloudEnv.getString('alert_notification_password') if True else '' } def getService(app): return 'alert-notification', config
def getService(app): mongoConnect = IBMCloudEnv.getString('mongodb_uri') client = MongoClient(mongoConnect) return 'mongodb', client
from ibm_cloud_env import IBMCloudEnv import psycopg2 url = IBMCloudEnv.getString('postgre_uri') def getService(app): client = psycopg2.connect(url) return 'postgre-client', client
from ibm_cloud_env import IBMCloudEnv from cloudant.client import Cloudant username = IBMCloudEnv.getString('cloudant_username') password = IBMCloudEnv.getString('cloudant_password') url = IBMCloudEnv.getString('cloudant_url') cloudant = Cloudant(username, password, url=url, connect=True, auto_renew=True) def getService(app): return 'cloudant', cloudant
from ibm_cloud_env import IBMCloudEnv from watson_developer_cloud import PersonalityInsightsV3 personality_insights = PersonalityInsightsV3( username=IBMCloudEnv.getString('watson_personality_insights_username'), password=IBMCloudEnv.getString('watson_personality_insights_password'), version='2016-10-20') def getService(app): return 'watson-personality-insights', personality_insights