graphscope-flex 0.27.0__py2.py3-none-any.whl → 0.28.0a20240920__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- graphscope/flex/rest/__init__.py +59 -44
- graphscope/flex/rest/api/__init__.py +2 -4
- graphscope/flex/rest/api/alert_api.py +721 -394
- graphscope/flex/rest/api/{legacy_api.py → data_source_api.py} +260 -189
- graphscope/flex/rest/api/deployment_api.py +388 -138
- graphscope/flex/rest/api/graph_api.py +858 -260
- graphscope/flex/rest/api/job_api.py +286 -203
- graphscope/flex/rest/api/service_api.py +320 -39
- graphscope/flex/rest/api/{procedure_api.py → stored_procedure_api.py} +296 -237
- graphscope/flex/rest/api/utils_api.py +18 -13
- graphscope/flex/rest/api_client.py +60 -30
- graphscope/flex/rest/configuration.py +19 -5
- graphscope/flex/rest/exceptions.py +2 -2
- graphscope/flex/rest/models/__init__.py +57 -40
- graphscope/flex/rest/models/{vertex_type.py → base_edge_type.py} +25 -25
- graphscope/flex/rest/models/{edge_type_vertex_type_pair_relations_inner.py → base_edge_type_vertex_type_pair_relations_inner.py} +17 -17
- graphscope/flex/rest/models/{edge_type_vertex_type_pair_relations_inner_x_csr_params.py → base_edge_type_vertex_type_pair_relations_inner_x_csr_params.py} +11 -11
- graphscope/flex/rest/models/{model_property.py → base_property_meta.py} +28 -19
- graphscope/flex/rest/models/base_vertex_type.py +96 -0
- graphscope/flex/rest/models/{groot_edge_type_relations_inner.py → base_vertex_type_x_csr_params.py} +15 -17
- graphscope/flex/rest/models/column_mapping.py +13 -13
- graphscope/flex/rest/models/{edge_mapping_source_vertex_mappings_inner_column.py → column_mapping_column.py} +12 -12
- graphscope/flex/rest/models/{schema_mapping_loading_config_data_source.py → create_alert_receiver_request.py} +29 -24
- graphscope/flex/rest/models/{alert_rule.py → create_alert_rule_request.py} +19 -25
- graphscope/flex/rest/models/create_dataloading_job_response.py +88 -0
- graphscope/flex/rest/models/create_edge_type.py +114 -0
- graphscope/flex/rest/models/{graph.py → create_graph_request.py} +27 -33
- graphscope/flex/rest/models/create_graph_response.py +88 -0
- graphscope/flex/rest/models/{model_schema.py → create_graph_schema_request.py} +25 -25
- graphscope/flex/rest/models/{groot_vertex_type.py → create_property_meta.py} +32 -25
- graphscope/flex/rest/models/{graph_stored_procedures.py → create_stored_proc_request.py} +26 -23
- graphscope/flex/rest/models/create_stored_proc_response.py +88 -0
- graphscope/flex/rest/models/create_vertex_type.py +108 -0
- graphscope/flex/rest/models/{groot_dataloading_job_config.py → dataloading_job_config.py} +45 -21
- graphscope/flex/rest/models/{groot_dataloading_job_config_edges_inner.py → dataloading_job_config_edges_inner.py} +12 -12
- graphscope/flex/rest/models/{schema_mapping_loading_config.py → dataloading_job_config_loading_config.py} +16 -22
- graphscope/flex/rest/models/{schema_mapping_loading_config_format.py → dataloading_job_config_loading_config_format.py} +12 -12
- graphscope/flex/rest/models/dataloading_job_config_vertices_inner.py +88 -0
- graphscope/flex/rest/models/dataloading_mr_job_config.py +88 -0
- graphscope/flex/rest/models/date_type.py +88 -0
- graphscope/flex/rest/models/edge_mapping.py +23 -25
- graphscope/flex/rest/models/edge_mapping_type_triplet.py +12 -12
- graphscope/flex/rest/models/error.py +90 -0
- graphscope/flex/rest/models/{alert_message.py → get_alert_message_response.py} +23 -32
- graphscope/flex/rest/models/{alert_receiver.py → get_alert_receiver_response.py} +22 -25
- graphscope/flex/rest/models/{connection_status.py → get_alert_rule_response.py} +37 -33
- graphscope/flex/rest/models/{edge_type.py → get_edge_type.py} +33 -27
- graphscope/flex/rest/models/get_graph_response.py +139 -0
- graphscope/flex/rest/models/{groot_schema.py → get_graph_schema_response.py} +32 -32
- graphscope/flex/rest/models/get_pod_log_response.py +88 -0
- graphscope/flex/rest/models/{edge_mapping_destination_vertex_mappings_inner.py → get_property_meta.py} +34 -19
- graphscope/flex/rest/models/get_resource_usage_response.py +105 -0
- graphscope/flex/rest/models/get_storage_usage_response.py +88 -0
- graphscope/flex/rest/models/{procedure.py → get_stored_proc_response.py} +37 -36
- graphscope/flex/rest/models/{groot_edge_type.py → get_vertex_type.py} +33 -31
- graphscope/flex/rest/models/gs_data_type.py +152 -0
- graphscope/flex/rest/models/job_status.py +14 -17
- graphscope/flex/rest/models/{connection.py → long_text.py} +20 -15
- graphscope/flex/rest/models/node_status.py +15 -15
- graphscope/flex/rest/models/{procedure_params_inner.py → parameter.py} +20 -16
- graphscope/flex/rest/models/{deployment_info_graphs_info_value.py → pod_status.py} +34 -20
- graphscope/flex/rest/models/{property_property_type.py → primitive_type.py} +16 -19
- graphscope/flex/rest/models/resource_usage.py +92 -0
- graphscope/flex/rest/models/{deployment_info.py → running_deployment_info.py} +42 -45
- graphscope/flex/rest/models/running_deployment_status.py +124 -0
- graphscope/flex/rest/models/schema_mapping.py +18 -26
- graphscope/flex/rest/models/service_status.py +22 -13
- graphscope/flex/rest/models/service_status_sdk_endpoints.py +8 -8
- graphscope/flex/rest/models/start_service_request.py +11 -11
- graphscope/flex/rest/models/{groot_graph.py → stored_procedure_meta.py} +46 -36
- graphscope/flex/rest/models/string_type.py +92 -0
- graphscope/flex/rest/models/string_type_string.py +124 -0
- graphscope/flex/rest/models/temporal_type.py +92 -0
- graphscope/flex/rest/models/temporal_type_temporal.py +138 -0
- graphscope/flex/rest/models/time_stamp_type.py +88 -0
- graphscope/flex/rest/models/update_alert_message_status_request.py +97 -0
- graphscope/flex/rest/models/update_stored_proc_request.py +88 -0
- graphscope/flex/rest/models/upload_file_response.py +90 -0
- graphscope/flex/rest/models/vertex_mapping.py +13 -13
- graphscope/flex/rest/rest.py +4 -2
- graphscope_flex-0.28.0a20240920.dist-info/METADATA +19 -0
- graphscope_flex-0.28.0a20240920.dist-info/RECORD +86 -0
- {graphscope_flex-0.27.0.dist-info → graphscope_flex-0.28.0a20240920.dist-info}/WHEEL +1 -1
- graphscope/flex/rest/api/connection_api.py +0 -550
- graphscope/flex/rest/api/datasource_api.py +0 -2308
- graphscope/flex/rest/models/data_source.py +0 -106
- graphscope/flex/rest/models/deployment_status.py +0 -108
- graphscope/flex/rest/models/edge_data_source.py +0 -112
- graphscope/flex/rest/models/edge_mapping_source_vertex_mappings_inner.py +0 -92
- graphscope/flex/rest/models/groot_graph_gremlin_interface.py +0 -94
- graphscope/flex/rest/models/groot_property.py +0 -104
- graphscope/flex/rest/models/update_alert_messages_request.py +0 -110
- graphscope/flex/rest/models/vertex_data_source.py +0 -104
- graphscope_flex-0.27.0.dist-info/METADATA +0 -17
- graphscope_flex-0.27.0.dist-info/RECORD +0 -71
- {graphscope_flex-0.27.0.dist-info → graphscope_flex-0.28.0a20240920.dist-info}/top_level.txt +0 -0
@@ -3,9 +3,9 @@
|
|
3
3
|
"""
|
4
4
|
GraphScope FLEX HTTP SERVICE API
|
5
5
|
|
6
|
-
This is a specification for GraphScope FLEX HTTP service based on the OpenAPI 3.0 specification. You can find out more details about specification at [doc](https://swagger.io/specification/v3/).
|
6
|
+
This is a specification for GraphScope FLEX HTTP service based on the OpenAPI 3.0 specification. You can find out more details about specification at [doc](https://swagger.io/specification/v3/).
|
7
7
|
|
8
|
-
The version of the OpenAPI document: 0.
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
9
|
Contact: graphscope@alibaba-inc.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -18,29 +18,26 @@ import pprint
|
|
18
18
|
import re # noqa: F401
|
19
19
|
import json
|
20
20
|
|
21
|
-
from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, field_validator
|
22
|
-
from typing import Any, ClassVar, Dict, List
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
23
23
|
from typing import Optional, Set
|
24
24
|
from typing_extensions import Self
|
25
25
|
|
26
|
-
class
|
26
|
+
class CreateAlertRuleRequest(BaseModel):
|
27
27
|
"""
|
28
|
-
|
28
|
+
CreateAlertRuleRequest
|
29
29
|
""" # noqa: E501
|
30
|
-
name:
|
31
|
-
severity:
|
32
|
-
metric_type:
|
33
|
-
conditions_description:
|
34
|
-
frequency:
|
35
|
-
enable:
|
30
|
+
name: StrictStr
|
31
|
+
severity: StrictStr
|
32
|
+
metric_type: StrictStr
|
33
|
+
conditions_description: StrictStr
|
34
|
+
frequency: StrictInt = Field(description="(mins)")
|
35
|
+
enable: StrictBool
|
36
36
|
__properties: ClassVar[List[str]] = ["name", "severity", "metric_type", "conditions_description", "frequency", "enable"]
|
37
37
|
|
38
38
|
@field_validator('severity')
|
39
39
|
def severity_validate_enum(cls, value):
|
40
40
|
"""Validates the enum"""
|
41
|
-
if value is None:
|
42
|
-
return value
|
43
|
-
|
44
41
|
if value not in set(['warning', 'emergency']):
|
45
42
|
raise ValueError("must be one of enum values ('warning', 'emergency')")
|
46
43
|
return value
|
@@ -48,18 +45,15 @@ class AlertRule(BaseModel):
|
|
48
45
|
@field_validator('metric_type')
|
49
46
|
def metric_type_validate_enum(cls, value):
|
50
47
|
"""Validates the enum"""
|
51
|
-
if value is None:
|
52
|
-
return value
|
53
|
-
|
54
48
|
if value not in set(['node', 'service']):
|
55
49
|
raise ValueError("must be one of enum values ('node', 'service')")
|
56
50
|
return value
|
57
51
|
|
58
|
-
model_config =
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
52
|
+
model_config = ConfigDict(
|
53
|
+
populate_by_name=True,
|
54
|
+
validate_assignment=True,
|
55
|
+
protected_namespaces=(),
|
56
|
+
)
|
63
57
|
|
64
58
|
|
65
59
|
def to_str(self) -> str:
|
@@ -73,7 +67,7 @@ class AlertRule(BaseModel):
|
|
73
67
|
|
74
68
|
@classmethod
|
75
69
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
76
|
-
"""Create an instance of
|
70
|
+
"""Create an instance of CreateAlertRuleRequest from a JSON string"""
|
77
71
|
return cls.from_dict(json.loads(json_str))
|
78
72
|
|
79
73
|
def to_dict(self) -> Dict[str, Any]:
|
@@ -98,7 +92,7 @@ class AlertRule(BaseModel):
|
|
98
92
|
|
99
93
|
@classmethod
|
100
94
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
101
|
-
"""Create an instance of
|
95
|
+
"""Create an instance of CreateAlertRuleRequest from a dict"""
|
102
96
|
if obj is None:
|
103
97
|
return None
|
104
98
|
|
@@ -0,0 +1,88 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
GraphScope FLEX HTTP SERVICE API
|
5
|
+
|
6
|
+
This is a specification for GraphScope FLEX HTTP service based on the OpenAPI 3.0 specification. You can find out more details about specification at [doc](https://swagger.io/specification/v3/).
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Contact: graphscope@alibaba-inc.com
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
|
+
|
12
|
+
Do not edit the class manually.
|
13
|
+
""" # noqa: E501
|
14
|
+
|
15
|
+
|
16
|
+
from __future__ import annotations
|
17
|
+
import pprint
|
18
|
+
import re # noqa: F401
|
19
|
+
import json
|
20
|
+
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
25
|
+
|
26
|
+
class CreateDataloadingJobResponse(BaseModel):
|
27
|
+
"""
|
28
|
+
CreateDataloadingJobResponse
|
29
|
+
""" # noqa: E501
|
30
|
+
job_id: StrictStr
|
31
|
+
__properties: ClassVar[List[str]] = ["job_id"]
|
32
|
+
|
33
|
+
model_config = ConfigDict(
|
34
|
+
populate_by_name=True,
|
35
|
+
validate_assignment=True,
|
36
|
+
protected_namespaces=(),
|
37
|
+
)
|
38
|
+
|
39
|
+
|
40
|
+
def to_str(self) -> str:
|
41
|
+
"""Returns the string representation of the model using alias"""
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
43
|
+
|
44
|
+
def to_json(self) -> str:
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
47
|
+
return json.dumps(self.to_dict())
|
48
|
+
|
49
|
+
@classmethod
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
51
|
+
"""Create an instance of CreateDataloadingJobResponse from a JSON string"""
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
53
|
+
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
56
|
+
|
57
|
+
This has the following differences from calling pydantic's
|
58
|
+
`self.model_dump(by_alias=True)`:
|
59
|
+
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
61
|
+
were set at model initialization. Other fields with value `None`
|
62
|
+
are ignored.
|
63
|
+
"""
|
64
|
+
excluded_fields: Set[str] = set([
|
65
|
+
])
|
66
|
+
|
67
|
+
_dict = self.model_dump(
|
68
|
+
by_alias=True,
|
69
|
+
exclude=excluded_fields,
|
70
|
+
exclude_none=True,
|
71
|
+
)
|
72
|
+
return _dict
|
73
|
+
|
74
|
+
@classmethod
|
75
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
76
|
+
"""Create an instance of CreateDataloadingJobResponse from a dict"""
|
77
|
+
if obj is None:
|
78
|
+
return None
|
79
|
+
|
80
|
+
if not isinstance(obj, dict):
|
81
|
+
return cls.model_validate(obj)
|
82
|
+
|
83
|
+
_obj = cls.model_validate({
|
84
|
+
"job_id": obj.get("job_id")
|
85
|
+
})
|
86
|
+
return _obj
|
87
|
+
|
88
|
+
|
@@ -0,0 +1,114 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
GraphScope FLEX HTTP SERVICE API
|
5
|
+
|
6
|
+
This is a specification for GraphScope FLEX HTTP service based on the OpenAPI 3.0 specification. You can find out more details about specification at [doc](https://swagger.io/specification/v3/).
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Contact: graphscope@alibaba-inc.com
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
|
+
|
12
|
+
Do not edit the class manually.
|
13
|
+
""" # noqa: E501
|
14
|
+
|
15
|
+
|
16
|
+
from __future__ import annotations
|
17
|
+
import pprint
|
18
|
+
import re # noqa: F401
|
19
|
+
import json
|
20
|
+
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
+
from graphscope.flex.rest.models.base_edge_type_vertex_type_pair_relations_inner import BaseEdgeTypeVertexTypePairRelationsInner
|
24
|
+
from graphscope.flex.rest.models.create_property_meta import CreatePropertyMeta
|
25
|
+
from typing import Optional, Set
|
26
|
+
from typing_extensions import Self
|
27
|
+
|
28
|
+
class CreateEdgeType(BaseModel):
|
29
|
+
"""
|
30
|
+
CreateEdgeType
|
31
|
+
""" # noqa: E501
|
32
|
+
type_name: StrictStr
|
33
|
+
vertex_type_pair_relations: List[BaseEdgeTypeVertexTypePairRelationsInner]
|
34
|
+
directed: Optional[StrictBool] = None
|
35
|
+
primary_keys: Optional[List[StrictStr]] = None
|
36
|
+
properties: Optional[List[CreatePropertyMeta]] = None
|
37
|
+
description: Optional[StrictStr] = None
|
38
|
+
__properties: ClassVar[List[str]] = ["type_name", "vertex_type_pair_relations", "directed", "primary_keys", "properties", "description"]
|
39
|
+
|
40
|
+
model_config = ConfigDict(
|
41
|
+
populate_by_name=True,
|
42
|
+
validate_assignment=True,
|
43
|
+
protected_namespaces=(),
|
44
|
+
)
|
45
|
+
|
46
|
+
|
47
|
+
def to_str(self) -> str:
|
48
|
+
"""Returns the string representation of the model using alias"""
|
49
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
50
|
+
|
51
|
+
def to_json(self) -> str:
|
52
|
+
"""Returns the JSON representation of the model using alias"""
|
53
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
54
|
+
return json.dumps(self.to_dict())
|
55
|
+
|
56
|
+
@classmethod
|
57
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
58
|
+
"""Create an instance of CreateEdgeType from a JSON string"""
|
59
|
+
return cls.from_dict(json.loads(json_str))
|
60
|
+
|
61
|
+
def to_dict(self) -> Dict[str, Any]:
|
62
|
+
"""Return the dictionary representation of the model using alias.
|
63
|
+
|
64
|
+
This has the following differences from calling pydantic's
|
65
|
+
`self.model_dump(by_alias=True)`:
|
66
|
+
|
67
|
+
* `None` is only added to the output dict for nullable fields that
|
68
|
+
were set at model initialization. Other fields with value `None`
|
69
|
+
are ignored.
|
70
|
+
"""
|
71
|
+
excluded_fields: Set[str] = set([
|
72
|
+
])
|
73
|
+
|
74
|
+
_dict = self.model_dump(
|
75
|
+
by_alias=True,
|
76
|
+
exclude=excluded_fields,
|
77
|
+
exclude_none=True,
|
78
|
+
)
|
79
|
+
# override the default output from pydantic by calling `to_dict()` of each item in vertex_type_pair_relations (list)
|
80
|
+
_items = []
|
81
|
+
if self.vertex_type_pair_relations:
|
82
|
+
for _item_vertex_type_pair_relations in self.vertex_type_pair_relations:
|
83
|
+
if _item_vertex_type_pair_relations:
|
84
|
+
_items.append(_item_vertex_type_pair_relations.to_dict())
|
85
|
+
_dict['vertex_type_pair_relations'] = _items
|
86
|
+
# override the default output from pydantic by calling `to_dict()` of each item in properties (list)
|
87
|
+
_items = []
|
88
|
+
if self.properties:
|
89
|
+
for _item_properties in self.properties:
|
90
|
+
if _item_properties:
|
91
|
+
_items.append(_item_properties.to_dict())
|
92
|
+
_dict['properties'] = _items
|
93
|
+
return _dict
|
94
|
+
|
95
|
+
@classmethod
|
96
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
97
|
+
"""Create an instance of CreateEdgeType from a dict"""
|
98
|
+
if obj is None:
|
99
|
+
return None
|
100
|
+
|
101
|
+
if not isinstance(obj, dict):
|
102
|
+
return cls.model_validate(obj)
|
103
|
+
|
104
|
+
_obj = cls.model_validate({
|
105
|
+
"type_name": obj.get("type_name"),
|
106
|
+
"vertex_type_pair_relations": [BaseEdgeTypeVertexTypePairRelationsInner.from_dict(_item) for _item in obj["vertex_type_pair_relations"]] if obj.get("vertex_type_pair_relations") is not None else None,
|
107
|
+
"directed": obj.get("directed"),
|
108
|
+
"primary_keys": obj.get("primary_keys"),
|
109
|
+
"properties": [CreatePropertyMeta.from_dict(_item) for _item in obj["properties"]] if obj.get("properties") is not None else None,
|
110
|
+
"description": obj.get("description")
|
111
|
+
})
|
112
|
+
return _obj
|
113
|
+
|
114
|
+
|
@@ -3,9 +3,9 @@
|
|
3
3
|
"""
|
4
4
|
GraphScope FLEX HTTP SERVICE API
|
5
5
|
|
6
|
-
This is a specification for GraphScope FLEX HTTP service based on the OpenAPI 3.0 specification. You can find out more details about specification at [doc](https://swagger.io/specification/v3/).
|
6
|
+
This is a specification for GraphScope FLEX HTTP service based on the OpenAPI 3.0 specification. You can find out more details about specification at [doc](https://swagger.io/specification/v3/).
|
7
7
|
|
8
|
-
The version of the OpenAPI document: 0.
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
9
|
Contact: graphscope@alibaba-inc.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -18,38 +18,28 @@ import pprint
|
|
18
18
|
import re # noqa: F401
|
19
19
|
import json
|
20
20
|
|
21
|
-
from pydantic import BaseModel, Field, StrictStr
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
-
from graphscope.flex.rest.models.
|
24
|
-
from graphscope.flex.rest.models.
|
23
|
+
from graphscope.flex.rest.models.create_graph_schema_request import CreateGraphSchemaRequest
|
24
|
+
from graphscope.flex.rest.models.create_stored_proc_request import CreateStoredProcRequest
|
25
25
|
from typing import Optional, Set
|
26
26
|
from typing_extensions import Self
|
27
27
|
|
28
|
-
class
|
28
|
+
class CreateGraphRequest(BaseModel):
|
29
29
|
"""
|
30
|
-
|
30
|
+
CreateGraphRequest
|
31
31
|
""" # noqa: E501
|
32
32
|
name: Optional[StrictStr] = None
|
33
|
-
|
34
|
-
stored_procedures: Optional[
|
35
|
-
var_schema: Optional[
|
36
|
-
__properties: ClassVar[List[str]] = ["name", "
|
33
|
+
description: Optional[StrictStr] = None
|
34
|
+
stored_procedures: Optional[List[CreateStoredProcRequest]] = None
|
35
|
+
var_schema: Optional[CreateGraphSchemaRequest] = Field(default=None, alias="schema")
|
36
|
+
__properties: ClassVar[List[str]] = ["name", "description", "stored_procedures", "schema"]
|
37
37
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
if value not in set(['mutable_csr']):
|
45
|
-
raise ValueError("must be one of enum values ('mutable_csr')")
|
46
|
-
return value
|
47
|
-
|
48
|
-
model_config = {
|
49
|
-
"populate_by_name": True,
|
50
|
-
"validate_assignment": True,
|
51
|
-
"protected_namespaces": (),
|
52
|
-
}
|
38
|
+
model_config = ConfigDict(
|
39
|
+
populate_by_name=True,
|
40
|
+
validate_assignment=True,
|
41
|
+
protected_namespaces=(),
|
42
|
+
)
|
53
43
|
|
54
44
|
|
55
45
|
def to_str(self) -> str:
|
@@ -63,7 +53,7 @@ class Graph(BaseModel):
|
|
63
53
|
|
64
54
|
@classmethod
|
65
55
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
66
|
-
"""Create an instance of
|
56
|
+
"""Create an instance of CreateGraphRequest from a JSON string"""
|
67
57
|
return cls.from_dict(json.loads(json_str))
|
68
58
|
|
69
59
|
def to_dict(self) -> Dict[str, Any]:
|
@@ -84,9 +74,13 @@ class Graph(BaseModel):
|
|
84
74
|
exclude=excluded_fields,
|
85
75
|
exclude_none=True,
|
86
76
|
)
|
87
|
-
# override the default output from pydantic by calling `to_dict()` of stored_procedures
|
77
|
+
# override the default output from pydantic by calling `to_dict()` of each item in stored_procedures (list)
|
78
|
+
_items = []
|
88
79
|
if self.stored_procedures:
|
89
|
-
|
80
|
+
for _item_stored_procedures in self.stored_procedures:
|
81
|
+
if _item_stored_procedures:
|
82
|
+
_items.append(_item_stored_procedures.to_dict())
|
83
|
+
_dict['stored_procedures'] = _items
|
90
84
|
# override the default output from pydantic by calling `to_dict()` of var_schema
|
91
85
|
if self.var_schema:
|
92
86
|
_dict['schema'] = self.var_schema.to_dict()
|
@@ -94,7 +88,7 @@ class Graph(BaseModel):
|
|
94
88
|
|
95
89
|
@classmethod
|
96
90
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
97
|
-
"""Create an instance of
|
91
|
+
"""Create an instance of CreateGraphRequest from a dict"""
|
98
92
|
if obj is None:
|
99
93
|
return None
|
100
94
|
|
@@ -103,9 +97,9 @@ class Graph(BaseModel):
|
|
103
97
|
|
104
98
|
_obj = cls.model_validate({
|
105
99
|
"name": obj.get("name"),
|
106
|
-
"
|
107
|
-
"stored_procedures":
|
108
|
-
"schema":
|
100
|
+
"description": obj.get("description"),
|
101
|
+
"stored_procedures": [CreateStoredProcRequest.from_dict(_item) for _item in obj["stored_procedures"]] if obj.get("stored_procedures") is not None else None,
|
102
|
+
"schema": CreateGraphSchemaRequest.from_dict(obj["schema"]) if obj.get("schema") is not None else None
|
109
103
|
})
|
110
104
|
return _obj
|
111
105
|
|
@@ -0,0 +1,88 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
GraphScope FLEX HTTP SERVICE API
|
5
|
+
|
6
|
+
This is a specification for GraphScope FLEX HTTP service based on the OpenAPI 3.0 specification. You can find out more details about specification at [doc](https://swagger.io/specification/v3/).
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Contact: graphscope@alibaba-inc.com
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
|
+
|
12
|
+
Do not edit the class manually.
|
13
|
+
""" # noqa: E501
|
14
|
+
|
15
|
+
|
16
|
+
from __future__ import annotations
|
17
|
+
import pprint
|
18
|
+
import re # noqa: F401
|
19
|
+
import json
|
20
|
+
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
25
|
+
|
26
|
+
class CreateGraphResponse(BaseModel):
|
27
|
+
"""
|
28
|
+
CreateGraphResponse
|
29
|
+
""" # noqa: E501
|
30
|
+
graph_id: StrictStr
|
31
|
+
__properties: ClassVar[List[str]] = ["graph_id"]
|
32
|
+
|
33
|
+
model_config = ConfigDict(
|
34
|
+
populate_by_name=True,
|
35
|
+
validate_assignment=True,
|
36
|
+
protected_namespaces=(),
|
37
|
+
)
|
38
|
+
|
39
|
+
|
40
|
+
def to_str(self) -> str:
|
41
|
+
"""Returns the string representation of the model using alias"""
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
43
|
+
|
44
|
+
def to_json(self) -> str:
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
47
|
+
return json.dumps(self.to_dict())
|
48
|
+
|
49
|
+
@classmethod
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
51
|
+
"""Create an instance of CreateGraphResponse from a JSON string"""
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
53
|
+
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
56
|
+
|
57
|
+
This has the following differences from calling pydantic's
|
58
|
+
`self.model_dump(by_alias=True)`:
|
59
|
+
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
61
|
+
were set at model initialization. Other fields with value `None`
|
62
|
+
are ignored.
|
63
|
+
"""
|
64
|
+
excluded_fields: Set[str] = set([
|
65
|
+
])
|
66
|
+
|
67
|
+
_dict = self.model_dump(
|
68
|
+
by_alias=True,
|
69
|
+
exclude=excluded_fields,
|
70
|
+
exclude_none=True,
|
71
|
+
)
|
72
|
+
return _dict
|
73
|
+
|
74
|
+
@classmethod
|
75
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
76
|
+
"""Create an instance of CreateGraphResponse from a dict"""
|
77
|
+
if obj is None:
|
78
|
+
return None
|
79
|
+
|
80
|
+
if not isinstance(obj, dict):
|
81
|
+
return cls.model_validate(obj)
|
82
|
+
|
83
|
+
_obj = cls.model_validate({
|
84
|
+
"graph_id": obj.get("graph_id")
|
85
|
+
})
|
86
|
+
return _obj
|
87
|
+
|
88
|
+
|
@@ -3,9 +3,9 @@
|
|
3
3
|
"""
|
4
4
|
GraphScope FLEX HTTP SERVICE API
|
5
5
|
|
6
|
-
This is a specification for GraphScope FLEX HTTP service based on the OpenAPI 3.0 specification. You can find out more details about specification at [doc](https://swagger.io/specification/v3/).
|
6
|
+
This is a specification for GraphScope FLEX HTTP service based on the OpenAPI 3.0 specification. You can find out more details about specification at [doc](https://swagger.io/specification/v3/).
|
7
7
|
|
8
|
-
The version of the OpenAPI document: 0.
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
9
|
Contact: graphscope@alibaba-inc.com
|
10
10
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11
11
|
|
@@ -18,26 +18,26 @@ import pprint
|
|
18
18
|
import re # noqa: F401
|
19
19
|
import json
|
20
20
|
|
21
|
-
from pydantic import BaseModel
|
22
|
-
from typing import Any, ClassVar, Dict, List
|
23
|
-
from graphscope.flex.rest.models.
|
24
|
-
from graphscope.flex.rest.models.
|
21
|
+
from pydantic import BaseModel, ConfigDict
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
23
|
+
from graphscope.flex.rest.models.create_edge_type import CreateEdgeType
|
24
|
+
from graphscope.flex.rest.models.create_vertex_type import CreateVertexType
|
25
25
|
from typing import Optional, Set
|
26
26
|
from typing_extensions import Self
|
27
27
|
|
28
|
-
class
|
28
|
+
class CreateGraphSchemaRequest(BaseModel):
|
29
29
|
"""
|
30
|
-
|
30
|
+
CreateGraphSchemaRequest
|
31
31
|
""" # noqa: E501
|
32
|
-
vertex_types:
|
33
|
-
edge_types:
|
32
|
+
vertex_types: List[CreateVertexType]
|
33
|
+
edge_types: List[CreateEdgeType]
|
34
34
|
__properties: ClassVar[List[str]] = ["vertex_types", "edge_types"]
|
35
35
|
|
36
|
-
model_config =
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
36
|
+
model_config = ConfigDict(
|
37
|
+
populate_by_name=True,
|
38
|
+
validate_assignment=True,
|
39
|
+
protected_namespaces=(),
|
40
|
+
)
|
41
41
|
|
42
42
|
|
43
43
|
def to_str(self) -> str:
|
@@ -51,7 +51,7 @@ class ModelSchema(BaseModel):
|
|
51
51
|
|
52
52
|
@classmethod
|
53
53
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
54
|
-
"""Create an instance of
|
54
|
+
"""Create an instance of CreateGraphSchemaRequest from a JSON string"""
|
55
55
|
return cls.from_dict(json.loads(json_str))
|
56
56
|
|
57
57
|
def to_dict(self) -> Dict[str, Any]:
|
@@ -75,22 +75,22 @@ class ModelSchema(BaseModel):
|
|
75
75
|
# override the default output from pydantic by calling `to_dict()` of each item in vertex_types (list)
|
76
76
|
_items = []
|
77
77
|
if self.vertex_types:
|
78
|
-
for
|
79
|
-
if
|
80
|
-
_items.append(
|
78
|
+
for _item_vertex_types in self.vertex_types:
|
79
|
+
if _item_vertex_types:
|
80
|
+
_items.append(_item_vertex_types.to_dict())
|
81
81
|
_dict['vertex_types'] = _items
|
82
82
|
# override the default output from pydantic by calling `to_dict()` of each item in edge_types (list)
|
83
83
|
_items = []
|
84
84
|
if self.edge_types:
|
85
|
-
for
|
86
|
-
if
|
87
|
-
_items.append(
|
85
|
+
for _item_edge_types in self.edge_types:
|
86
|
+
if _item_edge_types:
|
87
|
+
_items.append(_item_edge_types.to_dict())
|
88
88
|
_dict['edge_types'] = _items
|
89
89
|
return _dict
|
90
90
|
|
91
91
|
@classmethod
|
92
92
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
93
|
-
"""Create an instance of
|
93
|
+
"""Create an instance of CreateGraphSchemaRequest from a dict"""
|
94
94
|
if obj is None:
|
95
95
|
return None
|
96
96
|
|
@@ -98,8 +98,8 @@ class ModelSchema(BaseModel):
|
|
98
98
|
return cls.model_validate(obj)
|
99
99
|
|
100
100
|
_obj = cls.model_validate({
|
101
|
-
"vertex_types": [
|
102
|
-
"edge_types": [
|
101
|
+
"vertex_types": [CreateVertexType.from_dict(_item) for _item in obj["vertex_types"]] if obj.get("vertex_types") is not None else None,
|
102
|
+
"edge_types": [CreateEdgeType.from_dict(_item) for _item in obj["edge_types"]] if obj.get("edge_types") is not None else None
|
103
103
|
})
|
104
104
|
return _obj
|
105
105
|
|