nevermined_sdk_py.gateway.gateway module¶
-
class
nevermined_sdk_py.gateway.gateway.
Gateway
¶ Bases:
object
Gateway is the name chosen for the asset service provider.
The main functions available are: - Allow to get access to an asset data file - encrypt a secret using different methods - consume_service - run_compute_service
-
static
access_service
(did, service_agreement_id, service_endpoint, account, destination_folder, index)¶
-
static
consume_service
(did, service_agreement_id, service_endpoint, account, files, destination_folder, index=None)¶ Call the Gateway endpoint to get access to the different files that form the asset.
- Parameters
service_agreement_id – Service Agreement Id, str
service_endpoint – Url to access, str
account – Account instance of the consumer signing this agreement, hex-str
files – List containing the files to be consumed, list
index – Index of the document that is going to be downloaded, int
destination_folder – Path, str
- Returns
True if was downloaded, bool
-
static
encrypt_files_dict
(files_dict, encrypt_endpoint, asset_id, method)¶
-
static
execute_service
(service_agreement_id, service_endpoint, account, workflow_ddo)¶ - Parameters
service_agreement_id –
service_endpoint –
account –
- Returns
-
static
get_access_endpoint
(config)¶ Return the endpoint to access the asset.
:param config:Config :return: Url, str
-
static
get_consume_endpoint
(config)¶ Return the url to access the asset.
- Parameters
config – Config
- Returns
Url, str
-
static
get_ecdsa_public_key
(config)¶
-
static
get_encrypt_endpoint
(config)¶ Return the url to encrypt the asset.
- Parameters
config – Config
- Returns
Url, str
-
static
get_exec_endpoint
(config)¶ Return the url to execute the asset. This method has been deprecated.
- Parameters
config – Config
- Returns
Url, str
-
static
get_execute_endpoint
(config)¶ Return the url to execute the asset.
- Parameters
config – Config
- Returns
Url, str
-
static
get_gateway_url
(config)¶ Return the Gateway component url.
- Parameters
config – Config
- Returns
Url, str
-
static
get_publish_endpoint
(config)¶ Return the url to encrypt the asset. This method has been deprecated.
- Parameters
config – Config
- Returns
Url, str
-
static
get_rsa_public_key
(config)¶
-
static
old_encrypt_files_dict
(files_dict, encrypt_endpoint, asset_id, account_address, signed_did)¶
-
static
set_http_client
(http_client)¶ Set the http client to something other than the default requests
-
static
write_file
(response, destination_folder, file_name)¶ Write the response content in a file in the destination folder. :param response: Response :param destination_folder: Destination folder, string :param file_name: File name, string :return: bool
-
static