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(): # create an instance of the API class api, username = get_api() 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 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(software_version): api, username = get_api() 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