utils.rcclient.commons.rest_clients

Module Contents

Classes

RestClient

WebappClient

SegmentClient

ScenarioClient

RecipeClient

GlobalVariableClient

FeatureClient

StreamlitClient

LogErrorClient

SignedUrlClient

DataAppClient

AppTemplateClient

FileClient

ScenarioRunStepClient

PypiClient

DatasourceClient

DatasetClient

Attributes

logger

T

U

utils.rcclient.commons.rest_clients.logger
utils.rcclient.commons.rest_clients.T
utils.rcclient.commons.rest_clients.U
class utils.rcclient.commons.rest_clients.RestClient
property __headers: dict
get(url: str, headers: dict = {}) requests.Response
post(url: str, payload: dict, headers: dict = {}, timeout=None) requests.Response
put(url: str, payload: dict, headers: dict = {}) requests.Response
patch(url: str, payload: dict, headers: dict = {}) requests.Response
delete(url: str, headers: dict = {}) requests.Response
upload(url: str, file: dict, headers: dict = {}) requests.Response
__update_headers(headers: dict) dict
class utils.rcclient.commons.rest_clients.WebappClient

Bases: RestClient

property __headers
WEBAPP_STAGING_BASE_URL = 'http://staging.dev.rapidcanvas.net/api'
post(endpoint: str, payload: Sequence[T], headers: dict = {}, version: utils.rcclient.enums.WebappApiVersion = WebappApiVersion.V2, response_klass: Sequence[T] = None, skip_auth=False, timeout=None) T
put(endpoint: str, payload: Sequence[T], headers: dict = {}, version: utils.rcclient.enums.WebappApiVersion = WebappApiVersion.V2, response_klass: Sequence[T] = None) T
patch(endpoint: str, payload: Sequence[T], headers: dict = {}, version: utils.rcclient.enums.WebappApiVersion = WebappApiVersion.V2, response_klass: Sequence[T] = None) T
get(endpoint: str, headers: dict = {}, version: utils.rcclient.enums.WebappApiVersion = WebappApiVersion.V2, response_klass: Sequence[T] = None, with_api_namespace=True) T
upload(endpoint: str, payload: Sequence[T], headers: dict = {}, version: utils.rcclient.enums.WebappApiVersion = WebappApiVersion.V2, response_klass: Sequence[T] = None) T
delete(endpoint: str, headers: dict = {}, version: utils.rcclient.enums.WebappApiVersion = WebappApiVersion.V2, response_klass: Sequence[T] = None) T
__handle_response(res: requests.Response, response_klass: Sequence[T]) T | utils.rcclient.dtos.response_dtos.APIRequestSuccessful
__prepare_list_res(res_json: dict, response_klass: Sequence[T]) tuple
__handle_error(res: requests.Response) utils.rcclient.dtos.response_dtos.APIRequestFailed
__prepare_request(endpoint: str, version: utils.rcclient.enums.WebappApiVersion, headers: dict, payload: Sequence[T], with_api_namespace=True, skip_auth=False)
__get_url(endpoint: str, version: utils.rcclient.enums.WebappApiVersion, with_api_namespace: bool)
__get_host(version: utils.rcclient.enums.WebappApiVersion, with_api_namespace: bool)
class utils.rcclient.commons.rest_clients.SegmentClient

Bases: WebappClient

post(endpoint: str, payload: Sequence[U], headers: dict = {}, version: utils.rcclient.enums.WebappApiVersion = WebappApiVersion.V2, response_klass: Sequence[T] = None) T
find(endpoint: str, response_klass: Sequence[T] = None) List[T]
try_it(endpoint: str, payload: Sequence[U], headers: dict = {}, version: utils.rcclient.enums.WebappApiVersion = WebappApiVersion.V2, response_klass: Sequence[T] = None) T
class utils.rcclient.commons.rest_clients.ScenarioClient

Bases: WebappClient

find(endpoint: str, response_klass: Sequence[T]) List[T]
post(endpoint: str, payload: Sequence[U], headers: dict = {}, version: utils.rcclient.enums.WebappApiVersion = WebappApiVersion.V2, response_klass: Sequence[T] = None) T
class utils.rcclient.commons.rest_clients.RecipeClient

Bases: WebappClient

find(endpoint: str, response_klass: Sequence[T]) List[T]
class utils.rcclient.commons.rest_clients.GlobalVariableClient

Bases: WebappClient

find(endpoint: str, response_klass: Sequence[T], version: utils.rcclient.enums.WebappApiVersion = WebappApiVersion.V2) List[T]
post(endpoint: str, payload: Sequence[U], headers: dict = {}, version: utils.rcclient.enums.WebappApiVersion = WebappApiVersion.V2, response_klass: Sequence[T] = None) T
put(endpoint: str, payload: Sequence[U], headers: dict = {}, version: utils.rcclient.enums.WebappApiVersion = WebappApiVersion.V2, response_klass: Sequence[T] = None) T
class utils.rcclient.commons.rest_clients.FeatureClient

Bases: WebappClient

find(endpoint: str, response_klass: Sequence[T]) List[T]
class utils.rcclient.commons.rest_clients.StreamlitClient

Bases: WebappClient

upload_app(endpoint: str, payload: utils.rcclient.dtos.request_dtos.streamlit.StreamlitUploadAppDto, headers: dict = {}, version: utils.rcclient.enums.WebappApiVersion = WebappApiVersion.V2, response_klass: Sequence[T] = None) None
class utils.rcclient.commons.rest_clients.LogErrorClient

Bases: WebappClient

endpoint = '/log'
log(payload: str, headers: dict = {}, version: utils.rcclient.enums.WebappApiVersion = WebappApiVersion.V2, response_klass: Sequence[T] = None)
class utils.rcclient.commons.rest_clients.SignedUrlClient

Bases: WebappClient

file_upload_url_endpoint = '/signed-url/generate-file-upload-url'
file_download_url_endpoint = '/signed-url/generate-file-download-url'
list_files_url_endpoint = '/signed-url/list-files'
file_upload_url(payload: utils.rcclient.dtos.request_dtos.signed_url.SignedUrlRequestDto, headers: dict = {}, version: utils.rcclient.enums.WebappApiVersion = WebappApiVersion.V1, response_klass: Sequence[T] = None) T
file_download_url(payload: utils.rcclient.dtos.request_dtos.signed_url.SignedUrlRequestDto, headers: dict = {}, version: utils.rcclient.enums.WebappApiVersion = WebappApiVersion.V1, response_klass: Sequence[T] = None) T
list_files(payload: utils.rcclient.dtos.request_dtos.list_dir.ListDirRequestDto, headers: dict = {}, version: utils.rcclient.enums.WebappApiVersion = WebappApiVersion.V1, response_klass: Sequence[T] = None) T
class utils.rcclient.commons.rest_clients.DataAppClient

Bases: WebappClient

find(endpoint: str, response_klass: T, version: utils.rcclient.enums.WebappApiVersion = WebappApiVersion.V1)
post(endpoint: str, payload: Sequence[U], headers: dict = {}, version: utils.rcclient.enums.WebappApiVersion = WebappApiVersion.V1, response_klass: Sequence[T] = None) T
launch(endpoint: str, payload: Sequence[U], headers: dict = {}, version: utils.rcclient.enums.WebappApiVersion = WebappApiVersion.V1, response_klass: Sequence[T] = None, timeout=None)
put(endpoint: str, payload: Sequence[U], headers: dict = {}, version: utils.rcclient.enums.WebappApiVersion = WebappApiVersion.V1, response_klass: Sequence[T] = None) T
class utils.rcclient.commons.rest_clients.AppTemplateClient

Bases: WebappClient

post(endpoint: str, payload: Sequence[U], headers: dict = {}, version: utils.rcclient.enums.WebappApiVersion = WebappApiVersion.V1, response_klass: Sequence[T] = None, skip_auth=False) T
get(endpoint: str, response_klass: T, version: utils.rcclient.enums.WebappApiVersion = WebappApiVersion.V1)
update(endpoint, payload: Sequence[U], version: utils.rcclient.enums.WebappApiVersion = WebappApiVersion.V1)
class utils.rcclient.commons.rest_clients.FileClient

Bases: RestClient

upload_file(url: str, file_path: str, headers: dict = {})
download_file(url: str, save_path: str)
class utils.rcclient.commons.rest_clients.ScenarioRunStepClient

Bases: WebappClient

find(endpoint: str, response_klass: T, version: utils.rcclient.enums.WebappApiVersion = WebappApiVersion.V1) T
class utils.rcclient.commons.rest_clients.PypiClient

Bases: RestClient

get(endpoint: str) T
class utils.rcclient.commons.rest_clients.DatasourceClient

Bases: WebappClient

get(endpoint: str, response_klass: T, version: utils.rcclient.enums.WebappApiVersion = WebappApiVersion.V2)
class utils.rcclient.commons.rest_clients.DatasetClient

Bases: WebappClient

find(endpoint: str, response_klass: T, version: utils.rcclient.enums.WebappApiVersion = WebappApiVersion.V2)
generate_upload_signed_url(endpoint: str, payload: Sequence[U], headers: dict = {}, version: utils.rcclient.enums.WebappApiVersion = WebappApiVersion.V2, response_klass: Sequence[T] = None)