graphscope-flex 0.27.0__5-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 +97 -0
- graphscope/flex/rest/api/__init__.py +12 -0
- graphscope/flex/rest/api/alert_api.py +2780 -0
- graphscope/flex/rest/api/data_source_api.py +1173 -0
- graphscope/flex/rest/api/deployment_api.py +528 -0
- graphscope/flex/rest/api/graph_api.py +2803 -0
- graphscope/flex/rest/api/job_api.py +1356 -0
- graphscope/flex/rest/api/service_api.py +1311 -0
- graphscope/flex/rest/api/stored_procedure_api.py +1449 -0
- graphscope/flex/rest/api/utils_api.py +309 -0
- graphscope/flex/rest/api_client.py +759 -0
- graphscope/flex/rest/api_response.py +21 -0
- graphscope/flex/rest/configuration.py +437 -0
- graphscope/flex/rest/exceptions.py +200 -0
- graphscope/flex/rest/models/__init__.py +73 -0
- graphscope/flex/rest/models/base_edge_type.py +102 -0
- graphscope/flex/rest/models/base_edge_type_vertex_type_pair_relations_inner.py +105 -0
- graphscope/flex/rest/models/base_edge_type_vertex_type_pair_relations_inner_x_csr_params.py +98 -0
- graphscope/flex/rest/models/base_property_meta.py +105 -0
- graphscope/flex/rest/models/base_vertex_type.py +96 -0
- graphscope/flex/rest/models/base_vertex_type_x_csr_params.py +88 -0
- graphscope/flex/rest/models/column_mapping.py +94 -0
- graphscope/flex/rest/models/column_mapping_column.py +90 -0
- graphscope/flex/rest/models/create_alert_receiver_request.py +103 -0
- graphscope/flex/rest/models/create_alert_rule_request.py +112 -0
- 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/create_graph_request.py +106 -0
- graphscope/flex/rest/models/create_graph_response.py +88 -0
- graphscope/flex/rest/models/create_graph_schema_request.py +106 -0
- graphscope/flex/rest/models/create_property_meta.py +100 -0
- graphscope/flex/rest/models/create_stored_proc_request.py +101 -0
- 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/dataloading_job_config.py +136 -0
- graphscope/flex/rest/models/dataloading_job_config_edges_inner.py +92 -0
- graphscope/flex/rest/models/dataloading_job_config_loading_config.py +104 -0
- graphscope/flex/rest/models/dataloading_job_config_loading_config_format.py +90 -0
- graphscope/flex/rest/models/dataloading_job_config_vertices_inner.py +88 -0
- graphscope/flex/rest/models/edge_mapping.py +122 -0
- graphscope/flex/rest/models/edge_mapping_type_triplet.py +92 -0
- graphscope/flex/rest/models/error.py +90 -0
- graphscope/flex/rest/models/get_alert_message_response.py +123 -0
- graphscope/flex/rest/models/get_alert_receiver_response.py +107 -0
- graphscope/flex/rest/models/get_alert_rule_response.py +114 -0
- graphscope/flex/rest/models/get_edge_type.py +116 -0
- graphscope/flex/rest/models/get_graph_response.py +126 -0
- graphscope/flex/rest/models/get_graph_schema_response.py +106 -0
- graphscope/flex/rest/models/get_property_meta.py +102 -0
- graphscope/flex/rest/models/get_stored_proc_response.py +128 -0
- graphscope/flex/rest/models/get_vertex_type.py +110 -0
- graphscope/flex/rest/models/gs_data_type.py +138 -0
- graphscope/flex/rest/models/job_status.py +107 -0
- graphscope/flex/rest/models/long_text.py +93 -0
- graphscope/flex/rest/models/node_status.py +94 -0
- graphscope/flex/rest/models/parameter.py +94 -0
- graphscope/flex/rest/models/primitive_type.py +95 -0
- graphscope/flex/rest/models/running_deployment_info.py +128 -0
- graphscope/flex/rest/models/running_deployment_status.py +105 -0
- graphscope/flex/rest/models/running_deployment_status_nodes_inner.py +124 -0
- graphscope/flex/rest/models/schema_mapping.py +106 -0
- graphscope/flex/rest/models/service_status.py +105 -0
- graphscope/flex/rest/models/service_status_sdk_endpoints.py +94 -0
- graphscope/flex/rest/models/start_service_request.py +88 -0
- graphscope/flex/rest/models/stored_procedure_meta.py +124 -0
- graphscope/flex/rest/models/string_type.py +92 -0
- graphscope/flex/rest/models/string_type_string.py +124 -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 +100 -0
- graphscope/flex/rest/py.typed +0 -0
- graphscope/flex/rest/rest.py +256 -0
- graphscope_flex-0.27.0.dist-info/METADATA +17 -0
- graphscope_flex-0.27.0.dist-info/RECORD +77 -0
- graphscope_flex-0.27.0.dist-info/WHEEL +6 -0
- graphscope_flex-0.27.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,122 @@
|
|
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/). 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)
|
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, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
+
from graphscope.flex.rest.models.column_mapping import ColumnMapping
|
24
|
+
from graphscope.flex.rest.models.edge_mapping_type_triplet import EdgeMappingTypeTriplet
|
25
|
+
from typing import Optional, Set
|
26
|
+
from typing_extensions import Self
|
27
|
+
|
28
|
+
class EdgeMapping(BaseModel):
|
29
|
+
"""
|
30
|
+
EdgeMapping
|
31
|
+
""" # noqa: E501
|
32
|
+
type_triplet: EdgeMappingTypeTriplet
|
33
|
+
inputs: List[StrictStr]
|
34
|
+
source_vertex_mappings: List[ColumnMapping]
|
35
|
+
destination_vertex_mappings: List[ColumnMapping]
|
36
|
+
column_mappings: Optional[List[ColumnMapping]] = None
|
37
|
+
__properties: ClassVar[List[str]] = ["type_triplet", "inputs", "source_vertex_mappings", "destination_vertex_mappings", "column_mappings"]
|
38
|
+
|
39
|
+
model_config = {
|
40
|
+
"populate_by_name": True,
|
41
|
+
"validate_assignment": True,
|
42
|
+
"protected_namespaces": (),
|
43
|
+
}
|
44
|
+
|
45
|
+
|
46
|
+
def to_str(self) -> str:
|
47
|
+
"""Returns the string representation of the model using alias"""
|
48
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
49
|
+
|
50
|
+
def to_json(self) -> str:
|
51
|
+
"""Returns the JSON representation of the model using alias"""
|
52
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
53
|
+
return json.dumps(self.to_dict())
|
54
|
+
|
55
|
+
@classmethod
|
56
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
57
|
+
"""Create an instance of EdgeMapping from a JSON string"""
|
58
|
+
return cls.from_dict(json.loads(json_str))
|
59
|
+
|
60
|
+
def to_dict(self) -> Dict[str, Any]:
|
61
|
+
"""Return the dictionary representation of the model using alias.
|
62
|
+
|
63
|
+
This has the following differences from calling pydantic's
|
64
|
+
`self.model_dump(by_alias=True)`:
|
65
|
+
|
66
|
+
* `None` is only added to the output dict for nullable fields that
|
67
|
+
were set at model initialization. Other fields with value `None`
|
68
|
+
are ignored.
|
69
|
+
"""
|
70
|
+
excluded_fields: Set[str] = set([
|
71
|
+
])
|
72
|
+
|
73
|
+
_dict = self.model_dump(
|
74
|
+
by_alias=True,
|
75
|
+
exclude=excluded_fields,
|
76
|
+
exclude_none=True,
|
77
|
+
)
|
78
|
+
# override the default output from pydantic by calling `to_dict()` of type_triplet
|
79
|
+
if self.type_triplet:
|
80
|
+
_dict['type_triplet'] = self.type_triplet.to_dict()
|
81
|
+
# override the default output from pydantic by calling `to_dict()` of each item in source_vertex_mappings (list)
|
82
|
+
_items = []
|
83
|
+
if self.source_vertex_mappings:
|
84
|
+
for _item in self.source_vertex_mappings:
|
85
|
+
if _item:
|
86
|
+
_items.append(_item.to_dict())
|
87
|
+
_dict['source_vertex_mappings'] = _items
|
88
|
+
# override the default output from pydantic by calling `to_dict()` of each item in destination_vertex_mappings (list)
|
89
|
+
_items = []
|
90
|
+
if self.destination_vertex_mappings:
|
91
|
+
for _item in self.destination_vertex_mappings:
|
92
|
+
if _item:
|
93
|
+
_items.append(_item.to_dict())
|
94
|
+
_dict['destination_vertex_mappings'] = _items
|
95
|
+
# override the default output from pydantic by calling `to_dict()` of each item in column_mappings (list)
|
96
|
+
_items = []
|
97
|
+
if self.column_mappings:
|
98
|
+
for _item in self.column_mappings:
|
99
|
+
if _item:
|
100
|
+
_items.append(_item.to_dict())
|
101
|
+
_dict['column_mappings'] = _items
|
102
|
+
return _dict
|
103
|
+
|
104
|
+
@classmethod
|
105
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
106
|
+
"""Create an instance of EdgeMapping from a dict"""
|
107
|
+
if obj is None:
|
108
|
+
return None
|
109
|
+
|
110
|
+
if not isinstance(obj, dict):
|
111
|
+
return cls.model_validate(obj)
|
112
|
+
|
113
|
+
_obj = cls.model_validate({
|
114
|
+
"type_triplet": EdgeMappingTypeTriplet.from_dict(obj["type_triplet"]) if obj.get("type_triplet") is not None else None,
|
115
|
+
"inputs": obj.get("inputs"),
|
116
|
+
"source_vertex_mappings": [ColumnMapping.from_dict(_item) for _item in obj["source_vertex_mappings"]] if obj.get("source_vertex_mappings") is not None else None,
|
117
|
+
"destination_vertex_mappings": [ColumnMapping.from_dict(_item) for _item in obj["destination_vertex_mappings"]] if obj.get("destination_vertex_mappings") is not None else None,
|
118
|
+
"column_mappings": [ColumnMapping.from_dict(_item) for _item in obj["column_mappings"]] if obj.get("column_mappings") is not None else None
|
119
|
+
})
|
120
|
+
return _obj
|
121
|
+
|
122
|
+
|
@@ -0,0 +1,92 @@
|
|
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/). 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)
|
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, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
25
|
+
|
26
|
+
class EdgeMappingTypeTriplet(BaseModel):
|
27
|
+
"""
|
28
|
+
source label -> [edge label] -> destination label
|
29
|
+
""" # noqa: E501
|
30
|
+
edge: StrictStr
|
31
|
+
source_vertex: StrictStr
|
32
|
+
destination_vertex: StrictStr
|
33
|
+
__properties: ClassVar[List[str]] = ["edge", "source_vertex", "destination_vertex"]
|
34
|
+
|
35
|
+
model_config = {
|
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 EdgeMappingTypeTriplet 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
|
+
return _dict
|
75
|
+
|
76
|
+
@classmethod
|
77
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
78
|
+
"""Create an instance of EdgeMappingTypeTriplet from a dict"""
|
79
|
+
if obj is None:
|
80
|
+
return None
|
81
|
+
|
82
|
+
if not isinstance(obj, dict):
|
83
|
+
return cls.model_validate(obj)
|
84
|
+
|
85
|
+
_obj = cls.model_validate({
|
86
|
+
"edge": obj.get("edge"),
|
87
|
+
"source_vertex": obj.get("source_vertex"),
|
88
|
+
"destination_vertex": obj.get("destination_vertex")
|
89
|
+
})
|
90
|
+
return _obj
|
91
|
+
|
92
|
+
|
@@ -0,0 +1,90 @@
|
|
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/). 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)
|
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, Field, StrictInt, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
25
|
+
|
26
|
+
class Error(BaseModel):
|
27
|
+
"""
|
28
|
+
Error
|
29
|
+
""" # noqa: E501
|
30
|
+
code: StrictInt = Field(description="Error code")
|
31
|
+
message: StrictStr = Field(description="Error message")
|
32
|
+
__properties: ClassVar[List[str]] = ["code", "message"]
|
33
|
+
|
34
|
+
model_config = {
|
35
|
+
"populate_by_name": True,
|
36
|
+
"validate_assignment": True,
|
37
|
+
"protected_namespaces": (),
|
38
|
+
}
|
39
|
+
|
40
|
+
|
41
|
+
def to_str(self) -> str:
|
42
|
+
"""Returns the string representation of the model using alias"""
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
44
|
+
|
45
|
+
def to_json(self) -> str:
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
48
|
+
return json.dumps(self.to_dict())
|
49
|
+
|
50
|
+
@classmethod
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
52
|
+
"""Create an instance of Error from a JSON string"""
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
54
|
+
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
57
|
+
|
58
|
+
This has the following differences from calling pydantic's
|
59
|
+
`self.model_dump(by_alias=True)`:
|
60
|
+
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
62
|
+
were set at model initialization. Other fields with value `None`
|
63
|
+
are ignored.
|
64
|
+
"""
|
65
|
+
excluded_fields: Set[str] = set([
|
66
|
+
])
|
67
|
+
|
68
|
+
_dict = self.model_dump(
|
69
|
+
by_alias=True,
|
70
|
+
exclude=excluded_fields,
|
71
|
+
exclude_none=True,
|
72
|
+
)
|
73
|
+
return _dict
|
74
|
+
|
75
|
+
@classmethod
|
76
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
77
|
+
"""Create an instance of Error from a dict"""
|
78
|
+
if obj is None:
|
79
|
+
return None
|
80
|
+
|
81
|
+
if not isinstance(obj, dict):
|
82
|
+
return cls.model_validate(obj)
|
83
|
+
|
84
|
+
_obj = cls.model_validate({
|
85
|
+
"code": obj.get("code"),
|
86
|
+
"message": obj.get("message")
|
87
|
+
})
|
88
|
+
return _obj
|
89
|
+
|
90
|
+
|
@@ -0,0 +1,123 @@
|
|
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/). 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)
|
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, Field, StrictStr, field_validator
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
25
|
+
|
26
|
+
class GetAlertMessageResponse(BaseModel):
|
27
|
+
"""
|
28
|
+
GetAlertMessageResponse
|
29
|
+
""" # noqa: E501
|
30
|
+
id: StrictStr = Field(description="Generated in server side")
|
31
|
+
alert_name: StrictStr
|
32
|
+
severity: StrictStr
|
33
|
+
metric_type: StrictStr
|
34
|
+
target: List[StrictStr]
|
35
|
+
trigger_time: StrictStr
|
36
|
+
status: StrictStr
|
37
|
+
message: StrictStr
|
38
|
+
__properties: ClassVar[List[str]] = ["id", "alert_name", "severity", "metric_type", "target", "trigger_time", "status", "message"]
|
39
|
+
|
40
|
+
@field_validator('severity')
|
41
|
+
def severity_validate_enum(cls, value):
|
42
|
+
"""Validates the enum"""
|
43
|
+
if value not in set(['warning', 'emergency']):
|
44
|
+
raise ValueError("must be one of enum values ('warning', 'emergency')")
|
45
|
+
return value
|
46
|
+
|
47
|
+
@field_validator('metric_type')
|
48
|
+
def metric_type_validate_enum(cls, value):
|
49
|
+
"""Validates the enum"""
|
50
|
+
if value not in set(['node', 'service']):
|
51
|
+
raise ValueError("must be one of enum values ('node', 'service')")
|
52
|
+
return value
|
53
|
+
|
54
|
+
@field_validator('status')
|
55
|
+
def status_validate_enum(cls, value):
|
56
|
+
"""Validates the enum"""
|
57
|
+
if value not in set(['unsolved', 'solved', 'dealing']):
|
58
|
+
raise ValueError("must be one of enum values ('unsolved', 'solved', 'dealing')")
|
59
|
+
return value
|
60
|
+
|
61
|
+
model_config = {
|
62
|
+
"populate_by_name": True,
|
63
|
+
"validate_assignment": True,
|
64
|
+
"protected_namespaces": (),
|
65
|
+
}
|
66
|
+
|
67
|
+
|
68
|
+
def to_str(self) -> str:
|
69
|
+
"""Returns the string representation of the model using alias"""
|
70
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
71
|
+
|
72
|
+
def to_json(self) -> str:
|
73
|
+
"""Returns the JSON representation of the model using alias"""
|
74
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
75
|
+
return json.dumps(self.to_dict())
|
76
|
+
|
77
|
+
@classmethod
|
78
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
79
|
+
"""Create an instance of GetAlertMessageResponse from a JSON string"""
|
80
|
+
return cls.from_dict(json.loads(json_str))
|
81
|
+
|
82
|
+
def to_dict(self) -> Dict[str, Any]:
|
83
|
+
"""Return the dictionary representation of the model using alias.
|
84
|
+
|
85
|
+
This has the following differences from calling pydantic's
|
86
|
+
`self.model_dump(by_alias=True)`:
|
87
|
+
|
88
|
+
* `None` is only added to the output dict for nullable fields that
|
89
|
+
were set at model initialization. Other fields with value `None`
|
90
|
+
are ignored.
|
91
|
+
"""
|
92
|
+
excluded_fields: Set[str] = set([
|
93
|
+
])
|
94
|
+
|
95
|
+
_dict = self.model_dump(
|
96
|
+
by_alias=True,
|
97
|
+
exclude=excluded_fields,
|
98
|
+
exclude_none=True,
|
99
|
+
)
|
100
|
+
return _dict
|
101
|
+
|
102
|
+
@classmethod
|
103
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
104
|
+
"""Create an instance of GetAlertMessageResponse from a dict"""
|
105
|
+
if obj is None:
|
106
|
+
return None
|
107
|
+
|
108
|
+
if not isinstance(obj, dict):
|
109
|
+
return cls.model_validate(obj)
|
110
|
+
|
111
|
+
_obj = cls.model_validate({
|
112
|
+
"id": obj.get("id"),
|
113
|
+
"alert_name": obj.get("alert_name"),
|
114
|
+
"severity": obj.get("severity"),
|
115
|
+
"metric_type": obj.get("metric_type"),
|
116
|
+
"target": obj.get("target"),
|
117
|
+
"trigger_time": obj.get("trigger_time"),
|
118
|
+
"status": obj.get("status"),
|
119
|
+
"message": obj.get("message")
|
120
|
+
})
|
121
|
+
return _obj
|
122
|
+
|
123
|
+
|
@@ -0,0 +1,107 @@
|
|
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/). 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)
|
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, Field, StrictBool, StrictStr, field_validator
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
25
|
+
|
26
|
+
class GetAlertReceiverResponse(BaseModel):
|
27
|
+
"""
|
28
|
+
GetAlertReceiverResponse
|
29
|
+
""" # noqa: E501
|
30
|
+
type: StrictStr
|
31
|
+
webhook_url: StrictStr
|
32
|
+
at_user_ids: List[StrictStr]
|
33
|
+
is_at_all: StrictBool
|
34
|
+
enable: StrictBool
|
35
|
+
id: StrictStr
|
36
|
+
message: StrictStr = Field(description="Error message generated in server side")
|
37
|
+
__properties: ClassVar[List[str]] = ["type", "webhook_url", "at_user_ids", "is_at_all", "enable", "id", "message"]
|
38
|
+
|
39
|
+
@field_validator('type')
|
40
|
+
def type_validate_enum(cls, value):
|
41
|
+
"""Validates the enum"""
|
42
|
+
if value not in set(['webhook']):
|
43
|
+
raise ValueError("must be one of enum values ('webhook')")
|
44
|
+
return value
|
45
|
+
|
46
|
+
model_config = {
|
47
|
+
"populate_by_name": True,
|
48
|
+
"validate_assignment": True,
|
49
|
+
"protected_namespaces": (),
|
50
|
+
}
|
51
|
+
|
52
|
+
|
53
|
+
def to_str(self) -> str:
|
54
|
+
"""Returns the string representation of the model using alias"""
|
55
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
56
|
+
|
57
|
+
def to_json(self) -> str:
|
58
|
+
"""Returns the JSON representation of the model using alias"""
|
59
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
60
|
+
return json.dumps(self.to_dict())
|
61
|
+
|
62
|
+
@classmethod
|
63
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
64
|
+
"""Create an instance of GetAlertReceiverResponse from a JSON string"""
|
65
|
+
return cls.from_dict(json.loads(json_str))
|
66
|
+
|
67
|
+
def to_dict(self) -> Dict[str, Any]:
|
68
|
+
"""Return the dictionary representation of the model using alias.
|
69
|
+
|
70
|
+
This has the following differences from calling pydantic's
|
71
|
+
`self.model_dump(by_alias=True)`:
|
72
|
+
|
73
|
+
* `None` is only added to the output dict for nullable fields that
|
74
|
+
were set at model initialization. Other fields with value `None`
|
75
|
+
are ignored.
|
76
|
+
"""
|
77
|
+
excluded_fields: Set[str] = set([
|
78
|
+
])
|
79
|
+
|
80
|
+
_dict = self.model_dump(
|
81
|
+
by_alias=True,
|
82
|
+
exclude=excluded_fields,
|
83
|
+
exclude_none=True,
|
84
|
+
)
|
85
|
+
return _dict
|
86
|
+
|
87
|
+
@classmethod
|
88
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
89
|
+
"""Create an instance of GetAlertReceiverResponse from a dict"""
|
90
|
+
if obj is None:
|
91
|
+
return None
|
92
|
+
|
93
|
+
if not isinstance(obj, dict):
|
94
|
+
return cls.model_validate(obj)
|
95
|
+
|
96
|
+
_obj = cls.model_validate({
|
97
|
+
"type": obj.get("type"),
|
98
|
+
"webhook_url": obj.get("webhook_url"),
|
99
|
+
"at_user_ids": obj.get("at_user_ids"),
|
100
|
+
"is_at_all": obj.get("is_at_all"),
|
101
|
+
"enable": obj.get("enable"),
|
102
|
+
"id": obj.get("id"),
|
103
|
+
"message": obj.get("message")
|
104
|
+
})
|
105
|
+
return _obj
|
106
|
+
|
107
|
+
|
@@ -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/). 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)
|
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, Field, StrictBool, StrictInt, StrictStr, field_validator
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
25
|
+
|
26
|
+
class GetAlertRuleResponse(BaseModel):
|
27
|
+
"""
|
28
|
+
GetAlertRuleResponse
|
29
|
+
""" # noqa: E501
|
30
|
+
name: StrictStr
|
31
|
+
severity: StrictStr
|
32
|
+
metric_type: StrictStr
|
33
|
+
conditions_description: StrictStr
|
34
|
+
frequency: StrictInt = Field(description="(mins)")
|
35
|
+
enable: StrictBool
|
36
|
+
id: StrictStr
|
37
|
+
__properties: ClassVar[List[str]] = ["name", "severity", "metric_type", "conditions_description", "frequency", "enable", "id"]
|
38
|
+
|
39
|
+
@field_validator('severity')
|
40
|
+
def severity_validate_enum(cls, value):
|
41
|
+
"""Validates the enum"""
|
42
|
+
if value not in set(['warning', 'emergency']):
|
43
|
+
raise ValueError("must be one of enum values ('warning', 'emergency')")
|
44
|
+
return value
|
45
|
+
|
46
|
+
@field_validator('metric_type')
|
47
|
+
def metric_type_validate_enum(cls, value):
|
48
|
+
"""Validates the enum"""
|
49
|
+
if value not in set(['node', 'service']):
|
50
|
+
raise ValueError("must be one of enum values ('node', 'service')")
|
51
|
+
return value
|
52
|
+
|
53
|
+
model_config = {
|
54
|
+
"populate_by_name": True,
|
55
|
+
"validate_assignment": True,
|
56
|
+
"protected_namespaces": (),
|
57
|
+
}
|
58
|
+
|
59
|
+
|
60
|
+
def to_str(self) -> str:
|
61
|
+
"""Returns the string representation of the model using alias"""
|
62
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
63
|
+
|
64
|
+
def to_json(self) -> str:
|
65
|
+
"""Returns the JSON representation of the model using alias"""
|
66
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
67
|
+
return json.dumps(self.to_dict())
|
68
|
+
|
69
|
+
@classmethod
|
70
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
71
|
+
"""Create an instance of GetAlertRuleResponse from a JSON string"""
|
72
|
+
return cls.from_dict(json.loads(json_str))
|
73
|
+
|
74
|
+
def to_dict(self) -> Dict[str, Any]:
|
75
|
+
"""Return the dictionary representation of the model using alias.
|
76
|
+
|
77
|
+
This has the following differences from calling pydantic's
|
78
|
+
`self.model_dump(by_alias=True)`:
|
79
|
+
|
80
|
+
* `None` is only added to the output dict for nullable fields that
|
81
|
+
were set at model initialization. Other fields with value `None`
|
82
|
+
are ignored.
|
83
|
+
"""
|
84
|
+
excluded_fields: Set[str] = set([
|
85
|
+
])
|
86
|
+
|
87
|
+
_dict = self.model_dump(
|
88
|
+
by_alias=True,
|
89
|
+
exclude=excluded_fields,
|
90
|
+
exclude_none=True,
|
91
|
+
)
|
92
|
+
return _dict
|
93
|
+
|
94
|
+
@classmethod
|
95
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
96
|
+
"""Create an instance of GetAlertRuleResponse from a dict"""
|
97
|
+
if obj is None:
|
98
|
+
return None
|
99
|
+
|
100
|
+
if not isinstance(obj, dict):
|
101
|
+
return cls.model_validate(obj)
|
102
|
+
|
103
|
+
_obj = cls.model_validate({
|
104
|
+
"name": obj.get("name"),
|
105
|
+
"severity": obj.get("severity"),
|
106
|
+
"metric_type": obj.get("metric_type"),
|
107
|
+
"conditions_description": obj.get("conditions_description"),
|
108
|
+
"frequency": obj.get("frequency"),
|
109
|
+
"enable": obj.get("enable"),
|
110
|
+
"id": obj.get("id")
|
111
|
+
})
|
112
|
+
return _obj
|
113
|
+
|
114
|
+
|