Repository: airavata-sandbox Updated Branches: refs/heads/master ef2916920 -> 6f3da7c39
http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/6f3da7c3/Interacting_with_Airavata_using_ipython_Notebook/Admin-User/appcatalog/appcatalog.py ---------------------------------------------------------------------- diff --git a/Interacting_with_Airavata_using_ipython_Notebook/Admin-User/appcatalog/appcatalog.py b/Interacting_with_Airavata_using_ipython_Notebook/Admin-User/appcatalog/appcatalog.py index 1716cdf..8498673 100644 --- a/Interacting_with_Airavata_using_ipython_Notebook/Admin-User/appcatalog/appcatalog.py +++ b/Interacting_with_Airavata_using_ipython_Notebook/Admin-User/appcatalog/appcatalog.py @@ -12,7 +12,7 @@ import sys import random from thrift.protocol import TBinaryProtocol -from thrift.transport import TSocket, TTransport ##, TSSLSocket +from thrift.transport import TSocket, TTransport, TSSLSocket from apache.airavata.api import Airavata from apache.airavata.model.security.ttypes import AuthzToken @@ -21,7 +21,7 @@ from apache.airavata.model.application.io.ttypes import InputDataObjectType, Out class AppCatalog: def __init__(self, hostName, port): # Create a socket to the Airavata Server - transport = TSocket.TSocket(hostName,port) + transport = TSSLSocket.TSSLSocket(hostName,port, validate=False) # Use Buffered Protocol to speedup over raw sockets transport = TTransport.TBufferedTransport(transport) @@ -33,18 +33,19 @@ class AppCatalog: transport.open() - client_id = r'XXXXXXXXXX' - client_secret = r'XXXXXXXXXXX' + #client_id = r'XXXXXXXXXX' + #client_secret = r'XXXXXXXXXXX' - client = BackendApplicationClient(client_id=client_id) - oauth = OAuth2Session(client=client) - token = oauth.fetch_token(token_url='https://idp.scigap.org:9443/oauth2/token', client_id=client_id, client_secret=client_secret) - self.authzToken = AuthzToken(token["access_token"]) + #client = BackendApplicationClient(client_id=client_id) + #oauth = OAuth2Session(client=client) + #token = oauth.fetch_token(token_url='https://idp.scigap.org:9443/oauth2/token', client_id=client_id, client_secret=client_secret) + #self.authzToken = AuthzToken(token["access_token"]) + self.authzToken = AuthzToken("") - claimsMap = {"userName":"admin","gatewayID": "Ultrascan_Production"} + claimsMap = {"userName":"admin","gatewayID": "seagrid"} self.authzToken.claimsMap = claimsMap - self.gateWayId = "Ultrascan_Production" + self.gateWayId = "seagrid" print self.airavataClient.getAPIVersion(self.authzToken) http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/6f3da7c3/Interacting_with_Airavata_using_ipython_Notebook/Admin-User/cli.properties ---------------------------------------------------------------------- diff --git a/Interacting_with_Airavata_using_ipython_Notebook/Admin-User/cli.properties b/Interacting_with_Airavata_using_ipython_Notebook/Admin-User/cli.properties index 9327692..32a6b24 100644 --- a/Interacting_with_Airavata_using_ipython_Notebook/Admin-User/cli.properties +++ b/Interacting_with_Airavata_using_ipython_Notebook/Admin-User/cli.properties @@ -1,13 +1,14 @@ [AiravataServer] -host=gw154.iu.xsede.org -port=8930 +host=gf5.ucs.indiana.edu +#host=gw56.iu.xsede.org +port=9930 #host=gw77.iu.xsede.org #port=9930 #port=10930 ## Gateway Specific Properties [GatewayProperties] -gateway_id=Ultrascan_Production +gateway_id=seagrid cred_token_id= #gateway_id=seagrid #cred_token_id=47507a08-1579-4883-be03-3c8e3b7da061 @@ -16,4 +17,3 @@ cred_token_id= host=stampede.tacc.xsede.org hostDesc=TACC Stampede Cluster jobManagerType=SLURM - http://git-wip-us.apache.org/repos/asf/airavata-sandbox/blob/6f3da7c3/Interacting_with_Airavata_using_ipython_Notebook/Admin-User/expcatalog/expcatalog.py ---------------------------------------------------------------------- diff --git a/Interacting_with_Airavata_using_ipython_Notebook/Admin-User/expcatalog/expcatalog.py b/Interacting_with_Airavata_using_ipython_Notebook/Admin-User/expcatalog/expcatalog.py index d49edf9..c621a9a 100644 --- a/Interacting_with_Airavata_using_ipython_Notebook/Admin-User/expcatalog/expcatalog.py +++ b/Interacting_with_Airavata_using_ipython_Notebook/Admin-User/expcatalog/expcatalog.py @@ -17,7 +17,7 @@ import sys import random from thrift.protocol import TBinaryProtocol -from thrift.transport import TSocket, TTransport ##, TSSLSocket +from thrift.transport import TSocket, TTransport, TSSLSocket from apache.airavata.api import Airavata from apache.airavata.model.security.ttypes import AuthzToken @@ -26,7 +26,7 @@ from apache.airavata.model.application.io.ttypes import InputDataObjectType, Out class ExpCatalog: def __init__(self, hostName, port): # Create a socket to the Airavata Server - transport = TSocket.TSocket(hostName,port) + transport = TSSLSocket.TSSLSocket(hostName,port, validate=False) # Use Buffered Protocol to speedup over raw sockets transport = TTransport.TBufferedTransport(transport) @@ -38,19 +38,20 @@ class ExpCatalog: transport.open() - client_id = r'XXXXXXXXX' - client_secret = r'XXXXXXXXX' - - client = BackendApplicationClient(client_id=client_id) - oauth = OAuth2Session(client=client) - token = oauth.fetch_token(token_url='https://idp.scigap.org:9443/oauth2/token', client_id=client_id, client_secret=client_secret) - self.authzToken = AuthzToken(token["access_token"]) + #client_id = r'XXXXXXXXX' + #client_secret = r'XXXXXXXXX' + + #client = BackendApplicationClient(client_id=client_id) + #oauth = OAuth2Session(client=client) + #token = oauth.fetch_token(token_url='https://idp.scigap.org:9443/oauth2/token', client_id=client_id, client_secret=client_secret) + #self.authzToken = AuthzToken(token["access_token"]) + self.authzToken = AuthzToken("empty-token") - claimsMap = {"userName":"admin","gatewayID": "Ultrascan_Production"} + claimsMap = {"userName":"admin","gatewayID": "seagrid"} self.authzToken.claimsMap = claimsMap - self.gateWayId = "default" - + self.gateWayId = "seagrid" + print(self.authzToken) print (self.airavataClient.getAPIVersion(self.authzToken)) def getExperiment(self, expId):
