decentriq_platform.archv2
Sub-modules
- decentriq_platform.archv2.client
- decentriq_platform.archv2.compute_job
- decentriq_platform.archv2.release_policy_builder
- decentriq_platform.archv2.secret
- decentriq_platform.archv2.session
Classes
ClientV2
ClientV2(
api: decentriq_platform.api.Api,
)
check_data_labs_compatibility
def check_data_labs_compatibility(
self,
data_room_id: str,
data_lab_ids: List[str],
) ‑> decentriq_platform.archv2.client.DataLabCompatibilityResponse
create_data_lab
def create_data_lab(
self,
create_data_lab: Union[Dict[str, ForwardRef('JSONType')], List[ForwardRef('JSONType')], str, int, float, bool, ForwardRef(None)],
verification_key: bytes,
) ‑> decentriq_platform.archv2.client.DataLabV2
create_data_room
def create_data_room(
self,
create_data_room: Union[Dict[str, ForwardRef('JSONType')], List[ForwardRef('JSONType')], str, int, float, bool, ForwardRef(None)],
verification_key: bytes,
) ‑> decentriq_platform.archv2.client.DataRoom
create_job
def create_job(
self,
data_room_id: str,
data_room_compute_action: Union[Dict[str, ForwardRef('JSONType')], List[ForwardRef('JSONType')], str, int, float, bool, ForwardRef(None)],
) ‑> decentriq_platform.archv2.client.Job
delete_data_lab
def delete_data_lab(
self,
data_lab_id: str,
) ‑> None
download_job_raw_errors
def download_job_raw_errors(
self,
job_id: str,
) ‑> decentriq_platform.archv2.client.RawErrorsView
get_data_lab
def get_data_lab(
self,
data_lab_id: str,
verification_key: bytes,
) ‑> decentriq_platform.archv2.client.DataLabV2
get_data_labs
def get_data_labs(
self,
user_id: str,
verification_key: bytes,
) ‑> List[decentriq_platform.archv2.client.DataLabV2]
get_data_room
def get_data_room(
self,
data_room_id: str,
verification_key: bytes,
) ‑> decentriq_platform.archv2.client.DataRoom
get_data_room_action_info
def get_data_room_action_info(
self,
data_room_id: str,
data_room_compute_action: Union[Dict[str, ForwardRef('JSONType')], List[ForwardRef('JSONType')], str, int, float, bool, ForwardRef(None)],
) ‑> decentriq_platform.archv2.client.Action
get_data_room_actions
def get_data_room_actions(
self,
data_room_id: str,
) ‑> decentriq_platform.archv2.client.DataRoomActionsView
get_data_room_audit_log
def get_data_room_audit_log(
self,
data_room_id: str,
verification_key: bytes,
) ‑> decentriq_platform.archv2.client.DataRoomAuditLog
get_data_room_policies
def get_data_room_policies(
self,
data_room_id: str,
policy_ids: List[str],
) ‑> Dict[str, Union[decentriq_platform.archv2.client.PolicyNotFound, decentriq_platform.archv2.client.PolicyNotProvisioned, decentriq_platform.archv2.client.PolicyMetadata]]
get_job
def get_job(
self,
job_id: str,
) ‑> decentriq_platform.archv2.client.Job
get_job_freshness
def get_job_freshness(
self,
job_id: str,
) ‑> bool
get_job_status
def get_job_status(
self,
job_id: str,
) ‑> decentriq_platform.archv2.client.JobStatusView
get_job_tasks
def get_job_tasks(
self,
job_id: str,
) ‑> decentriq_platform.archv2.client.JobTasksView
stop_data_room
def stop_data_room(
self,
data_room_id: str,
) ‑> None
ComputeJob
ComputeJob(
dcr_id: str,
action: DataRoomComputeAction,
result_zip_file_name: str,
client: Client,
)
Abstract base class for compute jobs in archv2 DCRs.
Initialize a compute job.
Parameters:
dcr_id: The identifier for the DCR or DataLabaction: The compute action to performresult_zip_file_name: The name of the file in the zip to get the result fromclient: The client instance for API communication
Ancestors (in MRO)
- abc.ABC Descendants
- decentriq_platform.data_lab.compute_job.DataLabStatisticsJob
- decentriq_platform.data_lab.compute_job.DataLabValidationStatusJob
- decentriq_platform.data_lab.compute_job.ValidationReportJob
- decentriq_platform.media.compute_job.MediaAudienceUserListJob
- decentriq_platform.media.compute_job.MediaDataAttributesJob
- decentriq_platform.media.compute_job.MediaEstimateAudienceSizeJob
- decentriq_platform.media.compute_job.MediaGetAudiencesJob
- decentriq_platform.media.compute_job.MediaGetCustomAudiencesJob
- decentriq_platform.media.compute_job.MediaGetSeedAudiencesJob
- decentriq_platform.media.compute_job.MediaInsightsJob
- decentriq_platform.media.compute_job.MediaLookalikeAudienceStatisticsJob
- decentriq_platform.media.compute_job.MediaMatchingValidationReportJob
- decentriq_platform.media.compute_job.MediaModelQualityReportJob
- decentriq_platform.media.compute_job.MediaOverlapStatisticsJob
- decentriq_platform.media.compute_job.ValidationReportJob
download_result
def download_result(
self,
task_result_hash: str,
) ‑> io.RawIOBase
Download the result of the compute job.
Parameters:
task_result_hash: The hash of the task result to download
Returns:
- The result of the compute job
get_result
def get_result(
self,
) ‑> bytes
Get the result of the compute job.
Returns:
- The content of the result file as bytes or raises an exception if the job failed
get_result_as_zipfile
def get_result_as_zipfile(
self,
) ‑> zipfile.ZipFile
Get the result of the compute job as a zipfile.ZipFile.
Returns:
- The content of the result file as a zipfile.ZipFile. If the job failed, an Exception will be raised.
is_complete
def is_complete(
self,
) ‑> bool
Check if the compute job is complete.
Returns:
- True if the job is complete, False otherwise
result
def result(
self,
) ‑> Any
Get the parsed result of the compute job.
Each job subclass should implement this method and return the appropriate type which represents the job result.
run
def run(
self,
) ‑> None
Run the compute job.
Raises:
Exception: If the computation has already been run
wait_for_completion
def wait_for_completion(
self,
timeout: Optional[int] = None,
sleep_interval: int = 1,
) ‑> Self
Wait for the compute job to complete.
Parameters:
timeout: The maximum time to wait for the job to complete, in secondssleep_interval: The interval to wait between checks, in seconds
Returns:
- The compute job
DataLabV2
DataLabV2(
*args,
**kwargs,
)
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)
Ancestors (in MRO)
- builtins.dict
JobStatus
JobStatus(
*args,
**kwds,
)
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
Ancestors (in MRO)
- builtins.str
- enum.Enum
Secret
Secret(
secret: bytes,
state: decentriq_dcr_compiler._schemas.secret_store_entry_state.SecretStoreEntryState,
)
Secret(secret: bytes, state: decentriq_dcr_compiler._schemas.secret_store_entry_state.SecretStoreEntryState)
SessionV2
SessionV2(
client: Client,
connection: Connection,
)
Class for managing the communication with an enclave.
Session instances should not be instantiated directly but rather
be created using a Client object using decentriq_platform.Client.create_session_v2.
create_policy
def create_policy(
self,
policy: ReleasePolicy,
) ‑> str
Create a release policy and return the policy ID.
create_secret
def create_secret(
self,
secret: Secret,
) ‑> str
Store a secret in the user's own enclave-protected secret store
get_dataset_secret_id
def get_dataset_secret_id(
self,
manifest_hash: str,
) ‑> str
get_secret
def get_secret(
self,
secret_id: str,
) ‑> Tuple[decentriq_platform.archv2.secret.Secret, int]
remove_secret
def remove_secret(
self,
secret_id: str,
expected_cas_index: int,
) ‑> bool
send_authenticated_request
def send_authenticated_request(
self,
authenticated_request: AuthenticatedRequest,
) ‑> gcg_pb2.AuthenticatedResponse
send_data_room_state_action_request
def send_data_room_state_action_request(
self,
data_room_id: str,
action: JSONType,
) ‑> Union[Dict[str, JSONType], List[JSONType], str, int, float, bool, ForwardRef(None)]
Send a DCR action request.
send_export_result_as_dataset_request
def send_export_result_as_dataset_request(
self,
job_id: str,
task_result_hash: str,
zip_path: Optional[str],
) ‑> Tuple[str, str, str]
Export a result as a dataset.
send_get_verification_key_request
def send_get_verification_key_request(
self,
) ‑> bytes
Retrieve the verification key for a DCR.
send_retrieve_result_encryption_key_request
def send_retrieve_result_encryption_key_request(
self,
job_id: str,
task_result_hash: str,
) ‑> Tuple[str, bytes]
Retrieve the manifest hash and encryption key for a result.
send_secret_store_request
def send_secret_store_request(
self,
request: SecretStoreRequest,
) ‑> secret_store_pb2.SecretStoreResponse
update_secret_acl
def update_secret_acl(
self,
secret_id: str,
new_acl: v0.SecretStoreEntryAcl,
expected_cas_index: int,
) ‑> bool
Update a secret ACL