Data

class jelastic.api.data.Data(session: Session, token: str, debug: bool = False, ruk: str | None = None)[source]

Bases: ClientAbstract

Service provides a flexible structure to manage the database, create tables, fields, indicating the type, make notes in the tables to hold associations between data. Service is based on technology ORM (programming technique that links databases to the concepts of object-oriented programming languages, creating a “virtual object data base). Service structures has its own SQL processor (HiveQL) for the structured queries that completely eliminates the possibility of malicious injections. Service access control is also working with the structures, allowing to specify the individual rights of access as the data types, and on objects. Options for using the service:

The development of any applications which require storage of information; Exchange of data between clients through the lens of service; Construction of API to import data from your project for other developers of applications; Duplication of data to reduce the risk of loss, encryption, if necessary. >>> from jelastic import Jelastic >>> jelastic = Jelastic(’https://app.xapp.cloudmydc.com’, token=’d6f4e314a5b5fefd164995169f28ae32d987704f’) >>> jelastic.data

Ref: https://docs.jelastic.com/api/#!/data

property Base: _Base
>>> from jelastic import Jelastic
>>> jelastic = Jelastic('https://app.xapp.cloudmydc.com', token='d6f4e314a5b5fefd164995169f28ae32d987704f')
>>> jelastic.data.Base

Ref: https://docs.jelastic.com/api/private/#!/api/data.Base

class jelastic.api.data._Base(session: Session, token: str, debug: bool = False, ruk: str | None = None)[source]

Bases: Data

Service provides a flexible structure to manage the database, create tables, fields, indicating the type, make notes in the tables to hold associations between data. Service is based on technology ORM (programming technique that links databases to the concepts of object-oriented programming languages, creating a “virtual object data base). Service structures has its own SQL processor (HiveQL) for the structured queries that completely eliminates the possibility of malicious injections. Service access control is also working with the structures, allowing to specify the individual rights of access as the data types, and on objects. Options for using the service:

The development of any applications which require storage of information; Exchange of data between clients through the lens of service; Construction of API to import data from your project for other developers of applications; Duplication of data to reduce the risk of loss, encryption, if necessary.

Ref: https://docs.jelastic.com/api/private/#!/api/data.Base

AddField(type: str, field: str, field_type: str | None = None, ruk: str | None = None)[source]
Parameters:
  • type – name type

  • field – name added a field (id - reserved)

  • field_type – type of added fields

CreateObject(type: str, data: str | None = None, ruk: str | None = None)[source]
Parameters:
  • type – name of the data type for which the object is created

  • data – the data object in the JSON

CreateObjects(type: str, data: str, ruk: str | None = None)[source]
DefineType(type: str, fields: str | None = None, unique: str | None = None, ruk: str | None = None)[source]
Parameters:
  • type – name for the created data type, which meets the following requirements: is unique for the specified appid does not start with a digit contains only latin letters, digits and underscore

  • fields – A list of fields for the created data type specified in the { fieldname : “datatype”, … }, { fieldname : “datatype”, … }, … format.

  • unique – A unique fields data type in the { fields : [ “field_name”, … ] }, { … } format.

DefineTypeByUid(uid: int, type: str, fields: str | None = None, unique: str | None = None, ruk: str | None = None)[source]

param uid: user unique identifier param type: type name param fields: fields definition param unique: unique fields

DeleteObject(type: str, id: int, ruk: str | None = None)[source]

param type: name of the type of data param id: object id

DeleteObjectsByCriteria(type: str, criteria: str | None = None, ruk: str | None = None)[source]

param type: name of the data type for which the object is created param criteria: the criteria for selection

GetNotEmptyType(type_like: str, asc: bool | None = None, ruk: str | None = None)[source]
GetObject(type: str, id: int, join: str | None = None, ruk: str | None = None)[source]

param type: name of the type of data param id: object id

GetObjects(type: str, froms: int | None = None, count: int | None = None, join: str | None = None, ruk: str | None = None)[source]

param type: name of the type of data param froms: index which returned objects (default is 0) param count: number of objects (by default equal to the total number of objects for a given type)

GetObjectsByCriteria(type: str, criteria: str | None = None, froms: int | None = None, count: int | None = None, join: str | None = None, projection: str | None = None, ruk: str | None = None)[source]

param type: name of the type of data param criteria: the criteria for selection param froms: index which returned objects (default is 0) param count: number of objects (by default equal to the total number of objects for a given type)

GetObjectsByRole(type: str, role: str, criteria: str | None = None, froms: int | None = None, count: int | None = None, join: str | None = None, projection: str | None = None, ruk: str | None = None)[source]

param type: name of the type of data param criteria: the criteria for selection param froms: index which returned objects (default is 0) param count: number of objects (by default equal to the total number of objects for a given type)

GetObjectsCount(type: str, criteria: str | None = None, ruk: str | None = None)[source]

param type: name of the data type for which the object is created param criteria: the criteria for selection

GetProperty(type: str, id: int, property: str, join: str | None = None, ruk: str | None = None)[source]

param type: name of the type of data param id: object id param property: property name

GetType(type: str, ruk: str | None = None)[source]

param type: name of the type of data

GetTypes(froms: int | None = None, count: int | None = None, ruk: str | None = None)[source]

param froms: index which returned objects (default is 0) param count: number of objects (by default equal to the total number of objects for a given type)

GetTypesCount(ruk: str | None = None)[source]
GetUniqueFields(type: str, ruk: str | None = None)[source]

param type: name of the type of data

RemoveField(type: str, field: str, ruk: str | None = None)[source]

param type: name of the type of data param field: name deleted fields (id - reserved)

RenameField(type: str, old_field: str, new_field: str, ruk: str | None = None)[source]

param type: name of the type of data param oldField: the current name of the field param newField:new field name

RenameType(type: str, old_type: str, new_type: str, ruk: str | None = None)[source]

param type: name of the type of data param old_type: old name param new_type: new name

SetObject(type: str, id: int, data: str, ruk: str | None = None)[source]

param type: name of the type of data param id: object id param data: the data object in the JSON

SetObjects(type: str, data: str, ruk: str | None = None)[source]

param type: name of the type of data param id: object id param data: the data object in the JSON

SetObjectsByCriteria(type: str, property: str, value: None = None, criteria: str | None = None, froms: int | None = None, count: int | None = None, join: str | None = None, ruk: str | None = None)[source]
SetProperty(type: str, id: int, property: str, value: None, ruk: str | None = None)[source]

param type: name of the type of data param id: object id param property: property name param value: property value

SetUniqueFields(type: str, unique: str | None = None, ruk: str | None = None)[source]

param type:name name of the type of data param unique: A unique fields data type in the { fields : [ “field_name”, … ] }, { … } format.

UndefineType(type: str, ruk: str | None = None)[source]

param type:name name of the type of data