def get(self): api, username = get_api(profile=self.profile) api_instance = modelcatalog.SoftwareVersionApi(api) try: # List all Person entities api_response = api_instance.softwareversions_get(username=username) return api_response except ApiException as e: raise e
def get(self): api, username = get_api(profile=self.profile) api_instance = modelcatalog.DatasetSpecificationApi(api) try: api_response = api_instance.datasetspecifications_get( username=username) return api_response except ApiException as e: raise e
def get(self): api, username = get_api(profile=self.profile) api_instance = modelcatalog.SampleResourceApi(api) try: # List all Person entities api_response = api_instance.sampleresources_get(username=username) return api_response except ApiException as e: raise e
def get(self): api, username = get_api(profile=self.profile) api_instance = modelcatalog.DataTransformationApi(api) try: # List all Person entities api_response = api_instance.datatransformations_get(username=username) return api_response except ApiException as e: raise e
def get(self): # create an instance of the API class api, username = get_api(profile=self.profile) api_instance = modelcatalog.PersonApi(api) try: # List all Person entities api_response = api_instance.persons_get(username=username) return api_response except ApiException as e: raise e
def post(self, request): api, username = get_api(profile=self.profile) api_instance = modelcatalog.ModelApi(api) model = Model(**request) if isinstance(request, dict) else request try: api_response = api_instance.models_post(username, model=model) return api_response except ApiException as e: logging.error("Exception when calling ModelConfigurationSetupApi->modelconfigurationsetups_post: %s\n" % e) raise e
def get_one(self, _id): api, username = get_api(profile=self.profile) api_instance = modelcatalog.ModelConfigurationApi(api) try: # List all Person entities api_response = api_instance.modelconfigurations_id_get( id=_id, username=username) return api_response except ApiException as e: raise e
def put(self, request): model_id = obtain_id(request.id) api, username = get_api(profile=self.profile) api_instance = modelcatalog.ModelApi(api) model = Model(**request) if isinstance(request, dict) else request try: # Update a Model return api_instance.models_id_put(model_id, username, model=model) except ApiException as e: print("Exception when calling ModelApi->models_id_put: %s\n" % e)
def post(self, request): api, username = get_api(profile=self.profile) api_instance = modelcatalog.DataTransformationApi(api) data_transformation = DataTransformation(**request) if isinstance(request, dict) else request try: api_response = api_instance.datatransformations_post(user=username, data_transformation=data_transformation) return api_response except ApiException as e: logging.error( "Exception when calling ModelConfigurationConfigurationSetupApi->modelconfigurationsetups_post: %s\n" % e) raise e return api_response
def test_get_api(): runner = CliRunner() model_catalog = os.environ['MODEL_CATALOG_PASSWORD'] result = runner.invoke(credentials, [ "--server", "https://api.models.mint.isi.edu/v1.4.0", "--username", "*****@*****.**", "--git_username", "mintbot", "--git_token", "asdfsafs", "--password", model_catalog, "--dockerhub_username", "a", "--name", "pedro", "--profile", "testing" ]) assert result.exit_code == 0 api = get_api(profile="testing") assert api
def post(self, request): api, username = get_api(profile=self.profile) api_instance = modelcatalog.SoftwareVersionApi(api) software_version = SoftwareVersion( **request) if isinstance(request, dict) else request try: api_response = api_instance.softwareversions_post( user=username, software_version=software_version) return api_response except ApiException as e: logging.error( "Exception when calling ModelConfigurationSetupApi->modelconfigurationsetups_post: %s\n" % e) raise
def put(self, software_version): api, username = get_api(profile=self.profile) api_instance = modelcatalog.SoftwareVersionApi(api) try: version_id = software_version.id.replace(MODEL_CATALOG_URL, '') api_response = api_instance.softwareversions_id_put( version_id, username, software_version=software_version) return api_response except ApiException as e: logging.error( "Exception when calling SoftwareVersionApi->softwareversions_id_put: %s\n" % e) raise e return api_response
def put(self, request): model_id = obtain_id(request.id) api, username = get_api(profile=self.profile) api_instance = modelcatalog.DatasetSpecificationApi(api) data_set = DatasetSpecification( **request) if isinstance(request, dict) else request try: # Update a Model return api_instance.datasetspecifications_id_put( id=model_id, user=username, dataset_specification=data_set) except ApiException as e: logging.error( "Exception when calling ModelConfigurationConfigurationSetupApi->modelconfigurationsetups_post: %s\n" % e) raise e