gsctl 0.29.0a20250114__py2.py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- graphscope/flex/rest/__init__.py +106 -0
- graphscope/flex/rest/api/__init__.py +12 -0
- graphscope/flex/rest/api/alert_api.py +2790 -0
- graphscope/flex/rest/api/data_source_api.py +1177 -0
- graphscope/flex/rest/api/deployment_api.py +1323 -0
- graphscope/flex/rest/api/graph_api.py +2813 -0
- graphscope/flex/rest/api/job_api.py +1408 -0
- graphscope/flex/rest/api/service_api.py +1316 -0
- graphscope/flex/rest/api/stored_procedure_api.py +1454 -0
- graphscope/flex/rest/api/utils_api.py +310 -0
- graphscope/flex/rest/api_client.py +789 -0
- graphscope/flex/rest/api_response.py +21 -0
- graphscope/flex/rest/configuration.py +451 -0
- graphscope/flex/rest/exceptions.py +200 -0
- graphscope/flex/rest/models/__init__.py +82 -0
- graphscope/flex/rest/models/base_edge_type.py +102 -0
- graphscope/flex/rest/models/base_edge_type_vertex_type_pair_relations_inner.py +108 -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 +105 -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/dataloading_mr_job_config.py +88 -0
- graphscope/flex/rest/models/date_type.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 +139 -0
- graphscope/flex/rest/models/get_graph_schema_response.py +106 -0
- graphscope/flex/rest/models/get_pod_log_response.py +88 -0
- graphscope/flex/rest/models/get_property_meta.py +107 -0
- 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/get_stored_proc_response.py +130 -0
- graphscope/flex/rest/models/get_vertex_type.py +110 -0
- graphscope/flex/rest/models/gs_data_type.py +152 -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 +96 -0
- graphscope/flex/rest/models/pod_status.py +108 -0
- graphscope/flex/rest/models/primitive_type.py +95 -0
- graphscope/flex/rest/models/resource_usage.py +92 -0
- graphscope/flex/rest/models/running_deployment_info.py +128 -0
- graphscope/flex/rest/models/running_deployment_status.py +124 -0
- graphscope/flex/rest/models/schema_mapping.py +106 -0
- graphscope/flex/rest/models/service_status.py +112 -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 +126 -0
- 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 +100 -0
- graphscope/flex/rest/py.typed +0 -0
- graphscope/flex/rest/rest.py +258 -0
- graphscope/gsctl/V6D_VERSION +1 -0
- graphscope/gsctl/VERSION +1 -0
- graphscope/gsctl/__init__.py +22 -0
- graphscope/gsctl/commands/__init__.py +148 -0
- graphscope/gsctl/commands/common.py +200 -0
- graphscope/gsctl/commands/dev.py +448 -0
- graphscope/gsctl/commands/insight/__init__.py +17 -0
- graphscope/gsctl/commands/insight/glob.py +234 -0
- graphscope/gsctl/commands/insight/graph.py +205 -0
- graphscope/gsctl/commands/interactive/__init__.py +17 -0
- graphscope/gsctl/commands/interactive/glob.py +280 -0
- graphscope/gsctl/commands/interactive/graph.py +259 -0
- graphscope/gsctl/config.py +221 -0
- graphscope/gsctl/gsctl.py +51 -0
- graphscope/gsctl/impl/__init__.py +64 -0
- graphscope/gsctl/impl/alert.py +135 -0
- graphscope/gsctl/impl/common.py +53 -0
- graphscope/gsctl/impl/datasource.py +80 -0
- graphscope/gsctl/impl/deployment.py +62 -0
- graphscope/gsctl/impl/graph.py +150 -0
- graphscope/gsctl/impl/job.py +63 -0
- graphscope/gsctl/impl/service.py +62 -0
- graphscope/gsctl/impl/stored_procedure.py +92 -0
- graphscope/gsctl/impl/utils.py +38 -0
- graphscope/gsctl/scripts/install_deps.sh +969 -0
- graphscope/gsctl/tests/__init__.py +17 -0
- graphscope/gsctl/tests/test_graphscope_insight.py +401 -0
- graphscope/gsctl/tests/test_interactive.py +516 -0
- graphscope/gsctl/utils.py +337 -0
- graphscope/gsctl/version.py +31 -0
- gsctl-0.29.0a20250114.dist-info/METADATA +20 -0
- gsctl-0.29.0a20250114.dist-info/RECORD +117 -0
- gsctl-0.29.0a20250114.dist-info/WHEEL +6 -0
- gsctl-0.29.0a20250114.dist-info/entry_points.txt +3 -0
- gsctl-0.29.0a20250114.dist-info/top_level.txt +1 -0
@@ -0,0 +1,94 @@
|
|
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, Field, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
23
|
+
from graphscope.flex.rest.models.column_mapping_column import ColumnMappingColumn
|
24
|
+
from typing import Optional, Set
|
25
|
+
from typing_extensions import Self
|
26
|
+
|
27
|
+
class ColumnMapping(BaseModel):
|
28
|
+
"""
|
29
|
+
ColumnMapping
|
30
|
+
""" # noqa: E501
|
31
|
+
column: ColumnMappingColumn
|
32
|
+
var_property: StrictStr = Field(description="must align with the schema", alias="property")
|
33
|
+
__properties: ClassVar[List[str]] = ["column", "property"]
|
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 ColumnMapping 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 column
|
75
|
+
if self.column:
|
76
|
+
_dict['column'] = self.column.to_dict()
|
77
|
+
return _dict
|
78
|
+
|
79
|
+
@classmethod
|
80
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
81
|
+
"""Create an instance of ColumnMapping from a dict"""
|
82
|
+
if obj is None:
|
83
|
+
return None
|
84
|
+
|
85
|
+
if not isinstance(obj, dict):
|
86
|
+
return cls.model_validate(obj)
|
87
|
+
|
88
|
+
_obj = cls.model_validate({
|
89
|
+
"column": ColumnMappingColumn.from_dict(obj["column"]) if obj.get("column") is not None else None,
|
90
|
+
"property": obj.get("property")
|
91
|
+
})
|
92
|
+
return _obj
|
93
|
+
|
94
|
+
|
@@ -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/).
|
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, StrictInt, StrictStr
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
25
|
+
|
26
|
+
class ColumnMappingColumn(BaseModel):
|
27
|
+
"""
|
28
|
+
ColumnMappingColumn
|
29
|
+
""" # noqa: E501
|
30
|
+
index: Optional[StrictInt] = None
|
31
|
+
name: Optional[StrictStr] = None
|
32
|
+
__properties: ClassVar[List[str]] = ["index", "name"]
|
33
|
+
|
34
|
+
model_config = ConfigDict(
|
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 ColumnMappingColumn 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 ColumnMappingColumn 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
|
+
"index": obj.get("index"),
|
86
|
+
"name": obj.get("name")
|
87
|
+
})
|
88
|
+
return _obj
|
89
|
+
|
90
|
+
|
@@ -0,0 +1,103 @@
|
|
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, 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 CreateAlertReceiverRequest(BaseModel):
|
27
|
+
"""
|
28
|
+
CreateAlertReceiverRequest
|
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
|
+
__properties: ClassVar[List[str]] = ["type", "webhook_url", "at_user_ids", "is_at_all", "enable"]
|
36
|
+
|
37
|
+
@field_validator('type')
|
38
|
+
def type_validate_enum(cls, value):
|
39
|
+
"""Validates the enum"""
|
40
|
+
if value not in set(['webhook']):
|
41
|
+
raise ValueError("must be one of enum values ('webhook')")
|
42
|
+
return value
|
43
|
+
|
44
|
+
model_config = ConfigDict(
|
45
|
+
populate_by_name=True,
|
46
|
+
validate_assignment=True,
|
47
|
+
protected_namespaces=(),
|
48
|
+
)
|
49
|
+
|
50
|
+
|
51
|
+
def to_str(self) -> str:
|
52
|
+
"""Returns the string representation of the model using alias"""
|
53
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
54
|
+
|
55
|
+
def to_json(self) -> str:
|
56
|
+
"""Returns the JSON representation of the model using alias"""
|
57
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
58
|
+
return json.dumps(self.to_dict())
|
59
|
+
|
60
|
+
@classmethod
|
61
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
62
|
+
"""Create an instance of CreateAlertReceiverRequest from a JSON string"""
|
63
|
+
return cls.from_dict(json.loads(json_str))
|
64
|
+
|
65
|
+
def to_dict(self) -> Dict[str, Any]:
|
66
|
+
"""Return the dictionary representation of the model using alias.
|
67
|
+
|
68
|
+
This has the following differences from calling pydantic's
|
69
|
+
`self.model_dump(by_alias=True)`:
|
70
|
+
|
71
|
+
* `None` is only added to the output dict for nullable fields that
|
72
|
+
were set at model initialization. Other fields with value `None`
|
73
|
+
are ignored.
|
74
|
+
"""
|
75
|
+
excluded_fields: Set[str] = set([
|
76
|
+
])
|
77
|
+
|
78
|
+
_dict = self.model_dump(
|
79
|
+
by_alias=True,
|
80
|
+
exclude=excluded_fields,
|
81
|
+
exclude_none=True,
|
82
|
+
)
|
83
|
+
return _dict
|
84
|
+
|
85
|
+
@classmethod
|
86
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
87
|
+
"""Create an instance of CreateAlertReceiverRequest from a dict"""
|
88
|
+
if obj is None:
|
89
|
+
return None
|
90
|
+
|
91
|
+
if not isinstance(obj, dict):
|
92
|
+
return cls.model_validate(obj)
|
93
|
+
|
94
|
+
_obj = cls.model_validate({
|
95
|
+
"type": obj.get("type"),
|
96
|
+
"webhook_url": obj.get("webhook_url"),
|
97
|
+
"at_user_ids": obj.get("at_user_ids"),
|
98
|
+
"is_at_all": obj.get("is_at_all"),
|
99
|
+
"enable": obj.get("enable")
|
100
|
+
})
|
101
|
+
return _obj
|
102
|
+
|
103
|
+
|
@@ -0,0 +1,112 @@
|
|
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, 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 CreateAlertRuleRequest(BaseModel):
|
27
|
+
"""
|
28
|
+
CreateAlertRuleRequest
|
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
|
+
__properties: ClassVar[List[str]] = ["name", "severity", "metric_type", "conditions_description", "frequency", "enable"]
|
37
|
+
|
38
|
+
@field_validator('severity')
|
39
|
+
def severity_validate_enum(cls, value):
|
40
|
+
"""Validates the enum"""
|
41
|
+
if value not in set(['warning', 'emergency']):
|
42
|
+
raise ValueError("must be one of enum values ('warning', 'emergency')")
|
43
|
+
return value
|
44
|
+
|
45
|
+
@field_validator('metric_type')
|
46
|
+
def metric_type_validate_enum(cls, value):
|
47
|
+
"""Validates the enum"""
|
48
|
+
if value not in set(['node', 'service']):
|
49
|
+
raise ValueError("must be one of enum values ('node', 'service')")
|
50
|
+
return value
|
51
|
+
|
52
|
+
model_config = ConfigDict(
|
53
|
+
populate_by_name=True,
|
54
|
+
validate_assignment=True,
|
55
|
+
protected_namespaces=(),
|
56
|
+
)
|
57
|
+
|
58
|
+
|
59
|
+
def to_str(self) -> str:
|
60
|
+
"""Returns the string representation of the model using alias"""
|
61
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
62
|
+
|
63
|
+
def to_json(self) -> str:
|
64
|
+
"""Returns the JSON representation of the model using alias"""
|
65
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
66
|
+
return json.dumps(self.to_dict())
|
67
|
+
|
68
|
+
@classmethod
|
69
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
70
|
+
"""Create an instance of CreateAlertRuleRequest from a JSON string"""
|
71
|
+
return cls.from_dict(json.loads(json_str))
|
72
|
+
|
73
|
+
def to_dict(self) -> Dict[str, Any]:
|
74
|
+
"""Return the dictionary representation of the model using alias.
|
75
|
+
|
76
|
+
This has the following differences from calling pydantic's
|
77
|
+
`self.model_dump(by_alias=True)`:
|
78
|
+
|
79
|
+
* `None` is only added to the output dict for nullable fields that
|
80
|
+
were set at model initialization. Other fields with value `None`
|
81
|
+
are ignored.
|
82
|
+
"""
|
83
|
+
excluded_fields: Set[str] = set([
|
84
|
+
])
|
85
|
+
|
86
|
+
_dict = self.model_dump(
|
87
|
+
by_alias=True,
|
88
|
+
exclude=excluded_fields,
|
89
|
+
exclude_none=True,
|
90
|
+
)
|
91
|
+
return _dict
|
92
|
+
|
93
|
+
@classmethod
|
94
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
95
|
+
"""Create an instance of CreateAlertRuleRequest from a dict"""
|
96
|
+
if obj is None:
|
97
|
+
return None
|
98
|
+
|
99
|
+
if not isinstance(obj, dict):
|
100
|
+
return cls.model_validate(obj)
|
101
|
+
|
102
|
+
_obj = cls.model_validate({
|
103
|
+
"name": obj.get("name"),
|
104
|
+
"severity": obj.get("severity"),
|
105
|
+
"metric_type": obj.get("metric_type"),
|
106
|
+
"conditions_description": obj.get("conditions_description"),
|
107
|
+
"frequency": obj.get("frequency"),
|
108
|
+
"enable": obj.get("enable")
|
109
|
+
})
|
110
|
+
return _obj
|
111
|
+
|
112
|
+
|
@@ -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
|
+
|