diff --git a/README.md b/README.md index 03fe82c..22201b4 100644 --- a/README.md +++ b/README.md @@ -1 +1,5 @@ -## Accelerator python client \ No newline at end of file +## Accelerator python client + +# Build +Please follow [this link.](https://packaging.python.org/en/latest/tutorials/packaging-projects/) + diff --git a/accli/AcceleratorProjectService.py b/accli/AcceleratorProjectService.py index da4072f..962fe34 100644 --- a/accli/AcceleratorProjectService.py +++ b/accli/AcceleratorProjectService.py @@ -221,25 +221,63 @@ def abort_update_multipart_upload(self, bucket_object_id, upload_id): ), headers=headers ) - # TODO @wrufesh ensure it requires special token - def register_iamc_validation( - self, validated_bucket_object_id, indexdb_bucket_object_id + + # # TODO @wrufesh ensure it requires special token + # def register_iamc_validation( + # self, validated_bucket_object_id, indexdb_bucket_object_id + # ): + + # headers = {"Content-Type": "application/json"} + + # headers.update(self.common_request_headers) + + # res = self.http_client_request( + # "PUT", + # f"{self.cli_base_url}/register-iamc-validation", + # json=dict( + # validated_bucket_object_id=validated_bucket_object_id, + # indexdb_bucket_object_id=indexdb_bucket_object_id + # ), + # headers=headers + # ) + + def register_validation( + self, + validated_bucket_object_id: int, + dataset_template_id: int, + validated_metadata: dict ): - headers = {"Content-Type": "application/json"} headers.update(self.common_request_headers) res = self.http_client_request( "PUT", - f"{self.cli_base_url}/register-iamc-validation", + f"{self.cli_base_url}/register-validation", json=dict( validated_bucket_object_id=validated_bucket_object_id, - indexdb_bucket_object_id=indexdb_bucket_object_id + dataset_template_id=dataset_template_id, + validated_metadata=validated_metadata ), headers=headers ) + def get_dataset_template_details( + self, + dataset_template_id + ): + headers = {"Content-Type": "application/json"} + + headers.update(self.common_request_headers) + + res = self.http_client_request( + "GET", + f"{self.cli_base_url}/dataset-template-detail/{dataset_template_id}", + headers=headers + ) + + return res.json() + def read_part_data(self, stream, size, part_data=b"", progress=None): diff --git a/pyproject.toml b/pyproject.toml index f88d61a..f056025 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "accli" -version = "0.1.1" +version = "0.1.2" authors = [ { name="Wrufesh S", email="wrufesh@gmail.com" }, ]