def __init__(self, configuration_file_location, username, password, gateway_id): self.authenticator = Authenticator(configuration_file_location) self.token = self.authenticator.get_token_and_user_info_password_flow( username=username, password=password, gateway_id=gateway_id) self.gateway_id = gateway_id self.username = username self.password = password self.api_server_client = APIServerClient(configuration_file_location)
# See the License for the specific language governing permissions and # limitations under the License. # import logging from clients.tenant_profile_client import TenantProfileClient from clients.keycloak_token_fetcher import Authenticator from airavata.api.error.ttypes import TException logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) authenticator = Authenticator(); token = authenticator.get_token_and_user_info_password_flow("default-admin", "123456", "default") # load GroupManagerClient with default configuration #client = TenantProfileClient() # load client with given configuration file (e.g customized_settings.ini) client = TenantProfileClient('../transport/settings.ini') def get_all_gateways(): try: gws = client.get_all_gateways(token) print("Gateways ", gws) except TException:
ReplicaLocationCategory, ReplicaPersistentType from airavata.model.application.io.ttypes import InputDataObjectType from airavata.model.appcatalog.groupresourceprofile.ttypes import GroupResourceProfile from airavata.api.error.ttypes import TException, InvalidRequestException, AiravataSystemException, \ AiravataClientException, AuthorizationException logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) configFile = "/Users/isururanawaka/Documents/Cyberwater/poc/resources/settings.ini" authenticator = Authenticator(configFile) user_name = "username" password = "******" gateway_id = "cyberwater" token = authenticator.get_token_and_user_info_password_flow( username=user_name, password=password, gateway_id=gateway_id) api_server_client = APIServerClient(configFile) airavata_util = APIServerClientUtil(configFile, username=user_name, password=password, gateway_id=gateway_id) data_model_client = DataModelCreationUtil(configFile,