From b070a639fd957219a477889e709334105017df0c Mon Sep 17 00:00:00 2001 From: Maria Carmina Date: Fri, 28 Oct 2022 17:57:07 +0300 Subject: [PATCH 01/13] Documentation for initializeCompute. --- ocean_provider/routes/README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 ocean_provider/routes/README.md diff --git a/ocean_provider/routes/README.md b/ocean_provider/routes/README.md new file mode 100644 index 00000000..5edee3fa --- /dev/null +++ b/ocean_provider/routes/README.md @@ -0,0 +1,31 @@ + + +# Possible errors returned by Provider + +This document reflects couple of the possible errors returned by Provider. +## Compute routes + +### initializeCompute + +In order to consume a data service the user is required to send +one datatoken to the provider, as well as provider fees for the compute job. + +#### 400 - Bad Request + +It occurs when the payload is incorrect, either at least one parameter is missing. +The following messages attached to this status code are: + +- **The validUntil value is not correct.** +- **Compute environment does not exist.** +- **DID is not a valid algorithm.** + +#### 503 - Service Unavailable + +It shows up when Provider server is not responding. + + + + From f3f63ae1ea00f21668034736109fa116d8e795f2 Mon Sep 17 00:00:00 2001 From: Maria Carmina Date: Mon, 31 Oct 2022 17:39:00 +0200 Subject: [PATCH 02/13] Changed to JSON format. Provided description. --- ocean_provider/routes/README.md | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/ocean_provider/routes/README.md b/ocean_provider/routes/README.md index 5edee3fa..a75ab7b7 100644 --- a/ocean_provider/routes/README.md +++ b/ocean_provider/routes/README.md @@ -16,11 +16,27 @@ one datatoken to the provider, as well as provider fees for the compute job. #### 400 - Bad Request It occurs when the payload is incorrect, either at least one parameter is missing. -The following messages attached to this status code are: - -- **The validUntil value is not correct.** -- **Compute environment does not exist.** -- **DID is not a valid algorithm.** +The following errors are displayed in JSON format: + +```python +{ + "error": "The validUntil value is not correct." +} +``` +**Reason** `validUntil` value is most probably expired. + +```python +{ + "error": "Compute environment does not exist." +} +``` +**Reason** If you are trying to initialize a compute service, the compute values need to be provided. +```python +{ + "error": "DID is not a valid algorithm." +} +``` +**Reason** Either the DID is incorrect typed, either the algorithm timeout expired. #### 503 - Service Unavailable From eb546453b8ce665123607fb464183b488e288947 Mon Sep 17 00:00:00 2001 From: Maria Carmina Date: Mon, 21 Nov 2022 21:45:43 +0200 Subject: [PATCH 03/13] Added new validation errors for alogirthm. --- ocean_provider/routes/README.md | 51 +++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/ocean_provider/routes/README.md b/ocean_provider/routes/README.md index a75ab7b7..6337a8d4 100644 --- a/ocean_provider/routes/README.md +++ b/ocean_provider/routes/README.md @@ -13,11 +13,56 @@ This document reflects couple of the possible errors returned by Provider. In order to consume a data service the user is required to send one datatoken to the provider, as well as provider fees for the compute job. -#### 400 - Bad Request +#### 1. 400 - Bad Request -It occurs when the payload is incorrect, either at least one parameter is missing. +It occurs when the validation part fails. The following errors are displayed in JSON format: +##### 1.1 For algorithm validation +```python +{ + "additional_input": "invalid" +} +``` +**Reason** The `additional_inputs` key is not a list. + +```python +{ + "algorithm": "missing_meta_documentId" +} +``` +**Reason** Either algorithm metadata, either algorithm DID is missing. + +```python +{ + "algorithm": "file_unavailable" +} +``` +**Reason** One possibility is that the asset could not be retrieved from Aquarius's database. +Otherwise, there are issues related to `services`, such as: +- particular `service` is not found; +- `datatokenAddress`, `nftAddress`, `files` information are missing from the +decrypted files object. + +```python +{ + "algorithm": "not_algo" +} +``` +**Reason** The `type` from the algorithm's metadata is not specified as `algorithm`. + +```python +{ + "algorithm.serviceId": "missing" +} +``` +**Reason** The `serviceId` key is missing from the algorithm's DDO. + + + + + + ```python { "error": "The validUntil value is not correct." @@ -38,7 +83,7 @@ The following errors are displayed in JSON format: ``` **Reason** Either the DID is incorrect typed, either the algorithm timeout expired. -#### 503 - Service Unavailable +#### 2. 503 - Service Unavailable It shows up when Provider server is not responding. From bb6afa3e08b438f24cb0ddcad9e2f4fee4df4dd3 Mon Sep 17 00:00:00 2001 From: Maria Carmina Date: Tue, 22 Nov 2022 02:21:52 +0200 Subject: [PATCH 04/13] Finished algo validation. --- ocean_provider/routes/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ocean_provider/routes/README.md b/ocean_provider/routes/README.md index 6337a8d4..f327edd1 100644 --- a/ocean_provider/routes/README.md +++ b/ocean_provider/routes/README.md @@ -41,8 +41,12 @@ The following errors are displayed in JSON format: **Reason** One possibility is that the asset could not be retrieved from Aquarius's database. Otherwise, there are issues related to `services`, such as: - particular `service` is not found; -- `datatokenAddress`, `nftAddress`, `files` information are missing from the -decrypted files object. +- `Key not found in files.` - `datatokenAddress` or `nftAddress` or `files` is missing +the decrypted files object; +- `Mismatch of datatoken.` - mismatch between service datatoken & decrypted files datatoken; +- `Mismatch of dataNft.` - mismatch between asset data NFT address & the one from the decrypted files; +- `Expected a files list` - `files` is not a list; +- `Error decrypting service files` - other errors for decrypting the file. ```python { @@ -59,10 +63,6 @@ decrypted files object. **Reason** The `serviceId` key is missing from the algorithm's DDO. - - - - ```python { "error": "The validUntil value is not correct." From 89def666597aa5b0fd95adcd08d5089b8625071f Mon Sep 17 00:00:00 2001 From: Maria Carmina Date: Tue, 22 Nov 2022 19:50:03 +0200 Subject: [PATCH 05/13] Completed errors for initialize endpoint. --- ocean_provider/routes/README.md | 78 ++++++++++++++++++++++++++++++++- 1 file changed, 76 insertions(+), 2 deletions(-) diff --git a/ocean_provider/routes/README.md b/ocean_provider/routes/README.md index f327edd1..a8b127ac 100644 --- a/ocean_provider/routes/README.md +++ b/ocean_provider/routes/README.md @@ -40,12 +40,22 @@ The following errors are displayed in JSON format: ``` **Reason** One possibility is that the asset could not be retrieved from Aquarius's database. Otherwise, there are issues related to `services`, such as: -- particular `service` is not found; +- particular `service` is not found + + - `Key not found in files.` - `datatokenAddress` or `nftAddress` or `files` is missing -the decrypted files object; +the decrypted files object + + - `Mismatch of datatoken.` - mismatch between service datatoken & decrypted files datatoken; + + - `Mismatch of dataNft.` - mismatch between asset data NFT address & the one from the decrypted files; + + - `Expected a files list` - `files` is not a list; + + - `Error decrypting service files` - other errors for decrypting the file. ```python @@ -55,13 +65,77 @@ the decrypted files object; ``` **Reason** The `type` from the algorithm's metadata is not specified as `algorithm`. + ```python { "algorithm.serviceId": "missing" } ``` +or + +```python +{ + "algorithm.serviceId": "not_found" +} +``` + **Reason** The `serviceId` key is missing from the algorithm's DDO. +```python +{ + "algorithm.documentId": "did_not_found" +} +``` + +**Reason** The asset `DID` could not be retrieved from the metadata store. + +```python +{ + "error": "Asset malformed" +} +``` +**Reason** Data NFT address is not present in the asset object. + +```python +{ + "error": "Asset is not consumable." +} +``` + +**Reason** Metadata status is not in the range of valid status codes for +assets. + +```python +{ + "error": "Error: Access to asset was denied with code: ." +} +``` +**Reason** Asset cannot be accessed due to error status code. + +```python +{ + "algorithm.serviceId": "service_not_access_compute" +} +``` + +**Reason** Service type is neither `access`, nor `compute`. + +```python +{ + "algorithm.serviceId": "main_service_compute" +} +``` + +**Reason** If the main service is not `compute` for this asset when calling `initialize` +endpoint. + +```python +{ + "algorithm.serviceId": "compute_services_not_in_same_provider" +} +``` + +**Reason** Files attached to the compute service are not decrypted by the correct provider. ```python { From 6bb64456431006cfeb22565d62c03bd248f2ddac Mon Sep 17 00:00:00 2001 From: Maria Carmina Date: Tue, 6 Dec 2022 05:30:50 +0200 Subject: [PATCH 06/13] Resolved requested changes for initializeCompute route. --- ocean_provider/routes/README.md | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/ocean_provider/routes/README.md b/ocean_provider/routes/README.md index a8b127ac..ecc5d884 100644 --- a/ocean_provider/routes/README.md +++ b/ocean_provider/routes/README.md @@ -63,7 +63,7 @@ the decrypted files object "algorithm": "not_algo" } ``` -**Reason** The `type` from the algorithm's metadata is not specified as `algorithm`. +**Reason** The `type` from the algorithm's metadata from the algorithm DDO is not specified as `algorithm`. ```python @@ -71,7 +71,7 @@ the decrypted files object "algorithm.serviceId": "missing" } ``` -or +**Reason** The `serviceId` key is missing from the algorithm's DDO. ```python { @@ -79,7 +79,7 @@ or } ``` -**Reason** The `serviceId` key is missing from the algorithm's DDO. +**Reason** The provided `serviceId` does not exist. ```python { @@ -87,14 +87,15 @@ or } ``` -**Reason** The asset `DID` could not be retrieved from the metadata store. +**Reason** The algorithm's `DID` could not be retrieved from the metadata store, +because the algorithm asset does not exist. ```python { "error": "Asset malformed" } ``` -**Reason** Data NFT address is not present in the asset object. +**Reason** The asset published on chain is malformed, missing some required keys or not compliant with our schemas. ```python { @@ -102,8 +103,10 @@ or } ``` -**Reason** Metadata status is not in the range of valid status codes for -assets. +**Reason** Asset's metadata status is not in the range of valid status codes for +assets. The recognized states for the metadata are +defined on our [docs](https://docs.oceanprotocol.com/core-concepts/did-ddo#state). + ```python { @@ -136,6 +139,8 @@ endpoint. ``` **Reason** Files attached to the compute service are not decrypted by the correct provider. +This occurs when both `asset` and `algorithm` are requested by their compute service +which cannot be decrypted by a single provider as how it is supposed to be. ```python { @@ -149,13 +154,14 @@ endpoint. "error": "Compute environment does not exist." } ``` -**Reason** If you are trying to initialize a compute service, the compute values need to be provided. +**Reason** The compute environment provided by the user does not exist, it is not served by our compute-to-data feature. +The user can use `get_c2d_environments` to check the list of available compute environments. ```python { "error": "DID is not a valid algorithm." } ``` -**Reason** Either the DID is incorrect typed, either the algorithm timeout expired. +**Reason** Either the algorithm asset's DID is incorrectly typed, either the algorithm timeout expired. #### 2. 503 - Service Unavailable From f89a7bfba66bacb1b07624c4f84b3c137000bd1d Mon Sep 17 00:00:00 2001 From: Maria Carmina Date: Tue, 6 Dec 2022 18:19:45 +0200 Subject: [PATCH 07/13] Modified initializeCompute and started startCompute. --- ocean_provider/routes/README.md | 368 ++++++++++++++++++++++++++++++++ 1 file changed, 368 insertions(+) diff --git a/ocean_provider/routes/README.md b/ocean_provider/routes/README.md index ecc5d884..a7065b63 100644 --- a/ocean_provider/routes/README.md +++ b/ocean_provider/routes/README.md @@ -65,6 +65,19 @@ the decrypted files object ``` **Reason** The `type` from the algorithm's metadata from the algorithm DDO is not specified as `algorithm`. +```python +{ + "algorithm.documentId": "missing" +} +``` +**Reason** The `documentId` key is missing from the algorithm's DDO. + +```python +{ + "algorithm.transferTxId": "missing" +} +``` +**Reason** The `transferTxId` key is missing from the algorithm's DDO. ```python { @@ -142,6 +155,109 @@ endpoint. This occurs when both `asset` and `algorithm` are requested by their compute service which cannot be decrypted by a single provider as how it is supposed to be. +```python +{ + "error": "not_trusted_algo_publisher" +} +``` +**Reason** The owner of the algorithm's DDO is not a trusted algorithms publishers list. + +```python +{ + "error": "not_trusted_algo" +} +``` +**Reason** The algorithm's DID is not a trusted algorithms' dictionary. + +```python +{ + "error": "no_publisherTrustedAlgorithms" +} +``` +**Reason** The algorithm's key `publisherTrustedAlgorithms` does not exist in the algorithm's DDO. + +```python +{ + "error": "algorithm_file_checksum_mismatch" +} +``` +**Reason** The `filesChecksum` from the algorithm's DDO is invalid. + +```python +{ + "error": "algorithm_container_checksum_mismatch" +} +``` +**Reason** The `containerChecksum` from the algorithm's DDO is invalid. + +```python +{ + "error": "no_raw_algo_allowed" +} +``` +**Reason** Privacy option regarding raw algorithms is disabled. + +```python +{ + "algorithm": "in_use_or_not_on_chain" +} +``` +**Reason** Validation order for the algorithm failed due to the fact that the algorithm +has already an order in use, or it does not exist on the chain. + +```python +{ + "algorithm.": "did_not_found" +} +``` +**Reason** Algorithm's DID does not exist in the Metadata store. Also, `url` or `remote` +are missing from algorithm's DDO. + +```python +{ + "algorithm.": "meta_oneof_url_rawcode_remote" +} +``` +**Reason** Algorithm's DDO does not contain the following keys: + +- `url` +- `rawcode` +- `remote` + +```python +{ + "algorithm.container": "missing_entrypoint_image_checksum" +} +``` +**Reason** Either `entrypoint`, either `image`, or either `checksum` are missing from the container dictionary from the algorithm's +DDO. + +```python +{ + "algorithm.container": "checksum_prefix" +} +``` +**Reason** Container checksum does not start with the prefix `sha256:`. + +```python +{ + "output": "invalid" +} +``` +**Reason** The algorithm's validation after the build stage has not been +decoded properly as a dictionary. + +##### 1.2 For order fees validation + +```python +{ + "order": "fees_not_paid" +} +``` +**Reason** Provider fees are not paid. + +##### 1.3 For other validation errors + ```python { "error": "The validUntil value is not correct." @@ -168,5 +284,257 @@ The user can use `get_c2d_environments` to check the list of available compute e It shows up when Provider server is not responding. +### startCompute + +Starts the execution of the workflow and runs the provided algorithm. + +#### 1. 400 - Bad Request + +It occurs when the validation part fails. +The following errors are displayed in JSON format: + +##### 1.1 For algorithm validation +```python +{ + "additional_input": "invalid" +} +``` +**Reason** The `additional_inputs` key is not a list. + +```python +{ + "algorithm": "missing_meta_documentId" +} +``` +**Reason** Either algorithm metadata, either algorithm DID is missing. + +```python +{ + "algorithm": "file_unavailable" +} +``` +**Reason** One possibility is that the asset could not be retrieved from Aquarius's database. +Otherwise, there are issues related to `services`, such as: +- particular `service` is not found + + +- `Key not found in files.` - `datatokenAddress` or `nftAddress` or `files` is missing +the decrypted files object + + +- `Mismatch of datatoken.` - mismatch between service datatoken & decrypted files datatoken; + + +- `Mismatch of dataNft.` - mismatch between asset data NFT address & the one from the decrypted files; + + +- `Expected a files list` - `files` is not a list; + + +- `Error decrypting service files` - other errors for decrypting the file. + +```python +{ + "algorithm": "not_algo" +} +``` +**Reason** The `type` from the algorithm's metadata from the algorithm DDO is not specified as `algorithm`. + +```python +{ + "algorithm.documentId": "missing" +} +``` +**Reason** The `documentId` key is missing from the aalgorithm's DDO. + +```python +{ + "algorithm.transferTxId": "missing" +} +``` +**Reason** The `transferTxId` key is missing from the algorithm's DDO. + +```python +{ + "algorithm.serviceId": "missing" +} +``` +**Reason** The `serviceId` key is missing from the algorithm's DDO. + + +```python +{ + "algorithm.documentId": "did_not_found" +} +``` + +**Reason** The algorithm's `DID` could not be retrieved from the metadata store, +because the algorithm asset does not exist. + +```python +{ + "algorithm.serviceId": "not_found" +} +``` + +**Reason** The provided `serviceId` does not exist. + +```python +{ + "error": "Asset malformed" +} +``` +**Reason** The asset published on chain is malformed, missing some required keys or not compliant with our schemas. + +```python +{ + "error": "Asset is not consumable." +} +``` + +**Reason** Asset's metadata status is not in the range of valid status codes for +assets. The recognized states for the metadata are +defined on our [docs](https://docs.oceanprotocol.com/core-concepts/did-ddo#state). + + +```python +{ + "error": "Error: Access to asset was denied with code: ." +} +``` +**Reason** Asset cannot be accessed due to error status code. + +```python +{ + "algorithm.serviceId": "service_not_access_compute" +} +``` + +**Reason** Service type is neither `access`, nor `compute`. + +```python +{ + "algorithm.serviceId": "main_service_compute" +} +``` + +**Reason** If the main service is not `compute` for this asset when calling `initialize` +endpoint. + +```python +{ + "algorithm.serviceId": "compute_services_not_in_same_provider" +} +``` + +**Reason** Files attached to the compute service are not decrypted by the correct provider. +This occurs when both `asset` and `algorithm` are requested by their compute service +which cannot be decrypted by a single provider as how it is supposed to be. + + +```python +{ + "error": "not_trusted_algo_publisher" +} +``` +**Reason** The owner of the algorithm's DDO is not a trusted algorithms publishers list. + +```python +{ + "error": "not_trusted_algo" +} +``` +**Reason** The algorithm's DID is not a trusted algorithms' dictionary. + +```python +{ + "error": "no_publisherTrustedAlgorithms" +} +``` +**Reason** The algorithm's key `publisherTrustedAlgorithms` does not exist in the algorithm's DDO. + +```python +{ + "error": "algorithm_file_checksum_mismatch" +} +``` +**Reason** The `filesChecksum` from the algorithm's DDO is invalid. + +```python +{ + "error": "algorithm_container_checksum_mismatch" +} +``` +**Reason** The `containerChecksum` from the algorithm's DDO is invalid. + +```python +{ + "error": "no_raw_algo_allowed" +} +``` +**Reason** Privacy option regarding raw algorithms is disabled. + +```python +{ + "algorithm": "in_use_or_not_on_chain" +} +``` +**Reason** Validation order for the algorithm failed due to the fact that the algorithm +has already an order in use, or it does not exist on the chain. + +```python +{ + "algorithm.": "did_not_found" +} +``` +**Reason** Algorithm's DID does not exist in the Metadata store. Also, `url` or `remote` +are missing from algorithm's DDO. + +```python +{ + "algorithm.": "meta_oneof_url_rawcode_remote" +} +``` +**Reason** Algorithm's DDO does not contain the following keys: + +- `url` +- `rawcode` +- `remote` + +```python +{ + "algorithm.container": "missing_entrypoint_image_checksum" +} +``` +**Reason** Either `entrypoint`, either `image`, or either `checksum` are missing from the container dictionary from the algorithm's +DDO. + +```python +{ + "algorithm.container": "checksum_prefix" +} +``` +**Reason** Container checksum does not start with the prefix `sha256:`. + +```python +{ + "output": "invalid" +} +``` +**Reason** The algorithm's validation after the build stage has not been +decoded properly as a dictionary. + +##### 1.2 For order fees validation + +```python +{ + "order": "fees_not_paid" +} +``` +**Reason** Provider fees are not paid. + +#### 2. 401 - Consumer signature is invalid or failed verification +#### 3. 503 - Service Unavailable +It shows up when Provider server is not responding. \ No newline at end of file From ef948471448433a5089685d0be0f26830b436fa3 Mon Sep 17 00:00:00 2001 From: Maria Carmina Date: Wed, 7 Dec 2022 17:18:33 +0200 Subject: [PATCH 08/13] Re-tweaked startCompute. --- ocean_provider/routes/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ocean_provider/routes/README.md b/ocean_provider/routes/README.md index a7065b63..5ddf7617 100644 --- a/ocean_provider/routes/README.md +++ b/ocean_provider/routes/README.md @@ -533,7 +533,10 @@ decoded properly as a dictionary. ``` **Reason** Provider fees are not paid. -#### 2. 401 - Consumer signature is invalid or failed verification +#### 2. 401 - Consumer signature is invalid + +Consumer signature is invalid or failed verification when the job was submitted to +operator-service. #### 3. 503 - Service Unavailable From a38956810b8ad50de2b646b3db09c8533b929a64 Mon Sep 17 00:00:00 2001 From: Maria Carmina Date: Wed, 7 Dec 2022 17:29:01 +0200 Subject: [PATCH 09/13] Added computeStop and computeStatus. --- ocean_provider/routes/README.md | 41 +++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/ocean_provider/routes/README.md b/ocean_provider/routes/README.md index 5ddf7617..b32f9cea 100644 --- a/ocean_provider/routes/README.md +++ b/ocean_provider/routes/README.md @@ -536,8 +536,45 @@ decoded properly as a dictionary. #### 2. 401 - Consumer signature is invalid Consumer signature is invalid or failed verification when the job was submitted to -operator-service. +Operator Service. #### 3. 503 - Service Unavailable -It shows up when Provider server is not responding. \ No newline at end of file +It shows up when Provider server is not responding. + +### computeStatus +These status codes come from Operator service repository which is a microservice +for Compute-to-Data feature. + +#### 1. 400 - Validation errors + +One or more of the required attributes are missing or invalid to the payload that is sent +to the Operator Service. + +#### 2. 401 - Consumer signature is invalid + +Consumer signature is invalid or failed verification when the job was submitted to +Operator Service. + +#### 3. 503 - Service Unavailable + +It shows up when Provider or Operator Service server is not responding. + + +### computeStop +These status codes come from Operator service repository which is a microservice +for Compute-to-Data feature. + +#### 1. 400 - Validation errors + +One or more of the required attributes are missing or invalid to the payload that is sent +to the Operator Service. + +#### 2. 401 - Consumer signature is invalid + +Consumer signature is invalid or failed verification when the job was submitted to +Operator Service. + +#### 3. 503 - Service Unavailable + +It shows up when Provider or Operator Service server is not responding. \ No newline at end of file From ebdd55c6db5d961097009fc5475e5274cc5e4fa9 Mon Sep 17 00:00:00 2001 From: Maria Carmina Date: Fri, 6 Jan 2023 12:06:40 +0200 Subject: [PATCH 10/13] Finished compute endpoints. Started auth endpoints. --- ocean_provider/routes/README.md | 51 +++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/ocean_provider/routes/README.md b/ocean_provider/routes/README.md index b32f9cea..8953524c 100644 --- a/ocean_provider/routes/README.md +++ b/ocean_provider/routes/README.md @@ -6,7 +6,7 @@ SPDX-License-Identifier: Apache-2.0 # Possible errors returned by Provider This document reflects couple of the possible errors returned by Provider. -## Compute routes +## Compute endpoints ### initializeCompute @@ -577,4 +577,51 @@ Operator Service. #### 3. 503 - Service Unavailable -It shows up when Provider or Operator Service server is not responding. \ No newline at end of file +It shows up when Provider or Operator Service server is not responding. + +### computeDelete +These status codes come from Operator service repository which is a microservice +for Compute-to-Data feature. + +#### 1. 400 - Validation errors + +One or more of the required attributes are missing or invalid to the payload that is sent +to the Operator Service. + +#### 2. 401 - Invalid asset data + +Consumer signature is invalid or asset's data is not the correct one. + +#### 3. 503 - Service Unavailable + +It shows up when Provider or Operator Service server is not responding. + + +### computeResult +These status codes come from Operator service repository which is a microservice +for Compute-to-Data feature. + +#### 1. 400 - Validation errors + +One or more of the required attributes are missing or invalid to the payload that is sent +to the Operator Service. + +#### 2. 404 - Result not found + +Compute job result could not be found in the Operator Service database. + +#### 3. 503 - Service Unavailable + +It shows up when Provider or Operator Service server is not responding. + + +### computeEnvironments +These status codes come from Operator service repository which is a microservice +for Compute-to-Data feature. + +#### 1. 503 - Service Unavailable + +It shows up when Provider or Operator Service server is not responding. + + +## Authentication endpoints From bbb0bfff176480b19fee6b27ceec8790a8b6bdcf Mon Sep 17 00:00:00 2001 From: Maria Carmina Date: Fri, 6 Jan 2023 12:11:02 +0200 Subject: [PATCH 11/13] Finished auth endpoints. --- ocean_provider/routes/README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/ocean_provider/routes/README.md b/ocean_provider/routes/README.md index 8953524c..d3ee605c 100644 --- a/ocean_provider/routes/README.md +++ b/ocean_provider/routes/README.md @@ -625,3 +625,26 @@ It shows up when Provider or Operator Service server is not responding. ## Authentication endpoints + +### createAuthToken +Creates an AuthToken for the given address, that can replace signature in API calls. + +#### 1. 400 - Validation errors + +One or more of the required attributes are missing or invalid to the payload. + +#### 2. 503 - Service Unavailable + +It shows up when Provider server is not responding. + + +### deleteAuthToken +Revokes a given AuthToken if it is still valid. + +#### 1. 400 - Validation errors + +One or more of the required attributes are missing or invalid to the payload. + +#### 2. 503 - Service Unavailable + +It occurs when Provider or Operator Service server is not responding. \ No newline at end of file From 3772343efc91d4a1151d61a00b88db1eed1c391c Mon Sep 17 00:00:00 2001 From: Maria Carmina Date: Fri, 6 Jan 2023 15:07:06 +0200 Subject: [PATCH 12/13] Started consume endpoints. --- ocean_provider/routes/README.md | 87 +++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/ocean_provider/routes/README.md b/ocean_provider/routes/README.md index d3ee605c..acb93d45 100644 --- a/ocean_provider/routes/README.md +++ b/ocean_provider/routes/README.md @@ -6,6 +6,93 @@ SPDX-License-Identifier: Apache-2.0 # Possible errors returned by Provider This document reflects couple of the possible errors returned by Provider. +## Consume endpoints + +### nonce +Returns last-used nonce value. +#### 1. 503 - Service Unavailable + +It occurs when Provider server is not responding. + +### fileinfo +Retrieves Content-Type and Content-Length from the given URL or asset. + +#### 1. 400 - Bad Request +It occurs when the validation part fails. +The following errors are displayed in JSON format: + +```python +{ + "error": "Cannot resolve DID" +} +``` +**Reason** The dataset `DID` does not exist in the Metadata store. + +```python +{ + "error": "Invalid serviceId" +} +``` +**Reason** The `serviceId` of that dataset is not correct. + +```python +{ + "error": "Unable to get dataset files" +} +``` +**Reason** The `files` of that dataset could not be decrypted or retrieved +due to the following issues: +- `Key not found in files.` - `datatokenAddress` or `nftAddress` or `files` is missing +the decrypted files object + + +- `Mismatch of datatoken.` - mismatch between service datatoken & decrypted files datatoken; + + +- `Mismatch of dataNft.` - mismatch between asset data NFT address & the one from the decrypted files; + + +- `Expected a files list` - `files` is not a list; + + +- `Error decrypting service files` - other errors for decrypting the file. + +```python +{ + "error": "cannot decrypt files for this service." +} +``` +**Reason** The `files` of that dataset could not be decrypted due to the fact that +`file object`, which contains the structure and the type of specific file, is missing +from the validation part. + + +```python +{ + "error": "Unsupported type " +} +``` +**Reason** The `file object` type is not supported by Provider besides the known ones:. +- `url`; +- `arweave`; +- `ipfs`; +- `graphql`; +- `smartcontract`. + +```python +{ + "error": "malformed file object." +} +``` +**Reason** The `file object` structure is invalid and does not contain the wanted +information for the specific file. + +##### 1.1 For Url file validation + + +### initialize + + ## Compute endpoints ### initializeCompute From 1c5a16e98590387bdc9701e337f05c55521c68bb Mon Sep 17 00:00:00 2001 From: Maria Carmina Date: Fri, 6 Jan 2023 15:38:32 +0200 Subject: [PATCH 13/13] Files validation possible errors. --- ocean_provider/routes/README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ocean_provider/routes/README.md b/ocean_provider/routes/README.md index acb93d45..3f9ad900 100644 --- a/ocean_provider/routes/README.md +++ b/ocean_provider/routes/README.md @@ -89,6 +89,28 @@ information for the specific file. ##### 1.1 For Url file validation +```python +{ + "error": "malformed service files, missing required keys." +} +``` +**Reason** The `url` is missing from `UrlFile` object. + +```python +{ + "error": f"Unsafe method " +} +``` +**Reason** The `method` for that `url` is neither `get`, nor `post`. + +##### 1.2 For Arweave file validation + +```python +{ + "error": "malformed service files, missing transactionId." +} +``` +**Reason** The `transactionId` is missing from `ArweaveFile` object. ### initialize