dpdispatcher.utils.dpcloudserver package#
Expose helpers for the legacy Bohrium cloud-service API.
- class dpdispatcher.utils.dpcloudserver.Client(email: str | None = None, password: str | None = None, debug: bool = False, ticket: str | None = None, base_url: str = 'https://bohrium.dp.tech/')[source]#
Bases:
objectCall legacy Bohrium APIs for authentication, jobs, logs, and files.
Methods
download_from_url(url, save_file)Download a URL and fail explicitly after retry exhaustion.
download
get
get_job_detail
get_job_result_url
get_log
get_tasks_list
job_create
kill
post
refresh_token
upload
- download_from_url(url: str, save_file: str | PathLike) None[source]#
Download a URL and fail explicitly after retry exhaustion.
- Parameters:
- urlstr
Remote URL to download.
- save_filestr or os.PathLike
Local path where the response body is written.
- Raises:
- RequestInfoException
If no HTTP request succeeds after three attempts. The exception includes the URL and the final transport or HTTP response details.
- get(url: str, header: dict[str, str] | None = None, params: dict[str, Any] | None = None, retry: int = 5) dict[str, Any][source]#
- job_create(job_type: str, oss_path: str, input_data: dict[str, Any], program_id: int | None = None, group_id: int | None = None) tuple[int, int | None][source]#
Submodules#
dpdispatcher.utils.dpcloudserver.client module#
Provide a legacy HTTP client for Bohrium job and storage operations.
- class dpdispatcher.utils.dpcloudserver.client.Client(email: str | None = None, password: str | None = None, debug: bool = False, ticket: str | None = None, base_url: str = 'https://bohrium.dp.tech/')[source]#
Bases:
objectCall legacy Bohrium APIs for authentication, jobs, logs, and files.
Methods
download_from_url(url, save_file)Download a URL and fail explicitly after retry exhaustion.
download
get
get_job_detail
get_job_result_url
get_log
get_tasks_list
job_create
kill
post
refresh_token
upload
- download_from_url(url: str, save_file: str | PathLike) None[source]#
Download a URL and fail explicitly after retry exhaustion.
- Parameters:
- urlstr
Remote URL to download.
- save_filestr or os.PathLike
Local path where the response body is written.
- Raises:
- RequestInfoException
If no HTTP request succeeds after three attempts. The exception includes the URL and the final transport or HTTP response details.
- get(url: str, header: dict[str, str] | None = None, params: dict[str, Any] | None = None, retry: int = 5) dict[str, Any][source]#
- job_create(job_type: str, oss_path: str, input_data: dict[str, Any], program_id: int | None = None, group_id: int | None = None) tuple[int, int | None][source]#
dpdispatcher.utils.dpcloudserver.config module#
Read legacy Bohrium API endpoints and object-storage settings.
dpdispatcher.utils.dpcloudserver.retcode module#
Define return codes used by the legacy Bohrium API.
- class dpdispatcher.utils.dpcloudserver.retcode.RETCODE[source]#
Bases:
objectGroup string constants returned by the legacy Bohrium API.
- DATAERR = '2002'#
- DBERR = '2000'#
- IOERR = '2003'#
- NODATA = '2300'#
- OK = '0000'#
- PARAMERR = '2101'#
- PWDERR = '2104'#
- REQERR = '2200'#
- ROLEERR = '2103'#
- THIRDERR = '2001'#
- TOKENINVALID = '2100'#
- UNDERDEBUG = '2301'#
- UNKOWNERR = '2400'#
- USERERR = '2102'#
- VERIFYERR = '2105'#
dpdispatcher.utils.dpcloudserver.zip_file module#
Create and extract ZIP archives for cloud file transfer.