def update(self): configuration = product_catalogue_py_rest_client.Configuration( host=self.database_url) configuration.access_token = self.token # Enter a context with an instance of the API client with product_catalogue_py_rest_client.ApiClient( configuration) as api_client: # Create an instance of the API class api_instance = product_catalogue_py_rest_client.ProductsL3DistApi( api_client) product_l3_src_id = self.product_l3_src.id product_l3_dist_dto = product_catalogue_py_rest_client.ProductL3DistDto( bathymetry_bag_location="", bathymetry_location=self.src_dist_name.s3_dest_tif, hillshade_location=self.src_dist_name.s3_hillshade_dest_tif, l3_coverage_location=self.src_dist_name.s3_dest_shp) try: api_response = api_instance.products_l3_dist_controller_create( product_l3_src_id, product_l3_dist_dto) logging.info(api_response) except ApiException as e: logging.error( "Exception when calling ProductsL3DistApi->products_l3_dist_controller_create: %s\n" % e)
def retrieve_l3_src_products_using_rest(self) -> List[ProductL3Src]: configuration = product_catalogue_py_rest_client.Configuration( host=self.source_tif_path ) configuration.access_token = self.bearer_id with product_catalogue_py_rest_client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = product_catalogue_py_rest_client.ProductsL3SrcApi( api_client) try: api_response = api_instance.products_l3_src_controller_find_all() # logging.info(api_response) return api_response except ApiException as e: logging.error( "Exception when calling CompilationsApi->compilations_controller_create: %s\n" % e)
def retrieve_surveys(self) -> List[Survey]: configuration = product_catalogue_py_rest_client.Configuration( host=self.source_tif_path ) configuration.access_token = self.bearer_id with product_catalogue_py_rest_client.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = product_catalogue_py_rest_client.SurveysApi( api_client) try: api_response = api_instance.surveys_controller_find_all( snapshot_date_time=self.snapshot_iso_datetime) # logging.info(api_response) return api_response except ApiException as e: logging.error( "Exception when calling CompilationsApi->compilations_controller_create: %s\n" % e)