syncano.models.custom_sockets_utils¶
- class CallType[source]¶
Bases: object
The type of the call object used in the custom socket;
- SCRIPT = 'script'¶
- class DependencyType[source]¶
Bases: object
The type of the dependency object used in the custom socket;
- SCRIPT = 'script'¶
- CLASS = 'class'¶
- class ScriptCall(name, methods)[source]¶
Bases: syncano.models.custom_sockets_utils.BaseCall
Script call object.
The JSON format is as follows (to_dict in the base class):
{ 'type': 'script', 'name': '<script_label>, 'methods': [<method_list>], }
- methods can be as follows:
- [‘GET’]
- [‘*’] - which will do a call on every request method;
- call_type = 'script'¶
- class Endpoint(name)[source]¶
Bases: object
The object which stores metadata about endpoints in custom socket;
The JSON format is as follows:
{ '<endpoint_name>': { 'calls': [ <list of JSON format of Calls objects> ] } }
- class BaseDependency[source]¶
Bases: object
Base dependency object;
On the base of the fields attribute - the JSON format of the dependency is returned. The fields are taken from the dependency object - which can be Script (supported now).
- fields = []¶
- dependency_type = None¶
- name = None¶
- class ScriptDependency(script_or_script_endpoint, name=None)[source]¶
Bases: syncano.models.custom_sockets_utils.BaseDependency
Script dependency object;
- The JSON format is as follows::
- {
- ‘type’: ‘script’, ‘runtime_name’: ‘<runtime name defined in RuntimeChoices>’, ‘source’: ‘<source>’, ‘name’: ‘<name>’
}
- dependency_type = 'script'¶
- fields = ['runtime_name', 'source']¶
- class ClassDependency(class_instance)[source]¶
Bases: syncano.models.custom_sockets_utils.BaseDependency
Class dependency object;
- The JSON format is as follows::
- {
‘type’: ‘class’, ‘name’: ‘<class_name>’, ‘schema’: [
{“name”: “f1”, “type”: “string”}, {“name”: “f2”, “type”: “string”}, {“name”: “f3”, “type”: “integer”}],
}
- dependency_type = 'class'¶
- fields = ['name', 'schema']¶
- class EndpointMetadataMixin(*args, **kwargs)[source]¶
Bases: object
A mixin which allows to collect Endpoints objects and transform them to the appropriate JSON format.