cterasdk.client.host module#

class cterasdk.client.host.CTERAHost(host, port, https, *, url)#

Bases: NetworkHost

add(path, param, use_file_url=False)#

Add a schema object.

property base_api_url#
property base_file_url#
copy(src, dest, overwrite, use_file_url=False)#
db(path, name, param, use_file_url=False)#
default_class(name)#
delete(path, use_file_url=False)#

Delete a schema object.

download_zip(path, form_data, use_file_url=False)#
execute(path, name, param=None, use_file_url=False)#

Execute a schema object method.

form_data(path, form_data, use_file_url=False)#
get(path, params=None, use_file_url=False)#

Retrieve a schema object as a Python object.

get_multi(path, paths, use_file_url=False)#

Retrieve one or more schema objects as a Python object.

get_session_id()#

Get the id of the current session

Return str:

Current session id

login(username, password)#

Log in

Parameters:
  • username (str) – User name to log in

  • password (str) – User password

logout()#

Log out

mkcol(path, use_file_url=False)#
move(src, dest, overwrite, use_file_url=False)#
multipart(path, form_data, use_file_url=False)#
openfile(path, params=None, use_file_url=False)#
post(path, value, use_file_url=False)#
put(path, value, use_file_url=False)#

Update a schema object or attribute.

register_session(session)#
session()#
set_authorization_headers(headers)#

Start a session using authorization headers id instead of logging in

Parameters:

headers (dict) – the authorization headers, represented as a key-value str dict

set_session_id(session_id)#

Start a session with the session id instead of logging in

Parameters:

session_id (str) – Session id for the new session

show(path, use_file_url=False)#

Print a schema object as a JSON string.

show_multi(path, paths, use_file_url=False)#

Print one or more schema objects as a JSON string.

upload(path, form_data, use_file_url=False)#
whoami()#

Return the name of the logged in user.

Return cterasdk.common.object.Object:

The session object of the current user

class cterasdk.client.host.CTERAMigrate(url, is_authenticated=None, http_client=None)#

Bases: NetworkHost

delete(path)#
get(path, params=None)#
login(path)#
post(path, value)#
put(path, value)#
class cterasdk.client.host.NetworkHost(host=None, port=None, https=None, *, url=None)#

Bases: object

baseurl()#
host()#
https()#
port()#
scheme()#
test_conn()#
cterasdk.client.host.authenticated(function)#