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.
Files changed (96) hide show
  1. graphscope/flex/rest/__init__.py +59 -44
  2. graphscope/flex/rest/api/__init__.py +2 -4
  3. graphscope/flex/rest/api/alert_api.py +721 -394
  4. graphscope/flex/rest/api/{legacy_api.py → data_source_api.py} +260 -189
  5. graphscope/flex/rest/api/deployment_api.py +388 -138
  6. graphscope/flex/rest/api/graph_api.py +858 -260
  7. graphscope/flex/rest/api/job_api.py +286 -203
  8. graphscope/flex/rest/api/service_api.py +320 -39
  9. graphscope/flex/rest/api/{procedure_api.py → stored_procedure_api.py} +296 -237
  10. graphscope/flex/rest/api/utils_api.py +18 -13
  11. graphscope/flex/rest/api_client.py +60 -30
  12. graphscope/flex/rest/configuration.py +19 -5
  13. graphscope/flex/rest/exceptions.py +2 -2
  14. graphscope/flex/rest/models/__init__.py +57 -40
  15. graphscope/flex/rest/models/{vertex_type.py → base_edge_type.py} +25 -25
  16. graphscope/flex/rest/models/{edge_type_vertex_type_pair_relations_inner.py → base_edge_type_vertex_type_pair_relations_inner.py} +17 -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
  18. graphscope/flex/rest/models/{model_property.py → base_property_meta.py} +28 -19
  19. graphscope/flex/rest/models/base_vertex_type.py +96 -0
  20. graphscope/flex/rest/models/{groot_edge_type_relations_inner.py → base_vertex_type_x_csr_params.py} +15 -17
  21. graphscope/flex/rest/models/column_mapping.py +13 -13
  22. graphscope/flex/rest/models/{edge_mapping_source_vertex_mappings_inner_column.py → column_mapping_column.py} +12 -12
  23. graphscope/flex/rest/models/{schema_mapping_loading_config_data_source.py → create_alert_receiver_request.py} +29 -24
  24. graphscope/flex/rest/models/{alert_rule.py → create_alert_rule_request.py} +19 -25
  25. graphscope/flex/rest/models/create_dataloading_job_response.py +88 -0
  26. graphscope/flex/rest/models/create_edge_type.py +114 -0
  27. graphscope/flex/rest/models/{graph.py → create_graph_request.py} +27 -33
  28. graphscope/flex/rest/models/create_graph_response.py +88 -0
  29. graphscope/flex/rest/models/{model_schema.py → create_graph_schema_request.py} +25 -25
  30. graphscope/flex/rest/models/{groot_vertex_type.py → create_property_meta.py} +32 -25
  31. graphscope/flex/rest/models/{graph_stored_procedures.py → create_stored_proc_request.py} +26 -23
  32. graphscope/flex/rest/models/create_stored_proc_response.py +88 -0
  33. graphscope/flex/rest/models/create_vertex_type.py +108 -0
  34. graphscope/flex/rest/models/{groot_dataloading_job_config.py → dataloading_job_config.py} +45 -21
  35. graphscope/flex/rest/models/{groot_dataloading_job_config_edges_inner.py → dataloading_job_config_edges_inner.py} +12 -12
  36. graphscope/flex/rest/models/{schema_mapping_loading_config.py → dataloading_job_config_loading_config.py} +16 -22
  37. graphscope/flex/rest/models/{schema_mapping_loading_config_format.py → dataloading_job_config_loading_config_format.py} +12 -12
  38. graphscope/flex/rest/models/dataloading_job_config_vertices_inner.py +88 -0
  39. graphscope/flex/rest/models/dataloading_mr_job_config.py +88 -0
  40. graphscope/flex/rest/models/date_type.py +88 -0
  41. graphscope/flex/rest/models/edge_mapping.py +23 -25
  42. graphscope/flex/rest/models/edge_mapping_type_triplet.py +12 -12
  43. graphscope/flex/rest/models/error.py +90 -0
  44. graphscope/flex/rest/models/{alert_message.py → get_alert_message_response.py} +23 -32
  45. graphscope/flex/rest/models/{alert_receiver.py → get_alert_receiver_response.py} +22 -25
  46. graphscope/flex/rest/models/{connection_status.py → get_alert_rule_response.py} +37 -33
  47. graphscope/flex/rest/models/{edge_type.py → get_edge_type.py} +33 -27
  48. graphscope/flex/rest/models/get_graph_response.py +139 -0
  49. graphscope/flex/rest/models/{groot_schema.py → get_graph_schema_response.py} +32 -32
  50. graphscope/flex/rest/models/get_pod_log_response.py +88 -0
  51. graphscope/flex/rest/models/{edge_mapping_destination_vertex_mappings_inner.py → get_property_meta.py} +34 -19
  52. graphscope/flex/rest/models/get_resource_usage_response.py +105 -0
  53. graphscope/flex/rest/models/get_storage_usage_response.py +88 -0
  54. graphscope/flex/rest/models/{procedure.py → get_stored_proc_response.py} +37 -36
  55. graphscope/flex/rest/models/{groot_edge_type.py → get_vertex_type.py} +33 -31
  56. graphscope/flex/rest/models/gs_data_type.py +152 -0
  57. graphscope/flex/rest/models/job_status.py +14 -17
  58. graphscope/flex/rest/models/{connection.py → long_text.py} +20 -15
  59. graphscope/flex/rest/models/node_status.py +15 -15
  60. graphscope/flex/rest/models/{procedure_params_inner.py → parameter.py} +20 -16
  61. graphscope/flex/rest/models/{deployment_info_graphs_info_value.py → pod_status.py} +34 -20
  62. graphscope/flex/rest/models/{property_property_type.py → primitive_type.py} +16 -19
  63. graphscope/flex/rest/models/resource_usage.py +92 -0
  64. graphscope/flex/rest/models/{deployment_info.py → running_deployment_info.py} +42 -45
  65. graphscope/flex/rest/models/running_deployment_status.py +124 -0
  66. graphscope/flex/rest/models/schema_mapping.py +18 -26
  67. graphscope/flex/rest/models/service_status.py +22 -13
  68. graphscope/flex/rest/models/service_status_sdk_endpoints.py +8 -8
  69. graphscope/flex/rest/models/start_service_request.py +11 -11
  70. graphscope/flex/rest/models/{groot_graph.py → stored_procedure_meta.py} +46 -36
  71. graphscope/flex/rest/models/string_type.py +92 -0
  72. graphscope/flex/rest/models/string_type_string.py +124 -0
  73. graphscope/flex/rest/models/temporal_type.py +92 -0
  74. graphscope/flex/rest/models/temporal_type_temporal.py +138 -0
  75. graphscope/flex/rest/models/time_stamp_type.py +88 -0
  76. graphscope/flex/rest/models/update_alert_message_status_request.py +97 -0
  77. graphscope/flex/rest/models/update_stored_proc_request.py +88 -0
  78. graphscope/flex/rest/models/upload_file_response.py +90 -0
  79. graphscope/flex/rest/models/vertex_mapping.py +13 -13
  80. graphscope/flex/rest/rest.py +4 -2
  81. graphscope_flex-0.28.0a20240920.dist-info/METADATA +19 -0
  82. graphscope_flex-0.28.0a20240920.dist-info/RECORD +86 -0
  83. {graphscope_flex-0.27.0.dist-info → graphscope_flex-0.28.0a20240920.dist-info}/WHEEL +1 -1
  84. graphscope/flex/rest/api/connection_api.py +0 -550
  85. graphscope/flex/rest/api/datasource_api.py +0 -2308
  86. graphscope/flex/rest/models/data_source.py +0 -106
  87. graphscope/flex/rest/models/deployment_status.py +0 -108
  88. graphscope/flex/rest/models/edge_data_source.py +0 -112
  89. graphscope/flex/rest/models/edge_mapping_source_vertex_mappings_inner.py +0 -92
  90. graphscope/flex/rest/models/groot_graph_gremlin_interface.py +0 -94
  91. graphscope/flex/rest/models/groot_property.py +0 -104
  92. graphscope/flex/rest/models/update_alert_messages_request.py +0 -110
  93. graphscope/flex/rest/models/vertex_data_source.py +0 -104
  94. graphscope_flex-0.27.0.dist-info/METADATA +0 -17
  95. graphscope_flex-0.27.0.dist-info/RECORD +0 -71
  96. {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/). Some useful links: - [GraphScope Repository](https://github.com/alibaba/GraphScope) - [The Source API definition for GraphScope Interactive](https://github.com/GraphScope/portal/tree/main/httpservice)
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.9.1
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, Optional
23
- from graphscope.flex.rest.models.groot_edge_type import GrootEdgeType
24
- from graphscope.flex.rest.models.groot_vertex_type import GrootVertexType
21
+ from pydantic import BaseModel, ConfigDict
22
+ from typing import Any, ClassVar, Dict, List
23
+ from graphscope.flex.rest.models.get_edge_type import GetEdgeType
24
+ from graphscope.flex.rest.models.get_vertex_type import GetVertexType
25
25
  from typing import Optional, Set
26
26
  from typing_extensions import Self
27
27
 
28
- class GrootSchema(BaseModel):
28
+ class GetGraphSchemaResponse(BaseModel):
29
29
  """
30
- GrootSchema
30
+ GetGraphSchemaResponse
31
31
  """ # noqa: E501
32
- vertices: Optional[List[GrootVertexType]] = None
33
- edges: Optional[List[GrootEdgeType]] = None
34
- __properties: ClassVar[List[str]] = ["vertices", "edges"]
32
+ vertex_types: List[GetVertexType]
33
+ edge_types: List[GetEdgeType]
34
+ __properties: ClassVar[List[str]] = ["vertex_types", "edge_types"]
35
35
 
36
- model_config = {
37
- "populate_by_name": True,
38
- "validate_assignment": True,
39
- "protected_namespaces": (),
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 GrootSchema(BaseModel):
51
51
 
52
52
  @classmethod
53
53
  def from_json(cls, json_str: str) -> Optional[Self]:
54
- """Create an instance of GrootSchema from a JSON string"""
54
+ """Create an instance of GetGraphSchemaResponse 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]:
@@ -72,25 +72,25 @@ class GrootSchema(BaseModel):
72
72
  exclude=excluded_fields,
73
73
  exclude_none=True,
74
74
  )
75
- # override the default output from pydantic by calling `to_dict()` of each item in vertices (list)
75
+ # override the default output from pydantic by calling `to_dict()` of each item in vertex_types (list)
76
76
  _items = []
77
- if self.vertices:
78
- for _item in self.vertices:
79
- if _item:
80
- _items.append(_item.to_dict())
81
- _dict['vertices'] = _items
82
- # override the default output from pydantic by calling `to_dict()` of each item in edges (list)
77
+ if self.vertex_types:
78
+ for _item_vertex_types in self.vertex_types:
79
+ if _item_vertex_types:
80
+ _items.append(_item_vertex_types.to_dict())
81
+ _dict['vertex_types'] = _items
82
+ # override the default output from pydantic by calling `to_dict()` of each item in edge_types (list)
83
83
  _items = []
84
- if self.edges:
85
- for _item in self.edges:
86
- if _item:
87
- _items.append(_item.to_dict())
88
- _dict['edges'] = _items
84
+ if self.edge_types:
85
+ for _item_edge_types in self.edge_types:
86
+ if _item_edge_types:
87
+ _items.append(_item_edge_types.to_dict())
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 GrootSchema from a dict"""
93
+ """Create an instance of GetGraphSchemaResponse from a dict"""
94
94
  if obj is None:
95
95
  return None
96
96
 
@@ -98,8 +98,8 @@ class GrootSchema(BaseModel):
98
98
  return cls.model_validate(obj)
99
99
 
100
100
  _obj = cls.model_validate({
101
- "vertices": [GrootVertexType.from_dict(_item) for _item in obj["vertices"]] if obj.get("vertices") is not None else None,
102
- "edges": [GrootEdgeType.from_dict(_item) for _item in obj["edges"]] if obj.get("edges") is not None else None
101
+ "vertex_types": [GetVertexType.from_dict(_item) for _item in obj["vertex_types"]] if obj.get("vertex_types") is not None else None,
102
+ "edge_types": [GetEdgeType.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
 
@@ -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
22
+ from typing import Any, ClassVar, Dict, List
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class GetPodLogResponse(BaseModel):
27
+ """
28
+ GetPodLogResponse
29
+ """ # noqa: E501
30
+ log: Dict[str, Any]
31
+ __properties: ClassVar[List[str]] = ["log"]
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 GetPodLogResponse 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 GetPodLogResponse 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
+ "log": obj.get("log")
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/). Some useful links: - [GraphScope Repository](https://github.com/alibaba/GraphScope) - [The Source API definition for GraphScope Interactive](https://github.com/GraphScope/portal/tree/main/httpservice)
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.9.1
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,24 +18,29 @@ import pprint
18
18
  import re # noqa: F401
19
19
  import json
20
20
 
21
- from pydantic import BaseModel
21
+ from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
- from graphscope.flex.rest.models.edge_mapping_source_vertex_mappings_inner_column import EdgeMappingSourceVertexMappingsInnerColumn
23
+ from graphscope.flex.rest.models.gs_data_type import GSDataType
24
24
  from typing import Optional, Set
25
25
  from typing_extensions import Self
26
26
 
27
- class EdgeMappingDestinationVertexMappingsInner(BaseModel):
27
+ class GetPropertyMeta(BaseModel):
28
28
  """
29
- Mapping column index to the primary key of destination vertex
29
+ GetPropertyMeta
30
30
  """ # noqa: E501
31
- column: Optional[EdgeMappingSourceVertexMappingsInnerColumn] = None
32
- __properties: ClassVar[List[str]] = ["column"]
31
+ property_name: StrictStr
32
+ property_type: GSDataType
33
+ nullable: Optional[StrictBool] = None
34
+ default_value: Optional[Any] = None
35
+ description: Optional[StrictStr] = None
36
+ property_id: StrictInt
37
+ __properties: ClassVar[List[str]] = ["property_name", "property_type", "nullable", "default_value", "description", "property_id"]
33
38
 
34
- model_config = {
35
- "populate_by_name": True,
36
- "validate_assignment": True,
37
- "protected_namespaces": (),
38
- }
39
+ model_config = ConfigDict(
40
+ populate_by_name=True,
41
+ validate_assignment=True,
42
+ protected_namespaces=(),
43
+ )
39
44
 
40
45
 
41
46
  def to_str(self) -> str:
@@ -49,7 +54,7 @@ class EdgeMappingDestinationVertexMappingsInner(BaseModel):
49
54
 
50
55
  @classmethod
51
56
  def from_json(cls, json_str: str) -> Optional[Self]:
52
- """Create an instance of EdgeMappingDestinationVertexMappingsInner from a JSON string"""
57
+ """Create an instance of GetPropertyMeta from a JSON string"""
53
58
  return cls.from_dict(json.loads(json_str))
54
59
 
55
60
  def to_dict(self) -> Dict[str, Any]:
@@ -70,14 +75,19 @@ class EdgeMappingDestinationVertexMappingsInner(BaseModel):
70
75
  exclude=excluded_fields,
71
76
  exclude_none=True,
72
77
  )
73
- # override the default output from pydantic by calling `to_dict()` of column
74
- if self.column:
75
- _dict['column'] = self.column.to_dict()
78
+ # override the default output from pydantic by calling `to_dict()` of property_type
79
+ if self.property_type:
80
+ _dict['property_type'] = self.property_type.to_dict()
81
+ # set to None if default_value (nullable) is None
82
+ # and model_fields_set contains the field
83
+ if self.default_value is None and "default_value" in self.model_fields_set:
84
+ _dict['default_value'] = None
85
+
76
86
  return _dict
77
87
 
78
88
  @classmethod
79
89
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
80
- """Create an instance of EdgeMappingDestinationVertexMappingsInner from a dict"""
90
+ """Create an instance of GetPropertyMeta from a dict"""
81
91
  if obj is None:
82
92
  return None
83
93
 
@@ -85,7 +95,12 @@ class EdgeMappingDestinationVertexMappingsInner(BaseModel):
85
95
  return cls.model_validate(obj)
86
96
 
87
97
  _obj = cls.model_validate({
88
- "column": EdgeMappingSourceVertexMappingsInnerColumn.from_dict(obj["column"]) if obj.get("column") is not None else None
98
+ "property_name": obj.get("property_name"),
99
+ "property_type": GSDataType.from_dict(obj["property_type"]) if obj.get("property_type") is not None else None,
100
+ "nullable": obj.get("nullable"),
101
+ "default_value": obj.get("default_value"),
102
+ "description": obj.get("description"),
103
+ "property_id": obj.get("property_id")
89
104
  })
90
105
  return _obj
91
106
 
@@ -0,0 +1,105 @@
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
22
+ from typing import Any, ClassVar, Dict, List
23
+ from graphscope.flex.rest.models.resource_usage import ResourceUsage
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class GetResourceUsageResponse(BaseModel):
28
+ """
29
+ GetResourceUsageResponse
30
+ """ # noqa: E501
31
+ cpu_usage: List[ResourceUsage]
32
+ memory_usage: List[ResourceUsage]
33
+ __properties: ClassVar[List[str]] = ["cpu_usage", "memory_usage"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of GetResourceUsageResponse from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ # override the default output from pydantic by calling `to_dict()` of each item in cpu_usage (list)
75
+ _items = []
76
+ if self.cpu_usage:
77
+ for _item_cpu_usage in self.cpu_usage:
78
+ if _item_cpu_usage:
79
+ _items.append(_item_cpu_usage.to_dict())
80
+ _dict['cpu_usage'] = _items
81
+ # override the default output from pydantic by calling `to_dict()` of each item in memory_usage (list)
82
+ _items = []
83
+ if self.memory_usage:
84
+ for _item_memory_usage in self.memory_usage:
85
+ if _item_memory_usage:
86
+ _items.append(_item_memory_usage.to_dict())
87
+ _dict['memory_usage'] = _items
88
+ return _dict
89
+
90
+ @classmethod
91
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
92
+ """Create an instance of GetResourceUsageResponse from a dict"""
93
+ if obj is None:
94
+ return None
95
+
96
+ if not isinstance(obj, dict):
97
+ return cls.model_validate(obj)
98
+
99
+ _obj = cls.model_validate({
100
+ "cpu_usage": [ResourceUsage.from_dict(_item) for _item in obj["cpu_usage"]] if obj.get("cpu_usage") is not None else None,
101
+ "memory_usage": [ResourceUsage.from_dict(_item) for _item in obj["memory_usage"]] if obj.get("memory_usage") is not None else None
102
+ })
103
+ return _obj
104
+
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, StrictFloat, StrictInt
22
+ from typing import Any, ClassVar, Dict, List, Union
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class GetStorageUsageResponse(BaseModel):
27
+ """
28
+ GetStorageUsageResponse
29
+ """ # noqa: E501
30
+ storage_usage: Dict[str, Union[StrictFloat, StrictInt]]
31
+ __properties: ClassVar[List[str]] = ["storage_usage"]
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 GetStorageUsageResponse 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 GetStorageUsageResponse 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
+ "storage_usage": obj.get("storage_usage")
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/). Some useful links: - [GraphScope Repository](https://github.com/alibaba/GraphScope) - [The Source API definition for GraphScope Interactive](https://github.com/GraphScope/portal/tree/main/httpservice)
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.9.1
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,42 +18,41 @@ import pprint
18
18
  import re # noqa: F401
19
19
  import json
20
20
 
21
- from pydantic import BaseModel, StrictBool, StrictStr, field_validator
21
+ from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr, field_validator
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
- from graphscope.flex.rest.models.procedure_params_inner import ProcedureParamsInner
23
+ from graphscope.flex.rest.models.parameter import Parameter
24
24
  from typing import Optional, Set
25
25
  from typing_extensions import Self
26
26
 
27
- class Procedure(BaseModel):
27
+ class GetStoredProcResponse(BaseModel):
28
28
  """
29
- Procedure
29
+ GetStoredProcResponse
30
30
  """ # noqa: E501
31
- name: Optional[StrictStr] = None
32
- bound_graph: Optional[StrictStr] = None
31
+ name: StrictStr
33
32
  description: Optional[StrictStr] = None
34
- type: Optional[StrictStr] = None
35
- query: Optional[StrictStr] = None
36
- enable: Optional[StrictBool] = None
37
- runnable: Optional[StrictBool] = None
38
- params: Optional[List[ProcedureParamsInner]] = None
39
- returns: Optional[List[ProcedureParamsInner]] = None
40
- __properties: ClassVar[List[str]] = ["name", "bound_graph", "description", "type", "query", "enable", "runnable", "params", "returns"]
33
+ type: StrictStr
34
+ query: StrictStr
35
+ id: StrictStr
36
+ library: StrictStr
37
+ params: List[Parameter]
38
+ returns: List[Parameter]
39
+ option: Optional[Dict[str, Any]] = None
40
+ bound_graph: StrictStr
41
+ runnable: StrictBool
42
+ __properties: ClassVar[List[str]] = ["name", "description", "type", "query", "id", "library", "params", "returns", "option", "bound_graph", "runnable"]
41
43
 
42
44
  @field_validator('type')
43
45
  def type_validate_enum(cls, value):
44
46
  """Validates the enum"""
45
- if value is None:
46
- return value
47
-
48
47
  if value not in set(['cpp', 'cypher']):
49
48
  raise ValueError("must be one of enum values ('cpp', 'cypher')")
50
49
  return value
51
50
 
52
- model_config = {
53
- "populate_by_name": True,
54
- "validate_assignment": True,
55
- "protected_namespaces": (),
56
- }
51
+ model_config = ConfigDict(
52
+ populate_by_name=True,
53
+ validate_assignment=True,
54
+ protected_namespaces=(),
55
+ )
57
56
 
58
57
 
59
58
  def to_str(self) -> str:
@@ -67,7 +66,7 @@ class Procedure(BaseModel):
67
66
 
68
67
  @classmethod
69
68
  def from_json(cls, json_str: str) -> Optional[Self]:
70
- """Create an instance of Procedure from a JSON string"""
69
+ """Create an instance of GetStoredProcResponse from a JSON string"""
71
70
  return cls.from_dict(json.loads(json_str))
72
71
 
73
72
  def to_dict(self) -> Dict[str, Any]:
@@ -91,22 +90,22 @@ class Procedure(BaseModel):
91
90
  # override the default output from pydantic by calling `to_dict()` of each item in params (list)
92
91
  _items = []
93
92
  if self.params:
94
- for _item in self.params:
95
- if _item:
96
- _items.append(_item.to_dict())
93
+ for _item_params in self.params:
94
+ if _item_params:
95
+ _items.append(_item_params.to_dict())
97
96
  _dict['params'] = _items
98
97
  # override the default output from pydantic by calling `to_dict()` of each item in returns (list)
99
98
  _items = []
100
99
  if self.returns:
101
- for _item in self.returns:
102
- if _item:
103
- _items.append(_item.to_dict())
100
+ for _item_returns in self.returns:
101
+ if _item_returns:
102
+ _items.append(_item_returns.to_dict())
104
103
  _dict['returns'] = _items
105
104
  return _dict
106
105
 
107
106
  @classmethod
108
107
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
109
- """Create an instance of Procedure from a dict"""
108
+ """Create an instance of GetStoredProcResponse from a dict"""
110
109
  if obj is None:
111
110
  return None
112
111
 
@@ -115,14 +114,16 @@ class Procedure(BaseModel):
115
114
 
116
115
  _obj = cls.model_validate({
117
116
  "name": obj.get("name"),
118
- "bound_graph": obj.get("bound_graph"),
119
117
  "description": obj.get("description"),
120
118
  "type": obj.get("type"),
121
119
  "query": obj.get("query"),
122
- "enable": obj.get("enable"),
123
- "runnable": obj.get("runnable"),
124
- "params": [ProcedureParamsInner.from_dict(_item) for _item in obj["params"]] if obj.get("params") is not None else None,
125
- "returns": [ProcedureParamsInner.from_dict(_item) for _item in obj["returns"]] if obj.get("returns") is not None else None
120
+ "id": obj.get("id"),
121
+ "library": obj.get("library"),
122
+ "params": [Parameter.from_dict(_item) for _item in obj["params"]] if obj.get("params") is not None else None,
123
+ "returns": [Parameter.from_dict(_item) for _item in obj["returns"]] if obj.get("returns") is not None else None,
124
+ "option": obj.get("option"),
125
+ "bound_graph": obj.get("bound_graph"),
126
+ "runnable": obj.get("runnable")
126
127
  })
127
128
  return _obj
128
129