Provider v0.4.12

Ocean Provider is the technical component executed by Data Providers allowing them to provide extended data services. When running with our Docker images, it is exposed under http://localhost:8030.

/api/v1/services/compute

delete

Deletes a workflow.

Parameters

signaturestring

Signature of the documentId to verify that the consumer has rights to download the asset.

documentId*string

The ID of the asset

consumerAddress*string

The consumer address.

jobIdstring

JobId.

Responses

200 Call to the operator-service was successful.
400 One of the required attributes is missing.
401 Invalid asset data.
503 Service Unavailable

get

Get status for a specific jobId/documentId/owner

Parameters

signaturestring

Signature of (consumerAddress+jobId+documentId) to verify the consumer of this asset/compute job. The signature uses ethereum based signing method (see https://github.com/ethereum/EIPs/pull/683)

documentId*string

The ID of the asset. If not provided, the status of all currently running and old compute jobs for the specified consumerAddress will be returned.

consumerAddress*string

The consumer ethereum address.

jobIdstring

The ID of the compute job. If not provided, all running compute jobs of the specified consumerAddress/documentId are suspended

Responses

200 Call to the operator-service was successful.
400 One of the required attributes is missing.
401 Consumer signature is invalid or failed verification.
503 Service Unavailable

post

Call the execution of a workflow.

Parameters

signaturestring

Signature of (consumerAddress+jobId+documentId) to verify the consumer of this asset/compute job. The signature uses ethereum based signing method (see https://github.com/ethereum/EIPs/pull/683)

consumerAddress*string

The consumer ethereum address.

algorithmDidstring

The DID of the algorithm Asset to be executed

algorithmMetajson string

json object that define the algorithm attributes and url or raw code

output*json string

json object that define the output section

Responses

200 Call to the operator-service was successful.
400 One of the required attributes is missing.
401 Consumer signature is invalid or failed verification
503 Service unavailable

put

Stop the execution of a workflow.

Parameters

signaturestring

Signature of (consumerAddress+jobId+documentId) to verify the consumer of this compute job/asset. The signature uses ethereum based signing method (see https://github.com/ethereum/EIPs/pull/683)

documentId*string

The ID of the asset. If not provided, all currently running compute jobs will be stopped for the specified consumerAddress

consumerAddress*string

The consumer ethereum address.

jobIdstring

The ID of the compute job. If not provided, all running compute jobs of the specified consumerAddress/documentId are suspended

Responses

200 Call to the operator-service was successful.
400 One of the required attributes is missing.
401 Consumer signature is invalid or failed verification.
503 Service unavailable

/api/v1/services/download

get

Allows download of asset data file.

Parameters

consumerAddress*string

The consumer address.

documentId*string

The ID of the asset/document (the DID).

url*string

This URL is only valid if Provider acts as a proxy. Consumer can't download using the URL if it's not through the Provider.

signature

Signature of the documentId to verify that the consumer has rights to download the asset.

index

Index of the file in the array of files.

Responses

200 Redirect to valid asset url.
400 One of the required attributes is missing.
401 Invalid asset data.
503 Service Unavailable

/api/v1/services/encrypt

post

Encrypt document using the Provider's own symmetric key (symmetric encryption).

This can be used by the publisher of an asset to encrypt the urls of the<br/>asset data files before publishing the asset ddo. The publisher to use this<br/>service is one that is using a front-end with a wallet app such as MetaMask.<br/>The `urls` are encrypted by the provider so that the provider will be able<br/>to decrypt at time of providing the service later on.<br/>

Parameters

body*

Asset urls encryption.

{
"document": "/some-url",
"documentId": "did:op:08a429b8529856d59867503f8056903a680935a76950bb9649785cc97869a43d",
"publisherAddress": "0x00a329c0648769A73afAc7F9381E08FB43dBEA72",
}

Responses

201 document successfully encrypted.
503 Service Unavailable

/api/v1/services/fileinfo

post

Retrieves Content-Type and Content-Length from the given URL or asset. Supports a payload of either url or did.

This can be used by the publisher of an asset to check basic information<br/>about the URL(s). For now, this information consists of the Content-Type<br/>and Content-Length of the request, using primarily OPTIONS, with fallback<br/>to GET. In the future, we will add a hash to make sure that the file was<br/>not tampered with at consumption time.<br/>

Responses

200 the URL(s) could be analysed (returns the result).
400 the URL(s) could not be analysed (bad request).