From bb751e1c52b2b2379a61368287724aa18e0f588c Mon Sep 17 00:00:00 2001 From: Dongze Li Date: Thu, 16 May 2024 14:10:44 +0800 Subject: [PATCH 01/15] FLEX: Reorganize the Coordinator and gsctl to adapt to the unified schema --- flex/coordinator/.openapi-generator/FILES | 83 +- .../controllers/alert_controller.py | 172 +- .../controllers/connection_controller.py | 39 - .../controllers/data_source_controller.py | 79 + .../controllers/datasource_controller.py | 161 - .../controllers/deployment_controller.py | 55 +- .../controllers/graph_controller.py | 144 +- .../controllers/job_controller.py | 61 +- .../controllers/legacy_controller.py | 75 - .../controllers/procedure_controller.py | 106 +- .../controllers/service_controller.py | 22 +- .../controllers/utils_controller.py | 9 +- .../gs_flex_coordinator/core/__init__.py | 4 + .../core/client_wrapper.py | 500 +- .../gs_flex_coordinator/core/config.py | 4 +- .../gs_flex_coordinator/core/datasource.py | 145 + .../gs_flex_coordinator/core/insight/groot.py | 721 +-- .../core/interactive/__init__.py | 6 - .../core/interactive/hqps.py | 303 +- .../core/interactive/hqps_client/__init__.py | 63 - .../interactive/hqps_client/api/__init__.py | 8 - .../interactive/hqps_client/api/graph_api.py | 1075 ---- .../interactive/hqps_client/api/job_api.py | 1082 ---- .../hqps_client/api/procedure_api.py | 1434 ----- .../hqps_client/api/service_api.py | 1045 ---- .../interactive/hqps_client/api_client.py | 732 --- .../interactive/hqps_client/api_response.py | 21 - .../interactive/hqps_client/configuration.py | 435 -- .../interactive/hqps_client/exceptions.py | 201 - .../hqps_client/models/__init__.py | 43 - .../hqps_client/models/column_mapping.py | 96 - .../hqps_client/models/edge_mapping.py | 125 - ...pping_destination_vertex_mappings_inner.py | 93 - ...ge_mapping_source_vertex_mappings_inner.py | 93 - ...ing_source_vertex_mappings_inner_column.py | 91 - .../models/edge_mapping_type_triplet.py | 93 - .../hqps_client/models/edge_type.py | 111 - ...e_type_vertex_type_pair_relations_inner.py | 109 - ..._type_pair_relations_inner_x_csr_params.py | 99 - .../interactive/hqps_client/models/graph.py | 114 - .../models/graph_stored_procedures.py | 99 - .../hqps_client/models/job_response.py | 88 - .../hqps_client/models/job_status.py | 111 - .../hqps_client/models/model_property.py | 97 - .../hqps_client/models/model_schema.py | 107 - .../hqps_client/models/procedure.py | 130 - .../models/procedure_params_inner.py | 91 - .../models/property_property_type.py | 99 - .../hqps_client/models/schema_mapping.py | 115 - .../models/schema_mapping_loading_config.py | 111 - ...hema_mapping_loading_config_data_source.py | 99 - .../schema_mapping_loading_config_format.py | 91 - .../interactive/hqps_client/models/service.py | 89 - .../hqps_client/models/service_status.py | 95 - .../hqps_client/models/vertex_mapping.py | 101 - .../hqps_client/models/vertex_type.py | 103 - .../core/interactive/hqps_client/py.typed | 0 .../core/interactive/hqps_client/rest.py | 268 - .../gs_flex_coordinator/models/__init__.py | 83 +- .../models/alert_receiver.py | 227 - .../models/base_edge_type.py | 145 + ...e_type_vertex_type_pair_relations_inner.py | 151 + ...type_pair_relations_inner_x_csr_params.py} | 20 +- .../models/base_property_meta.py | 171 + .../models/base_vertex_type.py | 119 + .../models/base_vertex_type_x_csr_params.py | 61 + .../models/column_mapping.py | 20 +- ...ner_column.py => column_mapping_column.py} | 30 +- .../gs_flex_coordinator/models/connection.py | 61 - .../models/connection_status.py | 99 - .../models/create_alert_receiver_request.py | 179 + ...t_rule.py => create_alert_rule_request.py} | 78 +- ....py => create_dataloading_job_response.py} | 22 +- .../models/create_edge_type.py | 201 + .../models/create_graph_request.py | 147 + .../models/create_graph_response.py | 63 + .../models/create_graph_schema_request.py | 95 + .../models/create_procedure_request.py | 149 + .../models/create_procedure_response.py | 63 + .../models/create_property_meta.py | 171 + .../models/create_vertex_type.py | 175 + .../gs_flex_coordinator/models/data_source.py | 91 - .../models/dataloading_job_config.py | 185 + ... => dataloading_job_config_edges_inner.py} | 40 +- .../dataloading_job_config_loading_config.py | 95 + ...ading_job_config_loading_config_format.py} | 30 +- .../dataloading_job_config_vertices_inner.py | 61 + .../models/deployment_info.py | 205 - .../deployment_info_graphs_info_value.py | 139 - .../models/deployment_status.py | 325 -- .../models/edge_data_source.py | 249 - .../models/edge_mapping.py | 36 +- ...pping_destination_vertex_mappings_inner.py | 63 - ...ge_mapping_source_vertex_mappings_inner.py | 63 - .../models/edge_mapping_type_triplet.py | 6 + .../gs_flex_coordinator/models/edge_type.py | 143 - ...e_type_vertex_type_pair_relations_inner.py | 147 - .../gs_flex_coordinator/models/error.py | 95 + ...ssage.py => get_alert_message_response.py} | 122 +- .../models/get_alert_receiver_response.py | 237 + .../models/get_alert_rule_response.py | 241 + .../models/get_edge_type.py | 229 + .../models/get_graph_response.py | 291 + .../models/get_graph_schema_response.py | 95 + .../models/get_procedure_response.py | 319 ++ .../models/get_property_meta.py | 199 + .../models/get_vertex_type.py | 203 + .../gs_flex_coordinator/models/graph.py | 149 - .../models/graph_stored_procedures.py | 67 - .../models/groot_dataloading_job_config.py | 149 - .../models/groot_edge_type.py | 117 - .../models/groot_edge_type_relations_inner.py | 87 - .../gs_flex_coordinator/models/groot_graph.py | 201 - .../models/groot_graph_gremlin_interface.py | 139 - .../models/groot_property.py | 145 - .../models/groot_schema.py | 91 - .../models/groot_vertex_type.py | 89 - .../models/gs_data_type.py | 101 + .../gs_flex_coordinator/models/job_status.py | 40 +- .../gs_flex_coordinator/models/long_text.py | 63 + .../models/model_property.py | 115 - .../models/model_schema.py | 91 - .../gs_flex_coordinator/models/node_status.py | 139 - .../gs_flex_coordinator/models/parameter.py | 93 + ...rty_property_type.py => primitive_type.py} | 22 +- .../gs_flex_coordinator/models/procedure.py | 277 - .../models/procedure_params_inner.py | 87 - .../models/query_statement.py | 141 - .../models/running_deployment_info.py | 183 + .../models/schema_mapping.py | 60 +- .../models/schema_mapping_loading_config.py | 123 - ...hema_mapping_loading_config_data_source.py | 67 - .../models/service_status.py | 44 +- .../models/start_service_request.py | 34 +- .../models/stored_procedure_meta.py | 263 + .../gs_flex_coordinator/models/string_type.py | 65 + .../models/string_type_string.py | 65 + .../update_alert_message_status_request.py | 95 + .../models/update_alert_messages_request.py | 125 - .../models/update_procedure_request.py | 63 + .../models/upload_file_response.py | 63 + .../models/vertex_data_source.py | 145 - .../models/vertex_mapping.py | 6 + .../gs_flex_coordinator/models/vertex_type.py | 141 - .../gs_flex_coordinator/openapi/openapi.yaml | 4909 +++++++++-------- .../test/test_alert_controller.py | 123 +- .../test/test_connection_controller.py | 49 - .../test/test_data_source_controller.py | 82 + .../test/test_datasource_controller.py | 154 - .../test/test_deployment_controller.py | 19 +- .../test/test_extension_controller.py | 82 - .../test/test_graph_controller.py | 86 +- .../test/test_job_controller.py | 48 +- .../test/test_legacy_controller.py | 64 - .../test/test_procedure_controller.py | 40 +- .../test/test_service_controller.py | 3 +- .../test/test_utils_controller.py | 12 +- flex/coordinator/setup.py | 48 - flex/openapi/openapi_coordinator.yaml | 3950 +++++++------ python/graphscope/flex/rest/__init__.py | 89 +- python/graphscope/flex/rest/api/__init__.py | 4 +- python/graphscope/flex/rest/api/alert_api.py | 1003 ++-- .../flex/rest/api/connection_api.py | 550 -- .../api/{legacy_api.py => data_source_api.py} | 395 +- .../flex/rest/api/datasource_api.py | 2308 -------- .../flex/rest/api/deployment_api.py | 817 +-- python/graphscope/flex/rest/api/graph_api.py | 1014 +++- python/graphscope/flex/rest/api/job_api.py | 373 +- .../graphscope/flex/rest/api/procedure_api.py | 694 +-- .../graphscope/flex/rest/api/service_api.py | 17 +- python/graphscope/flex/rest/api/utils_api.py | 16 +- python/graphscope/flex/rest/api_client.py | 2 +- python/graphscope/flex/rest/configuration.py | 4 +- python/graphscope/flex/rest/exceptions.py | 2 +- .../graphscope/flex/rest/models/__init__.py | 85 +- .../{vertex_type.py => base_edge_type.py} | 34 +- ..._type_vertex_type_pair_relations_inner.py} | 25 +- ...type_pair_relations_inner_x_csr_params.py} | 8 +- ...appings_inner.py => base_property_meta.py} | 39 +- ...oot_vertex_type.py => base_vertex_type.py} | 34 +- ...er.py => base_vertex_type_x_csr_params.py} | 20 +- .../flex/rest/models/column_mapping.py | 12 +- ...ner_column.py => column_mapping_column.py} | 10 +- ...ty.py => create_alert_receiver_request.py} | 39 +- ...t_rule.py => create_alert_rule_request.py} | 30 +- .../models/create_dataloading_job_response.py | 88 + .../{edge_type.py => create_edge_type.py} | 36 +- .../{graph.py => create_graph_request.py} | 50 +- .../flex/rest/models/create_graph_response.py | 88 + ...hema.py => create_graph_schema_request.py} | 42 +- ..._source.py => create_procedure_request.py} | 35 +- .../rest/models/create_procedure_response.py | 88 + ...el_property.py => create_property_meta.py} | 30 +- ...oot_edge_type.py => create_vertex_type.py} | 42 +- .../flex/rest/models/data_source.py | 106 - ...ob_config.py => dataloading_job_config.py} | 46 +- ... => dataloading_job_config_edges_inner.py} | 10 +- ... dataloading_job_config_loading_config.py} | 24 +- ...ading_job_config_loading_config_format.py} | 10 +- ... dataloading_job_config_vertices_inner.py} | 16 +- .../flex/rest/models/deployment_info.py | 131 - .../deployment_info_graphs_info_value.py | 94 - .../flex/rest/models/deployment_status.py | 108 - .../flex/rest/models/edge_data_source.py | 112 - .../flex/rest/models/edge_mapping.py | 16 +- .../rest/models/edge_mapping_type_triplet.py | 10 +- python/graphscope/flex/rest/models/error.py | 90 + ...ssage.py => get_alert_message_response.py} | 41 +- ...iver.py => get_alert_receiver_response.py} | 33 +- .../rest/models/get_alert_rule_response.py | 114 + .../flex/rest/models/get_edge_type.py | 116 + .../flex/rest/models/get_graph_response.py | 126 + ...schema.py => get_graph_schema_response.py} | 24 +- ...procedure.py => get_procedure_response.py} | 45 +- ...mappings_inner.py => get_property_meta.py} | 36 +- .../flex/rest/models/get_vertex_type.py | 110 + .../models/groot_graph_gremlin_interface.py | 94 - .../flex/rest/models/gs_data_type.py | 138 + .../graphscope/flex/rest/models/job_status.py | 17 +- ...e_type_relations_inner.py => long_text.py} | 23 +- .../flex/rest/models/node_status.py | 94 - .../graphscope/flex/rest/models/parameter.py | 94 + ...rty_property_type.py => primitive_type.py} | 21 +- ...n_status.py => running_deployment_info.py} | 44 +- .../flex/rest/models/schema_mapping.py | 20 +- .../flex/rest/models/service_status.py | 23 +- .../models/service_status_sdk_endpoints.py | 2 +- .../flex/rest/models/start_service_request.py | 8 +- ...root_graph.py => stored_procedure_meta.py} | 68 +- .../flex/rest/models/string_type.py | 92 + .../flex/rest/models/string_type_string.py | 124 + ...=> update_alert_message_status_request.py} | 31 +- .../models/update_alert_messages_request.py | 110 - .../rest/models/update_procedure_request.py | 88 + .../flex/rest/models/upload_file_response.py | 88 + .../flex/rest/models/vertex_data_source.py | 104 - .../flex/rest/models/vertex_mapping.py | 10 +- python/graphscope/flex/rest/rest.py | 2 +- python/graphscope/gsctl/__init__.py | 5 + python/graphscope/gsctl/commands/__init__.py | 5 +- .../gsctl/commands/insight/graph.py | 307 -- .../gsctl/commands/interactive/glob.py | 51 +- .../gsctl/commands/interactive/graph.py | 115 +- python/graphscope/gsctl/impl/__init__.py | 57 +- python/graphscope/gsctl/impl/alert.py | 118 - python/graphscope/gsctl/impl/common.py | 26 +- python/graphscope/gsctl/impl/datasource.py | 53 +- python/graphscope/gsctl/impl/deployment.py | 42 - python/graphscope/gsctl/impl/graph.py | 68 +- python/graphscope/gsctl/impl/job.py | 51 +- python/graphscope/gsctl/impl/legacy.py | 56 - python/graphscope/gsctl/impl/procedure.py | 48 +- python/graphscope/gsctl/impl/service.py | 4 +- python/graphscope/gsctl/impl/utils.py | 25 +- python/graphscope/gsctl/utils.py | 166 +- .../insight => tests/flex}/__init__.py | 0 .../graphscope/tests/flex/test_interactive.py | 351 ++ 257 files changed, 16700 insertions(+), 27483 deletions(-) delete mode 100644 flex/coordinator/gs_flex_coordinator/controllers/connection_controller.py create mode 100644 flex/coordinator/gs_flex_coordinator/controllers/data_source_controller.py delete mode 100644 flex/coordinator/gs_flex_coordinator/controllers/datasource_controller.py delete mode 100644 flex/coordinator/gs_flex_coordinator/controllers/legacy_controller.py create mode 100644 flex/coordinator/gs_flex_coordinator/core/datasource.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/__init__.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/api/__init__.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/api/graph_api.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/api/job_api.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/api/procedure_api.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/api/service_api.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/api_client.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/api_response.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/configuration.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/exceptions.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/__init__.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/column_mapping.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_mapping.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_mapping_destination_vertex_mappings_inner.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_mapping_source_vertex_mappings_inner.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_mapping_source_vertex_mappings_inner_column.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_mapping_type_triplet.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_type.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_type_vertex_type_pair_relations_inner.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_type_vertex_type_pair_relations_inner_x_csr_params.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/graph.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/graph_stored_procedures.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/job_response.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/job_status.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/model_property.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/model_schema.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/procedure.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/procedure_params_inner.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/property_property_type.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/schema_mapping.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/schema_mapping_loading_config.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/schema_mapping_loading_config_data_source.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/schema_mapping_loading_config_format.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/service.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/service_status.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/vertex_mapping.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/vertex_type.py delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/py.typed delete mode 100644 flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/rest.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/alert_receiver.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/base_edge_type.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/base_edge_type_vertex_type_pair_relations_inner.py rename flex/coordinator/gs_flex_coordinator/models/{edge_type_vertex_type_pair_relations_inner_x_csr_params.py => base_edge_type_vertex_type_pair_relations_inner_x_csr_params.py} (64%) create mode 100644 flex/coordinator/gs_flex_coordinator/models/base_property_meta.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/base_vertex_type.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/base_vertex_type_x_csr_params.py rename flex/coordinator/gs_flex_coordinator/models/{edge_mapping_source_vertex_mappings_inner_column.py => column_mapping_column.py} (51%) delete mode 100644 flex/coordinator/gs_flex_coordinator/models/connection.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/connection_status.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/create_alert_receiver_request.py rename flex/coordinator/gs_flex_coordinator/models/{alert_rule.py => create_alert_rule_request.py} (58%) rename flex/coordinator/gs_flex_coordinator/models/{job_response.py => create_dataloading_job_response.py} (55%) create mode 100644 flex/coordinator/gs_flex_coordinator/models/create_edge_type.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/create_graph_request.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/create_graph_response.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/create_graph_schema_request.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/create_procedure_request.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/create_procedure_response.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/create_property_meta.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/create_vertex_type.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/data_source.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/dataloading_job_config.py rename flex/coordinator/gs_flex_coordinator/models/{groot_dataloading_job_config_edges_inner.py => dataloading_job_config_edges_inner.py} (59%) create mode 100644 flex/coordinator/gs_flex_coordinator/models/dataloading_job_config_loading_config.py rename flex/coordinator/gs_flex_coordinator/models/{schema_mapping_loading_config_format.py => dataloading_job_config_loading_config_format.py} (54%) create mode 100644 flex/coordinator/gs_flex_coordinator/models/dataloading_job_config_vertices_inner.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/deployment_info.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/deployment_info_graphs_info_value.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/deployment_status.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/edge_data_source.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/edge_mapping_destination_vertex_mappings_inner.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/edge_mapping_source_vertex_mappings_inner.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/edge_type.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/edge_type_vertex_type_pair_relations_inner.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/error.py rename flex/coordinator/gs_flex_coordinator/models/{alert_message.py => get_alert_message_response.py} (51%) create mode 100644 flex/coordinator/gs_flex_coordinator/models/get_alert_receiver_response.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/get_alert_rule_response.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/get_edge_type.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/get_graph_response.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/get_graph_schema_response.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/get_procedure_response.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/get_property_meta.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/get_vertex_type.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/graph.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/graph_stored_procedures.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/groot_dataloading_job_config.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/groot_edge_type.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/groot_edge_type_relations_inner.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/groot_graph.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/groot_graph_gremlin_interface.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/groot_property.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/groot_schema.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/groot_vertex_type.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/gs_data_type.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/long_text.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/model_property.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/model_schema.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/node_status.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/parameter.py rename flex/coordinator/gs_flex_coordinator/models/{property_property_type.py => primitive_type.py} (63%) delete mode 100644 flex/coordinator/gs_flex_coordinator/models/procedure.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/procedure_params_inner.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/query_statement.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/running_deployment_info.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/schema_mapping_loading_config.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/schema_mapping_loading_config_data_source.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/stored_procedure_meta.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/string_type.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/string_type_string.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/update_alert_message_status_request.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/update_alert_messages_request.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/update_procedure_request.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/upload_file_response.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/vertex_data_source.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/vertex_type.py delete mode 100644 flex/coordinator/gs_flex_coordinator/test/test_connection_controller.py create mode 100644 flex/coordinator/gs_flex_coordinator/test/test_data_source_controller.py delete mode 100644 flex/coordinator/gs_flex_coordinator/test/test_datasource_controller.py delete mode 100644 flex/coordinator/gs_flex_coordinator/test/test_extension_controller.py delete mode 100644 flex/coordinator/gs_flex_coordinator/test/test_legacy_controller.py delete mode 100644 python/graphscope/flex/rest/api/connection_api.py rename python/graphscope/flex/rest/api/{legacy_api.py => data_source_api.py} (80%) delete mode 100644 python/graphscope/flex/rest/api/datasource_api.py rename python/graphscope/flex/rest/models/{vertex_type.py => base_edge_type.py} (70%) rename python/graphscope/flex/rest/models/{edge_type_vertex_type_pair_relations_inner.py => base_edge_type_vertex_type_pair_relations_inner.py} (78%) rename python/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} (90%) rename python/graphscope/flex/rest/models/{edge_mapping_destination_vertex_mappings_inner.py => base_property_meta.py} (65%) rename python/graphscope/flex/rest/models/{groot_vertex_type.py => base_vertex_type.py} (74%) rename python/graphscope/flex/rest/models/{procedure_params_inner.py => base_vertex_type_x_csr_params.py} (82%) rename python/graphscope/flex/rest/models/{edge_mapping_source_vertex_mappings_inner_column.py => column_mapping_column.py} (88%) rename python/graphscope/flex/rest/models/{groot_property.py => create_alert_receiver_request.py} (72%) rename python/graphscope/flex/rest/models/{alert_rule.py => create_alert_rule_request.py} (83%) create mode 100644 python/graphscope/flex/rest/models/create_dataloading_job_response.py rename python/graphscope/flex/rest/models/{edge_type.py => create_edge_type.py} (69%) rename python/graphscope/flex/rest/models/{graph.py => create_graph_request.py} (65%) create mode 100644 python/graphscope/flex/rest/models/create_graph_response.py rename python/graphscope/flex/rest/models/{groot_schema.py => create_graph_schema_request.py} (69%) rename python/graphscope/flex/rest/models/{schema_mapping_loading_config_data_source.py => create_procedure_request.py} (76%) create mode 100644 python/graphscope/flex/rest/models/create_procedure_response.py rename python/graphscope/flex/rest/models/{model_property.py => create_property_meta.py} (73%) rename python/graphscope/flex/rest/models/{groot_edge_type.py => create_vertex_type.py} (69%) delete mode 100644 python/graphscope/flex/rest/models/data_source.py rename python/graphscope/flex/rest/models/{groot_dataloading_job_config.py => dataloading_job_config.py} (60%) rename python/graphscope/flex/rest/models/{groot_dataloading_job_config_edges_inner.py => dataloading_job_config_edges_inner.py} (90%) rename python/graphscope/flex/rest/models/{schema_mapping_loading_config.py => dataloading_job_config_loading_config.py} (72%) rename python/graphscope/flex/rest/models/{schema_mapping_loading_config_format.py => dataloading_job_config_loading_config_format.py} (89%) rename python/graphscope/flex/rest/models/{connection.py => dataloading_job_config_vertices_inner.py} (84%) delete mode 100644 python/graphscope/flex/rest/models/deployment_info.py delete mode 100644 python/graphscope/flex/rest/models/deployment_info_graphs_info_value.py delete mode 100644 python/graphscope/flex/rest/models/deployment_status.py delete mode 100644 python/graphscope/flex/rest/models/edge_data_source.py create mode 100644 python/graphscope/flex/rest/models/error.py rename python/graphscope/flex/rest/models/{alert_message.py => get_alert_message_response.py} (77%) rename python/graphscope/flex/rest/models/{alert_receiver.py => get_alert_receiver_response.py} (76%) create mode 100644 python/graphscope/flex/rest/models/get_alert_rule_response.py create mode 100644 python/graphscope/flex/rest/models/get_edge_type.py create mode 100644 python/graphscope/flex/rest/models/get_graph_response.py rename python/graphscope/flex/rest/models/{model_schema.py => get_graph_schema_response.py} (79%) rename python/graphscope/flex/rest/models/{procedure.py => get_procedure_response.py} (75%) rename python/graphscope/flex/rest/models/{edge_mapping_source_vertex_mappings_inner.py => get_property_meta.py} (67%) create mode 100644 python/graphscope/flex/rest/models/get_vertex_type.py delete mode 100644 python/graphscope/flex/rest/models/groot_graph_gremlin_interface.py create mode 100644 python/graphscope/flex/rest/models/gs_data_type.py rename python/graphscope/flex/rest/models/{groot_edge_type_relations_inner.py => long_text.py} (81%) delete mode 100644 python/graphscope/flex/rest/models/node_status.py create mode 100644 python/graphscope/flex/rest/models/parameter.py rename python/graphscope/flex/rest/models/{property_property_type.py => primitive_type.py} (80%) rename python/graphscope/flex/rest/models/{connection_status.py => running_deployment_info.py} (73%) rename python/graphscope/flex/rest/models/{groot_graph.py => stored_procedure_meta.py} (61%) create mode 100644 python/graphscope/flex/rest/models/string_type.py create mode 100644 python/graphscope/flex/rest/models/string_type_string.py rename python/graphscope/flex/rest/models/{graph_stored_procedures.py => update_alert_message_status_request.py} (76%) delete mode 100644 python/graphscope/flex/rest/models/update_alert_messages_request.py create mode 100644 python/graphscope/flex/rest/models/update_procedure_request.py create mode 100644 python/graphscope/flex/rest/models/upload_file_response.py delete mode 100644 python/graphscope/flex/rest/models/vertex_data_source.py delete mode 100644 python/graphscope/gsctl/commands/insight/graph.py delete mode 100644 python/graphscope/gsctl/impl/alert.py delete mode 100644 python/graphscope/gsctl/impl/deployment.py delete mode 100644 python/graphscope/gsctl/impl/legacy.py rename python/graphscope/{gsctl/commands/insight => tests/flex}/__init__.py (100%) create mode 100644 python/graphscope/tests/flex/test_interactive.py diff --git a/flex/coordinator/.openapi-generator/FILES b/flex/coordinator/.openapi-generator/FILES index 251c46d9122a..4130fa8a5154 100644 --- a/flex/coordinator/.openapi-generator/FILES +++ b/flex/coordinator/.openapi-generator/FILES @@ -8,55 +8,60 @@ gs_flex_coordinator/__init__.py gs_flex_coordinator/__main__.py gs_flex_coordinator/encoder.py gs_flex_coordinator/models/__init__.py -gs_flex_coordinator/models/alert_message.py -gs_flex_coordinator/models/alert_receiver.py -gs_flex_coordinator/models/alert_rule.py +gs_flex_coordinator/models/base_edge_type.py +gs_flex_coordinator/models/base_edge_type_vertex_type_pair_relations_inner.py +gs_flex_coordinator/models/base_edge_type_vertex_type_pair_relations_inner_x_csr_params.py gs_flex_coordinator/models/base_model.py +gs_flex_coordinator/models/base_property_meta.py +gs_flex_coordinator/models/base_vertex_type.py +gs_flex_coordinator/models/base_vertex_type_x_csr_params.py gs_flex_coordinator/models/column_mapping.py -gs_flex_coordinator/models/connection.py -gs_flex_coordinator/models/connection_status.py -gs_flex_coordinator/models/data_source.py -gs_flex_coordinator/models/deployment_info.py -gs_flex_coordinator/models/deployment_info_graphs_info_value.py -gs_flex_coordinator/models/deployment_status.py -gs_flex_coordinator/models/edge_data_source.py +gs_flex_coordinator/models/column_mapping_column.py +gs_flex_coordinator/models/create_alert_receiver_request.py +gs_flex_coordinator/models/create_alert_rule_request.py +gs_flex_coordinator/models/create_dataloading_job_response.py +gs_flex_coordinator/models/create_edge_type.py +gs_flex_coordinator/models/create_graph_request.py +gs_flex_coordinator/models/create_graph_response.py +gs_flex_coordinator/models/create_graph_schema_request.py +gs_flex_coordinator/models/create_procedure_request.py +gs_flex_coordinator/models/create_procedure_response.py +gs_flex_coordinator/models/create_property_meta.py +gs_flex_coordinator/models/create_vertex_type.py +gs_flex_coordinator/models/dataloading_job_config.py +gs_flex_coordinator/models/dataloading_job_config_edges_inner.py +gs_flex_coordinator/models/dataloading_job_config_loading_config.py +gs_flex_coordinator/models/dataloading_job_config_loading_config_format.py +gs_flex_coordinator/models/dataloading_job_config_vertices_inner.py gs_flex_coordinator/models/edge_mapping.py -gs_flex_coordinator/models/edge_mapping_destination_vertex_mappings_inner.py -gs_flex_coordinator/models/edge_mapping_source_vertex_mappings_inner.py -gs_flex_coordinator/models/edge_mapping_source_vertex_mappings_inner_column.py gs_flex_coordinator/models/edge_mapping_type_triplet.py -gs_flex_coordinator/models/edge_type.py -gs_flex_coordinator/models/edge_type_vertex_type_pair_relations_inner.py -gs_flex_coordinator/models/edge_type_vertex_type_pair_relations_inner_x_csr_params.py -gs_flex_coordinator/models/graph.py -gs_flex_coordinator/models/graph_stored_procedures.py -gs_flex_coordinator/models/groot_dataloading_job_config.py -gs_flex_coordinator/models/groot_dataloading_job_config_edges_inner.py -gs_flex_coordinator/models/groot_edge_type.py -gs_flex_coordinator/models/groot_edge_type_relations_inner.py -gs_flex_coordinator/models/groot_graph.py -gs_flex_coordinator/models/groot_graph_gremlin_interface.py -gs_flex_coordinator/models/groot_property.py -gs_flex_coordinator/models/groot_schema.py -gs_flex_coordinator/models/groot_vertex_type.py +gs_flex_coordinator/models/error.py +gs_flex_coordinator/models/get_alert_message_response.py +gs_flex_coordinator/models/get_alert_receiver_response.py +gs_flex_coordinator/models/get_alert_rule_response.py +gs_flex_coordinator/models/get_edge_type.py +gs_flex_coordinator/models/get_graph_response.py +gs_flex_coordinator/models/get_graph_schema_response.py +gs_flex_coordinator/models/get_procedure_response.py +gs_flex_coordinator/models/get_property_meta.py +gs_flex_coordinator/models/get_vertex_type.py +gs_flex_coordinator/models/gs_data_type.py gs_flex_coordinator/models/job_status.py -gs_flex_coordinator/models/model_property.py -gs_flex_coordinator/models/model_schema.py -gs_flex_coordinator/models/node_status.py -gs_flex_coordinator/models/procedure.py -gs_flex_coordinator/models/procedure_params_inner.py -gs_flex_coordinator/models/property_property_type.py +gs_flex_coordinator/models/long_text.py +gs_flex_coordinator/models/parameter.py +gs_flex_coordinator/models/primitive_type.py +gs_flex_coordinator/models/running_deployment_info.py gs_flex_coordinator/models/schema_mapping.py -gs_flex_coordinator/models/schema_mapping_loading_config.py -gs_flex_coordinator/models/schema_mapping_loading_config_data_source.py -gs_flex_coordinator/models/schema_mapping_loading_config_format.py gs_flex_coordinator/models/service_status.py gs_flex_coordinator/models/service_status_sdk_endpoints.py gs_flex_coordinator/models/start_service_request.py -gs_flex_coordinator/models/update_alert_messages_request.py -gs_flex_coordinator/models/vertex_data_source.py +gs_flex_coordinator/models/stored_procedure_meta.py +gs_flex_coordinator/models/string_type.py +gs_flex_coordinator/models/string_type_string.py +gs_flex_coordinator/models/update_alert_message_status_request.py +gs_flex_coordinator/models/update_procedure_request.py +gs_flex_coordinator/models/upload_file_response.py gs_flex_coordinator/models/vertex_mapping.py -gs_flex_coordinator/models/vertex_type.py gs_flex_coordinator/openapi/openapi.yaml gs_flex_coordinator/test/__init__.py gs_flex_coordinator/typing_utils.py diff --git a/flex/coordinator/gs_flex_coordinator/controllers/alert_controller.py b/flex/coordinator/gs_flex_coordinator/controllers/alert_controller.py index e0615872bee5..d20c65bb8ea2 100644 --- a/flex/coordinator/gs_flex_coordinator/controllers/alert_controller.py +++ b/flex/coordinator/gs_flex_coordinator/controllers/alert_controller.py @@ -3,157 +3,159 @@ from typing import Tuple from typing import Union -from gs_flex_coordinator.core.alert import alert_manager -from gs_flex_coordinator.core import handle_api_exception -from gs_flex_coordinator.models.alert_message import AlertMessage # noqa: E501 -from gs_flex_coordinator.models.alert_receiver import AlertReceiver # noqa: E501 -from gs_flex_coordinator.models.alert_rule import AlertRule # noqa: E501 -from gs_flex_coordinator.models.update_alert_messages_request import UpdateAlertMessagesRequest # noqa: E501 +from gs_flex_coordinator.models.create_alert_receiver_request import CreateAlertReceiverRequest # noqa: E501 +from gs_flex_coordinator.models.create_alert_rule_request import CreateAlertRuleRequest # noqa: E501 +from gs_flex_coordinator.models.error import Error # noqa: E501 +from gs_flex_coordinator.models.get_alert_message_response import GetAlertMessageResponse # noqa: E501 +from gs_flex_coordinator.models.get_alert_receiver_response import GetAlertReceiverResponse # noqa: E501 +from gs_flex_coordinator.models.get_alert_rule_response import GetAlertRuleResponse # noqa: E501 +from gs_flex_coordinator.models.update_alert_message_status_request import UpdateAlertMessageStatusRequest # noqa: E501 from gs_flex_coordinator import util -@handle_api_exception() -def delete_alert_rule_by_name(rule_name): # noqa: E501 - """delete_alert_rule +def create_alert_receiver(create_alert_receiver_request): # noqa: E501 + """create_alert_receiver - # noqa: E501 + Create a new alert receiver # noqa: E501 - :param rule_name: - :type rule_name: str + :param create_alert_receiver_request: + :type create_alert_receiver_request: dict | bytes :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] """ - return alert_manager.delete_alert_rule_by_name(rule_name) + if connexion.request.is_json: + create_alert_receiver_request = CreateAlertReceiverRequest.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' -@handle_api_exception() -def delete_receiver_by_id(receiver_id): # noqa: E501 - """delete_receiver_by_id +def delete_alert_message_in_batch(message_ids): # noqa: E501 + """delete_alert_message_in_batch - # noqa: E501 + Delete alert message in batch # noqa: E501 + + :param message_ids: A list of message id separated by comma, e.g. id1,id2,id3 + :type message_ids: str + + :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] + """ + return 'do some magic!' + + +def delete_alert_receiver_by_id(receiver_id): # noqa: E501 + """delete_alert_receiver_by_id + + Delete the alert receiver by ID # noqa: E501 :param receiver_id: :type receiver_id: str :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] """ - return alert_manager.delete_receiver_by_id(receiver_id) + return 'do some magic!' -@handle_api_exception() -def list_alert_messages(alert_type=None, status=None, severity=None, start_time=None, end_time=None): # noqa: E501 - """list_alert_messages +def delete_alert_rule_by_id(rule_id): # noqa: E501 + """delete_alert_rule_by_id # noqa: E501 - :param alert_type: + :param rule_id: + :type rule_id: str + + :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] + """ + return 'do some magic!' + + +def list_alert_messages(alert_type=None, status=None, severity=None, start_time=None, end_time=None, limit=None): # noqa: E501 + """list_alert_messages + + List all alert messages # noqa: E501 + + :param alert_type: :type alert_type: str - :param status: + :param status: :type status: str - :param severity: + :param severity: :type severity: str :param start_time: format with \"2023-02-21-11-56-30\" :type start_time: str :param end_time: format with \"2023-02-21-11-56-30\" :type end_time: str + :param limit: + :type limit: int - :rtype: Union[List[AlertMessage], Tuple[List[AlertMessage], int], Tuple[List[AlertMessage], int, Dict[str, str]] - """ - return alert_manager.list_alert_messages(alert_type, status, severity, start_time, end_time) - - -@handle_api_exception() -def list_alert_rules(): # noqa: E501 - """list_alert_rules - - # noqa: E501 - - - :rtype: Union[List[AlertRule], Tuple[List[AlertRule], int], Tuple[List[AlertRule], int, Dict[str, str]] + :rtype: Union[List[GetAlertMessageResponse], Tuple[List[GetAlertMessageResponse], int], Tuple[List[GetAlertMessageResponse], int, Dict[str, str]] """ - return alert_manager.list_alert_rules() + return 'do some magic!' -@handle_api_exception() -def list_receivers(): # noqa: E501 - """list_receivers +def list_alert_receivers(): # noqa: E501 + """list_alert_receivers - # noqa: E501 + List all alert receivers # noqa: E501 - :rtype: Union[List[AlertReceiver], Tuple[List[AlertReceiver], int], Tuple[List[AlertReceiver], int, Dict[str, str]] + :rtype: Union[List[GetAlertReceiverResponse], Tuple[List[GetAlertReceiverResponse], int], Tuple[List[GetAlertReceiverResponse], int, Dict[str, str]] """ - return alert_manager.list_receivers() + return 'do some magic!' -@handle_api_exception() -def register_receiver(alert_receiver): # noqa: E501 - """register_receiver +def list_alert_rules(): # noqa: E501 + """list_alert_rules - # noqa: E501 + List all alert rules # noqa: E501 - :param alert_receiver: - :type alert_receiver: dict | bytes - :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] + :rtype: Union[List[GetAlertRuleResponse], Tuple[List[GetAlertRuleResponse], int], Tuple[List[GetAlertRuleResponse], int, Dict[str, str]] """ - if connexion.request.is_json: - alert_receiver = AlertReceiver.from_dict(connexion.request.get_json()) # noqa: E501 - return alert_manager.register_receiver(alert_receiver) return 'do some magic!' -@handle_api_exception() -def update_alert_messages(update_alert_messages_request=None): # noqa: E501 - """update_alert_messages +def update_alert_message_in_batch(update_alert_message_status_request=None): # noqa: E501 + """update_alert_message_in_batch - Update alert messages in batch # noqa: E501 + Update the message status in batch # noqa: E501 - :param update_alert_messages_request: - :type update_alert_messages_request: dict | bytes + :param update_alert_message_status_request: + :type update_alert_message_status_request: dict | bytes :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] """ if connexion.request.is_json: - update_alert_messages_request = UpdateAlertMessagesRequest.from_dict(connexion.request.get_json()) # noqa: E501 - return alert_manager.update_alert_messages( - update_alert_messages_request.messages, - update_alert_messages_request.batch_status, - update_alert_messages_request.batch_delete - ) + update_alert_message_status_request = UpdateAlertMessageStatusRequest.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' -@handle_api_exception() -def update_alert_rule_by_name(rule_name, alert_rule=None): # noqa: E501 - """update_alert_rule_by_name +def update_alert_receiver_by_id(receiver_id, create_alert_receiver_request=None): # noqa: E501 + """update_alert_receiver_by_id - # noqa: E501 + Update alert receiver by ID # noqa: E501 - :param rule_name: - :type rule_name: str - :param alert_rule: - :type alert_rule: dict | bytes + :param receiver_id: + :type receiver_id: str + :param create_alert_receiver_request: + :type create_alert_receiver_request: dict | bytes :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] """ if connexion.request.is_json: - alert_rule = AlertRule.from_dict(connexion.request.get_json()) # noqa: E501 - return alert_manager.update_alert_rule_by_name(rule_name, alert_rule) + create_alert_receiver_request = CreateAlertReceiverRequest.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' -@handle_api_exception() -def update_receiver_by_id(receiver_id, alert_receiver=None): # noqa: E501 - """update_receiver_by_id +def update_alert_rule_by_id(rule_id, create_alert_rule_request=None): # noqa: E501 + """update_alert_rule_by_id # noqa: E501 - :param receiver_id: - :type receiver_id: str - :param alert_receiver: - :type alert_receiver: dict | bytes + :param rule_id: + :type rule_id: str + :param create_alert_rule_request: + :type create_alert_rule_request: dict | bytes :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] """ if connexion.request.is_json: - alert_receiver = AlertReceiver.from_dict(connexion.request.get_json()) # noqa: E501 - return alert_manager.update_receiver_by_id(receiver_id, alert_receiver) + create_alert_rule_request = CreateAlertRuleRequest.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' diff --git a/flex/coordinator/gs_flex_coordinator/controllers/connection_controller.py b/flex/coordinator/gs_flex_coordinator/controllers/connection_controller.py deleted file mode 100644 index a97f4bcee7f6..000000000000 --- a/flex/coordinator/gs_flex_coordinator/controllers/connection_controller.py +++ /dev/null @@ -1,39 +0,0 @@ -import connexion -from typing import Dict -from typing import Tuple -from typing import Union - -from gs_flex_coordinator.core.config import SOLUTION -from gs_flex_coordinator.models.connection import Connection # noqa: E501 -from gs_flex_coordinator.models.connection_status import ConnectionStatus # noqa: E501 -from gs_flex_coordinator import util - - -def close(): # noqa: E501 - """close - - Close the connection with coordinator # noqa: E501 - - - :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] - """ - return "Disconnect with coordinator successfully." - - -def connect(connection): # noqa: E501 - """connect - - Connect to coordinator service # noqa: E501 - - :param connection: - :type connection: dict | bytes - - :rtype: Union[ConnectionStatus, Tuple[ConnectionStatus, int], Tuple[ConnectionStatus, int, Dict[str, str]] - """ - if connexion.request.is_json: - connection = Connection.from_dict(connexion.request.get_json()) # noqa: E501 - connection_status = ConnectionStatus.from_dict({ - "status": "CONNECTED", - "solution": SOLUTION - }) - return connection_status diff --git a/flex/coordinator/gs_flex_coordinator/controllers/data_source_controller.py b/flex/coordinator/gs_flex_coordinator/controllers/data_source_controller.py new file mode 100644 index 000000000000..5d485a77455c --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/controllers/data_source_controller.py @@ -0,0 +1,79 @@ +import connexion +from typing import Dict +from typing import Tuple +from typing import Union + +from gs_flex_coordinator.models.error import Error # noqa: E501 +from gs_flex_coordinator.models.schema_mapping import SchemaMapping # noqa: E501 +from gs_flex_coordinator import util + +from gs_flex_coordinator.core import client_wrapper +from gs_flex_coordinator.core import handle_api_exception + + +@handle_api_exception() +def bind_datasource_in_batch(graph_id, schema_mapping): # noqa: E501 + """bind_datasource_in_batch + + Bind data sources in batches # noqa: E501 + + :param graph_id: + :type graph_id: str + :param schema_mapping: + :type schema_mapping: dict | bytes + + :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] + """ + if connexion.request.is_json: + schema_mapping = SchemaMapping.from_dict(connexion.request.get_json()) # noqa: E501 + return client_wrapper.bind_datasource_in_batch(graph_id, schema_mapping) + + +@handle_api_exception() +def get_datasource_by_id(graph_id): # noqa: E501 + """get_datasource_by_id + + List all data sources # noqa: E501 + + :param graph_id: + :type graph_id: str + + :rtype: Union[SchemaMapping, Tuple[SchemaMapping, int], Tuple[SchemaMapping, int, Dict[str, str]] + """ + return client_wrapper.get_datasource_by_id(graph_id) + + +@handle_api_exception() +def unbind_edge_datasource(graph_id, type_name, source_vertex_type, destination_vertex_type): # noqa: E501 + """unbind_edge_datasource + + Unbind datas ource on an edge type # noqa: E501 + + :param graph_id: + :type graph_id: str + :param type_name: + :type type_name: str + :param source_vertex_type: + :type source_vertex_type: str + :param destination_vertex_type: + :type destination_vertex_type: str + + :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] + """ + return client_wrapper.unbind_edge_datasource(graph_id, type_name, source_vertex_type, destination_vertex_type) + + +@handle_api_exception() +def unbind_vertex_datasource(graph_id, type_name): # noqa: E501 + """unbind_vertex_datasource + + Unbind data source on a vertex type # noqa: E501 + + :param graph_id: + :type graph_id: str + :param type_name: + :type type_name: str + + :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] + """ + return client_wrapper.unbind_vertex_datasource(graph_id, type_name) diff --git a/flex/coordinator/gs_flex_coordinator/controllers/datasource_controller.py b/flex/coordinator/gs_flex_coordinator/controllers/datasource_controller.py deleted file mode 100644 index cbf3c24dbd3b..000000000000 --- a/flex/coordinator/gs_flex_coordinator/controllers/datasource_controller.py +++ /dev/null @@ -1,161 +0,0 @@ -import connexion -from typing import Dict -from typing import Tuple -from typing import Union - -from gs_flex_coordinator.core import client_wrapper -from gs_flex_coordinator.core import handle_api_exception -from gs_flex_coordinator.models.data_source import DataSource # noqa: E501 -from gs_flex_coordinator.models.edge_data_source import EdgeDataSource # noqa: E501 -from gs_flex_coordinator.models.vertex_data_source import VertexDataSource # noqa: E501 -from gs_flex_coordinator import util - - -@handle_api_exception() -def bind_edge_datasource(graph_name, edge_data_source): # noqa: E501 - """bind_edge_datasource - - Bind data source on edge type # noqa: E501 - - :param graph_name: - :type graph_name: str - :param edge_data_source: - :type edge_data_source: dict | bytes - - :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] - """ - if connexion.request.is_json: - edge_data_source = EdgeDataSource.from_dict(connexion.request.get_json()) # noqa: E501 - return client_wrapper.bind_edge_datasource(graph_name, edge_data_source) - - -@handle_api_exception() -def bind_vertex_datasource(graph_name, vertex_data_source): # noqa: E501 - """bind_vertex_datasource - - Bind data source on vertex type # noqa: E501 - - :param graph_name: - :type graph_name: str - :param vertex_data_source: - :type vertex_data_source: dict | bytes - - :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] - """ - if connexion.request.is_json: - vertex_data_source = VertexDataSource.from_dict(connexion.request.get_json()) # noqa: E501 - return client_wrapper.bind_vertex_datasource(graph_name, vertex_data_source) - - -@handle_api_exception() -def get_datasource(graph_name): # noqa: E501 - """get_datasource - - List data source on graph # noqa: E501 - - :param graph_name: - :type graph_name: str - - :rtype: Union[DataSource, Tuple[DataSource, int], Tuple[DataSource, int, Dict[str, str]] - """ - return client_wrapper.get_datasource(graph_name) - - -@handle_api_exception() -def get_edge_datasource(graph_name, type_name, source_vertex_type, destination_vertex_type): # noqa: E501 - """get_edge_datasource - - Get edge data source # noqa: E501 - - :param graph_name: - :type graph_name: str - :param type_name: - :type type_name: str - :param source_vertex_type: - :type source_vertex_type: str - :param destination_vertex_type: - :type destination_vertex_type: str - - :rtype: Union[EdgeDataSource, Tuple[EdgeDataSource, int], Tuple[EdgeDataSource, int, Dict[str, str]] - """ - return client_wrapper.get_edge_datasource( - graph_name, - type_name, - source_vertex_type, - destination_vertex_type - ) - - -@handle_api_exception() -def get_vertex_datasource(graph_name, type_name): # noqa: E501 - """get_vertex_datasource - - Get vertex data source # noqa: E501 - - :param graph_name: - :type graph_name: str - :param type_name: - :type type_name: str - - :rtype: Union[VertexDataSource, Tuple[VertexDataSource, int], Tuple[VertexDataSource, int, Dict[str, str]] - """ - return client_wrapper.get_vertex_datasource(graph_name, type_name) - - -@handle_api_exception() -def import_datasource(graph_name, data_source): # noqa: E501 - """import_datasource - - Import data source in batch # noqa: E501 - - :param graph_name: - :type graph_name: str - :param data_source: - :type data_source: dict | bytes - - :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] - """ - if connexion.request.is_json: - data_source = DataSource.from_dict(connexion.request.get_json()) # noqa: E501 - return client_wrapper.import_datasource(graph_name, data_source) - - -@handle_api_exception() -def unbind_edge_datasource(graph_name, type_name, source_vertex_type, destination_vertex_type): # noqa: E501 - """unbind_edge_datasource - - Unbind datasource on an edge type # noqa: E501 - - :param graph_name: - :type graph_name: str - :param type_name: - :type type_name: str - :param source_vertex_type: - :type source_vertex_type: str - :param destination_vertex_type: - :type destination_vertex_type: str - - :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] - """ - return client_wrapper.unbind_edge_datasource( - graph_name, - type_name, - source_vertex_type, - destination_vertex_type - ) - - -@handle_api_exception() -def unbind_vertex_datasource(graph_name, type_name): # noqa: E501 - """unbind_vertex_datasource - - Unbind datasource on a vertex type # noqa: E501 - - :param graph_name: - :type graph_name: str - :param type_name: - :type type_name: str - - :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] - """ - return client_wrapper.unbind_vertex_datasource(graph_name, type_name) diff --git a/flex/coordinator/gs_flex_coordinator/controllers/deployment_controller.py b/flex/coordinator/gs_flex_coordinator/controllers/deployment_controller.py index d1bd87765728..91880161ba09 100644 --- a/flex/coordinator/gs_flex_coordinator/controllers/deployment_controller.py +++ b/flex/coordinator/gs_flex_coordinator/controllers/deployment_controller.py @@ -3,64 +3,21 @@ from typing import Tuple from typing import Union -from gs_flex_coordinator.core import client_wrapper -from gs_flex_coordinator.core import handle_api_exception -from gs_flex_coordinator.models.deployment_info import DeploymentInfo # noqa: E501 -from gs_flex_coordinator.models.node_status import NodeStatus # noqa: E501 +from gs_flex_coordinator.models.error import Error # noqa: E501 +from gs_flex_coordinator.models.running_deployment_info import RunningDeploymentInfo # noqa: E501 from gs_flex_coordinator import util - -@handle_api_exception() -def fetch_log(component, pod_name, container_name, since_seconds): # noqa: E501 - """fetch_log - - # noqa: E501 - - :param component: - :type component: str - :param pod_name: - :type pod_name: str - :param container_name: - :type container_name: str - :param since_seconds: - :type since_seconds: int - - :rtype: Union[List[DeploymentStatus], Tuple[List[DeploymentStatus], int], Tuple[List[DeploymentStatus], int, Dict[str, str]] - """ - return 'do some magic!' +from gs_flex_coordinator.core import client_wrapper +from gs_flex_coordinator.core import handle_api_exception @handle_api_exception() def get_deployment_info(): # noqa: E501 """get_deployment_info - Get deployment's meta info # noqa: E501 + Deployment information # noqa: E501 - :rtype: Union[List[DeploymentInfo], Tuple[List[DeploymentInfo], int], Tuple[List[DeploymentInfo], int, Dict[str, str]] + :rtype: Union[RunningDeploymentInfo, Tuple[RunningDeploymentInfo, int], Tuple[RunningDeploymentInfo, int, Dict[str, str]] """ return client_wrapper.get_deployment_info() - - -@handle_api_exception() -def get_deployment_status(): # noqa: E501 - """get_deployment_status - - Get deployment's status (k8s only) # noqa: E501 - - - :rtype: Union[List[DeploymentStatus], Tuple[List[DeploymentStatus], int], Tuple[List[DeploymentStatus], int, Dict[str, str]] - """ - return client_wrapper.get_deployment_status() - - -@handle_api_exception() -def get_node_status(): # noqa: E501 - """get_node_status - - Get node status (cpu/memory/disk) # noqa: E501 - - - :rtype: Union[List[NodeStatus], Tuple[List[NodeStatus], int], Tuple[List[NodeStatus], int, Dict[str, str]] - """ - return client_wrapper.get_node_status() diff --git a/flex/coordinator/gs_flex_coordinator/controllers/graph_controller.py b/flex/coordinator/gs_flex_coordinator/controllers/graph_controller.py index c484dee2ab8c..4785c64454cd 100644 --- a/flex/coordinator/gs_flex_coordinator/controllers/graph_controller.py +++ b/flex/coordinator/gs_flex_coordinator/controllers/graph_controller.py @@ -3,75 +3,77 @@ from typing import Tuple from typing import Union +from gs_flex_coordinator.models.create_edge_type import CreateEdgeType # noqa: E501 +from gs_flex_coordinator.models.create_graph_request import CreateGraphRequest # noqa: E501 +from gs_flex_coordinator.models.create_graph_response import CreateGraphResponse # noqa: E501 +from gs_flex_coordinator.models.create_graph_schema_request import CreateGraphSchemaRequest # noqa: E501 +from gs_flex_coordinator.models.create_vertex_type import CreateVertexType # noqa: E501 +from gs_flex_coordinator.models.error import Error # noqa: E501 +from gs_flex_coordinator.models.get_graph_response import GetGraphResponse # noqa: E501 +from gs_flex_coordinator.models.get_graph_schema_response import GetGraphSchemaResponse # noqa: E501 +from gs_flex_coordinator import util + from gs_flex_coordinator.core import client_wrapper from gs_flex_coordinator.core import handle_api_exception -from gs_flex_coordinator.models.edge_type import EdgeType # noqa: E501 -from gs_flex_coordinator.models.graph import Graph # noqa: E501 -from gs_flex_coordinator.models.model_schema import ModelSchema # noqa: E501 -from gs_flex_coordinator.models.vertex_type import VertexType # noqa: E501 -from gs_flex_coordinator import util -@handle_api_exception() -def create_edge_type(graph_name, edge_type): # noqa: E501 +def create_edge_type(graph_id, create_edge_type=None): # noqa: E501 """create_edge_type Create a edge type # noqa: E501 - :param graph_name: - :type graph_name: str - :param edge_type: - :type edge_type: dict | bytes + :param graph_id: + :type graph_id: str + :param create_edge_type: + :type create_edge_type: dict | bytes :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] """ if connexion.request.is_json: - edge_type = EdgeType.from_dict(connexion.request.get_json()) # noqa: E501 - return client_wrapper.create_edge_type(graph_name, edge_type) + create_edge_type = CreateEdgeType.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' @handle_api_exception() -def create_graph(graph): # noqa: E501 +def create_graph(create_graph_request): # noqa: E501 """create_graph Create a new graph # noqa: E501 - :param graph: - :type graph: dict | bytes + :param create_graph_request: + :type create_graph_request: dict | bytes - :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] + :rtype: Union[CreateGraphResponse, Tuple[CreateGraphResponse, int], Tuple[CreateGraphResponse, int, Dict[str, str]] """ if connexion.request.is_json: - graph = Graph.from_dict(connexion.request.get_json()) # noqa: E501 - return client_wrapper.create_graph(graph) + create_graph_request = CreateGraphRequest.from_dict(connexion.request.get_json()) # noqa: E501 + return client_wrapper.create_graph(create_graph_request) -@handle_api_exception() -def create_vertex_type(graph_name, vertex_type): # noqa: E501 +def create_vertex_type(graph_id, create_vertex_type): # noqa: E501 """create_vertex_type Create a vertex type # noqa: E501 - :param graph_name: - :type graph_name: str - :param vertex_type: - :type vertex_type: dict | bytes + :param graph_id: + :type graph_id: str + :param create_vertex_type: + :type create_vertex_type: dict | bytes :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] """ if connexion.request.is_json: - vertex_type = VertexType.from_dict(connexion.request.get_json()) # noqa: E501 - return client_wrapper.create_vertex_type(graph_name, vertex_type) + create_vertex_type = CreateVertexType.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' -@handle_api_exception() -def delete_edge_type(graph_name, type_name, source_vertex_type, destination_vertex_type): # noqa: E501 - """delete_edge_type +def delete_edge_type_by_name(graph_id, type_name, source_vertex_type, destination_vertex_type): # noqa: E501 + """delete_edge_type_by_name - Delete a edge type by name # noqa: E501 + Delete edge type by name # noqa: E501 - :param graph_name: - :type graph_name: str + :param graph_id: + :type graph_id: str :param type_name: :type type_name: str :param source_vertex_type: @@ -81,53 +83,81 @@ def delete_edge_type(graph_name, type_name, source_vertex_type, destination_vert :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] """ - return client_wrapper.delete_edge_type( - graph_name, type_name, source_vertex_type, destination_vertex_type - ) + return 'do some magic!' @handle_api_exception() -def delete_graph(graph_name): # noqa: E501 - """delete_graph +def delete_graph_by_id(graph_id): # noqa: E501 + """delete_graph_by_id - Delete a graph by name # noqa: E501 + Delete graph by ID # noqa: E501 - :param graph_name: - :type graph_name: str + :param graph_id: + :type graph_id: str :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] """ - return client_wrapper.delete_graph_by_name(graph_name) + return client_wrapper.delete_graph_by_id(graph_id) -@handle_api_exception() -def delete_vertex_type(graph_name, type_name): # noqa: E501 - """delete_vertex_type +def delete_vertex_type_by_name(graph_id, type_name): # noqa: E501 + """delete_vertex_type_by_name - Delete a vertex type by name # noqa: E501 + Delete vertex type by name # noqa: E501 - :param graph_name: - :type graph_name: str + :param graph_id: + :type graph_id: str :param type_name: :type type_name: str :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] """ - return client_wrapper.delete_vertex_type(graph_name, type_name) + return 'do some magic!' @handle_api_exception() -def get_schema(graph_name): # noqa: E501 - """get_schema +def get_graph_by_id(graph_id): # noqa: E501 + """get_graph_by_id - Get graph schema by name # noqa: E501 + Get graph by ID # noqa: E501 - :param graph_name: - :type graph_name: str + :param graph_id: + :type graph_id: str - :rtype: Union[ModelSchema, Tuple[ModelSchema, int], Tuple[ModelSchema, int, Dict[str, str]] + :rtype: Union[GetGraphResponse, Tuple[GetGraphResponse, int], Tuple[GetGraphResponse, int, Dict[str, str]] """ - return client_wrapper.get_schema_by_name(graph_name) + return client_wrapper.get_graph_by_id(graph_id) + + +@handle_api_exception() +def get_schema_by_id(graph_id): # noqa: E501 + """get_schema_by_id + + Get graph schema by ID # noqa: E501 + + :param graph_id: + :type graph_id: str + + :rtype: Union[GetGraphSchemaResponse, Tuple[GetGraphSchemaResponse, int], Tuple[GetGraphSchemaResponse, int, Dict[str, str]] + """ + return client_wrapper.get_schema_by_id(graph_id) + + +def import_schema_by_id(graph_id, create_graph_schema_request): # noqa: E501 + """import_schema_by_id + + Import graph schema # noqa: E501 + + :param graph_id: + :type graph_id: str + :param create_graph_schema_request: + :type create_graph_schema_request: dict | bytes + + :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] + """ + if connexion.request.is_json: + create_graph_schema_request = CreateGraphSchemaRequest.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' @handle_api_exception() @@ -137,6 +167,6 @@ def list_graphs(): # noqa: E501 List all graphs # noqa: E501 - :rtype: Union[List[Graph], Tuple[List[Graph], int], Tuple[List[Graph], int, Dict[str, str]] + :rtype: Union[List[GetGraphResponse], Tuple[List[GetGraphResponse], int], Tuple[List[GetGraphResponse], int, Dict[str, str]] """ return client_wrapper.list_graphs() diff --git a/flex/coordinator/gs_flex_coordinator/controllers/job_controller.py b/flex/coordinator/gs_flex_coordinator/controllers/job_controller.py index b557d9a865e2..0373efcd34c0 100644 --- a/flex/coordinator/gs_flex_coordinator/controllers/job_controller.py +++ b/flex/coordinator/gs_flex_coordinator/controllers/job_controller.py @@ -3,50 +3,49 @@ from typing import Tuple from typing import Union -from gs_flex_coordinator.core import client_wrapper -from gs_flex_coordinator.core import handle_api_exception +from gs_flex_coordinator.models.create_dataloading_job_response import CreateDataloadingJobResponse # noqa: E501 +from gs_flex_coordinator.models.dataloading_job_config import DataloadingJobConfig # noqa: E501 +from gs_flex_coordinator.models.error import Error # noqa: E501 from gs_flex_coordinator.models.job_status import JobStatus # noqa: E501 -from gs_flex_coordinator.models.schema_mapping import SchemaMapping # noqa: E501 from gs_flex_coordinator import util +from gs_flex_coordinator.core import client_wrapper +from gs_flex_coordinator.core import handle_api_exception + @handle_api_exception() -def create_dataloading_job(graph_name, schema_mapping): # noqa: E501 - """create_dataloading_job +def delete_job_by_id(job_id): # noqa: E501 + """delete_job_by_id - # noqa: E501 + Delete job by ID # noqa: E501 - :param graph_name: - :type graph_name: str - :param schema_mapping: - :type schema_mapping: dict | bytes + :param job_id: + :type job_id: str :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] """ - if connexion.request.is_json: - schema_mapping = SchemaMapping.from_dict(connexion.request.get_json()) # noqa: E501 - return client_wrapper.create_dataloading_job(graph_name, schema_mapping) + return client_wrapper.delete_job_by_id(job_id) @handle_api_exception() -def delete_job_by_id(job_id): # noqa: E501 - """delete_job_by_id +def get_dataloading_job_config(graph_id): # noqa: E501 + """get_dataloading_job_config - # noqa: E501 + Get the data loading configuration # noqa: E501 - :param job_id: - :type job_id: str + :param graph_id: + :type graph_id: str - :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] + :rtype: Union[DataloadingJobConfig, Tuple[DataloadingJobConfig, int], Tuple[DataloadingJobConfig, int, Dict[str, str]] """ - return client_wrapper.delete_job_by_id(job_id) + return client_wrapper.get_dataloading_job_config(graph_id) @handle_api_exception() def get_job_by_id(job_id): # noqa: E501 """get_job_by_id - # noqa: E501 + Get job status by ID # noqa: E501 :param job_id: :type job_id: str @@ -60,7 +59,7 @@ def get_job_by_id(job_id): # noqa: E501 def list_jobs(): # noqa: E501 """list_jobs - # noqa: E501 + List all jobs # noqa: E501 :rtype: Union[List[JobStatus], Tuple[List[JobStatus], int], Tuple[List[JobStatus], int, Dict[str, str]] @@ -69,14 +68,18 @@ def list_jobs(): # noqa: E501 @handle_api_exception() -def get_dataloading_config(graph_name): # noqa: E501 - """get_dataloading_config +def submit_dataloading_job(graph_id, dataloading_job_config): # noqa: E501 + """submit_dataloading_job - get dataloading configuration # noqa: E501 + Submit a dataloading job # noqa: E501 - :param graph_name: - :type graph_name: str + :param graph_id: + :type graph_id: str + :param dataloading_job_config: + :type dataloading_job_config: dict | bytes - :rtype: Union[List[SchemaMapping], Tuple[List[SchemaMapping], int], Tuple[List[SchemaMapping], int, Dict[str, str]] + :rtype: Union[CreateDataloadingJobResponse, Tuple[CreateDataloadingJobResponse, int], Tuple[CreateDataloadingJobResponse, int, Dict[str, str]] """ - return client_wrapper.get_dataloading_config(graph_name) + if connexion.request.is_json: + dataloading_job_config = DataloadingJobConfig.from_dict(connexion.request.get_json()) # noqa: E501 + return client_wrapper.submit_dataloading_job(graph_id, dataloading_job_config) diff --git a/flex/coordinator/gs_flex_coordinator/controllers/legacy_controller.py b/flex/coordinator/gs_flex_coordinator/controllers/legacy_controller.py deleted file mode 100644 index 19ae6181312c..000000000000 --- a/flex/coordinator/gs_flex_coordinator/controllers/legacy_controller.py +++ /dev/null @@ -1,75 +0,0 @@ -import connexion -from typing import Dict -from typing import Tuple -from typing import Union - -from gs_flex_coordinator.core import client_wrapper -from gs_flex_coordinator.core import handle_api_exception -from gs_flex_coordinator.models.groot_dataloading_job_config import GrootDataloadingJobConfig # noqa: E501 -from gs_flex_coordinator.models.groot_graph import GrootGraph # noqa: E501 -from gs_flex_coordinator.models.groot_schema import GrootSchema # noqa: E501 -from gs_flex_coordinator.models.schema_mapping import SchemaMapping # noqa: E501 -from gs_flex_coordinator import util - - -def create_groot_dataloading_job(graph_name, groot_dataloading_job_config): # noqa: E501 - """create_groot_dataloading_job - - # noqa: E501 - - :param graph_name: - :type graph_name: str - :param groot_dataloading_job_config: - :type groot_dataloading_job_config: dict | bytes - - :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] - """ - if connexion.request.is_json: - groot_dataloading_job_config = GrootDataloadingJobConfig.from_dict(connexion.request.get_json()) # noqa: E501 - return client_wrapper.create_groot_dataloading_job( - graph_name, groot_dataloading_job_config - ) - - -@handle_api_exception() -def get_groot_schema(graph_name): # noqa: E501 - """get_groot_schema - - Get graph schema by name # noqa: E501 - - :param graph_name: - :type graph_name: str - - :rtype: Union[GrootSchema, Tuple[GrootSchema, int], Tuple[GrootSchema, int, Dict[str, str]] - """ - return client_wrapper.get_groot_schema(graph_name) - - -@handle_api_exception() -def import_groot_schema(graph_name, groot_schema): # noqa: E501 - """import_schema - - Import schema to groot graph # noqa: E501 - - :param graph_name: - :type graph_name: str - :param groot_schema: - :type groot_schema: dict | bytes - - :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] - """ - if connexion.request.is_json: - groot_schema = GrootSchema.from_dict(connexion.request.get_json()) # noqa: E501 - return client_wrapper.import_groot_schema(graph_name, groot_schema) - - -@handle_api_exception() -def list_groot_graph(): # noqa: E501 - """list_groot_graph - - list groot graph # noqa: E501 - - - :rtype: Union[List[GrootGraph], Tuple[List[GrootGraph], int], Tuple[List[GrootGraph], int, Dict[str, str]] - """ - return client_wrapper.list_groot_graph() diff --git a/flex/coordinator/gs_flex_coordinator/controllers/procedure_controller.py b/flex/coordinator/gs_flex_coordinator/controllers/procedure_controller.py index ce7029a06a93..d9b9e5a259ae 100644 --- a/flex/coordinator/gs_flex_coordinator/controllers/procedure_controller.py +++ b/flex/coordinator/gs_flex_coordinator/controllers/procedure_controller.py @@ -3,102 +3,96 @@ from typing import Tuple from typing import Union +from gs_flex_coordinator.models.create_procedure_request import CreateProcedureRequest # noqa: E501 +from gs_flex_coordinator.models.create_procedure_response import CreateProcedureResponse # noqa: E501 +from gs_flex_coordinator.models.error import Error # noqa: E501 +from gs_flex_coordinator.models.get_procedure_response import GetProcedureResponse # noqa: E501 +from gs_flex_coordinator.models.update_procedure_request import UpdateProcedureRequest # noqa: E501 +from gs_flex_coordinator import util + from gs_flex_coordinator.core import client_wrapper from gs_flex_coordinator.core import handle_api_exception -from gs_flex_coordinator.models.procedure import Procedure # noqa: E501 -from gs_flex_coordinator import util @handle_api_exception() -def create_procedure(graph_name, procedure): # noqa: E501 +def create_procedure(graph_id, create_procedure_request): # noqa: E501 """create_procedure Create a new stored procedure on a certain graph # noqa: E501 - :param graph_name: - :type graph_name: str - :param procedure: - :type procedure: dict | bytes + :param graph_id: + :type graph_id: str + :param create_procedure_request: + :type create_procedure_request: dict | bytes - :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] + :rtype: Union[CreateProcedureResponse, Tuple[CreateProcedureResponse, int], Tuple[CreateProcedureResponse, int, Dict[str, str]] """ if connexion.request.is_json: - procedure = Procedure.from_dict(connexion.request.get_json()) # noqa: E501 - return client_wrapper.create_procedure(graph_name, procedure) + create_procedure_request = CreateProcedureRequest.from_dict(connexion.request.get_json()) # noqa: E501 + return client_wrapper.create_procedure(graph_id, create_procedure_request) @handle_api_exception() -def delete_procedure(graph_name, procedure_name): # noqa: E501 - """delete_procedure +def delete_procedure_by_id(graph_id, procedure_id): # noqa: E501 + """delete_procedure_by_id - Delete a stored procedure on a certain graph # noqa: E501 + Delete a stored procedure by ID # noqa: E501 - :param graph_name: - :type graph_name: str - :param procedure_name: - :type procedure_name: str + :param graph_id: + :type graph_id: str + :param procedure_id: + :type procedure_id: str :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] """ - return client_wrapper.delete_procedure_by_name(graph_name, procedure_name) - - -def get_procedure(graph_name, procedure_name): # noqa: E501 - """get_procedure - - Get a procedure by name # noqa: E501 - - :param graph_name: - :type graph_name: str - :param procedure_name: - :type procedure_name: str - - :rtype: Union[Procedure, Tuple[Procedure, int], Tuple[Procedure, int, Dict[str, str]] - """ - return client_wrapper.get_procedure_by_name(graph_name, procedure_name) + return client_wrapper.delete_procedure_by_id(graph_id, procedure_id) @handle_api_exception() -def list_procedures(): # noqa: E501 - """list_procedures +def get_procedure_by_id(graph_id, procedure_id): # noqa: E501 + """get_procedure_by_id - List all the stored procedures # noqa: E501 + Get a stored procedure by ID # noqa: E501 + :param graph_id: + :type graph_id: str + :param procedure_id: + :type procedure_id: str - :rtype: Union[List[Procedure], Tuple[List[Procedure], int], Tuple[List[Procedure], int, Dict[str, str]] + :rtype: Union[GetProcedureResponse, Tuple[GetProcedureResponse, int], Tuple[GetProcedureResponse, int, Dict[str, str]] """ - return client_wrapper.list_procedures(graph_name=None) + return client_wrapper.get_procedure_by_id(graph_id, procedure_id) @handle_api_exception() -def list_procedures_by_graph(graph_name): # noqa: E501 - """list_procedures_by_graph +def list_procedures(graph_id): # noqa: E501 + """list_procedures - List stored procedures on a certain graph # noqa: E501 + List all stored procedures on a certain graph # noqa: E501 - :param graph_name: - :type graph_name: str + :param graph_id: + :type graph_id: str - :rtype: Union[List[Procedure], Tuple[List[Procedure], int], Tuple[List[Procedure], int, Dict[str, str]] + :rtype: Union[List[GetProcedureResponse], Tuple[List[GetProcedureResponse], int], Tuple[List[GetProcedureResponse], int, Dict[str, str]] """ - return client_wrapper.list_procedures(graph_name=graph_name) + return client_wrapper.list_procedures(graph_id) @handle_api_exception() -def update_procedure(graph_name, procedure_name, procedure=None): # noqa: E501 - """update_procedure +def update_procedure_by_id(graph_id, procedure_id, update_procedure_request=None): # noqa: E501 + """update_procedure_by_id - Update stored procedure on a certain graph # noqa: E501 + Update a stored procedure by ID # noqa: E501 - :param graph_name: - :type graph_name: str - :param procedure_name: - :type procedure_name: str - :param procedure: - :type procedure: dict | bytes + :param graph_id: + :type graph_id: str + :param procedure_id: + :type procedure_id: str + :param update_procedure_request: + :type update_procedure_request: dict | bytes :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] """ if connexion.request.is_json: - procedure = Procedure.from_dict(connexion.request.get_json()) # noqa: E501 - return client_wrapper.update_procedure(graph_name, procedure_name, procedure) + update_procedure_request = UpdateProcedureRequest.from_dict(connexion.request.get_json()) # noqa: E501 + return client_wrapper.update_procedure_by_id(graph_id, procedure_id, update_procedure_request) diff --git a/flex/coordinator/gs_flex_coordinator/controllers/service_controller.py b/flex/coordinator/gs_flex_coordinator/controllers/service_controller.py index 6938682f4401..fe769898162c 100644 --- a/flex/coordinator/gs_flex_coordinator/controllers/service_controller.py +++ b/flex/coordinator/gs_flex_coordinator/controllers/service_controller.py @@ -1,13 +1,15 @@ -from typing import Dict, Tuple, Union - import connexion +from typing import Dict +from typing import Tuple +from typing import Union +from gs_flex_coordinator.models.error import Error # noqa: E501 +from gs_flex_coordinator.models.service_status import ServiceStatus # noqa: E501 +from gs_flex_coordinator.models.start_service_request import StartServiceRequest # noqa: E501 from gs_flex_coordinator import util -from gs_flex_coordinator.core import client_wrapper, handle_api_exception -from gs_flex_coordinator.models.service_status import \ - ServiceStatus # noqa: E501 -from gs_flex_coordinator.models.start_service_request import \ - StartServiceRequest # noqa: E501 + +from gs_flex_coordinator.core import client_wrapper +from gs_flex_coordinator.core import handle_api_exception @handle_api_exception() @@ -40,15 +42,13 @@ def start_service(start_service_request=None): # noqa: E501 Start service # noqa: E501 - :param start_service_request: + :param start_service_request: :type start_service_request: dict | bytes :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] """ if connexion.request.is_json: - start_service_request = StartServiceRequest.from_dict( - connexion.request.get_json() - ) # noqa: E501 + start_service_request = StartServiceRequest.from_dict(connexion.request.get_json()) # noqa: E501 return client_wrapper.start_service(start_service_request) diff --git a/flex/coordinator/gs_flex_coordinator/controllers/utils_controller.py b/flex/coordinator/gs_flex_coordinator/controllers/utils_controller.py index 7e6e8585cebf..21ded4824eff 100644 --- a/flex/coordinator/gs_flex_coordinator/controllers/utils_controller.py +++ b/flex/coordinator/gs_flex_coordinator/controllers/utils_controller.py @@ -3,9 +3,12 @@ from typing import Tuple from typing import Union +from gs_flex_coordinator.models.error import Error # noqa: E501 +from gs_flex_coordinator.models.upload_file_response import UploadFileResponse # noqa: E501 +from gs_flex_coordinator import util + from gs_flex_coordinator.core import client_wrapper from gs_flex_coordinator.core import handle_api_exception -from gs_flex_coordinator import util @handle_api_exception() @@ -14,9 +17,9 @@ def upload_file(filestorage=None): # noqa: E501 # noqa: E501 - :param filestorage: + :param filestorage: :type filestorage: str - :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] + :rtype: Union[UploadFileResponse, Tuple[UploadFileResponse, int], Tuple[UploadFileResponse, int, Dict[str, str]] """ return client_wrapper.upload_file(filestorage) diff --git a/flex/coordinator/gs_flex_coordinator/core/__init__.py b/flex/coordinator/gs_flex_coordinator/core/__init__.py index b86cee8549e1..53b18cdb9c65 100644 --- a/flex/coordinator/gs_flex_coordinator/core/__init__.py +++ b/flex/coordinator/gs_flex_coordinator/core/__init__.py @@ -17,6 +17,10 @@ # import logging +import warnings + +# Disable warnings +warnings.filterwarnings("ignore", category=Warning) logging.basicConfig( format="%(asctime)s [%(levelname)s][%(module)s:%(lineno)d]: %(message)s", diff --git a/flex/coordinator/gs_flex_coordinator/core/client_wrapper.py b/flex/coordinator/gs_flex_coordinator/core/client_wrapper.py index d3a5e6f75b44..9828f917de57 100644 --- a/flex/coordinator/gs_flex_coordinator/core/client_wrapper.py +++ b/flex/coordinator/gs_flex_coordinator/core/client_wrapper.py @@ -16,16 +16,16 @@ # limitations under the License. # -import datetime +# import datetime import itertools import logging import os -import pickle -import socket +# import pickle +# import socket import threading from typing import List, Union -import psutil +# import psutil from gs_flex_coordinator.core.config import ( CLUSTER_TYPE, @@ -37,31 +37,43 @@ ) from gs_flex_coordinator.core.insight import init_groot_client from gs_flex_coordinator.core.interactive import init_hqps_client -from gs_flex_coordinator.core.scheduler import schedule +from gs_flex_coordinator.core.datasource import DataSourceManager +# from gs_flex_coordinator.core.scheduler import schedule from gs_flex_coordinator.core.utils import ( - GraphInfo, - decode_datetimestr, + # GraphInfo, + # decode_datetimestr, encode_datetime, - get_current_time, + # get_current_time, ) from gs_flex_coordinator.models import ( - DataSource, - DeploymentInfo, - EdgeDataSource, - EdgeType, - Graph, - GrootDataloadingJobConfig, - GrootGraph, - GrootSchema, + RunningDeploymentInfo, + CreateGraphRequest, + CreateGraphResponse, + GetGraphSchemaResponse, + CreateProcedureRequest, + UpdateProcedureRequest, + CreateProcedureResponse, + GetProcedureResponse, + UploadFileResponse, + DataloadingJobConfig, + CreateDataloadingJobResponse, + CreateEdgeType, + CreateVertexType, + # EdgeDataSource, + # EdgeType, + GetGraphResponse, + # GrootDataloadingJobConfig, + # GrootGraph, + # GrootSchema, JobStatus, - ModelSchema, - NodeStatus, - Procedure, + # ModelSchema, + # NodeStatus, + # Procedure, SchemaMapping, ServiceStatus, StartServiceRequest, - VertexDataSource, - VertexType, + # VertexDataSource, + # VertexType, ) from gs_flex_coordinator.version import __version__ @@ -74,49 +86,51 @@ def __init__(self): self._lock = threading.RLock() # initialize specific client self._client = self._initialize_client() + # data source management + self._datasource_manager = DataSourceManager() # graphs info - self._graphs_info = {} + # self._graphs_info = {} # pickle path - self._pickle_path = os.path.join(WORKSPACE, "graphs_info.pickle") - # recover - self._try_to_recover_from_disk() - # sync graphs info every 60s - self._sync_graphs_info_job = ( - schedule.every(60) - .seconds.do(self._sync_graphs_info_impl) - .tag("sync", "graphs info") - ) - - def _try_to_recover_from_disk(self): - try: - if os.path.exists(self._pickle_path): - logging.info("Recover graphs info from file %s", self._pickle_path) - with open(self._pickle_path, "rb") as f: - self._graphs_info = pickle.load(f) - except Exception as e: - logging.warn("Failed to recover graphs info: %s", str(e)) - # set default graph info - self._sync_graphs_info_impl() - - def _pickle_graphs_info_impl(self): - try: - with open(self._pickle_path, "wb") as f: - pickle.dump(self._graphs_info, f) - except Exception as e: - logging.warn("Failed to dump graphs info: %s", str(e)) - - def _sync_graphs_info_impl(self): - if SOLUTION == "INTERACTIVE": - graphs = self.list_graphs() - elif SOLUTION == "GRAPHSCOPE_INSIGHT": - graphs = self.list_groot_graph() - rlts = {} - for g in graphs: - if g.name in self._graphs_info: - rlts[g.name] = self._graphs_info[g.name] - else: - rlts[g.name] = GraphInfo(name=g.name, creation_time=CREATION_TIME) - self._graphs_info = rlts + # self._pickle_path = os.path.join(WORKSPACE, "graphs_info.pickle") + # # recover + # self._try_to_recover_from_disk() + # # sync graphs info every 60s + # self._sync_graphs_info_job = ( + # schedule.every(60) + # .seconds.do(self._sync_graphs_info_impl) + # .tag("sync", "graphs info") + # ) + + # def _try_to_recover_from_disk(self): + # try: + # if os.path.exists(self._pickle_path): + # logging.info("Recover graphs info from file %s", self._pickle_path) + # with open(self._pickle_path, "rb") as f: + # self._graphs_info = pickle.load(f) + # except Exception as e: + # logging.warn("Failed to recover graphs info: %s", str(e)) + # # set default graph info + # self._sync_graphs_info_impl() + + # def _pickle_graphs_info_impl(self): + # try: + # with open(self._pickle_path, "wb") as f: + # pickle.dump(self._graphs_info, f) + # except Exception as e: + # logging.warn("Failed to dump graphs info: %s", str(e)) + + # def _sync_graphs_info_impl(self): + # if SOLUTION == "INTERACTIVE": + # graphs = self.list_graphs() + # elif SOLUTION == "GRAPHSCOPE_INSIGHT": + # graphs = self.list_groot_graph() + # rlts = {} + # for g in graphs: + # if g.name in self._graphs_info: + # rlts[g.name] = self._graphs_info[g.name] + # else: + # rlts[g.name] = GraphInfo(name=g.name, creation_time=CREATION_TIME) + # self._graphs_info = rlts def _initialize_client(self): service_initializer = { @@ -128,150 +142,171 @@ def _initialize_client(self): raise RuntimeError(f"Client initializer of {SOLUTION} not found.") return initializer() - def list_graphs(self) -> List[Graph]: + def list_graphs(self) -> List[GetGraphResponse]: graphs = self._client.list_graphs() + # fix ValueError: Invalid value for `long_text`, must not be `None` + for g in graphs: + for item in itertools.chain(g["schema"]["vertex_types"], g["schema"]["edge_types"]): + for p in item["properties"]: + if "string" in p["property_type"] and "long_text" in p["property_type"]["string"]: + p["property_type"]["string"]["long_text"] = "" # transfer - rlts = [Graph.from_dict(g.to_dict()) for g in graphs] + rlts = [GetGraphResponse.from_dict(g) for g in graphs] return rlts - def get_schema_by_name(self, graph_name: str) -> ModelSchema: - schema = self._client.get_schema_by_name(graph_name) - # transfer - rlt = ModelSchema.from_dict(schema.to_dict()) - return rlt + def get_schema_by_id(self, graph_id: str) -> GetGraphSchemaResponse: + schema = self._client.get_schema_by_id(graph_id) + # fix ValueError: Invalid value for `long_text`, must not be `None` + for item in itertools.chain(schema["vertex_types"], schema["edge_types"]): + for p in item["properties"]: + if "string" in p["property_type"] and "long_text" in p["property_type"]["string"]: + p["property_type"]["string"]["long_text"] = "" + return GetGraphSchemaResponse.from_dict(schema) - def get_groot_schema(self, graph_name: str) -> GrootSchema: - return GrootSchema.from_dict(self._client.get_groot_schema(graph_name)) + # def get_groot_schema(self, graph_name: str) -> GrootSchema: + # return GrootSchema.from_dict(self._client.get_groot_schema(graph_name)) - def import_groot_schema(self, graph_name: str, schema: GrootSchema) -> str: - rlt = self._client.import_groot_schema(graph_name, schema.to_dict()) - self._graphs_info[INSTANCE_NAME].update_time = get_current_time() - return rlt + # def import_groot_schema(self, graph_name: str, schema: GrootSchema) -> str: + # rlt = self._client.import_groot_schema(graph_name, schema.to_dict()) + # self._graphs_info[INSTANCE_NAME].update_time = get_current_time() + # return rlt - def get_current_graph(self) -> GrootGraph: - return self._client.get_current_graph() + # def get_current_graph(self) -> GrootGraph: + # return self._client.get_current_graph() - def create_graph(self, graph: Graph) -> str: + def create_graph(self, graph: CreateGraphRequest) -> CreateGraphResponse: # there are some tricks here, since schema is a keyword of openapi # specification, so it will be converted into the _schema field. graph_dict = graph.to_dict() if "_schema" in graph_dict: graph_dict["schema"] = graph_dict.pop("_schema") - rlt = self._client.create_graph(graph_dict) - self._graphs_info[graph.name] = GraphInfo( - name=graph.name, creation_time=get_current_time() - ) - self._pickle_graphs_info_impl() - return rlt - - def create_vertex_type(self, graph_name: str, vtype: VertexType) -> str: - if SOLUTION == "GRAPHSCOPE_INSIGHT": - graph_name = INSTANCE_NAME - vtype_dict = vtype.to_dict() - rlt = self._client.create_vertex_type(graph_name, vtype_dict) - self._graphs_info[graph_name].update_time = get_current_time() - return rlt - - def create_edge_type(self, graph_name: str, etype: EdgeType) -> str: - if SOLUTION == "GRAPHSCOPE_INSIGHT": - graph_name = INSTANCE_NAME - etype_dict = etype.to_dict() - rlt = self._client.create_edge_type(graph_name, etype_dict) - self._graphs_info[graph_name].update_time = get_current_time() - return rlt - - def delete_vertex_type(self, graph_name: str, vertex_type: str) -> str: - if SOLUTION == "GRAPHSCOPE_INSIGHT": - graph_name = INSTANCE_NAME - rlt = self._client.delete_vertex_type(graph_name, vertex_type) - self._graphs_info[graph_name].update_time = get_current_time() - return rlt - - def delete_edge_type( + response = self._client.create_graph(graph_dict) + return CreateGraphResponse.from_dict(response) + + def create_vertex_type(self, graph_id: str, vtype: CreateVertexType) -> str: + self._client.create_vertex_type(graph_id, vtype.to_dict()) + return "Create vertex type successfully" + # if SOLUTION == "GRAPHSCOPE_INSIGHT": + # graph_name = INSTANCE_NAME + # vtype_dict = vtype.to_dict() + # rlt = self._client.create_vertex_type(graph_name, vtype_dict) + # # self._graphs_info[graph_name].update_time = get_current_time() + # return rlt + + def create_edge_type(self, graph_id: str, etype: CreateEdgeType) -> str: + self._client.create_edge_type(graph_id, etype.to_dict()) + return "Create edge type successfully" + # if SOLUTION == "GRAPHSCOPE_INSIGHT": + # graph_name = INSTANCE_NAME + # etype_dict = etype.to_dict() + # rlt = self._client.create_edge_type(graph_name, etype_dict) + # self._graphs_info[graph_name].update_time = get_current_time() + # return rlt + + def delete_vertex_type_by_name(self, graph_id: str, type_name: str) -> str: + self._client.delete_vertex_type_by_name(graph_id, type_name) + # remove data source mapping + self.unbind_vertex_datasource(graph_id, type_name) + return f"Delete vertex type {type_name} successfully" + # if SOLUTION == "GRAPHSCOPE_INSIGHT": + # graph_name = INSTANCE_NAME + # rlt = self._client.delete_vertex_type(graph_name, vertex_type) + # self._graphs_info[graph_name].update_time = get_current_time() + # return rlt + + def delete_edge_type_by_name( self, - graph_name: str, - edge_type: str, + graph_id: str, + type_name: str, source_vertex_type: str, destination_vertex_type: str, ) -> str: - if SOLUTION == "GRAPHSCOPE_INSIGHT": - graph_name = INSTANCE_NAME - rlt = self._client.delete_edge_type( - graph_name, edge_type, source_vertex_type, destination_vertex_type + self._client.delete_edge_type_by_name( + graph_id, type_name, source_vertex_type, destination_vertex_type ) - self._graphs_info[graph_name].update_time = get_current_time() + # remove data source mapping + self.unbind_edge_datasource(graph_id, type_name, source_vertex_type, destination_vertex_type) + return f"Delete edge type ({source_vertex_type})->[{type_name}]->({destination_vertex_type}) successfully" + # if SOLUTION == "GRAPHSCOPE_INSIGHT": + # graph_name = INSTANCE_NAME + # rlt = self._client.delete_edge_type( + # graph_name, edge_type, source_vertex_type, destination_vertex_type + # ) + # self._graphs_info[graph_name].update_time = get_current_time() + # return rlt + + def delete_graph_by_id(self, graph_id: str) -> str: + rlt = self._client.delete_graph_by_id(graph_id) + # remove data source mapping + self._datasource_manager.delete_datasource_by_id(graph_id) return rlt - def delete_graph_by_name(self, graph_name: str) -> str: - rlt = self._client.delete_graph_by_name(graph_name) - if graph_name in self._graphs_info: - del self._graphs_info[graph_name] - self._pickle_graphs_info_impl() - return rlt + def get_graph_by_id(self, graph_id: str) -> GetGraphResponse: + g = self._client.get_graph_by_id(graph_id) + for item in itertools.chain(g["schema"]["vertex_types"], g["schema"]["edge_types"]): + for p in item["properties"]: + if "string" in p["property_type"] and "long_text" in p["property_type"]["string"]: + p["property_type"]["string"]["long_text"] = "" + return GetGraphResponse.from_dict(g) - def create_procedure(self, graph_name: str, procedure: Procedure) -> str: + def create_procedure(self, graph_id: str, procedure: CreateProcedureRequest) -> CreateProcedureResponse: procedure_dict = procedure.to_dict() - return self._client.create_procedure(graph_name, procedure_dict) + response = self._client.create_procedure(graph_id, procedure_dict) + return CreateProcedureResponse.from_dict(response) - def list_procedures(self, graph_name: Union[None, str]) -> List[Procedure]: - procedures = self._client.list_procedures(graph_name) + def list_procedures(self, graph_id: str) -> List[GetProcedureResponse]: + procedures = self._client.list_procedures(graph_id) # transfer - rlt = [Procedure.from_dict(p.to_dict()) for p in procedures] + rlt = [GetProcedureResponse.from_dict(p) for p in procedures] return rlt - def update_procedure( - self, graph_name: str, procedure_name: str, procedure: Procedure + def update_procedure_by_id( + self, graph_id: str, procedure_id: str, procedure: UpdateProcedureRequest ) -> str: procedure_dict = procedure.to_dict() - return self._client.update_procedure(graph_name, procedure_name, procedure_dict) + return self._client.update_procedure_by_id(graph_id, procedure_id, procedure_dict) - def delete_procedure_by_name(self, graph_name: str, procedure_name: str) -> str: - return self._client.delete_procedure_by_name(graph_name, procedure_name) + def delete_procedure_by_id(self, graph_id: str, procedure_id: str) -> str: + return self._client.delete_procedure_by_id(graph_id, procedure_id) - def get_procedure_by_name(self, graph_name: str, procedure_name: str) -> Procedure: - return Procedure.from_dict( - self._client.get_procedure_by_name(graph_name, procedure_name).to_dict() + def get_procedure_by_id(self, graph_id: str, procedure_id: str) -> GetProcedureResponse: + return GetProcedureResponse.from_dict( + self._client.get_procedure_by_id(graph_id, procedure_id) ) - def get_node_status(self) -> List[NodeStatus]: - rlt = [] - if CLUSTER_TYPE == "HOSTS": - disk_info = psutil.disk_usage("/") - status = { - "node": socket.gethostname(), - "cpu_usage": psutil.cpu_percent(), - "memory_usage": psutil.virtual_memory().percent, - "disk_usage": float(f"{disk_info.used / disk_info.total * 100:.2f}"), - } - rlt.append(NodeStatus.from_dict(status)) - return rlt - - def get_deployment_info(self) -> DeploymentInfo: - # update graphs info - for job in self.list_jobs(): - if ( - job.detail["graph_name"] in self._graphs_info - and job.end_time is not None - ): - self._graphs_info[job.detail["graph_name"]].last_dataloading_time = ( - decode_datetimestr(job.end_time) - ) - self._pickle_graphs_info_impl() - graphs_info = {} - for name, info in self._graphs_info.items(): - graphs_info[name] = info.to_dict() + # def get_node_status(self) -> List[NodeStatus]: + # rlt = [] + # if CLUSTER_TYPE == "HOSTS": + # disk_info = psutil.disk_usage("/") + # status = { + # "node": socket.gethostname(), + # "cpu_usage": psutil.cpu_percent(), + # "memory_usage": psutil.virtual_memory().percent, + # "disk_usage": float(f"{disk_info.used / disk_info.total * 100:.2f}"), + # } + # rlt.append(NodeStatus.from_dict(status)) + # return rlt + + def get_deployment_info(self) -> RunningDeploymentInfo: info = { - "name": INSTANCE_NAME, + "instance_name": INSTANCE_NAME, "cluster_type": CLUSTER_TYPE, "version": __version__, "solution": SOLUTION, "creation_time": encode_datetime(CREATION_TIME), - "graphs_info": graphs_info, } - return DeploymentInfo.from_dict(info) + return RunningDeploymentInfo.from_dict(info) def get_service_status(self) -> ServiceStatus: - return ServiceStatus.from_dict(self._client.get_service_status()) + status = self._client.get_service_status() + if "graph" in status: + # fix ValueError: Invalid value for `long_text`, must not be `None` + schema = status["graph"]["schema"] + for item in itertools.chain(schema["vertex_types"], schema["edge_types"]): + for p in item["properties"]: + if "string" in p["property_type"] and "long_text" in p["property_type"]["string"]: + p["property_type"]["string"]["long_text"] = "" + return ServiceStatus.from_dict(status) def stop_service(self) -> str: return self._client.stop_service() @@ -280,25 +315,48 @@ def restart_service(self) -> str: return self._client.restart_service() def start_service(self, request: StartServiceRequest) -> str: - return self._client.start_service(request) + return self._client.start_service(request.graph_id) def list_jobs(self) -> List[JobStatus]: - # transfer - rlt = [] - for job_status_dict in self._client.list_jobs(): - rlt.append(JobStatus.from_dict(job_status_dict)) - return rlt + return [JobStatus.from_dict(s) for s in self._client.list_jobs()] def get_job_by_id(self, job_id: str) -> JobStatus: - job_status_dict = self._client.get_job_by_id(job_id) - return JobStatus.from_dict(job_status_dict) + return JobStatus.from_dict(self._client.get_job_by_id(job_id)) def delete_job_by_id(self, job_id: str) -> str: return self._client.delete_job_by_id(job_id) - def create_dataloading_job( - self, graph_name: str, schema_mapping: SchemaMapping + def submit_dataloading_job( + self, graph_id: str, dataloading_job_config: DataloadingJobConfig ) -> str: + config = dataloading_job_config.to_dict() + job_id = self._client.submit_dataloading_job(graph_id, config, self._datasource_manager) + return CreateDataloadingJobResponse.from_dict({"job_id": job_id}) + + def get_dataloading_job_config(self, graph_id: str) -> DataloadingJobConfig: + return DataloadingJobConfig.from_dict(self._client.get_dataloading_job_config(graph_id)) + + def upload_file(self, filestorage) -> str: + if CLUSTER_TYPE == "HOSTS": + filepath = os.path.join(DATASET_WORKSPACE, filestorage.filename) + filestorage.save(filepath) + return UploadFileResponse.from_dict({"file_path": filepath}) + + # def create_groot_dataloading_job( + # self, graph_name: str, job_config: GrootDataloadingJobConfig + # ) -> str: + # job_id = self._client.create_groot_dataloading_job( + # graph_name, job_config.to_dict() + # ) + # return job_id + + # def list_groot_graph(self) -> List[GrootGraph]: + # graphs = self._client.list_groot_graph() + # # transfer + # rlts = [GrootGraph.from_dict(g) for g in graphs] + # return rlts + + def bind_datasource_in_batch(self, graph_id: str, schema_mapping: SchemaMapping) -> str: # there are some tricks here, since property is a keyword of openapi # specification, so it will be converted into the _property field. schema_mapping_dict = schema_mapping.to_dict() @@ -308,89 +366,33 @@ def create_dataloading_job( for column_mapping in mapping["column_mappings"]: if "_property" in column_mapping: column_mapping["property"] = column_mapping.pop("_property") - job_id = self._client.create_dataloading_job(graph_name, schema_mapping_dict) - return job_id - - def get_dataloading_config(self, graph_name: str) -> SchemaMapping: - config = self._client.get_dataloading_config(graph_name) - if not config: - # construct an empty config - schema_mapping = SchemaMapping() - else: - schema_mapping = SchemaMapping.from_dict(config) - return schema_mapping - - def upload_file(self, filestorage) -> str: - if CLUSTER_TYPE == "HOSTS": - filepath = os.path.join(DATASET_WORKSPACE, filestorage.filename) - filestorage.save(filepath) - return str(filepath) - - def create_groot_dataloading_job( - self, graph_name: str, job_config: GrootDataloadingJobConfig - ) -> str: - job_id = self._client.create_groot_dataloading_job( - graph_name, job_config.to_dict() - ) - return job_id - - def list_groot_graph(self) -> List[GrootGraph]: - graphs = self._client.list_groot_graph() - # transfer - rlts = [GrootGraph.from_dict(g) for g in graphs] - return rlts - - def import_datasource(self, graph_name: str, data_source: DataSource) -> str: - return self._client.import_datasource(graph_name, data_source.to_dict()) - - def get_datasource(self, graph_name: str) -> DataSource: - return DataSource.from_dict(self._client.get_datasource(graph_name)) - - def bind_vertex_datasource( - self, graph_name: str, vertex_data_source: VertexDataSource - ) -> str: - return self._client.bind_vertex_datasource( - graph_name, vertex_data_source.to_dict() - ) - - def bind_edge_datasource( - self, graph_name: str, edge_data_source: EdgeDataSource - ) -> str: - return self._client.bind_edge_datasource(graph_name, edge_data_source.to_dict()) - - def get_vertex_datasource( - self, graph_name: str, vertex_type: str - ) -> VertexDataSource: - return VertexDataSource.from_dict( - self._client.get_vertex_datasource(graph_name, vertex_type) - ) - - def get_edge_datasource( - self, - graph_name: str, - edge_type: str, - source_vertex_type: str, - destination_vertex_type: str, - ) -> EdgeDataSource: - return EdgeDataSource.from_dict( - self._client.get_edge_datasource( - graph_name, edge_type, source_vertex_type, destination_vertex_type - ) + if "source_vertex_mappings" in mapping and "destination_vertex_mappings" in mapping: + for column_mapping in itertools.chain(mapping["source_vertex_mappings"], mapping["destination_vertex_mappings"]): + if "_property" in column_mapping: + column_mapping["property"] = column_mapping.pop("_property") + self._datasource_manager.bind_datasource_in_batch(graph_id, schema_mapping_dict) + return "Bind data source mapping successfully" + + def get_datasource_by_id(self, graph_id: str) -> SchemaMapping: + return SchemaMapping.from_dict( + self._datasource_manager.get_datasource_mapping(graph_id) ) - def unbind_vertex_datasource(self, graph_name: str, vertex_type: str) -> str: - return self._client.unbind_vertex_datasource(graph_name, vertex_type) + def unbind_vertex_datasource(self, graph_id: str, vertex_type: str) -> str: + self._datasource_manager.unbind_vertex_datasource(graph_id, vertex_type) + return "Unbind vertex data source successfully" def unbind_edge_datasource( self, - graph_name: str, + graph_id: str, edge_type: str, source_vertex_type: str, destination_vertex_type: str, ) -> str: - return self._client.unbind_edge_datasource( - graph_name, edge_type, source_vertex_type, destination_vertex_type + self._datasource_manager.unbind_edge_datasource( + graph_id, edge_type, source_vertex_type, destination_vertex_type ) + return "Unbind edge data source successfully" client_wrapper = ClientWrapper() diff --git a/flex/coordinator/gs_flex_coordinator/core/config.py b/flex/coordinator/gs_flex_coordinator/core/config.py index d4a4e2e71339..454d68598a22 100644 --- a/flex/coordinator/gs_flex_coordinator/core/config.py +++ b/flex/coordinator/gs_flex_coordinator/core/config.py @@ -32,7 +32,7 @@ def str_to_bool(s): try: WORKSPACE = os.environ["GRAPHSCOPE_RUNTIME"] except KeyError: - WORKSPACE = os.path.expanduser("~/.graphscope/gs") + WORKSPACE = os.path.expanduser("~/.graphscope/runtime/coordinator") # make sure we have permission to create instance workspace try: os.makedirs(os.path.join(WORKSPACE, ".ignore"), exist_ok=True) @@ -79,7 +79,7 @@ def str_to_bool(s): # kubernetes NAMESPACE = os.environ.get("NAMESPACE", "kubetask") -INSTANCE_NAME = os.environ.get("INSTANCE_NAME", "default-graph") +INSTANCE_NAME = os.environ.get("INSTANCE_NAME", "demo") # groot diff --git a/flex/coordinator/gs_flex_coordinator/core/datasource.py b/flex/coordinator/gs_flex_coordinator/core/datasource.py new file mode 100644 index 000000000000..2869b22199bd --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/core/datasource.py @@ -0,0 +1,145 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Copyright 2024 Alibaba Group Holding Limited. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import logging +import os +import pickle + +from gs_flex_coordinator.core.config import WORKSPACE + + +class DataSourceManager(object): + """Management class for data source mapping""" + + def __init__(self): + # graph id -> mapping + self._datasource_mapping = {} + self._pickle_path = os.path.join(WORKSPACE, "datasource_mapping.pickle") + # recover + self.try_to_recover_from_disk() + + def try_to_recover_from_disk(self): + try: + if os.path.exists(self._pickle_path): + logging.info( + "Recover data source mapping from file %s", self._pickle_path + ) + with open(self._pickle_path, "rb") as f: + self._datasource_mapping = pickle.load(f) + except Exception as e: + logging.warn("Failed to recover data source mapping: %s", str(e)) + + def dump_to_disk(self): + try: + with open(self._pickle_path, "wb") as f: + pickle.dump(self._datasource_mapping, f) + except Exception as e: + logging.warn("Failed to dump data source mapping: %s", str(e)) + + def get_edge_full_label( + self, type_name: str, source_vertex_type: str, destination_vertex_type: str + ) -> str: + return f"{source_vertex_type}_{type_name}_{destination_vertex_type}" + + def get_vertex_datasource(self, graph_id: str, vertex_type: str) -> dict: + rlt = {} + if ( + graph_id in self._datasource_mapping + and vertex_type in self._datasource_mapping[graph_id]["vertices"] + ): + rlt = self._datasource_mapping[graph_id]["vertices"][vertex_type] + return rlt + + def get_edge_datasource( + self, + graph_id: str, + edge_type: str, + source_vertex_type: str, + destination_vertex_type: str, + ) -> dict: + rlt = {} + elabel = self.get_edge_full_label( + edge_type, source_vertex_type, destination_vertex_type + ) + if ( + graph_id in self._datasource_mapping + and elabel in self._datasource_mapping[graph_id]["edges"] + ): + rlt = self._datasource_mapping[graph_id]["edges"][elabel] + return rlt + + def bind_datasource_in_batch(self, graph_id: str, schema_mapping: dict): + datasource_mapping = {"vertices": {}, "edges": {}} + # vertices + for vdsm in schema_mapping["vertex_mappings"]: + datasource_mapping["vertices"][vdsm["type_name"]] = vdsm + # edge + for edsm in schema_mapping["edge_mappings"]: + elabel = self.get_edge_full_label( + edsm["type_triplet"]["edge"], + edsm["type_triplet"]["source_vertex"], + edsm["type_triplet"]["destination_vertex"], + ) + datasource_mapping["edges"][elabel] = edsm + # update + if graph_id not in self._datasource_mapping: + self._datasource_mapping[graph_id] = datasource_mapping + else: + self._datasource_mapping[graph_id]["vertices"].update( + datasource_mapping["vertices"] + ) + self._datasource_mapping[graph_id]["edges"].update( + datasource_mapping["edges"] + ) + # dump + self.dump_to_disk() + + def get_datasource_mapping(self, graph_id: str) -> dict: + datasource_mapping = {"vertex_mappings": [], "edge_mappings": []} + if graph_id in self._datasource_mapping: + for _, v_mapping in self._datasource_mapping[graph_id]["vertices"].items(): + datasource_mapping["vertex_mappings"].append(v_mapping) + for _, e_mapping in self._datasource_mapping[graph_id]["edges"].items(): + datasource_mapping["edge_mappings"].append(e_mapping) + return datasource_mapping + + def unbind_vertex_datasource(self, graph_id: str, vertex_type: str): + if graph_id in self._datasource_mapping: + if vertex_type in self._datasource_mapping[graph_id]["vertices"]: + del self._datasource_mapping[graph_id]["vertices"][vertex_type] + self.dump_to_disk() + + def unbind_edge_datasource( + self, + graph_id: str, + edge_type: str, + source_vertex_type: str, + destination_vertex_type: str, + ): + elabel = self.get_edge_full_label( + edge_type, source_vertex_type, destination_vertex_type + ) + if graph_id in self._datasource_mapping: + if elabel in self._datasource_mapping[graph_id]["edges"]: + del self._datasource_mapping[graph_id]["edges"][elabel] + self.dump_to_disk() + + def delete_datasource_by_id(self, graph_id: str): + if graph_id in self._datasource_mapping: + del self._datasource_mapping[graph_id] + self.dump_to_disk() diff --git a/flex/coordinator/gs_flex_coordinator/core/insight/groot.py b/flex/coordinator/gs_flex_coordinator/core/insight/groot.py index a03f148d7801..4e63ccf5a058 100644 --- a/flex/coordinator/gs_flex_coordinator/core/insight/groot.py +++ b/flex/coordinator/gs_flex_coordinator/core/insight/groot.py @@ -16,373 +16,374 @@ # limitations under the License. # -import itertools -import logging -import os -import pickle -from typing import List +# import itertools +# import logging +# import os +# import pickle +# from typing import List -from gs_flex_coordinator.core.config import (CLUSTER_TYPE, INSTANCE_NAME, - WORKSPACE) -from gs_flex_coordinator.core.insight.graph import get_groot_graph -from gs_flex_coordinator.core.insight.job import DataloadingJobScheduler -from gs_flex_coordinator.core.scheduler import schedule -from gs_flex_coordinator.models import JobStatus +# from gs_flex_coordinator.core.config import (CLUSTER_TYPE, INSTANCE_NAME, + # WORKSPACE) +# from gs_flex_coordinator.core.insight.graph import get_groot_graph +# from gs_flex_coordinator.core.insight.job import DataloadingJobScheduler +# from gs_flex_coordinator.core.scheduler import schedule +# from gs_flex_coordinator.models import JobStatus class GrootClient(object): """Class used to interact with Groot""" def __init__(self): - self._graph = get_groot_graph() - # workspace - self._workspace = os.path.join(WORKSPACE, "groot") - os.makedirs(self._workspace, exist_ok=True) - # data source - self._data_source = {"vertices_datasource": {}, "edges_datasource": {}} - # pickle path - self._datasource_pickle_path = os.path.join( - self._workspace, "datasource.pickle" - ) - # job - self._job_scheduler = {} - # job status - self._job_status = {} - # pickle path - self._job_status_pickle_path = os.path.join( - self._workspace, "job_status.pickle" - ) - # recover - self._try_to_recover_from_disk() - # dump job status to disk every 10s - self._pickle_job_status_job = ( - schedule.every(10) - .seconds.do(self._pickle_job_status_impl) - .tag("pickle", "job status") - ) - - def _try_to_recover_from_disk(self): - try: - if os.path.exists(self._datasource_pickle_path): - logging.info( - "Recover data source from file %s", self._datasource_pickle_path - ) - with open(self._datasource_pickle_path, "rb") as f: - self._data_source = pickle.load(f) - except Exception as e: - logging.warn("Failed to recover data source: %s", str(e)) - - try: - if os.path.exists(self._job_status_pickle_path): - logging.info( - "Recover job status from file %s", self._job_status_pickle_path - ) - with open(self._job_status_pickle_path, "rb") as f: - data = pickle.load(f) - for jobid, status in data.items(): - self._job_status[jobid] = JobStatus.from_dict(status) - except Exception as e: - logging.warn("Failed to recover job status: %s", str(e)) - - def _pickle_datasource_impl(self): - try: - with open(self._datasource_pickle_path, "wb") as f: - pickle.dump(self._data_source, f) - except Exception as e: - logging.warn("Failed to dump data source: %s", str(e)) - - def _pickle_job_status_impl(self): - try: - rlt = {} - for jobid, status in self._job_status.items(): - rlt[jobid] = status.to_dict() - with open(self._job_status_pickle_path, "wb") as f: - pickle.dump(rlt, f) - except Exception as e: - logging.warn("Failed to dump job status: %s", str(e)) - - def get_edge_full_label( - self, type_name: str, source_vertex_type: str, destination_vertex_type: str - ) -> str: - return f"{source_vertex_type}_{type_name}_{destination_vertex_type}" - - def get_current_graph(self): - return self._graph - - def list_groot_graph(self) -> list: - rlts = [self._graph.to_dict()] - return rlts - - def create_vertex_type(self, graph_name: str, vtype_dict: dict) -> str: - return self._graph.create_vertex_type(vtype_dict) - - def create_edge_type(self, graph_name: str, etype_dict: dict) -> str: - return self._graph.create_edge_type(etype_dict) - - def delete_vertex_type(self, graph_name: str, vertex_type: str) -> str: - rlt = self._graph.delete_vertex_type(graph_name, vertex_type) - # unbind data source - if vertex_type in self._data_source["vertices_datasource"]: - del self._data_source["vertices_datasource"][vertex_type] - self._pickle_datasource_impl() - return rlt - - def delete_edge_type( - self, - graph_name: str, - edge_type: str, - source_vertex_type: str, - destination_vertex_type: str, - ) -> str: - rlt = self._graph.delete_edge_type( - graph_name, edge_type, source_vertex_type, destination_vertex_type - ) - # unbind data source - edge_label = self.get_edge_full_label( - edge_type, source_vertex_type, destination_vertex_type - ) - if edge_label in self._data_source["edges_datasource"]: - del self._data_source["edges_datasource"][edge_label] - self._pickle_datasource_impl() - return rlt - - def get_groot_schema(self, graph_name: str) -> dict: - return self._graph.schema - - def import_groot_schema(self, graph_name: str, schema: dict) -> str: - def _data_type_to_groot(dt): - if dt == "DT_DOUBLE": - return "DOUBLE" - elif dt == "DT_SIGNED_INT64": - return "LONG" - elif dt == "DT_STRING": - return "STRING" - else: - return dt - - # transfer to groot data type - for item in itertools.chain(schema["vertices"], schema["edges"]): - for p in item["properties"]: - p["type"] = _data_type_to_groot(p["type"]) - return self._graph.import_schema(schema) - - def list_jobs(self) -> List[dict]: - rlt = [] - for jobid, status in self._job_status.items(): - rlt.append(status.to_dict()) - return rlt - - def import_datasource(self, graph_name: str, data_source: dict) -> str: - for vertex_data_source in data_source["vertices_datasource"]: - self._data_source["vertices_datasource"][ - vertex_data_source["type_name"] - ] = vertex_data_source - for edge_data_source in data_source["edges_datasource"]: - edge_label = self.get_edge_full_label( - edge_data_source["type_name"], - edge_data_source["source_vertex"], - edge_data_source["destination_vertex"], - ) - self._data_source["edges_datasource"][edge_label] = edge_data_source - self._pickle_datasource_impl() - - def get_service_status(self) -> dict: - return { - "status": "running", - "graph_name": self._graph.name, - "sdk_endpoints": { - "gremlin": self._graph.gremlin_interface["gremlin_endpoint"], - "grpc": self._graph.gremlin_interface["grpc_endpoint"], - }, - } - - def get_datasource(self, graph_name: str) -> dict: - rlts = {"vertices_datasource": [], "edges_datasource": []} - for _, v in self._data_source["vertices_datasource"].items(): - rlts["vertices_datasource"].append(v) - for _, e in self._data_source["edges_datasource"].items(): - rlts["edges_datasource"].append(e) - return rlts - - def bind_vertex_datasource(self, graph_name: str, vertex_data_source: dict) -> str: - self._data_source["vertices_datasource"][ - vertex_data_source["type_name"] - ] = vertex_data_source - self._pickle_datasource_impl() - return "Bind vertex data source successfully" - - def bind_edge_datasource(self, graph_name: str, edge_data_source: dict) -> str: - edge_label = self.get_edge_full_label( - edge_data_source["type_name"], - edge_data_source["source_vertex"], - edge_data_source["destination_vertex"], - ) - self._data_source["edges_datasource"][edge_label] = edge_data_source - self._pickle_datasource_impl() - return "Bind edge data source successfully" - - def get_vertex_datasource(self, graph_name: str, vertex_type: str) -> dict: - if vertex_type not in self._data_source["vertices_datasource"]: - raise RuntimeError( - f"Vertex type {vertex_type} does not bind any data source" - ) - return self._data_source["vertices_datasource"][vertex_type] - - def get_edge_datasource( - self, - graph_name: str, - edge_type: str, - source_vertex_type: str, - destination_vertex_type: str, - ) -> dict: - edge_label = self.get_edge_full_label( - edge_type, source_vertex_type, destination_vertex_type - ) - if edge_label not in self._data_source["edges_datasource"]: - raise RuntimeError(f"Edge type {edge_label} does not bind any data source") - return self._data_source["edges_datasource"][edge_label] - - def unbind_vertex_datasource(self, graph_name: str, vertex_type: str) -> str: - # check - vertex_type_exists = False - schema = self._graph.schema - for v in schema["vertices"]: - if vertex_type == v["label"]: - vertex_type_exists = True - break - if not vertex_type_exists: - raise RuntimeError(f"Vertex type {vertex_type} not exists") - if vertex_type in self._data_source["vertices_datasource"]: - del self._data_source["vertices_datasource"][vertex_type] - self._pickle_datasource_impl() - return "unbind data source successfully" - - def unbind_edge_datasource( - self, - graph_name: str, - edge_type: str, - source_vertex_type: str, - destination_vertex_type: str, - ) -> str: - # check - edge_type_exists = False - schema = self._graph.schema - for e in schema["edges"]: - for relation in e["relations"]: - if ( - edge_type == e["label"] - and source_vertex_type == relation["src_label"] - and destination_vertex_type == relation["dst_label"] - ): - edge_type_exists = True - break - if not edge_type_exists: - raise RuntimeError( - f"Edge type ({source_vertex_type})-[{edge_type}]->({destination_vertex_type}) not exists" - ) - edge_label = self.get_edge_full_label( - edge_type, source_vertex_type, destination_vertex_type - ) - if edge_label in self._data_source["edges_datasource"]: - del self._data_source["edges_datasource"][edge_label] - self._pickle_datasource_impl() - return "unbind data source successfully" - - def create_groot_dataloading_job(self, graph_name: str, job_config: dict) -> str: - dataloading_job_scheduler = DataloadingJobScheduler( - job_config=job_config, - data_source=self._data_source, - job_scheduler=self._job_scheduler, - job_status=self._job_status, - graph=self._graph, - ) - return dataloading_job_scheduler.schedulerid - - def get_job_by_id(self, job_id: str) -> dict: - if job_id not in self._job_status: - raise RuntimeError(f"Job {job_id} not found") - return self._job_status[job_id].to_dict() - - def delete_job_by_id(self, job_id: str) -> str: - if job_id not in self._job_status: - raise RuntimeError(f"Job {job_id} not found") - if job_id in self._job_scheduler: - # we don't have some processes in case of restart the coordinator - # some processes will not exist if the coordinator is restart - self._job_scheduler[job_id].cancel() - return f"Submit cancellation job successfully" - - def get_dataloading_config(self, graph_name: str) -> dict: - config = { - "graph": INSTANCE_NAME, - "loading_config": {}, - "vertex_mappings": [], - "edge_mappings": [], - } - # transfer - for vtype, ds in self._data_source["vertices_datasource"].items(): - column_mappings = [] - if ds["property_mapping"] is not None: - for index, property_name in ds["property_mapping"].items(): - column_mappings.append( - { - "column": { - "index": int(index), - }, - "property": property_name, - } - ) - config["vertex_mappings"].append( - { - "type_name": vtype, - "inputs": [ds["location"]], - "column_mappings": column_mappings, - } - ) - for etype, ds in self._data_source["edges_datasource"].items(): - source_vertex_mappings = [] - for index, _ in ds["source_pk_column_map"].items(): - source_vertex_mappings.append( - { - "column": { - "index": int(index), - } - } - ) - destination_vertex_mappings = [] - for index, _ in ds["destination_pk_column_map"].items(): - destination_vertex_mappings.append( - { - "column": { - "index": int(index), - } - } - ) - column_mappings = [] - if ds["property_mapping"] is not None: - for index, property_name in ds["property_mapping"].items(): - column_mappings.append( - { - "column": { - "index": int(index), - }, - "property": property_name, - } - ) - config["edge_mappings"].append( - { - "type_triplet": { - "edge": ds["type_name"], - "source_vertex": ds["source_vertex"], - "destination_vertex": ds["destination_vertex"], - }, - "inputs": [ds["location"]], - "source_vertex_mappings": source_vertex_mappings, - "destination_vertex_mappings": destination_vertex_mappings, - "column_mappings": column_mappings, - } - ) - return config + pass + # self._graph = get_groot_graph() + # # workspace + # self._workspace = os.path.join(WORKSPACE, "groot") + # os.makedirs(self._workspace, exist_ok=True) + # # data source + # self._data_source = {"vertices_datasource": {}, "edges_datasource": {}} + # # pickle path + # self._datasource_pickle_path = os.path.join( + # self._workspace, "datasource.pickle" + # ) + # # job + # self._job_scheduler = {} + # # job status + # self._job_status = {} + # # pickle path + # self._job_status_pickle_path = os.path.join( + # self._workspace, "job_status.pickle" + # ) + # # recover + # self._try_to_recover_from_disk() + # # dump job status to disk every 10s + # self._pickle_job_status_job = ( + # schedule.every(10) + # .seconds.do(self._pickle_job_status_impl) + # .tag("pickle", "job status") + # ) + + # def _try_to_recover_from_disk(self): + # try: + # if os.path.exists(self._datasource_pickle_path): + # logging.info( + # "Recover data source from file %s", self._datasource_pickle_path + # ) + # with open(self._datasource_pickle_path, "rb") as f: + # self._data_source = pickle.load(f) + # except Exception as e: + # logging.warn("Failed to recover data source: %s", str(e)) + + # try: + # if os.path.exists(self._job_status_pickle_path): + # logging.info( + # "Recover job status from file %s", self._job_status_pickle_path + # ) + # with open(self._job_status_pickle_path, "rb") as f: + # data = pickle.load(f) + # for jobid, status in data.items(): + # self._job_status[jobid] = JobStatus.from_dict(status) + # except Exception as e: + # logging.warn("Failed to recover job status: %s", str(e)) + + # def _pickle_datasource_impl(self): + # try: + # with open(self._datasource_pickle_path, "wb") as f: + # pickle.dump(self._data_source, f) + # except Exception as e: + # logging.warn("Failed to dump data source: %s", str(e)) + + # def _pickle_job_status_impl(self): + # try: + # rlt = {} + # for jobid, status in self._job_status.items(): + # rlt[jobid] = status.to_dict() + # with open(self._job_status_pickle_path, "wb") as f: + # pickle.dump(rlt, f) + # except Exception as e: + # logging.warn("Failed to dump job status: %s", str(e)) + + # def get_edge_full_label( + # self, type_name: str, source_vertex_type: str, destination_vertex_type: str + # ) -> str: + # return f"{source_vertex_type}_{type_name}_{destination_vertex_type}" + + # def get_current_graph(self): + # return self._graph + + # def list_groot_graph(self) -> list: + # rlts = [self._graph.to_dict()] + # return rlts + + # def create_vertex_type(self, graph_name: str, vtype_dict: dict) -> str: + # return self._graph.create_vertex_type(vtype_dict) + + # def create_edge_type(self, graph_name: str, etype_dict: dict) -> str: + # return self._graph.create_edge_type(etype_dict) + + # def delete_vertex_type(self, graph_name: str, vertex_type: str) -> str: + # rlt = self._graph.delete_vertex_type(graph_name, vertex_type) + # # unbind data source + # if vertex_type in self._data_source["vertices_datasource"]: + # del self._data_source["vertices_datasource"][vertex_type] + # self._pickle_datasource_impl() + # return rlt + + # def delete_edge_type( + # self, + # graph_name: str, + # edge_type: str, + # source_vertex_type: str, + # destination_vertex_type: str, + # ) -> str: + # rlt = self._graph.delete_edge_type( + # graph_name, edge_type, source_vertex_type, destination_vertex_type + # ) + # # unbind data source + # edge_label = self.get_edge_full_label( + # edge_type, source_vertex_type, destination_vertex_type + # ) + # if edge_label in self._data_source["edges_datasource"]: + # del self._data_source["edges_datasource"][edge_label] + # self._pickle_datasource_impl() + # return rlt + + # def get_groot_schema(self, graph_name: str) -> dict: + # return self._graph.schema + + # def import_groot_schema(self, graph_name: str, schema: dict) -> str: + # def _data_type_to_groot(dt): + # if dt == "DT_DOUBLE": + # return "DOUBLE" + # elif dt == "DT_SIGNED_INT64": + # return "LONG" + # elif dt == "DT_STRING": + # return "STRING" + # else: + # return dt + + # # transfer to groot data type + # for item in itertools.chain(schema["vertices"], schema["edges"]): + # for p in item["properties"]: + # p["type"] = _data_type_to_groot(p["type"]) + # return self._graph.import_schema(schema) + + # def list_jobs(self) -> List[dict]: + # rlt = [] + # for jobid, status in self._job_status.items(): + # rlt.append(status.to_dict()) + # return rlt + + # def import_datasource(self, graph_name: str, data_source: dict) -> str: + # for vertex_data_source in data_source["vertices_datasource"]: + # self._data_source["vertices_datasource"][ + # vertex_data_source["type_name"] + # ] = vertex_data_source + # for edge_data_source in data_source["edges_datasource"]: + # edge_label = self.get_edge_full_label( + # edge_data_source["type_name"], + # edge_data_source["source_vertex"], + # edge_data_source["destination_vertex"], + # ) + # self._data_source["edges_datasource"][edge_label] = edge_data_source + # self._pickle_datasource_impl() + + # def get_service_status(self) -> dict: + # return { + # "status": "running", + # "graph_name": self._graph.name, + # "sdk_endpoints": { + # "gremlin": self._graph.gremlin_interface["gremlin_endpoint"], + # "grpc": self._graph.gremlin_interface["grpc_endpoint"], + # }, + # } + + # def get_datasource(self, graph_name: str) -> dict: + # rlts = {"vertices_datasource": [], "edges_datasource": []} + # for _, v in self._data_source["vertices_datasource"].items(): + # rlts["vertices_datasource"].append(v) + # for _, e in self._data_source["edges_datasource"].items(): + # rlts["edges_datasource"].append(e) + # return rlts + + # def bind_vertex_datasource(self, graph_name: str, vertex_data_source: dict) -> str: + # self._data_source["vertices_datasource"][ + # vertex_data_source["type_name"] + # ] = vertex_data_source + # self._pickle_datasource_impl() + # return "Bind vertex data source successfully" + + # def bind_edge_datasource(self, graph_name: str, edge_data_source: dict) -> str: + # edge_label = self.get_edge_full_label( + # edge_data_source["type_name"], + # edge_data_source["source_vertex"], + # edge_data_source["destination_vertex"], + # ) + # self._data_source["edges_datasource"][edge_label] = edge_data_source + # self._pickle_datasource_impl() + # return "Bind edge data source successfully" + + # def get_vertex_datasource(self, graph_name: str, vertex_type: str) -> dict: + # if vertex_type not in self._data_source["vertices_datasource"]: + # raise RuntimeError( + # f"Vertex type {vertex_type} does not bind any data source" + # ) + # return self._data_source["vertices_datasource"][vertex_type] + + # def get_edge_datasource( + # self, + # graph_name: str, + # edge_type: str, + # source_vertex_type: str, + # destination_vertex_type: str, + # ) -> dict: + # edge_label = self.get_edge_full_label( + # edge_type, source_vertex_type, destination_vertex_type + # ) + # if edge_label not in self._data_source["edges_datasource"]: + # raise RuntimeError(f"Edge type {edge_label} does not bind any data source") + # return self._data_source["edges_datasource"][edge_label] + + # def unbind_vertex_datasource(self, graph_name: str, vertex_type: str) -> str: + # # check + # vertex_type_exists = False + # schema = self._graph.schema + # for v in schema["vertices"]: + # if vertex_type == v["label"]: + # vertex_type_exists = True + # break + # if not vertex_type_exists: + # raise RuntimeError(f"Vertex type {vertex_type} not exists") + # if vertex_type in self._data_source["vertices_datasource"]: + # del self._data_source["vertices_datasource"][vertex_type] + # self._pickle_datasource_impl() + # return "unbind data source successfully" + + # def unbind_edge_datasource( + # self, + # graph_name: str, + # edge_type: str, + # source_vertex_type: str, + # destination_vertex_type: str, + # ) -> str: + # # check + # edge_type_exists = False + # schema = self._graph.schema + # for e in schema["edges"]: + # for relation in e["relations"]: + # if ( + # edge_type == e["label"] + # and source_vertex_type == relation["src_label"] + # and destination_vertex_type == relation["dst_label"] + # ): + # edge_type_exists = True + # break + # if not edge_type_exists: + # raise RuntimeError( + # f"Edge type ({source_vertex_type})-[{edge_type}]->({destination_vertex_type}) not exists" + # ) + # edge_label = self.get_edge_full_label( + # edge_type, source_vertex_type, destination_vertex_type + # ) + # if edge_label in self._data_source["edges_datasource"]: + # del self._data_source["edges_datasource"][edge_label] + # self._pickle_datasource_impl() + # return "unbind data source successfully" + + # def create_groot_dataloading_job(self, graph_name: str, job_config: dict) -> str: + # dataloading_job_scheduler = DataloadingJobScheduler( + # job_config=job_config, + # data_source=self._data_source, + # job_scheduler=self._job_scheduler, + # job_status=self._job_status, + # graph=self._graph, + # ) + # return dataloading_job_scheduler.schedulerid + + # def get_job_by_id(self, job_id: str) -> dict: + # if job_id not in self._job_status: + # raise RuntimeError(f"Job {job_id} not found") + # return self._job_status[job_id].to_dict() + + # def delete_job_by_id(self, job_id: str) -> str: + # if job_id not in self._job_status: + # raise RuntimeError(f"Job {job_id} not found") + # if job_id in self._job_scheduler: + # # we don't have some processes in case of restart the coordinator + # # some processes will not exist if the coordinator is restart + # self._job_scheduler[job_id].cancel() + # return f"Submit cancellation job successfully" + + # def get_dataloading_config(self, graph_name: str) -> dict: + # config = { + # "graph": INSTANCE_NAME, + # "loading_config": {}, + # "vertex_mappings": [], + # "edge_mappings": [], + # } + # # transfer + # for vtype, ds in self._data_source["vertices_datasource"].items(): + # column_mappings = [] + # if ds["property_mapping"] is not None: + # for index, property_name in ds["property_mapping"].items(): + # column_mappings.append( + # { + # "column": { + # "index": int(index), + # }, + # "property": property_name, + # } + # ) + # config["vertex_mappings"].append( + # { + # "type_name": vtype, + # "inputs": [ds["location"]], + # "column_mappings": column_mappings, + # } + # ) + # for etype, ds in self._data_source["edges_datasource"].items(): + # source_vertex_mappings = [] + # for index, _ in ds["source_pk_column_map"].items(): + # source_vertex_mappings.append( + # { + # "column": { + # "index": int(index), + # } + # } + # ) + # destination_vertex_mappings = [] + # for index, _ in ds["destination_pk_column_map"].items(): + # destination_vertex_mappings.append( + # { + # "column": { + # "index": int(index), + # } + # } + # ) + # column_mappings = [] + # if ds["property_mapping"] is not None: + # for index, property_name in ds["property_mapping"].items(): + # column_mappings.append( + # { + # "column": { + # "index": int(index), + # }, + # "property": property_name, + # } + # ) + # config["edge_mappings"].append( + # { + # "type_triplet": { + # "edge": ds["type_name"], + # "source_vertex": ds["source_vertex"], + # "destination_vertex": ds["destination_vertex"], + # }, + # "inputs": [ds["location"]], + # "source_vertex_mappings": source_vertex_mappings, + # "destination_vertex_mappings": destination_vertex_mappings, + # "column_mappings": column_mappings, + # } + # ) + # return config def init_groot_client(): diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/__init__.py b/flex/coordinator/gs_flex_coordinator/core/interactive/__init__.py index b75561641056..57b689a39c57 100644 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/__init__.py +++ b/flex/coordinator/gs_flex_coordinator/core/interactive/__init__.py @@ -19,10 +19,4 @@ import os import sys -try: - sys.path.insert(0, os.path.dirname(__file__)) - import hqps_client -except ImportError: - raise - from gs_flex_coordinator.core.interactive.hqps import init_hqps_client diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps.py index a2059c31ff05..bbdbc2c4ac9c 100644 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps.py +++ b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps.py @@ -21,20 +21,17 @@ import os import pickle import time +import requests from typing import List, Union -import hqps_client -import requests -from hqps_client import ( - Graph, - JobResponse, - JobStatus, - ModelSchema, - Procedure, - SchemaMapping, - Service, -) +import interactive_sdk.openapi +from interactive_sdk.openapi import CreateGraphRequest +from interactive_sdk.openapi import CreateProcedureRequest +from interactive_sdk.openapi import UpdateProcedureRequest +from interactive_sdk.openapi import StartServiceRequest +from interactive_sdk.openapi import SchemaMapping +from gs_flex_coordinator.core.datasource import DataSourceManager from gs_flex_coordinator.core.config import ( CLUSTER_TYPE, HQPS_ADMIN_SERVICE_PORT, @@ -45,7 +42,6 @@ get_internal_ip, get_public_ip, ) -from gs_flex_coordinator.models import StartServiceRequest class HQPSClient(object): @@ -54,33 +50,30 @@ class HQPSClient(object): def __init__(self): # hqps admin service endpoint self._hqps_endpoint = self._get_hqps_service_endpoints() - # workspace - self._workspace = os.path.join(WORKSPACE, "interactive") - os.makedirs(self._workspace, exist_ok=True) - # dataloading config - self._dataloading_config = {} - # pickle path - self._pickle_path = os.path.join(self._workspace, "dataloading_config") + # job configuration + self._job_config = {} + # job Configuration path + self._job_config_pickle_path = os.path.join(WORKSPACE, "job_config.pickle") # recover - self._try_to_recover_from_disk() + self.try_to_recover_from_disk() - def _try_to_recover_from_disk(self): + def dump_to_disk(self): try: - if os.path.exists(self._pickle_path): - logging.info( - "Recover dataloading configs from file %s", self._pickle_path - ) - with open(self._pickle_path, "rb") as f: - self._dataloading_config = pickle.load(f) + with open(self._job_config_pickle_path, "wb") as f: + pickle.dump(self._job_config, f) except Exception as e: - logging.warn("Failed to recover dataloading configs: %s", str(e)) + logging.warn("Failed to dump job config file: %s", str(e)) - def _pickle_dataloading_config_impl(self): + def try_to_recover_from_disk(self): try: - with open(self._pickle_path, "wb") as f: - pickle.dump(self._dataloading_config, f) + if os.path.exists(self._job_config_pickle_path): + logging.info( + "Recover job config from file %s", self._job_config_pickle_path + ) + with open(self._job_config_pickle_path, "rb") as f: + self._job_config = pickle.load(f) except Exception as e: - logging.warn("Failed to dump dataloading configs: %s", str(e)) + logging.warn("Failed to recover job config: %s", str(e)) def _get_hqps_service_endpoints(self): if CLUSTER_TYPE == "HOSTS": @@ -93,140 +86,168 @@ def _get_hqps_service_endpoints(self): else: return f"http://192.168.0.9:{HQPS_ADMIN_SERVICE_PORT}" - def list_graphs(self) -> List[Graph]: - with hqps_client.ApiClient( - hqps_client.Configuration(self._hqps_endpoint) + def list_graphs(self) -> List[dict]: + with interactive_sdk.openapi.ApiClient( + interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = hqps_client.GraphApi(api_client) - return api_instance.list_graphs() + api_instance = interactive_sdk.openapi.AdminServiceGraphManagementApi(api_client) + graphs = [g.to_dict() for g in api_instance.list_graphs()] + for g in graphs: + # `schema_update_time` is same to `creation_time` in Interactive + g["schema_update_time"] = g["creation_time"] + # we do not have edge's primary key in Interactive + for edge in g["schema"]["edge_types"]: + if "primary_keys" not in edge: + edge["primary_keys"] = [] + return graphs - def get_schema_by_name(self, graph_name: str) -> ModelSchema: - with hqps_client.ApiClient( - hqps_client.Configuration(self._hqps_endpoint) + def get_schema_by_id(self, graph_id: str) -> dict: + with interactive_sdk.openapi.ApiClient( + interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = hqps_client.GraphApi(api_client) - return api_instance.get_schema(graph_name) + api_instance = interactive_sdk.openapi.AdminServiceGraphManagementApi(api_client) + return api_instance.get_schema(graph_id).to_dict() - def create_graph(self, graph: dict) -> str: - with hqps_client.ApiClient( - hqps_client.Configuration(self._hqps_endpoint) + def create_graph(self, graph: dict) -> dict: + with interactive_sdk.openapi.ApiClient( + interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = hqps_client.GraphApi(api_client) - return api_instance.create_graph(Graph.from_dict(graph)) + api_instance = interactive_sdk.openapi.AdminServiceGraphManagementApi(api_client) + response = api_instance.create_graph(CreateGraphRequest.from_dict(graph)) + return response.to_dict() - def delete_graph_by_name(self, graph_name: str) -> str: - with hqps_client.ApiClient( - hqps_client.Configuration(self._hqps_endpoint) + def delete_graph_by_id(self, graph_id: str) -> str: + with interactive_sdk.openapi.ApiClient( + interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = hqps_client.GraphApi(api_client) - rlt = api_instance.delete_graph(graph_name) - # unbind datasource - if graph_name in self._dataloading_config: - del self._dataloading_config[graph_name] - self._pickle_dataloading_config_impl() + api_instance = interactive_sdk.openapi.AdminServiceGraphManagementApi(api_client) + rlt = api_instance.delete_graph(graph_id) return rlt - def create_procedure(self, graph_name: str, procedure: dict) -> str: - with hqps_client.ApiClient( - hqps_client.Configuration(self._hqps_endpoint) + def get_graph_by_id(self, graph_id: str) -> dict: + with interactive_sdk.openapi.ApiClient( + interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = hqps_client.ProcedureApi(api_client) - return api_instance.create_procedure( - graph_name, Procedure.from_dict(procedure) - ) + api_instance = interactive_sdk.openapi.AdminServiceGraphManagementApi(api_client) + a = api_instance.get_graph(graph_id) + g = api_instance.get_graph(graph_id).to_dict() + # `schema_update_time` is same to `creation_time` in Interactive + g["schema_update_time"] = g["creation_time"] + # we do not have edge's primary key in Interactive + for edge in g["schema"]["edge_types"]: + if "primary_keys" not in edge: + edge["primary_keys"] = [] + return g + + def create_vertex_type(self, graph_id: str, vtype: dict): + raise RuntimeError("Create vertex type is not supported yet!") - def list_procedures(self, graph_name: Union[None, str]) -> List[Procedure]: - if graph_name is not None: - graph_name_list = [graph_name] - else: - # list all procedures - graphs = self.list_graphs() - graph_name_list = [g.name for g in graphs] + def create_edge_type(self, graph_id: str, etype: dict): + raise RuntimeError("Create vertex type is not supported yet!") - with hqps_client.ApiClient( - hqps_client.Configuration(self._hqps_endpoint) + def delete_vertex_type_by_name(self, graph_id: str, type_name: str): + raise RuntimeError("Create vertex type is not supported yet!") + + def delete_edge_type_by_name(self, graph_id: str, edge_type: str, source_vertex_type: str, destination_vertex_type: str): + raise RuntimeError("Create vertex type is not supported yet!") + + def create_procedure(self, graph_id: str, procedure: dict) -> dict: + with interactive_sdk.openapi.ApiClient( + interactive_sdk.openapi.Configuration(self._hqps_endpoint) + ) as api_client: + api_instance = interactive_sdk.openapi.AdminServiceProcedureManagementApi(api_client) + response = api_instance.create_procedure( + graph_id, CreateProcedureRequest.from_dict(procedure) + ) + return response.to_dict() + + def list_procedures(self, graph_id: str) -> List[dict]: + with interactive_sdk.openapi.ApiClient( + interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: procedures = [] - api_instance = hqps_client.ProcedureApi(api_client) - for graph_name in graph_name_list: - response = api_instance.list_procedures(graph_name) - if response is not None: - procedures.extend(response) + api_instance = interactive_sdk.openapi.AdminServiceProcedureManagementApi(api_client) + procedures = [p.to_dict() for p in api_instance.list_procedures(graph_id)] return procedures - def update_procedure( - self, graph_name: str, procedure_name: str, procedure: dict + def update_procedure_by_id( + self, graph_id: str, procedure_id: str, procedure: dict ) -> str: - with hqps_client.ApiClient( - hqps_client.Configuration(self._hqps_endpoint) + with interactive_sdk.openapi.ApiClient( + interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = hqps_client.ProcedureApi(api_client) + api_instance = interactive_sdk.openapi.AdminServiceProcedureManagementApi(api_client) return api_instance.update_procedure( - graph_name, procedure_name, Procedure.from_dict(procedure) + graph_id, procedure_id, UpdateProcedureRequest.from_dict(procedure) ) - def delete_procedure_by_name(self, graph_name: str, procedure_name: str) -> str: - with hqps_client.ApiClient( - hqps_client.Configuration(self._hqps_endpoint) + def delete_procedure_by_id(self, graph_id: str, procedure_id: str) -> str: + with interactive_sdk.openapi.ApiClient( + interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = hqps_client.ProcedureApi(api_client) - return api_instance.delete_procedure(graph_name, procedure_name) + api_instance = interactive_sdk.openapi.AdminServiceProcedureManagementApi(api_client) + return api_instance.delete_procedure(graph_id, procedure_id) - def get_procedure_by_name(self, graph_name: str, procedure_name: str) -> Procedure: - with hqps_client.ApiClient( - hqps_client.Configuration(self._hqps_endpoint) + def get_procedure_by_id(self, graph_id: str, procedure_id: str) -> dict: + with interactive_sdk.openapi.ApiClient( + interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = hqps_client.ProcedureApi(api_client) - return api_instance.get_procedure(graph_name, procedure_name) + api_instance = interactive_sdk.openapi.AdminServiceProcedureManagementApi(api_client) + return api_instance.get_procedure(graph_id, procedure_id).to_dict() def get_service_status(self) -> dict: - with hqps_client.ApiClient( - hqps_client.Configuration(self._hqps_endpoint) + with interactive_sdk.openapi.ApiClient( + interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = hqps_client.ServiceApi(api_client) + api_instance = interactive_sdk.openapi.AdminServiceServiceManagementApi(api_client) response = api_instance.get_service_status() # transfer if CLUSTER_TYPE == "HOSTS": host = get_public_ip() if host is None: host = get_internal_ip() - return { + status = { "status": response.status, - "graph_name": response.graph_name, "sdk_endpoints": { "cypher": f"neo4j://{host}:{response.bolt_port}", "hqps": f"http://{host}:{response.hqps_port}", + "gremlin": f"ws://{host}:{response.gremlin_port}/gremlin", }, } + if response.graph is not None: + graph = response.graph.to_dict() + # `schema_update_time` is same to `creation_time` in Interactive + graph["schema_update_time"] = graph["creation_time"] + status["graph"] = graph + return status + def stop_service(self) -> str: - with hqps_client.ApiClient( - hqps_client.Configuration(self._hqps_endpoint) + with interactive_sdk.openapi.ApiClient( + interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = hqps_client.ServiceApi(api_client) + api_instance = interactive_sdk.openapi.AdminServiceServiceManagementApi(api_client) return api_instance.stop_service() def restart_service(self) -> str: - with hqps_client.ApiClient( - hqps_client.Configuration(self._hqps_endpoint) + with interactive_sdk.openapi.ApiClient( + interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = hqps_client.ServiceApi(api_client) + api_instance = interactive_sdk.openapi.AdminServiceServiceManagementApi(api_client) return api_instance.restart_service() - def start_service(self, request: StartServiceRequest) -> str: - with hqps_client.ApiClient( - hqps_client.Configuration(self._hqps_endpoint) + def start_service(self, graph_id: str) -> str: + with interactive_sdk.openapi.ApiClient( + interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = hqps_client.ServiceApi(api_client) - return api_instance.start_service( - Service.from_dict({"graph_name": request.graph_name}) - ) + api_instance = interactive_sdk.openapi.AdminServiceServiceManagementApi(api_client) + return api_instance.start_service(StartServiceRequest(graph_id=graph_id)) def list_jobs(self) -> List[dict]: - with hqps_client.ApiClient( - hqps_client.Configuration(self._hqps_endpoint) + with interactive_sdk.openapi.ApiClient( + interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = hqps_client.JobApi(api_client) + api_instance = interactive_sdk.openapi.AdminServiceJobManagementApi(api_client) rlt = [] for s in api_instance.list_jobs(): job_status = s.to_dict() @@ -241,10 +262,10 @@ def list_jobs(self) -> List[dict]: return rlt def get_job_by_id(self, job_id: str) -> dict: - with hqps_client.ApiClient( - hqps_client.Configuration(self._hqps_endpoint) + with interactive_sdk.openapi.ApiClient( + interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = hqps_client.JobApi(api_client) + api_instance = interactive_sdk.openapi.AdminServiceJobManagementApi(api_client) job_status = api_instance.get_job_by_id(job_id).to_dict() job_status["start_time"] = encode_datetime( datetime.datetime.fromtimestamp(job_status["start_time"] / 1000) @@ -256,29 +277,47 @@ def get_job_by_id(self, job_id: str) -> dict: return job_status def delete_job_by_id(self, job_id: str) -> str: - with hqps_client.ApiClient( - hqps_client.Configuration(self._hqps_endpoint) + with interactive_sdk.openapi.ApiClient( + interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = hqps_client.JobApi(api_client) + api_instance = interactive_sdk.openapi.AdminServiceJobManagementApi(api_client) return api_instance.delete_job_by_id(job_id) - def create_dataloading_job( - self, graph_name: str, schema_mapping: dict - ) -> JobResponse: - # dataloading - self._dataloading_config[graph_name] = schema_mapping - self._pickle_dataloading_config_impl() - with hqps_client.ApiClient( - hqps_client.Configuration(self._hqps_endpoint) + def submit_dataloading_job( + self, graph_id: str, config: dict, ds_manager: DataSourceManager + ) -> str: + # schema mapping + schema_mapping = { + "loading_config": config["loading_config"], + "vertex_mappings": [], + "edge_mappings": [], + } + for v in config["vertices"]: + vds = ds_manager.get_vertex_datasource(graph_id, v["type_name"]) + if vds: + schema_mapping["vertex_mappings"].append(vds) + for e in config["edges"]: + eds = ds_manager.get_edge_datasource(graph_id, e["type_name"], e["source_vertex"], e["destination_vertex"]) + if eds: + schema_mapping["edge_mappings"].append(eds) + # set job configuration before submission + self._job_config[graph_id] = config + self.dump_to_disk() + # submit + with interactive_sdk.openapi.ApiClient( + interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = hqps_client.JobApi(api_client) + api_instance = interactive_sdk.openapi.AdminServiceGraphManagementApi(api_client) response = api_instance.create_dataloading_job( - graph_name, SchemaMapping.from_dict(schema_mapping) + graph_id, SchemaMapping.from_dict(schema_mapping) ) return response.job_id - def get_dataloading_config(self, graph_name: str) -> dict: - return self._dataloading_config.get(graph_name, {}) + def get_dataloading_job_config(self, graph_id: str) -> dict: + config = {} + if graph_id in self._job_config: + config = self._job_config[graph_id] + return config def init_hqps_client(): diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/__init__.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/__init__.py deleted file mode 100644 index 1ca63d2e1849..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/__init__.py +++ /dev/null @@ -1,63 +0,0 @@ -# coding: utf-8 - -# flake8: noqa - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -__version__ = "1.0.0" - -# import apis into sdk package -from hqps_client.api.graph_api import GraphApi -from hqps_client.api.job_api import JobApi -from hqps_client.api.procedure_api import ProcedureApi -from hqps_client.api.service_api import ServiceApi - -# import ApiClient -from hqps_client.api_response import ApiResponse -from hqps_client.api_client import ApiClient -from hqps_client.configuration import Configuration -from hqps_client.exceptions import OpenApiException -from hqps_client.exceptions import ApiTypeError -from hqps_client.exceptions import ApiValueError -from hqps_client.exceptions import ApiKeyError -from hqps_client.exceptions import ApiAttributeError -from hqps_client.exceptions import ApiException - -# import models into sdk package -from hqps_client.models.column_mapping import ColumnMapping -from hqps_client.models.edge_mapping import EdgeMapping -from hqps_client.models.edge_mapping_destination_vertex_mappings_inner import EdgeMappingDestinationVertexMappingsInner -from hqps_client.models.edge_mapping_source_vertex_mappings_inner import EdgeMappingSourceVertexMappingsInner -from hqps_client.models.edge_mapping_source_vertex_mappings_inner_column import EdgeMappingSourceVertexMappingsInnerColumn -from hqps_client.models.edge_mapping_type_triplet import EdgeMappingTypeTriplet -from hqps_client.models.edge_type import EdgeType -from hqps_client.models.edge_type_vertex_type_pair_relations_inner import EdgeTypeVertexTypePairRelationsInner -from hqps_client.models.edge_type_vertex_type_pair_relations_inner_x_csr_params import EdgeTypeVertexTypePairRelationsInnerXCsrParams -from hqps_client.models.graph import Graph -from hqps_client.models.graph_stored_procedures import GraphStoredProcedures -from hqps_client.models.job_response import JobResponse -from hqps_client.models.job_status import JobStatus -from hqps_client.models.model_property import ModelProperty -from hqps_client.models.model_schema import ModelSchema -from hqps_client.models.procedure import Procedure -from hqps_client.models.procedure_params_inner import ProcedureParamsInner -from hqps_client.models.property_property_type import PropertyPropertyType -from hqps_client.models.schema_mapping import SchemaMapping -from hqps_client.models.schema_mapping_loading_config import SchemaMappingLoadingConfig -from hqps_client.models.schema_mapping_loading_config_data_source import SchemaMappingLoadingConfigDataSource -from hqps_client.models.schema_mapping_loading_config_format import SchemaMappingLoadingConfigFormat -from hqps_client.models.service import Service -from hqps_client.models.service_status import ServiceStatus -from hqps_client.models.vertex_mapping import VertexMapping -from hqps_client.models.vertex_type import VertexType diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/api/__init__.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/api/__init__.py deleted file mode 100644 index 5fbd916816d1..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/api/__init__.py +++ /dev/null @@ -1,8 +0,0 @@ -# flake8: noqa - -# import apis into api package -from hqps_client.api.graph_api import GraphApi -from hqps_client.api.job_api import JobApi -from hqps_client.api.procedure_api import ProcedureApi -from hqps_client.api.service_api import ServiceApi - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/api/graph_api.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/api/graph_api.py deleted file mode 100644 index 6d323a0a238b..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/api/graph_api.py +++ /dev/null @@ -1,1075 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import io -import warnings - -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any - -try: - from typing import Annotated -except ImportError: - from typing_extensions import Annotated - -from pydantic import StrictStr - -from typing import List - -from hqps_client.models.graph import Graph -from hqps_client.models.model_schema import ModelSchema - -from hqps_client.api_client import ApiClient -from hqps_client.api_response import ApiResponse -from hqps_client.rest import RESTResponseType - - -class GraphApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def create_graph( - self, - graph: Graph, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> str: - """create_graph - - Create a new graph - - :param graph: (required) - :type graph: Graph - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_graph_serialize( - graph=graph, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def create_graph_with_http_info( - self, - graph: Graph, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[str]: - """create_graph - - Create a new graph - - :param graph: (required) - :type graph: Graph - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_graph_serialize( - graph=graph, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def create_graph_without_preload_content( - self, - graph: Graph, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """create_graph - - Create a new graph - - :param graph: (required) - :type graph: Graph - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_graph_serialize( - graph=graph, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _create_graph_serialize( - self, - graph, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> Tuple: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if graph is not None: - _body_params = graph - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/graph', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def delete_graph( - self, - graph_name: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> str: - """delete_graph - - Delete a graph by name - - :param graph_name: (required) - :type graph_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_graph_serialize( - graph_name=graph_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def delete_graph_with_http_info( - self, - graph_name: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[str]: - """delete_graph - - Delete a graph by name - - :param graph_name: (required) - :type graph_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_graph_serialize( - graph_name=graph_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def delete_graph_without_preload_content( - self, - graph_name: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """delete_graph - - Delete a graph by name - - :param graph_name: (required) - :type graph_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_graph_serialize( - graph_name=graph_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_graph_serialize( - self, - graph_name, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> Tuple: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v1/graph/{graph_name}', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def get_schema( - self, - graph_name: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ModelSchema: - """get_schema - - Get schema by graph name - - :param graph_name: (required) - :type graph_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_schema_serialize( - graph_name=graph_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ModelSchema", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def get_schema_with_http_info( - self, - graph_name: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ModelSchema]: - """get_schema - - Get schema by graph name - - :param graph_name: (required) - :type graph_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_schema_serialize( - graph_name=graph_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ModelSchema", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def get_schema_without_preload_content( - self, - graph_name: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """get_schema - - Get schema by graph name - - :param graph_name: (required) - :type graph_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_schema_serialize( - graph_name=graph_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ModelSchema", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_schema_serialize( - self, - graph_name, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> Tuple: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/graph/{graph_name}/schema', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def list_graphs( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[Graph]: - """list_graphs - - List all graphs - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_graphs_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[Graph]", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def list_graphs_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[Graph]]: - """list_graphs - - List all graphs - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_graphs_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[Graph]", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def list_graphs_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """list_graphs - - List all graphs - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_graphs_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[Graph]", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _list_graphs_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> Tuple: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/graph', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/api/job_api.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/api/job_api.py deleted file mode 100644 index 4b035cb84aee..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/api/job_api.py +++ /dev/null @@ -1,1082 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import io -import warnings - -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any - -try: - from typing import Annotated -except ImportError: - from typing_extensions import Annotated - -from pydantic import StrictStr - -from typing import List - -from hqps_client.models.job_response import JobResponse -from hqps_client.models.job_status import JobStatus -from hqps_client.models.schema_mapping import SchemaMapping - -from hqps_client.api_client import ApiClient -from hqps_client.api_response import ApiResponse -from hqps_client.rest import RESTResponseType - - -class JobApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def create_dataloading_job( - self, - graph_name: StrictStr, - schema_mapping: SchemaMapping, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> JobResponse: - """create_dataloading_job - - Create a dataloading job - - :param graph_name: (required) - :type graph_name: str - :param schema_mapping: (required) - :type schema_mapping: SchemaMapping - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_dataloading_job_serialize( - graph_name=graph_name, - schema_mapping=schema_mapping, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "JobResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def create_dataloading_job_with_http_info( - self, - graph_name: StrictStr, - schema_mapping: SchemaMapping, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[JobResponse]: - """create_dataloading_job - - Create a dataloading job - - :param graph_name: (required) - :type graph_name: str - :param schema_mapping: (required) - :type schema_mapping: SchemaMapping - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_dataloading_job_serialize( - graph_name=graph_name, - schema_mapping=schema_mapping, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "JobResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def create_dataloading_job_without_preload_content( - self, - graph_name: StrictStr, - schema_mapping: SchemaMapping, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """create_dataloading_job - - Create a dataloading job - - :param graph_name: (required) - :type graph_name: str - :param schema_mapping: (required) - :type schema_mapping: SchemaMapping - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_dataloading_job_serialize( - graph_name=graph_name, - schema_mapping=schema_mapping, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "JobResponse", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _create_dataloading_job_serialize( - self, - graph_name, - schema_mapping, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> Tuple: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if schema_mapping is not None: - _body_params = schema_mapping - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/graph/{graph_name}/dataloading', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def delete_job_by_id( - self, - job_id: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> str: - """delete_job_by_id - - - :param job_id: (required) - :type job_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_job_by_id_serialize( - job_id=job_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def delete_job_by_id_with_http_info( - self, - job_id: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[str]: - """delete_job_by_id - - - :param job_id: (required) - :type job_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_job_by_id_serialize( - job_id=job_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def delete_job_by_id_without_preload_content( - self, - job_id: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """delete_job_by_id - - - :param job_id: (required) - :type job_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_job_by_id_serialize( - job_id=job_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_job_by_id_serialize( - self, - job_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> Tuple: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if job_id is not None: - _path_params['job_id'] = job_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v1/job/{job_id}', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def get_job_by_id( - self, - job_id: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> JobStatus: - """get_job_by_id - - - :param job_id: (required) - :type job_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_job_by_id_serialize( - job_id=job_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "JobStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def get_job_by_id_with_http_info( - self, - job_id: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[JobStatus]: - """get_job_by_id - - - :param job_id: (required) - :type job_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_job_by_id_serialize( - job_id=job_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "JobStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def get_job_by_id_without_preload_content( - self, - job_id: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """get_job_by_id - - - :param job_id: (required) - :type job_id: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_job_by_id_serialize( - job_id=job_id, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "JobStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_job_by_id_serialize( - self, - job_id, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> Tuple: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if job_id is not None: - _path_params['job_id'] = job_id - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/job/{job_id}', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def list_jobs( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[JobStatus]: - """list_jobs - - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_jobs_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[JobStatus]", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def list_jobs_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[JobStatus]]: - """list_jobs - - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_jobs_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[JobStatus]", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def list_jobs_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """list_jobs - - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_jobs_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[JobStatus]", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _list_jobs_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> Tuple: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/job', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/api/procedure_api.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/api/procedure_api.py deleted file mode 100644 index 0f7a10e006e9..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/api/procedure_api.py +++ /dev/null @@ -1,1434 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import io -import warnings - -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any - -try: - from typing import Annotated -except ImportError: - from typing_extensions import Annotated - -from pydantic import StrictStr - -from typing import List, Optional - -from hqps_client.models.procedure import Procedure - -from hqps_client.api_client import ApiClient -from hqps_client.api_response import ApiResponse -from hqps_client.rest import RESTResponseType - - -class ProcedureApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def create_procedure( - self, - graph_name: StrictStr, - procedure: Procedure, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> str: - """create_procedure - - Create a new procedure on a graph - - :param graph_name: (required) - :type graph_name: str - :param procedure: (required) - :type procedure: Procedure - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_procedure_serialize( - graph_name=graph_name, - procedure=procedure, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def create_procedure_with_http_info( - self, - graph_name: StrictStr, - procedure: Procedure, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[str]: - """create_procedure - - Create a new procedure on a graph - - :param graph_name: (required) - :type graph_name: str - :param procedure: (required) - :type procedure: Procedure - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_procedure_serialize( - graph_name=graph_name, - procedure=procedure, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def create_procedure_without_preload_content( - self, - graph_name: StrictStr, - procedure: Procedure, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """create_procedure - - Create a new procedure on a graph - - :param graph_name: (required) - :type graph_name: str - :param procedure: (required) - :type procedure: Procedure - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._create_procedure_serialize( - graph_name=graph_name, - procedure=procedure, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _create_procedure_serialize( - self, - graph_name, - procedure, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> Tuple: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if procedure is not None: - _body_params = procedure - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/graph/{graph_name}/procedure', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def delete_procedure( - self, - graph_name: StrictStr, - procedure_name: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> str: - """delete_procedure - - Delete a procedure on a graph by name - - :param graph_name: (required) - :type graph_name: str - :param procedure_name: (required) - :type procedure_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_procedure_serialize( - graph_name=graph_name, - procedure_name=procedure_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def delete_procedure_with_http_info( - self, - graph_name: StrictStr, - procedure_name: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[str]: - """delete_procedure - - Delete a procedure on a graph by name - - :param graph_name: (required) - :type graph_name: str - :param procedure_name: (required) - :type procedure_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_procedure_serialize( - graph_name=graph_name, - procedure_name=procedure_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def delete_procedure_without_preload_content( - self, - graph_name: StrictStr, - procedure_name: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """delete_procedure - - Delete a procedure on a graph by name - - :param graph_name: (required) - :type graph_name: str - :param procedure_name: (required) - :type procedure_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._delete_procedure_serialize( - graph_name=graph_name, - procedure_name=procedure_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _delete_procedure_serialize( - self, - graph_name, - procedure_name, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> Tuple: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name - if procedure_name is not None: - _path_params['procedure_name'] = procedure_name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/v1/graph/{graph_name}/procedure/{procedure_name}', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def get_procedure( - self, - graph_name: StrictStr, - procedure_name: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Procedure: - """get_procedure - - Get a procedure by name - - :param graph_name: (required) - :type graph_name: str - :param procedure_name: (required) - :type procedure_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_procedure_serialize( - graph_name=graph_name, - procedure_name=procedure_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Procedure", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def get_procedure_with_http_info( - self, - graph_name: StrictStr, - procedure_name: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Procedure]: - """get_procedure - - Get a procedure by name - - :param graph_name: (required) - :type graph_name: str - :param procedure_name: (required) - :type procedure_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_procedure_serialize( - graph_name=graph_name, - procedure_name=procedure_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Procedure", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def get_procedure_without_preload_content( - self, - graph_name: StrictStr, - procedure_name: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """get_procedure - - Get a procedure by name - - :param graph_name: (required) - :type graph_name: str - :param procedure_name: (required) - :type procedure_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_procedure_serialize( - graph_name=graph_name, - procedure_name=procedure_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "Procedure", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_procedure_serialize( - self, - graph_name, - procedure_name, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> Tuple: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name - if procedure_name is not None: - _path_params['procedure_name'] = procedure_name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/graph/{graph_name}/procedure/{procedure_name}', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def list_procedures( - self, - graph_name: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[Procedure]: - """list_procedures - - List all procedures - - :param graph_name: (required) - :type graph_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_procedures_serialize( - graph_name=graph_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[Procedure]", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def list_procedures_with_http_info( - self, - graph_name: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[Procedure]]: - """list_procedures - - List all procedures - - :param graph_name: (required) - :type graph_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_procedures_serialize( - graph_name=graph_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[Procedure]", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def list_procedures_without_preload_content( - self, - graph_name: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """list_procedures - - List all procedures - - :param graph_name: (required) - :type graph_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_procedures_serialize( - graph_name=graph_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[Procedure]", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _list_procedures_serialize( - self, - graph_name, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> Tuple: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/graph/{graph_name}/procedure', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def update_procedure( - self, - graph_name: StrictStr, - procedure_name: StrictStr, - procedure: Optional[Procedure] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> str: - """update_procedure - - Update procedure on a graph by name - - :param graph_name: (required) - :type graph_name: str - :param procedure_name: (required) - :type procedure_name: str - :param procedure: - :type procedure: Procedure - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._update_procedure_serialize( - graph_name=graph_name, - procedure_name=procedure_name, - procedure=procedure, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def update_procedure_with_http_info( - self, - graph_name: StrictStr, - procedure_name: StrictStr, - procedure: Optional[Procedure] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[str]: - """update_procedure - - Update procedure on a graph by name - - :param graph_name: (required) - :type graph_name: str - :param procedure_name: (required) - :type procedure_name: str - :param procedure: - :type procedure: Procedure - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._update_procedure_serialize( - graph_name=graph_name, - procedure_name=procedure_name, - procedure=procedure, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def update_procedure_without_preload_content( - self, - graph_name: StrictStr, - procedure_name: StrictStr, - procedure: Optional[Procedure] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """update_procedure - - Update procedure on a graph by name - - :param graph_name: (required) - :type graph_name: str - :param procedure_name: (required) - :type procedure_name: str - :param procedure: - :type procedure: Procedure - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._update_procedure_serialize( - graph_name=graph_name, - procedure_name=procedure_name, - procedure=procedure, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _update_procedure_serialize( - self, - graph_name, - procedure_name, - procedure, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> Tuple: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name - if procedure_name is not None: - _path_params['procedure_name'] = procedure_name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if procedure is not None: - _body_params = procedure - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='PUT', - resource_path='/v1/graph/{graph_name}/procedure/{procedure_name}', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/api/service_api.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/api/service_api.py deleted file mode 100644 index fd46dc43e180..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/api/service_api.py +++ /dev/null @@ -1,1045 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import io -import warnings - -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Dict, List, Optional, Tuple, Union, Any - -try: - from typing import Annotated -except ImportError: - from typing_extensions import Annotated - -from pydantic import Field -from typing_extensions import Annotated -from typing import Optional - -from hqps_client.models.service import Service -from hqps_client.models.service_status import ServiceStatus - -from hqps_client.api_client import ApiClient -from hqps_client.api_response import ApiResponse -from hqps_client.rest import RESTResponseType - - -class ServiceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def get_service_status( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ServiceStatus: - """get_service_status - - Get service status - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_service_status_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ServiceStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def get_service_status_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ServiceStatus]: - """get_service_status - - Get service status - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_service_status_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ServiceStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def get_service_status_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """get_service_status - - Get service status - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_service_status_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ServiceStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_service_status_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> Tuple: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/service/status', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def restart_service( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> str: - """restart_service - - Start current service - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._restart_service_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def restart_service_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[str]: - """restart_service - - Start current service - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._restart_service_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def restart_service_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """restart_service - - Start current service - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._restart_service_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _restart_service_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> Tuple: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/service/restart', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def start_service( - self, - service: Annotated[Optional[Service], Field(description="Start service on a specified graph")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> str: - """start_service - - Start service on a specified graph - - :param service: Start service on a specified graph - :type service: Service - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._start_service_serialize( - service=service, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def start_service_with_http_info( - self, - service: Annotated[Optional[Service], Field(description="Start service on a specified graph")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[str]: - """start_service - - Start service on a specified graph - - :param service: Start service on a specified graph - :type service: Service - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._start_service_serialize( - service=service, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def start_service_without_preload_content( - self, - service: Annotated[Optional[Service], Field(description="Start service on a specified graph")] = None, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """start_service - - Start service on a specified graph - - :param service: Start service on a specified graph - :type service: Service - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._start_service_serialize( - service=service, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _start_service_serialize( - self, - service, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> Tuple: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if service is not None: - _body_params = service - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/service/start', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def stop_service( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> str: - """stop_service - - Stop current service - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._stop_service_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def stop_service_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[str]: - """stop_service - - Stop current service - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._stop_service_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def stop_service_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """stop_service - - Stop current service - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._stop_service_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _stop_service_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> Tuple: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/v1/service/stop', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/api_client.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/api_client.py deleted file mode 100644 index 2faed8f1b12a..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/api_client.py +++ /dev/null @@ -1,732 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import atexit -import datetime -from dateutil.parser import parse -import json -import mimetypes -import os -import re -import tempfile - -from urllib.parse import quote -from typing import Tuple, Optional, List - -from hqps_client.configuration import Configuration -from hqps_client.api_response import ApiResponse -import hqps_client.models -from hqps_client import rest -from hqps_client.exceptions import ( - ApiValueError, - ApiException, - BadRequestException, - UnauthorizedException, - ForbiddenException, - NotFoundException, - ServiceException -) - - -class ApiClient: - """Generic API client for OpenAPI client library builds. - - OpenAPI generic API client. This client handles the client- - server communication, and is invariant across implementations. Specifics of - the methods and models for each application are generated from the OpenAPI - templates. - - :param configuration: .Configuration object for this client - :param header_name: a header to pass when making calls to the API. - :param header_value: a header value to pass when making calls to - the API. - :param cookie: a cookie to include in the header when making calls - to the API - """ - - PRIMITIVE_TYPES = (float, bool, bytes, str, int) - NATIVE_TYPES_MAPPING = { - 'int': int, - 'long': int, # TODO remove as only py3 is supported? - 'float': float, - 'str': str, - 'bool': bool, - 'date': datetime.date, - 'datetime': datetime.datetime, - 'object': object, - } - _pool = None - - def __init__( - self, - configuration=None, - header_name=None, - header_value=None, - cookie=None - ) -> None: - # use default configuration if none is provided - if configuration is None: - configuration = Configuration.get_default() - self.configuration = configuration - - self.rest_client = rest.RESTClientObject(configuration) - self.default_headers = {} - if header_name is not None: - self.default_headers[header_name] = header_value - self.cookie = cookie - # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.0.0/python' - self.client_side_validation = configuration.client_side_validation - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_value, traceback): - pass - - @property - def user_agent(self): - """User agent for this API client""" - return self.default_headers['User-Agent'] - - @user_agent.setter - def user_agent(self, value): - self.default_headers['User-Agent'] = value - - def set_default_header(self, header_name, header_value): - self.default_headers[header_name] = header_value - - - _default = None - - @classmethod - def get_default(cls): - """Return new instance of ApiClient. - - This method returns newly created, based on default constructor, - object of ApiClient class or returns a copy of default - ApiClient. - - :return: The ApiClient object. - """ - if cls._default is None: - cls._default = ApiClient() - return cls._default - - @classmethod - def set_default(cls, default): - """Set default instance of ApiClient. - - It stores default ApiClient. - - :param default: object of ApiClient. - """ - cls._default = default - - def param_serialize( - self, - method, - resource_path, - path_params=None, - query_params=None, - header_params=None, - body=None, - post_params=None, - files=None, auth_settings=None, - collection_formats=None, - _host=None, - _request_auth=None - ) -> Tuple: - - """Builds the HTTP request params needed by the request. - :param method: Method to call. - :param resource_path: Path to method endpoint. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param files dict: key -> filename, value -> filepath, - for `multipart/form-data`. - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :return: tuple of form (path, http_method, query_params, header_params, - body, post_params, files) - """ - - config = self.configuration - - # header parameters - header_params = header_params or {} - header_params.update(self.default_headers) - if self.cookie: - header_params['Cookie'] = self.cookie - if header_params: - header_params = self.sanitize_for_serialization(header_params) - header_params = dict( - self.parameters_to_tuples(header_params,collection_formats) - ) - - # path parameters - if path_params: - path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples( - path_params, - collection_formats - ) - for k, v in path_params: - # specified safe chars, encode everything - resource_path = resource_path.replace( - '{%s}' % k, - quote(str(v), safe=config.safe_chars_for_path_param) - ) - - # post parameters - if post_params or files: - post_params = post_params if post_params else [] - post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples( - post_params, - collection_formats - ) - post_params.extend(self.files_parameters(files)) - - # auth setting - self.update_params_for_auth( - header_params, - query_params, - auth_settings, - resource_path, - method, - body, - request_auth=_request_auth - ) - - # body - if body: - body = self.sanitize_for_serialization(body) - - # request url - if _host is None: - url = self.configuration.host + resource_path - else: - # use server/host defined in path or operation instead - url = _host + resource_path - - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - url_query = self.parameters_to_url_query( - query_params, - collection_formats - ) - url += "?" + url_query - - return method, url, header_params, body, post_params - - - def call_api( - self, - method, - url, - header_params=None, - body=None, - post_params=None, - _request_timeout=None - ) -> rest.RESTResponse: - """Makes the HTTP request (synchronous) - :param method: Method to call. - :param url: Path to method endpoint. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param _request_timeout: timeout setting for this request. - :return: RESTResponse - """ - - try: - # perform request and return response - response_data = self.rest_client.request( - method, url, - headers=header_params, - body=body, post_params=post_params, - _request_timeout=_request_timeout - ) - - except ApiException as e: - if e.body: - e.body = e.body.decode('utf-8') - raise e - - return response_data - - def response_deserialize( - self, - response_data: rest.RESTResponse = None, - response_types_map=None - ) -> ApiResponse: - """Deserializes response into an object. - :param response_data: RESTResponse object to be deserialized. - :param response_types_map: dict of response types. - :return: ApiResponse - """ - - - response_type = response_types_map.get(str(response_data.status), None) - if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: - # if not found, look for '1XX', '2XX', etc. - response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) - - # deserialize response data - response_text = None - return_data = None - try: - if response_type == "bytearray": - return_data = response_data.data - elif response_type == "file": - return_data = self.__deserialize_file(response_data) - elif response_type is not None: - match = None - content_type = response_data.getheader('content-type') - if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) - encoding = match.group(1) if match else "utf-8" - response_text = response_data.data.decode(encoding) - return_data = self.deserialize(response_text, response_type) - finally: - if not 200 <= response_data.status <= 299: - raise ApiException.from_response( - http_resp=response_data, - body=response_text, - data=return_data, - ) - - return ApiResponse( - status_code = response_data.status, - data = return_data, - headers = response_data.getheaders(), - raw_data = response_data.data - ) - - def sanitize_for_serialization(self, obj): - """Builds a JSON POST object. - - If obj is None, return None. - If obj is str, int, long, float, bool, return directly. - If obj is datetime.datetime, datetime.date - convert to string in iso8601 format. - If obj is list, sanitize each element in the list. - If obj is dict, return the dict. - If obj is OpenAPI model, return the properties dict. - - :param obj: The data to serialize. - :return: The serialized form of data. - """ - if obj is None: - return None - elif isinstance(obj, self.PRIMITIVE_TYPES): - return obj - elif isinstance(obj, list): - return [ - self.sanitize_for_serialization(sub_obj) for sub_obj in obj - ] - elif isinstance(obj, tuple): - return tuple( - self.sanitize_for_serialization(sub_obj) for sub_obj in obj - ) - elif isinstance(obj, (datetime.datetime, datetime.date)): - return obj.isoformat() - - elif isinstance(obj, dict): - obj_dict = obj - else: - # Convert model obj to dict except - # attributes `openapi_types`, `attribute_map` - # and attributes which value is not None. - # Convert attribute name to json key in - # model definition for request. - obj_dict = obj.to_dict() - - return { - key: self.sanitize_for_serialization(val) - for key, val in obj_dict.items() - } - - def deserialize(self, response_text, response_type): - """Deserializes response into an object. - - :param response: RESTResponse object to be deserialized. - :param response_type: class literal for - deserialized object, or string of class name. - - :return: deserialized object. - """ - - # fetch data from response object - try: - data = json.loads(response_text) - except ValueError: - data = response_text - - return self.__deserialize(data, response_type) - - def __deserialize(self, data, klass): - """Deserializes dict, list, str into an object. - - :param data: dict, list or str. - :param klass: class literal, or string of class name. - - :return: object. - """ - if data is None: - return None - - if isinstance(klass, str): - if klass.startswith('List['): - sub_kls = re.match(r'List\[(.*)]', klass).group(1) - return [self.__deserialize(sub_data, sub_kls) - for sub_data in data] - - if klass.startswith('Dict['): - sub_kls = re.match(r'Dict\[([^,]*), (.*)]', klass).group(2) - return {k: self.__deserialize(v, sub_kls) - for k, v in data.items()} - - # convert str to class - if klass in self.NATIVE_TYPES_MAPPING: - klass = self.NATIVE_TYPES_MAPPING[klass] - else: - klass = getattr(hqps_client.models, klass) - - if klass in self.PRIMITIVE_TYPES: - return self.__deserialize_primitive(data, klass) - elif klass == object: - return self.__deserialize_object(data) - elif klass == datetime.date: - return self.__deserialize_date(data) - elif klass == datetime.datetime: - return self.__deserialize_datetime(data) - else: - return self.__deserialize_model(data, klass) - - def parameters_to_tuples(self, params, collection_formats): - """Get parameters as list of tuples, formatting collections. - - :param params: Parameters as dict or list of two-tuples - :param dict collection_formats: Parameter collection formats - :return: Parameters as list of tuples, collections formatted - """ - new_params = [] - if collection_formats is None: - collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: - if k in collection_formats: - collection_format = collection_formats[k] - if collection_format == 'multi': - new_params.extend((k, value) for value in v) - else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' - else: # csv is the default - delimiter = ',' - new_params.append( - (k, delimiter.join(str(value) for value in v))) - else: - new_params.append((k, v)) - return new_params - - def parameters_to_url_query(self, params, collection_formats): - """Get parameters as list of tuples, formatting collections. - - :param params: Parameters as dict or list of two-tuples - :param dict collection_formats: Parameter collection formats - :return: URL query string (e.g. a=Hello%20World&b=123) - """ - new_params = [] - if collection_formats is None: - collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: - if isinstance(v, bool): - v = str(v).lower() - if isinstance(v, (int, float)): - v = str(v) - if isinstance(v, dict): - v = json.dumps(v) - - if k in collection_formats: - collection_format = collection_formats[k] - if collection_format == 'multi': - new_params.extend((k, value) for value in v) - else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' - else: # csv is the default - delimiter = ',' - new_params.append( - (k, delimiter.join(quote(str(value)) for value in v)) - ) - else: - new_params.append((k, quote(str(v)))) - - return "&".join(["=".join(item) for item in new_params]) - - def files_parameters(self, files=None): - """Builds form parameters. - - :param files: File parameters. - :return: Form parameters with files. - """ - params = [] - - if files: - for k, v in files.items(): - if not v: - continue - file_names = v if type(v) is list else [v] - for n in file_names: - with open(n, 'rb') as f: - filename = os.path.basename(f.name) - filedata = f.read() - mimetype = ( - mimetypes.guess_type(filename)[0] - or 'application/octet-stream' - ) - params.append( - tuple([k, tuple([filename, filedata, mimetype])]) - ) - - return params - - def select_header_accept(self, accepts: List[str]) -> Optional[str]: - """Returns `Accept` based on an array of accepts provided. - - :param accepts: List of headers. - :return: Accept (e.g. application/json). - """ - if not accepts: - return None - - for accept in accepts: - if re.search('json', accept, re.IGNORECASE): - return accept - - return accepts[0] - - def select_header_content_type(self, content_types): - """Returns `Content-Type` based on an array of content_types provided. - - :param content_types: List of content-types. - :return: Content-Type (e.g. application/json). - """ - if not content_types: - return None - - for content_type in content_types: - if re.search('json', content_type, re.IGNORECASE): - return content_type - - return content_types[0] - - def update_params_for_auth( - self, - headers, - queries, - auth_settings, - resource_path, - method, - body, - request_auth=None - ) -> None: - """Updates header and query params based on authentication setting. - - :param headers: Header parameters dict to be updated. - :param queries: Query parameters tuple list to be updated. - :param auth_settings: Authentication setting identifiers list. - :resource_path: A string representation of the HTTP request resource path. - :method: A string representation of the HTTP request method. - :body: A object representing the body of the HTTP request. - The object type is the return value of sanitize_for_serialization(). - :param request_auth: if set, the provided settings will - override the token in the configuration. - """ - if not auth_settings: - return - - if request_auth: - self._apply_auth_params( - headers, - queries, - resource_path, - method, - body, - request_auth - ) - else: - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - self._apply_auth_params( - headers, - queries, - resource_path, - method, - body, - auth_setting - ) - - def _apply_auth_params( - self, - headers, - queries, - resource_path, - method, - body, - auth_setting - ) -> None: - """Updates the request parameters based on a single auth_setting - - :param headers: Header parameters dict to be updated. - :param queries: Query parameters tuple list to be updated. - :resource_path: A string representation of the HTTP request resource path. - :method: A string representation of the HTTP request method. - :body: A object representing the body of the HTTP request. - The object type is the return value of sanitize_for_serialization(). - :param auth_setting: auth settings for the endpoint - """ - if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] - elif auth_setting['in'] == 'header': - if auth_setting['type'] != 'http-signature': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - queries.append((auth_setting['key'], auth_setting['value'])) - else: - raise ApiValueError( - 'Authentication token must be in `query` or `header`' - ) - - def __deserialize_file(self, response): - """Deserializes body to file - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - handle file downloading - save response body into a tmp file and return the instance - - :param response: RESTResponse. - :return: file path. - """ - fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - content_disposition = response.getheader("Content-Disposition") - if content_disposition: - filename = re.search( - r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition - ).group(1) - path = os.path.join(os.path.dirname(path), filename) - - with open(path, "wb") as f: - f.write(response.data) - - return path - - def __deserialize_primitive(self, data, klass): - """Deserializes string to primitive type. - - :param data: str. - :param klass: class literal. - - :return: int, long, float, str, bool. - """ - try: - return klass(data) - except UnicodeEncodeError: - return str(data) - except TypeError: - return data - - def __deserialize_object(self, value): - """Return an original value. - - :return: object. - """ - return value - - def __deserialize_date(self, string): - """Deserializes string to date. - - :param string: str. - :return: date. - """ - try: - return parse(string).date() - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason="Failed to parse `{0}` as date object".format(string) - ) - - def __deserialize_datetime(self, string): - """Deserializes string to datetime. - - The string should be in iso8601 datetime format. - - :param string: str. - :return: datetime. - """ - try: - return parse(string) - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason=( - "Failed to parse `{0}` as datetime object" - .format(string) - ) - ) - - def __deserialize_model(self, data, klass): - """Deserializes list or dict to model. - - :param data: dict, list. - :param klass: class literal. - :return: model object. - """ - - return klass.from_dict(data) diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/api_response.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/api_response.py deleted file mode 100644 index 2ac1ada6e9b3..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/api_response.py +++ /dev/null @@ -1,21 +0,0 @@ -"""API response object.""" - -from __future__ import annotations -from typing import Any, Dict, Optional, Generic, TypeVar -from pydantic import Field, StrictInt, StrictStr, StrictBytes, BaseModel - -T = TypeVar("T") - -class ApiResponse(BaseModel, Generic[T]): - """ - API response object - """ - - status_code: StrictInt = Field(description="HTTP status code") - headers: Optional[Dict[StrictStr, StrictStr]] = Field(None, description="HTTP headers") - data: T = Field(description="Deserialized data given the data type") - raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") - - model_config = { - "arbitrary_types_allowed": True - } diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/configuration.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/configuration.py deleted file mode 100644 index 4f3de71e8330..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/configuration.py +++ /dev/null @@ -1,435 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import copy -import logging -import multiprocessing -import sys -import urllib3 - -import http.client as httplib - -JSON_SCHEMA_VALIDATION_KEYWORDS = { - 'multipleOf', 'maximum', 'exclusiveMaximum', - 'minimum', 'exclusiveMinimum', 'maxLength', - 'minLength', 'pattern', 'maxItems', 'minItems' -} - -class Configuration: - """This class contains various settings of the API client. - - :param host: Base url. - :param api_key: Dict to store API key(s). - Each entry in the dict specifies an API key. - The dict key is the name of the security scheme in the OAS specification. - The dict value is the API key secret. - :param api_key_prefix: Dict to store API prefix (e.g. Bearer). - The dict key is the name of the security scheme in the OAS specification. - The dict value is an API key prefix when generating the auth data. - :param username: Username for HTTP basic authentication. - :param password: Password for HTTP basic authentication. - :param access_token: Access token. - :param server_index: Index to servers configuration. - :param server_variables: Mapping with string values to replace variables in - templated server configuration. The validation of enums is performed for - variables with defined enum values before. - :param server_operation_index: Mapping from operation ID to an index to server - configuration. - :param server_operation_variables: Mapping from operation ID to a mapping with - string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum - values before. - :param ssl_ca_cert: str - the path to a file of concatenated CA certificates - in PEM format. - - """ - - _default = None - - def __init__(self, host=None, - api_key=None, api_key_prefix=None, - username=None, password=None, - access_token=None, - server_index=None, server_variables=None, - server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, - ) -> None: - """Constructor - """ - self._base_path = "http://localhost" if host is None else host - """Default Base url - """ - self.server_index = 0 if server_index is None and host is None else server_index - self.server_operation_index = server_operation_index or {} - """Default server index - """ - self.server_variables = server_variables or {} - self.server_operation_variables = server_operation_variables or {} - """Default server variables - """ - self.temp_folder_path = None - """Temp file folder for downloading files - """ - # Authentication Settings - self.api_key = {} - if api_key: - self.api_key = api_key - """dict to store API key(s) - """ - self.api_key_prefix = {} - if api_key_prefix: - self.api_key_prefix = api_key_prefix - """dict to store API prefix (e.g. Bearer) - """ - self.refresh_api_key_hook = None - """function hook to refresh API key if expired - """ - self.username = username - """Username for HTTP basic authentication - """ - self.password = password - """Password for HTTP basic authentication - """ - self.access_token = access_token - """Access token - """ - self.logger = {} - """Logging Settings - """ - self.logger["package_logger"] = logging.getLogger("hqps_client") - self.logger["urllib3_logger"] = logging.getLogger("urllib3") - self.logger_format = '%(asctime)s %(levelname)s %(message)s' - """Log format - """ - self.logger_stream_handler = None - """Log stream handler - """ - self.logger_file_handler = None - """Log file handler - """ - self.logger_file = None - """Debug file location - """ - self.debug = False - """Debug switch - """ - - self.verify_ssl = True - """SSL/TLS verification - Set this to false to skip verifying SSL certificate when calling API - from https server. - """ - self.ssl_ca_cert = ssl_ca_cert - """Set this to customize the certificate file to verify the peer. - """ - self.cert_file = None - """client certificate file - """ - self.key_file = None - """client key file - """ - self.assert_hostname = None - """Set this to True/False to enable/disable SSL hostname verification. - """ - self.tls_server_name = None - """SSL/TLS Server Name Indication (SNI) - Set this to the SNI value expected by the server. - """ - - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 - """urllib3 connection pool's maximum number of connections saved - per pool. urllib3 uses 1 connection as default value, but this is - not the best value when you are making a lot of possibly parallel - requests to the same host, which is often the case here. - cpu_count * 5 is used as default value to increase performance. - """ - - self.proxy = None - """Proxy URL - """ - self.proxy_headers = None - """Proxy headers - """ - self.safe_chars_for_path_param = '' - """Safe chars for path_param - """ - self.retries = None - """Adding retries to override urllib3 default value 3 - """ - # Enable client side validation - self.client_side_validation = True - - self.socket_options = None - """Options to pass down to the underlying urllib3 socket - """ - - self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" - """datetime format - """ - - self.date_format = "%Y-%m-%d" - """date format - """ - - def __deepcopy__(self, memo): - cls = self.__class__ - result = cls.__new__(cls) - memo[id(self)] = result - for k, v in self.__dict__.items(): - if k not in ('logger', 'logger_file_handler'): - setattr(result, k, copy.deepcopy(v, memo)) - # shallow copy of loggers - result.logger = copy.copy(self.logger) - # use setters to configure loggers - result.logger_file = self.logger_file - result.debug = self.debug - return result - - def __setattr__(self, name, value): - object.__setattr__(self, name, value) - - @classmethod - def set_default(cls, default): - """Set default instance of configuration. - - It stores default configuration, which can be - returned by get_default_copy method. - - :param default: object of Configuration - """ - cls._default = default - - @classmethod - def get_default_copy(cls): - """Deprecated. Please use `get_default` instead. - - Deprecated. Please use `get_default` instead. - - :return: The configuration object. - """ - return cls.get_default() - - @classmethod - def get_default(cls): - """Return the default configuration. - - This method returns newly created, based on default constructor, - object of Configuration class or returns a copy of default - configuration. - - :return: The configuration object. - """ - if cls._default is None: - cls._default = Configuration() - return cls._default - - @property - def logger_file(self): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - return self.__logger_file - - @logger_file.setter - def logger_file(self, value): - """The logger file. - - If the logger_file is None, then add stream handler and remove file - handler. Otherwise, add file handler and remove stream handler. - - :param value: The logger_file path. - :type: str - """ - self.__logger_file = value - if self.__logger_file: - # If set logging file, - # then add file handler and remove stream handler. - self.logger_file_handler = logging.FileHandler(self.__logger_file) - self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in self.logger.items(): - logger.addHandler(self.logger_file_handler) - - @property - def debug(self): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - return self.__debug - - @debug.setter - def debug(self, value): - """Debug status - - :param value: The debug status, True or False. - :type: bool - """ - self.__debug = value - if self.__debug: - # if debug status is True, turn on debug logging - for _, logger in self.logger.items(): - logger.setLevel(logging.DEBUG) - # turn on httplib debug - httplib.HTTPConnection.debuglevel = 1 - else: - # if debug status is False, turn off debug logging, - # setting log level to default `logging.WARNING` - for _, logger in self.logger.items(): - logger.setLevel(logging.WARNING) - # turn off httplib debug - httplib.HTTPConnection.debuglevel = 0 - - @property - def logger_format(self): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - return self.__logger_format - - @logger_format.setter - def logger_format(self, value): - """The logger format. - - The logger_formatter will be updated when sets logger_format. - - :param value: The format string. - :type: str - """ - self.__logger_format = value - self.logger_formatter = logging.Formatter(self.__logger_format) - - def get_api_key_with_prefix(self, identifier, alias=None): - """Gets API key (with prefix if set). - - :param identifier: The identifier of apiKey. - :param alias: The alternative identifier of apiKey. - :return: The token for api key authentication. - """ - if self.refresh_api_key_hook is not None: - self.refresh_api_key_hook(self) - key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) - if key: - prefix = self.api_key_prefix.get(identifier) - if prefix: - return "%s %s" % (prefix, key) - else: - return key - - def get_basic_auth_token(self): - """Gets HTTP basic authentication header (string). - - :return: The token for basic HTTP authentication. - """ - username = "" - if self.username is not None: - username = self.username - password = "" - if self.password is not None: - password = self.password - return urllib3.util.make_headers( - basic_auth=username + ':' + password - ).get('authorization') - - def auth_settings(self): - """Gets Auth Settings dict for api client. - - :return: The Auth Settings information dict. - """ - auth = {} - return auth - - def to_debug_report(self): - """Gets the essential information for debugging. - - :return: The report for debugging. - """ - return "Python SDK Debug Report:\n"\ - "OS: {env}\n"\ - "Python Version: {pyversion}\n"\ - "Version of the API: 0.9.1\n"\ - "SDK Package Version: 1.0.0".\ - format(env=sys.platform, pyversion=sys.version) - - def get_host_settings(self): - """Gets an array of host settings - - :return: An array of host settings - """ - return [ - { - 'url': "", - 'description': "No description provided", - } - ] - - def get_host_from_settings(self, index, variables=None, servers=None): - """Gets host URL based on the index and variables - :param index: array index of the host settings - :param variables: hash of variable and the corresponding value - :param servers: an array of host settings or None - :return: URL based on host settings - """ - if index is None: - return self._base_path - - variables = {} if variables is None else variables - servers = self.get_host_settings() if servers is None else servers - - try: - server = servers[index] - except IndexError: - raise ValueError( - "Invalid index {0} when selecting the host settings. " - "Must be less than {1}".format(index, len(servers))) - - url = server['url'] - - # go through variables and replace placeholders - for variable_name, variable in server.get('variables', {}).items(): - used_value = variables.get( - variable_name, variable['default_value']) - - if 'enum_values' in variable \ - and used_value not in variable['enum_values']: - raise ValueError( - "The variable `{0}` in the host URL has invalid value " - "{1}. Must be {2}.".format( - variable_name, variables[variable_name], - variable['enum_values'])) - - url = url.replace("{" + variable_name + "}", used_value) - - return url - - @property - def host(self): - """Return generated host.""" - return self.get_host_from_settings(self.server_index, variables=self.server_variables) - - @host.setter - def host(self, value): - """Fix base path.""" - self._base_path = value - self.server_index = None diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/exceptions.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/exceptions.py deleted file mode 100644 index 6832c50bf463..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/exceptions.py +++ /dev/null @@ -1,201 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -from typing import Any, Optional - -from typing_extensions import Self - -class OpenApiException(Exception): - """The base exception class for all OpenAPIExceptions""" - - -class ApiTypeError(OpenApiException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, - key_type=None) -> None: - """ Raises an exception for TypeErrors - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list): a list of keys an indices to get to the - current_item - None if unset - valid_classes (tuple): the primitive classes that current item - should be an instance of - None if unset - key_type (bool): False if our value is a value in a dict - True if it is a key in a dict - False if our item is an item in a list - None if unset - """ - self.path_to_item = path_to_item - self.valid_classes = valid_classes - self.key_type = key_type - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiTypeError, self).__init__(full_msg) - - -class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None) -> None: - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (list) the path to the exception in the - received_data dict. None if unset - """ - - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiValueError, self).__init__(full_msg) - - -class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None) -> None: - """ - Raised when an attribute reference or assignment fails. - - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiAttributeError, self).__init__(full_msg) - - -class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None) -> None: - """ - Args: - msg (str): the exception message - - Keyword Args: - path_to_item (None/list) the path to the exception in the - received_data dict - """ - self.path_to_item = path_to_item - full_msg = msg - if path_to_item: - full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) - super(ApiKeyError, self).__init__(full_msg) - - -class ApiException(OpenApiException): - - def __init__( - self, - status=None, - reason=None, - http_resp=None, - *, - body: Optional[str] = None, - data: Optional[Any] = None, - ) -> None: - self.status = status - self.reason = reason - self.body = body - self.data = data - self.headers = None - - if http_resp: - if self.status is None: - self.status = http_resp.status - if self.reason is None: - self.reason = http_resp.reason - if self.body is None: - try: - self.body = http_resp.data.decode('utf-8') - except Exception: - pass - self.headers = http_resp.getheaders() - - @classmethod - def from_response( - cls, - *, - http_resp, - body: Optional[str], - data: Optional[Any], - ) -> Self: - if http_resp.status == 400: - raise BadRequestException(http_resp=http_resp, body=body, data=data) - - if http_resp.status == 401: - raise UnauthorizedException(http_resp=http_resp, body=body, data=data) - - if http_resp.status == 403: - raise ForbiddenException(http_resp=http_resp, body=body, data=data) - - if http_resp.status == 404: - raise NotFoundException(http_resp=http_resp, body=body, data=data) - - if 500 <= http_resp.status <= 599: - raise ServiceException(http_resp=http_resp, body=body, data=data) - raise ApiException(http_resp=http_resp, body=body, data=data) - - def __str__(self): - """Custom error messages for exception""" - error_message = "({0})\n"\ - "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) - - if self.data or self.body: - error_message += "HTTP response body: {0}\n".format(self.data or self.body) - - return error_message - - -class BadRequestException(ApiException): - pass - - -class NotFoundException(ApiException): - pass - - -class UnauthorizedException(ApiException): - pass - - -class ForbiddenException(ApiException): - pass - - -class ServiceException(ApiException): - pass - - -def render_path(path_to_item): - """Returns a string representation of a path""" - result = "" - for pth in path_to_item: - if isinstance(pth, int): - result += "[{0}]".format(pth) - else: - result += "['{0}']".format(pth) - return result diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/__init__.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/__init__.py deleted file mode 100644 index 6eeaab32b362..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/__init__.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding: utf-8 - -# flake8: noqa -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -# import models into model package -from hqps_client.models.column_mapping import ColumnMapping -from hqps_client.models.edge_mapping import EdgeMapping -from hqps_client.models.edge_mapping_destination_vertex_mappings_inner import EdgeMappingDestinationVertexMappingsInner -from hqps_client.models.edge_mapping_source_vertex_mappings_inner import EdgeMappingSourceVertexMappingsInner -from hqps_client.models.edge_mapping_source_vertex_mappings_inner_column import EdgeMappingSourceVertexMappingsInnerColumn -from hqps_client.models.edge_mapping_type_triplet import EdgeMappingTypeTriplet -from hqps_client.models.edge_type import EdgeType -from hqps_client.models.edge_type_vertex_type_pair_relations_inner import EdgeTypeVertexTypePairRelationsInner -from hqps_client.models.edge_type_vertex_type_pair_relations_inner_x_csr_params import EdgeTypeVertexTypePairRelationsInnerXCsrParams -from hqps_client.models.graph import Graph -from hqps_client.models.graph_stored_procedures import GraphStoredProcedures -from hqps_client.models.job_response import JobResponse -from hqps_client.models.job_status import JobStatus -from hqps_client.models.model_property import ModelProperty -from hqps_client.models.model_schema import ModelSchema -from hqps_client.models.procedure import Procedure -from hqps_client.models.procedure_params_inner import ProcedureParamsInner -from hqps_client.models.property_property_type import PropertyPropertyType -from hqps_client.models.schema_mapping import SchemaMapping -from hqps_client.models.schema_mapping_loading_config import SchemaMappingLoadingConfig -from hqps_client.models.schema_mapping_loading_config_data_source import SchemaMappingLoadingConfigDataSource -from hqps_client.models.schema_mapping_loading_config_format import SchemaMappingLoadingConfigFormat -from hqps_client.models.service import Service -from hqps_client.models.service_status import ServiceStatus -from hqps_client.models.vertex_mapping import VertexMapping -from hqps_client.models.vertex_type import VertexType diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/column_mapping.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/column_mapping.py deleted file mode 100644 index 79a6d32f29e7..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/column_mapping.py +++ /dev/null @@ -1,96 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -from pydantic import Field -from hqps_client.models.edge_mapping_source_vertex_mappings_inner_column import EdgeMappingSourceVertexMappingsInnerColumn -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class ColumnMapping(BaseModel): - """ - ColumnMapping - """ # noqa: E501 - column: Optional[EdgeMappingSourceVertexMappingsInnerColumn] = None - var_property: Optional[StrictStr] = Field(default=None, description="must align with the schema", alias="property") - __properties: ClassVar[List[str]] = ["column", "property"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ColumnMapping from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of column - if self.column: - _dict['column'] = self.column.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of ColumnMapping from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "column": EdgeMappingSourceVertexMappingsInnerColumn.from_dict(obj.get("column")) if obj.get("column") is not None else None, - "property": obj.get("property") - }) - return _obj - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_mapping.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_mapping.py deleted file mode 100644 index 1befeb93358d..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_mapping.py +++ /dev/null @@ -1,125 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -from hqps_client.models.column_mapping import ColumnMapping -from hqps_client.models.edge_mapping_destination_vertex_mappings_inner import EdgeMappingDestinationVertexMappingsInner -from hqps_client.models.edge_mapping_source_vertex_mappings_inner import EdgeMappingSourceVertexMappingsInner -from hqps_client.models.edge_mapping_type_triplet import EdgeMappingTypeTriplet -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class EdgeMapping(BaseModel): - """ - EdgeMapping - """ # noqa: E501 - type_triplet: Optional[EdgeMappingTypeTriplet] = None - inputs: Optional[List[StrictStr]] = None - source_vertex_mappings: Optional[List[EdgeMappingSourceVertexMappingsInner]] = None - destination_vertex_mappings: Optional[List[EdgeMappingDestinationVertexMappingsInner]] = None - column_mappings: Optional[List[ColumnMapping]] = None - __properties: ClassVar[List[str]] = ["type_triplet", "inputs", "source_vertex_mappings", "destination_vertex_mappings", "column_mappings"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of EdgeMapping from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of type_triplet - if self.type_triplet: - _dict['type_triplet'] = self.type_triplet.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in source_vertex_mappings (list) - _items = [] - if self.source_vertex_mappings: - for _item in self.source_vertex_mappings: - if _item: - _items.append(_item.to_dict()) - _dict['source_vertex_mappings'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in destination_vertex_mappings (list) - _items = [] - if self.destination_vertex_mappings: - for _item in self.destination_vertex_mappings: - if _item: - _items.append(_item.to_dict()) - _dict['destination_vertex_mappings'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in column_mappings (list) - _items = [] - if self.column_mappings: - for _item in self.column_mappings: - if _item: - _items.append(_item.to_dict()) - _dict['column_mappings'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of EdgeMapping from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type_triplet": EdgeMappingTypeTriplet.from_dict(obj.get("type_triplet")) if obj.get("type_triplet") is not None else None, - "inputs": obj.get("inputs"), - "source_vertex_mappings": [EdgeMappingSourceVertexMappingsInner.from_dict(_item) for _item in obj.get("source_vertex_mappings")] if obj.get("source_vertex_mappings") is not None else None, - "destination_vertex_mappings": [EdgeMappingDestinationVertexMappingsInner.from_dict(_item) for _item in obj.get("destination_vertex_mappings")] if obj.get("destination_vertex_mappings") is not None else None, - "column_mappings": [ColumnMapping.from_dict(_item) for _item in obj.get("column_mappings")] if obj.get("column_mappings") is not None else None - }) - return _obj - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_mapping_destination_vertex_mappings_inner.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_mapping_destination_vertex_mappings_inner.py deleted file mode 100644 index 29a9fa32fd1a..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_mapping_destination_vertex_mappings_inner.py +++ /dev/null @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel -from hqps_client.models.edge_mapping_source_vertex_mappings_inner_column import EdgeMappingSourceVertexMappingsInnerColumn -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class EdgeMappingDestinationVertexMappingsInner(BaseModel): - """ - Mapping column to the primary key of destination vertex - """ # noqa: E501 - column: Optional[EdgeMappingSourceVertexMappingsInnerColumn] = None - __properties: ClassVar[List[str]] = ["column"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of EdgeMappingDestinationVertexMappingsInner from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of column - if self.column: - _dict['column'] = self.column.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of EdgeMappingDestinationVertexMappingsInner from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "column": EdgeMappingSourceVertexMappingsInnerColumn.from_dict(obj.get("column")) if obj.get("column") is not None else None - }) - return _obj - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_mapping_source_vertex_mappings_inner.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_mapping_source_vertex_mappings_inner.py deleted file mode 100644 index 6c426c0a6b87..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_mapping_source_vertex_mappings_inner.py +++ /dev/null @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel -from hqps_client.models.edge_mapping_source_vertex_mappings_inner_column import EdgeMappingSourceVertexMappingsInnerColumn -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class EdgeMappingSourceVertexMappingsInner(BaseModel): - """ - Mapping column to the primary key of source vertex - """ # noqa: E501 - column: Optional[EdgeMappingSourceVertexMappingsInnerColumn] = None - __properties: ClassVar[List[str]] = ["column"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of EdgeMappingSourceVertexMappingsInner from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of column - if self.column: - _dict['column'] = self.column.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of EdgeMappingSourceVertexMappingsInner from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "column": EdgeMappingSourceVertexMappingsInnerColumn.from_dict(obj.get("column")) if obj.get("column") is not None else None - }) - return _obj - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_mapping_source_vertex_mappings_inner_column.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_mapping_source_vertex_mappings_inner_column.py deleted file mode 100644 index 00bb6cda40a7..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_mapping_source_vertex_mappings_inner_column.py +++ /dev/null @@ -1,91 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt, StrictStr -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class EdgeMappingSourceVertexMappingsInnerColumn(BaseModel): - """ - EdgeMappingSourceVertexMappingsInnerColumn - """ # noqa: E501 - index: Optional[StrictInt] = None - name: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["index", "name"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of EdgeMappingSourceVertexMappingsInnerColumn from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of EdgeMappingSourceVertexMappingsInnerColumn from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "index": obj.get("index"), - "name": obj.get("name") - }) - return _obj - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_mapping_type_triplet.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_mapping_type_triplet.py deleted file mode 100644 index 0a00c4171760..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_mapping_type_triplet.py +++ /dev/null @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class EdgeMappingTypeTriplet(BaseModel): - """ - source label -> [edge label] -> destination label - """ # noqa: E501 - edge: Optional[StrictStr] = None - source_vertex: Optional[StrictStr] = None - destination_vertex: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["edge", "source_vertex", "destination_vertex"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of EdgeMappingTypeTriplet from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of EdgeMappingTypeTriplet from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "edge": obj.get("edge"), - "source_vertex": obj.get("source_vertex"), - "destination_vertex": obj.get("destination_vertex") - }) - return _obj - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_type.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_type.py deleted file mode 100644 index bc010e123db6..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_type.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt, StrictStr -from hqps_client.models.edge_type_vertex_type_pair_relations_inner import EdgeTypeVertexTypePairRelationsInner -from hqps_client.models.model_property import ModelProperty -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class EdgeType(BaseModel): - """ - EdgeType - """ # noqa: E501 - type_id: Optional[StrictInt] = None - type_name: Optional[StrictStr] = None - vertex_type_pair_relations: Optional[List[EdgeTypeVertexTypePairRelationsInner]] = None - properties: Optional[List[ModelProperty]] = None - __properties: ClassVar[List[str]] = ["type_id", "type_name", "vertex_type_pair_relations", "properties"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of EdgeType from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in vertex_type_pair_relations (list) - _items = [] - if self.vertex_type_pair_relations: - for _item in self.vertex_type_pair_relations: - if _item: - _items.append(_item.to_dict()) - _dict['vertex_type_pair_relations'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in properties (list) - _items = [] - if self.properties: - for _item in self.properties: - if _item: - _items.append(_item.to_dict()) - _dict['properties'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of EdgeType from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type_id": obj.get("type_id"), - "type_name": obj.get("type_name"), - "vertex_type_pair_relations": [EdgeTypeVertexTypePairRelationsInner.from_dict(_item) for _item in obj.get("vertex_type_pair_relations")] if obj.get("vertex_type_pair_relations") is not None else None, - "properties": [ModelProperty.from_dict(_item) for _item in obj.get("properties")] if obj.get("properties") is not None else None - }) - return _obj - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_type_vertex_type_pair_relations_inner.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_type_vertex_type_pair_relations_inner.py deleted file mode 100644 index 6c141304a522..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_type_vertex_type_pair_relations_inner.py +++ /dev/null @@ -1,109 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr, field_validator -from hqps_client.models.edge_type_vertex_type_pair_relations_inner_x_csr_params import EdgeTypeVertexTypePairRelationsInnerXCsrParams -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class EdgeTypeVertexTypePairRelationsInner(BaseModel): - """ - EdgeTypeVertexTypePairRelationsInner - """ # noqa: E501 - source_vertex: Optional[StrictStr] = None - destination_vertex: Optional[StrictStr] = None - relation: Optional[StrictStr] = None - x_csr_params: Optional[EdgeTypeVertexTypePairRelationsInnerXCsrParams] = None - __properties: ClassVar[List[str]] = ["source_vertex", "destination_vertex", "relation", "x_csr_params"] - - @field_validator('relation') - def relation_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in ('MANY_TO_MANY', 'ONE_TO_MANY', 'MANY_TO_ONE', 'ONE_TO_ONE'): - raise ValueError("must be one of enum values ('MANY_TO_MANY', 'ONE_TO_MANY', 'MANY_TO_ONE', 'ONE_TO_ONE')") - return value - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of EdgeTypeVertexTypePairRelationsInner from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of x_csr_params - if self.x_csr_params: - _dict['x_csr_params'] = self.x_csr_params.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of EdgeTypeVertexTypePairRelationsInner from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "source_vertex": obj.get("source_vertex"), - "destination_vertex": obj.get("destination_vertex"), - "relation": obj.get("relation"), - "x_csr_params": EdgeTypeVertexTypePairRelationsInnerXCsrParams.from_dict(obj.get("x_csr_params")) if obj.get("x_csr_params") is not None else None - }) - return _obj - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_type_vertex_type_pair_relations_inner_x_csr_params.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_type_vertex_type_pair_relations_inner_x_csr_params.py deleted file mode 100644 index c1bcdff67b4c..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/edge_type_vertex_type_pair_relations_inner_x_csr_params.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr, field_validator -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class EdgeTypeVertexTypePairRelationsInnerXCsrParams(BaseModel): - """ - Used for storage optimization - """ # noqa: E501 - edge_storage_strategy: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["edge_storage_strategy"] - - @field_validator('edge_storage_strategy') - def edge_storage_strategy_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in ('ONLY_IN', 'ONLY_OUT', 'BOTH_OUT_IN'): - raise ValueError("must be one of enum values ('ONLY_IN', 'ONLY_OUT', 'BOTH_OUT_IN')") - return value - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of EdgeTypeVertexTypePairRelationsInnerXCsrParams from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of EdgeTypeVertexTypePairRelationsInnerXCsrParams from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "edge_storage_strategy": obj.get("edge_storage_strategy") - }) - return _obj - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/graph.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/graph.py deleted file mode 100644 index 496dd20e514a..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/graph.py +++ /dev/null @@ -1,114 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr, field_validator -from pydantic import Field -from hqps_client.models.graph_stored_procedures import GraphStoredProcedures -from hqps_client.models.model_schema import ModelSchema -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class Graph(BaseModel): - """ - Graph - """ # noqa: E501 - name: Optional[StrictStr] = None - store_type: Optional[StrictStr] = None - stored_procedures: Optional[GraphStoredProcedures] = None - var_schema: Optional[ModelSchema] = Field(default=None, alias="schema") - __properties: ClassVar[List[str]] = ["name", "store_type", "stored_procedures", "schema"] - - @field_validator('store_type') - def store_type_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in ('mutable_csr'): - raise ValueError("must be one of enum values ('mutable_csr')") - return value - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of Graph from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of stored_procedures - if self.stored_procedures: - _dict['stored_procedures'] = self.stored_procedures.to_dict() - # override the default output from pydantic by calling `to_dict()` of var_schema - if self.var_schema: - _dict['schema'] = self.var_schema.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of Graph from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name"), - "store_type": obj.get("store_type"), - "stored_procedures": GraphStoredProcedures.from_dict(obj.get("stored_procedures")) if obj.get("stored_procedures") is not None else None, - "schema": ModelSchema.from_dict(obj.get("schema")) if obj.get("schema") is not None else None - }) - return _obj - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/graph_stored_procedures.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/graph_stored_procedures.py deleted file mode 100644 index 94f37ebebc1e..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/graph_stored_procedures.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr, field_validator -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class GraphStoredProcedures(BaseModel): - """ - GraphStoredProcedures - """ # noqa: E501 - directory: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["directory"] - - @field_validator('directory') - def directory_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in ('plugins'): - raise ValueError("must be one of enum values ('plugins')") - return value - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of GraphStoredProcedures from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of GraphStoredProcedures from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "directory": obj.get("directory") - }) - return _obj - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/job_response.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/job_response.py deleted file mode 100644 index 78292eeb21c5..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/job_response.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class JobResponse(BaseModel): - """ - JobResponse - """ # noqa: E501 - job_id: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["job_id"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of JobResponse from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of JobResponse from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "job_id": obj.get("job_id") - }) - return _obj - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/job_status.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/job_status.py deleted file mode 100644 index 36a93a011e56..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/job_status.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt, StrictStr, field_validator -from pydantic import Field -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class JobStatus(BaseModel): - """ - JobStatus - """ # noqa: E501 - job_id: Optional[StrictStr] = None - type: Optional[StrictStr] = None - status: Optional[StrictStr] = None - start_time: Optional[StrictInt] = None - end_time: Optional[StrictInt] = None - log: Optional[StrictStr] = Field(default=None, description="URL or log string") - detail: Optional[Dict[str, Any]] = None - __properties: ClassVar[List[str]] = ["job_id", "type", "status", "start_time", "end_time", "log", "detail"] - - @field_validator('status') - def status_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in ('RUNNING', 'SUCCESS', 'FAILED', 'CANCELLED', 'WAITING'): - raise ValueError("must be one of enum values ('RUNNING', 'SUCCESS', 'FAILED', 'CANCELLED', 'WAITING')") - return value - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of JobStatus from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of JobStatus from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "job_id": obj.get("job_id"), - "type": obj.get("type"), - "status": obj.get("status"), - "start_time": obj.get("start_time"), - "end_time": obj.get("end_time"), - "log": obj.get("log"), - "detail": obj.get("detail") - }) - return _obj - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/model_property.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/model_property.py deleted file mode 100644 index 710d007f1527..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/model_property.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt, StrictStr -from hqps_client.models.property_property_type import PropertyPropertyType -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class ModelProperty(BaseModel): - """ - ModelProperty - """ # noqa: E501 - property_id: Optional[StrictInt] = None - property_name: Optional[StrictStr] = None - property_type: Optional[PropertyPropertyType] = None - __properties: ClassVar[List[str]] = ["property_id", "property_name", "property_type"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ModelProperty from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of property_type - if self.property_type: - _dict['property_type'] = self.property_type.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of ModelProperty from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "property_id": obj.get("property_id"), - "property_name": obj.get("property_name"), - "property_type": PropertyPropertyType.from_dict(obj.get("property_type")) if obj.get("property_type") is not None else None - }) - return _obj - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/model_schema.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/model_schema.py deleted file mode 100644 index ef00bffdca0d..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/model_schema.py +++ /dev/null @@ -1,107 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel -from hqps_client.models.edge_type import EdgeType -from hqps_client.models.vertex_type import VertexType -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class ModelSchema(BaseModel): - """ - ModelSchema - """ # noqa: E501 - vertex_types: Optional[List[VertexType]] = None - edge_types: Optional[List[EdgeType]] = None - __properties: ClassVar[List[str]] = ["vertex_types", "edge_types"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ModelSchema from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in vertex_types (list) - _items = [] - if self.vertex_types: - for _item in self.vertex_types: - if _item: - _items.append(_item.to_dict()) - _dict['vertex_types'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in edge_types (list) - _items = [] - if self.edge_types: - for _item in self.edge_types: - if _item: - _items.append(_item.to_dict()) - _dict['edge_types'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of ModelSchema from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "vertex_types": [VertexType.from_dict(_item) for _item in obj.get("vertex_types")] if obj.get("vertex_types") is not None else None, - "edge_types": [EdgeType.from_dict(_item) for _item in obj.get("edge_types")] if obj.get("edge_types") is not None else None - }) - return _obj - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/procedure.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/procedure.py deleted file mode 100644 index 9fee360e02a1..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/procedure.py +++ /dev/null @@ -1,130 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictBool, StrictStr, field_validator -from hqps_client.models.procedure_params_inner import ProcedureParamsInner -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class Procedure(BaseModel): - """ - Procedure - """ # noqa: E501 - name: Optional[StrictStr] = None - bound_graph: Optional[StrictStr] = None - description: Optional[StrictStr] = None - type: Optional[StrictStr] = None - query: Optional[StrictStr] = None - enable: Optional[StrictBool] = None - runnable: Optional[StrictBool] = None - params: Optional[List[ProcedureParamsInner]] = None - returns: Optional[List[ProcedureParamsInner]] = None - __properties: ClassVar[List[str]] = ["name", "bound_graph", "description", "type", "query", "enable", "runnable", "params", "returns"] - - @field_validator('type') - def type_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in ('cpp', 'cypher'): - raise ValueError("must be one of enum values ('cpp', 'cypher')") - return value - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of Procedure from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in params (list) - _items = [] - if self.params: - for _item in self.params: - if _item: - _items.append(_item.to_dict()) - _dict['params'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in returns (list) - _items = [] - if self.returns: - for _item in self.returns: - if _item: - _items.append(_item.to_dict()) - _dict['returns'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of Procedure from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name"), - "bound_graph": obj.get("bound_graph"), - "description": obj.get("description"), - "type": obj.get("type"), - "query": obj.get("query"), - "enable": obj.get("enable"), - "runnable": obj.get("runnable"), - "params": [ProcedureParamsInner.from_dict(_item) for _item in obj.get("params")] if obj.get("params") is not None else None, - "returns": [ProcedureParamsInner.from_dict(_item) for _item in obj.get("returns")] if obj.get("returns") is not None else None - }) - return _obj - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/procedure_params_inner.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/procedure_params_inner.py deleted file mode 100644 index 28d015335995..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/procedure_params_inner.py +++ /dev/null @@ -1,91 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class ProcedureParamsInner(BaseModel): - """ - ProcedureParamsInner - """ # noqa: E501 - name: Optional[StrictStr] = None - type: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["name", "type"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ProcedureParamsInner from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of ProcedureParamsInner from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name"), - "type": obj.get("type") - }) - return _obj - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/property_property_type.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/property_property_type.py deleted file mode 100644 index 6cd10092f5dd..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/property_property_type.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr, field_validator -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class PropertyPropertyType(BaseModel): - """ - Property type - """ # noqa: E501 - primitive_type: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["primitive_type"] - - @field_validator('primitive_type') - def primitive_type_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in ('DT_DOUBLE', 'DT_STRING', 'DT_SIGNED_INT32', 'DT_SIGNED_INT64', 'DT_DATE32'): - raise ValueError("must be one of enum values ('DT_DOUBLE', 'DT_STRING', 'DT_SIGNED_INT32', 'DT_SIGNED_INT64', 'DT_DATE32')") - return value - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of PropertyPropertyType from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of PropertyPropertyType from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "primitive_type": obj.get("primitive_type") - }) - return _obj - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/schema_mapping.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/schema_mapping.py deleted file mode 100644 index d533f83fc13d..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/schema_mapping.py +++ /dev/null @@ -1,115 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -from hqps_client.models.edge_mapping import EdgeMapping -from hqps_client.models.schema_mapping_loading_config import SchemaMappingLoadingConfig -from hqps_client.models.vertex_mapping import VertexMapping -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class SchemaMapping(BaseModel): - """ - SchemaMapping - """ # noqa: E501 - graph: Optional[StrictStr] = None - loading_config: Optional[SchemaMappingLoadingConfig] = None - vertex_mappings: Optional[List[VertexMapping]] = None - edge_mappings: Optional[List[EdgeMapping]] = None - __properties: ClassVar[List[str]] = ["graph", "loading_config", "vertex_mappings", "edge_mappings"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of SchemaMapping from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of loading_config - if self.loading_config: - _dict['loading_config'] = self.loading_config.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in vertex_mappings (list) - _items = [] - if self.vertex_mappings: - for _item in self.vertex_mappings: - if _item: - _items.append(_item.to_dict()) - _dict['vertex_mappings'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in edge_mappings (list) - _items = [] - if self.edge_mappings: - for _item in self.edge_mappings: - if _item: - _items.append(_item.to_dict()) - _dict['edge_mappings'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of SchemaMapping from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "graph": obj.get("graph"), - "loading_config": SchemaMappingLoadingConfig.from_dict(obj.get("loading_config")) if obj.get("loading_config") is not None else None, - "vertex_mappings": [VertexMapping.from_dict(_item) for _item in obj.get("vertex_mappings")] if obj.get("vertex_mappings") is not None else None, - "edge_mappings": [EdgeMapping.from_dict(_item) for _item in obj.get("edge_mappings")] if obj.get("edge_mappings") is not None else None - }) - return _obj - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/schema_mapping_loading_config.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/schema_mapping_loading_config.py deleted file mode 100644 index b3576ccfc82d..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/schema_mapping_loading_config.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr, field_validator -from hqps_client.models.schema_mapping_loading_config_data_source import SchemaMappingLoadingConfigDataSource -from hqps_client.models.schema_mapping_loading_config_format import SchemaMappingLoadingConfigFormat -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class SchemaMappingLoadingConfig(BaseModel): - """ - SchemaMappingLoadingConfig - """ # noqa: E501 - data_source: Optional[SchemaMappingLoadingConfigDataSource] = None - import_option: Optional[StrictStr] = None - format: Optional[SchemaMappingLoadingConfigFormat] = None - __properties: ClassVar[List[str]] = ["data_source", "import_option", "format"] - - @field_validator('import_option') - def import_option_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in ('init', 'overwrite'): - raise ValueError("must be one of enum values ('init', 'overwrite')") - return value - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of SchemaMappingLoadingConfig from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of data_source - if self.data_source: - _dict['data_source'] = self.data_source.to_dict() - # override the default output from pydantic by calling `to_dict()` of format - if self.format: - _dict['format'] = self.format.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of SchemaMappingLoadingConfig from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "data_source": SchemaMappingLoadingConfigDataSource.from_dict(obj.get("data_source")) if obj.get("data_source") is not None else None, - "import_option": obj.get("import_option"), - "format": SchemaMappingLoadingConfigFormat.from_dict(obj.get("format")) if obj.get("format") is not None else None - }) - return _obj - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/schema_mapping_loading_config_data_source.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/schema_mapping_loading_config_data_source.py deleted file mode 100644 index c29059f34d0d..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/schema_mapping_loading_config_data_source.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr, field_validator -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class SchemaMappingLoadingConfigDataSource(BaseModel): - """ - SchemaMappingLoadingConfigDataSource - """ # noqa: E501 - scheme: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["scheme"] - - @field_validator('scheme') - def scheme_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in ('file', 'oss', 's3', 'hdfs'): - raise ValueError("must be one of enum values ('file', 'oss', 's3', 'hdfs')") - return value - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of SchemaMappingLoadingConfigDataSource from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of SchemaMappingLoadingConfigDataSource from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "scheme": obj.get("scheme") - }) - return _obj - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/schema_mapping_loading_config_format.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/schema_mapping_loading_config_format.py deleted file mode 100644 index 5c5ad40d0f3f..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/schema_mapping_loading_config_format.py +++ /dev/null @@ -1,91 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class SchemaMappingLoadingConfigFormat(BaseModel): - """ - SchemaMappingLoadingConfigFormat - """ # noqa: E501 - type: Optional[StrictStr] = None - metadata: Optional[Dict[str, Any]] = None - __properties: ClassVar[List[str]] = ["type", "metadata"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of SchemaMappingLoadingConfigFormat from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of SchemaMappingLoadingConfigFormat from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type": obj.get("type"), - "metadata": obj.get("metadata") - }) - return _obj - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/service.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/service.py deleted file mode 100644 index 3770bf7c8c0d..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/service.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class Service(BaseModel): - """ - Service - """ # noqa: E501 - graph_name: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["graph_name"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of Service from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of Service from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "graph_name": obj.get("graph_name") - }) - return _obj - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/service_status.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/service_status.py deleted file mode 100644 index 5493c3d0c419..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/service_status.py +++ /dev/null @@ -1,95 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt, StrictStr -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class ServiceStatus(BaseModel): - """ - ServiceStatus - """ # noqa: E501 - status: Optional[StrictStr] = None - graph_name: Optional[StrictStr] = None - bolt_port: Optional[StrictInt] = None - hqps_port: Optional[StrictInt] = None - __properties: ClassVar[List[str]] = ["status", "graph_name", "bolt_port", "hqps_port"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of ServiceStatus from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of ServiceStatus from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "status": obj.get("status"), - "graph_name": obj.get("graph_name"), - "bolt_port": obj.get("bolt_port"), - "hqps_port": obj.get("hqps_port") - }) - return _obj - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/vertex_mapping.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/vertex_mapping.py deleted file mode 100644 index 83de7b5976e3..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/vertex_mapping.py +++ /dev/null @@ -1,101 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictStr -from hqps_client.models.column_mapping import ColumnMapping -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class VertexMapping(BaseModel): - """ - VertexMapping - """ # noqa: E501 - type_name: Optional[StrictStr] = None - inputs: Optional[List[StrictStr]] = None - column_mappings: Optional[List[ColumnMapping]] = None - __properties: ClassVar[List[str]] = ["type_name", "inputs", "column_mappings"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of VertexMapping from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in column_mappings (list) - _items = [] - if self.column_mappings: - for _item in self.column_mappings: - if _item: - _items.append(_item.to_dict()) - _dict['column_mappings'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of VertexMapping from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type_name": obj.get("type_name"), - "inputs": obj.get("inputs"), - "column_mappings": [ColumnMapping.from_dict(_item) for _item in obj.get("column_mappings")] if obj.get("column_mappings") is not None else None - }) - return _obj - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/vertex_type.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/vertex_type.py deleted file mode 100644 index bb796972ea79..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/models/vertex_type.py +++ /dev/null @@ -1,103 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - - -from typing import Any, ClassVar, Dict, List, Optional -from pydantic import BaseModel, StrictInt, StrictStr -from hqps_client.models.model_property import ModelProperty -try: - from typing import Self -except ImportError: - from typing_extensions import Self - -class VertexType(BaseModel): - """ - VertexType - """ # noqa: E501 - type_id: Optional[StrictInt] = None - type_name: Optional[StrictStr] = None - properties: Optional[List[ModelProperty]] = None - primary_keys: Optional[List[StrictStr]] = None - __properties: ClassVar[List[str]] = ["type_id", "type_name", "properties", "primary_keys"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of VertexType from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - _dict = self.model_dump( - by_alias=True, - exclude={ - }, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in properties (list) - _items = [] - if self.properties: - for _item in self.properties: - if _item: - _items.append(_item.to_dict()) - _dict['properties'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Dict) -> Self: - """Create an instance of VertexType from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "type_id": obj.get("type_id"), - "type_name": obj.get("type_name"), - "properties": [ModelProperty.from_dict(_item) for _item in obj.get("properties")] if obj.get("properties") is not None else None, - "primary_keys": obj.get("primary_keys") - }) - return _obj - - diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/py.typed b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/py.typed deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/rest.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/rest.py deleted file mode 100644 index ccdfd8fd6c01..000000000000 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps_client/rest.py +++ /dev/null @@ -1,268 +0,0 @@ -# coding: utf-8 - -""" - GraphScope Interactive API - - This is a specification for GraphScope Interactive 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](#) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import io -import json -import re -import ssl - -import urllib3 - -from hqps_client.exceptions import ApiException, ApiValueError - -SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} -RESTResponseType = urllib3.HTTPResponse - - -def is_socks_proxy_url(url): - if url is None: - return False - split_section = url.split("://") - if len(split_section) < 2: - return False - else: - return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES - - -class RESTResponse(io.IOBase): - - def __init__(self, resp) -> None: - self.response = resp - self.status = resp.status - self.reason = resp.reason - self.data = None - - def read(self): - if self.data is None: - self.data = self.response.data - return self.data - - def getheaders(self): - """Returns a dictionary of the response headers.""" - return self.response.headers - - def getheader(self, name, default=None): - """Returns a given response header.""" - return self.response.headers.get(name, default) - - -class RESTClientObject: - - def __init__(self, configuration) -> None: - # urllib3.PoolManager will pass all kw parameters to connectionpool - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 - - # cert_reqs - if configuration.verify_ssl: - cert_reqs = ssl.CERT_REQUIRED - else: - cert_reqs = ssl.CERT_NONE - - addition_pool_args = {} - if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = ( - configuration.assert_hostname - ) - - if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries - - if configuration.tls_server_name: - addition_pool_args['server_hostname'] = configuration.tls_server_name - - - if configuration.socket_options is not None: - addition_pool_args['socket_options'] = configuration.socket_options - - if configuration.connection_pool_maxsize is not None: - addition_pool_args['maxsize'] = configuration.connection_pool_maxsize - - # https pool manager - if configuration.proxy: - if is_socks_proxy_url(configuration.proxy): - from urllib3.contrib.socks import SOCKSProxyManager - self.pool_manager = SOCKSProxyManager( - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - headers=configuration.proxy_headers, - **addition_pool_args - ) - else: - self.pool_manager = urllib3.ProxyManager( - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args - ) - else: - self.pool_manager = urllib3.PoolManager( - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request( - self, - method, - url, - headers=None, - body=None, - post_params=None, - _request_timeout=None - ): - """Perform requests. - - :param method: http request method - :param url: http request url - :param headers: http request headers - :param body: request json body, for `application/json` - :param post_params: request post parameters, - `application/x-www-form-urlencoded` - and `multipart/form-data` - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - """ - method = method.upper() - assert method in [ - 'GET', - 'HEAD', - 'DELETE', - 'POST', - 'PUT', - 'PATCH', - 'OPTIONS' - ] - - if post_params and body: - raise ApiValueError( - "body parameter cannot be used with post_params parameter." - ) - - post_params = post_params or {} - headers = headers or {} - - timeout = None - if _request_timeout: - if isinstance(_request_timeout, (int, float)): - timeout = urllib3.Timeout(total=_request_timeout) - elif ( - isinstance(_request_timeout, tuple) - and len(_request_timeout) == 2 - ): - timeout = urllib3.Timeout( - connect=_request_timeout[0], - read=_request_timeout[1] - ) - - try: - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - - # no content type provided or payload is json - content_type = headers.get('Content-Type') - if ( - not content_type - or re.search('json', content_type, re.IGNORECASE) - ): - request_body = None - if body is not None: - request_body = json.dumps(body) - r = self.pool_manager.request( - method, - url, - body=request_body, - timeout=timeout, - headers=headers, - preload_content=False - ) - elif content_type == 'application/x-www-form-urlencoded': - r = self.pool_manager.request( - method, - url, - fields=post_params, - encode_multipart=False, - timeout=timeout, - headers=headers, - preload_content=False - ) - elif content_type == 'multipart/form-data': - # must del headers['Content-Type'], or the correct - # Content-Type which generated by urllib3 will be - # overwritten. - del headers['Content-Type'] - r = self.pool_manager.request( - method, - url, - fields=post_params, - encode_multipart=True, - timeout=timeout, - headers=headers, - preload_content=False - ) - # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form - elif isinstance(body, str) or isinstance(body, bytes): - request_body = body - r = self.pool_manager.request( - method, - url, - body=request_body, - timeout=timeout, - headers=headers, - preload_content=False - ) - elif headers['Content-Type'] == 'text/plain' and isinstance(body, bool): - request_body = "true" if body else "false" - r = self.pool_manager.request( - method, - url, - body=request_body, - preload_content=False, - timeout=timeout, - headers=headers) - else: - # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided - arguments. Please check that your arguments match - declared content type.""" - raise ApiException(status=0, reason=msg) - # For `GET`, `HEAD` - else: - r = self.pool_manager.request( - method, - url, - fields={}, - timeout=timeout, - headers=headers, - preload_content=False - ) - except urllib3.exceptions.SSLError as e: - msg = "\n".join([type(e).__name__, str(e)]) - raise ApiException(status=0, reason=msg) - - return RESTResponse(r) diff --git a/flex/coordinator/gs_flex_coordinator/models/__init__.py b/flex/coordinator/gs_flex_coordinator/models/__init__.py index 9bb175ee9366..499023bdac33 100644 --- a/flex/coordinator/gs_flex_coordinator/models/__init__.py +++ b/flex/coordinator/gs_flex_coordinator/models/__init__.py @@ -1,50 +1,55 @@ # flake8: noqa # import models into model package -from gs_flex_coordinator.models.alert_message import AlertMessage -from gs_flex_coordinator.models.alert_receiver import AlertReceiver -from gs_flex_coordinator.models.alert_rule import AlertRule +from gs_flex_coordinator.models.base_edge_type import BaseEdgeType +from gs_flex_coordinator.models.base_edge_type_vertex_type_pair_relations_inner import BaseEdgeTypeVertexTypePairRelationsInner +from gs_flex_coordinator.models.base_edge_type_vertex_type_pair_relations_inner_x_csr_params import BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams +from gs_flex_coordinator.models.base_property_meta import BasePropertyMeta +from gs_flex_coordinator.models.base_vertex_type import BaseVertexType +from gs_flex_coordinator.models.base_vertex_type_x_csr_params import BaseVertexTypeXCsrParams from gs_flex_coordinator.models.column_mapping import ColumnMapping -from gs_flex_coordinator.models.connection import Connection -from gs_flex_coordinator.models.connection_status import ConnectionStatus -from gs_flex_coordinator.models.data_source import DataSource -from gs_flex_coordinator.models.deployment_info import DeploymentInfo -from gs_flex_coordinator.models.deployment_info_graphs_info_value import DeploymentInfoGraphsInfoValue -from gs_flex_coordinator.models.deployment_status import DeploymentStatus -from gs_flex_coordinator.models.edge_data_source import EdgeDataSource +from gs_flex_coordinator.models.column_mapping_column import ColumnMappingColumn +from gs_flex_coordinator.models.create_alert_receiver_request import CreateAlertReceiverRequest +from gs_flex_coordinator.models.create_alert_rule_request import CreateAlertRuleRequest +from gs_flex_coordinator.models.create_dataloading_job_response import CreateDataloadingJobResponse +from gs_flex_coordinator.models.create_edge_type import CreateEdgeType +from gs_flex_coordinator.models.create_graph_request import CreateGraphRequest +from gs_flex_coordinator.models.create_graph_response import CreateGraphResponse +from gs_flex_coordinator.models.create_graph_schema_request import CreateGraphSchemaRequest +from gs_flex_coordinator.models.create_procedure_request import CreateProcedureRequest +from gs_flex_coordinator.models.create_procedure_response import CreateProcedureResponse +from gs_flex_coordinator.models.create_property_meta import CreatePropertyMeta +from gs_flex_coordinator.models.create_vertex_type import CreateVertexType +from gs_flex_coordinator.models.dataloading_job_config import DataloadingJobConfig +from gs_flex_coordinator.models.dataloading_job_config_edges_inner import DataloadingJobConfigEdgesInner +from gs_flex_coordinator.models.dataloading_job_config_loading_config import DataloadingJobConfigLoadingConfig +from gs_flex_coordinator.models.dataloading_job_config_loading_config_format import DataloadingJobConfigLoadingConfigFormat +from gs_flex_coordinator.models.dataloading_job_config_vertices_inner import DataloadingJobConfigVerticesInner from gs_flex_coordinator.models.edge_mapping import EdgeMapping -from gs_flex_coordinator.models.edge_mapping_destination_vertex_mappings_inner import EdgeMappingDestinationVertexMappingsInner -from gs_flex_coordinator.models.edge_mapping_source_vertex_mappings_inner import EdgeMappingSourceVertexMappingsInner -from gs_flex_coordinator.models.edge_mapping_source_vertex_mappings_inner_column import EdgeMappingSourceVertexMappingsInnerColumn from gs_flex_coordinator.models.edge_mapping_type_triplet import EdgeMappingTypeTriplet -from gs_flex_coordinator.models.edge_type import EdgeType -from gs_flex_coordinator.models.edge_type_vertex_type_pair_relations_inner import EdgeTypeVertexTypePairRelationsInner -from gs_flex_coordinator.models.edge_type_vertex_type_pair_relations_inner_x_csr_params import EdgeTypeVertexTypePairRelationsInnerXCsrParams -from gs_flex_coordinator.models.graph import Graph -from gs_flex_coordinator.models.graph_stored_procedures import GraphStoredProcedures -from gs_flex_coordinator.models.groot_dataloading_job_config import GrootDataloadingJobConfig -from gs_flex_coordinator.models.groot_dataloading_job_config_edges_inner import GrootDataloadingJobConfigEdgesInner -from gs_flex_coordinator.models.groot_edge_type import GrootEdgeType -from gs_flex_coordinator.models.groot_edge_type_relations_inner import GrootEdgeTypeRelationsInner -from gs_flex_coordinator.models.groot_graph import GrootGraph -from gs_flex_coordinator.models.groot_graph_gremlin_interface import GrootGraphGremlinInterface -from gs_flex_coordinator.models.groot_property import GrootProperty -from gs_flex_coordinator.models.groot_schema import GrootSchema -from gs_flex_coordinator.models.groot_vertex_type import GrootVertexType +from gs_flex_coordinator.models.error import Error +from gs_flex_coordinator.models.gs_data_type import GSDataType +from gs_flex_coordinator.models.get_alert_message_response import GetAlertMessageResponse +from gs_flex_coordinator.models.get_alert_receiver_response import GetAlertReceiverResponse +from gs_flex_coordinator.models.get_alert_rule_response import GetAlertRuleResponse +from gs_flex_coordinator.models.get_edge_type import GetEdgeType +from gs_flex_coordinator.models.get_graph_response import GetGraphResponse +from gs_flex_coordinator.models.get_graph_schema_response import GetGraphSchemaResponse +from gs_flex_coordinator.models.get_procedure_response import GetProcedureResponse +from gs_flex_coordinator.models.get_property_meta import GetPropertyMeta +from gs_flex_coordinator.models.get_vertex_type import GetVertexType from gs_flex_coordinator.models.job_status import JobStatus -from gs_flex_coordinator.models.model_property import ModelProperty -from gs_flex_coordinator.models.model_schema import ModelSchema -from gs_flex_coordinator.models.node_status import NodeStatus -from gs_flex_coordinator.models.procedure import Procedure -from gs_flex_coordinator.models.procedure_params_inner import ProcedureParamsInner -from gs_flex_coordinator.models.property_property_type import PropertyPropertyType +from gs_flex_coordinator.models.long_text import LongText +from gs_flex_coordinator.models.parameter import Parameter +from gs_flex_coordinator.models.primitive_type import PrimitiveType +from gs_flex_coordinator.models.running_deployment_info import RunningDeploymentInfo from gs_flex_coordinator.models.schema_mapping import SchemaMapping -from gs_flex_coordinator.models.schema_mapping_loading_config import SchemaMappingLoadingConfig -from gs_flex_coordinator.models.schema_mapping_loading_config_data_source import SchemaMappingLoadingConfigDataSource -from gs_flex_coordinator.models.schema_mapping_loading_config_format import SchemaMappingLoadingConfigFormat from gs_flex_coordinator.models.service_status import ServiceStatus from gs_flex_coordinator.models.service_status_sdk_endpoints import ServiceStatusSdkEndpoints from gs_flex_coordinator.models.start_service_request import StartServiceRequest -from gs_flex_coordinator.models.update_alert_messages_request import UpdateAlertMessagesRequest -from gs_flex_coordinator.models.vertex_data_source import VertexDataSource +from gs_flex_coordinator.models.stored_procedure_meta import StoredProcedureMeta +from gs_flex_coordinator.models.string_type import StringType +from gs_flex_coordinator.models.string_type_string import StringTypeString +from gs_flex_coordinator.models.update_alert_message_status_request import UpdateAlertMessageStatusRequest +from gs_flex_coordinator.models.update_procedure_request import UpdateProcedureRequest +from gs_flex_coordinator.models.upload_file_response import UploadFileResponse from gs_flex_coordinator.models.vertex_mapping import VertexMapping -from gs_flex_coordinator.models.vertex_type import VertexType diff --git a/flex/coordinator/gs_flex_coordinator/models/alert_receiver.py b/flex/coordinator/gs_flex_coordinator/models/alert_receiver.py deleted file mode 100644 index e566c5cc8853..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/alert_receiver.py +++ /dev/null @@ -1,227 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util - - -class AlertReceiver(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, type=None, receiver_id=None, webhook_url=None, at_user_ids=None, is_at_all=None, enable=None, message=None): # noqa: E501 - """AlertReceiver - a model defined in OpenAPI - - :param type: The type of this AlertReceiver. # noqa: E501 - :type type: str - :param receiver_id: The receiver_id of this AlertReceiver. # noqa: E501 - :type receiver_id: str - :param webhook_url: The webhook_url of this AlertReceiver. # noqa: E501 - :type webhook_url: str - :param at_user_ids: The at_user_ids of this AlertReceiver. # noqa: E501 - :type at_user_ids: List[str] - :param is_at_all: The is_at_all of this AlertReceiver. # noqa: E501 - :type is_at_all: bool - :param enable: The enable of this AlertReceiver. # noqa: E501 - :type enable: bool - :param message: The message of this AlertReceiver. # noqa: E501 - :type message: str - """ - self.openapi_types = { - 'type': str, - 'receiver_id': str, - 'webhook_url': str, - 'at_user_ids': List[str], - 'is_at_all': bool, - 'enable': bool, - 'message': str - } - - self.attribute_map = { - 'type': 'type', - 'receiver_id': 'receiver_id', - 'webhook_url': 'webhook_url', - 'at_user_ids': 'at_user_ids', - 'is_at_all': 'is_at_all', - 'enable': 'enable', - 'message': 'message' - } - - self._type = type - self._receiver_id = receiver_id - self._webhook_url = webhook_url - self._at_user_ids = at_user_ids - self._is_at_all = is_at_all - self._enable = enable - self._message = message - - @classmethod - def from_dict(cls, dikt) -> 'AlertReceiver': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The AlertReceiver of this AlertReceiver. # noqa: E501 - :rtype: AlertReceiver - """ - return util.deserialize_model(dikt, cls) - - @property - def type(self) -> str: - """Gets the type of this AlertReceiver. - - - :return: The type of this AlertReceiver. - :rtype: str - """ - return self._type - - @type.setter - def type(self, type: str): - """Sets the type of this AlertReceiver. - - - :param type: The type of this AlertReceiver. - :type type: str - """ - allowed_values = ["webhook"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" - .format(type, allowed_values) - ) - - self._type = type - - @property - def receiver_id(self) -> str: - """Gets the receiver_id of this AlertReceiver. - - Generated in server side # noqa: E501 - - :return: The receiver_id of this AlertReceiver. - :rtype: str - """ - return self._receiver_id - - @receiver_id.setter - def receiver_id(self, receiver_id: str): - """Sets the receiver_id of this AlertReceiver. - - Generated in server side # noqa: E501 - - :param receiver_id: The receiver_id of this AlertReceiver. - :type receiver_id: str - """ - - self._receiver_id = receiver_id - - @property - def webhook_url(self) -> str: - """Gets the webhook_url of this AlertReceiver. - - - :return: The webhook_url of this AlertReceiver. - :rtype: str - """ - return self._webhook_url - - @webhook_url.setter - def webhook_url(self, webhook_url: str): - """Sets the webhook_url of this AlertReceiver. - - - :param webhook_url: The webhook_url of this AlertReceiver. - :type webhook_url: str - """ - - self._webhook_url = webhook_url - - @property - def at_user_ids(self) -> List[str]: - """Gets the at_user_ids of this AlertReceiver. - - - :return: The at_user_ids of this AlertReceiver. - :rtype: List[str] - """ - return self._at_user_ids - - @at_user_ids.setter - def at_user_ids(self, at_user_ids: List[str]): - """Sets the at_user_ids of this AlertReceiver. - - - :param at_user_ids: The at_user_ids of this AlertReceiver. - :type at_user_ids: List[str] - """ - - self._at_user_ids = at_user_ids - - @property - def is_at_all(self) -> bool: - """Gets the is_at_all of this AlertReceiver. - - - :return: The is_at_all of this AlertReceiver. - :rtype: bool - """ - return self._is_at_all - - @is_at_all.setter - def is_at_all(self, is_at_all: bool): - """Sets the is_at_all of this AlertReceiver. - - - :param is_at_all: The is_at_all of this AlertReceiver. - :type is_at_all: bool - """ - - self._is_at_all = is_at_all - - @property - def enable(self) -> bool: - """Gets the enable of this AlertReceiver. - - - :return: The enable of this AlertReceiver. - :rtype: bool - """ - return self._enable - - @enable.setter - def enable(self, enable: bool): - """Sets the enable of this AlertReceiver. - - - :param enable: The enable of this AlertReceiver. - :type enable: bool - """ - - self._enable = enable - - @property - def message(self) -> str: - """Gets the message of this AlertReceiver. - - error message generated in server side # noqa: E501 - - :return: The message of this AlertReceiver. - :rtype: str - """ - return self._message - - @message.setter - def message(self, message: str): - """Sets the message of this AlertReceiver. - - error message generated in server side # noqa: E501 - - :param message: The message of this AlertReceiver. - :type message: str - """ - - self._message = message diff --git a/flex/coordinator/gs_flex_coordinator/models/base_edge_type.py b/flex/coordinator/gs_flex_coordinator/models/base_edge_type.py new file mode 100644 index 000000000000..dcf91e83a4fa --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/base_edge_type.py @@ -0,0 +1,145 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator.models.base_edge_type_vertex_type_pair_relations_inner import BaseEdgeTypeVertexTypePairRelationsInner +from gs_flex_coordinator import util + +from gs_flex_coordinator.models.base_edge_type_vertex_type_pair_relations_inner import BaseEdgeTypeVertexTypePairRelationsInner # noqa: E501 + +class BaseEdgeType(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, type_name=None, vertex_type_pair_relations=None, directed=None, primary_keys=None): # noqa: E501 + """BaseEdgeType - a model defined in OpenAPI + + :param type_name: The type_name of this BaseEdgeType. # noqa: E501 + :type type_name: str + :param vertex_type_pair_relations: The vertex_type_pair_relations of this BaseEdgeType. # noqa: E501 + :type vertex_type_pair_relations: List[BaseEdgeTypeVertexTypePairRelationsInner] + :param directed: The directed of this BaseEdgeType. # noqa: E501 + :type directed: bool + :param primary_keys: The primary_keys of this BaseEdgeType. # noqa: E501 + :type primary_keys: List[str] + """ + self.openapi_types = { + 'type_name': str, + 'vertex_type_pair_relations': List[BaseEdgeTypeVertexTypePairRelationsInner], + 'directed': bool, + 'primary_keys': List[str] + } + + self.attribute_map = { + 'type_name': 'type_name', + 'vertex_type_pair_relations': 'vertex_type_pair_relations', + 'directed': 'directed', + 'primary_keys': 'primary_keys' + } + + self._type_name = type_name + self._vertex_type_pair_relations = vertex_type_pair_relations + self._directed = directed + self._primary_keys = primary_keys + + @classmethod + def from_dict(cls, dikt) -> 'BaseEdgeType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The BaseEdgeType of this BaseEdgeType. # noqa: E501 + :rtype: BaseEdgeType + """ + return util.deserialize_model(dikt, cls) + + @property + def type_name(self) -> str: + """Gets the type_name of this BaseEdgeType. + + + :return: The type_name of this BaseEdgeType. + :rtype: str + """ + return self._type_name + + @type_name.setter + def type_name(self, type_name: str): + """Sets the type_name of this BaseEdgeType. + + + :param type_name: The type_name of this BaseEdgeType. + :type type_name: str + """ + if type_name is None: + raise ValueError("Invalid value for `type_name`, must not be `None`") # noqa: E501 + + self._type_name = type_name + + @property + def vertex_type_pair_relations(self) -> List[BaseEdgeTypeVertexTypePairRelationsInner]: + """Gets the vertex_type_pair_relations of this BaseEdgeType. + + + :return: The vertex_type_pair_relations of this BaseEdgeType. + :rtype: List[BaseEdgeTypeVertexTypePairRelationsInner] + """ + return self._vertex_type_pair_relations + + @vertex_type_pair_relations.setter + def vertex_type_pair_relations(self, vertex_type_pair_relations: List[BaseEdgeTypeVertexTypePairRelationsInner]): + """Sets the vertex_type_pair_relations of this BaseEdgeType. + + + :param vertex_type_pair_relations: The vertex_type_pair_relations of this BaseEdgeType. + :type vertex_type_pair_relations: List[BaseEdgeTypeVertexTypePairRelationsInner] + """ + if vertex_type_pair_relations is None: + raise ValueError("Invalid value for `vertex_type_pair_relations`, must not be `None`") # noqa: E501 + + self._vertex_type_pair_relations = vertex_type_pair_relations + + @property + def directed(self) -> bool: + """Gets the directed of this BaseEdgeType. + + + :return: The directed of this BaseEdgeType. + :rtype: bool + """ + return self._directed + + @directed.setter + def directed(self, directed: bool): + """Sets the directed of this BaseEdgeType. + + + :param directed: The directed of this BaseEdgeType. + :type directed: bool + """ + + self._directed = directed + + @property + def primary_keys(self) -> List[str]: + """Gets the primary_keys of this BaseEdgeType. + + + :return: The primary_keys of this BaseEdgeType. + :rtype: List[str] + """ + return self._primary_keys + + @primary_keys.setter + def primary_keys(self, primary_keys: List[str]): + """Sets the primary_keys of this BaseEdgeType. + + + :param primary_keys: The primary_keys of this BaseEdgeType. + :type primary_keys: List[str] + """ + + self._primary_keys = primary_keys diff --git a/flex/coordinator/gs_flex_coordinator/models/base_edge_type_vertex_type_pair_relations_inner.py b/flex/coordinator/gs_flex_coordinator/models/base_edge_type_vertex_type_pair_relations_inner.py new file mode 100644 index 000000000000..8b8ea903f548 --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/base_edge_type_vertex_type_pair_relations_inner.py @@ -0,0 +1,151 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator.models.base_edge_type_vertex_type_pair_relations_inner_x_csr_params import BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams +from gs_flex_coordinator import util + +from gs_flex_coordinator.models.base_edge_type_vertex_type_pair_relations_inner_x_csr_params import BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams # noqa: E501 + +class BaseEdgeTypeVertexTypePairRelationsInner(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, source_vertex=None, destination_vertex=None, relation=None, x_csr_params=None): # noqa: E501 + """BaseEdgeTypeVertexTypePairRelationsInner - a model defined in OpenAPI + + :param source_vertex: The source_vertex of this BaseEdgeTypeVertexTypePairRelationsInner. # noqa: E501 + :type source_vertex: str + :param destination_vertex: The destination_vertex of this BaseEdgeTypeVertexTypePairRelationsInner. # noqa: E501 + :type destination_vertex: str + :param relation: The relation of this BaseEdgeTypeVertexTypePairRelationsInner. # noqa: E501 + :type relation: str + :param x_csr_params: The x_csr_params of this BaseEdgeTypeVertexTypePairRelationsInner. # noqa: E501 + :type x_csr_params: BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams + """ + self.openapi_types = { + 'source_vertex': str, + 'destination_vertex': str, + 'relation': str, + 'x_csr_params': BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams + } + + self.attribute_map = { + 'source_vertex': 'source_vertex', + 'destination_vertex': 'destination_vertex', + 'relation': 'relation', + 'x_csr_params': 'x_csr_params' + } + + self._source_vertex = source_vertex + self._destination_vertex = destination_vertex + self._relation = relation + self._x_csr_params = x_csr_params + + @classmethod + def from_dict(cls, dikt) -> 'BaseEdgeTypeVertexTypePairRelationsInner': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The BaseEdgeType_vertex_type_pair_relations_inner of this BaseEdgeTypeVertexTypePairRelationsInner. # noqa: E501 + :rtype: BaseEdgeTypeVertexTypePairRelationsInner + """ + return util.deserialize_model(dikt, cls) + + @property + def source_vertex(self) -> str: + """Gets the source_vertex of this BaseEdgeTypeVertexTypePairRelationsInner. + + + :return: The source_vertex of this BaseEdgeTypeVertexTypePairRelationsInner. + :rtype: str + """ + return self._source_vertex + + @source_vertex.setter + def source_vertex(self, source_vertex: str): + """Sets the source_vertex of this BaseEdgeTypeVertexTypePairRelationsInner. + + + :param source_vertex: The source_vertex of this BaseEdgeTypeVertexTypePairRelationsInner. + :type source_vertex: str + """ + if source_vertex is None: + raise ValueError("Invalid value for `source_vertex`, must not be `None`") # noqa: E501 + + self._source_vertex = source_vertex + + @property + def destination_vertex(self) -> str: + """Gets the destination_vertex of this BaseEdgeTypeVertexTypePairRelationsInner. + + + :return: The destination_vertex of this BaseEdgeTypeVertexTypePairRelationsInner. + :rtype: str + """ + return self._destination_vertex + + @destination_vertex.setter + def destination_vertex(self, destination_vertex: str): + """Sets the destination_vertex of this BaseEdgeTypeVertexTypePairRelationsInner. + + + :param destination_vertex: The destination_vertex of this BaseEdgeTypeVertexTypePairRelationsInner. + :type destination_vertex: str + """ + if destination_vertex is None: + raise ValueError("Invalid value for `destination_vertex`, must not be `None`") # noqa: E501 + + self._destination_vertex = destination_vertex + + @property + def relation(self) -> str: + """Gets the relation of this BaseEdgeTypeVertexTypePairRelationsInner. + + + :return: The relation of this BaseEdgeTypeVertexTypePairRelationsInner. + :rtype: str + """ + return self._relation + + @relation.setter + def relation(self, relation: str): + """Sets the relation of this BaseEdgeTypeVertexTypePairRelationsInner. + + + :param relation: The relation of this BaseEdgeTypeVertexTypePairRelationsInner. + :type relation: str + """ + allowed_values = ["MANY_TO_MANY", "ONE_TO_MANY", "MANY_TO_ONE", "ONE_TO_ONE"] # noqa: E501 + if relation not in allowed_values: + raise ValueError( + "Invalid value for `relation` ({0}), must be one of {1}" + .format(relation, allowed_values) + ) + + self._relation = relation + + @property + def x_csr_params(self) -> BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams: + """Gets the x_csr_params of this BaseEdgeTypeVertexTypePairRelationsInner. + + + :return: The x_csr_params of this BaseEdgeTypeVertexTypePairRelationsInner. + :rtype: BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams + """ + return self._x_csr_params + + @x_csr_params.setter + def x_csr_params(self, x_csr_params: BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams): + """Sets the x_csr_params of this BaseEdgeTypeVertexTypePairRelationsInner. + + + :param x_csr_params: The x_csr_params of this BaseEdgeTypeVertexTypePairRelationsInner. + :type x_csr_params: BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams + """ + + self._x_csr_params = x_csr_params diff --git a/flex/coordinator/gs_flex_coordinator/models/edge_type_vertex_type_pair_relations_inner_x_csr_params.py b/flex/coordinator/gs_flex_coordinator/models/base_edge_type_vertex_type_pair_relations_inner_x_csr_params.py similarity index 64% rename from flex/coordinator/gs_flex_coordinator/models/edge_type_vertex_type_pair_relations_inner_x_csr_params.py rename to flex/coordinator/gs_flex_coordinator/models/base_edge_type_vertex_type_pair_relations_inner_x_csr_params.py index 2b890b98287e..f57d268f862f 100644 --- a/flex/coordinator/gs_flex_coordinator/models/edge_type_vertex_type_pair_relations_inner_x_csr_params.py +++ b/flex/coordinator/gs_flex_coordinator/models/base_edge_type_vertex_type_pair_relations_inner_x_csr_params.py @@ -6,16 +6,16 @@ from gs_flex_coordinator import util -class EdgeTypeVertexTypePairRelationsInnerXCsrParams(Model): +class BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. """ def __init__(self, edge_storage_strategy=None): # noqa: E501 - """EdgeTypeVertexTypePairRelationsInnerXCsrParams - a model defined in OpenAPI + """BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams - a model defined in OpenAPI - :param edge_storage_strategy: The edge_storage_strategy of this EdgeTypeVertexTypePairRelationsInnerXCsrParams. # noqa: E501 + :param edge_storage_strategy: The edge_storage_strategy of this BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams. # noqa: E501 :type edge_storage_strategy: str """ self.openapi_types = { @@ -29,32 +29,32 @@ def __init__(self, edge_storage_strategy=None): # noqa: E501 self._edge_storage_strategy = edge_storage_strategy @classmethod - def from_dict(cls, dikt) -> 'EdgeTypeVertexTypePairRelationsInnerXCsrParams': + def from_dict(cls, dikt) -> 'BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams': """Returns the dict as a model :param dikt: A dict. :type: dict - :return: The EdgeType_vertex_type_pair_relations_inner_x_csr_params of this EdgeTypeVertexTypePairRelationsInnerXCsrParams. # noqa: E501 - :rtype: EdgeTypeVertexTypePairRelationsInnerXCsrParams + :return: The BaseEdgeType_vertex_type_pair_relations_inner_x_csr_params of this BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams. # noqa: E501 + :rtype: BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams """ return util.deserialize_model(dikt, cls) @property def edge_storage_strategy(self) -> str: - """Gets the edge_storage_strategy of this EdgeTypeVertexTypePairRelationsInnerXCsrParams. + """Gets the edge_storage_strategy of this BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams. - :return: The edge_storage_strategy of this EdgeTypeVertexTypePairRelationsInnerXCsrParams. + :return: The edge_storage_strategy of this BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams. :rtype: str """ return self._edge_storage_strategy @edge_storage_strategy.setter def edge_storage_strategy(self, edge_storage_strategy: str): - """Sets the edge_storage_strategy of this EdgeTypeVertexTypePairRelationsInnerXCsrParams. + """Sets the edge_storage_strategy of this BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams. - :param edge_storage_strategy: The edge_storage_strategy of this EdgeTypeVertexTypePairRelationsInnerXCsrParams. + :param edge_storage_strategy: The edge_storage_strategy of this BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams. :type edge_storage_strategy: str """ allowed_values = ["ONLY_IN", "ONLY_OUT", "BOTH_OUT_IN"] # noqa: E501 diff --git a/flex/coordinator/gs_flex_coordinator/models/base_property_meta.py b/flex/coordinator/gs_flex_coordinator/models/base_property_meta.py new file mode 100644 index 000000000000..49206c873b2b --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/base_property_meta.py @@ -0,0 +1,171 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator.models.gs_data_type import GSDataType +from gs_flex_coordinator import util + +from gs_flex_coordinator.models.gs_data_type import GSDataType # noqa: E501 + +class BasePropertyMeta(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, property_name=None, property_type=None, nullable=None, default_value=None, description=None): # noqa: E501 + """BasePropertyMeta - a model defined in OpenAPI + + :param property_name: The property_name of this BasePropertyMeta. # noqa: E501 + :type property_name: str + :param property_type: The property_type of this BasePropertyMeta. # noqa: E501 + :type property_type: GSDataType + :param nullable: The nullable of this BasePropertyMeta. # noqa: E501 + :type nullable: bool + :param default_value: The default_value of this BasePropertyMeta. # noqa: E501 + :type default_value: object + :param description: The description of this BasePropertyMeta. # noqa: E501 + :type description: str + """ + self.openapi_types = { + 'property_name': str, + 'property_type': GSDataType, + 'nullable': bool, + 'default_value': object, + 'description': str + } + + self.attribute_map = { + 'property_name': 'property_name', + 'property_type': 'property_type', + 'nullable': 'nullable', + 'default_value': 'default_value', + 'description': 'description' + } + + self._property_name = property_name + self._property_type = property_type + self._nullable = nullable + self._default_value = default_value + self._description = description + + @classmethod + def from_dict(cls, dikt) -> 'BasePropertyMeta': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The BasePropertyMeta of this BasePropertyMeta. # noqa: E501 + :rtype: BasePropertyMeta + """ + return util.deserialize_model(dikt, cls) + + @property + def property_name(self) -> str: + """Gets the property_name of this BasePropertyMeta. + + + :return: The property_name of this BasePropertyMeta. + :rtype: str + """ + return self._property_name + + @property_name.setter + def property_name(self, property_name: str): + """Sets the property_name of this BasePropertyMeta. + + + :param property_name: The property_name of this BasePropertyMeta. + :type property_name: str + """ + if property_name is None: + raise ValueError("Invalid value for `property_name`, must not be `None`") # noqa: E501 + + self._property_name = property_name + + @property + def property_type(self) -> GSDataType: + """Gets the property_type of this BasePropertyMeta. + + + :return: The property_type of this BasePropertyMeta. + :rtype: GSDataType + """ + return self._property_type + + @property_type.setter + def property_type(self, property_type: GSDataType): + """Sets the property_type of this BasePropertyMeta. + + + :param property_type: The property_type of this BasePropertyMeta. + :type property_type: GSDataType + """ + if property_type is None: + raise ValueError("Invalid value for `property_type`, must not be `None`") # noqa: E501 + + self._property_type = property_type + + @property + def nullable(self) -> bool: + """Gets the nullable of this BasePropertyMeta. + + + :return: The nullable of this BasePropertyMeta. + :rtype: bool + """ + return self._nullable + + @nullable.setter + def nullable(self, nullable: bool): + """Sets the nullable of this BasePropertyMeta. + + + :param nullable: The nullable of this BasePropertyMeta. + :type nullable: bool + """ + + self._nullable = nullable + + @property + def default_value(self) -> object: + """Gets the default_value of this BasePropertyMeta. + + + :return: The default_value of this BasePropertyMeta. + :rtype: object + """ + return self._default_value + + @default_value.setter + def default_value(self, default_value: object): + """Sets the default_value of this BasePropertyMeta. + + + :param default_value: The default_value of this BasePropertyMeta. + :type default_value: object + """ + + self._default_value = default_value + + @property + def description(self) -> str: + """Gets the description of this BasePropertyMeta. + + + :return: The description of this BasePropertyMeta. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description: str): + """Sets the description of this BasePropertyMeta. + + + :param description: The description of this BasePropertyMeta. + :type description: str + """ + + self._description = description diff --git a/flex/coordinator/gs_flex_coordinator/models/base_vertex_type.py b/flex/coordinator/gs_flex_coordinator/models/base_vertex_type.py new file mode 100644 index 000000000000..8e57ff85dced --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/base_vertex_type.py @@ -0,0 +1,119 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator.models.base_vertex_type_x_csr_params import BaseVertexTypeXCsrParams +from gs_flex_coordinator import util + +from gs_flex_coordinator.models.base_vertex_type_x_csr_params import BaseVertexTypeXCsrParams # noqa: E501 + +class BaseVertexType(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, type_name=None, primary_keys=None, x_csr_params=None): # noqa: E501 + """BaseVertexType - a model defined in OpenAPI + + :param type_name: The type_name of this BaseVertexType. # noqa: E501 + :type type_name: str + :param primary_keys: The primary_keys of this BaseVertexType. # noqa: E501 + :type primary_keys: List[str] + :param x_csr_params: The x_csr_params of this BaseVertexType. # noqa: E501 + :type x_csr_params: BaseVertexTypeXCsrParams + """ + self.openapi_types = { + 'type_name': str, + 'primary_keys': List[str], + 'x_csr_params': BaseVertexTypeXCsrParams + } + + self.attribute_map = { + 'type_name': 'type_name', + 'primary_keys': 'primary_keys', + 'x_csr_params': 'x_csr_params' + } + + self._type_name = type_name + self._primary_keys = primary_keys + self._x_csr_params = x_csr_params + + @classmethod + def from_dict(cls, dikt) -> 'BaseVertexType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The BaseVertexType of this BaseVertexType. # noqa: E501 + :rtype: BaseVertexType + """ + return util.deserialize_model(dikt, cls) + + @property + def type_name(self) -> str: + """Gets the type_name of this BaseVertexType. + + + :return: The type_name of this BaseVertexType. + :rtype: str + """ + return self._type_name + + @type_name.setter + def type_name(self, type_name: str): + """Sets the type_name of this BaseVertexType. + + + :param type_name: The type_name of this BaseVertexType. + :type type_name: str + """ + if type_name is None: + raise ValueError("Invalid value for `type_name`, must not be `None`") # noqa: E501 + + self._type_name = type_name + + @property + def primary_keys(self) -> List[str]: + """Gets the primary_keys of this BaseVertexType. + + + :return: The primary_keys of this BaseVertexType. + :rtype: List[str] + """ + return self._primary_keys + + @primary_keys.setter + def primary_keys(self, primary_keys: List[str]): + """Sets the primary_keys of this BaseVertexType. + + + :param primary_keys: The primary_keys of this BaseVertexType. + :type primary_keys: List[str] + """ + if primary_keys is None: + raise ValueError("Invalid value for `primary_keys`, must not be `None`") # noqa: E501 + + self._primary_keys = primary_keys + + @property + def x_csr_params(self) -> BaseVertexTypeXCsrParams: + """Gets the x_csr_params of this BaseVertexType. + + + :return: The x_csr_params of this BaseVertexType. + :rtype: BaseVertexTypeXCsrParams + """ + return self._x_csr_params + + @x_csr_params.setter + def x_csr_params(self, x_csr_params: BaseVertexTypeXCsrParams): + """Sets the x_csr_params of this BaseVertexType. + + + :param x_csr_params: The x_csr_params of this BaseVertexType. + :type x_csr_params: BaseVertexTypeXCsrParams + """ + + self._x_csr_params = x_csr_params diff --git a/flex/coordinator/gs_flex_coordinator/models/base_vertex_type_x_csr_params.py b/flex/coordinator/gs_flex_coordinator/models/base_vertex_type_x_csr_params.py new file mode 100644 index 000000000000..2972e19b8492 --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/base_vertex_type_x_csr_params.py @@ -0,0 +1,61 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator import util + + +class BaseVertexTypeXCsrParams(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, max_vertex_num=None): # noqa: E501 + """BaseVertexTypeXCsrParams - a model defined in OpenAPI + + :param max_vertex_num: The max_vertex_num of this BaseVertexTypeXCsrParams. # noqa: E501 + :type max_vertex_num: int + """ + self.openapi_types = { + 'max_vertex_num': int + } + + self.attribute_map = { + 'max_vertex_num': 'max_vertex_num' + } + + self._max_vertex_num = max_vertex_num + + @classmethod + def from_dict(cls, dikt) -> 'BaseVertexTypeXCsrParams': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The BaseVertexType_x_csr_params of this BaseVertexTypeXCsrParams. # noqa: E501 + :rtype: BaseVertexTypeXCsrParams + """ + return util.deserialize_model(dikt, cls) + + @property + def max_vertex_num(self) -> int: + """Gets the max_vertex_num of this BaseVertexTypeXCsrParams. + + + :return: The max_vertex_num of this BaseVertexTypeXCsrParams. + :rtype: int + """ + return self._max_vertex_num + + @max_vertex_num.setter + def max_vertex_num(self, max_vertex_num: int): + """Sets the max_vertex_num of this BaseVertexTypeXCsrParams. + + + :param max_vertex_num: The max_vertex_num of this BaseVertexTypeXCsrParams. + :type max_vertex_num: int + """ + + self._max_vertex_num = max_vertex_num diff --git a/flex/coordinator/gs_flex_coordinator/models/column_mapping.py b/flex/coordinator/gs_flex_coordinator/models/column_mapping.py index 545f3f126ab7..642465f1bcc3 100644 --- a/flex/coordinator/gs_flex_coordinator/models/column_mapping.py +++ b/flex/coordinator/gs_flex_coordinator/models/column_mapping.py @@ -3,10 +3,10 @@ from typing import List, Dict # noqa: F401 from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.edge_mapping_source_vertex_mappings_inner_column import EdgeMappingSourceVertexMappingsInnerColumn +from gs_flex_coordinator.models.column_mapping_column import ColumnMappingColumn from gs_flex_coordinator import util -from gs_flex_coordinator.models.edge_mapping_source_vertex_mappings_inner_column import EdgeMappingSourceVertexMappingsInnerColumn # noqa: E501 +from gs_flex_coordinator.models.column_mapping_column import ColumnMappingColumn # noqa: E501 class ColumnMapping(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -18,12 +18,12 @@ def __init__(self, column=None, _property=None): # noqa: E501 """ColumnMapping - a model defined in OpenAPI :param column: The column of this ColumnMapping. # noqa: E501 - :type column: EdgeMappingSourceVertexMappingsInnerColumn + :type column: ColumnMappingColumn :param _property: The _property of this ColumnMapping. # noqa: E501 :type _property: str """ self.openapi_types = { - 'column': EdgeMappingSourceVertexMappingsInnerColumn, + 'column': ColumnMappingColumn, '_property': str } @@ -47,23 +47,25 @@ def from_dict(cls, dikt) -> 'ColumnMapping': return util.deserialize_model(dikt, cls) @property - def column(self) -> EdgeMappingSourceVertexMappingsInnerColumn: + def column(self) -> ColumnMappingColumn: """Gets the column of this ColumnMapping. :return: The column of this ColumnMapping. - :rtype: EdgeMappingSourceVertexMappingsInnerColumn + :rtype: ColumnMappingColumn """ return self._column @column.setter - def column(self, column: EdgeMappingSourceVertexMappingsInnerColumn): + def column(self, column: ColumnMappingColumn): """Sets the column of this ColumnMapping. :param column: The column of this ColumnMapping. - :type column: EdgeMappingSourceVertexMappingsInnerColumn + :type column: ColumnMappingColumn """ + if column is None: + raise ValueError("Invalid value for `column`, must not be `None`") # noqa: E501 self._column = column @@ -87,5 +89,7 @@ def _property(self, _property: str): :param _property: The _property of this ColumnMapping. :type _property: str """ + if _property is None: + raise ValueError("Invalid value for `_property`, must not be `None`") # noqa: E501 self.__property = _property diff --git a/flex/coordinator/gs_flex_coordinator/models/edge_mapping_source_vertex_mappings_inner_column.py b/flex/coordinator/gs_flex_coordinator/models/column_mapping_column.py similarity index 51% rename from flex/coordinator/gs_flex_coordinator/models/edge_mapping_source_vertex_mappings_inner_column.py rename to flex/coordinator/gs_flex_coordinator/models/column_mapping_column.py index bb3d0093e3d6..2334ce2cee50 100644 --- a/flex/coordinator/gs_flex_coordinator/models/edge_mapping_source_vertex_mappings_inner_column.py +++ b/flex/coordinator/gs_flex_coordinator/models/column_mapping_column.py @@ -6,18 +6,18 @@ from gs_flex_coordinator import util -class EdgeMappingSourceVertexMappingsInnerColumn(Model): +class ColumnMappingColumn(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. """ def __init__(self, index=None, name=None): # noqa: E501 - """EdgeMappingSourceVertexMappingsInnerColumn - a model defined in OpenAPI + """ColumnMappingColumn - a model defined in OpenAPI - :param index: The index of this EdgeMappingSourceVertexMappingsInnerColumn. # noqa: E501 + :param index: The index of this ColumnMappingColumn. # noqa: E501 :type index: int - :param name: The name of this EdgeMappingSourceVertexMappingsInnerColumn. # noqa: E501 + :param name: The name of this ColumnMappingColumn. # noqa: E501 :type name: str """ self.openapi_types = { @@ -34,32 +34,32 @@ def __init__(self, index=None, name=None): # noqa: E501 self._name = name @classmethod - def from_dict(cls, dikt) -> 'EdgeMappingSourceVertexMappingsInnerColumn': + def from_dict(cls, dikt) -> 'ColumnMappingColumn': """Returns the dict as a model :param dikt: A dict. :type: dict - :return: The EdgeMapping_source_vertex_mappings_inner_column of this EdgeMappingSourceVertexMappingsInnerColumn. # noqa: E501 - :rtype: EdgeMappingSourceVertexMappingsInnerColumn + :return: The ColumnMapping_column of this ColumnMappingColumn. # noqa: E501 + :rtype: ColumnMappingColumn """ return util.deserialize_model(dikt, cls) @property def index(self) -> int: - """Gets the index of this EdgeMappingSourceVertexMappingsInnerColumn. + """Gets the index of this ColumnMappingColumn. - :return: The index of this EdgeMappingSourceVertexMappingsInnerColumn. + :return: The index of this ColumnMappingColumn. :rtype: int """ return self._index @index.setter def index(self, index: int): - """Sets the index of this EdgeMappingSourceVertexMappingsInnerColumn. + """Sets the index of this ColumnMappingColumn. - :param index: The index of this EdgeMappingSourceVertexMappingsInnerColumn. + :param index: The index of this ColumnMappingColumn. :type index: int """ @@ -67,20 +67,20 @@ def index(self, index: int): @property def name(self) -> str: - """Gets the name of this EdgeMappingSourceVertexMappingsInnerColumn. + """Gets the name of this ColumnMappingColumn. - :return: The name of this EdgeMappingSourceVertexMappingsInnerColumn. + :return: The name of this ColumnMappingColumn. :rtype: str """ return self._name @name.setter def name(self, name: str): - """Sets the name of this EdgeMappingSourceVertexMappingsInnerColumn. + """Sets the name of this ColumnMappingColumn. - :param name: The name of this EdgeMappingSourceVertexMappingsInnerColumn. + :param name: The name of this ColumnMappingColumn. :type name: str """ diff --git a/flex/coordinator/gs_flex_coordinator/models/connection.py b/flex/coordinator/gs_flex_coordinator/models/connection.py deleted file mode 100644 index 778489af33ae..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/connection.py +++ /dev/null @@ -1,61 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util - - -class Connection(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, coordinator_endpoint=None): # noqa: E501 - """Connection - a model defined in OpenAPI - - :param coordinator_endpoint: The coordinator_endpoint of this Connection. # noqa: E501 - :type coordinator_endpoint: str - """ - self.openapi_types = { - 'coordinator_endpoint': str - } - - self.attribute_map = { - 'coordinator_endpoint': 'coordinator_endpoint' - } - - self._coordinator_endpoint = coordinator_endpoint - - @classmethod - def from_dict(cls, dikt) -> 'Connection': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The Connection of this Connection. # noqa: E501 - :rtype: Connection - """ - return util.deserialize_model(dikt, cls) - - @property - def coordinator_endpoint(self) -> str: - """Gets the coordinator_endpoint of this Connection. - - - :return: The coordinator_endpoint of this Connection. - :rtype: str - """ - return self._coordinator_endpoint - - @coordinator_endpoint.setter - def coordinator_endpoint(self, coordinator_endpoint: str): - """Sets the coordinator_endpoint of this Connection. - - - :param coordinator_endpoint: The coordinator_endpoint of this Connection. - :type coordinator_endpoint: str - """ - - self._coordinator_endpoint = coordinator_endpoint diff --git a/flex/coordinator/gs_flex_coordinator/models/connection_status.py b/flex/coordinator/gs_flex_coordinator/models/connection_status.py deleted file mode 100644 index d7aefe26b09d..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/connection_status.py +++ /dev/null @@ -1,99 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util - - -class ConnectionStatus(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, status=None, solution=None): # noqa: E501 - """ConnectionStatus - a model defined in OpenAPI - - :param status: The status of this ConnectionStatus. # noqa: E501 - :type status: str - :param solution: The solution of this ConnectionStatus. # noqa: E501 - :type solution: str - """ - self.openapi_types = { - 'status': str, - 'solution': str - } - - self.attribute_map = { - 'status': 'status', - 'solution': 'solution' - } - - self._status = status - self._solution = solution - - @classmethod - def from_dict(cls, dikt) -> 'ConnectionStatus': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The ConnectionStatus of this ConnectionStatus. # noqa: E501 - :rtype: ConnectionStatus - """ - return util.deserialize_model(dikt, cls) - - @property - def status(self) -> str: - """Gets the status of this ConnectionStatus. - - - :return: The status of this ConnectionStatus. - :rtype: str - """ - return self._status - - @status.setter - def status(self, status: str): - """Sets the status of this ConnectionStatus. - - - :param status: The status of this ConnectionStatus. - :type status: str - """ - allowed_values = ["CONNECTED"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" - .format(status, allowed_values) - ) - - self._status = status - - @property - def solution(self) -> str: - """Gets the solution of this ConnectionStatus. - - - :return: The solution of this ConnectionStatus. - :rtype: str - """ - return self._solution - - @solution.setter - def solution(self, solution: str): - """Sets the solution of this ConnectionStatus. - - - :param solution: The solution of this ConnectionStatus. - :type solution: str - """ - allowed_values = ["INTERACTIVE", "GRAPHSCOPE_INSIGHT"] # noqa: E501 - if solution not in allowed_values: - raise ValueError( - "Invalid value for `solution` ({0}), must be one of {1}" - .format(solution, allowed_values) - ) - - self._solution = solution diff --git a/flex/coordinator/gs_flex_coordinator/models/create_alert_receiver_request.py b/flex/coordinator/gs_flex_coordinator/models/create_alert_receiver_request.py new file mode 100644 index 000000000000..d37fd6f9f5b3 --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/create_alert_receiver_request.py @@ -0,0 +1,179 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator import util + + +class CreateAlertReceiverRequest(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, type=None, webhook_url=None, at_user_ids=None, is_at_all=None, enable=None): # noqa: E501 + """CreateAlertReceiverRequest - a model defined in OpenAPI + + :param type: The type of this CreateAlertReceiverRequest. # noqa: E501 + :type type: str + :param webhook_url: The webhook_url of this CreateAlertReceiverRequest. # noqa: E501 + :type webhook_url: str + :param at_user_ids: The at_user_ids of this CreateAlertReceiverRequest. # noqa: E501 + :type at_user_ids: List[str] + :param is_at_all: The is_at_all of this CreateAlertReceiverRequest. # noqa: E501 + :type is_at_all: bool + :param enable: The enable of this CreateAlertReceiverRequest. # noqa: E501 + :type enable: bool + """ + self.openapi_types = { + 'type': str, + 'webhook_url': str, + 'at_user_ids': List[str], + 'is_at_all': bool, + 'enable': bool + } + + self.attribute_map = { + 'type': 'type', + 'webhook_url': 'webhook_url', + 'at_user_ids': 'at_user_ids', + 'is_at_all': 'is_at_all', + 'enable': 'enable' + } + + self._type = type + self._webhook_url = webhook_url + self._at_user_ids = at_user_ids + self._is_at_all = is_at_all + self._enable = enable + + @classmethod + def from_dict(cls, dikt) -> 'CreateAlertReceiverRequest': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The CreateAlertReceiverRequest of this CreateAlertReceiverRequest. # noqa: E501 + :rtype: CreateAlertReceiverRequest + """ + return util.deserialize_model(dikt, cls) + + @property + def type(self) -> str: + """Gets the type of this CreateAlertReceiverRequest. + + + :return: The type of this CreateAlertReceiverRequest. + :rtype: str + """ + return self._type + + @type.setter + def type(self, type: str): + """Sets the type of this CreateAlertReceiverRequest. + + + :param type: The type of this CreateAlertReceiverRequest. + :type type: str + """ + allowed_values = ["webhook"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" + .format(type, allowed_values) + ) + + self._type = type + + @property + def webhook_url(self) -> str: + """Gets the webhook_url of this CreateAlertReceiverRequest. + + + :return: The webhook_url of this CreateAlertReceiverRequest. + :rtype: str + """ + return self._webhook_url + + @webhook_url.setter + def webhook_url(self, webhook_url: str): + """Sets the webhook_url of this CreateAlertReceiverRequest. + + + :param webhook_url: The webhook_url of this CreateAlertReceiverRequest. + :type webhook_url: str + """ + if webhook_url is None: + raise ValueError("Invalid value for `webhook_url`, must not be `None`") # noqa: E501 + + self._webhook_url = webhook_url + + @property + def at_user_ids(self) -> List[str]: + """Gets the at_user_ids of this CreateAlertReceiverRequest. + + + :return: The at_user_ids of this CreateAlertReceiverRequest. + :rtype: List[str] + """ + return self._at_user_ids + + @at_user_ids.setter + def at_user_ids(self, at_user_ids: List[str]): + """Sets the at_user_ids of this CreateAlertReceiverRequest. + + + :param at_user_ids: The at_user_ids of this CreateAlertReceiverRequest. + :type at_user_ids: List[str] + """ + if at_user_ids is None: + raise ValueError("Invalid value for `at_user_ids`, must not be `None`") # noqa: E501 + + self._at_user_ids = at_user_ids + + @property + def is_at_all(self) -> bool: + """Gets the is_at_all of this CreateAlertReceiverRequest. + + + :return: The is_at_all of this CreateAlertReceiverRequest. + :rtype: bool + """ + return self._is_at_all + + @is_at_all.setter + def is_at_all(self, is_at_all: bool): + """Sets the is_at_all of this CreateAlertReceiverRequest. + + + :param is_at_all: The is_at_all of this CreateAlertReceiverRequest. + :type is_at_all: bool + """ + if is_at_all is None: + raise ValueError("Invalid value for `is_at_all`, must not be `None`") # noqa: E501 + + self._is_at_all = is_at_all + + @property + def enable(self) -> bool: + """Gets the enable of this CreateAlertReceiverRequest. + + + :return: The enable of this CreateAlertReceiverRequest. + :rtype: bool + """ + return self._enable + + @enable.setter + def enable(self, enable: bool): + """Sets the enable of this CreateAlertReceiverRequest. + + + :param enable: The enable of this CreateAlertReceiverRequest. + :type enable: bool + """ + if enable is None: + raise ValueError("Invalid value for `enable`, must not be `None`") # noqa: E501 + + self._enable = enable diff --git a/flex/coordinator/gs_flex_coordinator/models/alert_rule.py b/flex/coordinator/gs_flex_coordinator/models/create_alert_rule_request.py similarity index 58% rename from flex/coordinator/gs_flex_coordinator/models/alert_rule.py rename to flex/coordinator/gs_flex_coordinator/models/create_alert_rule_request.py index fe1dcef4526c..65a524c5484b 100644 --- a/flex/coordinator/gs_flex_coordinator/models/alert_rule.py +++ b/flex/coordinator/gs_flex_coordinator/models/create_alert_rule_request.py @@ -6,26 +6,26 @@ from gs_flex_coordinator import util -class AlertRule(Model): +class CreateAlertRuleRequest(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. """ def __init__(self, name=None, severity=None, metric_type=None, conditions_description=None, frequency=None, enable=None): # noqa: E501 - """AlertRule - a model defined in OpenAPI + """CreateAlertRuleRequest - a model defined in OpenAPI - :param name: The name of this AlertRule. # noqa: E501 + :param name: The name of this CreateAlertRuleRequest. # noqa: E501 :type name: str - :param severity: The severity of this AlertRule. # noqa: E501 + :param severity: The severity of this CreateAlertRuleRequest. # noqa: E501 :type severity: str - :param metric_type: The metric_type of this AlertRule. # noqa: E501 + :param metric_type: The metric_type of this CreateAlertRuleRequest. # noqa: E501 :type metric_type: str - :param conditions_description: The conditions_description of this AlertRule. # noqa: E501 + :param conditions_description: The conditions_description of this CreateAlertRuleRequest. # noqa: E501 :type conditions_description: str - :param frequency: The frequency of this AlertRule. # noqa: E501 + :param frequency: The frequency of this CreateAlertRuleRequest. # noqa: E501 :type frequency: int - :param enable: The enable of this AlertRule. # noqa: E501 + :param enable: The enable of this CreateAlertRuleRequest. # noqa: E501 :type enable: bool """ self.openapi_types = { @@ -54,53 +54,55 @@ def __init__(self, name=None, severity=None, metric_type=None, conditions_descri self._enable = enable @classmethod - def from_dict(cls, dikt) -> 'AlertRule': + def from_dict(cls, dikt) -> 'CreateAlertRuleRequest': """Returns the dict as a model :param dikt: A dict. :type: dict - :return: The AlertRule of this AlertRule. # noqa: E501 - :rtype: AlertRule + :return: The CreateAlertRuleRequest of this CreateAlertRuleRequest. # noqa: E501 + :rtype: CreateAlertRuleRequest """ return util.deserialize_model(dikt, cls) @property def name(self) -> str: - """Gets the name of this AlertRule. + """Gets the name of this CreateAlertRuleRequest. - :return: The name of this AlertRule. + :return: The name of this CreateAlertRuleRequest. :rtype: str """ return self._name @name.setter def name(self, name: str): - """Sets the name of this AlertRule. + """Sets the name of this CreateAlertRuleRequest. - :param name: The name of this AlertRule. + :param name: The name of this CreateAlertRuleRequest. :type name: str """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name @property def severity(self) -> str: - """Gets the severity of this AlertRule. + """Gets the severity of this CreateAlertRuleRequest. - :return: The severity of this AlertRule. + :return: The severity of this CreateAlertRuleRequest. :rtype: str """ return self._severity @severity.setter def severity(self, severity: str): - """Sets the severity of this AlertRule. + """Sets the severity of this CreateAlertRuleRequest. - :param severity: The severity of this AlertRule. + :param severity: The severity of this CreateAlertRuleRequest. :type severity: str """ allowed_values = ["warning", "emergency"] # noqa: E501 @@ -114,20 +116,20 @@ def severity(self, severity: str): @property def metric_type(self) -> str: - """Gets the metric_type of this AlertRule. + """Gets the metric_type of this CreateAlertRuleRequest. - :return: The metric_type of this AlertRule. + :return: The metric_type of this CreateAlertRuleRequest. :rtype: str """ return self._metric_type @metric_type.setter def metric_type(self, metric_type: str): - """Sets the metric_type of this AlertRule. + """Sets the metric_type of this CreateAlertRuleRequest. - :param metric_type: The metric_type of this AlertRule. + :param metric_type: The metric_type of this CreateAlertRuleRequest. :type metric_type: str """ allowed_values = ["node", "service"] # noqa: E501 @@ -141,65 +143,71 @@ def metric_type(self, metric_type: str): @property def conditions_description(self) -> str: - """Gets the conditions_description of this AlertRule. + """Gets the conditions_description of this CreateAlertRuleRequest. - :return: The conditions_description of this AlertRule. + :return: The conditions_description of this CreateAlertRuleRequest. :rtype: str """ return self._conditions_description @conditions_description.setter def conditions_description(self, conditions_description: str): - """Sets the conditions_description of this AlertRule. + """Sets the conditions_description of this CreateAlertRuleRequest. - :param conditions_description: The conditions_description of this AlertRule. + :param conditions_description: The conditions_description of this CreateAlertRuleRequest. :type conditions_description: str """ + if conditions_description is None: + raise ValueError("Invalid value for `conditions_description`, must not be `None`") # noqa: E501 self._conditions_description = conditions_description @property def frequency(self) -> int: - """Gets the frequency of this AlertRule. + """Gets the frequency of this CreateAlertRuleRequest. (mins) # noqa: E501 - :return: The frequency of this AlertRule. + :return: The frequency of this CreateAlertRuleRequest. :rtype: int """ return self._frequency @frequency.setter def frequency(self, frequency: int): - """Sets the frequency of this AlertRule. + """Sets the frequency of this CreateAlertRuleRequest. (mins) # noqa: E501 - :param frequency: The frequency of this AlertRule. + :param frequency: The frequency of this CreateAlertRuleRequest. :type frequency: int """ + if frequency is None: + raise ValueError("Invalid value for `frequency`, must not be `None`") # noqa: E501 self._frequency = frequency @property def enable(self) -> bool: - """Gets the enable of this AlertRule. + """Gets the enable of this CreateAlertRuleRequest. - :return: The enable of this AlertRule. + :return: The enable of this CreateAlertRuleRequest. :rtype: bool """ return self._enable @enable.setter def enable(self, enable: bool): - """Sets the enable of this AlertRule. + """Sets the enable of this CreateAlertRuleRequest. - :param enable: The enable of this AlertRule. + :param enable: The enable of this CreateAlertRuleRequest. :type enable: bool """ + if enable is None: + raise ValueError("Invalid value for `enable`, must not be `None`") # noqa: E501 self._enable = enable diff --git a/flex/coordinator/gs_flex_coordinator/models/job_response.py b/flex/coordinator/gs_flex_coordinator/models/create_dataloading_job_response.py similarity index 55% rename from flex/coordinator/gs_flex_coordinator/models/job_response.py rename to flex/coordinator/gs_flex_coordinator/models/create_dataloading_job_response.py index 0ff619af3936..1a315f1d38f0 100644 --- a/flex/coordinator/gs_flex_coordinator/models/job_response.py +++ b/flex/coordinator/gs_flex_coordinator/models/create_dataloading_job_response.py @@ -6,16 +6,16 @@ from gs_flex_coordinator import util -class JobResponse(Model): +class CreateDataloadingJobResponse(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. """ def __init__(self, job_id=None): # noqa: E501 - """JobResponse - a model defined in OpenAPI + """CreateDataloadingJobResponse - a model defined in OpenAPI - :param job_id: The job_id of this JobResponse. # noqa: E501 + :param job_id: The job_id of this CreateDataloadingJobResponse. # noqa: E501 :type job_id: str """ self.openapi_types = { @@ -29,33 +29,35 @@ def __init__(self, job_id=None): # noqa: E501 self._job_id = job_id @classmethod - def from_dict(cls, dikt) -> 'JobResponse': + def from_dict(cls, dikt) -> 'CreateDataloadingJobResponse': """Returns the dict as a model :param dikt: A dict. :type: dict - :return: The JobResponse of this JobResponse. # noqa: E501 - :rtype: JobResponse + :return: The CreateDataloadingJobResponse of this CreateDataloadingJobResponse. # noqa: E501 + :rtype: CreateDataloadingJobResponse """ return util.deserialize_model(dikt, cls) @property def job_id(self) -> str: - """Gets the job_id of this JobResponse. + """Gets the job_id of this CreateDataloadingJobResponse. - :return: The job_id of this JobResponse. + :return: The job_id of this CreateDataloadingJobResponse. :rtype: str """ return self._job_id @job_id.setter def job_id(self, job_id: str): - """Sets the job_id of this JobResponse. + """Sets the job_id of this CreateDataloadingJobResponse. - :param job_id: The job_id of this JobResponse. + :param job_id: The job_id of this CreateDataloadingJobResponse. :type job_id: str """ + if job_id is None: + raise ValueError("Invalid value for `job_id`, must not be `None`") # noqa: E501 self._job_id = job_id diff --git a/flex/coordinator/gs_flex_coordinator/models/create_edge_type.py b/flex/coordinator/gs_flex_coordinator/models/create_edge_type.py new file mode 100644 index 000000000000..abd3ff2cbcae --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/create_edge_type.py @@ -0,0 +1,201 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator.models.base_edge_type_vertex_type_pair_relations_inner import BaseEdgeTypeVertexTypePairRelationsInner +from gs_flex_coordinator.models.create_property_meta import CreatePropertyMeta +from gs_flex_coordinator import util + +from gs_flex_coordinator.models.base_edge_type_vertex_type_pair_relations_inner import BaseEdgeTypeVertexTypePairRelationsInner # noqa: E501 +from gs_flex_coordinator.models.create_property_meta import CreatePropertyMeta # noqa: E501 + +class CreateEdgeType(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, type_name=None, vertex_type_pair_relations=None, directed=None, primary_keys=None, properties=None, description=None): # noqa: E501 + """CreateEdgeType - a model defined in OpenAPI + + :param type_name: The type_name of this CreateEdgeType. # noqa: E501 + :type type_name: str + :param vertex_type_pair_relations: The vertex_type_pair_relations of this CreateEdgeType. # noqa: E501 + :type vertex_type_pair_relations: List[BaseEdgeTypeVertexTypePairRelationsInner] + :param directed: The directed of this CreateEdgeType. # noqa: E501 + :type directed: bool + :param primary_keys: The primary_keys of this CreateEdgeType. # noqa: E501 + :type primary_keys: List[str] + :param properties: The properties of this CreateEdgeType. # noqa: E501 + :type properties: List[CreatePropertyMeta] + :param description: The description of this CreateEdgeType. # noqa: E501 + :type description: str + """ + self.openapi_types = { + 'type_name': str, + 'vertex_type_pair_relations': List[BaseEdgeTypeVertexTypePairRelationsInner], + 'directed': bool, + 'primary_keys': List[str], + 'properties': List[CreatePropertyMeta], + 'description': str + } + + self.attribute_map = { + 'type_name': 'type_name', + 'vertex_type_pair_relations': 'vertex_type_pair_relations', + 'directed': 'directed', + 'primary_keys': 'primary_keys', + 'properties': 'properties', + 'description': 'description' + } + + self._type_name = type_name + self._vertex_type_pair_relations = vertex_type_pair_relations + self._directed = directed + self._primary_keys = primary_keys + self._properties = properties + self._description = description + + @classmethod + def from_dict(cls, dikt) -> 'CreateEdgeType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The CreateEdgeType of this CreateEdgeType. # noqa: E501 + :rtype: CreateEdgeType + """ + return util.deserialize_model(dikt, cls) + + @property + def type_name(self) -> str: + """Gets the type_name of this CreateEdgeType. + + + :return: The type_name of this CreateEdgeType. + :rtype: str + """ + return self._type_name + + @type_name.setter + def type_name(self, type_name: str): + """Sets the type_name of this CreateEdgeType. + + + :param type_name: The type_name of this CreateEdgeType. + :type type_name: str + """ + if type_name is None: + raise ValueError("Invalid value for `type_name`, must not be `None`") # noqa: E501 + + self._type_name = type_name + + @property + def vertex_type_pair_relations(self) -> List[BaseEdgeTypeVertexTypePairRelationsInner]: + """Gets the vertex_type_pair_relations of this CreateEdgeType. + + + :return: The vertex_type_pair_relations of this CreateEdgeType. + :rtype: List[BaseEdgeTypeVertexTypePairRelationsInner] + """ + return self._vertex_type_pair_relations + + @vertex_type_pair_relations.setter + def vertex_type_pair_relations(self, vertex_type_pair_relations: List[BaseEdgeTypeVertexTypePairRelationsInner]): + """Sets the vertex_type_pair_relations of this CreateEdgeType. + + + :param vertex_type_pair_relations: The vertex_type_pair_relations of this CreateEdgeType. + :type vertex_type_pair_relations: List[BaseEdgeTypeVertexTypePairRelationsInner] + """ + if vertex_type_pair_relations is None: + raise ValueError("Invalid value for `vertex_type_pair_relations`, must not be `None`") # noqa: E501 + + self._vertex_type_pair_relations = vertex_type_pair_relations + + @property + def directed(self) -> bool: + """Gets the directed of this CreateEdgeType. + + + :return: The directed of this CreateEdgeType. + :rtype: bool + """ + return self._directed + + @directed.setter + def directed(self, directed: bool): + """Sets the directed of this CreateEdgeType. + + + :param directed: The directed of this CreateEdgeType. + :type directed: bool + """ + + self._directed = directed + + @property + def primary_keys(self) -> List[str]: + """Gets the primary_keys of this CreateEdgeType. + + + :return: The primary_keys of this CreateEdgeType. + :rtype: List[str] + """ + return self._primary_keys + + @primary_keys.setter + def primary_keys(self, primary_keys: List[str]): + """Sets the primary_keys of this CreateEdgeType. + + + :param primary_keys: The primary_keys of this CreateEdgeType. + :type primary_keys: List[str] + """ + + self._primary_keys = primary_keys + + @property + def properties(self) -> List[CreatePropertyMeta]: + """Gets the properties of this CreateEdgeType. + + + :return: The properties of this CreateEdgeType. + :rtype: List[CreatePropertyMeta] + """ + return self._properties + + @properties.setter + def properties(self, properties: List[CreatePropertyMeta]): + """Sets the properties of this CreateEdgeType. + + + :param properties: The properties of this CreateEdgeType. + :type properties: List[CreatePropertyMeta] + """ + if properties is None: + raise ValueError("Invalid value for `properties`, must not be `None`") # noqa: E501 + + self._properties = properties + + @property + def description(self) -> str: + """Gets the description of this CreateEdgeType. + + + :return: The description of this CreateEdgeType. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description: str): + """Sets the description of this CreateEdgeType. + + + :param description: The description of this CreateEdgeType. + :type description: str + """ + + self._description = description diff --git a/flex/coordinator/gs_flex_coordinator/models/create_graph_request.py b/flex/coordinator/gs_flex_coordinator/models/create_graph_request.py new file mode 100644 index 000000000000..5fcc955dc808 --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/create_graph_request.py @@ -0,0 +1,147 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator.models.create_graph_schema_request import CreateGraphSchemaRequest +from gs_flex_coordinator.models.create_procedure_request import CreateProcedureRequest +from gs_flex_coordinator import util + +from gs_flex_coordinator.models.create_graph_schema_request import CreateGraphSchemaRequest # noqa: E501 +from gs_flex_coordinator.models.create_procedure_request import CreateProcedureRequest # noqa: E501 + +class CreateGraphRequest(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, name=None, description=None, stored_procedures=None, _schema=None): # noqa: E501 + """CreateGraphRequest - a model defined in OpenAPI + + :param name: The name of this CreateGraphRequest. # noqa: E501 + :type name: str + :param description: The description of this CreateGraphRequest. # noqa: E501 + :type description: str + :param stored_procedures: The stored_procedures of this CreateGraphRequest. # noqa: E501 + :type stored_procedures: List[CreateProcedureRequest] + :param _schema: The _schema of this CreateGraphRequest. # noqa: E501 + :type _schema: CreateGraphSchemaRequest + """ + self.openapi_types = { + 'name': str, + 'description': str, + 'stored_procedures': List[CreateProcedureRequest], + '_schema': CreateGraphSchemaRequest + } + + self.attribute_map = { + 'name': 'name', + 'description': 'description', + 'stored_procedures': 'stored_procedures', + '_schema': 'schema' + } + + self._name = name + self._description = description + self._stored_procedures = stored_procedures + self.__schema = _schema + + @classmethod + def from_dict(cls, dikt) -> 'CreateGraphRequest': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The CreateGraphRequest of this CreateGraphRequest. # noqa: E501 + :rtype: CreateGraphRequest + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> str: + """Gets the name of this CreateGraphRequest. + + + :return: The name of this CreateGraphRequest. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name: str): + """Sets the name of this CreateGraphRequest. + + + :param name: The name of this CreateGraphRequest. + :type name: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def description(self) -> str: + """Gets the description of this CreateGraphRequest. + + + :return: The description of this CreateGraphRequest. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description: str): + """Sets the description of this CreateGraphRequest. + + + :param description: The description of this CreateGraphRequest. + :type description: str + """ + + self._description = description + + @property + def stored_procedures(self) -> List[CreateProcedureRequest]: + """Gets the stored_procedures of this CreateGraphRequest. + + + :return: The stored_procedures of this CreateGraphRequest. + :rtype: List[CreateProcedureRequest] + """ + return self._stored_procedures + + @stored_procedures.setter + def stored_procedures(self, stored_procedures: List[CreateProcedureRequest]): + """Sets the stored_procedures of this CreateGraphRequest. + + + :param stored_procedures: The stored_procedures of this CreateGraphRequest. + :type stored_procedures: List[CreateProcedureRequest] + """ + + self._stored_procedures = stored_procedures + + @property + def _schema(self) -> CreateGraphSchemaRequest: + """Gets the _schema of this CreateGraphRequest. + + + :return: The _schema of this CreateGraphRequest. + :rtype: CreateGraphSchemaRequest + """ + return self.__schema + + @_schema.setter + def _schema(self, _schema: CreateGraphSchemaRequest): + """Sets the _schema of this CreateGraphRequest. + + + :param _schema: The _schema of this CreateGraphRequest. + :type _schema: CreateGraphSchemaRequest + """ + if _schema is None: + raise ValueError("Invalid value for `_schema`, must not be `None`") # noqa: E501 + + self.__schema = _schema diff --git a/flex/coordinator/gs_flex_coordinator/models/create_graph_response.py b/flex/coordinator/gs_flex_coordinator/models/create_graph_response.py new file mode 100644 index 000000000000..81e8fcf56aa4 --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/create_graph_response.py @@ -0,0 +1,63 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator import util + + +class CreateGraphResponse(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, graph_id=None): # noqa: E501 + """CreateGraphResponse - a model defined in OpenAPI + + :param graph_id: The graph_id of this CreateGraphResponse. # noqa: E501 + :type graph_id: str + """ + self.openapi_types = { + 'graph_id': str + } + + self.attribute_map = { + 'graph_id': 'graph_id' + } + + self._graph_id = graph_id + + @classmethod + def from_dict(cls, dikt) -> 'CreateGraphResponse': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The CreateGraphResponse of this CreateGraphResponse. # noqa: E501 + :rtype: CreateGraphResponse + """ + return util.deserialize_model(dikt, cls) + + @property + def graph_id(self) -> str: + """Gets the graph_id of this CreateGraphResponse. + + + :return: The graph_id of this CreateGraphResponse. + :rtype: str + """ + return self._graph_id + + @graph_id.setter + def graph_id(self, graph_id: str): + """Sets the graph_id of this CreateGraphResponse. + + + :param graph_id: The graph_id of this CreateGraphResponse. + :type graph_id: str + """ + if graph_id is None: + raise ValueError("Invalid value for `graph_id`, must not be `None`") # noqa: E501 + + self._graph_id = graph_id diff --git a/flex/coordinator/gs_flex_coordinator/models/create_graph_schema_request.py b/flex/coordinator/gs_flex_coordinator/models/create_graph_schema_request.py new file mode 100644 index 000000000000..8aa36619d1d2 --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/create_graph_schema_request.py @@ -0,0 +1,95 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator.models.create_edge_type import CreateEdgeType +from gs_flex_coordinator.models.create_vertex_type import CreateVertexType +from gs_flex_coordinator import util + +from gs_flex_coordinator.models.create_edge_type import CreateEdgeType # noqa: E501 +from gs_flex_coordinator.models.create_vertex_type import CreateVertexType # noqa: E501 + +class CreateGraphSchemaRequest(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, vertex_types=None, edge_types=None): # noqa: E501 + """CreateGraphSchemaRequest - a model defined in OpenAPI + + :param vertex_types: The vertex_types of this CreateGraphSchemaRequest. # noqa: E501 + :type vertex_types: List[CreateVertexType] + :param edge_types: The edge_types of this CreateGraphSchemaRequest. # noqa: E501 + :type edge_types: List[CreateEdgeType] + """ + self.openapi_types = { + 'vertex_types': List[CreateVertexType], + 'edge_types': List[CreateEdgeType] + } + + self.attribute_map = { + 'vertex_types': 'vertex_types', + 'edge_types': 'edge_types' + } + + self._vertex_types = vertex_types + self._edge_types = edge_types + + @classmethod + def from_dict(cls, dikt) -> 'CreateGraphSchemaRequest': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The CreateGraphSchemaRequest of this CreateGraphSchemaRequest. # noqa: E501 + :rtype: CreateGraphSchemaRequest + """ + return util.deserialize_model(dikt, cls) + + @property + def vertex_types(self) -> List[CreateVertexType]: + """Gets the vertex_types of this CreateGraphSchemaRequest. + + + :return: The vertex_types of this CreateGraphSchemaRequest. + :rtype: List[CreateVertexType] + """ + return self._vertex_types + + @vertex_types.setter + def vertex_types(self, vertex_types: List[CreateVertexType]): + """Sets the vertex_types of this CreateGraphSchemaRequest. + + + :param vertex_types: The vertex_types of this CreateGraphSchemaRequest. + :type vertex_types: List[CreateVertexType] + """ + if vertex_types is None: + raise ValueError("Invalid value for `vertex_types`, must not be `None`") # noqa: E501 + + self._vertex_types = vertex_types + + @property + def edge_types(self) -> List[CreateEdgeType]: + """Gets the edge_types of this CreateGraphSchemaRequest. + + + :return: The edge_types of this CreateGraphSchemaRequest. + :rtype: List[CreateEdgeType] + """ + return self._edge_types + + @edge_types.setter + def edge_types(self, edge_types: List[CreateEdgeType]): + """Sets the edge_types of this CreateGraphSchemaRequest. + + + :param edge_types: The edge_types of this CreateGraphSchemaRequest. + :type edge_types: List[CreateEdgeType] + """ + if edge_types is None: + raise ValueError("Invalid value for `edge_types`, must not be `None`") # noqa: E501 + + self._edge_types = edge_types diff --git a/flex/coordinator/gs_flex_coordinator/models/create_procedure_request.py b/flex/coordinator/gs_flex_coordinator/models/create_procedure_request.py new file mode 100644 index 000000000000..ae8d787b59db --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/create_procedure_request.py @@ -0,0 +1,149 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator import util + + +class CreateProcedureRequest(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, name=None, description=None, type=None, query=None): # noqa: E501 + """CreateProcedureRequest - a model defined in OpenAPI + + :param name: The name of this CreateProcedureRequest. # noqa: E501 + :type name: str + :param description: The description of this CreateProcedureRequest. # noqa: E501 + :type description: str + :param type: The type of this CreateProcedureRequest. # noqa: E501 + :type type: str + :param query: The query of this CreateProcedureRequest. # noqa: E501 + :type query: str + """ + self.openapi_types = { + 'name': str, + 'description': str, + 'type': str, + 'query': str + } + + self.attribute_map = { + 'name': 'name', + 'description': 'description', + 'type': 'type', + 'query': 'query' + } + + self._name = name + self._description = description + self._type = type + self._query = query + + @classmethod + def from_dict(cls, dikt) -> 'CreateProcedureRequest': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The CreateProcedureRequest of this CreateProcedureRequest. # noqa: E501 + :rtype: CreateProcedureRequest + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> str: + """Gets the name of this CreateProcedureRequest. + + + :return: The name of this CreateProcedureRequest. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name: str): + """Sets the name of this CreateProcedureRequest. + + + :param name: The name of this CreateProcedureRequest. + :type name: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def description(self) -> str: + """Gets the description of this CreateProcedureRequest. + + + :return: The description of this CreateProcedureRequest. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description: str): + """Sets the description of this CreateProcedureRequest. + + + :param description: The description of this CreateProcedureRequest. + :type description: str + """ + + self._description = description + + @property + def type(self) -> str: + """Gets the type of this CreateProcedureRequest. + + + :return: The type of this CreateProcedureRequest. + :rtype: str + """ + return self._type + + @type.setter + def type(self, type: str): + """Sets the type of this CreateProcedureRequest. + + + :param type: The type of this CreateProcedureRequest. + :type type: str + """ + allowed_values = ["cpp", "cypher"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" + .format(type, allowed_values) + ) + + self._type = type + + @property + def query(self) -> str: + """Gets the query of this CreateProcedureRequest. + + + :return: The query of this CreateProcedureRequest. + :rtype: str + """ + return self._query + + @query.setter + def query(self, query: str): + """Sets the query of this CreateProcedureRequest. + + + :param query: The query of this CreateProcedureRequest. + :type query: str + """ + if query is None: + raise ValueError("Invalid value for `query`, must not be `None`") # noqa: E501 + + self._query = query diff --git a/flex/coordinator/gs_flex_coordinator/models/create_procedure_response.py b/flex/coordinator/gs_flex_coordinator/models/create_procedure_response.py new file mode 100644 index 000000000000..c89ad9d859ed --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/create_procedure_response.py @@ -0,0 +1,63 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator import util + + +class CreateProcedureResponse(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, procedure_id=None): # noqa: E501 + """CreateProcedureResponse - a model defined in OpenAPI + + :param procedure_id: The procedure_id of this CreateProcedureResponse. # noqa: E501 + :type procedure_id: str + """ + self.openapi_types = { + 'procedure_id': str + } + + self.attribute_map = { + 'procedure_id': 'procedure_id' + } + + self._procedure_id = procedure_id + + @classmethod + def from_dict(cls, dikt) -> 'CreateProcedureResponse': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The CreateProcedureResponse of this CreateProcedureResponse. # noqa: E501 + :rtype: CreateProcedureResponse + """ + return util.deserialize_model(dikt, cls) + + @property + def procedure_id(self) -> str: + """Gets the procedure_id of this CreateProcedureResponse. + + + :return: The procedure_id of this CreateProcedureResponse. + :rtype: str + """ + return self._procedure_id + + @procedure_id.setter + def procedure_id(self, procedure_id: str): + """Sets the procedure_id of this CreateProcedureResponse. + + + :param procedure_id: The procedure_id of this CreateProcedureResponse. + :type procedure_id: str + """ + if procedure_id is None: + raise ValueError("Invalid value for `procedure_id`, must not be `None`") # noqa: E501 + + self._procedure_id = procedure_id diff --git a/flex/coordinator/gs_flex_coordinator/models/create_property_meta.py b/flex/coordinator/gs_flex_coordinator/models/create_property_meta.py new file mode 100644 index 000000000000..ac20861afedf --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/create_property_meta.py @@ -0,0 +1,171 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator.models.gs_data_type import GSDataType +from gs_flex_coordinator import util + +from gs_flex_coordinator.models.gs_data_type import GSDataType # noqa: E501 + +class CreatePropertyMeta(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, property_name=None, property_type=None, nullable=None, default_value=None, description=None): # noqa: E501 + """CreatePropertyMeta - a model defined in OpenAPI + + :param property_name: The property_name of this CreatePropertyMeta. # noqa: E501 + :type property_name: str + :param property_type: The property_type of this CreatePropertyMeta. # noqa: E501 + :type property_type: GSDataType + :param nullable: The nullable of this CreatePropertyMeta. # noqa: E501 + :type nullable: bool + :param default_value: The default_value of this CreatePropertyMeta. # noqa: E501 + :type default_value: object + :param description: The description of this CreatePropertyMeta. # noqa: E501 + :type description: str + """ + self.openapi_types = { + 'property_name': str, + 'property_type': GSDataType, + 'nullable': bool, + 'default_value': object, + 'description': str + } + + self.attribute_map = { + 'property_name': 'property_name', + 'property_type': 'property_type', + 'nullable': 'nullable', + 'default_value': 'default_value', + 'description': 'description' + } + + self._property_name = property_name + self._property_type = property_type + self._nullable = nullable + self._default_value = default_value + self._description = description + + @classmethod + def from_dict(cls, dikt) -> 'CreatePropertyMeta': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The CreatePropertyMeta of this CreatePropertyMeta. # noqa: E501 + :rtype: CreatePropertyMeta + """ + return util.deserialize_model(dikt, cls) + + @property + def property_name(self) -> str: + """Gets the property_name of this CreatePropertyMeta. + + + :return: The property_name of this CreatePropertyMeta. + :rtype: str + """ + return self._property_name + + @property_name.setter + def property_name(self, property_name: str): + """Sets the property_name of this CreatePropertyMeta. + + + :param property_name: The property_name of this CreatePropertyMeta. + :type property_name: str + """ + if property_name is None: + raise ValueError("Invalid value for `property_name`, must not be `None`") # noqa: E501 + + self._property_name = property_name + + @property + def property_type(self) -> GSDataType: + """Gets the property_type of this CreatePropertyMeta. + + + :return: The property_type of this CreatePropertyMeta. + :rtype: GSDataType + """ + return self._property_type + + @property_type.setter + def property_type(self, property_type: GSDataType): + """Sets the property_type of this CreatePropertyMeta. + + + :param property_type: The property_type of this CreatePropertyMeta. + :type property_type: GSDataType + """ + if property_type is None: + raise ValueError("Invalid value for `property_type`, must not be `None`") # noqa: E501 + + self._property_type = property_type + + @property + def nullable(self) -> bool: + """Gets the nullable of this CreatePropertyMeta. + + + :return: The nullable of this CreatePropertyMeta. + :rtype: bool + """ + return self._nullable + + @nullable.setter + def nullable(self, nullable: bool): + """Sets the nullable of this CreatePropertyMeta. + + + :param nullable: The nullable of this CreatePropertyMeta. + :type nullable: bool + """ + + self._nullable = nullable + + @property + def default_value(self) -> object: + """Gets the default_value of this CreatePropertyMeta. + + + :return: The default_value of this CreatePropertyMeta. + :rtype: object + """ + return self._default_value + + @default_value.setter + def default_value(self, default_value: object): + """Sets the default_value of this CreatePropertyMeta. + + + :param default_value: The default_value of this CreatePropertyMeta. + :type default_value: object + """ + + self._default_value = default_value + + @property + def description(self) -> str: + """Gets the description of this CreatePropertyMeta. + + + :return: The description of this CreatePropertyMeta. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description: str): + """Sets the description of this CreatePropertyMeta. + + + :param description: The description of this CreatePropertyMeta. + :type description: str + """ + + self._description = description diff --git a/flex/coordinator/gs_flex_coordinator/models/create_vertex_type.py b/flex/coordinator/gs_flex_coordinator/models/create_vertex_type.py new file mode 100644 index 000000000000..56f5fc903030 --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/create_vertex_type.py @@ -0,0 +1,175 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator.models.base_vertex_type_x_csr_params import BaseVertexTypeXCsrParams +from gs_flex_coordinator.models.create_property_meta import CreatePropertyMeta +from gs_flex_coordinator import util + +from gs_flex_coordinator.models.base_vertex_type_x_csr_params import BaseVertexTypeXCsrParams # noqa: E501 +from gs_flex_coordinator.models.create_property_meta import CreatePropertyMeta # noqa: E501 + +class CreateVertexType(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, type_name=None, primary_keys=None, x_csr_params=None, properties=None, description=None): # noqa: E501 + """CreateVertexType - a model defined in OpenAPI + + :param type_name: The type_name of this CreateVertexType. # noqa: E501 + :type type_name: str + :param primary_keys: The primary_keys of this CreateVertexType. # noqa: E501 + :type primary_keys: List[str] + :param x_csr_params: The x_csr_params of this CreateVertexType. # noqa: E501 + :type x_csr_params: BaseVertexTypeXCsrParams + :param properties: The properties of this CreateVertexType. # noqa: E501 + :type properties: List[CreatePropertyMeta] + :param description: The description of this CreateVertexType. # noqa: E501 + :type description: str + """ + self.openapi_types = { + 'type_name': str, + 'primary_keys': List[str], + 'x_csr_params': BaseVertexTypeXCsrParams, + 'properties': List[CreatePropertyMeta], + 'description': str + } + + self.attribute_map = { + 'type_name': 'type_name', + 'primary_keys': 'primary_keys', + 'x_csr_params': 'x_csr_params', + 'properties': 'properties', + 'description': 'description' + } + + self._type_name = type_name + self._primary_keys = primary_keys + self._x_csr_params = x_csr_params + self._properties = properties + self._description = description + + @classmethod + def from_dict(cls, dikt) -> 'CreateVertexType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The CreateVertexType of this CreateVertexType. # noqa: E501 + :rtype: CreateVertexType + """ + return util.deserialize_model(dikt, cls) + + @property + def type_name(self) -> str: + """Gets the type_name of this CreateVertexType. + + + :return: The type_name of this CreateVertexType. + :rtype: str + """ + return self._type_name + + @type_name.setter + def type_name(self, type_name: str): + """Sets the type_name of this CreateVertexType. + + + :param type_name: The type_name of this CreateVertexType. + :type type_name: str + """ + if type_name is None: + raise ValueError("Invalid value for `type_name`, must not be `None`") # noqa: E501 + + self._type_name = type_name + + @property + def primary_keys(self) -> List[str]: + """Gets the primary_keys of this CreateVertexType. + + + :return: The primary_keys of this CreateVertexType. + :rtype: List[str] + """ + return self._primary_keys + + @primary_keys.setter + def primary_keys(self, primary_keys: List[str]): + """Sets the primary_keys of this CreateVertexType. + + + :param primary_keys: The primary_keys of this CreateVertexType. + :type primary_keys: List[str] + """ + if primary_keys is None: + raise ValueError("Invalid value for `primary_keys`, must not be `None`") # noqa: E501 + + self._primary_keys = primary_keys + + @property + def x_csr_params(self) -> BaseVertexTypeXCsrParams: + """Gets the x_csr_params of this CreateVertexType. + + + :return: The x_csr_params of this CreateVertexType. + :rtype: BaseVertexTypeXCsrParams + """ + return self._x_csr_params + + @x_csr_params.setter + def x_csr_params(self, x_csr_params: BaseVertexTypeXCsrParams): + """Sets the x_csr_params of this CreateVertexType. + + + :param x_csr_params: The x_csr_params of this CreateVertexType. + :type x_csr_params: BaseVertexTypeXCsrParams + """ + + self._x_csr_params = x_csr_params + + @property + def properties(self) -> List[CreatePropertyMeta]: + """Gets the properties of this CreateVertexType. + + + :return: The properties of this CreateVertexType. + :rtype: List[CreatePropertyMeta] + """ + return self._properties + + @properties.setter + def properties(self, properties: List[CreatePropertyMeta]): + """Sets the properties of this CreateVertexType. + + + :param properties: The properties of this CreateVertexType. + :type properties: List[CreatePropertyMeta] + """ + if properties is None: + raise ValueError("Invalid value for `properties`, must not be `None`") # noqa: E501 + + self._properties = properties + + @property + def description(self) -> str: + """Gets the description of this CreateVertexType. + + + :return: The description of this CreateVertexType. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description: str): + """Sets the description of this CreateVertexType. + + + :param description: The description of this CreateVertexType. + :type description: str + """ + + self._description = description diff --git a/flex/coordinator/gs_flex_coordinator/models/data_source.py b/flex/coordinator/gs_flex_coordinator/models/data_source.py deleted file mode 100644 index ddf377f2a8cb..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/data_source.py +++ /dev/null @@ -1,91 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.edge_data_source import EdgeDataSource -from gs_flex_coordinator.models.vertex_data_source import VertexDataSource -from gs_flex_coordinator import util - -from gs_flex_coordinator.models.edge_data_source import EdgeDataSource # noqa: E501 -from gs_flex_coordinator.models.vertex_data_source import VertexDataSource # noqa: E501 - -class DataSource(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, vertices_datasource=None, edges_datasource=None): # noqa: E501 - """DataSource - a model defined in OpenAPI - - :param vertices_datasource: The vertices_datasource of this DataSource. # noqa: E501 - :type vertices_datasource: List[VertexDataSource] - :param edges_datasource: The edges_datasource of this DataSource. # noqa: E501 - :type edges_datasource: List[EdgeDataSource] - """ - self.openapi_types = { - 'vertices_datasource': List[VertexDataSource], - 'edges_datasource': List[EdgeDataSource] - } - - self.attribute_map = { - 'vertices_datasource': 'vertices_datasource', - 'edges_datasource': 'edges_datasource' - } - - self._vertices_datasource = vertices_datasource - self._edges_datasource = edges_datasource - - @classmethod - def from_dict(cls, dikt) -> 'DataSource': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The DataSource of this DataSource. # noqa: E501 - :rtype: DataSource - """ - return util.deserialize_model(dikt, cls) - - @property - def vertices_datasource(self) -> List[VertexDataSource]: - """Gets the vertices_datasource of this DataSource. - - - :return: The vertices_datasource of this DataSource. - :rtype: List[VertexDataSource] - """ - return self._vertices_datasource - - @vertices_datasource.setter - def vertices_datasource(self, vertices_datasource: List[VertexDataSource]): - """Sets the vertices_datasource of this DataSource. - - - :param vertices_datasource: The vertices_datasource of this DataSource. - :type vertices_datasource: List[VertexDataSource] - """ - - self._vertices_datasource = vertices_datasource - - @property - def edges_datasource(self) -> List[EdgeDataSource]: - """Gets the edges_datasource of this DataSource. - - - :return: The edges_datasource of this DataSource. - :rtype: List[EdgeDataSource] - """ - return self._edges_datasource - - @edges_datasource.setter - def edges_datasource(self, edges_datasource: List[EdgeDataSource]): - """Sets the edges_datasource of this DataSource. - - - :param edges_datasource: The edges_datasource of this DataSource. - :type edges_datasource: List[EdgeDataSource] - """ - - self._edges_datasource = edges_datasource diff --git a/flex/coordinator/gs_flex_coordinator/models/dataloading_job_config.py b/flex/coordinator/gs_flex_coordinator/models/dataloading_job_config.py new file mode 100644 index 000000000000..e4c5e79050d4 --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/dataloading_job_config.py @@ -0,0 +1,185 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator.models.dataloading_job_config_edges_inner import DataloadingJobConfigEdgesInner +from gs_flex_coordinator.models.dataloading_job_config_loading_config import DataloadingJobConfigLoadingConfig +from gs_flex_coordinator.models.dataloading_job_config_vertices_inner import DataloadingJobConfigVerticesInner +from gs_flex_coordinator import util + +from gs_flex_coordinator.models.dataloading_job_config_edges_inner import DataloadingJobConfigEdgesInner # noqa: E501 +from gs_flex_coordinator.models.dataloading_job_config_loading_config import DataloadingJobConfigLoadingConfig # noqa: E501 +from gs_flex_coordinator.models.dataloading_job_config_vertices_inner import DataloadingJobConfigVerticesInner # noqa: E501 + +class DataloadingJobConfig(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, loading_config=None, vertices=None, edges=None, schedule=None, repeat=None): # noqa: E501 + """DataloadingJobConfig - a model defined in OpenAPI + + :param loading_config: The loading_config of this DataloadingJobConfig. # noqa: E501 + :type loading_config: DataloadingJobConfigLoadingConfig + :param vertices: The vertices of this DataloadingJobConfig. # noqa: E501 + :type vertices: List[DataloadingJobConfigVerticesInner] + :param edges: The edges of this DataloadingJobConfig. # noqa: E501 + :type edges: List[DataloadingJobConfigEdgesInner] + :param schedule: The schedule of this DataloadingJobConfig. # noqa: E501 + :type schedule: str + :param repeat: The repeat of this DataloadingJobConfig. # noqa: E501 + :type repeat: str + """ + self.openapi_types = { + 'loading_config': DataloadingJobConfigLoadingConfig, + 'vertices': List[DataloadingJobConfigVerticesInner], + 'edges': List[DataloadingJobConfigEdgesInner], + 'schedule': str, + 'repeat': str + } + + self.attribute_map = { + 'loading_config': 'loading_config', + 'vertices': 'vertices', + 'edges': 'edges', + 'schedule': 'schedule', + 'repeat': 'repeat' + } + + self._loading_config = loading_config + self._vertices = vertices + self._edges = edges + self._schedule = schedule + self._repeat = repeat + + @classmethod + def from_dict(cls, dikt) -> 'DataloadingJobConfig': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The DataloadingJobConfig of this DataloadingJobConfig. # noqa: E501 + :rtype: DataloadingJobConfig + """ + return util.deserialize_model(dikt, cls) + + @property + def loading_config(self) -> DataloadingJobConfigLoadingConfig: + """Gets the loading_config of this DataloadingJobConfig. + + + :return: The loading_config of this DataloadingJobConfig. + :rtype: DataloadingJobConfigLoadingConfig + """ + return self._loading_config + + @loading_config.setter + def loading_config(self, loading_config: DataloadingJobConfigLoadingConfig): + """Sets the loading_config of this DataloadingJobConfig. + + + :param loading_config: The loading_config of this DataloadingJobConfig. + :type loading_config: DataloadingJobConfigLoadingConfig + """ + if loading_config is None: + raise ValueError("Invalid value for `loading_config`, must not be `None`") # noqa: E501 + + self._loading_config = loading_config + + @property + def vertices(self) -> List[DataloadingJobConfigVerticesInner]: + """Gets the vertices of this DataloadingJobConfig. + + + :return: The vertices of this DataloadingJobConfig. + :rtype: List[DataloadingJobConfigVerticesInner] + """ + return self._vertices + + @vertices.setter + def vertices(self, vertices: List[DataloadingJobConfigVerticesInner]): + """Sets the vertices of this DataloadingJobConfig. + + + :param vertices: The vertices of this DataloadingJobConfig. + :type vertices: List[DataloadingJobConfigVerticesInner] + """ + if vertices is None: + raise ValueError("Invalid value for `vertices`, must not be `None`") # noqa: E501 + + self._vertices = vertices + + @property + def edges(self) -> List[DataloadingJobConfigEdgesInner]: + """Gets the edges of this DataloadingJobConfig. + + + :return: The edges of this DataloadingJobConfig. + :rtype: List[DataloadingJobConfigEdgesInner] + """ + return self._edges + + @edges.setter + def edges(self, edges: List[DataloadingJobConfigEdgesInner]): + """Sets the edges of this DataloadingJobConfig. + + + :param edges: The edges of this DataloadingJobConfig. + :type edges: List[DataloadingJobConfigEdgesInner] + """ + if edges is None: + raise ValueError("Invalid value for `edges`, must not be `None`") # noqa: E501 + + self._edges = edges + + @property + def schedule(self) -> str: + """Gets the schedule of this DataloadingJobConfig. + + format with '2023-02-21 11:56:30' # noqa: E501 + + :return: The schedule of this DataloadingJobConfig. + :rtype: str + """ + return self._schedule + + @schedule.setter + def schedule(self, schedule: str): + """Sets the schedule of this DataloadingJobConfig. + + format with '2023-02-21 11:56:30' # noqa: E501 + + :param schedule: The schedule of this DataloadingJobConfig. + :type schedule: str + """ + + self._schedule = schedule + + @property + def repeat(self) -> str: + """Gets the repeat of this DataloadingJobConfig. + + + :return: The repeat of this DataloadingJobConfig. + :rtype: str + """ + return self._repeat + + @repeat.setter + def repeat(self, repeat: str): + """Sets the repeat of this DataloadingJobConfig. + + + :param repeat: The repeat of this DataloadingJobConfig. + :type repeat: str + """ + allowed_values = [None,"once", "day", "week"] # noqa: E501 + if repeat not in allowed_values: + raise ValueError( + "Invalid value for `repeat` ({0}), must be one of {1}" + .format(repeat, allowed_values) + ) + + self._repeat = repeat diff --git a/flex/coordinator/gs_flex_coordinator/models/groot_dataloading_job_config_edges_inner.py b/flex/coordinator/gs_flex_coordinator/models/dataloading_job_config_edges_inner.py similarity index 59% rename from flex/coordinator/gs_flex_coordinator/models/groot_dataloading_job_config_edges_inner.py rename to flex/coordinator/gs_flex_coordinator/models/dataloading_job_config_edges_inner.py index 82b0b57b1fba..6e7de019a03b 100644 --- a/flex/coordinator/gs_flex_coordinator/models/groot_dataloading_job_config_edges_inner.py +++ b/flex/coordinator/gs_flex_coordinator/models/dataloading_job_config_edges_inner.py @@ -6,20 +6,20 @@ from gs_flex_coordinator import util -class GrootDataloadingJobConfigEdgesInner(Model): +class DataloadingJobConfigEdgesInner(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. """ def __init__(self, type_name=None, source_vertex=None, destination_vertex=None): # noqa: E501 - """GrootDataloadingJobConfigEdgesInner - a model defined in OpenAPI + """DataloadingJobConfigEdgesInner - a model defined in OpenAPI - :param type_name: The type_name of this GrootDataloadingJobConfigEdgesInner. # noqa: E501 + :param type_name: The type_name of this DataloadingJobConfigEdgesInner. # noqa: E501 :type type_name: str - :param source_vertex: The source_vertex of this GrootDataloadingJobConfigEdgesInner. # noqa: E501 + :param source_vertex: The source_vertex of this DataloadingJobConfigEdgesInner. # noqa: E501 :type source_vertex: str - :param destination_vertex: The destination_vertex of this GrootDataloadingJobConfigEdgesInner. # noqa: E501 + :param destination_vertex: The destination_vertex of this DataloadingJobConfigEdgesInner. # noqa: E501 :type destination_vertex: str """ self.openapi_types = { @@ -39,32 +39,32 @@ def __init__(self, type_name=None, source_vertex=None, destination_vertex=None): self._destination_vertex = destination_vertex @classmethod - def from_dict(cls, dikt) -> 'GrootDataloadingJobConfigEdgesInner': + def from_dict(cls, dikt) -> 'DataloadingJobConfigEdgesInner': """Returns the dict as a model :param dikt: A dict. :type: dict - :return: The GrootDataloadingJobConfig_edges_inner of this GrootDataloadingJobConfigEdgesInner. # noqa: E501 - :rtype: GrootDataloadingJobConfigEdgesInner + :return: The DataloadingJobConfig_edges_inner of this DataloadingJobConfigEdgesInner. # noqa: E501 + :rtype: DataloadingJobConfigEdgesInner """ return util.deserialize_model(dikt, cls) @property def type_name(self) -> str: - """Gets the type_name of this GrootDataloadingJobConfigEdgesInner. + """Gets the type_name of this DataloadingJobConfigEdgesInner. - :return: The type_name of this GrootDataloadingJobConfigEdgesInner. + :return: The type_name of this DataloadingJobConfigEdgesInner. :rtype: str """ return self._type_name @type_name.setter def type_name(self, type_name: str): - """Sets the type_name of this GrootDataloadingJobConfigEdgesInner. + """Sets the type_name of this DataloadingJobConfigEdgesInner. - :param type_name: The type_name of this GrootDataloadingJobConfigEdgesInner. + :param type_name: The type_name of this DataloadingJobConfigEdgesInner. :type type_name: str """ @@ -72,20 +72,20 @@ def type_name(self, type_name: str): @property def source_vertex(self) -> str: - """Gets the source_vertex of this GrootDataloadingJobConfigEdgesInner. + """Gets the source_vertex of this DataloadingJobConfigEdgesInner. - :return: The source_vertex of this GrootDataloadingJobConfigEdgesInner. + :return: The source_vertex of this DataloadingJobConfigEdgesInner. :rtype: str """ return self._source_vertex @source_vertex.setter def source_vertex(self, source_vertex: str): - """Sets the source_vertex of this GrootDataloadingJobConfigEdgesInner. + """Sets the source_vertex of this DataloadingJobConfigEdgesInner. - :param source_vertex: The source_vertex of this GrootDataloadingJobConfigEdgesInner. + :param source_vertex: The source_vertex of this DataloadingJobConfigEdgesInner. :type source_vertex: str """ @@ -93,20 +93,20 @@ def source_vertex(self, source_vertex: str): @property def destination_vertex(self) -> str: - """Gets the destination_vertex of this GrootDataloadingJobConfigEdgesInner. + """Gets the destination_vertex of this DataloadingJobConfigEdgesInner. - :return: The destination_vertex of this GrootDataloadingJobConfigEdgesInner. + :return: The destination_vertex of this DataloadingJobConfigEdgesInner. :rtype: str """ return self._destination_vertex @destination_vertex.setter def destination_vertex(self, destination_vertex: str): - """Sets the destination_vertex of this GrootDataloadingJobConfigEdgesInner. + """Sets the destination_vertex of this DataloadingJobConfigEdgesInner. - :param destination_vertex: The destination_vertex of this GrootDataloadingJobConfigEdgesInner. + :param destination_vertex: The destination_vertex of this DataloadingJobConfigEdgesInner. :type destination_vertex: str """ diff --git a/flex/coordinator/gs_flex_coordinator/models/dataloading_job_config_loading_config.py b/flex/coordinator/gs_flex_coordinator/models/dataloading_job_config_loading_config.py new file mode 100644 index 000000000000..8495188a34a0 --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/dataloading_job_config_loading_config.py @@ -0,0 +1,95 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator.models.dataloading_job_config_loading_config_format import DataloadingJobConfigLoadingConfigFormat +from gs_flex_coordinator import util + +from gs_flex_coordinator.models.dataloading_job_config_loading_config_format import DataloadingJobConfigLoadingConfigFormat # noqa: E501 + +class DataloadingJobConfigLoadingConfig(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, import_option=None, format=None): # noqa: E501 + """DataloadingJobConfigLoadingConfig - a model defined in OpenAPI + + :param import_option: The import_option of this DataloadingJobConfigLoadingConfig. # noqa: E501 + :type import_option: str + :param format: The format of this DataloadingJobConfigLoadingConfig. # noqa: E501 + :type format: DataloadingJobConfigLoadingConfigFormat + """ + self.openapi_types = { + 'import_option': str, + 'format': DataloadingJobConfigLoadingConfigFormat + } + + self.attribute_map = { + 'import_option': 'import_option', + 'format': 'format' + } + + self._import_option = import_option + self._format = format + + @classmethod + def from_dict(cls, dikt) -> 'DataloadingJobConfigLoadingConfig': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The DataloadingJobConfig_loading_config of this DataloadingJobConfigLoadingConfig. # noqa: E501 + :rtype: DataloadingJobConfigLoadingConfig + """ + return util.deserialize_model(dikt, cls) + + @property + def import_option(self) -> str: + """Gets the import_option of this DataloadingJobConfigLoadingConfig. + + + :return: The import_option of this DataloadingJobConfigLoadingConfig. + :rtype: str + """ + return self._import_option + + @import_option.setter + def import_option(self, import_option: str): + """Sets the import_option of this DataloadingJobConfigLoadingConfig. + + + :param import_option: The import_option of this DataloadingJobConfigLoadingConfig. + :type import_option: str + """ + allowed_values = ["init", "overwrite"] # noqa: E501 + if import_option not in allowed_values: + raise ValueError( + "Invalid value for `import_option` ({0}), must be one of {1}" + .format(import_option, allowed_values) + ) + + self._import_option = import_option + + @property + def format(self) -> DataloadingJobConfigLoadingConfigFormat: + """Gets the format of this DataloadingJobConfigLoadingConfig. + + + :return: The format of this DataloadingJobConfigLoadingConfig. + :rtype: DataloadingJobConfigLoadingConfigFormat + """ + return self._format + + @format.setter + def format(self, format: DataloadingJobConfigLoadingConfigFormat): + """Sets the format of this DataloadingJobConfigLoadingConfig. + + + :param format: The format of this DataloadingJobConfigLoadingConfig. + :type format: DataloadingJobConfigLoadingConfigFormat + """ + + self._format = format diff --git a/flex/coordinator/gs_flex_coordinator/models/schema_mapping_loading_config_format.py b/flex/coordinator/gs_flex_coordinator/models/dataloading_job_config_loading_config_format.py similarity index 54% rename from flex/coordinator/gs_flex_coordinator/models/schema_mapping_loading_config_format.py rename to flex/coordinator/gs_flex_coordinator/models/dataloading_job_config_loading_config_format.py index 13a317ad7642..5c49c61026fc 100644 --- a/flex/coordinator/gs_flex_coordinator/models/schema_mapping_loading_config_format.py +++ b/flex/coordinator/gs_flex_coordinator/models/dataloading_job_config_loading_config_format.py @@ -6,18 +6,18 @@ from gs_flex_coordinator import util -class SchemaMappingLoadingConfigFormat(Model): +class DataloadingJobConfigLoadingConfigFormat(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. """ def __init__(self, type=None, metadata=None): # noqa: E501 - """SchemaMappingLoadingConfigFormat - a model defined in OpenAPI + """DataloadingJobConfigLoadingConfigFormat - a model defined in OpenAPI - :param type: The type of this SchemaMappingLoadingConfigFormat. # noqa: E501 + :param type: The type of this DataloadingJobConfigLoadingConfigFormat. # noqa: E501 :type type: str - :param metadata: The metadata of this SchemaMappingLoadingConfigFormat. # noqa: E501 + :param metadata: The metadata of this DataloadingJobConfigLoadingConfigFormat. # noqa: E501 :type metadata: Dict[str, object] """ self.openapi_types = { @@ -34,32 +34,32 @@ def __init__(self, type=None, metadata=None): # noqa: E501 self._metadata = metadata @classmethod - def from_dict(cls, dikt) -> 'SchemaMappingLoadingConfigFormat': + def from_dict(cls, dikt) -> 'DataloadingJobConfigLoadingConfigFormat': """Returns the dict as a model :param dikt: A dict. :type: dict - :return: The SchemaMapping_loading_config_format of this SchemaMappingLoadingConfigFormat. # noqa: E501 - :rtype: SchemaMappingLoadingConfigFormat + :return: The DataloadingJobConfig_loading_config_format of this DataloadingJobConfigLoadingConfigFormat. # noqa: E501 + :rtype: DataloadingJobConfigLoadingConfigFormat """ return util.deserialize_model(dikt, cls) @property def type(self) -> str: - """Gets the type of this SchemaMappingLoadingConfigFormat. + """Gets the type of this DataloadingJobConfigLoadingConfigFormat. - :return: The type of this SchemaMappingLoadingConfigFormat. + :return: The type of this DataloadingJobConfigLoadingConfigFormat. :rtype: str """ return self._type @type.setter def type(self, type: str): - """Sets the type of this SchemaMappingLoadingConfigFormat. + """Sets the type of this DataloadingJobConfigLoadingConfigFormat. - :param type: The type of this SchemaMappingLoadingConfigFormat. + :param type: The type of this DataloadingJobConfigLoadingConfigFormat. :type type: str """ @@ -67,20 +67,20 @@ def type(self, type: str): @property def metadata(self) -> Dict[str, object]: - """Gets the metadata of this SchemaMappingLoadingConfigFormat. + """Gets the metadata of this DataloadingJobConfigLoadingConfigFormat. - :return: The metadata of this SchemaMappingLoadingConfigFormat. + :return: The metadata of this DataloadingJobConfigLoadingConfigFormat. :rtype: Dict[str, object] """ return self._metadata @metadata.setter def metadata(self, metadata: Dict[str, object]): - """Sets the metadata of this SchemaMappingLoadingConfigFormat. + """Sets the metadata of this DataloadingJobConfigLoadingConfigFormat. - :param metadata: The metadata of this SchemaMappingLoadingConfigFormat. + :param metadata: The metadata of this DataloadingJobConfigLoadingConfigFormat. :type metadata: Dict[str, object] """ diff --git a/flex/coordinator/gs_flex_coordinator/models/dataloading_job_config_vertices_inner.py b/flex/coordinator/gs_flex_coordinator/models/dataloading_job_config_vertices_inner.py new file mode 100644 index 000000000000..c9f91d99c79e --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/dataloading_job_config_vertices_inner.py @@ -0,0 +1,61 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator import util + + +class DataloadingJobConfigVerticesInner(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, type_name=None): # noqa: E501 + """DataloadingJobConfigVerticesInner - a model defined in OpenAPI + + :param type_name: The type_name of this DataloadingJobConfigVerticesInner. # noqa: E501 + :type type_name: str + """ + self.openapi_types = { + 'type_name': str + } + + self.attribute_map = { + 'type_name': 'type_name' + } + + self._type_name = type_name + + @classmethod + def from_dict(cls, dikt) -> 'DataloadingJobConfigVerticesInner': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The DataloadingJobConfig_vertices_inner of this DataloadingJobConfigVerticesInner. # noqa: E501 + :rtype: DataloadingJobConfigVerticesInner + """ + return util.deserialize_model(dikt, cls) + + @property + def type_name(self) -> str: + """Gets the type_name of this DataloadingJobConfigVerticesInner. + + + :return: The type_name of this DataloadingJobConfigVerticesInner. + :rtype: str + """ + return self._type_name + + @type_name.setter + def type_name(self, type_name: str): + """Sets the type_name of this DataloadingJobConfigVerticesInner. + + + :param type_name: The type_name of this DataloadingJobConfigVerticesInner. + :type type_name: str + """ + + self._type_name = type_name diff --git a/flex/coordinator/gs_flex_coordinator/models/deployment_info.py b/flex/coordinator/gs_flex_coordinator/models/deployment_info.py deleted file mode 100644 index be3e14174773..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/deployment_info.py +++ /dev/null @@ -1,205 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.deployment_info_graphs_info_value import DeploymentInfoGraphsInfoValue -from gs_flex_coordinator import util - -from gs_flex_coordinator.models.deployment_info_graphs_info_value import DeploymentInfoGraphsInfoValue # noqa: E501 - -class DeploymentInfo(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, name=None, cluster_type=None, version=None, solution=None, creation_time=None, graphs_info=None): # noqa: E501 - """DeploymentInfo - a model defined in OpenAPI - - :param name: The name of this DeploymentInfo. # noqa: E501 - :type name: str - :param cluster_type: The cluster_type of this DeploymentInfo. # noqa: E501 - :type cluster_type: str - :param version: The version of this DeploymentInfo. # noqa: E501 - :type version: str - :param solution: The solution of this DeploymentInfo. # noqa: E501 - :type solution: str - :param creation_time: The creation_time of this DeploymentInfo. # noqa: E501 - :type creation_time: str - :param graphs_info: The graphs_info of this DeploymentInfo. # noqa: E501 - :type graphs_info: Dict[str, DeploymentInfoGraphsInfoValue] - """ - self.openapi_types = { - 'name': str, - 'cluster_type': str, - 'version': str, - 'solution': str, - 'creation_time': str, - 'graphs_info': Dict[str, DeploymentInfoGraphsInfoValue] - } - - self.attribute_map = { - 'name': 'name', - 'cluster_type': 'cluster_type', - 'version': 'version', - 'solution': 'solution', - 'creation_time': 'creation_time', - 'graphs_info': 'graphs_info' - } - - self._name = name - self._cluster_type = cluster_type - self._version = version - self._solution = solution - self._creation_time = creation_time - self._graphs_info = graphs_info - - @classmethod - def from_dict(cls, dikt) -> 'DeploymentInfo': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The DeploymentInfo of this DeploymentInfo. # noqa: E501 - :rtype: DeploymentInfo - """ - return util.deserialize_model(dikt, cls) - - @property - def name(self) -> str: - """Gets the name of this DeploymentInfo. - - - :return: The name of this DeploymentInfo. - :rtype: str - """ - return self._name - - @name.setter - def name(self, name: str): - """Sets the name of this DeploymentInfo. - - - :param name: The name of this DeploymentInfo. - :type name: str - """ - - self._name = name - - @property - def cluster_type(self) -> str: - """Gets the cluster_type of this DeploymentInfo. - - - :return: The cluster_type of this DeploymentInfo. - :rtype: str - """ - return self._cluster_type - - @cluster_type.setter - def cluster_type(self, cluster_type: str): - """Sets the cluster_type of this DeploymentInfo. - - - :param cluster_type: The cluster_type of this DeploymentInfo. - :type cluster_type: str - """ - allowed_values = ["HOSTS", "KUBERNETES"] # noqa: E501 - if cluster_type not in allowed_values: - raise ValueError( - "Invalid value for `cluster_type` ({0}), must be one of {1}" - .format(cluster_type, allowed_values) - ) - - self._cluster_type = cluster_type - - @property - def version(self) -> str: - """Gets the version of this DeploymentInfo. - - - :return: The version of this DeploymentInfo. - :rtype: str - """ - return self._version - - @version.setter - def version(self, version: str): - """Sets the version of this DeploymentInfo. - - - :param version: The version of this DeploymentInfo. - :type version: str - """ - - self._version = version - - @property - def solution(self) -> str: - """Gets the solution of this DeploymentInfo. - - - :return: The solution of this DeploymentInfo. - :rtype: str - """ - return self._solution - - @solution.setter - def solution(self, solution: str): - """Sets the solution of this DeploymentInfo. - - - :param solution: The solution of this DeploymentInfo. - :type solution: str - """ - allowed_values = ["INTERACTIVE", "GRAPHSCOPE_INSIGHT"] # noqa: E501 - if solution not in allowed_values: - raise ValueError( - "Invalid value for `solution` ({0}), must be one of {1}" - .format(solution, allowed_values) - ) - - self._solution = solution - - @property - def creation_time(self) -> str: - """Gets the creation_time of this DeploymentInfo. - - - :return: The creation_time of this DeploymentInfo. - :rtype: str - """ - return self._creation_time - - @creation_time.setter - def creation_time(self, creation_time: str): - """Sets the creation_time of this DeploymentInfo. - - - :param creation_time: The creation_time of this DeploymentInfo. - :type creation_time: str - """ - - self._creation_time = creation_time - - @property - def graphs_info(self) -> Dict[str, DeploymentInfoGraphsInfoValue]: - """Gets the graphs_info of this DeploymentInfo. - - - :return: The graphs_info of this DeploymentInfo. - :rtype: Dict[str, DeploymentInfoGraphsInfoValue] - """ - return self._graphs_info - - @graphs_info.setter - def graphs_info(self, graphs_info: Dict[str, DeploymentInfoGraphsInfoValue]): - """Sets the graphs_info of this DeploymentInfo. - - - :param graphs_info: The graphs_info of this DeploymentInfo. - :type graphs_info: Dict[str, DeploymentInfoGraphsInfoValue] - """ - - self._graphs_info = graphs_info diff --git a/flex/coordinator/gs_flex_coordinator/models/deployment_info_graphs_info_value.py b/flex/coordinator/gs_flex_coordinator/models/deployment_info_graphs_info_value.py deleted file mode 100644 index 639d1c5d593e..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/deployment_info_graphs_info_value.py +++ /dev/null @@ -1,139 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util - - -class DeploymentInfoGraphsInfoValue(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, name=None, creation_time=None, update_time=None, last_dataloading_time=None): # noqa: E501 - """DeploymentInfoGraphsInfoValue - a model defined in OpenAPI - - :param name: The name of this DeploymentInfoGraphsInfoValue. # noqa: E501 - :type name: str - :param creation_time: The creation_time of this DeploymentInfoGraphsInfoValue. # noqa: E501 - :type creation_time: str - :param update_time: The update_time of this DeploymentInfoGraphsInfoValue. # noqa: E501 - :type update_time: str - :param last_dataloading_time: The last_dataloading_time of this DeploymentInfoGraphsInfoValue. # noqa: E501 - :type last_dataloading_time: str - """ - self.openapi_types = { - 'name': str, - 'creation_time': str, - 'update_time': str, - 'last_dataloading_time': str - } - - self.attribute_map = { - 'name': 'name', - 'creation_time': 'creation_time', - 'update_time': 'update_time', - 'last_dataloading_time': 'last_dataloading_time' - } - - self._name = name - self._creation_time = creation_time - self._update_time = update_time - self._last_dataloading_time = last_dataloading_time - - @classmethod - def from_dict(cls, dikt) -> 'DeploymentInfoGraphsInfoValue': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The DeploymentInfo_graphs_info_value of this DeploymentInfoGraphsInfoValue. # noqa: E501 - :rtype: DeploymentInfoGraphsInfoValue - """ - return util.deserialize_model(dikt, cls) - - @property - def name(self) -> str: - """Gets the name of this DeploymentInfoGraphsInfoValue. - - - :return: The name of this DeploymentInfoGraphsInfoValue. - :rtype: str - """ - return self._name - - @name.setter - def name(self, name: str): - """Sets the name of this DeploymentInfoGraphsInfoValue. - - - :param name: The name of this DeploymentInfoGraphsInfoValue. - :type name: str - """ - - self._name = name - - @property - def creation_time(self) -> str: - """Gets the creation_time of this DeploymentInfoGraphsInfoValue. - - - :return: The creation_time of this DeploymentInfoGraphsInfoValue. - :rtype: str - """ - return self._creation_time - - @creation_time.setter - def creation_time(self, creation_time: str): - """Sets the creation_time of this DeploymentInfoGraphsInfoValue. - - - :param creation_time: The creation_time of this DeploymentInfoGraphsInfoValue. - :type creation_time: str - """ - - self._creation_time = creation_time - - @property - def update_time(self) -> str: - """Gets the update_time of this DeploymentInfoGraphsInfoValue. - - - :return: The update_time of this DeploymentInfoGraphsInfoValue. - :rtype: str - """ - return self._update_time - - @update_time.setter - def update_time(self, update_time: str): - """Sets the update_time of this DeploymentInfoGraphsInfoValue. - - - :param update_time: The update_time of this DeploymentInfoGraphsInfoValue. - :type update_time: str - """ - - self._update_time = update_time - - @property - def last_dataloading_time(self) -> str: - """Gets the last_dataloading_time of this DeploymentInfoGraphsInfoValue. - - - :return: The last_dataloading_time of this DeploymentInfoGraphsInfoValue. - :rtype: str - """ - return self._last_dataloading_time - - @last_dataloading_time.setter - def last_dataloading_time(self, last_dataloading_time: str): - """Sets the last_dataloading_time of this DeploymentInfoGraphsInfoValue. - - - :param last_dataloading_time: The last_dataloading_time of this DeploymentInfoGraphsInfoValue. - :type last_dataloading_time: str - """ - - self._last_dataloading_time = last_dataloading_time diff --git a/flex/coordinator/gs_flex_coordinator/models/deployment_status.py b/flex/coordinator/gs_flex_coordinator/models/deployment_status.py deleted file mode 100644 index 19b0b9136599..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/deployment_status.py +++ /dev/null @@ -1,325 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util - - -class DeploymentStatus(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, name=None, container=None, image=None, labels=None, node=None, status=None, restart_count=None, cpu_value=None, memory_value=None, timestamp=None, creation_time=None): # noqa: E501 - """DeploymentStatus - a model defined in OpenAPI - - :param name: The name of this DeploymentStatus. # noqa: E501 - :type name: str - :param container: The container of this DeploymentStatus. # noqa: E501 - :type container: List[str] - :param image: The image of this DeploymentStatus. # noqa: E501 - :type image: List[str] - :param labels: The labels of this DeploymentStatus. # noqa: E501 - :type labels: List[str] - :param node: The node of this DeploymentStatus. # noqa: E501 - :type node: str - :param status: The status of this DeploymentStatus. # noqa: E501 - :type status: str - :param restart_count: The restart_count of this DeploymentStatus. # noqa: E501 - :type restart_count: int - :param cpu_value: The cpu_value of this DeploymentStatus. # noqa: E501 - :type cpu_value: int - :param memory_value: The memory_value of this DeploymentStatus. # noqa: E501 - :type memory_value: int - :param timestamp: The timestamp of this DeploymentStatus. # noqa: E501 - :type timestamp: str - :param creation_time: The creation_time of this DeploymentStatus. # noqa: E501 - :type creation_time: str - """ - self.openapi_types = { - 'name': str, - 'container': List[str], - 'image': List[str], - 'labels': List[str], - 'node': str, - 'status': str, - 'restart_count': int, - 'cpu_value': int, - 'memory_value': int, - 'timestamp': str, - 'creation_time': str - } - - self.attribute_map = { - 'name': 'name', - 'container': 'container', - 'image': 'image', - 'labels': 'labels', - 'node': 'node', - 'status': 'status', - 'restart_count': 'restart_count', - 'cpu_value': 'cpu_value', - 'memory_value': 'memory_value', - 'timestamp': 'timestamp', - 'creation_time': 'creation_time' - } - - self._name = name - self._container = container - self._image = image - self._labels = labels - self._node = node - self._status = status - self._restart_count = restart_count - self._cpu_value = cpu_value - self._memory_value = memory_value - self._timestamp = timestamp - self._creation_time = creation_time - - @classmethod - def from_dict(cls, dikt) -> 'DeploymentStatus': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The DeploymentStatus of this DeploymentStatus. # noqa: E501 - :rtype: DeploymentStatus - """ - return util.deserialize_model(dikt, cls) - - @property - def name(self) -> str: - """Gets the name of this DeploymentStatus. - - - :return: The name of this DeploymentStatus. - :rtype: str - """ - return self._name - - @name.setter - def name(self, name: str): - """Sets the name of this DeploymentStatus. - - - :param name: The name of this DeploymentStatus. - :type name: str - """ - - self._name = name - - @property - def container(self) -> List[str]: - """Gets the container of this DeploymentStatus. - - - :return: The container of this DeploymentStatus. - :rtype: List[str] - """ - return self._container - - @container.setter - def container(self, container: List[str]): - """Sets the container of this DeploymentStatus. - - - :param container: The container of this DeploymentStatus. - :type container: List[str] - """ - - self._container = container - - @property - def image(self) -> List[str]: - """Gets the image of this DeploymentStatus. - - - :return: The image of this DeploymentStatus. - :rtype: List[str] - """ - return self._image - - @image.setter - def image(self, image: List[str]): - """Sets the image of this DeploymentStatus. - - - :param image: The image of this DeploymentStatus. - :type image: List[str] - """ - - self._image = image - - @property - def labels(self) -> List[str]: - """Gets the labels of this DeploymentStatus. - - - :return: The labels of this DeploymentStatus. - :rtype: List[str] - """ - return self._labels - - @labels.setter - def labels(self, labels: List[str]): - """Sets the labels of this DeploymentStatus. - - - :param labels: The labels of this DeploymentStatus. - :type labels: List[str] - """ - - self._labels = labels - - @property - def node(self) -> str: - """Gets the node of this DeploymentStatus. - - - :return: The node of this DeploymentStatus. - :rtype: str - """ - return self._node - - @node.setter - def node(self, node: str): - """Sets the node of this DeploymentStatus. - - - :param node: The node of this DeploymentStatus. - :type node: str - """ - - self._node = node - - @property - def status(self) -> str: - """Gets the status of this DeploymentStatus. - - - :return: The status of this DeploymentStatus. - :rtype: str - """ - return self._status - - @status.setter - def status(self, status: str): - """Sets the status of this DeploymentStatus. - - - :param status: The status of this DeploymentStatus. - :type status: str - """ - - self._status = status - - @property - def restart_count(self) -> int: - """Gets the restart_count of this DeploymentStatus. - - - :return: The restart_count of this DeploymentStatus. - :rtype: int - """ - return self._restart_count - - @restart_count.setter - def restart_count(self, restart_count: int): - """Sets the restart_count of this DeploymentStatus. - - - :param restart_count: The restart_count of this DeploymentStatus. - :type restart_count: int - """ - - self._restart_count = restart_count - - @property - def cpu_value(self) -> int: - """Gets the cpu_value of this DeploymentStatus. - - cpu value in millicore # noqa: E501 - - :return: The cpu_value of this DeploymentStatus. - :rtype: int - """ - return self._cpu_value - - @cpu_value.setter - def cpu_value(self, cpu_value: int): - """Sets the cpu_value of this DeploymentStatus. - - cpu value in millicore # noqa: E501 - - :param cpu_value: The cpu_value of this DeploymentStatus. - :type cpu_value: int - """ - - self._cpu_value = cpu_value - - @property - def memory_value(self) -> int: - """Gets the memory_value of this DeploymentStatus. - - memory value in megabytes # noqa: E501 - - :return: The memory_value of this DeploymentStatus. - :rtype: int - """ - return self._memory_value - - @memory_value.setter - def memory_value(self, memory_value: int): - """Sets the memory_value of this DeploymentStatus. - - memory value in megabytes # noqa: E501 - - :param memory_value: The memory_value of this DeploymentStatus. - :type memory_value: int - """ - - self._memory_value = memory_value - - @property - def timestamp(self) -> str: - """Gets the timestamp of this DeploymentStatus. - - - :return: The timestamp of this DeploymentStatus. - :rtype: str - """ - return self._timestamp - - @timestamp.setter - def timestamp(self, timestamp: str): - """Sets the timestamp of this DeploymentStatus. - - - :param timestamp: The timestamp of this DeploymentStatus. - :type timestamp: str - """ - - self._timestamp = timestamp - - @property - def creation_time(self) -> str: - """Gets the creation_time of this DeploymentStatus. - - - :return: The creation_time of this DeploymentStatus. - :rtype: str - """ - return self._creation_time - - @creation_time.setter - def creation_time(self, creation_time: str): - """Sets the creation_time of this DeploymentStatus. - - - :param creation_time: The creation_time of this DeploymentStatus. - :type creation_time: str - """ - - self._creation_time = creation_time diff --git a/flex/coordinator/gs_flex_coordinator/models/edge_data_source.py b/flex/coordinator/gs_flex_coordinator/models/edge_data_source.py deleted file mode 100644 index 4fca6c37a4a7..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/edge_data_source.py +++ /dev/null @@ -1,249 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util - - -class EdgeDataSource(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, data_source=None, type_name=None, source_vertex=None, destination_vertex=None, location=None, source_pk_column_map=None, destination_pk_column_map=None, property_mapping=None): # noqa: E501 - """EdgeDataSource - a model defined in OpenAPI - - :param data_source: The data_source of this EdgeDataSource. # noqa: E501 - :type data_source: str - :param type_name: The type_name of this EdgeDataSource. # noqa: E501 - :type type_name: str - :param source_vertex: The source_vertex of this EdgeDataSource. # noqa: E501 - :type source_vertex: str - :param destination_vertex: The destination_vertex of this EdgeDataSource. # noqa: E501 - :type destination_vertex: str - :param location: The location of this EdgeDataSource. # noqa: E501 - :type location: str - :param source_pk_column_map: The source_pk_column_map of this EdgeDataSource. # noqa: E501 - :type source_pk_column_map: Dict[str, object] - :param destination_pk_column_map: The destination_pk_column_map of this EdgeDataSource. # noqa: E501 - :type destination_pk_column_map: Dict[str, object] - :param property_mapping: The property_mapping of this EdgeDataSource. # noqa: E501 - :type property_mapping: Dict[str, object] - """ - self.openapi_types = { - 'data_source': str, - 'type_name': str, - 'source_vertex': str, - 'destination_vertex': str, - 'location': str, - 'source_pk_column_map': Dict[str, object], - 'destination_pk_column_map': Dict[str, object], - 'property_mapping': Dict[str, object] - } - - self.attribute_map = { - 'data_source': 'data_source', - 'type_name': 'type_name', - 'source_vertex': 'source_vertex', - 'destination_vertex': 'destination_vertex', - 'location': 'location', - 'source_pk_column_map': 'source_pk_column_map', - 'destination_pk_column_map': 'destination_pk_column_map', - 'property_mapping': 'property_mapping' - } - - self._data_source = data_source - self._type_name = type_name - self._source_vertex = source_vertex - self._destination_vertex = destination_vertex - self._location = location - self._source_pk_column_map = source_pk_column_map - self._destination_pk_column_map = destination_pk_column_map - self._property_mapping = property_mapping - - @classmethod - def from_dict(cls, dikt) -> 'EdgeDataSource': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The EdgeDataSource of this EdgeDataSource. # noqa: E501 - :rtype: EdgeDataSource - """ - return util.deserialize_model(dikt, cls) - - @property - def data_source(self) -> str: - """Gets the data_source of this EdgeDataSource. - - - :return: The data_source of this EdgeDataSource. - :rtype: str - """ - return self._data_source - - @data_source.setter - def data_source(self, data_source: str): - """Sets the data_source of this EdgeDataSource. - - - :param data_source: The data_source of this EdgeDataSource. - :type data_source: str - """ - allowed_values = ["ODPS", "FILE"] # noqa: E501 - if data_source not in allowed_values: - raise ValueError( - "Invalid value for `data_source` ({0}), must be one of {1}" - .format(data_source, allowed_values) - ) - - self._data_source = data_source - - @property - def type_name(self) -> str: - """Gets the type_name of this EdgeDataSource. - - - :return: The type_name of this EdgeDataSource. - :rtype: str - """ - return self._type_name - - @type_name.setter - def type_name(self, type_name: str): - """Sets the type_name of this EdgeDataSource. - - - :param type_name: The type_name of this EdgeDataSource. - :type type_name: str - """ - - self._type_name = type_name - - @property - def source_vertex(self) -> str: - """Gets the source_vertex of this EdgeDataSource. - - - :return: The source_vertex of this EdgeDataSource. - :rtype: str - """ - return self._source_vertex - - @source_vertex.setter - def source_vertex(self, source_vertex: str): - """Sets the source_vertex of this EdgeDataSource. - - - :param source_vertex: The source_vertex of this EdgeDataSource. - :type source_vertex: str - """ - - self._source_vertex = source_vertex - - @property - def destination_vertex(self) -> str: - """Gets the destination_vertex of this EdgeDataSource. - - - :return: The destination_vertex of this EdgeDataSource. - :rtype: str - """ - return self._destination_vertex - - @destination_vertex.setter - def destination_vertex(self, destination_vertex: str): - """Sets the destination_vertex of this EdgeDataSource. - - - :param destination_vertex: The destination_vertex of this EdgeDataSource. - :type destination_vertex: str - """ - - self._destination_vertex = destination_vertex - - @property - def location(self) -> str: - """Gets the location of this EdgeDataSource. - - - :return: The location of this EdgeDataSource. - :rtype: str - """ - return self._location - - @location.setter - def location(self, location: str): - """Sets the location of this EdgeDataSource. - - - :param location: The location of this EdgeDataSource. - :type location: str - """ - - self._location = location - - @property - def source_pk_column_map(self) -> Dict[str, object]: - """Gets the source_pk_column_map of this EdgeDataSource. - - - :return: The source_pk_column_map of this EdgeDataSource. - :rtype: Dict[str, object] - """ - return self._source_pk_column_map - - @source_pk_column_map.setter - def source_pk_column_map(self, source_pk_column_map: Dict[str, object]): - """Sets the source_pk_column_map of this EdgeDataSource. - - - :param source_pk_column_map: The source_pk_column_map of this EdgeDataSource. - :type source_pk_column_map: Dict[str, object] - """ - - self._source_pk_column_map = source_pk_column_map - - @property - def destination_pk_column_map(self) -> Dict[str, object]: - """Gets the destination_pk_column_map of this EdgeDataSource. - - - :return: The destination_pk_column_map of this EdgeDataSource. - :rtype: Dict[str, object] - """ - return self._destination_pk_column_map - - @destination_pk_column_map.setter - def destination_pk_column_map(self, destination_pk_column_map: Dict[str, object]): - """Sets the destination_pk_column_map of this EdgeDataSource. - - - :param destination_pk_column_map: The destination_pk_column_map of this EdgeDataSource. - :type destination_pk_column_map: Dict[str, object] - """ - - self._destination_pk_column_map = destination_pk_column_map - - @property - def property_mapping(self) -> Dict[str, object]: - """Gets the property_mapping of this EdgeDataSource. - - - :return: The property_mapping of this EdgeDataSource. - :rtype: Dict[str, object] - """ - return self._property_mapping - - @property_mapping.setter - def property_mapping(self, property_mapping: Dict[str, object]): - """Sets the property_mapping of this EdgeDataSource. - - - :param property_mapping: The property_mapping of this EdgeDataSource. - :type property_mapping: Dict[str, object] - """ - - self._property_mapping = property_mapping diff --git a/flex/coordinator/gs_flex_coordinator/models/edge_mapping.py b/flex/coordinator/gs_flex_coordinator/models/edge_mapping.py index fe083bbede2b..0cfe5bcde0fb 100644 --- a/flex/coordinator/gs_flex_coordinator/models/edge_mapping.py +++ b/flex/coordinator/gs_flex_coordinator/models/edge_mapping.py @@ -4,14 +4,10 @@ from gs_flex_coordinator.models.base_model import Model from gs_flex_coordinator.models.column_mapping import ColumnMapping -from gs_flex_coordinator.models.edge_mapping_destination_vertex_mappings_inner import EdgeMappingDestinationVertexMappingsInner -from gs_flex_coordinator.models.edge_mapping_source_vertex_mappings_inner import EdgeMappingSourceVertexMappingsInner from gs_flex_coordinator.models.edge_mapping_type_triplet import EdgeMappingTypeTriplet from gs_flex_coordinator import util from gs_flex_coordinator.models.column_mapping import ColumnMapping # noqa: E501 -from gs_flex_coordinator.models.edge_mapping_destination_vertex_mappings_inner import EdgeMappingDestinationVertexMappingsInner # noqa: E501 -from gs_flex_coordinator.models.edge_mapping_source_vertex_mappings_inner import EdgeMappingSourceVertexMappingsInner # noqa: E501 from gs_flex_coordinator.models.edge_mapping_type_triplet import EdgeMappingTypeTriplet # noqa: E501 class EdgeMapping(Model): @@ -28,17 +24,17 @@ def __init__(self, type_triplet=None, inputs=None, source_vertex_mappings=None, :param inputs: The inputs of this EdgeMapping. # noqa: E501 :type inputs: List[str] :param source_vertex_mappings: The source_vertex_mappings of this EdgeMapping. # noqa: E501 - :type source_vertex_mappings: List[EdgeMappingSourceVertexMappingsInner] + :type source_vertex_mappings: List[ColumnMapping] :param destination_vertex_mappings: The destination_vertex_mappings of this EdgeMapping. # noqa: E501 - :type destination_vertex_mappings: List[EdgeMappingDestinationVertexMappingsInner] + :type destination_vertex_mappings: List[ColumnMapping] :param column_mappings: The column_mappings of this EdgeMapping. # noqa: E501 :type column_mappings: List[ColumnMapping] """ self.openapi_types = { 'type_triplet': EdgeMappingTypeTriplet, 'inputs': List[str], - 'source_vertex_mappings': List[EdgeMappingSourceVertexMappingsInner], - 'destination_vertex_mappings': List[EdgeMappingDestinationVertexMappingsInner], + 'source_vertex_mappings': List[ColumnMapping], + 'destination_vertex_mappings': List[ColumnMapping], 'column_mappings': List[ColumnMapping] } @@ -85,6 +81,8 @@ def type_triplet(self, type_triplet: EdgeMappingTypeTriplet): :param type_triplet: The type_triplet of this EdgeMapping. :type type_triplet: EdgeMappingTypeTriplet """ + if type_triplet is None: + raise ValueError("Invalid value for `type_triplet`, must not be `None`") # noqa: E501 self._type_triplet = type_triplet @@ -106,48 +104,54 @@ def inputs(self, inputs: List[str]): :param inputs: The inputs of this EdgeMapping. :type inputs: List[str] """ + if inputs is None: + raise ValueError("Invalid value for `inputs`, must not be `None`") # noqa: E501 self._inputs = inputs @property - def source_vertex_mappings(self) -> List[EdgeMappingSourceVertexMappingsInner]: + def source_vertex_mappings(self) -> List[ColumnMapping]: """Gets the source_vertex_mappings of this EdgeMapping. :return: The source_vertex_mappings of this EdgeMapping. - :rtype: List[EdgeMappingSourceVertexMappingsInner] + :rtype: List[ColumnMapping] """ return self._source_vertex_mappings @source_vertex_mappings.setter - def source_vertex_mappings(self, source_vertex_mappings: List[EdgeMappingSourceVertexMappingsInner]): + def source_vertex_mappings(self, source_vertex_mappings: List[ColumnMapping]): """Sets the source_vertex_mappings of this EdgeMapping. :param source_vertex_mappings: The source_vertex_mappings of this EdgeMapping. - :type source_vertex_mappings: List[EdgeMappingSourceVertexMappingsInner] + :type source_vertex_mappings: List[ColumnMapping] """ + if source_vertex_mappings is None: + raise ValueError("Invalid value for `source_vertex_mappings`, must not be `None`") # noqa: E501 self._source_vertex_mappings = source_vertex_mappings @property - def destination_vertex_mappings(self) -> List[EdgeMappingDestinationVertexMappingsInner]: + def destination_vertex_mappings(self) -> List[ColumnMapping]: """Gets the destination_vertex_mappings of this EdgeMapping. :return: The destination_vertex_mappings of this EdgeMapping. - :rtype: List[EdgeMappingDestinationVertexMappingsInner] + :rtype: List[ColumnMapping] """ return self._destination_vertex_mappings @destination_vertex_mappings.setter - def destination_vertex_mappings(self, destination_vertex_mappings: List[EdgeMappingDestinationVertexMappingsInner]): + def destination_vertex_mappings(self, destination_vertex_mappings: List[ColumnMapping]): """Sets the destination_vertex_mappings of this EdgeMapping. :param destination_vertex_mappings: The destination_vertex_mappings of this EdgeMapping. - :type destination_vertex_mappings: List[EdgeMappingDestinationVertexMappingsInner] + :type destination_vertex_mappings: List[ColumnMapping] """ + if destination_vertex_mappings is None: + raise ValueError("Invalid value for `destination_vertex_mappings`, must not be `None`") # noqa: E501 self._destination_vertex_mappings = destination_vertex_mappings diff --git a/flex/coordinator/gs_flex_coordinator/models/edge_mapping_destination_vertex_mappings_inner.py b/flex/coordinator/gs_flex_coordinator/models/edge_mapping_destination_vertex_mappings_inner.py deleted file mode 100644 index 0caa3d499d91..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/edge_mapping_destination_vertex_mappings_inner.py +++ /dev/null @@ -1,63 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.edge_mapping_source_vertex_mappings_inner_column import EdgeMappingSourceVertexMappingsInnerColumn -from gs_flex_coordinator import util - -from gs_flex_coordinator.models.edge_mapping_source_vertex_mappings_inner_column import EdgeMappingSourceVertexMappingsInnerColumn # noqa: E501 - -class EdgeMappingDestinationVertexMappingsInner(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, column=None): # noqa: E501 - """EdgeMappingDestinationVertexMappingsInner - a model defined in OpenAPI - - :param column: The column of this EdgeMappingDestinationVertexMappingsInner. # noqa: E501 - :type column: EdgeMappingSourceVertexMappingsInnerColumn - """ - self.openapi_types = { - 'column': EdgeMappingSourceVertexMappingsInnerColumn - } - - self.attribute_map = { - 'column': 'column' - } - - self._column = column - - @classmethod - def from_dict(cls, dikt) -> 'EdgeMappingDestinationVertexMappingsInner': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The EdgeMapping_destination_vertex_mappings_inner of this EdgeMappingDestinationVertexMappingsInner. # noqa: E501 - :rtype: EdgeMappingDestinationVertexMappingsInner - """ - return util.deserialize_model(dikt, cls) - - @property - def column(self) -> EdgeMappingSourceVertexMappingsInnerColumn: - """Gets the column of this EdgeMappingDestinationVertexMappingsInner. - - - :return: The column of this EdgeMappingDestinationVertexMappingsInner. - :rtype: EdgeMappingSourceVertexMappingsInnerColumn - """ - return self._column - - @column.setter - def column(self, column: EdgeMappingSourceVertexMappingsInnerColumn): - """Sets the column of this EdgeMappingDestinationVertexMappingsInner. - - - :param column: The column of this EdgeMappingDestinationVertexMappingsInner. - :type column: EdgeMappingSourceVertexMappingsInnerColumn - """ - - self._column = column diff --git a/flex/coordinator/gs_flex_coordinator/models/edge_mapping_source_vertex_mappings_inner.py b/flex/coordinator/gs_flex_coordinator/models/edge_mapping_source_vertex_mappings_inner.py deleted file mode 100644 index 4650c8f66a73..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/edge_mapping_source_vertex_mappings_inner.py +++ /dev/null @@ -1,63 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.edge_mapping_source_vertex_mappings_inner_column import EdgeMappingSourceVertexMappingsInnerColumn -from gs_flex_coordinator import util - -from gs_flex_coordinator.models.edge_mapping_source_vertex_mappings_inner_column import EdgeMappingSourceVertexMappingsInnerColumn # noqa: E501 - -class EdgeMappingSourceVertexMappingsInner(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, column=None): # noqa: E501 - """EdgeMappingSourceVertexMappingsInner - a model defined in OpenAPI - - :param column: The column of this EdgeMappingSourceVertexMappingsInner. # noqa: E501 - :type column: EdgeMappingSourceVertexMappingsInnerColumn - """ - self.openapi_types = { - 'column': EdgeMappingSourceVertexMappingsInnerColumn - } - - self.attribute_map = { - 'column': 'column' - } - - self._column = column - - @classmethod - def from_dict(cls, dikt) -> 'EdgeMappingSourceVertexMappingsInner': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The EdgeMapping_source_vertex_mappings_inner of this EdgeMappingSourceVertexMappingsInner. # noqa: E501 - :rtype: EdgeMappingSourceVertexMappingsInner - """ - return util.deserialize_model(dikt, cls) - - @property - def column(self) -> EdgeMappingSourceVertexMappingsInnerColumn: - """Gets the column of this EdgeMappingSourceVertexMappingsInner. - - - :return: The column of this EdgeMappingSourceVertexMappingsInner. - :rtype: EdgeMappingSourceVertexMappingsInnerColumn - """ - return self._column - - @column.setter - def column(self, column: EdgeMappingSourceVertexMappingsInnerColumn): - """Sets the column of this EdgeMappingSourceVertexMappingsInner. - - - :param column: The column of this EdgeMappingSourceVertexMappingsInner. - :type column: EdgeMappingSourceVertexMappingsInnerColumn - """ - - self._column = column diff --git a/flex/coordinator/gs_flex_coordinator/models/edge_mapping_type_triplet.py b/flex/coordinator/gs_flex_coordinator/models/edge_mapping_type_triplet.py index 7f8244436d10..9312fd4d25b5 100644 --- a/flex/coordinator/gs_flex_coordinator/models/edge_mapping_type_triplet.py +++ b/flex/coordinator/gs_flex_coordinator/models/edge_mapping_type_triplet.py @@ -67,6 +67,8 @@ def edge(self, edge: str): :param edge: The edge of this EdgeMappingTypeTriplet. :type edge: str """ + if edge is None: + raise ValueError("Invalid value for `edge`, must not be `None`") # noqa: E501 self._edge = edge @@ -88,6 +90,8 @@ def source_vertex(self, source_vertex: str): :param source_vertex: The source_vertex of this EdgeMappingTypeTriplet. :type source_vertex: str """ + if source_vertex is None: + raise ValueError("Invalid value for `source_vertex`, must not be `None`") # noqa: E501 self._source_vertex = source_vertex @@ -109,5 +113,7 @@ def destination_vertex(self, destination_vertex: str): :param destination_vertex: The destination_vertex of this EdgeMappingTypeTriplet. :type destination_vertex: str """ + if destination_vertex is None: + raise ValueError("Invalid value for `destination_vertex`, must not be `None`") # noqa: E501 self._destination_vertex = destination_vertex diff --git a/flex/coordinator/gs_flex_coordinator/models/edge_type.py b/flex/coordinator/gs_flex_coordinator/models/edge_type.py deleted file mode 100644 index d0ed8f513746..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/edge_type.py +++ /dev/null @@ -1,143 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.edge_type_vertex_type_pair_relations_inner import EdgeTypeVertexTypePairRelationsInner -from gs_flex_coordinator.models.model_property import ModelProperty -from gs_flex_coordinator import util - -from gs_flex_coordinator.models.edge_type_vertex_type_pair_relations_inner import EdgeTypeVertexTypePairRelationsInner # noqa: E501 -from gs_flex_coordinator.models.model_property import ModelProperty # noqa: E501 - -class EdgeType(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, type_id=None, type_name=None, vertex_type_pair_relations=None, properties=None): # noqa: E501 - """EdgeType - a model defined in OpenAPI - - :param type_id: The type_id of this EdgeType. # noqa: E501 - :type type_id: int - :param type_name: The type_name of this EdgeType. # noqa: E501 - :type type_name: str - :param vertex_type_pair_relations: The vertex_type_pair_relations of this EdgeType. # noqa: E501 - :type vertex_type_pair_relations: List[EdgeTypeVertexTypePairRelationsInner] - :param properties: The properties of this EdgeType. # noqa: E501 - :type properties: List[ModelProperty] - """ - self.openapi_types = { - 'type_id': int, - 'type_name': str, - 'vertex_type_pair_relations': List[EdgeTypeVertexTypePairRelationsInner], - 'properties': List[ModelProperty] - } - - self.attribute_map = { - 'type_id': 'type_id', - 'type_name': 'type_name', - 'vertex_type_pair_relations': 'vertex_type_pair_relations', - 'properties': 'properties' - } - - self._type_id = type_id - self._type_name = type_name - self._vertex_type_pair_relations = vertex_type_pair_relations - self._properties = properties - - @classmethod - def from_dict(cls, dikt) -> 'EdgeType': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The EdgeType of this EdgeType. # noqa: E501 - :rtype: EdgeType - """ - return util.deserialize_model(dikt, cls) - - @property - def type_id(self) -> int: - """Gets the type_id of this EdgeType. - - - :return: The type_id of this EdgeType. - :rtype: int - """ - return self._type_id - - @type_id.setter - def type_id(self, type_id: int): - """Sets the type_id of this EdgeType. - - - :param type_id: The type_id of this EdgeType. - :type type_id: int - """ - - self._type_id = type_id - - @property - def type_name(self) -> str: - """Gets the type_name of this EdgeType. - - - :return: The type_name of this EdgeType. - :rtype: str - """ - return self._type_name - - @type_name.setter - def type_name(self, type_name: str): - """Sets the type_name of this EdgeType. - - - :param type_name: The type_name of this EdgeType. - :type type_name: str - """ - - self._type_name = type_name - - @property - def vertex_type_pair_relations(self) -> List[EdgeTypeVertexTypePairRelationsInner]: - """Gets the vertex_type_pair_relations of this EdgeType. - - - :return: The vertex_type_pair_relations of this EdgeType. - :rtype: List[EdgeTypeVertexTypePairRelationsInner] - """ - return self._vertex_type_pair_relations - - @vertex_type_pair_relations.setter - def vertex_type_pair_relations(self, vertex_type_pair_relations: List[EdgeTypeVertexTypePairRelationsInner]): - """Sets the vertex_type_pair_relations of this EdgeType. - - - :param vertex_type_pair_relations: The vertex_type_pair_relations of this EdgeType. - :type vertex_type_pair_relations: List[EdgeTypeVertexTypePairRelationsInner] - """ - - self._vertex_type_pair_relations = vertex_type_pair_relations - - @property - def properties(self) -> List[ModelProperty]: - """Gets the properties of this EdgeType. - - - :return: The properties of this EdgeType. - :rtype: List[ModelProperty] - """ - return self._properties - - @properties.setter - def properties(self, properties: List[ModelProperty]): - """Sets the properties of this EdgeType. - - - :param properties: The properties of this EdgeType. - :type properties: List[ModelProperty] - """ - - self._properties = properties diff --git a/flex/coordinator/gs_flex_coordinator/models/edge_type_vertex_type_pair_relations_inner.py b/flex/coordinator/gs_flex_coordinator/models/edge_type_vertex_type_pair_relations_inner.py deleted file mode 100644 index 9bf34c9c37fb..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/edge_type_vertex_type_pair_relations_inner.py +++ /dev/null @@ -1,147 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.edge_type_vertex_type_pair_relations_inner_x_csr_params import EdgeTypeVertexTypePairRelationsInnerXCsrParams -from gs_flex_coordinator import util - -from gs_flex_coordinator.models.edge_type_vertex_type_pair_relations_inner_x_csr_params import EdgeTypeVertexTypePairRelationsInnerXCsrParams # noqa: E501 - -class EdgeTypeVertexTypePairRelationsInner(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, source_vertex=None, destination_vertex=None, relation=None, x_csr_params=None): # noqa: E501 - """EdgeTypeVertexTypePairRelationsInner - a model defined in OpenAPI - - :param source_vertex: The source_vertex of this EdgeTypeVertexTypePairRelationsInner. # noqa: E501 - :type source_vertex: str - :param destination_vertex: The destination_vertex of this EdgeTypeVertexTypePairRelationsInner. # noqa: E501 - :type destination_vertex: str - :param relation: The relation of this EdgeTypeVertexTypePairRelationsInner. # noqa: E501 - :type relation: str - :param x_csr_params: The x_csr_params of this EdgeTypeVertexTypePairRelationsInner. # noqa: E501 - :type x_csr_params: EdgeTypeVertexTypePairRelationsInnerXCsrParams - """ - self.openapi_types = { - 'source_vertex': str, - 'destination_vertex': str, - 'relation': str, - 'x_csr_params': EdgeTypeVertexTypePairRelationsInnerXCsrParams - } - - self.attribute_map = { - 'source_vertex': 'source_vertex', - 'destination_vertex': 'destination_vertex', - 'relation': 'relation', - 'x_csr_params': 'x_csr_params' - } - - self._source_vertex = source_vertex - self._destination_vertex = destination_vertex - self._relation = relation - self._x_csr_params = x_csr_params - - @classmethod - def from_dict(cls, dikt) -> 'EdgeTypeVertexTypePairRelationsInner': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The EdgeType_vertex_type_pair_relations_inner of this EdgeTypeVertexTypePairRelationsInner. # noqa: E501 - :rtype: EdgeTypeVertexTypePairRelationsInner - """ - return util.deserialize_model(dikt, cls) - - @property - def source_vertex(self) -> str: - """Gets the source_vertex of this EdgeTypeVertexTypePairRelationsInner. - - - :return: The source_vertex of this EdgeTypeVertexTypePairRelationsInner. - :rtype: str - """ - return self._source_vertex - - @source_vertex.setter - def source_vertex(self, source_vertex: str): - """Sets the source_vertex of this EdgeTypeVertexTypePairRelationsInner. - - - :param source_vertex: The source_vertex of this EdgeTypeVertexTypePairRelationsInner. - :type source_vertex: str - """ - - self._source_vertex = source_vertex - - @property - def destination_vertex(self) -> str: - """Gets the destination_vertex of this EdgeTypeVertexTypePairRelationsInner. - - - :return: The destination_vertex of this EdgeTypeVertexTypePairRelationsInner. - :rtype: str - """ - return self._destination_vertex - - @destination_vertex.setter - def destination_vertex(self, destination_vertex: str): - """Sets the destination_vertex of this EdgeTypeVertexTypePairRelationsInner. - - - :param destination_vertex: The destination_vertex of this EdgeTypeVertexTypePairRelationsInner. - :type destination_vertex: str - """ - - self._destination_vertex = destination_vertex - - @property - def relation(self) -> str: - """Gets the relation of this EdgeTypeVertexTypePairRelationsInner. - - - :return: The relation of this EdgeTypeVertexTypePairRelationsInner. - :rtype: str - """ - return self._relation - - @relation.setter - def relation(self, relation: str): - """Sets the relation of this EdgeTypeVertexTypePairRelationsInner. - - - :param relation: The relation of this EdgeTypeVertexTypePairRelationsInner. - :type relation: str - """ - allowed_values = ["MANY_TO_MANY", "ONE_TO_MANY", "MANY_TO_ONE", "ONE_TO_ONE"] # noqa: E501 - if relation not in allowed_values: - raise ValueError( - "Invalid value for `relation` ({0}), must be one of {1}" - .format(relation, allowed_values) - ) - - self._relation = relation - - @property - def x_csr_params(self) -> EdgeTypeVertexTypePairRelationsInnerXCsrParams: - """Gets the x_csr_params of this EdgeTypeVertexTypePairRelationsInner. - - - :return: The x_csr_params of this EdgeTypeVertexTypePairRelationsInner. - :rtype: EdgeTypeVertexTypePairRelationsInnerXCsrParams - """ - return self._x_csr_params - - @x_csr_params.setter - def x_csr_params(self, x_csr_params: EdgeTypeVertexTypePairRelationsInnerXCsrParams): - """Sets the x_csr_params of this EdgeTypeVertexTypePairRelationsInner. - - - :param x_csr_params: The x_csr_params of this EdgeTypeVertexTypePairRelationsInner. - :type x_csr_params: EdgeTypeVertexTypePairRelationsInnerXCsrParams - """ - - self._x_csr_params = x_csr_params diff --git a/flex/coordinator/gs_flex_coordinator/models/error.py b/flex/coordinator/gs_flex_coordinator/models/error.py new file mode 100644 index 000000000000..b177257b5670 --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/error.py @@ -0,0 +1,95 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator import util + + +class Error(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, code=None, message=None): # noqa: E501 + """Error - a model defined in OpenAPI + + :param code: The code of this Error. # noqa: E501 + :type code: int + :param message: The message of this Error. # noqa: E501 + :type message: str + """ + self.openapi_types = { + 'code': int, + 'message': str + } + + self.attribute_map = { + 'code': 'code', + 'message': 'message' + } + + self._code = code + self._message = message + + @classmethod + def from_dict(cls, dikt) -> 'Error': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Error of this Error. # noqa: E501 + :rtype: Error + """ + return util.deserialize_model(dikt, cls) + + @property + def code(self) -> int: + """Gets the code of this Error. + + Error code # noqa: E501 + + :return: The code of this Error. + :rtype: int + """ + return self._code + + @code.setter + def code(self, code: int): + """Sets the code of this Error. + + Error code # noqa: E501 + + :param code: The code of this Error. + :type code: int + """ + if code is None: + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + + self._code = code + + @property + def message(self) -> str: + """Gets the message of this Error. + + Error message # noqa: E501 + + :return: The message of this Error. + :rtype: str + """ + return self._message + + @message.setter + def message(self, message: str): + """Sets the message of this Error. + + Error message # noqa: E501 + + :param message: The message of this Error. + :type message: str + """ + if message is None: + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message diff --git a/flex/coordinator/gs_flex_coordinator/models/alert_message.py b/flex/coordinator/gs_flex_coordinator/models/get_alert_message_response.py similarity index 51% rename from flex/coordinator/gs_flex_coordinator/models/alert_message.py rename to flex/coordinator/gs_flex_coordinator/models/get_alert_message_response.py index 84c4b2682af8..0ac7826077d4 100644 --- a/flex/coordinator/gs_flex_coordinator/models/alert_message.py +++ b/flex/coordinator/gs_flex_coordinator/models/get_alert_message_response.py @@ -6,34 +6,34 @@ from gs_flex_coordinator import util -class AlertMessage(Model): +class GetAlertMessageResponse(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. """ - def __init__(self, message_id=None, alert_name=None, severity=None, metric_type=None, target=None, trigger_time=None, status=None, message=None): # noqa: E501 - """AlertMessage - a model defined in OpenAPI + def __init__(self, id=None, alert_name=None, severity=None, metric_type=None, target=None, trigger_time=None, status=None, message=None): # noqa: E501 + """GetAlertMessageResponse - a model defined in OpenAPI - :param message_id: The message_id of this AlertMessage. # noqa: E501 - :type message_id: str - :param alert_name: The alert_name of this AlertMessage. # noqa: E501 + :param id: The id of this GetAlertMessageResponse. # noqa: E501 + :type id: str + :param alert_name: The alert_name of this GetAlertMessageResponse. # noqa: E501 :type alert_name: str - :param severity: The severity of this AlertMessage. # noqa: E501 + :param severity: The severity of this GetAlertMessageResponse. # noqa: E501 :type severity: str - :param metric_type: The metric_type of this AlertMessage. # noqa: E501 + :param metric_type: The metric_type of this GetAlertMessageResponse. # noqa: E501 :type metric_type: str - :param target: The target of this AlertMessage. # noqa: E501 + :param target: The target of this GetAlertMessageResponse. # noqa: E501 :type target: List[str] - :param trigger_time: The trigger_time of this AlertMessage. # noqa: E501 + :param trigger_time: The trigger_time of this GetAlertMessageResponse. # noqa: E501 :type trigger_time: str - :param status: The status of this AlertMessage. # noqa: E501 + :param status: The status of this GetAlertMessageResponse. # noqa: E501 :type status: str - :param message: The message of this AlertMessage. # noqa: E501 + :param message: The message of this GetAlertMessageResponse. # noqa: E501 :type message: str """ self.openapi_types = { - 'message_id': str, + 'id': str, 'alert_name': str, 'severity': str, 'metric_type': str, @@ -44,7 +44,7 @@ def __init__(self, message_id=None, alert_name=None, severity=None, metric_type= } self.attribute_map = { - 'message_id': 'message_id', + 'id': 'id', 'alert_name': 'alert_name', 'severity': 'severity', 'metric_type': 'metric_type', @@ -54,7 +54,7 @@ def __init__(self, message_id=None, alert_name=None, severity=None, metric_type= 'message': 'message' } - self._message_id = message_id + self._id = id self._alert_name = alert_name self._severity = severity self._metric_type = metric_type @@ -64,76 +64,80 @@ def __init__(self, message_id=None, alert_name=None, severity=None, metric_type= self._message = message @classmethod - def from_dict(cls, dikt) -> 'AlertMessage': + def from_dict(cls, dikt) -> 'GetAlertMessageResponse': """Returns the dict as a model :param dikt: A dict. :type: dict - :return: The AlertMessage of this AlertMessage. # noqa: E501 - :rtype: AlertMessage + :return: The GetAlertMessageResponse of this GetAlertMessageResponse. # noqa: E501 + :rtype: GetAlertMessageResponse """ return util.deserialize_model(dikt, cls) @property - def message_id(self) -> str: - """Gets the message_id of this AlertMessage. + def id(self) -> str: + """Gets the id of this GetAlertMessageResponse. Generated in server side # noqa: E501 - :return: The message_id of this AlertMessage. + :return: The id of this GetAlertMessageResponse. :rtype: str """ - return self._message_id + return self._id - @message_id.setter - def message_id(self, message_id: str): - """Sets the message_id of this AlertMessage. + @id.setter + def id(self, id: str): + """Sets the id of this GetAlertMessageResponse. Generated in server side # noqa: E501 - :param message_id: The message_id of this AlertMessage. - :type message_id: str + :param id: The id of this GetAlertMessageResponse. + :type id: str """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - self._message_id = message_id + self._id = id @property def alert_name(self) -> str: - """Gets the alert_name of this AlertMessage. + """Gets the alert_name of this GetAlertMessageResponse. - :return: The alert_name of this AlertMessage. + :return: The alert_name of this GetAlertMessageResponse. :rtype: str """ return self._alert_name @alert_name.setter def alert_name(self, alert_name: str): - """Sets the alert_name of this AlertMessage. + """Sets the alert_name of this GetAlertMessageResponse. - :param alert_name: The alert_name of this AlertMessage. + :param alert_name: The alert_name of this GetAlertMessageResponse. :type alert_name: str """ + if alert_name is None: + raise ValueError("Invalid value for `alert_name`, must not be `None`") # noqa: E501 self._alert_name = alert_name @property def severity(self) -> str: - """Gets the severity of this AlertMessage. + """Gets the severity of this GetAlertMessageResponse. - :return: The severity of this AlertMessage. + :return: The severity of this GetAlertMessageResponse. :rtype: str """ return self._severity @severity.setter def severity(self, severity: str): - """Sets the severity of this AlertMessage. + """Sets the severity of this GetAlertMessageResponse. - :param severity: The severity of this AlertMessage. + :param severity: The severity of this GetAlertMessageResponse. :type severity: str """ allowed_values = ["warning", "emergency"] # noqa: E501 @@ -147,20 +151,20 @@ def severity(self, severity: str): @property def metric_type(self) -> str: - """Gets the metric_type of this AlertMessage. + """Gets the metric_type of this GetAlertMessageResponse. - :return: The metric_type of this AlertMessage. + :return: The metric_type of this GetAlertMessageResponse. :rtype: str """ return self._metric_type @metric_type.setter def metric_type(self, metric_type: str): - """Sets the metric_type of this AlertMessage. + """Sets the metric_type of this GetAlertMessageResponse. - :param metric_type: The metric_type of this AlertMessage. + :param metric_type: The metric_type of this GetAlertMessageResponse. :type metric_type: str """ allowed_values = ["node", "service"] # noqa: E501 @@ -174,62 +178,66 @@ def metric_type(self, metric_type: str): @property def target(self) -> List[str]: - """Gets the target of this AlertMessage. + """Gets the target of this GetAlertMessageResponse. - :return: The target of this AlertMessage. + :return: The target of this GetAlertMessageResponse. :rtype: List[str] """ return self._target @target.setter def target(self, target: List[str]): - """Sets the target of this AlertMessage. + """Sets the target of this GetAlertMessageResponse. - :param target: The target of this AlertMessage. + :param target: The target of this GetAlertMessageResponse. :type target: List[str] """ + if target is None: + raise ValueError("Invalid value for `target`, must not be `None`") # noqa: E501 self._target = target @property def trigger_time(self) -> str: - """Gets the trigger_time of this AlertMessage. + """Gets the trigger_time of this GetAlertMessageResponse. - :return: The trigger_time of this AlertMessage. + :return: The trigger_time of this GetAlertMessageResponse. :rtype: str """ return self._trigger_time @trigger_time.setter def trigger_time(self, trigger_time: str): - """Sets the trigger_time of this AlertMessage. + """Sets the trigger_time of this GetAlertMessageResponse. - :param trigger_time: The trigger_time of this AlertMessage. + :param trigger_time: The trigger_time of this GetAlertMessageResponse. :type trigger_time: str """ + if trigger_time is None: + raise ValueError("Invalid value for `trigger_time`, must not be `None`") # noqa: E501 self._trigger_time = trigger_time @property def status(self) -> str: - """Gets the status of this AlertMessage. + """Gets the status of this GetAlertMessageResponse. - :return: The status of this AlertMessage. + :return: The status of this GetAlertMessageResponse. :rtype: str """ return self._status @status.setter def status(self, status: str): - """Sets the status of this AlertMessage. + """Sets the status of this GetAlertMessageResponse. - :param status: The status of this AlertMessage. + :param status: The status of this GetAlertMessageResponse. :type status: str """ allowed_values = ["unsolved", "solved", "dealing"] # noqa: E501 @@ -243,21 +251,23 @@ def status(self, status: str): @property def message(self) -> str: - """Gets the message of this AlertMessage. + """Gets the message of this GetAlertMessageResponse. - :return: The message of this AlertMessage. + :return: The message of this GetAlertMessageResponse. :rtype: str """ return self._message @message.setter def message(self, message: str): - """Sets the message of this AlertMessage. + """Sets the message of this GetAlertMessageResponse. - :param message: The message of this AlertMessage. + :param message: The message of this GetAlertMessageResponse. :type message: str """ + if message is None: + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 self._message = message diff --git a/flex/coordinator/gs_flex_coordinator/models/get_alert_receiver_response.py b/flex/coordinator/gs_flex_coordinator/models/get_alert_receiver_response.py new file mode 100644 index 000000000000..40e471fbd55d --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/get_alert_receiver_response.py @@ -0,0 +1,237 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator import util + + +class GetAlertReceiverResponse(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, type=None, webhook_url=None, at_user_ids=None, is_at_all=None, enable=None, id=None, message=None): # noqa: E501 + """GetAlertReceiverResponse - a model defined in OpenAPI + + :param type: The type of this GetAlertReceiverResponse. # noqa: E501 + :type type: str + :param webhook_url: The webhook_url of this GetAlertReceiverResponse. # noqa: E501 + :type webhook_url: str + :param at_user_ids: The at_user_ids of this GetAlertReceiverResponse. # noqa: E501 + :type at_user_ids: List[str] + :param is_at_all: The is_at_all of this GetAlertReceiverResponse. # noqa: E501 + :type is_at_all: bool + :param enable: The enable of this GetAlertReceiverResponse. # noqa: E501 + :type enable: bool + :param id: The id of this GetAlertReceiverResponse. # noqa: E501 + :type id: str + :param message: The message of this GetAlertReceiverResponse. # noqa: E501 + :type message: str + """ + self.openapi_types = { + 'type': str, + 'webhook_url': str, + 'at_user_ids': List[str], + 'is_at_all': bool, + 'enable': bool, + 'id': str, + 'message': str + } + + self.attribute_map = { + 'type': 'type', + 'webhook_url': 'webhook_url', + 'at_user_ids': 'at_user_ids', + 'is_at_all': 'is_at_all', + 'enable': 'enable', + 'id': 'id', + 'message': 'message' + } + + self._type = type + self._webhook_url = webhook_url + self._at_user_ids = at_user_ids + self._is_at_all = is_at_all + self._enable = enable + self._id = id + self._message = message + + @classmethod + def from_dict(cls, dikt) -> 'GetAlertReceiverResponse': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The GetAlertReceiverResponse of this GetAlertReceiverResponse. # noqa: E501 + :rtype: GetAlertReceiverResponse + """ + return util.deserialize_model(dikt, cls) + + @property + def type(self) -> str: + """Gets the type of this GetAlertReceiverResponse. + + + :return: The type of this GetAlertReceiverResponse. + :rtype: str + """ + return self._type + + @type.setter + def type(self, type: str): + """Sets the type of this GetAlertReceiverResponse. + + + :param type: The type of this GetAlertReceiverResponse. + :type type: str + """ + allowed_values = ["webhook"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" + .format(type, allowed_values) + ) + + self._type = type + + @property + def webhook_url(self) -> str: + """Gets the webhook_url of this GetAlertReceiverResponse. + + + :return: The webhook_url of this GetAlertReceiverResponse. + :rtype: str + """ + return self._webhook_url + + @webhook_url.setter + def webhook_url(self, webhook_url: str): + """Sets the webhook_url of this GetAlertReceiverResponse. + + + :param webhook_url: The webhook_url of this GetAlertReceiverResponse. + :type webhook_url: str + """ + if webhook_url is None: + raise ValueError("Invalid value for `webhook_url`, must not be `None`") # noqa: E501 + + self._webhook_url = webhook_url + + @property + def at_user_ids(self) -> List[str]: + """Gets the at_user_ids of this GetAlertReceiverResponse. + + + :return: The at_user_ids of this GetAlertReceiverResponse. + :rtype: List[str] + """ + return self._at_user_ids + + @at_user_ids.setter + def at_user_ids(self, at_user_ids: List[str]): + """Sets the at_user_ids of this GetAlertReceiverResponse. + + + :param at_user_ids: The at_user_ids of this GetAlertReceiverResponse. + :type at_user_ids: List[str] + """ + if at_user_ids is None: + raise ValueError("Invalid value for `at_user_ids`, must not be `None`") # noqa: E501 + + self._at_user_ids = at_user_ids + + @property + def is_at_all(self) -> bool: + """Gets the is_at_all of this GetAlertReceiverResponse. + + + :return: The is_at_all of this GetAlertReceiverResponse. + :rtype: bool + """ + return self._is_at_all + + @is_at_all.setter + def is_at_all(self, is_at_all: bool): + """Sets the is_at_all of this GetAlertReceiverResponse. + + + :param is_at_all: The is_at_all of this GetAlertReceiverResponse. + :type is_at_all: bool + """ + if is_at_all is None: + raise ValueError("Invalid value for `is_at_all`, must not be `None`") # noqa: E501 + + self._is_at_all = is_at_all + + @property + def enable(self) -> bool: + """Gets the enable of this GetAlertReceiverResponse. + + + :return: The enable of this GetAlertReceiverResponse. + :rtype: bool + """ + return self._enable + + @enable.setter + def enable(self, enable: bool): + """Sets the enable of this GetAlertReceiverResponse. + + + :param enable: The enable of this GetAlertReceiverResponse. + :type enable: bool + """ + if enable is None: + raise ValueError("Invalid value for `enable`, must not be `None`") # noqa: E501 + + self._enable = enable + + @property + def id(self) -> str: + """Gets the id of this GetAlertReceiverResponse. + + + :return: The id of this GetAlertReceiverResponse. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id: str): + """Sets the id of this GetAlertReceiverResponse. + + + :param id: The id of this GetAlertReceiverResponse. + :type id: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def message(self) -> str: + """Gets the message of this GetAlertReceiverResponse. + + Error message generated in server side # noqa: E501 + + :return: The message of this GetAlertReceiverResponse. + :rtype: str + """ + return self._message + + @message.setter + def message(self, message: str): + """Sets the message of this GetAlertReceiverResponse. + + Error message generated in server side # noqa: E501 + + :param message: The message of this GetAlertReceiverResponse. + :type message: str + """ + if message is None: + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message diff --git a/flex/coordinator/gs_flex_coordinator/models/get_alert_rule_response.py b/flex/coordinator/gs_flex_coordinator/models/get_alert_rule_response.py new file mode 100644 index 000000000000..33306adbfd79 --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/get_alert_rule_response.py @@ -0,0 +1,241 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator import util + + +class GetAlertRuleResponse(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, name=None, severity=None, metric_type=None, conditions_description=None, frequency=None, enable=None, id=None): # noqa: E501 + """GetAlertRuleResponse - a model defined in OpenAPI + + :param name: The name of this GetAlertRuleResponse. # noqa: E501 + :type name: str + :param severity: The severity of this GetAlertRuleResponse. # noqa: E501 + :type severity: str + :param metric_type: The metric_type of this GetAlertRuleResponse. # noqa: E501 + :type metric_type: str + :param conditions_description: The conditions_description of this GetAlertRuleResponse. # noqa: E501 + :type conditions_description: str + :param frequency: The frequency of this GetAlertRuleResponse. # noqa: E501 + :type frequency: int + :param enable: The enable of this GetAlertRuleResponse. # noqa: E501 + :type enable: bool + :param id: The id of this GetAlertRuleResponse. # noqa: E501 + :type id: str + """ + self.openapi_types = { + 'name': str, + 'severity': str, + 'metric_type': str, + 'conditions_description': str, + 'frequency': int, + 'enable': bool, + 'id': str + } + + self.attribute_map = { + 'name': 'name', + 'severity': 'severity', + 'metric_type': 'metric_type', + 'conditions_description': 'conditions_description', + 'frequency': 'frequency', + 'enable': 'enable', + 'id': 'id' + } + + self._name = name + self._severity = severity + self._metric_type = metric_type + self._conditions_description = conditions_description + self._frequency = frequency + self._enable = enable + self._id = id + + @classmethod + def from_dict(cls, dikt) -> 'GetAlertRuleResponse': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The GetAlertRuleResponse of this GetAlertRuleResponse. # noqa: E501 + :rtype: GetAlertRuleResponse + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> str: + """Gets the name of this GetAlertRuleResponse. + + + :return: The name of this GetAlertRuleResponse. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name: str): + """Sets the name of this GetAlertRuleResponse. + + + :param name: The name of this GetAlertRuleResponse. + :type name: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def severity(self) -> str: + """Gets the severity of this GetAlertRuleResponse. + + + :return: The severity of this GetAlertRuleResponse. + :rtype: str + """ + return self._severity + + @severity.setter + def severity(self, severity: str): + """Sets the severity of this GetAlertRuleResponse. + + + :param severity: The severity of this GetAlertRuleResponse. + :type severity: str + """ + allowed_values = ["warning", "emergency"] # noqa: E501 + if severity not in allowed_values: + raise ValueError( + "Invalid value for `severity` ({0}), must be one of {1}" + .format(severity, allowed_values) + ) + + self._severity = severity + + @property + def metric_type(self) -> str: + """Gets the metric_type of this GetAlertRuleResponse. + + + :return: The metric_type of this GetAlertRuleResponse. + :rtype: str + """ + return self._metric_type + + @metric_type.setter + def metric_type(self, metric_type: str): + """Sets the metric_type of this GetAlertRuleResponse. + + + :param metric_type: The metric_type of this GetAlertRuleResponse. + :type metric_type: str + """ + allowed_values = ["node", "service"] # noqa: E501 + if metric_type not in allowed_values: + raise ValueError( + "Invalid value for `metric_type` ({0}), must be one of {1}" + .format(metric_type, allowed_values) + ) + + self._metric_type = metric_type + + @property + def conditions_description(self) -> str: + """Gets the conditions_description of this GetAlertRuleResponse. + + + :return: The conditions_description of this GetAlertRuleResponse. + :rtype: str + """ + return self._conditions_description + + @conditions_description.setter + def conditions_description(self, conditions_description: str): + """Sets the conditions_description of this GetAlertRuleResponse. + + + :param conditions_description: The conditions_description of this GetAlertRuleResponse. + :type conditions_description: str + """ + if conditions_description is None: + raise ValueError("Invalid value for `conditions_description`, must not be `None`") # noqa: E501 + + self._conditions_description = conditions_description + + @property + def frequency(self) -> int: + """Gets the frequency of this GetAlertRuleResponse. + + (mins) # noqa: E501 + + :return: The frequency of this GetAlertRuleResponse. + :rtype: int + """ + return self._frequency + + @frequency.setter + def frequency(self, frequency: int): + """Sets the frequency of this GetAlertRuleResponse. + + (mins) # noqa: E501 + + :param frequency: The frequency of this GetAlertRuleResponse. + :type frequency: int + """ + if frequency is None: + raise ValueError("Invalid value for `frequency`, must not be `None`") # noqa: E501 + + self._frequency = frequency + + @property + def enable(self) -> bool: + """Gets the enable of this GetAlertRuleResponse. + + + :return: The enable of this GetAlertRuleResponse. + :rtype: bool + """ + return self._enable + + @enable.setter + def enable(self, enable: bool): + """Sets the enable of this GetAlertRuleResponse. + + + :param enable: The enable of this GetAlertRuleResponse. + :type enable: bool + """ + if enable is None: + raise ValueError("Invalid value for `enable`, must not be `None`") # noqa: E501 + + self._enable = enable + + @property + def id(self) -> str: + """Gets the id of this GetAlertRuleResponse. + + + :return: The id of this GetAlertRuleResponse. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id: str): + """Sets the id of this GetAlertRuleResponse. + + + :param id: The id of this GetAlertRuleResponse. + :type id: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id diff --git a/flex/coordinator/gs_flex_coordinator/models/get_edge_type.py b/flex/coordinator/gs_flex_coordinator/models/get_edge_type.py new file mode 100644 index 000000000000..6d7b89845d44 --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/get_edge_type.py @@ -0,0 +1,229 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator.models.base_edge_type_vertex_type_pair_relations_inner import BaseEdgeTypeVertexTypePairRelationsInner +from gs_flex_coordinator.models.get_property_meta import GetPropertyMeta +from gs_flex_coordinator import util + +from gs_flex_coordinator.models.base_edge_type_vertex_type_pair_relations_inner import BaseEdgeTypeVertexTypePairRelationsInner # noqa: E501 +from gs_flex_coordinator.models.get_property_meta import GetPropertyMeta # noqa: E501 + +class GetEdgeType(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, type_name=None, vertex_type_pair_relations=None, directed=None, primary_keys=None, type_id=None, properties=None, description=None): # noqa: E501 + """GetEdgeType - a model defined in OpenAPI + + :param type_name: The type_name of this GetEdgeType. # noqa: E501 + :type type_name: str + :param vertex_type_pair_relations: The vertex_type_pair_relations of this GetEdgeType. # noqa: E501 + :type vertex_type_pair_relations: List[BaseEdgeTypeVertexTypePairRelationsInner] + :param directed: The directed of this GetEdgeType. # noqa: E501 + :type directed: bool + :param primary_keys: The primary_keys of this GetEdgeType. # noqa: E501 + :type primary_keys: List[str] + :param type_id: The type_id of this GetEdgeType. # noqa: E501 + :type type_id: int + :param properties: The properties of this GetEdgeType. # noqa: E501 + :type properties: List[GetPropertyMeta] + :param description: The description of this GetEdgeType. # noqa: E501 + :type description: str + """ + self.openapi_types = { + 'type_name': str, + 'vertex_type_pair_relations': List[BaseEdgeTypeVertexTypePairRelationsInner], + 'directed': bool, + 'primary_keys': List[str], + 'type_id': int, + 'properties': List[GetPropertyMeta], + 'description': str + } + + self.attribute_map = { + 'type_name': 'type_name', + 'vertex_type_pair_relations': 'vertex_type_pair_relations', + 'directed': 'directed', + 'primary_keys': 'primary_keys', + 'type_id': 'type_id', + 'properties': 'properties', + 'description': 'description' + } + + self._type_name = type_name + self._vertex_type_pair_relations = vertex_type_pair_relations + self._directed = directed + self._primary_keys = primary_keys + self._type_id = type_id + self._properties = properties + self._description = description + + @classmethod + def from_dict(cls, dikt) -> 'GetEdgeType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The GetEdgeType of this GetEdgeType. # noqa: E501 + :rtype: GetEdgeType + """ + return util.deserialize_model(dikt, cls) + + @property + def type_name(self) -> str: + """Gets the type_name of this GetEdgeType. + + + :return: The type_name of this GetEdgeType. + :rtype: str + """ + return self._type_name + + @type_name.setter + def type_name(self, type_name: str): + """Sets the type_name of this GetEdgeType. + + + :param type_name: The type_name of this GetEdgeType. + :type type_name: str + """ + if type_name is None: + raise ValueError("Invalid value for `type_name`, must not be `None`") # noqa: E501 + + self._type_name = type_name + + @property + def vertex_type_pair_relations(self) -> List[BaseEdgeTypeVertexTypePairRelationsInner]: + """Gets the vertex_type_pair_relations of this GetEdgeType. + + + :return: The vertex_type_pair_relations of this GetEdgeType. + :rtype: List[BaseEdgeTypeVertexTypePairRelationsInner] + """ + return self._vertex_type_pair_relations + + @vertex_type_pair_relations.setter + def vertex_type_pair_relations(self, vertex_type_pair_relations: List[BaseEdgeTypeVertexTypePairRelationsInner]): + """Sets the vertex_type_pair_relations of this GetEdgeType. + + + :param vertex_type_pair_relations: The vertex_type_pair_relations of this GetEdgeType. + :type vertex_type_pair_relations: List[BaseEdgeTypeVertexTypePairRelationsInner] + """ + if vertex_type_pair_relations is None: + raise ValueError("Invalid value for `vertex_type_pair_relations`, must not be `None`") # noqa: E501 + + self._vertex_type_pair_relations = vertex_type_pair_relations + + @property + def directed(self) -> bool: + """Gets the directed of this GetEdgeType. + + + :return: The directed of this GetEdgeType. + :rtype: bool + """ + return self._directed + + @directed.setter + def directed(self, directed: bool): + """Sets the directed of this GetEdgeType. + + + :param directed: The directed of this GetEdgeType. + :type directed: bool + """ + + self._directed = directed + + @property + def primary_keys(self) -> List[str]: + """Gets the primary_keys of this GetEdgeType. + + + :return: The primary_keys of this GetEdgeType. + :rtype: List[str] + """ + return self._primary_keys + + @primary_keys.setter + def primary_keys(self, primary_keys: List[str]): + """Sets the primary_keys of this GetEdgeType. + + + :param primary_keys: The primary_keys of this GetEdgeType. + :type primary_keys: List[str] + """ + + self._primary_keys = primary_keys + + @property + def type_id(self) -> int: + """Gets the type_id of this GetEdgeType. + + + :return: The type_id of this GetEdgeType. + :rtype: int + """ + return self._type_id + + @type_id.setter + def type_id(self, type_id: int): + """Sets the type_id of this GetEdgeType. + + + :param type_id: The type_id of this GetEdgeType. + :type type_id: int + """ + if type_id is None: + raise ValueError("Invalid value for `type_id`, must not be `None`") # noqa: E501 + + self._type_id = type_id + + @property + def properties(self) -> List[GetPropertyMeta]: + """Gets the properties of this GetEdgeType. + + + :return: The properties of this GetEdgeType. + :rtype: List[GetPropertyMeta] + """ + return self._properties + + @properties.setter + def properties(self, properties: List[GetPropertyMeta]): + """Sets the properties of this GetEdgeType. + + + :param properties: The properties of this GetEdgeType. + :type properties: List[GetPropertyMeta] + """ + if properties is None: + raise ValueError("Invalid value for `properties`, must not be `None`") # noqa: E501 + + self._properties = properties + + @property + def description(self) -> str: + """Gets the description of this GetEdgeType. + + + :return: The description of this GetEdgeType. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description: str): + """Sets the description of this GetEdgeType. + + + :param description: The description of this GetEdgeType. + :type description: str + """ + + self._description = description diff --git a/flex/coordinator/gs_flex_coordinator/models/get_graph_response.py b/flex/coordinator/gs_flex_coordinator/models/get_graph_response.py new file mode 100644 index 000000000000..3404a34e391a --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/get_graph_response.py @@ -0,0 +1,291 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator.models.get_graph_schema_response import GetGraphSchemaResponse +from gs_flex_coordinator.models.get_procedure_response import GetProcedureResponse +from gs_flex_coordinator import util + +from gs_flex_coordinator.models.get_graph_schema_response import GetGraphSchemaResponse # noqa: E501 +from gs_flex_coordinator.models.get_procedure_response import GetProcedureResponse # noqa: E501 + +class GetGraphResponse(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, id=None, name=None, description=None, store_type=None, creation_time=None, data_update_time=None, schema_update_time=None, stored_procedures=None, _schema=None): # noqa: E501 + """GetGraphResponse - a model defined in OpenAPI + + :param id: The id of this GetGraphResponse. # noqa: E501 + :type id: str + :param name: The name of this GetGraphResponse. # noqa: E501 + :type name: str + :param description: The description of this GetGraphResponse. # noqa: E501 + :type description: str + :param store_type: The store_type of this GetGraphResponse. # noqa: E501 + :type store_type: str + :param creation_time: The creation_time of this GetGraphResponse. # noqa: E501 + :type creation_time: str + :param data_update_time: The data_update_time of this GetGraphResponse. # noqa: E501 + :type data_update_time: str + :param schema_update_time: The schema_update_time of this GetGraphResponse. # noqa: E501 + :type schema_update_time: str + :param stored_procedures: The stored_procedures of this GetGraphResponse. # noqa: E501 + :type stored_procedures: List[GetProcedureResponse] + :param _schema: The _schema of this GetGraphResponse. # noqa: E501 + :type _schema: GetGraphSchemaResponse + """ + self.openapi_types = { + 'id': str, + 'name': str, + 'description': str, + 'store_type': str, + 'creation_time': str, + 'data_update_time': str, + 'schema_update_time': str, + 'stored_procedures': List[GetProcedureResponse], + '_schema': GetGraphSchemaResponse + } + + self.attribute_map = { + 'id': 'id', + 'name': 'name', + 'description': 'description', + 'store_type': 'store_type', + 'creation_time': 'creation_time', + 'data_update_time': 'data_update_time', + 'schema_update_time': 'schema_update_time', + 'stored_procedures': 'stored_procedures', + '_schema': 'schema' + } + + self._id = id + self._name = name + self._description = description + self._store_type = store_type + self._creation_time = creation_time + self._data_update_time = data_update_time + self._schema_update_time = schema_update_time + self._stored_procedures = stored_procedures + self.__schema = _schema + + @classmethod + def from_dict(cls, dikt) -> 'GetGraphResponse': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The GetGraphResponse of this GetGraphResponse. # noqa: E501 + :rtype: GetGraphResponse + """ + return util.deserialize_model(dikt, cls) + + @property + def id(self) -> str: + """Gets the id of this GetGraphResponse. + + + :return: The id of this GetGraphResponse. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id: str): + """Sets the id of this GetGraphResponse. + + + :param id: The id of this GetGraphResponse. + :type id: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def name(self) -> str: + """Gets the name of this GetGraphResponse. + + + :return: The name of this GetGraphResponse. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name: str): + """Sets the name of this GetGraphResponse. + + + :param name: The name of this GetGraphResponse. + :type name: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def description(self) -> str: + """Gets the description of this GetGraphResponse. + + + :return: The description of this GetGraphResponse. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description: str): + """Sets the description of this GetGraphResponse. + + + :param description: The description of this GetGraphResponse. + :type description: str + """ + + self._description = description + + @property + def store_type(self) -> str: + """Gets the store_type of this GetGraphResponse. + + + :return: The store_type of this GetGraphResponse. + :rtype: str + """ + return self._store_type + + @store_type.setter + def store_type(self, store_type: str): + """Sets the store_type of this GetGraphResponse. + + + :param store_type: The store_type of this GetGraphResponse. + :type store_type: str + """ + allowed_values = ["mutable_csr"] # noqa: E501 + if store_type not in allowed_values: + raise ValueError( + "Invalid value for `store_type` ({0}), must be one of {1}" + .format(store_type, allowed_values) + ) + + self._store_type = store_type + + @property + def creation_time(self) -> str: + """Gets the creation_time of this GetGraphResponse. + + + :return: The creation_time of this GetGraphResponse. + :rtype: str + """ + return self._creation_time + + @creation_time.setter + def creation_time(self, creation_time: str): + """Sets the creation_time of this GetGraphResponse. + + + :param creation_time: The creation_time of this GetGraphResponse. + :type creation_time: str + """ + if creation_time is None: + raise ValueError("Invalid value for `creation_time`, must not be `None`") # noqa: E501 + + self._creation_time = creation_time + + @property + def data_update_time(self) -> str: + """Gets the data_update_time of this GetGraphResponse. + + + :return: The data_update_time of this GetGraphResponse. + :rtype: str + """ + return self._data_update_time + + @data_update_time.setter + def data_update_time(self, data_update_time: str): + """Sets the data_update_time of this GetGraphResponse. + + + :param data_update_time: The data_update_time of this GetGraphResponse. + :type data_update_time: str + """ + if data_update_time is None: + raise ValueError("Invalid value for `data_update_time`, must not be `None`") # noqa: E501 + + self._data_update_time = data_update_time + + @property + def schema_update_time(self) -> str: + """Gets the schema_update_time of this GetGraphResponse. + + + :return: The schema_update_time of this GetGraphResponse. + :rtype: str + """ + return self._schema_update_time + + @schema_update_time.setter + def schema_update_time(self, schema_update_time: str): + """Sets the schema_update_time of this GetGraphResponse. + + + :param schema_update_time: The schema_update_time of this GetGraphResponse. + :type schema_update_time: str + """ + if schema_update_time is None: + raise ValueError("Invalid value for `schema_update_time`, must not be `None`") # noqa: E501 + + self._schema_update_time = schema_update_time + + @property + def stored_procedures(self) -> List[GetProcedureResponse]: + """Gets the stored_procedures of this GetGraphResponse. + + + :return: The stored_procedures of this GetGraphResponse. + :rtype: List[GetProcedureResponse] + """ + return self._stored_procedures + + @stored_procedures.setter + def stored_procedures(self, stored_procedures: List[GetProcedureResponse]): + """Sets the stored_procedures of this GetGraphResponse. + + + :param stored_procedures: The stored_procedures of this GetGraphResponse. + :type stored_procedures: List[GetProcedureResponse] + """ + + self._stored_procedures = stored_procedures + + @property + def _schema(self) -> GetGraphSchemaResponse: + """Gets the _schema of this GetGraphResponse. + + + :return: The _schema of this GetGraphResponse. + :rtype: GetGraphSchemaResponse + """ + return self.__schema + + @_schema.setter + def _schema(self, _schema: GetGraphSchemaResponse): + """Sets the _schema of this GetGraphResponse. + + + :param _schema: The _schema of this GetGraphResponse. + :type _schema: GetGraphSchemaResponse + """ + if _schema is None: + raise ValueError("Invalid value for `_schema`, must not be `None`") # noqa: E501 + + self.__schema = _schema diff --git a/flex/coordinator/gs_flex_coordinator/models/get_graph_schema_response.py b/flex/coordinator/gs_flex_coordinator/models/get_graph_schema_response.py new file mode 100644 index 000000000000..c34280e51a03 --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/get_graph_schema_response.py @@ -0,0 +1,95 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator.models.get_edge_type import GetEdgeType +from gs_flex_coordinator.models.get_vertex_type import GetVertexType +from gs_flex_coordinator import util + +from gs_flex_coordinator.models.get_edge_type import GetEdgeType # noqa: E501 +from gs_flex_coordinator.models.get_vertex_type import GetVertexType # noqa: E501 + +class GetGraphSchemaResponse(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, vertex_types=None, edge_types=None): # noqa: E501 + """GetGraphSchemaResponse - a model defined in OpenAPI + + :param vertex_types: The vertex_types of this GetGraphSchemaResponse. # noqa: E501 + :type vertex_types: List[GetVertexType] + :param edge_types: The edge_types of this GetGraphSchemaResponse. # noqa: E501 + :type edge_types: List[GetEdgeType] + """ + self.openapi_types = { + 'vertex_types': List[GetVertexType], + 'edge_types': List[GetEdgeType] + } + + self.attribute_map = { + 'vertex_types': 'vertex_types', + 'edge_types': 'edge_types' + } + + self._vertex_types = vertex_types + self._edge_types = edge_types + + @classmethod + def from_dict(cls, dikt) -> 'GetGraphSchemaResponse': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The GetGraphSchemaResponse of this GetGraphSchemaResponse. # noqa: E501 + :rtype: GetGraphSchemaResponse + """ + return util.deserialize_model(dikt, cls) + + @property + def vertex_types(self) -> List[GetVertexType]: + """Gets the vertex_types of this GetGraphSchemaResponse. + + + :return: The vertex_types of this GetGraphSchemaResponse. + :rtype: List[GetVertexType] + """ + return self._vertex_types + + @vertex_types.setter + def vertex_types(self, vertex_types: List[GetVertexType]): + """Sets the vertex_types of this GetGraphSchemaResponse. + + + :param vertex_types: The vertex_types of this GetGraphSchemaResponse. + :type vertex_types: List[GetVertexType] + """ + if vertex_types is None: + raise ValueError("Invalid value for `vertex_types`, must not be `None`") # noqa: E501 + + self._vertex_types = vertex_types + + @property + def edge_types(self) -> List[GetEdgeType]: + """Gets the edge_types of this GetGraphSchemaResponse. + + + :return: The edge_types of this GetGraphSchemaResponse. + :rtype: List[GetEdgeType] + """ + return self._edge_types + + @edge_types.setter + def edge_types(self, edge_types: List[GetEdgeType]): + """Sets the edge_types of this GetGraphSchemaResponse. + + + :param edge_types: The edge_types of this GetGraphSchemaResponse. + :type edge_types: List[GetEdgeType] + """ + if edge_types is None: + raise ValueError("Invalid value for `edge_types`, must not be `None`") # noqa: E501 + + self._edge_types = edge_types diff --git a/flex/coordinator/gs_flex_coordinator/models/get_procedure_response.py b/flex/coordinator/gs_flex_coordinator/models/get_procedure_response.py new file mode 100644 index 000000000000..9f09abfac996 --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/get_procedure_response.py @@ -0,0 +1,319 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator.models.parameter import Parameter +from gs_flex_coordinator import util + +from gs_flex_coordinator.models.parameter import Parameter # noqa: E501 + +class GetProcedureResponse(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, name=None, description=None, type=None, query=None, id=None, library=None, params=None, returns=None, bound_graph=None, runnable=None): # noqa: E501 + """GetProcedureResponse - a model defined in OpenAPI + + :param name: The name of this GetProcedureResponse. # noqa: E501 + :type name: str + :param description: The description of this GetProcedureResponse. # noqa: E501 + :type description: str + :param type: The type of this GetProcedureResponse. # noqa: E501 + :type type: str + :param query: The query of this GetProcedureResponse. # noqa: E501 + :type query: str + :param id: The id of this GetProcedureResponse. # noqa: E501 + :type id: str + :param library: The library of this GetProcedureResponse. # noqa: E501 + :type library: str + :param params: The params of this GetProcedureResponse. # noqa: E501 + :type params: List[Parameter] + :param returns: The returns of this GetProcedureResponse. # noqa: E501 + :type returns: List[Parameter] + :param bound_graph: The bound_graph of this GetProcedureResponse. # noqa: E501 + :type bound_graph: str + :param runnable: The runnable of this GetProcedureResponse. # noqa: E501 + :type runnable: bool + """ + self.openapi_types = { + 'name': str, + 'description': str, + 'type': str, + 'query': str, + 'id': str, + 'library': str, + 'params': List[Parameter], + 'returns': List[Parameter], + 'bound_graph': str, + 'runnable': bool + } + + self.attribute_map = { + 'name': 'name', + 'description': 'description', + 'type': 'type', + 'query': 'query', + 'id': 'id', + 'library': 'library', + 'params': 'params', + 'returns': 'returns', + 'bound_graph': 'bound_graph', + 'runnable': 'runnable' + } + + self._name = name + self._description = description + self._type = type + self._query = query + self._id = id + self._library = library + self._params = params + self._returns = returns + self._bound_graph = bound_graph + self._runnable = runnable + + @classmethod + def from_dict(cls, dikt) -> 'GetProcedureResponse': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The GetProcedureResponse of this GetProcedureResponse. # noqa: E501 + :rtype: GetProcedureResponse + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> str: + """Gets the name of this GetProcedureResponse. + + + :return: The name of this GetProcedureResponse. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name: str): + """Sets the name of this GetProcedureResponse. + + + :param name: The name of this GetProcedureResponse. + :type name: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def description(self) -> str: + """Gets the description of this GetProcedureResponse. + + + :return: The description of this GetProcedureResponse. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description: str): + """Sets the description of this GetProcedureResponse. + + + :param description: The description of this GetProcedureResponse. + :type description: str + """ + + self._description = description + + @property + def type(self) -> str: + """Gets the type of this GetProcedureResponse. + + + :return: The type of this GetProcedureResponse. + :rtype: str + """ + return self._type + + @type.setter + def type(self, type: str): + """Sets the type of this GetProcedureResponse. + + + :param type: The type of this GetProcedureResponse. + :type type: str + """ + allowed_values = ["cpp", "cypher"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" + .format(type, allowed_values) + ) + + self._type = type + + @property + def query(self) -> str: + """Gets the query of this GetProcedureResponse. + + + :return: The query of this GetProcedureResponse. + :rtype: str + """ + return self._query + + @query.setter + def query(self, query: str): + """Sets the query of this GetProcedureResponse. + + + :param query: The query of this GetProcedureResponse. + :type query: str + """ + if query is None: + raise ValueError("Invalid value for `query`, must not be `None`") # noqa: E501 + + self._query = query + + @property + def id(self) -> str: + """Gets the id of this GetProcedureResponse. + + + :return: The id of this GetProcedureResponse. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id: str): + """Sets the id of this GetProcedureResponse. + + + :param id: The id of this GetProcedureResponse. + :type id: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def library(self) -> str: + """Gets the library of this GetProcedureResponse. + + + :return: The library of this GetProcedureResponse. + :rtype: str + """ + return self._library + + @library.setter + def library(self, library: str): + """Sets the library of this GetProcedureResponse. + + + :param library: The library of this GetProcedureResponse. + :type library: str + """ + if library is None: + raise ValueError("Invalid value for `library`, must not be `None`") # noqa: E501 + + self._library = library + + @property + def params(self) -> List[Parameter]: + """Gets the params of this GetProcedureResponse. + + + :return: The params of this GetProcedureResponse. + :rtype: List[Parameter] + """ + return self._params + + @params.setter + def params(self, params: List[Parameter]): + """Sets the params of this GetProcedureResponse. + + + :param params: The params of this GetProcedureResponse. + :type params: List[Parameter] + """ + if params is None: + raise ValueError("Invalid value for `params`, must not be `None`") # noqa: E501 + + self._params = params + + @property + def returns(self) -> List[Parameter]: + """Gets the returns of this GetProcedureResponse. + + + :return: The returns of this GetProcedureResponse. + :rtype: List[Parameter] + """ + return self._returns + + @returns.setter + def returns(self, returns: List[Parameter]): + """Sets the returns of this GetProcedureResponse. + + + :param returns: The returns of this GetProcedureResponse. + :type returns: List[Parameter] + """ + if returns is None: + raise ValueError("Invalid value for `returns`, must not be `None`") # noqa: E501 + + self._returns = returns + + @property + def bound_graph(self) -> str: + """Gets the bound_graph of this GetProcedureResponse. + + + :return: The bound_graph of this GetProcedureResponse. + :rtype: str + """ + return self._bound_graph + + @bound_graph.setter + def bound_graph(self, bound_graph: str): + """Sets the bound_graph of this GetProcedureResponse. + + + :param bound_graph: The bound_graph of this GetProcedureResponse. + :type bound_graph: str + """ + if bound_graph is None: + raise ValueError("Invalid value for `bound_graph`, must not be `None`") # noqa: E501 + + self._bound_graph = bound_graph + + @property + def runnable(self) -> bool: + """Gets the runnable of this GetProcedureResponse. + + + :return: The runnable of this GetProcedureResponse. + :rtype: bool + """ + return self._runnable + + @runnable.setter + def runnable(self, runnable: bool): + """Sets the runnable of this GetProcedureResponse. + + + :param runnable: The runnable of this GetProcedureResponse. + :type runnable: bool + """ + if runnable is None: + raise ValueError("Invalid value for `runnable`, must not be `None`") # noqa: E501 + + self._runnable = runnable diff --git a/flex/coordinator/gs_flex_coordinator/models/get_property_meta.py b/flex/coordinator/gs_flex_coordinator/models/get_property_meta.py new file mode 100644 index 000000000000..465f5c0bdd68 --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/get_property_meta.py @@ -0,0 +1,199 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator.models.gs_data_type import GSDataType +from gs_flex_coordinator import util + +from gs_flex_coordinator.models.gs_data_type import GSDataType # noqa: E501 + +class GetPropertyMeta(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, property_name=None, property_type=None, nullable=None, default_value=None, description=None, property_id=None): # noqa: E501 + """GetPropertyMeta - a model defined in OpenAPI + + :param property_name: The property_name of this GetPropertyMeta. # noqa: E501 + :type property_name: str + :param property_type: The property_type of this GetPropertyMeta. # noqa: E501 + :type property_type: GSDataType + :param nullable: The nullable of this GetPropertyMeta. # noqa: E501 + :type nullable: bool + :param default_value: The default_value of this GetPropertyMeta. # noqa: E501 + :type default_value: object + :param description: The description of this GetPropertyMeta. # noqa: E501 + :type description: str + :param property_id: The property_id of this GetPropertyMeta. # noqa: E501 + :type property_id: int + """ + self.openapi_types = { + 'property_name': str, + 'property_type': GSDataType, + 'nullable': bool, + 'default_value': object, + 'description': str, + 'property_id': int + } + + self.attribute_map = { + 'property_name': 'property_name', + 'property_type': 'property_type', + 'nullable': 'nullable', + 'default_value': 'default_value', + 'description': 'description', + 'property_id': 'property_id' + } + + self._property_name = property_name + self._property_type = property_type + self._nullable = nullable + self._default_value = default_value + self._description = description + self._property_id = property_id + + @classmethod + def from_dict(cls, dikt) -> 'GetPropertyMeta': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The GetPropertyMeta of this GetPropertyMeta. # noqa: E501 + :rtype: GetPropertyMeta + """ + return util.deserialize_model(dikt, cls) + + @property + def property_name(self) -> str: + """Gets the property_name of this GetPropertyMeta. + + + :return: The property_name of this GetPropertyMeta. + :rtype: str + """ + return self._property_name + + @property_name.setter + def property_name(self, property_name: str): + """Sets the property_name of this GetPropertyMeta. + + + :param property_name: The property_name of this GetPropertyMeta. + :type property_name: str + """ + if property_name is None: + raise ValueError("Invalid value for `property_name`, must not be `None`") # noqa: E501 + + self._property_name = property_name + + @property + def property_type(self) -> GSDataType: + """Gets the property_type of this GetPropertyMeta. + + + :return: The property_type of this GetPropertyMeta. + :rtype: GSDataType + """ + return self._property_type + + @property_type.setter + def property_type(self, property_type: GSDataType): + """Sets the property_type of this GetPropertyMeta. + + + :param property_type: The property_type of this GetPropertyMeta. + :type property_type: GSDataType + """ + if property_type is None: + raise ValueError("Invalid value for `property_type`, must not be `None`") # noqa: E501 + + self._property_type = property_type + + @property + def nullable(self) -> bool: + """Gets the nullable of this GetPropertyMeta. + + + :return: The nullable of this GetPropertyMeta. + :rtype: bool + """ + return self._nullable + + @nullable.setter + def nullable(self, nullable: bool): + """Sets the nullable of this GetPropertyMeta. + + + :param nullable: The nullable of this GetPropertyMeta. + :type nullable: bool + """ + + self._nullable = nullable + + @property + def default_value(self) -> object: + """Gets the default_value of this GetPropertyMeta. + + + :return: The default_value of this GetPropertyMeta. + :rtype: object + """ + return self._default_value + + @default_value.setter + def default_value(self, default_value: object): + """Sets the default_value of this GetPropertyMeta. + + + :param default_value: The default_value of this GetPropertyMeta. + :type default_value: object + """ + + self._default_value = default_value + + @property + def description(self) -> str: + """Gets the description of this GetPropertyMeta. + + + :return: The description of this GetPropertyMeta. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description: str): + """Sets the description of this GetPropertyMeta. + + + :param description: The description of this GetPropertyMeta. + :type description: str + """ + + self._description = description + + @property + def property_id(self) -> int: + """Gets the property_id of this GetPropertyMeta. + + + :return: The property_id of this GetPropertyMeta. + :rtype: int + """ + return self._property_id + + @property_id.setter + def property_id(self, property_id: int): + """Sets the property_id of this GetPropertyMeta. + + + :param property_id: The property_id of this GetPropertyMeta. + :type property_id: int + """ + if property_id is None: + raise ValueError("Invalid value for `property_id`, must not be `None`") # noqa: E501 + + self._property_id = property_id diff --git a/flex/coordinator/gs_flex_coordinator/models/get_vertex_type.py b/flex/coordinator/gs_flex_coordinator/models/get_vertex_type.py new file mode 100644 index 000000000000..d6759b8796c5 --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/get_vertex_type.py @@ -0,0 +1,203 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator.models.base_vertex_type_x_csr_params import BaseVertexTypeXCsrParams +from gs_flex_coordinator.models.get_property_meta import GetPropertyMeta +from gs_flex_coordinator import util + +from gs_flex_coordinator.models.base_vertex_type_x_csr_params import BaseVertexTypeXCsrParams # noqa: E501 +from gs_flex_coordinator.models.get_property_meta import GetPropertyMeta # noqa: E501 + +class GetVertexType(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, type_name=None, primary_keys=None, x_csr_params=None, type_id=None, properties=None, description=None): # noqa: E501 + """GetVertexType - a model defined in OpenAPI + + :param type_name: The type_name of this GetVertexType. # noqa: E501 + :type type_name: str + :param primary_keys: The primary_keys of this GetVertexType. # noqa: E501 + :type primary_keys: List[str] + :param x_csr_params: The x_csr_params of this GetVertexType. # noqa: E501 + :type x_csr_params: BaseVertexTypeXCsrParams + :param type_id: The type_id of this GetVertexType. # noqa: E501 + :type type_id: int + :param properties: The properties of this GetVertexType. # noqa: E501 + :type properties: List[GetPropertyMeta] + :param description: The description of this GetVertexType. # noqa: E501 + :type description: str + """ + self.openapi_types = { + 'type_name': str, + 'primary_keys': List[str], + 'x_csr_params': BaseVertexTypeXCsrParams, + 'type_id': int, + 'properties': List[GetPropertyMeta], + 'description': str + } + + self.attribute_map = { + 'type_name': 'type_name', + 'primary_keys': 'primary_keys', + 'x_csr_params': 'x_csr_params', + 'type_id': 'type_id', + 'properties': 'properties', + 'description': 'description' + } + + self._type_name = type_name + self._primary_keys = primary_keys + self._x_csr_params = x_csr_params + self._type_id = type_id + self._properties = properties + self._description = description + + @classmethod + def from_dict(cls, dikt) -> 'GetVertexType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The GetVertexType of this GetVertexType. # noqa: E501 + :rtype: GetVertexType + """ + return util.deserialize_model(dikt, cls) + + @property + def type_name(self) -> str: + """Gets the type_name of this GetVertexType. + + + :return: The type_name of this GetVertexType. + :rtype: str + """ + return self._type_name + + @type_name.setter + def type_name(self, type_name: str): + """Sets the type_name of this GetVertexType. + + + :param type_name: The type_name of this GetVertexType. + :type type_name: str + """ + if type_name is None: + raise ValueError("Invalid value for `type_name`, must not be `None`") # noqa: E501 + + self._type_name = type_name + + @property + def primary_keys(self) -> List[str]: + """Gets the primary_keys of this GetVertexType. + + + :return: The primary_keys of this GetVertexType. + :rtype: List[str] + """ + return self._primary_keys + + @primary_keys.setter + def primary_keys(self, primary_keys: List[str]): + """Sets the primary_keys of this GetVertexType. + + + :param primary_keys: The primary_keys of this GetVertexType. + :type primary_keys: List[str] + """ + if primary_keys is None: + raise ValueError("Invalid value for `primary_keys`, must not be `None`") # noqa: E501 + + self._primary_keys = primary_keys + + @property + def x_csr_params(self) -> BaseVertexTypeXCsrParams: + """Gets the x_csr_params of this GetVertexType. + + + :return: The x_csr_params of this GetVertexType. + :rtype: BaseVertexTypeXCsrParams + """ + return self._x_csr_params + + @x_csr_params.setter + def x_csr_params(self, x_csr_params: BaseVertexTypeXCsrParams): + """Sets the x_csr_params of this GetVertexType. + + + :param x_csr_params: The x_csr_params of this GetVertexType. + :type x_csr_params: BaseVertexTypeXCsrParams + """ + + self._x_csr_params = x_csr_params + + @property + def type_id(self) -> int: + """Gets the type_id of this GetVertexType. + + + :return: The type_id of this GetVertexType. + :rtype: int + """ + return self._type_id + + @type_id.setter + def type_id(self, type_id: int): + """Sets the type_id of this GetVertexType. + + + :param type_id: The type_id of this GetVertexType. + :type type_id: int + """ + if type_id is None: + raise ValueError("Invalid value for `type_id`, must not be `None`") # noqa: E501 + + self._type_id = type_id + + @property + def properties(self) -> List[GetPropertyMeta]: + """Gets the properties of this GetVertexType. + + + :return: The properties of this GetVertexType. + :rtype: List[GetPropertyMeta] + """ + return self._properties + + @properties.setter + def properties(self, properties: List[GetPropertyMeta]): + """Sets the properties of this GetVertexType. + + + :param properties: The properties of this GetVertexType. + :type properties: List[GetPropertyMeta] + """ + if properties is None: + raise ValueError("Invalid value for `properties`, must not be `None`") # noqa: E501 + + self._properties = properties + + @property + def description(self) -> str: + """Gets the description of this GetVertexType. + + + :return: The description of this GetVertexType. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description: str): + """Sets the description of this GetVertexType. + + + :param description: The description of this GetVertexType. + :type description: str + """ + + self._description = description diff --git a/flex/coordinator/gs_flex_coordinator/models/graph.py b/flex/coordinator/gs_flex_coordinator/models/graph.py deleted file mode 100644 index dcd156952761..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/graph.py +++ /dev/null @@ -1,149 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.graph_stored_procedures import GraphStoredProcedures -from gs_flex_coordinator.models.model_schema import ModelSchema -from gs_flex_coordinator import util - -from gs_flex_coordinator.models.graph_stored_procedures import GraphStoredProcedures # noqa: E501 -from gs_flex_coordinator.models.model_schema import ModelSchema # noqa: E501 - -class Graph(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, name=None, store_type=None, stored_procedures=None, _schema=None): # noqa: E501 - """Graph - a model defined in OpenAPI - - :param name: The name of this Graph. # noqa: E501 - :type name: str - :param store_type: The store_type of this Graph. # noqa: E501 - :type store_type: str - :param stored_procedures: The stored_procedures of this Graph. # noqa: E501 - :type stored_procedures: GraphStoredProcedures - :param _schema: The _schema of this Graph. # noqa: E501 - :type _schema: ModelSchema - """ - self.openapi_types = { - 'name': str, - 'store_type': str, - 'stored_procedures': GraphStoredProcedures, - '_schema': ModelSchema - } - - self.attribute_map = { - 'name': 'name', - 'store_type': 'store_type', - 'stored_procedures': 'stored_procedures', - '_schema': 'schema' - } - - self._name = name - self._store_type = store_type - self._stored_procedures = stored_procedures - self.__schema = _schema - - @classmethod - def from_dict(cls, dikt) -> 'Graph': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The Graph of this Graph. # noqa: E501 - :rtype: Graph - """ - return util.deserialize_model(dikt, cls) - - @property - def name(self) -> str: - """Gets the name of this Graph. - - - :return: The name of this Graph. - :rtype: str - """ - return self._name - - @name.setter - def name(self, name: str): - """Sets the name of this Graph. - - - :param name: The name of this Graph. - :type name: str - """ - - self._name = name - - @property - def store_type(self) -> str: - """Gets the store_type of this Graph. - - - :return: The store_type of this Graph. - :rtype: str - """ - return self._store_type - - @store_type.setter - def store_type(self, store_type: str): - """Sets the store_type of this Graph. - - - :param store_type: The store_type of this Graph. - :type store_type: str - """ - allowed_values = ["mutable_csr"] # noqa: E501 - if store_type not in allowed_values: - raise ValueError( - "Invalid value for `store_type` ({0}), must be one of {1}" - .format(store_type, allowed_values) - ) - - self._store_type = store_type - - @property - def stored_procedures(self) -> GraphStoredProcedures: - """Gets the stored_procedures of this Graph. - - - :return: The stored_procedures of this Graph. - :rtype: GraphStoredProcedures - """ - return self._stored_procedures - - @stored_procedures.setter - def stored_procedures(self, stored_procedures: GraphStoredProcedures): - """Sets the stored_procedures of this Graph. - - - :param stored_procedures: The stored_procedures of this Graph. - :type stored_procedures: GraphStoredProcedures - """ - - self._stored_procedures = stored_procedures - - @property - def _schema(self) -> ModelSchema: - """Gets the _schema of this Graph. - - - :return: The _schema of this Graph. - :rtype: ModelSchema - """ - return self.__schema - - @_schema.setter - def _schema(self, _schema: ModelSchema): - """Sets the _schema of this Graph. - - - :param _schema: The _schema of this Graph. - :type _schema: ModelSchema - """ - - self.__schema = _schema diff --git a/flex/coordinator/gs_flex_coordinator/models/graph_stored_procedures.py b/flex/coordinator/gs_flex_coordinator/models/graph_stored_procedures.py deleted file mode 100644 index 4d8cb869a0f8..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/graph_stored_procedures.py +++ /dev/null @@ -1,67 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util - - -class GraphStoredProcedures(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, directory=None): # noqa: E501 - """GraphStoredProcedures - a model defined in OpenAPI - - :param directory: The directory of this GraphStoredProcedures. # noqa: E501 - :type directory: str - """ - self.openapi_types = { - 'directory': str - } - - self.attribute_map = { - 'directory': 'directory' - } - - self._directory = directory - - @classmethod - def from_dict(cls, dikt) -> 'GraphStoredProcedures': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The Graph_stored_procedures of this GraphStoredProcedures. # noqa: E501 - :rtype: GraphStoredProcedures - """ - return util.deserialize_model(dikt, cls) - - @property - def directory(self) -> str: - """Gets the directory of this GraphStoredProcedures. - - - :return: The directory of this GraphStoredProcedures. - :rtype: str - """ - return self._directory - - @directory.setter - def directory(self, directory: str): - """Sets the directory of this GraphStoredProcedures. - - - :param directory: The directory of this GraphStoredProcedures. - :type directory: str - """ - allowed_values = ["plugins"] # noqa: E501 - if directory not in allowed_values: - raise ValueError( - "Invalid value for `directory` ({0}), must be one of {1}" - .format(directory, allowed_values) - ) - - self._directory = directory diff --git a/flex/coordinator/gs_flex_coordinator/models/groot_dataloading_job_config.py b/flex/coordinator/gs_flex_coordinator/models/groot_dataloading_job_config.py deleted file mode 100644 index d7a788264e72..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/groot_dataloading_job_config.py +++ /dev/null @@ -1,149 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.groot_dataloading_job_config_edges_inner import GrootDataloadingJobConfigEdgesInner -from gs_flex_coordinator import util - -from gs_flex_coordinator.models.groot_dataloading_job_config_edges_inner import GrootDataloadingJobConfigEdgesInner # noqa: E501 - -class GrootDataloadingJobConfig(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, vertices=None, edges=None, schedule=None, repeat=None): # noqa: E501 - """GrootDataloadingJobConfig - a model defined in OpenAPI - - :param vertices: The vertices of this GrootDataloadingJobConfig. # noqa: E501 - :type vertices: List[str] - :param edges: The edges of this GrootDataloadingJobConfig. # noqa: E501 - :type edges: List[GrootDataloadingJobConfigEdgesInner] - :param schedule: The schedule of this GrootDataloadingJobConfig. # noqa: E501 - :type schedule: str - :param repeat: The repeat of this GrootDataloadingJobConfig. # noqa: E501 - :type repeat: str - """ - self.openapi_types = { - 'vertices': List[str], - 'edges': List[GrootDataloadingJobConfigEdgesInner], - 'schedule': str, - 'repeat': str - } - - self.attribute_map = { - 'vertices': 'vertices', - 'edges': 'edges', - 'schedule': 'schedule', - 'repeat': 'repeat' - } - - self._vertices = vertices - self._edges = edges - self._schedule = schedule - self._repeat = repeat - - @classmethod - def from_dict(cls, dikt) -> 'GrootDataloadingJobConfig': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The GrootDataloadingJobConfig of this GrootDataloadingJobConfig. # noqa: E501 - :rtype: GrootDataloadingJobConfig - """ - return util.deserialize_model(dikt, cls) - - @property - def vertices(self) -> List[str]: - """Gets the vertices of this GrootDataloadingJobConfig. - - - :return: The vertices of this GrootDataloadingJobConfig. - :rtype: List[str] - """ - return self._vertices - - @vertices.setter - def vertices(self, vertices: List[str]): - """Sets the vertices of this GrootDataloadingJobConfig. - - - :param vertices: The vertices of this GrootDataloadingJobConfig. - :type vertices: List[str] - """ - - self._vertices = vertices - - @property - def edges(self) -> List[GrootDataloadingJobConfigEdgesInner]: - """Gets the edges of this GrootDataloadingJobConfig. - - - :return: The edges of this GrootDataloadingJobConfig. - :rtype: List[GrootDataloadingJobConfigEdgesInner] - """ - return self._edges - - @edges.setter - def edges(self, edges: List[GrootDataloadingJobConfigEdgesInner]): - """Sets the edges of this GrootDataloadingJobConfig. - - - :param edges: The edges of this GrootDataloadingJobConfig. - :type edges: List[GrootDataloadingJobConfigEdgesInner] - """ - - self._edges = edges - - @property - def schedule(self) -> str: - """Gets the schedule of this GrootDataloadingJobConfig. - - format with '2023-02-21 11:56:30' # noqa: E501 - - :return: The schedule of this GrootDataloadingJobConfig. - :rtype: str - """ - return self._schedule - - @schedule.setter - def schedule(self, schedule: str): - """Sets the schedule of this GrootDataloadingJobConfig. - - format with '2023-02-21 11:56:30' # noqa: E501 - - :param schedule: The schedule of this GrootDataloadingJobConfig. - :type schedule: str - """ - - self._schedule = schedule - - @property - def repeat(self) -> str: - """Gets the repeat of this GrootDataloadingJobConfig. - - - :return: The repeat of this GrootDataloadingJobConfig. - :rtype: str - """ - return self._repeat - - @repeat.setter - def repeat(self, repeat: str): - """Sets the repeat of this GrootDataloadingJobConfig. - - - :param repeat: The repeat of this GrootDataloadingJobConfig. - :type repeat: str - """ - allowed_values = ["once", "day", "week"] # noqa: E501 - if repeat not in allowed_values: - raise ValueError( - "Invalid value for `repeat` ({0}), must be one of {1}" - .format(repeat, allowed_values) - ) - - self._repeat = repeat diff --git a/flex/coordinator/gs_flex_coordinator/models/groot_edge_type.py b/flex/coordinator/gs_flex_coordinator/models/groot_edge_type.py deleted file mode 100644 index 9d2ae45c5c4e..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/groot_edge_type.py +++ /dev/null @@ -1,117 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.groot_edge_type_relations_inner import GrootEdgeTypeRelationsInner -from gs_flex_coordinator.models.groot_property import GrootProperty -from gs_flex_coordinator import util - -from gs_flex_coordinator.models.groot_edge_type_relations_inner import GrootEdgeTypeRelationsInner # noqa: E501 -from gs_flex_coordinator.models.groot_property import GrootProperty # noqa: E501 - -class GrootEdgeType(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, label=None, relations=None, properties=None): # noqa: E501 - """GrootEdgeType - a model defined in OpenAPI - - :param label: The label of this GrootEdgeType. # noqa: E501 - :type label: str - :param relations: The relations of this GrootEdgeType. # noqa: E501 - :type relations: List[GrootEdgeTypeRelationsInner] - :param properties: The properties of this GrootEdgeType. # noqa: E501 - :type properties: List[GrootProperty] - """ - self.openapi_types = { - 'label': str, - 'relations': List[GrootEdgeTypeRelationsInner], - 'properties': List[GrootProperty] - } - - self.attribute_map = { - 'label': 'label', - 'relations': 'relations', - 'properties': 'properties' - } - - self._label = label - self._relations = relations - self._properties = properties - - @classmethod - def from_dict(cls, dikt) -> 'GrootEdgeType': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The GrootEdgeType of this GrootEdgeType. # noqa: E501 - :rtype: GrootEdgeType - """ - return util.deserialize_model(dikt, cls) - - @property - def label(self) -> str: - """Gets the label of this GrootEdgeType. - - - :return: The label of this GrootEdgeType. - :rtype: str - """ - return self._label - - @label.setter - def label(self, label: str): - """Sets the label of this GrootEdgeType. - - - :param label: The label of this GrootEdgeType. - :type label: str - """ - - self._label = label - - @property - def relations(self) -> List[GrootEdgeTypeRelationsInner]: - """Gets the relations of this GrootEdgeType. - - - :return: The relations of this GrootEdgeType. - :rtype: List[GrootEdgeTypeRelationsInner] - """ - return self._relations - - @relations.setter - def relations(self, relations: List[GrootEdgeTypeRelationsInner]): - """Sets the relations of this GrootEdgeType. - - - :param relations: The relations of this GrootEdgeType. - :type relations: List[GrootEdgeTypeRelationsInner] - """ - - self._relations = relations - - @property - def properties(self) -> List[GrootProperty]: - """Gets the properties of this GrootEdgeType. - - - :return: The properties of this GrootEdgeType. - :rtype: List[GrootProperty] - """ - return self._properties - - @properties.setter - def properties(self, properties: List[GrootProperty]): - """Sets the properties of this GrootEdgeType. - - - :param properties: The properties of this GrootEdgeType. - :type properties: List[GrootProperty] - """ - - self._properties = properties diff --git a/flex/coordinator/gs_flex_coordinator/models/groot_edge_type_relations_inner.py b/flex/coordinator/gs_flex_coordinator/models/groot_edge_type_relations_inner.py deleted file mode 100644 index 9662593b3fec..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/groot_edge_type_relations_inner.py +++ /dev/null @@ -1,87 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util - - -class GrootEdgeTypeRelationsInner(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, src_label=None, dst_label=None): # noqa: E501 - """GrootEdgeTypeRelationsInner - a model defined in OpenAPI - - :param src_label: The src_label of this GrootEdgeTypeRelationsInner. # noqa: E501 - :type src_label: str - :param dst_label: The dst_label of this GrootEdgeTypeRelationsInner. # noqa: E501 - :type dst_label: str - """ - self.openapi_types = { - 'src_label': str, - 'dst_label': str - } - - self.attribute_map = { - 'src_label': 'src_label', - 'dst_label': 'dst_label' - } - - self._src_label = src_label - self._dst_label = dst_label - - @classmethod - def from_dict(cls, dikt) -> 'GrootEdgeTypeRelationsInner': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The GrootEdgeType_relations_inner of this GrootEdgeTypeRelationsInner. # noqa: E501 - :rtype: GrootEdgeTypeRelationsInner - """ - return util.deserialize_model(dikt, cls) - - @property - def src_label(self) -> str: - """Gets the src_label of this GrootEdgeTypeRelationsInner. - - - :return: The src_label of this GrootEdgeTypeRelationsInner. - :rtype: str - """ - return self._src_label - - @src_label.setter - def src_label(self, src_label: str): - """Sets the src_label of this GrootEdgeTypeRelationsInner. - - - :param src_label: The src_label of this GrootEdgeTypeRelationsInner. - :type src_label: str - """ - - self._src_label = src_label - - @property - def dst_label(self) -> str: - """Gets the dst_label of this GrootEdgeTypeRelationsInner. - - - :return: The dst_label of this GrootEdgeTypeRelationsInner. - :rtype: str - """ - return self._dst_label - - @dst_label.setter - def dst_label(self, dst_label: str): - """Sets the dst_label of this GrootEdgeTypeRelationsInner. - - - :param dst_label: The dst_label of this GrootEdgeTypeRelationsInner. - :type dst_label: str - """ - - self._dst_label = dst_label diff --git a/flex/coordinator/gs_flex_coordinator/models/groot_graph.py b/flex/coordinator/gs_flex_coordinator/models/groot_graph.py deleted file mode 100644 index 2ea67889ae32..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/groot_graph.py +++ /dev/null @@ -1,201 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.groot_graph_gremlin_interface import GrootGraphGremlinInterface -from gs_flex_coordinator.models.groot_schema import GrootSchema -from gs_flex_coordinator import util - -from gs_flex_coordinator.models.groot_graph_gremlin_interface import GrootGraphGremlinInterface # noqa: E501 -from gs_flex_coordinator.models.groot_schema import GrootSchema # noqa: E501 - -class GrootGraph(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, name=None, type=None, directed=None, creation_time=None, _schema=None, gremlin_interface=None): # noqa: E501 - """GrootGraph - a model defined in OpenAPI - - :param name: The name of this GrootGraph. # noqa: E501 - :type name: str - :param type: The type of this GrootGraph. # noqa: E501 - :type type: str - :param directed: The directed of this GrootGraph. # noqa: E501 - :type directed: bool - :param creation_time: The creation_time of this GrootGraph. # noqa: E501 - :type creation_time: str - :param _schema: The _schema of this GrootGraph. # noqa: E501 - :type _schema: GrootSchema - :param gremlin_interface: The gremlin_interface of this GrootGraph. # noqa: E501 - :type gremlin_interface: GrootGraphGremlinInterface - """ - self.openapi_types = { - 'name': str, - 'type': str, - 'directed': bool, - 'creation_time': str, - '_schema': GrootSchema, - 'gremlin_interface': GrootGraphGremlinInterface - } - - self.attribute_map = { - 'name': 'name', - 'type': 'type', - 'directed': 'directed', - 'creation_time': 'creation_time', - '_schema': 'schema', - 'gremlin_interface': 'gremlin_interface' - } - - self._name = name - self._type = type - self._directed = directed - self._creation_time = creation_time - self.__schema = _schema - self._gremlin_interface = gremlin_interface - - @classmethod - def from_dict(cls, dikt) -> 'GrootGraph': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The GrootGraph of this GrootGraph. # noqa: E501 - :rtype: GrootGraph - """ - return util.deserialize_model(dikt, cls) - - @property - def name(self) -> str: - """Gets the name of this GrootGraph. - - - :return: The name of this GrootGraph. - :rtype: str - """ - return self._name - - @name.setter - def name(self, name: str): - """Sets the name of this GrootGraph. - - - :param name: The name of this GrootGraph. - :type name: str - """ - - self._name = name - - @property - def type(self) -> str: - """Gets the type of this GrootGraph. - - - :return: The type of this GrootGraph. - :rtype: str - """ - return self._type - - @type.setter - def type(self, type: str): - """Sets the type of this GrootGraph. - - - :param type: The type of this GrootGraph. - :type type: str - """ - allowed_values = ["GrootGraph"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" - .format(type, allowed_values) - ) - - self._type = type - - @property - def directed(self) -> bool: - """Gets the directed of this GrootGraph. - - - :return: The directed of this GrootGraph. - :rtype: bool - """ - return self._directed - - @directed.setter - def directed(self, directed: bool): - """Sets the directed of this GrootGraph. - - - :param directed: The directed of this GrootGraph. - :type directed: bool - """ - - self._directed = directed - - @property - def creation_time(self) -> str: - """Gets the creation_time of this GrootGraph. - - - :return: The creation_time of this GrootGraph. - :rtype: str - """ - return self._creation_time - - @creation_time.setter - def creation_time(self, creation_time: str): - """Sets the creation_time of this GrootGraph. - - - :param creation_time: The creation_time of this GrootGraph. - :type creation_time: str - """ - - self._creation_time = creation_time - - @property - def _schema(self) -> GrootSchema: - """Gets the _schema of this GrootGraph. - - - :return: The _schema of this GrootGraph. - :rtype: GrootSchema - """ - return self.__schema - - @_schema.setter - def _schema(self, _schema: GrootSchema): - """Sets the _schema of this GrootGraph. - - - :param _schema: The _schema of this GrootGraph. - :type _schema: GrootSchema - """ - - self.__schema = _schema - - @property - def gremlin_interface(self) -> GrootGraphGremlinInterface: - """Gets the gremlin_interface of this GrootGraph. - - - :return: The gremlin_interface of this GrootGraph. - :rtype: GrootGraphGremlinInterface - """ - return self._gremlin_interface - - @gremlin_interface.setter - def gremlin_interface(self, gremlin_interface: GrootGraphGremlinInterface): - """Sets the gremlin_interface of this GrootGraph. - - - :param gremlin_interface: The gremlin_interface of this GrootGraph. - :type gremlin_interface: GrootGraphGremlinInterface - """ - - self._gremlin_interface = gremlin_interface diff --git a/flex/coordinator/gs_flex_coordinator/models/groot_graph_gremlin_interface.py b/flex/coordinator/gs_flex_coordinator/models/groot_graph_gremlin_interface.py deleted file mode 100644 index 97b719030721..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/groot_graph_gremlin_interface.py +++ /dev/null @@ -1,139 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util - - -class GrootGraphGremlinInterface(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, gremlin_endpoint=None, grpc_endpoint=None, username=None, password=None): # noqa: E501 - """GrootGraphGremlinInterface - a model defined in OpenAPI - - :param gremlin_endpoint: The gremlin_endpoint of this GrootGraphGremlinInterface. # noqa: E501 - :type gremlin_endpoint: str - :param grpc_endpoint: The grpc_endpoint of this GrootGraphGremlinInterface. # noqa: E501 - :type grpc_endpoint: str - :param username: The username of this GrootGraphGremlinInterface. # noqa: E501 - :type username: str - :param password: The password of this GrootGraphGremlinInterface. # noqa: E501 - :type password: str - """ - self.openapi_types = { - 'gremlin_endpoint': str, - 'grpc_endpoint': str, - 'username': str, - 'password': str - } - - self.attribute_map = { - 'gremlin_endpoint': 'gremlin_endpoint', - 'grpc_endpoint': 'grpc_endpoint', - 'username': 'username', - 'password': 'password' - } - - self._gremlin_endpoint = gremlin_endpoint - self._grpc_endpoint = grpc_endpoint - self._username = username - self._password = password - - @classmethod - def from_dict(cls, dikt) -> 'GrootGraphGremlinInterface': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The GrootGraph_gremlin_interface of this GrootGraphGremlinInterface. # noqa: E501 - :rtype: GrootGraphGremlinInterface - """ - return util.deserialize_model(dikt, cls) - - @property - def gremlin_endpoint(self) -> str: - """Gets the gremlin_endpoint of this GrootGraphGremlinInterface. - - - :return: The gremlin_endpoint of this GrootGraphGremlinInterface. - :rtype: str - """ - return self._gremlin_endpoint - - @gremlin_endpoint.setter - def gremlin_endpoint(self, gremlin_endpoint: str): - """Sets the gremlin_endpoint of this GrootGraphGremlinInterface. - - - :param gremlin_endpoint: The gremlin_endpoint of this GrootGraphGremlinInterface. - :type gremlin_endpoint: str - """ - - self._gremlin_endpoint = gremlin_endpoint - - @property - def grpc_endpoint(self) -> str: - """Gets the grpc_endpoint of this GrootGraphGremlinInterface. - - - :return: The grpc_endpoint of this GrootGraphGremlinInterface. - :rtype: str - """ - return self._grpc_endpoint - - @grpc_endpoint.setter - def grpc_endpoint(self, grpc_endpoint: str): - """Sets the grpc_endpoint of this GrootGraphGremlinInterface. - - - :param grpc_endpoint: The grpc_endpoint of this GrootGraphGremlinInterface. - :type grpc_endpoint: str - """ - - self._grpc_endpoint = grpc_endpoint - - @property - def username(self) -> str: - """Gets the username of this GrootGraphGremlinInterface. - - - :return: The username of this GrootGraphGremlinInterface. - :rtype: str - """ - return self._username - - @username.setter - def username(self, username: str): - """Sets the username of this GrootGraphGremlinInterface. - - - :param username: The username of this GrootGraphGremlinInterface. - :type username: str - """ - - self._username = username - - @property - def password(self) -> str: - """Gets the password of this GrootGraphGremlinInterface. - - - :return: The password of this GrootGraphGremlinInterface. - :rtype: str - """ - return self._password - - @password.setter - def password(self, password: str): - """Sets the password of this GrootGraphGremlinInterface. - - - :param password: The password of this GrootGraphGremlinInterface. - :type password: str - """ - - self._password = password diff --git a/flex/coordinator/gs_flex_coordinator/models/groot_property.py b/flex/coordinator/gs_flex_coordinator/models/groot_property.py deleted file mode 100644 index c45b332002bd..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/groot_property.py +++ /dev/null @@ -1,145 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util - - -class GrootProperty(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, id=None, name=None, type=None, is_primary_key=None): # noqa: E501 - """GrootProperty - a model defined in OpenAPI - - :param id: The id of this GrootProperty. # noqa: E501 - :type id: int - :param name: The name of this GrootProperty. # noqa: E501 - :type name: str - :param type: The type of this GrootProperty. # noqa: E501 - :type type: str - :param is_primary_key: The is_primary_key of this GrootProperty. # noqa: E501 - :type is_primary_key: bool - """ - self.openapi_types = { - 'id': int, - 'name': str, - 'type': str, - 'is_primary_key': bool - } - - self.attribute_map = { - 'id': 'id', - 'name': 'name', - 'type': 'type', - 'is_primary_key': 'is_primary_key' - } - - self._id = id - self._name = name - self._type = type - self._is_primary_key = is_primary_key - - @classmethod - def from_dict(cls, dikt) -> 'GrootProperty': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The GrootProperty of this GrootProperty. # noqa: E501 - :rtype: GrootProperty - """ - return util.deserialize_model(dikt, cls) - - @property - def id(self) -> int: - """Gets the id of this GrootProperty. - - - :return: The id of this GrootProperty. - :rtype: int - """ - return self._id - - @id.setter - def id(self, id: int): - """Sets the id of this GrootProperty. - - - :param id: The id of this GrootProperty. - :type id: int - """ - - self._id = id - - @property - def name(self) -> str: - """Gets the name of this GrootProperty. - - - :return: The name of this GrootProperty. - :rtype: str - """ - return self._name - - @name.setter - def name(self, name: str): - """Sets the name of this GrootProperty. - - - :param name: The name of this GrootProperty. - :type name: str - """ - - self._name = name - - @property - def type(self) -> str: - """Gets the type of this GrootProperty. - - - :return: The type of this GrootProperty. - :rtype: str - """ - return self._type - - @type.setter - def type(self, type: str): - """Sets the type of this GrootProperty. - - - :param type: The type of this GrootProperty. - :type type: str - """ - allowed_values = ["DT_STRING", "DT_SIGNED_INT64", "DT_DOUBLE"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" - .format(type, allowed_values) - ) - - self._type = type - - @property - def is_primary_key(self) -> bool: - """Gets the is_primary_key of this GrootProperty. - - - :return: The is_primary_key of this GrootProperty. - :rtype: bool - """ - return self._is_primary_key - - @is_primary_key.setter - def is_primary_key(self, is_primary_key: bool): - """Sets the is_primary_key of this GrootProperty. - - - :param is_primary_key: The is_primary_key of this GrootProperty. - :type is_primary_key: bool - """ - - self._is_primary_key = is_primary_key diff --git a/flex/coordinator/gs_flex_coordinator/models/groot_schema.py b/flex/coordinator/gs_flex_coordinator/models/groot_schema.py deleted file mode 100644 index 1df5884cdb20..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/groot_schema.py +++ /dev/null @@ -1,91 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.groot_edge_type import GrootEdgeType -from gs_flex_coordinator.models.groot_vertex_type import GrootVertexType -from gs_flex_coordinator import util - -from gs_flex_coordinator.models.groot_edge_type import GrootEdgeType # noqa: E501 -from gs_flex_coordinator.models.groot_vertex_type import GrootVertexType # noqa: E501 - -class GrootSchema(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, vertices=None, edges=None): # noqa: E501 - """GrootSchema - a model defined in OpenAPI - - :param vertices: The vertices of this GrootSchema. # noqa: E501 - :type vertices: List[GrootVertexType] - :param edges: The edges of this GrootSchema. # noqa: E501 - :type edges: List[GrootEdgeType] - """ - self.openapi_types = { - 'vertices': List[GrootVertexType], - 'edges': List[GrootEdgeType] - } - - self.attribute_map = { - 'vertices': 'vertices', - 'edges': 'edges' - } - - self._vertices = vertices - self._edges = edges - - @classmethod - def from_dict(cls, dikt) -> 'GrootSchema': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The GrootSchema of this GrootSchema. # noqa: E501 - :rtype: GrootSchema - """ - return util.deserialize_model(dikt, cls) - - @property - def vertices(self) -> List[GrootVertexType]: - """Gets the vertices of this GrootSchema. - - - :return: The vertices of this GrootSchema. - :rtype: List[GrootVertexType] - """ - return self._vertices - - @vertices.setter - def vertices(self, vertices: List[GrootVertexType]): - """Sets the vertices of this GrootSchema. - - - :param vertices: The vertices of this GrootSchema. - :type vertices: List[GrootVertexType] - """ - - self._vertices = vertices - - @property - def edges(self) -> List[GrootEdgeType]: - """Gets the edges of this GrootSchema. - - - :return: The edges of this GrootSchema. - :rtype: List[GrootEdgeType] - """ - return self._edges - - @edges.setter - def edges(self, edges: List[GrootEdgeType]): - """Sets the edges of this GrootSchema. - - - :param edges: The edges of this GrootSchema. - :type edges: List[GrootEdgeType] - """ - - self._edges = edges diff --git a/flex/coordinator/gs_flex_coordinator/models/groot_vertex_type.py b/flex/coordinator/gs_flex_coordinator/models/groot_vertex_type.py deleted file mode 100644 index 955a907a0bcd..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/groot_vertex_type.py +++ /dev/null @@ -1,89 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.groot_property import GrootProperty -from gs_flex_coordinator import util - -from gs_flex_coordinator.models.groot_property import GrootProperty # noqa: E501 - -class GrootVertexType(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, label=None, properties=None): # noqa: E501 - """GrootVertexType - a model defined in OpenAPI - - :param label: The label of this GrootVertexType. # noqa: E501 - :type label: str - :param properties: The properties of this GrootVertexType. # noqa: E501 - :type properties: List[GrootProperty] - """ - self.openapi_types = { - 'label': str, - 'properties': List[GrootProperty] - } - - self.attribute_map = { - 'label': 'label', - 'properties': 'properties' - } - - self._label = label - self._properties = properties - - @classmethod - def from_dict(cls, dikt) -> 'GrootVertexType': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The GrootVertexType of this GrootVertexType. # noqa: E501 - :rtype: GrootVertexType - """ - return util.deserialize_model(dikt, cls) - - @property - def label(self) -> str: - """Gets the label of this GrootVertexType. - - - :return: The label of this GrootVertexType. - :rtype: str - """ - return self._label - - @label.setter - def label(self, label: str): - """Sets the label of this GrootVertexType. - - - :param label: The label of this GrootVertexType. - :type label: str - """ - - self._label = label - - @property - def properties(self) -> List[GrootProperty]: - """Gets the properties of this GrootVertexType. - - - :return: The properties of this GrootVertexType. - :rtype: List[GrootProperty] - """ - return self._properties - - @properties.setter - def properties(self, properties: List[GrootProperty]): - """Sets the properties of this GrootVertexType. - - - :param properties: The properties of this GrootVertexType. - :type properties: List[GrootProperty] - """ - - self._properties = properties diff --git a/flex/coordinator/gs_flex_coordinator/models/gs_data_type.py b/flex/coordinator/gs_flex_coordinator/models/gs_data_type.py new file mode 100644 index 000000000000..8ba27bee55e8 --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/gs_data_type.py @@ -0,0 +1,101 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator.models.primitive_type import PrimitiveType +from gs_flex_coordinator.models.string_type import StringType +from gs_flex_coordinator.models.string_type_string import StringTypeString +from gs_flex_coordinator import util + +from gs_flex_coordinator.models.primitive_type import PrimitiveType # noqa: E501 +from gs_flex_coordinator.models.string_type import StringType # noqa: E501 +from gs_flex_coordinator.models.string_type_string import StringTypeString # noqa: E501 + +class GSDataType(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, primitive_type=None, string=None): # noqa: E501 + """GSDataType - a model defined in OpenAPI + + :param primitive_type: The primitive_type of this GSDataType. # noqa: E501 + :type primitive_type: str + :param string: The string of this GSDataType. # noqa: E501 + :type string: StringTypeString + """ + self.openapi_types = { + 'primitive_type': str, + 'string': StringTypeString + } + + self.attribute_map = { + 'primitive_type': 'primitive_type', + 'string': 'string' + } + + self._primitive_type = primitive_type + self._string = string + + @classmethod + def from_dict(cls, dikt) -> 'GSDataType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The GSDataType of this GSDataType. # noqa: E501 + :rtype: GSDataType + """ + return util.deserialize_model(dikt, cls) + + @property + def primitive_type(self) -> str: + """Gets the primitive_type of this GSDataType. + + + :return: The primitive_type of this GSDataType. + :rtype: str + """ + return self._primitive_type + + @primitive_type.setter + def primitive_type(self, primitive_type: str): + """Sets the primitive_type of this GSDataType. + + + :param primitive_type: The primitive_type of this GSDataType. + :type primitive_type: str + """ + allowed_values = ["DT_SIGNED_INT32", "DT_UNSIGNED_INT32", "DT_SIGNED_INT64", "DT_UNSIGNED_INT64", "DT_BOOL", "DT_FLOAT", "DT_DOUBLE"] # noqa: E501 + if primitive_type not in allowed_values: + raise ValueError( + "Invalid value for `primitive_type` ({0}), must be one of {1}" + .format(primitive_type, allowed_values) + ) + + self._primitive_type = primitive_type + + @property + def string(self) -> StringTypeString: + """Gets the string of this GSDataType. + + + :return: The string of this GSDataType. + :rtype: StringTypeString + """ + return self._string + + @string.setter + def string(self, string: StringTypeString): + """Sets the string of this GSDataType. + + + :param string: The string of this GSDataType. + :type string: StringTypeString + """ + if string is None: + raise ValueError("Invalid value for `string`, must not be `None`") # noqa: E501 + + self._string = string diff --git a/flex/coordinator/gs_flex_coordinator/models/job_status.py b/flex/coordinator/gs_flex_coordinator/models/job_status.py index c4894ec41752..bf17ca00d4ca 100644 --- a/flex/coordinator/gs_flex_coordinator/models/job_status.py +++ b/flex/coordinator/gs_flex_coordinator/models/job_status.py @@ -12,11 +12,11 @@ class JobStatus(Model): Do not edit the class manually. """ - def __init__(self, job_id=None, type=None, status=None, start_time=None, end_time=None, log=None, detail=None): # noqa: E501 + def __init__(self, id=None, type=None, status=None, start_time=None, end_time=None, log=None, detail=None): # noqa: E501 """JobStatus - a model defined in OpenAPI - :param job_id: The job_id of this JobStatus. # noqa: E501 - :type job_id: str + :param id: The id of this JobStatus. # noqa: E501 + :type id: str :param type: The type of this JobStatus. # noqa: E501 :type type: str :param status: The status of this JobStatus. # noqa: E501 @@ -31,7 +31,7 @@ def __init__(self, job_id=None, type=None, status=None, start_time=None, end_tim :type detail: Dict[str, object] """ self.openapi_types = { - 'job_id': str, + 'id': str, 'type': str, 'status': str, 'start_time': str, @@ -41,7 +41,7 @@ def __init__(self, job_id=None, type=None, status=None, start_time=None, end_tim } self.attribute_map = { - 'job_id': 'job_id', + 'id': 'id', 'type': 'type', 'status': 'status', 'start_time': 'start_time', @@ -50,7 +50,7 @@ def __init__(self, job_id=None, type=None, status=None, start_time=None, end_tim 'detail': 'detail' } - self._job_id = job_id + self._id = id self._type = type self._status = status self._start_time = start_time @@ -70,25 +70,27 @@ def from_dict(cls, dikt) -> 'JobStatus': return util.deserialize_model(dikt, cls) @property - def job_id(self) -> str: - """Gets the job_id of this JobStatus. + def id(self) -> str: + """Gets the id of this JobStatus. - :return: The job_id of this JobStatus. + :return: The id of this JobStatus. :rtype: str """ - return self._job_id + return self._id - @job_id.setter - def job_id(self, job_id: str): - """Sets the job_id of this JobStatus. + @id.setter + def id(self, id: str): + """Sets the id of this JobStatus. - :param job_id: The job_id of this JobStatus. - :type job_id: str + :param id: The id of this JobStatus. + :type id: str """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - self._job_id = job_id + self._id = id @property def type(self) -> str: @@ -108,6 +110,8 @@ def type(self, type: str): :param type: The type of this JobStatus. :type type: str """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 self._type = type @@ -184,7 +188,7 @@ def end_time(self, end_time: str): def log(self) -> str: """Gets the log of this JobStatus. - URL or log string # noqa: E501 + logview URL or log string # noqa: E501 :return: The log of this JobStatus. :rtype: str @@ -195,7 +199,7 @@ def log(self) -> str: def log(self, log: str): """Sets the log of this JobStatus. - URL or log string # noqa: E501 + logview URL or log string # noqa: E501 :param log: The log of this JobStatus. :type log: str diff --git a/flex/coordinator/gs_flex_coordinator/models/long_text.py b/flex/coordinator/gs_flex_coordinator/models/long_text.py new file mode 100644 index 000000000000..443ea6224073 --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/long_text.py @@ -0,0 +1,63 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator import util + + +class LongText(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, long_text=None): # noqa: E501 + """LongText - a model defined in OpenAPI + + :param long_text: The long_text of this LongText. # noqa: E501 + :type long_text: str + """ + self.openapi_types = { + 'long_text': str + } + + self.attribute_map = { + 'long_text': 'long_text' + } + + self._long_text = long_text + + @classmethod + def from_dict(cls, dikt) -> 'LongText': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The LongText of this LongText. # noqa: E501 + :rtype: LongText + """ + return util.deserialize_model(dikt, cls) + + @property + def long_text(self) -> str: + """Gets the long_text of this LongText. + + + :return: The long_text of this LongText. + :rtype: str + """ + return self._long_text + + @long_text.setter + def long_text(self, long_text: str): + """Sets the long_text of this LongText. + + + :param long_text: The long_text of this LongText. + :type long_text: str + """ + if long_text is None: + raise ValueError("Invalid value for `long_text`, must not be `None`") # noqa: E501 + + self._long_text = long_text diff --git a/flex/coordinator/gs_flex_coordinator/models/model_property.py b/flex/coordinator/gs_flex_coordinator/models/model_property.py deleted file mode 100644 index d80e193efadf..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/model_property.py +++ /dev/null @@ -1,115 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.property_property_type import PropertyPropertyType -from gs_flex_coordinator import util - -from gs_flex_coordinator.models.property_property_type import PropertyPropertyType # noqa: E501 - -class ModelProperty(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, property_id=None, property_name=None, property_type=None): # noqa: E501 - """ModelProperty - a model defined in OpenAPI - - :param property_id: The property_id of this ModelProperty. # noqa: E501 - :type property_id: int - :param property_name: The property_name of this ModelProperty. # noqa: E501 - :type property_name: str - :param property_type: The property_type of this ModelProperty. # noqa: E501 - :type property_type: PropertyPropertyType - """ - self.openapi_types = { - 'property_id': int, - 'property_name': str, - 'property_type': PropertyPropertyType - } - - self.attribute_map = { - 'property_id': 'property_id', - 'property_name': 'property_name', - 'property_type': 'property_type' - } - - self._property_id = property_id - self._property_name = property_name - self._property_type = property_type - - @classmethod - def from_dict(cls, dikt) -> 'ModelProperty': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The Property of this ModelProperty. # noqa: E501 - :rtype: ModelProperty - """ - return util.deserialize_model(dikt, cls) - - @property - def property_id(self) -> int: - """Gets the property_id of this ModelProperty. - - - :return: The property_id of this ModelProperty. - :rtype: int - """ - return self._property_id - - @property_id.setter - def property_id(self, property_id: int): - """Sets the property_id of this ModelProperty. - - - :param property_id: The property_id of this ModelProperty. - :type property_id: int - """ - - self._property_id = property_id - - @property - def property_name(self) -> str: - """Gets the property_name of this ModelProperty. - - - :return: The property_name of this ModelProperty. - :rtype: str - """ - return self._property_name - - @property_name.setter - def property_name(self, property_name: str): - """Sets the property_name of this ModelProperty. - - - :param property_name: The property_name of this ModelProperty. - :type property_name: str - """ - - self._property_name = property_name - - @property - def property_type(self) -> PropertyPropertyType: - """Gets the property_type of this ModelProperty. - - - :return: The property_type of this ModelProperty. - :rtype: PropertyPropertyType - """ - return self._property_type - - @property_type.setter - def property_type(self, property_type: PropertyPropertyType): - """Sets the property_type of this ModelProperty. - - - :param property_type: The property_type of this ModelProperty. - :type property_type: PropertyPropertyType - """ - - self._property_type = property_type diff --git a/flex/coordinator/gs_flex_coordinator/models/model_schema.py b/flex/coordinator/gs_flex_coordinator/models/model_schema.py deleted file mode 100644 index 6bb9e34e5e54..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/model_schema.py +++ /dev/null @@ -1,91 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.edge_type import EdgeType -from gs_flex_coordinator.models.vertex_type import VertexType -from gs_flex_coordinator import util - -from gs_flex_coordinator.models.edge_type import EdgeType # noqa: E501 -from gs_flex_coordinator.models.vertex_type import VertexType # noqa: E501 - -class ModelSchema(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, vertex_types=None, edge_types=None): # noqa: E501 - """ModelSchema - a model defined in OpenAPI - - :param vertex_types: The vertex_types of this ModelSchema. # noqa: E501 - :type vertex_types: List[VertexType] - :param edge_types: The edge_types of this ModelSchema. # noqa: E501 - :type edge_types: List[EdgeType] - """ - self.openapi_types = { - 'vertex_types': List[VertexType], - 'edge_types': List[EdgeType] - } - - self.attribute_map = { - 'vertex_types': 'vertex_types', - 'edge_types': 'edge_types' - } - - self._vertex_types = vertex_types - self._edge_types = edge_types - - @classmethod - def from_dict(cls, dikt) -> 'ModelSchema': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The Schema of this ModelSchema. # noqa: E501 - :rtype: ModelSchema - """ - return util.deserialize_model(dikt, cls) - - @property - def vertex_types(self) -> List[VertexType]: - """Gets the vertex_types of this ModelSchema. - - - :return: The vertex_types of this ModelSchema. - :rtype: List[VertexType] - """ - return self._vertex_types - - @vertex_types.setter - def vertex_types(self, vertex_types: List[VertexType]): - """Sets the vertex_types of this ModelSchema. - - - :param vertex_types: The vertex_types of this ModelSchema. - :type vertex_types: List[VertexType] - """ - - self._vertex_types = vertex_types - - @property - def edge_types(self) -> List[EdgeType]: - """Gets the edge_types of this ModelSchema. - - - :return: The edge_types of this ModelSchema. - :rtype: List[EdgeType] - """ - return self._edge_types - - @edge_types.setter - def edge_types(self, edge_types: List[EdgeType]): - """Sets the edge_types of this ModelSchema. - - - :param edge_types: The edge_types of this ModelSchema. - :type edge_types: List[EdgeType] - """ - - self._edge_types = edge_types diff --git a/flex/coordinator/gs_flex_coordinator/models/node_status.py b/flex/coordinator/gs_flex_coordinator/models/node_status.py deleted file mode 100644 index 584a42f7092b..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/node_status.py +++ /dev/null @@ -1,139 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util - - -class NodeStatus(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, node=None, cpu_usage=None, memory_usage=None, disk_usage=None): # noqa: E501 - """NodeStatus - a model defined in OpenAPI - - :param node: The node of this NodeStatus. # noqa: E501 - :type node: str - :param cpu_usage: The cpu_usage of this NodeStatus. # noqa: E501 - :type cpu_usage: float - :param memory_usage: The memory_usage of this NodeStatus. # noqa: E501 - :type memory_usage: float - :param disk_usage: The disk_usage of this NodeStatus. # noqa: E501 - :type disk_usage: float - """ - self.openapi_types = { - 'node': str, - 'cpu_usage': float, - 'memory_usage': float, - 'disk_usage': float - } - - self.attribute_map = { - 'node': 'node', - 'cpu_usage': 'cpu_usage', - 'memory_usage': 'memory_usage', - 'disk_usage': 'disk_usage' - } - - self._node = node - self._cpu_usage = cpu_usage - self._memory_usage = memory_usage - self._disk_usage = disk_usage - - @classmethod - def from_dict(cls, dikt) -> 'NodeStatus': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The NodeStatus of this NodeStatus. # noqa: E501 - :rtype: NodeStatus - """ - return util.deserialize_model(dikt, cls) - - @property - def node(self) -> str: - """Gets the node of this NodeStatus. - - - :return: The node of this NodeStatus. - :rtype: str - """ - return self._node - - @node.setter - def node(self, node: str): - """Sets the node of this NodeStatus. - - - :param node: The node of this NodeStatus. - :type node: str - """ - - self._node = node - - @property - def cpu_usage(self) -> float: - """Gets the cpu_usage of this NodeStatus. - - - :return: The cpu_usage of this NodeStatus. - :rtype: float - """ - return self._cpu_usage - - @cpu_usage.setter - def cpu_usage(self, cpu_usage: float): - """Sets the cpu_usage of this NodeStatus. - - - :param cpu_usage: The cpu_usage of this NodeStatus. - :type cpu_usage: float - """ - - self._cpu_usage = cpu_usage - - @property - def memory_usage(self) -> float: - """Gets the memory_usage of this NodeStatus. - - - :return: The memory_usage of this NodeStatus. - :rtype: float - """ - return self._memory_usage - - @memory_usage.setter - def memory_usage(self, memory_usage: float): - """Sets the memory_usage of this NodeStatus. - - - :param memory_usage: The memory_usage of this NodeStatus. - :type memory_usage: float - """ - - self._memory_usage = memory_usage - - @property - def disk_usage(self) -> float: - """Gets the disk_usage of this NodeStatus. - - - :return: The disk_usage of this NodeStatus. - :rtype: float - """ - return self._disk_usage - - @disk_usage.setter - def disk_usage(self, disk_usage: float): - """Sets the disk_usage of this NodeStatus. - - - :param disk_usage: The disk_usage of this NodeStatus. - :type disk_usage: float - """ - - self._disk_usage = disk_usage diff --git a/flex/coordinator/gs_flex_coordinator/models/parameter.py b/flex/coordinator/gs_flex_coordinator/models/parameter.py new file mode 100644 index 000000000000..c62fdb7d6615 --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/parameter.py @@ -0,0 +1,93 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator.models.gs_data_type import GSDataType +from gs_flex_coordinator import util + +from gs_flex_coordinator.models.gs_data_type import GSDataType # noqa: E501 + +class Parameter(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, name=None, type=None): # noqa: E501 + """Parameter - a model defined in OpenAPI + + :param name: The name of this Parameter. # noqa: E501 + :type name: str + :param type: The type of this Parameter. # noqa: E501 + :type type: GSDataType + """ + self.openapi_types = { + 'name': str, + 'type': GSDataType + } + + self.attribute_map = { + 'name': 'name', + 'type': 'type' + } + + self._name = name + self._type = type + + @classmethod + def from_dict(cls, dikt) -> 'Parameter': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The Parameter of this Parameter. # noqa: E501 + :rtype: Parameter + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> str: + """Gets the name of this Parameter. + + + :return: The name of this Parameter. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name: str): + """Sets the name of this Parameter. + + + :param name: The name of this Parameter. + :type name: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def type(self) -> GSDataType: + """Gets the type of this Parameter. + + + :return: The type of this Parameter. + :rtype: GSDataType + """ + return self._type + + @type.setter + def type(self, type: GSDataType): + """Sets the type of this Parameter. + + + :param type: The type of this Parameter. + :type type: GSDataType + """ + if type is None: + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + + self._type = type diff --git a/flex/coordinator/gs_flex_coordinator/models/property_property_type.py b/flex/coordinator/gs_flex_coordinator/models/primitive_type.py similarity index 63% rename from flex/coordinator/gs_flex_coordinator/models/property_property_type.py rename to flex/coordinator/gs_flex_coordinator/models/primitive_type.py index b45ae52d5ac7..95ed32da2bc6 100644 --- a/flex/coordinator/gs_flex_coordinator/models/property_property_type.py +++ b/flex/coordinator/gs_flex_coordinator/models/primitive_type.py @@ -6,16 +6,16 @@ from gs_flex_coordinator import util -class PropertyPropertyType(Model): +class PrimitiveType(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. """ def __init__(self, primitive_type=None): # noqa: E501 - """PropertyPropertyType - a model defined in OpenAPI + """PrimitiveType - a model defined in OpenAPI - :param primitive_type: The primitive_type of this PropertyPropertyType. # noqa: E501 + :param primitive_type: The primitive_type of this PrimitiveType. # noqa: E501 :type primitive_type: str """ self.openapi_types = { @@ -29,35 +29,35 @@ def __init__(self, primitive_type=None): # noqa: E501 self._primitive_type = primitive_type @classmethod - def from_dict(cls, dikt) -> 'PropertyPropertyType': + def from_dict(cls, dikt) -> 'PrimitiveType': """Returns the dict as a model :param dikt: A dict. :type: dict - :return: The Property_property_type of this PropertyPropertyType. # noqa: E501 - :rtype: PropertyPropertyType + :return: The PrimitiveType of this PrimitiveType. # noqa: E501 + :rtype: PrimitiveType """ return util.deserialize_model(dikt, cls) @property def primitive_type(self) -> str: - """Gets the primitive_type of this PropertyPropertyType. + """Gets the primitive_type of this PrimitiveType. - :return: The primitive_type of this PropertyPropertyType. + :return: The primitive_type of this PrimitiveType. :rtype: str """ return self._primitive_type @primitive_type.setter def primitive_type(self, primitive_type: str): - """Sets the primitive_type of this PropertyPropertyType. + """Sets the primitive_type of this PrimitiveType. - :param primitive_type: The primitive_type of this PropertyPropertyType. + :param primitive_type: The primitive_type of this PrimitiveType. :type primitive_type: str """ - allowed_values = ["DT_DOUBLE", "DT_STRING", "DT_SIGNED_INT32", "DT_SIGNED_INT64", "DT_DATE32"] # noqa: E501 + allowed_values = ["DT_SIGNED_INT32", "DT_UNSIGNED_INT32", "DT_SIGNED_INT64", "DT_UNSIGNED_INT64", "DT_BOOL", "DT_FLOAT", "DT_DOUBLE"] # noqa: E501 if primitive_type not in allowed_values: raise ValueError( "Invalid value for `primitive_type` ({0}), must be one of {1}" diff --git a/flex/coordinator/gs_flex_coordinator/models/procedure.py b/flex/coordinator/gs_flex_coordinator/models/procedure.py deleted file mode 100644 index 8fd20f234ff3..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/procedure.py +++ /dev/null @@ -1,277 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.procedure_params_inner import ProcedureParamsInner -from gs_flex_coordinator import util - -from gs_flex_coordinator.models.procedure_params_inner import ProcedureParamsInner # noqa: E501 - -class Procedure(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, name=None, bound_graph=None, description=None, type=None, query=None, enable=None, runnable=None, params=None, returns=None): # noqa: E501 - """Procedure - a model defined in OpenAPI - - :param name: The name of this Procedure. # noqa: E501 - :type name: str - :param bound_graph: The bound_graph of this Procedure. # noqa: E501 - :type bound_graph: str - :param description: The description of this Procedure. # noqa: E501 - :type description: str - :param type: The type of this Procedure. # noqa: E501 - :type type: str - :param query: The query of this Procedure. # noqa: E501 - :type query: str - :param enable: The enable of this Procedure. # noqa: E501 - :type enable: bool - :param runnable: The runnable of this Procedure. # noqa: E501 - :type runnable: bool - :param params: The params of this Procedure. # noqa: E501 - :type params: List[ProcedureParamsInner] - :param returns: The returns of this Procedure. # noqa: E501 - :type returns: List[ProcedureParamsInner] - """ - self.openapi_types = { - 'name': str, - 'bound_graph': str, - 'description': str, - 'type': str, - 'query': str, - 'enable': bool, - 'runnable': bool, - 'params': List[ProcedureParamsInner], - 'returns': List[ProcedureParamsInner] - } - - self.attribute_map = { - 'name': 'name', - 'bound_graph': 'bound_graph', - 'description': 'description', - 'type': 'type', - 'query': 'query', - 'enable': 'enable', - 'runnable': 'runnable', - 'params': 'params', - 'returns': 'returns' - } - - self._name = name - self._bound_graph = bound_graph - self._description = description - self._type = type - self._query = query - self._enable = enable - self._runnable = runnable - self._params = params - self._returns = returns - - @classmethod - def from_dict(cls, dikt) -> 'Procedure': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The Procedure of this Procedure. # noqa: E501 - :rtype: Procedure - """ - return util.deserialize_model(dikt, cls) - - @property - def name(self) -> str: - """Gets the name of this Procedure. - - - :return: The name of this Procedure. - :rtype: str - """ - return self._name - - @name.setter - def name(self, name: str): - """Sets the name of this Procedure. - - - :param name: The name of this Procedure. - :type name: str - """ - - self._name = name - - @property - def bound_graph(self) -> str: - """Gets the bound_graph of this Procedure. - - - :return: The bound_graph of this Procedure. - :rtype: str - """ - return self._bound_graph - - @bound_graph.setter - def bound_graph(self, bound_graph: str): - """Sets the bound_graph of this Procedure. - - - :param bound_graph: The bound_graph of this Procedure. - :type bound_graph: str - """ - - self._bound_graph = bound_graph - - @property - def description(self) -> str: - """Gets the description of this Procedure. - - - :return: The description of this Procedure. - :rtype: str - """ - return self._description - - @description.setter - def description(self, description: str): - """Sets the description of this Procedure. - - - :param description: The description of this Procedure. - :type description: str - """ - - self._description = description - - @property - def type(self) -> str: - """Gets the type of this Procedure. - - - :return: The type of this Procedure. - :rtype: str - """ - return self._type - - @type.setter - def type(self, type: str): - """Sets the type of this Procedure. - - - :param type: The type of this Procedure. - :type type: str - """ - allowed_values = ["cpp", "cypher"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" - .format(type, allowed_values) - ) - - self._type = type - - @property - def query(self) -> str: - """Gets the query of this Procedure. - - - :return: The query of this Procedure. - :rtype: str - """ - return self._query - - @query.setter - def query(self, query: str): - """Sets the query of this Procedure. - - - :param query: The query of this Procedure. - :type query: str - """ - - self._query = query - - @property - def enable(self) -> bool: - """Gets the enable of this Procedure. - - - :return: The enable of this Procedure. - :rtype: bool - """ - return self._enable - - @enable.setter - def enable(self, enable: bool): - """Sets the enable of this Procedure. - - - :param enable: The enable of this Procedure. - :type enable: bool - """ - - self._enable = enable - - @property - def runnable(self) -> bool: - """Gets the runnable of this Procedure. - - - :return: The runnable of this Procedure. - :rtype: bool - """ - return self._runnable - - @runnable.setter - def runnable(self, runnable: bool): - """Sets the runnable of this Procedure. - - - :param runnable: The runnable of this Procedure. - :type runnable: bool - """ - - self._runnable = runnable - - @property - def params(self) -> List[ProcedureParamsInner]: - """Gets the params of this Procedure. - - - :return: The params of this Procedure. - :rtype: List[ProcedureParamsInner] - """ - return self._params - - @params.setter - def params(self, params: List[ProcedureParamsInner]): - """Sets the params of this Procedure. - - - :param params: The params of this Procedure. - :type params: List[ProcedureParamsInner] - """ - - self._params = params - - @property - def returns(self) -> List[ProcedureParamsInner]: - """Gets the returns of this Procedure. - - - :return: The returns of this Procedure. - :rtype: List[ProcedureParamsInner] - """ - return self._returns - - @returns.setter - def returns(self, returns: List[ProcedureParamsInner]): - """Sets the returns of this Procedure. - - - :param returns: The returns of this Procedure. - :type returns: List[ProcedureParamsInner] - """ - - self._returns = returns diff --git a/flex/coordinator/gs_flex_coordinator/models/procedure_params_inner.py b/flex/coordinator/gs_flex_coordinator/models/procedure_params_inner.py deleted file mode 100644 index 9dc0404dee42..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/procedure_params_inner.py +++ /dev/null @@ -1,87 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util - - -class ProcedureParamsInner(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, name=None, type=None): # noqa: E501 - """ProcedureParamsInner - a model defined in OpenAPI - - :param name: The name of this ProcedureParamsInner. # noqa: E501 - :type name: str - :param type: The type of this ProcedureParamsInner. # noqa: E501 - :type type: str - """ - self.openapi_types = { - 'name': str, - 'type': str - } - - self.attribute_map = { - 'name': 'name', - 'type': 'type' - } - - self._name = name - self._type = type - - @classmethod - def from_dict(cls, dikt) -> 'ProcedureParamsInner': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The Procedure_params_inner of this ProcedureParamsInner. # noqa: E501 - :rtype: ProcedureParamsInner - """ - return util.deserialize_model(dikt, cls) - - @property - def name(self) -> str: - """Gets the name of this ProcedureParamsInner. - - - :return: The name of this ProcedureParamsInner. - :rtype: str - """ - return self._name - - @name.setter - def name(self, name: str): - """Sets the name of this ProcedureParamsInner. - - - :param name: The name of this ProcedureParamsInner. - :type name: str - """ - - self._name = name - - @property - def type(self) -> str: - """Gets the type of this ProcedureParamsInner. - - - :return: The type of this ProcedureParamsInner. - :rtype: str - """ - return self._type - - @type.setter - def type(self, type: str): - """Sets the type of this ProcedureParamsInner. - - - :param type: The type of this ProcedureParamsInner. - :type type: str - """ - - self._type = type diff --git a/flex/coordinator/gs_flex_coordinator/models/query_statement.py b/flex/coordinator/gs_flex_coordinator/models/query_statement.py deleted file mode 100644 index c0a7404eda8a..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/query_statement.py +++ /dev/null @@ -1,141 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util - - -class QueryStatement(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, statement_id=None, name=None, description=None, query=None): # noqa: E501 - """QueryStatement - a model defined in OpenAPI - - :param statement_id: The statement_id of this QueryStatement. # noqa: E501 - :type statement_id: str - :param name: The name of this QueryStatement. # noqa: E501 - :type name: str - :param description: The description of this QueryStatement. # noqa: E501 - :type description: str - :param query: The query of this QueryStatement. # noqa: E501 - :type query: str - """ - self.openapi_types = { - 'statement_id': str, - 'name': str, - 'description': str, - 'query': str - } - - self.attribute_map = { - 'statement_id': 'statement_id', - 'name': 'name', - 'description': 'description', - 'query': 'query' - } - - self._statement_id = statement_id - self._name = name - self._description = description - self._query = query - - @classmethod - def from_dict(cls, dikt) -> 'QueryStatement': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The QueryStatement of this QueryStatement. # noqa: E501 - :rtype: QueryStatement - """ - return util.deserialize_model(dikt, cls) - - @property - def statement_id(self) -> str: - """Gets the statement_id of this QueryStatement. - - generated in server side # noqa: E501 - - :return: The statement_id of this QueryStatement. - :rtype: str - """ - return self._statement_id - - @statement_id.setter - def statement_id(self, statement_id: str): - """Sets the statement_id of this QueryStatement. - - generated in server side # noqa: E501 - - :param statement_id: The statement_id of this QueryStatement. - :type statement_id: str - """ - - self._statement_id = statement_id - - @property - def name(self) -> str: - """Gets the name of this QueryStatement. - - - :return: The name of this QueryStatement. - :rtype: str - """ - return self._name - - @name.setter - def name(self, name: str): - """Sets the name of this QueryStatement. - - - :param name: The name of this QueryStatement. - :type name: str - """ - - self._name = name - - @property - def description(self) -> str: - """Gets the description of this QueryStatement. - - - :return: The description of this QueryStatement. - :rtype: str - """ - return self._description - - @description.setter - def description(self, description: str): - """Sets the description of this QueryStatement. - - - :param description: The description of this QueryStatement. - :type description: str - """ - - self._description = description - - @property - def query(self) -> str: - """Gets the query of this QueryStatement. - - - :return: The query of this QueryStatement. - :rtype: str - """ - return self._query - - @query.setter - def query(self, query: str): - """Sets the query of this QueryStatement. - - - :param query: The query of this QueryStatement. - :type query: str - """ - - self._query = query diff --git a/flex/coordinator/gs_flex_coordinator/models/running_deployment_info.py b/flex/coordinator/gs_flex_coordinator/models/running_deployment_info.py new file mode 100644 index 000000000000..97bf3bd22805 --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/running_deployment_info.py @@ -0,0 +1,183 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator import util + + +class RunningDeploymentInfo(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, instance_name=None, cluster_type=None, version=None, solution=None, creation_time=None): # noqa: E501 + """RunningDeploymentInfo - a model defined in OpenAPI + + :param instance_name: The instance_name of this RunningDeploymentInfo. # noqa: E501 + :type instance_name: str + :param cluster_type: The cluster_type of this RunningDeploymentInfo. # noqa: E501 + :type cluster_type: str + :param version: The version of this RunningDeploymentInfo. # noqa: E501 + :type version: str + :param solution: The solution of this RunningDeploymentInfo. # noqa: E501 + :type solution: str + :param creation_time: The creation_time of this RunningDeploymentInfo. # noqa: E501 + :type creation_time: str + """ + self.openapi_types = { + 'instance_name': str, + 'cluster_type': str, + 'version': str, + 'solution': str, + 'creation_time': str + } + + self.attribute_map = { + 'instance_name': 'instance_name', + 'cluster_type': 'cluster_type', + 'version': 'version', + 'solution': 'solution', + 'creation_time': 'creation_time' + } + + self._instance_name = instance_name + self._cluster_type = cluster_type + self._version = version + self._solution = solution + self._creation_time = creation_time + + @classmethod + def from_dict(cls, dikt) -> 'RunningDeploymentInfo': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The RunningDeploymentInfo of this RunningDeploymentInfo. # noqa: E501 + :rtype: RunningDeploymentInfo + """ + return util.deserialize_model(dikt, cls) + + @property + def instance_name(self) -> str: + """Gets the instance_name of this RunningDeploymentInfo. + + + :return: The instance_name of this RunningDeploymentInfo. + :rtype: str + """ + return self._instance_name + + @instance_name.setter + def instance_name(self, instance_name: str): + """Sets the instance_name of this RunningDeploymentInfo. + + + :param instance_name: The instance_name of this RunningDeploymentInfo. + :type instance_name: str + """ + if instance_name is None: + raise ValueError("Invalid value for `instance_name`, must not be `None`") # noqa: E501 + + self._instance_name = instance_name + + @property + def cluster_type(self) -> str: + """Gets the cluster_type of this RunningDeploymentInfo. + + + :return: The cluster_type of this RunningDeploymentInfo. + :rtype: str + """ + return self._cluster_type + + @cluster_type.setter + def cluster_type(self, cluster_type: str): + """Sets the cluster_type of this RunningDeploymentInfo. + + + :param cluster_type: The cluster_type of this RunningDeploymentInfo. + :type cluster_type: str + """ + allowed_values = ["HOSTS", "KUBERNETES"] # noqa: E501 + if cluster_type not in allowed_values: + raise ValueError( + "Invalid value for `cluster_type` ({0}), must be one of {1}" + .format(cluster_type, allowed_values) + ) + + self._cluster_type = cluster_type + + @property + def version(self) -> str: + """Gets the version of this RunningDeploymentInfo. + + + :return: The version of this RunningDeploymentInfo. + :rtype: str + """ + return self._version + + @version.setter + def version(self, version: str): + """Sets the version of this RunningDeploymentInfo. + + + :param version: The version of this RunningDeploymentInfo. + :type version: str + """ + if version is None: + raise ValueError("Invalid value for `version`, must not be `None`") # noqa: E501 + + self._version = version + + @property + def solution(self) -> str: + """Gets the solution of this RunningDeploymentInfo. + + + :return: The solution of this RunningDeploymentInfo. + :rtype: str + """ + return self._solution + + @solution.setter + def solution(self, solution: str): + """Sets the solution of this RunningDeploymentInfo. + + + :param solution: The solution of this RunningDeploymentInfo. + :type solution: str + """ + allowed_values = ["INTERACTIVE", "GRAPHSCOPE_INSIGHT"] # noqa: E501 + if solution not in allowed_values: + raise ValueError( + "Invalid value for `solution` ({0}), must be one of {1}" + .format(solution, allowed_values) + ) + + self._solution = solution + + @property + def creation_time(self) -> str: + """Gets the creation_time of this RunningDeploymentInfo. + + + :return: The creation_time of this RunningDeploymentInfo. + :rtype: str + """ + return self._creation_time + + @creation_time.setter + def creation_time(self, creation_time: str): + """Sets the creation_time of this RunningDeploymentInfo. + + + :param creation_time: The creation_time of this RunningDeploymentInfo. + :type creation_time: str + """ + if creation_time is None: + raise ValueError("Invalid value for `creation_time`, must not be `None`") # noqa: E501 + + self._creation_time = creation_time diff --git a/flex/coordinator/gs_flex_coordinator/models/schema_mapping.py b/flex/coordinator/gs_flex_coordinator/models/schema_mapping.py index 3cc9a19e1939..3a95d953069e 100644 --- a/flex/coordinator/gs_flex_coordinator/models/schema_mapping.py +++ b/flex/coordinator/gs_flex_coordinator/models/schema_mapping.py @@ -4,12 +4,10 @@ from gs_flex_coordinator.models.base_model import Model from gs_flex_coordinator.models.edge_mapping import EdgeMapping -from gs_flex_coordinator.models.schema_mapping_loading_config import SchemaMappingLoadingConfig from gs_flex_coordinator.models.vertex_mapping import VertexMapping from gs_flex_coordinator import util from gs_flex_coordinator.models.edge_mapping import EdgeMapping # noqa: E501 -from gs_flex_coordinator.models.schema_mapping_loading_config import SchemaMappingLoadingConfig # noqa: E501 from gs_flex_coordinator.models.vertex_mapping import VertexMapping # noqa: E501 class SchemaMapping(Model): @@ -18,34 +16,24 @@ class SchemaMapping(Model): Do not edit the class manually. """ - def __init__(self, graph=None, loading_config=None, vertex_mappings=None, edge_mappings=None): # noqa: E501 + def __init__(self, vertex_mappings=None, edge_mappings=None): # noqa: E501 """SchemaMapping - a model defined in OpenAPI - :param graph: The graph of this SchemaMapping. # noqa: E501 - :type graph: str - :param loading_config: The loading_config of this SchemaMapping. # noqa: E501 - :type loading_config: SchemaMappingLoadingConfig :param vertex_mappings: The vertex_mappings of this SchemaMapping. # noqa: E501 :type vertex_mappings: List[VertexMapping] :param edge_mappings: The edge_mappings of this SchemaMapping. # noqa: E501 :type edge_mappings: List[EdgeMapping] """ self.openapi_types = { - 'graph': str, - 'loading_config': SchemaMappingLoadingConfig, 'vertex_mappings': List[VertexMapping], 'edge_mappings': List[EdgeMapping] } self.attribute_map = { - 'graph': 'graph', - 'loading_config': 'loading_config', 'vertex_mappings': 'vertex_mappings', 'edge_mappings': 'edge_mappings' } - self._graph = graph - self._loading_config = loading_config self._vertex_mappings = vertex_mappings self._edge_mappings = edge_mappings @@ -60,48 +48,6 @@ def from_dict(cls, dikt) -> 'SchemaMapping': """ return util.deserialize_model(dikt, cls) - @property - def graph(self) -> str: - """Gets the graph of this SchemaMapping. - - - :return: The graph of this SchemaMapping. - :rtype: str - """ - return self._graph - - @graph.setter - def graph(self, graph: str): - """Sets the graph of this SchemaMapping. - - - :param graph: The graph of this SchemaMapping. - :type graph: str - """ - - self._graph = graph - - @property - def loading_config(self) -> SchemaMappingLoadingConfig: - """Gets the loading_config of this SchemaMapping. - - - :return: The loading_config of this SchemaMapping. - :rtype: SchemaMappingLoadingConfig - """ - return self._loading_config - - @loading_config.setter - def loading_config(self, loading_config: SchemaMappingLoadingConfig): - """Sets the loading_config of this SchemaMapping. - - - :param loading_config: The loading_config of this SchemaMapping. - :type loading_config: SchemaMappingLoadingConfig - """ - - self._loading_config = loading_config - @property def vertex_mappings(self) -> List[VertexMapping]: """Gets the vertex_mappings of this SchemaMapping. @@ -120,6 +66,8 @@ def vertex_mappings(self, vertex_mappings: List[VertexMapping]): :param vertex_mappings: The vertex_mappings of this SchemaMapping. :type vertex_mappings: List[VertexMapping] """ + if vertex_mappings is None: + raise ValueError("Invalid value for `vertex_mappings`, must not be `None`") # noqa: E501 self._vertex_mappings = vertex_mappings @@ -141,5 +89,7 @@ def edge_mappings(self, edge_mappings: List[EdgeMapping]): :param edge_mappings: The edge_mappings of this SchemaMapping. :type edge_mappings: List[EdgeMapping] """ + if edge_mappings is None: + raise ValueError("Invalid value for `edge_mappings`, must not be `None`") # noqa: E501 self._edge_mappings = edge_mappings diff --git a/flex/coordinator/gs_flex_coordinator/models/schema_mapping_loading_config.py b/flex/coordinator/gs_flex_coordinator/models/schema_mapping_loading_config.py deleted file mode 100644 index 8d275543c105..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/schema_mapping_loading_config.py +++ /dev/null @@ -1,123 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.schema_mapping_loading_config_data_source import SchemaMappingLoadingConfigDataSource -from gs_flex_coordinator.models.schema_mapping_loading_config_format import SchemaMappingLoadingConfigFormat -from gs_flex_coordinator import util - -from gs_flex_coordinator.models.schema_mapping_loading_config_data_source import SchemaMappingLoadingConfigDataSource # noqa: E501 -from gs_flex_coordinator.models.schema_mapping_loading_config_format import SchemaMappingLoadingConfigFormat # noqa: E501 - -class SchemaMappingLoadingConfig(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, data_source=None, import_option=None, format=None): # noqa: E501 - """SchemaMappingLoadingConfig - a model defined in OpenAPI - - :param data_source: The data_source of this SchemaMappingLoadingConfig. # noqa: E501 - :type data_source: SchemaMappingLoadingConfigDataSource - :param import_option: The import_option of this SchemaMappingLoadingConfig. # noqa: E501 - :type import_option: str - :param format: The format of this SchemaMappingLoadingConfig. # noqa: E501 - :type format: SchemaMappingLoadingConfigFormat - """ - self.openapi_types = { - 'data_source': SchemaMappingLoadingConfigDataSource, - 'import_option': str, - 'format': SchemaMappingLoadingConfigFormat - } - - self.attribute_map = { - 'data_source': 'data_source', - 'import_option': 'import_option', - 'format': 'format' - } - - self._data_source = data_source - self._import_option = import_option - self._format = format - - @classmethod - def from_dict(cls, dikt) -> 'SchemaMappingLoadingConfig': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The SchemaMapping_loading_config of this SchemaMappingLoadingConfig. # noqa: E501 - :rtype: SchemaMappingLoadingConfig - """ - return util.deserialize_model(dikt, cls) - - @property - def data_source(self) -> SchemaMappingLoadingConfigDataSource: - """Gets the data_source of this SchemaMappingLoadingConfig. - - - :return: The data_source of this SchemaMappingLoadingConfig. - :rtype: SchemaMappingLoadingConfigDataSource - """ - return self._data_source - - @data_source.setter - def data_source(self, data_source: SchemaMappingLoadingConfigDataSource): - """Sets the data_source of this SchemaMappingLoadingConfig. - - - :param data_source: The data_source of this SchemaMappingLoadingConfig. - :type data_source: SchemaMappingLoadingConfigDataSource - """ - - self._data_source = data_source - - @property - def import_option(self) -> str: - """Gets the import_option of this SchemaMappingLoadingConfig. - - - :return: The import_option of this SchemaMappingLoadingConfig. - :rtype: str - """ - return self._import_option - - @import_option.setter - def import_option(self, import_option: str): - """Sets the import_option of this SchemaMappingLoadingConfig. - - - :param import_option: The import_option of this SchemaMappingLoadingConfig. - :type import_option: str - """ - allowed_values = ["init", "overwrite"] # noqa: E501 - if import_option not in allowed_values: - raise ValueError( - "Invalid value for `import_option` ({0}), must be one of {1}" - .format(import_option, allowed_values) - ) - - self._import_option = import_option - - @property - def format(self) -> SchemaMappingLoadingConfigFormat: - """Gets the format of this SchemaMappingLoadingConfig. - - - :return: The format of this SchemaMappingLoadingConfig. - :rtype: SchemaMappingLoadingConfigFormat - """ - return self._format - - @format.setter - def format(self, format: SchemaMappingLoadingConfigFormat): - """Sets the format of this SchemaMappingLoadingConfig. - - - :param format: The format of this SchemaMappingLoadingConfig. - :type format: SchemaMappingLoadingConfigFormat - """ - - self._format = format diff --git a/flex/coordinator/gs_flex_coordinator/models/schema_mapping_loading_config_data_source.py b/flex/coordinator/gs_flex_coordinator/models/schema_mapping_loading_config_data_source.py deleted file mode 100644 index 83763256601c..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/schema_mapping_loading_config_data_source.py +++ /dev/null @@ -1,67 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util - - -class SchemaMappingLoadingConfigDataSource(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, scheme=None): # noqa: E501 - """SchemaMappingLoadingConfigDataSource - a model defined in OpenAPI - - :param scheme: The scheme of this SchemaMappingLoadingConfigDataSource. # noqa: E501 - :type scheme: str - """ - self.openapi_types = { - 'scheme': str - } - - self.attribute_map = { - 'scheme': 'scheme' - } - - self._scheme = scheme - - @classmethod - def from_dict(cls, dikt) -> 'SchemaMappingLoadingConfigDataSource': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The SchemaMapping_loading_config_data_source of this SchemaMappingLoadingConfigDataSource. # noqa: E501 - :rtype: SchemaMappingLoadingConfigDataSource - """ - return util.deserialize_model(dikt, cls) - - @property - def scheme(self) -> str: - """Gets the scheme of this SchemaMappingLoadingConfigDataSource. - - - :return: The scheme of this SchemaMappingLoadingConfigDataSource. - :rtype: str - """ - return self._scheme - - @scheme.setter - def scheme(self, scheme: str): - """Sets the scheme of this SchemaMappingLoadingConfigDataSource. - - - :param scheme: The scheme of this SchemaMappingLoadingConfigDataSource. - :type scheme: str - """ - allowed_values = ["file"] # noqa: E501 - if scheme not in allowed_values: - raise ValueError( - "Invalid value for `scheme` ({0}), must be one of {1}" - .format(scheme, allowed_values) - ) - - self._scheme = scheme diff --git a/flex/coordinator/gs_flex_coordinator/models/service_status.py b/flex/coordinator/gs_flex_coordinator/models/service_status.py index 0bcfb46f46aa..03eb6ef76e54 100644 --- a/flex/coordinator/gs_flex_coordinator/models/service_status.py +++ b/flex/coordinator/gs_flex_coordinator/models/service_status.py @@ -3,9 +3,11 @@ from typing import List, Dict # noqa: F401 from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator.models.get_graph_response import GetGraphResponse from gs_flex_coordinator.models.service_status_sdk_endpoints import ServiceStatusSdkEndpoints from gs_flex_coordinator import util +from gs_flex_coordinator.models.get_graph_response import GetGraphResponse # noqa: E501 from gs_flex_coordinator.models.service_status_sdk_endpoints import ServiceStatusSdkEndpoints # noqa: E501 class ServiceStatus(Model): @@ -14,30 +16,30 @@ class ServiceStatus(Model): Do not edit the class manually. """ - def __init__(self, status=None, graph_name=None, sdk_endpoints=None): # noqa: E501 + def __init__(self, status=None, graph=None, sdk_endpoints=None): # noqa: E501 """ServiceStatus - a model defined in OpenAPI :param status: The status of this ServiceStatus. # noqa: E501 :type status: str - :param graph_name: The graph_name of this ServiceStatus. # noqa: E501 - :type graph_name: str + :param graph: The graph of this ServiceStatus. # noqa: E501 + :type graph: GetGraphResponse :param sdk_endpoints: The sdk_endpoints of this ServiceStatus. # noqa: E501 :type sdk_endpoints: ServiceStatusSdkEndpoints """ self.openapi_types = { 'status': str, - 'graph_name': str, + 'graph': GetGraphResponse, 'sdk_endpoints': ServiceStatusSdkEndpoints } self.attribute_map = { 'status': 'status', - 'graph_name': 'graph_name', + 'graph': 'graph', 'sdk_endpoints': 'sdk_endpoints' } self._status = status - self._graph_name = graph_name + self._graph = graph self._sdk_endpoints = sdk_endpoints @classmethod @@ -69,31 +71,35 @@ def status(self, status: str): :param status: The status of this ServiceStatus. :type status: str """ + allowed_values = ["Running", "Stopped"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" + .format(status, allowed_values) + ) self._status = status @property - def graph_name(self) -> str: - """Gets the graph_name of this ServiceStatus. + def graph(self) -> GetGraphResponse: + """Gets the graph of this ServiceStatus. - which graph is serving now # noqa: E501 - :return: The graph_name of this ServiceStatus. - :rtype: str + :return: The graph of this ServiceStatus. + :rtype: GetGraphResponse """ - return self._graph_name + return self._graph - @graph_name.setter - def graph_name(self, graph_name: str): - """Sets the graph_name of this ServiceStatus. + @graph.setter + def graph(self, graph: GetGraphResponse): + """Sets the graph of this ServiceStatus. - which graph is serving now # noqa: E501 - :param graph_name: The graph_name of this ServiceStatus. - :type graph_name: str + :param graph: The graph of this ServiceStatus. + :type graph: GetGraphResponse """ - self._graph_name = graph_name + self._graph = graph @property def sdk_endpoints(self) -> ServiceStatusSdkEndpoints: diff --git a/flex/coordinator/gs_flex_coordinator/models/start_service_request.py b/flex/coordinator/gs_flex_coordinator/models/start_service_request.py index af6ed3a8e758..d068a8303b00 100644 --- a/flex/coordinator/gs_flex_coordinator/models/start_service_request.py +++ b/flex/coordinator/gs_flex_coordinator/models/start_service_request.py @@ -12,21 +12,21 @@ class StartServiceRequest(Model): Do not edit the class manually. """ - def __init__(self, graph_name=None): # noqa: E501 + def __init__(self, graph_id=None): # noqa: E501 """StartServiceRequest - a model defined in OpenAPI - :param graph_name: The graph_name of this StartServiceRequest. # noqa: E501 - :type graph_name: str + :param graph_id: The graph_id of this StartServiceRequest. # noqa: E501 + :type graph_id: str """ self.openapi_types = { - 'graph_name': str + 'graph_id': str } self.attribute_map = { - 'graph_name': 'graph_name' + 'graph_id': 'graph_id' } - self._graph_name = graph_name + self._graph_id = graph_id @classmethod def from_dict(cls, dikt) -> 'StartServiceRequest': @@ -34,28 +34,28 @@ def from_dict(cls, dikt) -> 'StartServiceRequest': :param dikt: A dict. :type: dict - :return: The start_service_request of this StartServiceRequest. # noqa: E501 + :return: The StartServiceRequest of this StartServiceRequest. # noqa: E501 :rtype: StartServiceRequest """ return util.deserialize_model(dikt, cls) @property - def graph_name(self) -> str: - """Gets the graph_name of this StartServiceRequest. + def graph_id(self) -> str: + """Gets the graph_id of this StartServiceRequest. - :return: The graph_name of this StartServiceRequest. + :return: The graph_id of this StartServiceRequest. :rtype: str """ - return self._graph_name + return self._graph_id - @graph_name.setter - def graph_name(self, graph_name: str): - """Sets the graph_name of this StartServiceRequest. + @graph_id.setter + def graph_id(self, graph_id: str): + """Sets the graph_id of this StartServiceRequest. - :param graph_name: The graph_name of this StartServiceRequest. - :type graph_name: str + :param graph_id: The graph_id of this StartServiceRequest. + :type graph_id: str """ - self._graph_name = graph_name + self._graph_id = graph_id diff --git a/flex/coordinator/gs_flex_coordinator/models/stored_procedure_meta.py b/flex/coordinator/gs_flex_coordinator/models/stored_procedure_meta.py new file mode 100644 index 000000000000..97f6d0f37140 --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/stored_procedure_meta.py @@ -0,0 +1,263 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator.models.parameter import Parameter +from gs_flex_coordinator import util + +from gs_flex_coordinator.models.parameter import Parameter # noqa: E501 + +class StoredProcedureMeta(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, name=None, description=None, type=None, query=None, id=None, library=None, params=None, returns=None): # noqa: E501 + """StoredProcedureMeta - a model defined in OpenAPI + + :param name: The name of this StoredProcedureMeta. # noqa: E501 + :type name: str + :param description: The description of this StoredProcedureMeta. # noqa: E501 + :type description: str + :param type: The type of this StoredProcedureMeta. # noqa: E501 + :type type: str + :param query: The query of this StoredProcedureMeta. # noqa: E501 + :type query: str + :param id: The id of this StoredProcedureMeta. # noqa: E501 + :type id: str + :param library: The library of this StoredProcedureMeta. # noqa: E501 + :type library: str + :param params: The params of this StoredProcedureMeta. # noqa: E501 + :type params: List[Parameter] + :param returns: The returns of this StoredProcedureMeta. # noqa: E501 + :type returns: List[Parameter] + """ + self.openapi_types = { + 'name': str, + 'description': str, + 'type': str, + 'query': str, + 'id': str, + 'library': str, + 'params': List[Parameter], + 'returns': List[Parameter] + } + + self.attribute_map = { + 'name': 'name', + 'description': 'description', + 'type': 'type', + 'query': 'query', + 'id': 'id', + 'library': 'library', + 'params': 'params', + 'returns': 'returns' + } + + self._name = name + self._description = description + self._type = type + self._query = query + self._id = id + self._library = library + self._params = params + self._returns = returns + + @classmethod + def from_dict(cls, dikt) -> 'StoredProcedureMeta': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The StoredProcedureMeta of this StoredProcedureMeta. # noqa: E501 + :rtype: StoredProcedureMeta + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> str: + """Gets the name of this StoredProcedureMeta. + + + :return: The name of this StoredProcedureMeta. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name: str): + """Sets the name of this StoredProcedureMeta. + + + :param name: The name of this StoredProcedureMeta. + :type name: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def description(self) -> str: + """Gets the description of this StoredProcedureMeta. + + + :return: The description of this StoredProcedureMeta. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description: str): + """Sets the description of this StoredProcedureMeta. + + + :param description: The description of this StoredProcedureMeta. + :type description: str + """ + + self._description = description + + @property + def type(self) -> str: + """Gets the type of this StoredProcedureMeta. + + + :return: The type of this StoredProcedureMeta. + :rtype: str + """ + return self._type + + @type.setter + def type(self, type: str): + """Sets the type of this StoredProcedureMeta. + + + :param type: The type of this StoredProcedureMeta. + :type type: str + """ + allowed_values = ["cpp", "cypher"] # noqa: E501 + if type not in allowed_values: + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}" + .format(type, allowed_values) + ) + + self._type = type + + @property + def query(self) -> str: + """Gets the query of this StoredProcedureMeta. + + + :return: The query of this StoredProcedureMeta. + :rtype: str + """ + return self._query + + @query.setter + def query(self, query: str): + """Sets the query of this StoredProcedureMeta. + + + :param query: The query of this StoredProcedureMeta. + :type query: str + """ + if query is None: + raise ValueError("Invalid value for `query`, must not be `None`") # noqa: E501 + + self._query = query + + @property + def id(self) -> str: + """Gets the id of this StoredProcedureMeta. + + + :return: The id of this StoredProcedureMeta. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id: str): + """Sets the id of this StoredProcedureMeta. + + + :param id: The id of this StoredProcedureMeta. + :type id: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def library(self) -> str: + """Gets the library of this StoredProcedureMeta. + + + :return: The library of this StoredProcedureMeta. + :rtype: str + """ + return self._library + + @library.setter + def library(self, library: str): + """Sets the library of this StoredProcedureMeta. + + + :param library: The library of this StoredProcedureMeta. + :type library: str + """ + if library is None: + raise ValueError("Invalid value for `library`, must not be `None`") # noqa: E501 + + self._library = library + + @property + def params(self) -> List[Parameter]: + """Gets the params of this StoredProcedureMeta. + + + :return: The params of this StoredProcedureMeta. + :rtype: List[Parameter] + """ + return self._params + + @params.setter + def params(self, params: List[Parameter]): + """Sets the params of this StoredProcedureMeta. + + + :param params: The params of this StoredProcedureMeta. + :type params: List[Parameter] + """ + if params is None: + raise ValueError("Invalid value for `params`, must not be `None`") # noqa: E501 + + self._params = params + + @property + def returns(self) -> List[Parameter]: + """Gets the returns of this StoredProcedureMeta. + + + :return: The returns of this StoredProcedureMeta. + :rtype: List[Parameter] + """ + return self._returns + + @returns.setter + def returns(self, returns: List[Parameter]): + """Sets the returns of this StoredProcedureMeta. + + + :param returns: The returns of this StoredProcedureMeta. + :type returns: List[Parameter] + """ + if returns is None: + raise ValueError("Invalid value for `returns`, must not be `None`") # noqa: E501 + + self._returns = returns diff --git a/flex/coordinator/gs_flex_coordinator/models/string_type.py b/flex/coordinator/gs_flex_coordinator/models/string_type.py new file mode 100644 index 000000000000..31edcef9088c --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/string_type.py @@ -0,0 +1,65 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator.models.string_type_string import StringTypeString +from gs_flex_coordinator import util + +from gs_flex_coordinator.models.string_type_string import StringTypeString # noqa: E501 + +class StringType(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, string=None): # noqa: E501 + """StringType - a model defined in OpenAPI + + :param string: The string of this StringType. # noqa: E501 + :type string: StringTypeString + """ + self.openapi_types = { + 'string': StringTypeString + } + + self.attribute_map = { + 'string': 'string' + } + + self._string = string + + @classmethod + def from_dict(cls, dikt) -> 'StringType': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The StringType of this StringType. # noqa: E501 + :rtype: StringType + """ + return util.deserialize_model(dikt, cls) + + @property + def string(self) -> StringTypeString: + """Gets the string of this StringType. + + + :return: The string of this StringType. + :rtype: StringTypeString + """ + return self._string + + @string.setter + def string(self, string: StringTypeString): + """Sets the string of this StringType. + + + :param string: The string of this StringType. + :type string: StringTypeString + """ + if string is None: + raise ValueError("Invalid value for `string`, must not be `None`") # noqa: E501 + + self._string = string diff --git a/flex/coordinator/gs_flex_coordinator/models/string_type_string.py b/flex/coordinator/gs_flex_coordinator/models/string_type_string.py new file mode 100644 index 000000000000..2e8c77e28887 --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/string_type_string.py @@ -0,0 +1,65 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator.models.long_text import LongText +from gs_flex_coordinator import util + +from gs_flex_coordinator.models.long_text import LongText # noqa: E501 + +class StringTypeString(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, long_text=None): # noqa: E501 + """StringTypeString - a model defined in OpenAPI + + :param long_text: The long_text of this StringTypeString. # noqa: E501 + :type long_text: str + """ + self.openapi_types = { + 'long_text': str + } + + self.attribute_map = { + 'long_text': 'long_text' + } + + self._long_text = long_text + + @classmethod + def from_dict(cls, dikt) -> 'StringTypeString': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The StringType_string of this StringTypeString. # noqa: E501 + :rtype: StringTypeString + """ + return util.deserialize_model(dikt, cls) + + @property + def long_text(self) -> str: + """Gets the long_text of this StringTypeString. + + + :return: The long_text of this StringTypeString. + :rtype: str + """ + return self._long_text + + @long_text.setter + def long_text(self, long_text: str): + """Sets the long_text of this StringTypeString. + + + :param long_text: The long_text of this StringTypeString. + :type long_text: str + """ + if long_text is None: + raise ValueError("Invalid value for `long_text`, must not be `None`") # noqa: E501 + + self._long_text = long_text diff --git a/flex/coordinator/gs_flex_coordinator/models/update_alert_message_status_request.py b/flex/coordinator/gs_flex_coordinator/models/update_alert_message_status_request.py new file mode 100644 index 000000000000..a26f13cdf108 --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/update_alert_message_status_request.py @@ -0,0 +1,95 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator import util + + +class UpdateAlertMessageStatusRequest(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, message_ids=None, status=None): # noqa: E501 + """UpdateAlertMessageStatusRequest - a model defined in OpenAPI + + :param message_ids: The message_ids of this UpdateAlertMessageStatusRequest. # noqa: E501 + :type message_ids: List[str] + :param status: The status of this UpdateAlertMessageStatusRequest. # noqa: E501 + :type status: str + """ + self.openapi_types = { + 'message_ids': List[str], + 'status': str + } + + self.attribute_map = { + 'message_ids': 'message_ids', + 'status': 'status' + } + + self._message_ids = message_ids + self._status = status + + @classmethod + def from_dict(cls, dikt) -> 'UpdateAlertMessageStatusRequest': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The UpdateAlertMessageStatusRequest of this UpdateAlertMessageStatusRequest. # noqa: E501 + :rtype: UpdateAlertMessageStatusRequest + """ + return util.deserialize_model(dikt, cls) + + @property + def message_ids(self) -> List[str]: + """Gets the message_ids of this UpdateAlertMessageStatusRequest. + + + :return: The message_ids of this UpdateAlertMessageStatusRequest. + :rtype: List[str] + """ + return self._message_ids + + @message_ids.setter + def message_ids(self, message_ids: List[str]): + """Sets the message_ids of this UpdateAlertMessageStatusRequest. + + + :param message_ids: The message_ids of this UpdateAlertMessageStatusRequest. + :type message_ids: List[str] + """ + if message_ids is None: + raise ValueError("Invalid value for `message_ids`, must not be `None`") # noqa: E501 + + self._message_ids = message_ids + + @property + def status(self) -> str: + """Gets the status of this UpdateAlertMessageStatusRequest. + + + :return: The status of this UpdateAlertMessageStatusRequest. + :rtype: str + """ + return self._status + + @status.setter + def status(self, status: str): + """Sets the status of this UpdateAlertMessageStatusRequest. + + + :param status: The status of this UpdateAlertMessageStatusRequest. + :type status: str + """ + allowed_values = ["unsolved", "solved", "dealing"] # noqa: E501 + if status not in allowed_values: + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}" + .format(status, allowed_values) + ) + + self._status = status diff --git a/flex/coordinator/gs_flex_coordinator/models/update_alert_messages_request.py b/flex/coordinator/gs_flex_coordinator/models/update_alert_messages_request.py deleted file mode 100644 index 49aee5353ab5..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/update_alert_messages_request.py +++ /dev/null @@ -1,125 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.alert_message import AlertMessage -from gs_flex_coordinator import util - -from gs_flex_coordinator.models.alert_message import AlertMessage # noqa: E501 - -class UpdateAlertMessagesRequest(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, messages=None, batch_status=None, batch_delete=False): # noqa: E501 - """UpdateAlertMessagesRequest - a model defined in OpenAPI - - :param messages: The messages of this UpdateAlertMessagesRequest. # noqa: E501 - :type messages: List[AlertMessage] - :param batch_status: The batch_status of this UpdateAlertMessagesRequest. # noqa: E501 - :type batch_status: str - :param batch_delete: The batch_delete of this UpdateAlertMessagesRequest. # noqa: E501 - :type batch_delete: bool - """ - self.openapi_types = { - 'messages': List[AlertMessage], - 'batch_status': str, - 'batch_delete': bool - } - - self.attribute_map = { - 'messages': 'messages', - 'batch_status': 'batch_status', - 'batch_delete': 'batch_delete' - } - - self._messages = messages - self._batch_status = batch_status - self._batch_delete = batch_delete - - @classmethod - def from_dict(cls, dikt) -> 'UpdateAlertMessagesRequest': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The update_alert_messages_request of this UpdateAlertMessagesRequest. # noqa: E501 - :rtype: UpdateAlertMessagesRequest - """ - return util.deserialize_model(dikt, cls) - - @property - def messages(self) -> List[AlertMessage]: - """Gets the messages of this UpdateAlertMessagesRequest. - - - :return: The messages of this UpdateAlertMessagesRequest. - :rtype: List[AlertMessage] - """ - return self._messages - - @messages.setter - def messages(self, messages: List[AlertMessage]): - """Sets the messages of this UpdateAlertMessagesRequest. - - - :param messages: The messages of this UpdateAlertMessagesRequest. - :type messages: List[AlertMessage] - """ - - self._messages = messages - - @property - def batch_status(self) -> str: - """Gets the batch_status of this UpdateAlertMessagesRequest. - - Override the status of each message # noqa: E501 - - :return: The batch_status of this UpdateAlertMessagesRequest. - :rtype: str - """ - return self._batch_status - - @batch_status.setter - def batch_status(self, batch_status: str): - """Sets the batch_status of this UpdateAlertMessagesRequest. - - Override the status of each message # noqa: E501 - - :param batch_status: The batch_status of this UpdateAlertMessagesRequest. - :type batch_status: str - """ - allowed_values = ["solved", "unsolved", "dealing"] # noqa: E501 - if batch_status not in allowed_values: - raise ValueError( - "Invalid value for `batch_status` ({0}), must be one of {1}" - .format(batch_status, allowed_values) - ) - - self._batch_status = batch_status - - @property - def batch_delete(self) -> bool: - """Gets the batch_delete of this UpdateAlertMessagesRequest. - - True will delete all the messages in request body # noqa: E501 - - :return: The batch_delete of this UpdateAlertMessagesRequest. - :rtype: bool - """ - return self._batch_delete - - @batch_delete.setter - def batch_delete(self, batch_delete: bool): - """Sets the batch_delete of this UpdateAlertMessagesRequest. - - True will delete all the messages in request body # noqa: E501 - - :param batch_delete: The batch_delete of this UpdateAlertMessagesRequest. - :type batch_delete: bool - """ - - self._batch_delete = batch_delete diff --git a/flex/coordinator/gs_flex_coordinator/models/update_procedure_request.py b/flex/coordinator/gs_flex_coordinator/models/update_procedure_request.py new file mode 100644 index 000000000000..435f9889f279 --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/update_procedure_request.py @@ -0,0 +1,63 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator import util + + +class UpdateProcedureRequest(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, description=None): # noqa: E501 + """UpdateProcedureRequest - a model defined in OpenAPI + + :param description: The description of this UpdateProcedureRequest. # noqa: E501 + :type description: str + """ + self.openapi_types = { + 'description': str + } + + self.attribute_map = { + 'description': 'description' + } + + self._description = description + + @classmethod + def from_dict(cls, dikt) -> 'UpdateProcedureRequest': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The UpdateProcedureRequest of this UpdateProcedureRequest. # noqa: E501 + :rtype: UpdateProcedureRequest + """ + return util.deserialize_model(dikt, cls) + + @property + def description(self) -> str: + """Gets the description of this UpdateProcedureRequest. + + + :return: The description of this UpdateProcedureRequest. + :rtype: str + """ + return self._description + + @description.setter + def description(self, description: str): + """Sets the description of this UpdateProcedureRequest. + + + :param description: The description of this UpdateProcedureRequest. + :type description: str + """ + if description is None: + raise ValueError("Invalid value for `description`, must not be `None`") # noqa: E501 + + self._description = description diff --git a/flex/coordinator/gs_flex_coordinator/models/upload_file_response.py b/flex/coordinator/gs_flex_coordinator/models/upload_file_response.py new file mode 100644 index 000000000000..3850c3bd7354 --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/upload_file_response.py @@ -0,0 +1,63 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator import util + + +class UploadFileResponse(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, file_path=None): # noqa: E501 + """UploadFileResponse - a model defined in OpenAPI + + :param file_path: The file_path of this UploadFileResponse. # noqa: E501 + :type file_path: str + """ + self.openapi_types = { + 'file_path': str + } + + self.attribute_map = { + 'file_path': 'file_path' + } + + self._file_path = file_path + + @classmethod + def from_dict(cls, dikt) -> 'UploadFileResponse': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The UploadFileResponse of this UploadFileResponse. # noqa: E501 + :rtype: UploadFileResponse + """ + return util.deserialize_model(dikt, cls) + + @property + def file_path(self) -> str: + """Gets the file_path of this UploadFileResponse. + + + :return: The file_path of this UploadFileResponse. + :rtype: str + """ + return self._file_path + + @file_path.setter + def file_path(self, file_path: str): + """Sets the file_path of this UploadFileResponse. + + + :param file_path: The file_path of this UploadFileResponse. + :type file_path: str + """ + if file_path is None: + raise ValueError("Invalid value for `file_path`, must not be `None`") # noqa: E501 + + self._file_path = file_path diff --git a/flex/coordinator/gs_flex_coordinator/models/vertex_data_source.py b/flex/coordinator/gs_flex_coordinator/models/vertex_data_source.py deleted file mode 100644 index bbb5ee75ac03..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/vertex_data_source.py +++ /dev/null @@ -1,145 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util - - -class VertexDataSource(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, data_source=None, type_name=None, location=None, property_mapping=None): # noqa: E501 - """VertexDataSource - a model defined in OpenAPI - - :param data_source: The data_source of this VertexDataSource. # noqa: E501 - :type data_source: str - :param type_name: The type_name of this VertexDataSource. # noqa: E501 - :type type_name: str - :param location: The location of this VertexDataSource. # noqa: E501 - :type location: str - :param property_mapping: The property_mapping of this VertexDataSource. # noqa: E501 - :type property_mapping: Dict[str, object] - """ - self.openapi_types = { - 'data_source': str, - 'type_name': str, - 'location': str, - 'property_mapping': Dict[str, object] - } - - self.attribute_map = { - 'data_source': 'data_source', - 'type_name': 'type_name', - 'location': 'location', - 'property_mapping': 'property_mapping' - } - - self._data_source = data_source - self._type_name = type_name - self._location = location - self._property_mapping = property_mapping - - @classmethod - def from_dict(cls, dikt) -> 'VertexDataSource': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The VertexDataSource of this VertexDataSource. # noqa: E501 - :rtype: VertexDataSource - """ - return util.deserialize_model(dikt, cls) - - @property - def data_source(self) -> str: - """Gets the data_source of this VertexDataSource. - - - :return: The data_source of this VertexDataSource. - :rtype: str - """ - return self._data_source - - @data_source.setter - def data_source(self, data_source: str): - """Sets the data_source of this VertexDataSource. - - - :param data_source: The data_source of this VertexDataSource. - :type data_source: str - """ - allowed_values = ["ODPS", "FILE"] # noqa: E501 - if data_source not in allowed_values: - raise ValueError( - "Invalid value for `data_source` ({0}), must be one of {1}" - .format(data_source, allowed_values) - ) - - self._data_source = data_source - - @property - def type_name(self) -> str: - """Gets the type_name of this VertexDataSource. - - - :return: The type_name of this VertexDataSource. - :rtype: str - """ - return self._type_name - - @type_name.setter - def type_name(self, type_name: str): - """Sets the type_name of this VertexDataSource. - - - :param type_name: The type_name of this VertexDataSource. - :type type_name: str - """ - - self._type_name = type_name - - @property - def location(self) -> str: - """Gets the location of this VertexDataSource. - - - :return: The location of this VertexDataSource. - :rtype: str - """ - return self._location - - @location.setter - def location(self, location: str): - """Sets the location of this VertexDataSource. - - - :param location: The location of this VertexDataSource. - :type location: str - """ - - self._location = location - - @property - def property_mapping(self) -> Dict[str, object]: - """Gets the property_mapping of this VertexDataSource. - - - :return: The property_mapping of this VertexDataSource. - :rtype: Dict[str, object] - """ - return self._property_mapping - - @property_mapping.setter - def property_mapping(self, property_mapping: Dict[str, object]): - """Sets the property_mapping of this VertexDataSource. - - - :param property_mapping: The property_mapping of this VertexDataSource. - :type property_mapping: Dict[str, object] - """ - - self._property_mapping = property_mapping diff --git a/flex/coordinator/gs_flex_coordinator/models/vertex_mapping.py b/flex/coordinator/gs_flex_coordinator/models/vertex_mapping.py index 7abf756fe4a5..edf0d28db5e2 100644 --- a/flex/coordinator/gs_flex_coordinator/models/vertex_mapping.py +++ b/flex/coordinator/gs_flex_coordinator/models/vertex_mapping.py @@ -69,6 +69,8 @@ def type_name(self, type_name: str): :param type_name: The type_name of this VertexMapping. :type type_name: str """ + if type_name is None: + raise ValueError("Invalid value for `type_name`, must not be `None`") # noqa: E501 self._type_name = type_name @@ -90,6 +92,8 @@ def inputs(self, inputs: List[str]): :param inputs: The inputs of this VertexMapping. :type inputs: List[str] """ + if inputs is None: + raise ValueError("Invalid value for `inputs`, must not be `None`") # noqa: E501 self._inputs = inputs @@ -111,5 +115,7 @@ def column_mappings(self, column_mappings: List[ColumnMapping]): :param column_mappings: The column_mappings of this VertexMapping. :type column_mappings: List[ColumnMapping] """ + if column_mappings is None: + raise ValueError("Invalid value for `column_mappings`, must not be `None`") # noqa: E501 self._column_mappings = column_mappings diff --git a/flex/coordinator/gs_flex_coordinator/models/vertex_type.py b/flex/coordinator/gs_flex_coordinator/models/vertex_type.py deleted file mode 100644 index da1f1f16e74e..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/vertex_type.py +++ /dev/null @@ -1,141 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.model_property import ModelProperty -from gs_flex_coordinator import util - -from gs_flex_coordinator.models.model_property import ModelProperty # noqa: E501 - -class VertexType(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, type_id=None, type_name=None, properties=None, primary_keys=None): # noqa: E501 - """VertexType - a model defined in OpenAPI - - :param type_id: The type_id of this VertexType. # noqa: E501 - :type type_id: int - :param type_name: The type_name of this VertexType. # noqa: E501 - :type type_name: str - :param properties: The properties of this VertexType. # noqa: E501 - :type properties: List[ModelProperty] - :param primary_keys: The primary_keys of this VertexType. # noqa: E501 - :type primary_keys: List[str] - """ - self.openapi_types = { - 'type_id': int, - 'type_name': str, - 'properties': List[ModelProperty], - 'primary_keys': List[str] - } - - self.attribute_map = { - 'type_id': 'type_id', - 'type_name': 'type_name', - 'properties': 'properties', - 'primary_keys': 'primary_keys' - } - - self._type_id = type_id - self._type_name = type_name - self._properties = properties - self._primary_keys = primary_keys - - @classmethod - def from_dict(cls, dikt) -> 'VertexType': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The VertexType of this VertexType. # noqa: E501 - :rtype: VertexType - """ - return util.deserialize_model(dikt, cls) - - @property - def type_id(self) -> int: - """Gets the type_id of this VertexType. - - - :return: The type_id of this VertexType. - :rtype: int - """ - return self._type_id - - @type_id.setter - def type_id(self, type_id: int): - """Sets the type_id of this VertexType. - - - :param type_id: The type_id of this VertexType. - :type type_id: int - """ - - self._type_id = type_id - - @property - def type_name(self) -> str: - """Gets the type_name of this VertexType. - - - :return: The type_name of this VertexType. - :rtype: str - """ - return self._type_name - - @type_name.setter - def type_name(self, type_name: str): - """Sets the type_name of this VertexType. - - - :param type_name: The type_name of this VertexType. - :type type_name: str - """ - - self._type_name = type_name - - @property - def properties(self) -> List[ModelProperty]: - """Gets the properties of this VertexType. - - - :return: The properties of this VertexType. - :rtype: List[ModelProperty] - """ - return self._properties - - @properties.setter - def properties(self, properties: List[ModelProperty]): - """Sets the properties of this VertexType. - - - :param properties: The properties of this VertexType. - :type properties: List[ModelProperty] - """ - - self._properties = properties - - @property - def primary_keys(self) -> List[str]: - """Gets the primary_keys of this VertexType. - - - :return: The primary_keys of this VertexType. - :rtype: List[str] - """ - return self._primary_keys - - @primary_keys.setter - def primary_keys(self, primary_keys: List[str]): - """Sets the primary_keys of this VertexType. - - - :param primary_keys: The primary_keys of this VertexType. - :type primary_keys: List[str] - """ - - self._primary_keys = primary_keys diff --git a/flex/coordinator/gs_flex_coordinator/openapi/openapi.yaml b/flex/coordinator/gs_flex_coordinator/openapi/openapi.yaml index dfbdb2e02ae8..af758d57795a 100644 --- a/flex/coordinator/gs_flex_coordinator/openapi/openapi.yaml +++ b/flex/coordinator/gs_flex_coordinator/openapi/openapi.yaml @@ -14,15 +14,25 @@ info: name: Apache 2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html title: GraphScope FLEX HTTP SERVICE API - version: 0.9.1 + version: 1.0.0 externalDocs: description: Find out More about GraphScope url: http://graphscope.io servers: - url: / +tags: +- name: Deployment +- name: Graph +- name: DataSource +- name: Job +- name: Procedure +- name: Service +- name: Alert +- name: Utils paths: /api/v1/alert/message: get: + description: List all alert messages operationId: list_alert_messages parameters: - explode: true @@ -69,12 +79,20 @@ paths: schema: type: string style: form + - explode: true + in: query + name: limit + required: false + schema: + format: int32 + type: integer + style: form responses: "200": content: application/json: example: - - message_id: ALERT-MESSAGE-QWERTYUIOP-1 + - id: ALERT-MESSAGE-QWERTYUIOP-1 alert_name: HighDiskUtilization severity: warning metric_type: node @@ -83,7 +101,7 @@ paths: trigger_time: 2023-02-21 11:56:30 status: unsolved message: "Disk usage node1 85.12%, exceeds threshold" - - message_id: ALERT-MESSAGE-QWERTYUIOP-2 + - id: ALERT-MESSAGE-QWERTYUIOP-2 alert_name: HighDiskUtilization severity: emergency metric_type: node @@ -92,7 +110,7 @@ paths: trigger_time: 2023-02-21 11:56:30 status: solved message: "Disk usage node1 85.12%, exceeds threshold" - - message_id: ALERT-MESSAGE-QWERTYUIOP-3 + - id: ALERT-MESSAGE-QWERTYUIOP-3 alert_name: HighDiskUtilization severity: warning metric_type: node @@ -103,50 +121,91 @@ paths: message: "Disk usage node1 85.12%, exceeds threshold" schema: items: - $ref: '#/components/schemas/AlertMessage' + $ref: '#/components/schemas/GetAlertMessageResponse' type: array - description: Successful operation + description: Successfully returned the alert messages + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error + tags: + - Alert + x-openapi-router-controller: gs_flex_coordinator.controllers.alert_controller + /api/v1/alert/message-collection: + delete: + description: Delete alert message in batch + operationId: delete_alert_message_in_batch + parameters: + - description: "A list of message id separated by comma, e.g. id1,id2,id3" + explode: true + in: query + name: message_ids + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + description: Successfully deleted the alert message + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error tags: - - alert + - Alert x-openapi-router-controller: gs_flex_coordinator.controllers.alert_controller + /api/v1/alert/message-collection/status: put: - description: Update alert messages in batch - operationId: update_alert_messages + description: Update the message status in batch + operationId: update_alert_message_in_batch requestBody: content: application/json: schema: - $ref: '#/components/schemas/update_alert_messages_request' + $ref: '#/components/schemas/UpdateAlertMessageStatusRequest' responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' + $ref: '#/components/schemas/APIResponse' description: Successful operation - "404": - description: Alert message not found + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error tags: - - alert + - Alert x-openapi-router-controller: gs_flex_coordinator.controllers.alert_controller /api/v1/alert/receiver: get: - operationId: list_receivers + description: List all alert receivers + operationId: list_alert_receivers responses: "200": content: application/json: example: - - type: webhook - receiver_id: RECEIVER-QWERTYUIOP-1 + - id: RECEIVER-QWERTYUIOP-1 + type: webhook webhook_url: http://webhook.com is_at_all: false at_user_ids: - 111111 - 222222 enable: false - - type: webhook - receiver_id: RECEIVER-QWERTYUIOP-2 + - id: RECEIVER-QWERTYUIOP-2 + type: webhook webhook_url: http://webhook.com is_at_all: false at_user_ids: @@ -156,33 +215,47 @@ paths: message: error message schema: items: - $ref: '#/components/schemas/AlertReceiver' + $ref: '#/components/schemas/GetAlertReceiverResponse' type: array - description: Successful operation + description: Successfully returned the alert receivers + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error tags: - - alert + - Alert x-openapi-router-controller: gs_flex_coordinator.controllers.alert_controller post: - operationId: register_receiver + description: Create a new alert receiver + operationId: create_alert_receiver requestBody: content: application/json: schema: - $ref: '#/components/schemas/AlertReceiver' + $ref: '#/components/schemas/CreateAlertReceiverRequest' required: true responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation + $ref: '#/components/schemas/APIResponse' + description: Successfully created the alert receiver + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error tags: - - alert + - Alert x-openapi-router-controller: gs_flex_coordinator.controllers.alert_controller /api/v1/alert/receiver/{receiver_id}: delete: - operationId: delete_receiver_by_id + description: Delete the alert receiver by ID + operationId: delete_alert_receiver_by_id parameters: - explode: false in: path @@ -196,15 +269,20 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - description: Successful operation - "404": - description: Receiver not found + $ref: '#/components/schemas/APIResponse' + description: Successfully deleted the alert receiver + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error tags: - - alert + - Alert x-openapi-router-controller: gs_flex_coordinator.controllers.alert_controller put: - operationId: update_receiver_by_id + description: Update alert receiver by ID + operationId: update_alert_receiver_by_id parameters: - explode: false in: path @@ -217,52 +295,65 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/AlertReceiver' + $ref: '#/components/schemas/CreateAlertReceiverRequest' responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - description: Successful operation - "404": - description: Receiver not found + $ref: '#/components/schemas/APIResponse' + description: Successfully updated the alert receiver + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error tags: - - alert + - Alert x-openapi-router-controller: gs_flex_coordinator.controllers.alert_controller /api/v1/alert/rule: get: + description: List all alert rules operationId: list_alert_rules responses: "200": content: application/json: example: - - name: HighDiskUtilization + - id: ALERTRULE-1 + name: HighDiskUtilization severity: warning metric_type: node conditions_description: disk usage >= 85 enable: true - - name: GremlinServiceAvailable + - id: ALERTRULE-2 + name: GremlinServiceAvailable severity: emergency metric_type: node conditions_description: g.V().limit(1) failed enable: false schema: items: - $ref: '#/components/schemas/AlertRule' + $ref: '#/components/schemas/GetAlertRuleResponse' type: array - description: Successful operation + description: Successfully returned the alert rules + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error tags: - - alert + - Alert x-openapi-router-controller: gs_flex_coordinator.controllers.alert_controller - /api/v1/alert/rule/{rule_name}: + /api/v1/alert/rule/{rule_id}: delete: - operationId: delete_alert_rule_by_name + operationId: delete_alert_rule_by_id parameters: - explode: false in: path - name: rule_name + name: rule_id required: true schema: type: string @@ -272,17 +363,23 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - description: Successful operation + $ref: '#/components/schemas/APIResponse' + description: Successfully deleted the alert rule + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error tags: - - alert + - Alert x-openapi-router-controller: gs_flex_coordinator.controllers.alert_controller put: - operationId: update_alert_rule_by_name + operationId: update_alert_rule_by_id parameters: - explode: false in: path - name: rule_name + name: rule_id required: true schema: type: string @@ -291,53 +388,26 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/AlertRule' - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: Successful operation - tags: - - alert - x-openapi-router-controller: gs_flex_coordinator.controllers.alert_controller - /api/v1/connection: - delete: - description: Close the connection with coordinator - operationId: close + $ref: '#/components/schemas/CreateAlertRuleRequest' responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - description: Close connection successfully - tags: - - connection - x-openapi-router-controller: gs_flex_coordinator.controllers.connection_controller - post: - description: Connect to coordinator service - operationId: connect - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Connection' - required: true - responses: - "200": + $ref: '#/components/schemas/APIResponse' + description: Successfully updated the alert rule + "500": content: application/json: schema: - $ref: '#/components/schemas/ConnectionStatus' - description: Connect coordinator service successfully + $ref: '#/components/schemas/Error' + description: Server error tags: - - connection - x-openapi-router-controller: gs_flex_coordinator.controllers.connection_controller + - Alert + x-openapi-router-controller: gs_flex_coordinator.controllers.alert_controller /api/v1/deployment/info: get: - description: Get deployment's meta info + description: Deployment information operationId: get_deployment_info responses: "200": @@ -345,81 +415,21 @@ paths: application/json: example: cluster_type: HOSTS - creation_time: 2024-02-07 14:21:28 - graphs_info: - demo: - creation_time: 2024-02-07 14:21:28 - last_dataloading_time: 2024-02-08 14:21:28 - name: demo - update_time: 2024-02-07 14:21:28 - name: demo + creation_time: 2024-01-01 00:00:00 + instance_name: demo solution: INTERACTIVE version: 0.27.0 schema: - $ref: '#/components/schemas/DeploymentInfo' - description: successful operation - tags: - - deployment - x-openapi-router-controller: gs_flex_coordinator.controllers.deployment_controller - /api/v1/deployment/log: - get: - operationId: fetch_log - parameters: - - explode: true - in: query - name: component - required: true - schema: - type: string - style: form - - explode: true - in: query - name: pod_name - required: true - schema: - type: string - style: form - - explode: true - in: query - name: container_name - required: true - schema: - type: string - style: form - - explode: true - in: query - name: since_seconds - required: true - schema: - type: integer - style: form - responses: - "200": - content: - application/json: - schema: - items: - $ref: '#/components/schemas/DeploymentStatus' - type: array - description: successful operation - tags: - - deployment - x-openapi-router-controller: gs_flex_coordinator.controllers.deployment_controller - /api/v1/deployment/status: - get: - description: Get deployment's status (k8s only) - operationId: get_deployment_status - responses: - "200": + $ref: '#/components/schemas/RunningDeploymentInfo' + description: Successfully returned the deployment information + "500": content: application/json: schema: - items: - $ref: '#/components/schemas/DeploymentStatus' - type: array - description: successful operation + $ref: '#/components/schemas/Error' + description: Server error tags: - - deployment + - Deployment x-openapi-router-controller: gs_flex_coordinator.controllers.deployment_controller /api/v1/file/uploading: post: @@ -428,17 +438,23 @@ paths: content: multipart/form-data: schema: - $ref: '#/components/schemas/upload_file_request' + $ref: '#/components/schemas/uploadFile_request' required: true responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' + $ref: '#/components/schemas/UploadFileResponse' description: successful operation + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error tags: - - utils + - Utils x-openapi-router-controller: gs_flex_coordinator.controllers.utils_controller /api/v1/graph: get: @@ -449,10 +465,28 @@ paths: content: application/json: example: - - name: demo - store_type: mutable_csr + - id: GRAPHID + name: demo + creation_time: 2024-01-01 00:00:00 + schema_update_time: 2024-01-02 00:00:00 + data_update_time: 2024-01-03 00:00:00 stored_procedures: - directory: plugins + - id: PROCEDUREID + name: procedure_name + type: cypher + query: MATCH(a) return COUNT(a); + library: /path/to/library + params: + - name: param1 + type: + string: + long_text: null + returns: + - name: return1 + type: + PrimitiveType: DT_SIGNED_INT64 + bound_graph: demo + runnable: true schema: vertex_types: - type_id: 0 @@ -461,11 +495,13 @@ paths: - property_id: 0 property_name: id property_type: - primitive_type: DT_STRING + string: + long_text: null - property_id: 1 property_name: name property_type: - primitive_type: DT_STRING + string: + long_text: null primary_keys: - id - type_id: 1 @@ -474,11 +510,13 @@ paths: - property_id: 0 property_name: id property_type: - primitive_type: DT_STRING + string: + long_text: null - property_id: 1 property_name: name property_type: - primitive_type: DT_STRING + string: + long_text: null primary_keys: - id edge_types: @@ -494,7 +532,7 @@ paths: - property_id: 0 property_name: weight property_type: - primitive_type: DT_STRING + primitive_type: DT_DOUBLE - type_id: 1 type_name: created vertex_type_pair_relations: @@ -507,14 +545,20 @@ paths: - property_id: 0 property_name: weight property_type: - primitive_type: DT_STRING + primitive_type: DT_DOUBLE schema: items: - $ref: '#/components/schemas/Graph' + $ref: '#/components/schemas/GetGraphResponse' type: array - description: Successful operation + description: Successfully returned all graphs + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error tags: - - graph + - Graph x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller post: description: Create a new graph @@ -523,26 +567,38 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Graph' + $ref: '#/components/schemas/CreateGraphRequest' required: true responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation + $ref: '#/components/schemas/CreateGraphResponse' + description: The graph was created + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Bad request + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error tags: - - graph + - Graph x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller - /api/v1/graph/{graph_name}: + /api/v1/graph/{graph_id}: delete: - description: Delete a graph by name - operationId: delete_graph + description: Delete graph by ID + operationId: delete_graph_by_id parameters: - explode: false in: path - name: graph_name + name: graph_id required: true schema: type: string @@ -552,18 +608,134 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - description: Successful operation + $ref: '#/components/schemas/APIResponse' + description: Successfully deleted the graph + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error + tags: + - Graph + x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller + get: + description: Get graph by ID + operationId: get_graph_by_id + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + example: + id: GRAPHID + name: demo + creation_time: 2024-01-01 00:00:00 + schema_update_time: 2024-01-02 00:00:00 + data_update_time: 2024-01-03 00:00:00 + stored_procedures: + - id: PROCEDUREID + name: procedure_name + type: cypher + query: MATCH(a) return COUNT(a); + library: /path/to/library + params: + - name: param1 + type: + string: + long_text: null + returns: + - name: return1 + type: + PrimitiveType: DT_SIGNED_INT64 + bound_graph: demo + runnable: true + schema: + vertex_types: + - type_id: 0 + type_name: person + properties: + - property_id: 0 + property_name: id + property_type: + string: + long_text: null + - property_id: 1 + property_name: name + property_type: + string: + long_text: null + primary_keys: + - id + - type_id: 1 + type_name: software + properties: + - property_id: 0 + property_name: id + property_type: + string: + long_text: null + - property_id: 1 + property_name: name + property_type: + string: + long_text: null + primary_keys: + - id + edge_types: + - type_id: 0 + type_name: knows + vertex_type_pair_relations: + - source_vertex: person + destination_vertex: person + relation: MANY_TO_MANY + x_csr_params: + edge_storage_strategy: ONLY_IN + properties: + - property_id: 0 + property_name: weight + property_type: + primitive_type: DT_DOUBLE + - type_id: 1 + type_name: created + vertex_type_pair_relations: + - source_vertex: person + destination_vertex: software + relation: MANY_TO_MANY + x_csr_params: + edge_storage_strategy: ONLY_IN + properties: + - property_id: 0 + property_name: weight + property_type: + primitive_type: DT_DOUBLE + schema: + $ref: '#/components/schemas/GetGraphResponse' + description: Successfully returned the graph + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error tags: - - graph + - Graph x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller - /api/v1/graph/{graph_name}/dataloading: + /api/v1/graph/{graph_id}/dataloading: post: - operationId: create_dataloading_job + description: Submit a dataloading job + operationId: submit_dataloading_job parameters: - explode: false in: path - name: graph_name + name: graph_id required: true schema: type: string @@ -572,26 +744,66 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SchemaMapping' + $ref: '#/components/schemas/DataloadingJobConfig' required: true responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation + $ref: '#/components/schemas/CreateDataloadingJobResponse' + description: Successfully submitted the job + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Bad request + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error + tags: + - Job + x-openapi-router-controller: gs_flex_coordinator.controllers.job_controller + /api/v1/graph/{graph_id}/dataloading/config: + get: + description: Get the data loading configuration + operationId: get_dataloading_job_config + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/DataloadingJobConfig' + description: Successfully returned the dataloading job configuration + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error tags: - - job + - Job x-openapi-router-controller: gs_flex_coordinator.controllers.job_controller - /api/v1/graph/{graph_name}/dataloading/config: + /api/v1/graph/{graph_id}/datasource: get: - description: get dataloading configuration - operationId: get_dataloading_config + description: Get data source by ID + operationId: get_datasource_by_id parameters: - explode: false in: path - name: graph_name + name: graph_id required: true schema: type: string @@ -601,16 +813,10 @@ paths: content: application/json: example: - graph: demo - loading_config: overwrite - format: - type: csv - metadata: - delimiter: '|' vertex_mappings: - type_name: person inputs: - - /home/graphscope/path/to/person.csv + - file:///path/to/person.csv column_mappings: - column: index: 0 @@ -622,7 +828,7 @@ paths: property: name - type_name: software inputs: - - /home/graphscope/path/to/software.csv + - file:///path/to/software.csv column_mappings: - column: index: 0 @@ -637,112 +843,63 @@ paths: edge: knows source_vertex: person destination_vertex: person - inputs: - - /home/graphscope/path/to/person_knows_person.csv - source_vertex_mappings: - - column: - index: 0 - name: id - destination_vertex_mappings: - - column: - index: 1 - name: id - column_mappings: - - column: - index: 2 - name: weight - property: weight + inputs: + - file:///path/to/knows.csv + source_vertex_mappings: + - column: + index: 0 + name: id + property: id + destination_vertex_mappings: + - column: + index: 1 + name: id + property: id + column_mappings: + - column: + index: 2 + name: weight + property: weight - type_triplet: edge: created source_vertex: person destination_vertex: software - inputs: - - /home/graphscope/path/to/person_created_software.csv - source_vertex_mappings: - - column: - index: 0 - name: id - destination_vertex_mappings: - - column: - index: 1 - name: id - column_mappings: - - column: - index: 2 - name: weight - property: weight - schema: - $ref: '#/components/schemas/SchemaMapping' - description: Successful operation - tags: - - job - x-openapi-router-controller: gs_flex_coordinator.controllers.job_controller - /api/v1/graph/{graph_name}/datasource: - get: - description: List data source on graph - operationId: get_datasource - parameters: - - explode: false - in: path - name: graph_name - required: true - schema: - type: string - style: simple - responses: - "200": + inputs: + - file:///path/to/created.csv + source_vertex_mappings: + - column: + index: 0 + name: id + property: id + destination_vertex_mappings: + - column: + index: 1 + name: id + property: id + column_mappings: + - column: + index: 2 + name: weight + property: weight + schema: + $ref: '#/components/schemas/SchemaMapping' + description: Successful returned all data sources + "500": content: application/json: - example: - vertices_datasource: - - data_source: FILE - type_name: person - location: /home/graphscope/path/to/person.csv - property_mapping: - "0": id - "1": name - - data_source: FILE - type_name: software - location: /home/graphscope/path/to/software.csv - property_mapping: - "0": id - "1": name - edges_datasource: - - data_source: FILE - type_name: knows - source_vertex: person - destination_vertex: person - location: /home/graphscope/path/to/person_knows_person.csv - source_pk_column_map: - "0": id - destination_pk_column_map: - "1": id - property_mapping: - "2": weight - - data_source: FILE - type_name: created - source_vertex: person - destination_vertex: software - location: /home/graphscope/path/to/person_created_software.csv - source_pk_column_map: - "0": id - destination_pk_column_map: - "1": id - property_mapping: - "2": weight - schema: - $ref: '#/components/schemas/DataSource' - description: Successful operation + schema: + $ref: '#/components/schemas/Error' + description: Server error tags: - - datasource - x-openapi-router-controller: gs_flex_coordinator.controllers.datasource_controller + - DataSource + x-openapi-router-controller: gs_flex_coordinator.controllers.data_source_controller post: - description: Import data source in batch - operationId: import_datasource + description: Bind data sources in batches + operationId: bind_datasource_in_batch parameters: - explode: false in: path - name: graph_name + name: graph_id required: true schema: type: string @@ -751,54 +908,38 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/DataSource' + $ref: '#/components/schemas/SchemaMapping' required: true responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - tags: - - datasource - x-openapi-router-controller: gs_flex_coordinator.controllers.datasource_controller - /api/v1/graph/{graph_name}/datasource/edge_datasource: - post: - description: Bind data source on edge type - operationId: bind_edge_datasource - parameters: - - explode: false - in: path - name: graph_name - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EdgeDataSource' - required: true - responses: - "200": + $ref: '#/components/schemas/APIResponse' + description: Successful bind the data sources + "400": content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation + $ref: '#/components/schemas/Error' + description: Bad request + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error tags: - - datasource - x-openapi-router-controller: gs_flex_coordinator.controllers.datasource_controller - /api/v1/graph/{graph_name}/datasource/edge_datasource/{type_name}: + - DataSource + x-openapi-router-controller: gs_flex_coordinator.controllers.data_source_controller + /api/v1/graph/{graph_id}/datasource/edge/{type_name}: delete: - description: Unbind datasource on an edge type + description: Unbind datas ource on an edge type operationId: unbind_edge_datasource parameters: - explode: false in: path - name: graph_name + name: graph_id required: true schema: type: string @@ -829,18 +970,25 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - description: Successful operation + $ref: '#/components/schemas/APIResponse' + description: Successfully unbind the data source + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error tags: - - datasource - x-openapi-router-controller: gs_flex_coordinator.controllers.datasource_controller - get: - description: Get edge data source - operationId: get_edge_datasource + - DataSource + x-openapi-router-controller: gs_flex_coordinator.controllers.data_source_controller + /api/v1/graph/{graph_id}/datasource/vertex/{type_name}: + delete: + description: Unbind data source on a vertex type + operationId: unbind_vertex_datasource parameters: - explode: false in: path - name: graph_name + name: graph_id required: true schema: type: string @@ -852,50 +1000,116 @@ paths: schema: type: string style: simple - - explode: true - in: query - name: source_vertex_type - required: true - schema: - type: string - style: form - - explode: true - in: query - name: destination_vertex_type + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + description: Successfully unbind the data source + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error + tags: + - DataSource + x-openapi-router-controller: gs_flex_coordinator.controllers.data_source_controller + /api/v1/graph/{graph_id}/schema: + get: + description: Get graph schema by ID + operationId: get_schema_by_id + parameters: + - explode: false + in: path + name: graph_id required: true schema: type: string - style: form + style: simple responses: "200": content: application/json: example: - data_source: FILE - type_name: created - source_vertex: person - destination_vertex: software - location: /home/graphscope/path/to/person_created_software.csv - source_pk_column_map: - "0": id - destination_pk_column_map: - "1": id - property_mapping: - "2": weight - schema: - $ref: '#/components/schemas/EdgeDataSource' - description: Successful operation + vertex_types: + - type_id: 0 + type_name: person + properties: + - property_id: 0 + property_name: id + property_type: + string: + long_text: null + - property_id: 1 + property_name: name + property_type: + string: + long_text: null + primary_keys: + - id + - type_id: 1 + type_name: software + properties: + - property_id: 0 + property_name: id + property_type: + string: + long_text: null + - property_id: 1 + property_name: name + property_type: + string: + long_text: null + primary_keys: + - id + edge_types: + - type_id: 0 + type_name: knows + vertex_type_pair_relations: + - source_vertex: person + destination_vertex: person + relation: MANY_TO_MANY + x_csr_params: + edge_storage_strategy: ONLY_IN + properties: + - property_id: 0 + property_name: weight + property_type: + primitive_type: DT_DOUBLE + - type_id: 1 + type_name: created + vertex_type_pair_relations: + - source_vertex: person + destination_vertex: software + relation: MANY_TO_MANY + x_csr_params: + edge_storage_strategy: ONLY_IN + properties: + - property_id: 0 + property_name: weight + property_type: + primitive_type: DT_DOUBLE + schema: + $ref: '#/components/schemas/GetGraphSchemaResponse' + description: Successfully returned the graph schema + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error tags: - - datasource - x-openapi-router-controller: gs_flex_coordinator.controllers.datasource_controller - /api/v1/graph/{graph_name}/datasource/vertex_datasource: + - Graph + x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller post: - description: Bind data source on vertex type - operationId: bind_vertex_datasource + description: Import graph schema + operationId: import_schema_by_id parameters: - explode: false in: path - name: graph_name + name: graph_id required: true schema: type: string @@ -904,54 +1118,77 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/VertexDataSource' + $ref: '#/components/schemas/CreateGraphSchemaRequest' required: true responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation + $ref: '#/components/schemas/APIResponse' + description: Successful imported the graph schema + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Bad request + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error tags: - - datasource - x-openapi-router-controller: gs_flex_coordinator.controllers.datasource_controller - /api/v1/graph/{graph_name}/datasource/vertex_datasource/{type_name}: - delete: - description: Unbind datasource on a vertex type - operationId: unbind_vertex_datasource + - Graph + x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller + /api/v1/graph/{graph_id}/schema/edge: + post: + description: Create a edge type + operationId: create_edge_type parameters: - explode: false in: path - name: graph_name - required: true - schema: - type: string - style: simple - - explode: false - in: path - name: type_name + name: graph_id required: true schema: type: string style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateEdgeType' responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - description: Successful operation + $ref: '#/components/schemas/APIResponse' + description: Successful created the edge type + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Bad request + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error tags: - - datasource - x-openapi-router-controller: gs_flex_coordinator.controllers.datasource_controller - get: - description: Get vertex data source - operationId: get_vertex_datasource + - Graph + x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller + /api/v1/graph/{graph_id}/schema/edge/{type_name}: + delete: + description: Delete edge type by name + operationId: delete_edge_type_by_name parameters: - explode: false in: path - name: graph_name + name: graph_id required: true schema: type: string @@ -963,68 +1200,44 @@ paths: schema: type: string style: simple - responses: - "200": - content: - application/json: - example: - data_source: FILE - type_name: person - location: /home/graphscope/path/to/person.csv - property_mapping: - "0": id - "1": name - schema: - $ref: '#/components/schemas/VertexDataSource' - description: Successful operation - tags: - - datasource - x-openapi-router-controller: gs_flex_coordinator.controllers.datasource_controller - /api/v1/graph/{graph_name}/procedure: - get: - description: List stored procedures on a certain graph - operationId: list_procedures_by_graph - parameters: - - explode: false - in: path - name: graph_name + - explode: true + in: query + name: source_vertex_type required: true schema: type: string - style: simple + style: form + - explode: true + in: query + name: destination_vertex_type + required: true + schema: + type: string + style: form responses: "200": content: application/json: - example: - - bound_graph: demo - description: stored procedure 1 - enable: true - runnable: true - name: procedure-1 - query: "MATCH (u: person) Return u.id, u.name LIMIT 5;" - type: cypher - params: - - name: id - type: DT_STRING - returns: - - name: name - type: DT_STRING schema: - items: - $ref: '#/components/schemas/Procedure' - type: array - description: Successful operation + $ref: '#/components/schemas/APIResponse' + description: Successful deleted the edge type + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error tags: - - procedure - x-openapi-router-controller: gs_flex_coordinator.controllers.procedure_controller + - Graph + x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller + /api/v1/graph/{graph_id}/schema/vertex: post: - description: Create a new stored procedure on a certain graph - operationId: create_procedure + description: Create a vertex type + operationId: create_vertex_type parameters: - explode: false in: path - name: graph_name + name: graph_id required: true schema: type: string @@ -1033,33 +1246,45 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Procedure' + $ref: '#/components/schemas/CreateVertexType' required: true responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation + $ref: '#/components/schemas/APIResponse' + description: Successful created a vertex type + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Bad request + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error tags: - - procedure - x-openapi-router-controller: gs_flex_coordinator.controllers.procedure_controller - /api/v1/graph/{graph_name}/procedure/{procedure_name}: + - Graph + x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller + /api/v1/graph/{graph_id}/schema/vertex/{type_name}: delete: - description: Delete a stored procedure on a certain graph - operationId: delete_procedure + description: Delete vertex type by name + operationId: delete_vertex_type_by_name parameters: - explode: false in: path - name: graph_name + name: graph_id required: true schema: type: string style: simple - explode: false in: path - name: procedure_name + name: type_name required: true schema: type: string @@ -1069,242 +1294,385 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - description: Successful operation + $ref: '#/components/schemas/APIResponse' + description: Successful deleted the vertex type + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error tags: - - procedure - x-openapi-router-controller: gs_flex_coordinator.controllers.procedure_controller + - Graph + x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller + /api/v1/job: get: - description: Get a procedure by name - operationId: get_procedure - parameters: - - explode: false - in: path - name: graph_name - required: true - schema: - type: string - style: simple - - explode: false - in: path - name: procedure_name - required: true - schema: - type: string - style: simple + description: List all jobs + operationId: list_jobs responses: "200": content: application/json: example: - bound_graph: demo - description: stored procedure 1 - enable: true - runnable: true - name: procedure-1 - query: "MATCH (u: person) Return u.id, u.name LIMIT 5;" - type: cypher - params: - - name: id - type: DT_STRING - returns: - - name: name - type: DT_STRING - schema: - $ref: '#/components/schemas/Procedure' - description: successful operation - tags: - - procedure - x-openapi-router-controller: gs_flex_coordinator.controllers.procedure_controller - put: - description: Update stored procedure on a certain graph - operationId: update_procedure - parameters: - - explode: false - in: path - name: graph_name + - id: JOB-QWERTYUIOPASDFGH-1 + type: DATA IMPORT + status: RUNNING + start_time: 2024-02-24 00:00:00 + log: logging... + detail: + graph_name: demo + - id: JOB-QWERTYUIOPASDFGH-2 + type: DATA IMPORT + status: CANCELLED + start_time: 2024-02-24 00:00:00 + log: logging... + detail: + graph_name: demo + - id: JOB-QWERTYUIOPASDFGH-3 + type: DATA IMPORT + status: SUCCESS + start_time: 2024-02-24 00:00:00 + end_time: 2024-02-24 12:00:00 + detail: + graph_name: demo + - id: JOB-QWERTYUIOPASDFGH-4 + type: DATA IMPORT + status: FAILED + start_time: 2024-02-24 00:00:00 + end_time: 2024-02-24 12:00:00 + log: logging... + detail: + graph_name: demo + - id: JOB-QWERTYUIOPASDFGH-5 + type: DATA IMPORT + status: WAITING + detail: + graph_name: demo + schema: + items: + $ref: '#/components/schemas/JobStatus' + type: array + description: Successful returned all the jobs + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error + tags: + - Job + x-openapi-router-controller: gs_flex_coordinator.controllers.job_controller + /api/v1/job/{job_id}: + delete: + description: Delete job by ID + operationId: delete_job_by_id + parameters: + - explode: false + in: path + name: job_id required: true schema: type: string style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + description: Successfuly cancelled the job + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error + tags: + - Job + x-openapi-router-controller: gs_flex_coordinator.controllers.job_controller + get: + description: Get job status by ID + operationId: get_job_by_id + parameters: - explode: false in: path - name: procedure_name + name: job_id required: true schema: type: string style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/JobStatus' + description: Successfully returned the job status + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error + tags: + - Job + x-openapi-router-controller: gs_flex_coordinator.controllers.job_controller + /api/v1/service/restart: + post: + description: Restart current service + operationId: restart_service + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + description: Successfully restarted the service + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error + tags: + - Service + x-openapi-router-controller: gs_flex_coordinator.controllers.service_controller + /api/v1/service/start: + post: + description: Start service + operationId: start_service requestBody: content: application/json: schema: - $ref: '#/components/schemas/Procedure' + $ref: '#/components/schemas/StartServiceRequest' responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - description: Successful operation + $ref: '#/components/schemas/APIResponse' + description: Successfully started the service + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Bad request + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error tags: - - procedure - x-openapi-router-controller: gs_flex_coordinator.controllers.procedure_controller - /api/v1/graph/{graph_name}/schema: + - Service + x-openapi-router-controller: gs_flex_coordinator.controllers.service_controller + /api/v1/service/status: get: - description: Get graph schema by name - operationId: get_schema - parameters: - - explode: false - in: path - name: graph_name - required: true - schema: - type: string - style: simple + description: Get service status + operationId: get_service_status responses: "200": content: application/json: example: - vertex_types: - - type_id: 0 - type_name: person - properties: - - property_id: 0 - property_name: id - property_type: - primitive_type: DT_STRING - - property_id: 1 - property_name: name - property_type: - primitive_type: DT_STRING - primary_keys: - - id - - type_id: 1 - type_name: software - properties: - - property_id: 0 - property_name: id - property_type: - primitive_type: DT_STRING - - property_id: 1 - property_name: name - property_type: - primitive_type: DT_STRING - primary_keys: - - id - edge_types: - - type_id: 0 - type_name: knows - vertex_type_pair_relations: - - source_vertex: person - destination_vertex: person - relation: MANY_TO_MANY - x_csr_params: - edge_storage_strategy: ONLY_IN - properties: - - property_id: 0 - property_name: weight - property_type: - primitive_type: DT_STRING - - type_id: 1 - type_name: created - vertex_type_pair_relations: - - source_vertex: person - destination_vertex: software - relation: MANY_TO_MANY - x_csr_params: - edge_storage_strategy: ONLY_IN - properties: - - property_id: 0 - property_name: weight - property_type: - primitive_type: DT_STRING + status: Running + graph: + id: GRAPHID + name: demo + creation_time: 2024-01-01 00:00:00 + schema_update_time: 2024-01-02 00:00:00 + data_update_time: 2024-01-03 00:00:00 + stored_procedures: + - id: PROCEDUREID + name: procedure_name + type: cypher + query: MATCH(a) return COUNT(a); + library: /path/to/library + params: + - name: param1 + type: + string: + long_text: null + returns: + - name: return1 + type: + PrimitiveType: DT_SIGNED_INT64 + bound_graph: demo + runnable: true + schema: + vertex_types: + - type_id: 0 + type_name: person + properties: + - property_id: 0 + property_name: id + property_type: + string: + long_text: null + - property_id: 1 + property_name: name + property_type: null + string: + long_text: null + primary_keys: + - id + - type_id: 1 + type_name: software + properties: + - property_id: 0 + property_name: id + property_type: + string: + long_text: null + - property_id: 1 + property_name: name + property_type: + string: + long_text: null + primary_keys: + - id + edge_types: + - type_id: 0 + type_name: knows + vertex_type_pair_relations: + - source_vertex: person + destination_vertex: person + relation: MANY_TO_MANY + x_csr_params: + edge_storage_strategy: ONLY_IN + properties: + - property_id: 0 + property_name: weight + property_type: + primitive_type: DT_DOUBLE + - type_id: 1 + type_name: created + vertex_type_pair_relations: + - source_vertex: person + destination_vertex: software + relation: MANY_TO_MANY + x_csr_params: + edge_storage_strategy: ONLY_IN + properties: + - property_id: 0 + property_name: weight + property_type: + primitive_type: DT_DOUBLE + sdk_endpoints: + cypher: neo4j://mock.api.cypher:7676 + gremlin: ws://mock.api.gremlin/gremlin + hqps: http://mock.api.hqps:10000 + grpc: http://mock.api.grpc:10000 schema: - $ref: '#/components/schemas/Schema' - description: Successful operation + $ref: '#/components/schemas/ServiceStatus' + description: Successfully returned current service status + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error tags: - - graph - x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller - /api/v1/graph/{graph_name}/schema/edge_edge/{type_name}: - delete: - description: Delete a edge type by name - operationId: delete_edge_type - parameters: - - explode: false - in: path - name: graph_name - required: true - schema: - type: string - style: simple - - explode: false - in: path - name: type_name - required: true - schema: - type: string - style: simple - - explode: true - in: query - name: source_vertex_type - required: true - schema: - type: string - style: form - - explode: true - in: query - name: destination_vertex_type - required: true - schema: - type: string - style: form + - Service + x-openapi-router-controller: gs_flex_coordinator.controllers.service_controller + /api/v1/service/stop: + post: + description: Stop current service + operationId: stop_service responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - description: Successful operation + $ref: '#/components/schemas/APIResponse' + description: Successfully stopped the service + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error tags: - - graph - x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller - /api/v1/graph/{graph_name}/schema/edge_type: - post: - description: Create a edge type - operationId: create_edge_type + - Service + x-openapi-router-controller: gs_flex_coordinator.controllers.service_controller + /v1/graph/{graph_id}/procedure: + get: + description: List all stored procedures on a certain graph + operationId: list_procedures parameters: - explode: false in: path - name: graph_name + name: graph_id required: true schema: type: string style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EdgeType' - required: true responses: "200": + content: + application/json: + example: + - id: PROCEDUREID-1 + name: procedure_name_1 + type: cypher + query: MATCH(a) return COUNT(a); + library: /path/to/library + params: + - name: param1 + type: + string: + long_text: null + returns: + - name: return1 + type: + PrimitiveType: DT_SIGNED_INT64 + bound_graph: demo + runnable: true + - id: PROCEDUREID-2 + name: procedure_name_2 + type: cypher + query: MATCH(a) return COUNT(a); + library: /path/to/library + params: + - name: param1 + type: + string: + long_text: null + returns: + - name: return1 + type: + PrimitiveType: DT_SIGNED_INT64 + bound_graph: demo + runnable: false + schema: + items: + $ref: '#/components/schemas/GetProcedureResponse' + type: array + description: Successful operation + "400": content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation + $ref: '#/components/schemas/Error' + description: Bad request + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error tags: - - graph - x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller - /api/v1/graph/{graph_name}/schema/vertex_type: + - Procedure + x-openapi-router-controller: gs_flex_coordinator.controllers.procedure_controller post: - description: Create a vertex type - operationId: create_vertex_type + description: Create a new stored procedure on a certain graph + operationId: create_procedure parameters: - explode: false in: path - name: graph_name + name: graph_id required: true schema: type: string @@ -1313,33 +1681,45 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/VertexType' + $ref: '#/components/schemas/CreateProcedureRequest' required: true responses: "200": content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation + $ref: '#/components/schemas/CreateProcedureResponse' + description: Successfully created a procedure + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Bad request + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error tags: - - graph - x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller - /api/v1/graph/{graph_name}/schema/vertex_type/{type_name}: + - Procedure + x-openapi-router-controller: gs_flex_coordinator.controllers.procedure_controller + /v1/graph/{graph_id}/procedure/{procedure_id}: delete: - description: Delete a vertex type by name - operationId: delete_vertex_type + description: Delete a stored procedure by ID + operationId: delete_procedure_by_id parameters: - explode: false in: path - name: graph_name + name: graph_id required: true schema: type: string style: simple - explode: false in: path - name: type_name + name: procedure_id required: true schema: type: string @@ -1349,108 +1729,31 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - description: Successful operation + $ref: '#/components/schemas/APIResponse' + description: Successfully deleted the stored procedure + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error tags: - - graph - x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller - /api/v1/groot/graph: + - Procedure + x-openapi-router-controller: gs_flex_coordinator.controllers.procedure_controller get: - description: list groot graph - operationId: list_groot_graph - responses: - "200": - content: - application/json: - example: - - name: demo - type: GrootGraph - directed: true - creation_time: 2024-04-01 12:00:00 - schema: - vertices: - - label: person - properties: - - id: 0 - name: id - type: STRING - is_primary_key: true - - id: 1 - name: name - type: STRING - is_primary_key: false - - label: software - properties: - - id: 0 - name: id - type: STRING - is_primary_key: true - - id: 1 - name: name - type: STRING - is_primary_key: false - edges: - - label: knows - relations: - - src_label: person - dst_label: person - properties: - - id: 0 - name: weight - type: DOUBLE - is_primary_key: false - - label: created - relations: - - src_label: person - dst_label: software - properties: - - id: 0 - name: weight - type: DOUBLE - is_primary_key: false - schema: - items: - $ref: '#/components/schemas/GrootGraph' - type: array - description: Successful operation - tags: - - legacy - x-openapi-router-controller: gs_flex_coordinator.controllers.legacy_controller - /api/v1/groot/graph/{graph_name}/dataloading: - post: - operationId: create_groot_dataloading_job + description: Get a stored procedure by ID + operationId: get_procedure_by_id parameters: - explode: false in: path - name: graph_name + name: graph_id required: true schema: type: string style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GrootDataloadingJobConfig' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - tags: - - legacy - x-openapi-router-controller: gs_flex_coordinator.controllers.legacy_controller - /api/v1/groot/graph/{graph_name}/schema: - get: - description: Get graph schema by name - operationId: get_groot_schema - parameters: - explode: false in: path - name: graph_name + name: procedure_id required: true schema: type: string @@ -1460,326 +1763,135 @@ paths: content: application/json: example: - vertices: - - label: person - properties: - - id: 0 - name: id - type: STRING - is_primary_key: true - - id: 1 - name: name - type: STRING - is_primary_key: false - - label: software - properties: - - id: 0 - name: id - type: STRING - is_primary_key: true - - id: 1 - name: name - type: STRING - is_primary_key: false - edges: - - label: knows - relations: - - src_label: person - dst_label: person - properties: - - id: 0 - name: weight - type: DOUBLE - is_primary_key: false - - label: created - relations: - - src_label: person - dst_label: software - properties: - - id: 0 - name: weight - type: DOUBLE - is_primary_key: false - schema: - $ref: '#/components/schemas/GrootSchema' - description: Successful operation - tags: - - legacy - x-openapi-router-controller: gs_flex_coordinator.controllers.legacy_controller - post: - description: Import schema to groot graph - operationId: import_groot_schema - parameters: - - explode: false - in: path - name: graph_name - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GrootSchema' - required: true - responses: - "200": - content: - application/json: + id: PROCEDUREID + name: procedure_name + type: cypher + query: MATCH(a) return COUNT(a); + library: /path/to/library + params: + - name: param1 + type: + string: + long_text: null + returns: + - name: return1 + type: + PrimitiveType: DT_SIGNED_INT64 + bound_graph: demo + runnable: true schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - tags: - - legacy - x-openapi-router-controller: gs_flex_coordinator.controllers.legacy_controller - /api/v1/job: - get: - operationId: list_jobs - responses: - "200": + $ref: '#/components/schemas/GetProcedureResponse' + description: Successfully returned the procedure + "500": content: application/json: - example: - - job_id: JOB-QWERTYUIOPASDFGH-1 - type: DATA IMPORT - status: RUNNING - start_time: 2024-02-24 00:00:00 - end_time: null - log: logging... - detail: - graph_name: demo - - job_id: JOB-QWERTYUIOPASDFGH-2 - type: DATA IMPORT - status: CANCELLED - start_time: 2024-02-24 00:00:00 - end_time: null - log: logging... - detail: - graph_name: demo - - job_id: JOB-QWERTYUIOPASDFGH-3 - type: DATA IMPORT - status: SUCCESS - start_time: 2024-02-24 00:00:00 - end_time: 2024-02-24 12:00:00 - log: logging... - detail: - graph_name: demo - - job_id: JOB-QWERTYUIOPASDFGH-4 - type: DATA IMPORT - status: FAILED - start_time: 2024-02-24 00:00:00 - end_time: 2024-02-24 12:00:00 - log: logging... - detail: - graph_name: demo - - job_id: JOB-QWERTYUIOPASDFGH-5 - type: DATA IMPORT - status: WAITING - start_time: null - end_time: null - detail: - graph_name: demo schema: - items: - $ref: '#/components/schemas/JobStatus' - type: array - description: successful operation + $ref: '#/components/schemas/Error' + description: Server error tags: - - job - x-openapi-router-controller: gs_flex_coordinator.controllers.job_controller - /api/v1/job/{job_id}: - delete: - operationId: delete_job_by_id + - Procedure + x-openapi-router-controller: gs_flex_coordinator.controllers.procedure_controller + put: + description: Update a stored procedure by ID + operationId: update_procedure_by_id parameters: - explode: false in: path - name: job_id + name: graph_id required: true schema: type: string style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: Successful operation - tags: - - job - x-openapi-router-controller: gs_flex_coordinator.controllers.job_controller - get: - operationId: get_job_by_id - parameters: - explode: false in: path - name: job_id + name: procedure_id required: true schema: type: string style: simple - responses: - "200": - content: - application/json: - example: - job_id: JOB-QWERTYUIOPASDFGH-1 - type: DATA IMPORT - status: RUNNING - start_time: 2024-02-24 00:00:00 - end_time: null - log: logging... - schema: - $ref: '#/components/schemas/JobStatus' - description: successful operation - tags: - - job - x-openapi-router-controller: gs_flex_coordinator.controllers.job_controller - /api/v1/node/status: - get: - description: "Get node status (cpu/memory/disk, local only)" - operationId: get_node_status - responses: - "200": - content: - application/json: - example: - - node: hostname-1 - cpu_usage: 80 - memory_usage: 40 - disk_usage: 85 - schema: - items: - $ref: '#/components/schemas/NodeStatus' - type: array - description: successful operation - tags: - - deployment - x-openapi-router-controller: gs_flex_coordinator.controllers.deployment_controller - /api/v1/procedure: - get: - description: List all the stored procedures - operationId: list_procedures - responses: - "200": - content: - application/json: - example: - - bound_graph: demo - description: stored procedure 1 - enable: true - runnable: true - name: procedure-1 - query: "MATCH (u: person) Return u.id, u.name LIMIT 5;" - type: cypher - params: - - name: id - type: DT_STRING - returns: - - name: name - type: DT_STRING - schema: - items: - $ref: '#/components/schemas/Procedure' - type: array - description: Successful operation - tags: - - procedure - x-openapi-router-controller: gs_flex_coordinator.controllers.procedure_controller - /api/v1/service/restart: - post: - description: Restart current service - operationId: restart_service - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - tags: - - service - x-openapi-router-controller: gs_flex_coordinator.controllers.service_controller - /api/v1/service/start: - post: - description: Start service - operationId: start_service requestBody: content: application/json: schema: - $ref: '#/components/schemas/start_service_request' - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - tags: - - service - x-openapi-router-controller: gs_flex_coordinator.controllers.service_controller - /api/v1/service/status: - get: - description: Get service status - operationId: get_service_status + $ref: '#/components/schemas/UpdateProcedureRequest' responses: "200": content: application/json: - example: - status: running - graph_name: demo - sdk_endpoints: - cypher: neo4j://mock.api.cypher:7676 - gremlin: ws://mock.api.gremlin/gremlin - hqps: http://mock.api.hqps:10000 - grpc: http://mock.api.grpc:10000 schema: - $ref: '#/components/schemas/ServiceStatus' - description: successful operation - tags: - - service - x-openapi-router-controller: gs_flex_coordinator.controllers.service_controller - /api/v1/service/stop: - post: - description: Stop current service - operationId: stop_service - responses: - "200": + $ref: '#/components/schemas/APIResponse' + description: Successfully updated the stored procedure + "500": content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation + $ref: '#/components/schemas/Error' + description: Server error tags: - - service - x-openapi-router-controller: gs_flex_coordinator.controllers.service_controller + - Procedure + x-openapi-router-controller: gs_flex_coordinator.controllers.procedure_controller components: + responses: + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Bad request + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Not found + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error schemas: - ApiResponse: - example: operation successful + APIResponse: type: string - Connection: + Error: example: - coordinator_endpoint: coordinator_endpoint + code: 0 + message: message properties: - coordinator_endpoint: - title: coordinator_endpoint + code: + description: Error code + format: int32 + title: code + type: integer + message: + description: Error message + title: message type: string - title: Connection - type: object - x-body-name: connection - ConnectionStatus: + required: + - code + - message + title: Error + AnyValue: + title: default_value + RunningDeploymentInfo: example: + creation_time: creation_time + instance_name: instance_name solution: INTERACTIVE - status: CONNECTED + cluster_type: HOSTS + version: version properties: - status: + instance_name: + title: instance_name + type: string + cluster_type: enum: - - CONNECTED - title: status + - HOSTS + - KUBERNETES + title: cluster_type + type: string + version: + title: version type: string solution: enum: @@ -1787,237 +1899,379 @@ components: - GRAPHSCOPE_INSIGHT title: solution type: string - title: ConnectionStatus - type: object - x-body-name: connection_status - Graph: + creation_time: + title: creation_time + type: string + required: + - cluster_type + - creation_time + - instance_name + - solution + - version + title: RunningDeploymentInfo + StartServiceRequest: example: - schema: - vertex_types: - - type_name: type_name - primary_keys: - - primary_keys - - primary_keys - type_id: 0 - properties: - - property_type: - primitive_type: DT_DOUBLE - property_id: 6 - property_name: property_name - - property_type: - primitive_type: DT_DOUBLE - property_id: 6 - property_name: property_name - - type_name: type_name - primary_keys: - - primary_keys - - primary_keys - type_id: 0 - properties: - - property_type: - primitive_type: DT_DOUBLE - property_id: 6 - property_name: property_name - - property_type: - primitive_type: DT_DOUBLE - property_id: 6 - property_name: property_name - edge_types: - - type_name: type_name - type_id: 1 - vertex_type_pair_relations: - - source_vertex: source_vertex - destination_vertex: destination_vertex - x_csr_params: - edge_storage_strategy: ONLY_IN - relation: MANY_TO_MANY - - source_vertex: source_vertex - destination_vertex: destination_vertex - x_csr_params: - edge_storage_strategy: ONLY_IN - relation: MANY_TO_MANY - properties: - - property_type: - primitive_type: DT_DOUBLE - property_id: 6 - property_name: property_name - - property_type: - primitive_type: DT_DOUBLE - property_id: 6 - property_name: property_name - - type_name: type_name - type_id: 1 - vertex_type_pair_relations: - - source_vertex: source_vertex - destination_vertex: destination_vertex + graph_id: graph_id + properties: + graph_id: + title: graph_id + type: string + title: StartServiceRequest + x-body-name: start_service_request + ServiceStatus: + example: + sdk_endpoints: + gremlin: gremlin + cypher: cypher + hqps: hqps + grpc: grpc + graph: + creation_time: creation_time + schema: + vertex_types: + - type_name: type_name + primary_keys: + - primary_keys + - primary_keys x_csr_params: - edge_storage_strategy: ONLY_IN - relation: MANY_TO_MANY - - source_vertex: source_vertex - destination_vertex: destination_vertex + max_vertex_num: 0 + type_id: 6 + description: description + properties: + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + - type_name: type_name + primary_keys: + - primary_keys + - primary_keys x_csr_params: - edge_storage_strategy: ONLY_IN - relation: MANY_TO_MANY - properties: - - property_type: - primitive_type: DT_DOUBLE - property_id: 6 - property_name: property_name - - property_type: - primitive_type: DT_DOUBLE - property_id: 6 - property_name: property_name - stored_procedures: - directory: plugins - name: name - store_type: mutable_csr + max_vertex_num: 0 + type_id: 6 + description: description + properties: + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + edge_types: + - type_name: type_name + directed: true + primary_keys: + - primary_keys + - primary_keys + vertex_type_pair_relations: + - source_vertex: source_vertex + destination_vertex: destination_vertex + x_csr_params: + edge_storage_strategy: ONLY_IN + relation: MANY_TO_MANY + - source_vertex: source_vertex + destination_vertex: destination_vertex + x_csr_params: + edge_storage_strategy: ONLY_IN + relation: MANY_TO_MANY + type_id: 5 + description: description + properties: + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + - type_name: type_name + directed: true + primary_keys: + - primary_keys + - primary_keys + vertex_type_pair_relations: + - source_vertex: source_vertex + destination_vertex: destination_vertex + x_csr_params: + edge_storage_strategy: ONLY_IN + relation: MANY_TO_MANY + - source_vertex: source_vertex + destination_vertex: destination_vertex + x_csr_params: + edge_storage_strategy: ONLY_IN + relation: MANY_TO_MANY + type_id: 5 + description: description + properties: + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + stored_procedures: + - runnable: true + bound_graph: bound_graph + - runnable: true + bound_graph: bound_graph + name: name + description: description + schema_update_time: schema_update_time + id: id + store_type: mutable_csr + data_update_time: data_update_time + status: Running + properties: + status: + enum: + - Running + - Stopped + title: status + type: string + graph: + $ref: '#/components/schemas/GetGraphResponse' + sdk_endpoints: + $ref: '#/components/schemas/ServiceStatus_sdk_endpoints' + required: + - status + title: ServiceStatus + UploadFileResponse: + example: + file_path: file_path + properties: + file_path: + title: file_path + type: string + required: + - file_path + title: UploadFileResponse + LongText: + properties: + long_text: + nullable: true + title: long_text + type: string + required: + - long_text + title: LongText + PrimitiveType: + example: + primitive_type: DT_SIGNED_INT32 + properties: + primitive_type: + enum: + - DT_SIGNED_INT32 + - DT_UNSIGNED_INT32 + - DT_SIGNED_INT64 + - DT_UNSIGNED_INT64 + - DT_BOOL + - DT_FLOAT + - DT_DOUBLE + title: primitive_type + type: string + required: + - primitive_type + title: PrimitiveType + StringType: + properties: + string: + $ref: '#/components/schemas/StringType_string' + required: + - string + title: StringType + GSDataType: + oneOf: + - $ref: '#/components/schemas/PrimitiveType' + - $ref: '#/components/schemas/StringType' + title: GSDataType + Parameter: properties: name: title: name type: string - store_type: - enum: - - mutable_csr - title: store_type + type: + $ref: '#/components/schemas/GSDataType' + required: + - name + - type + title: Parameter + BasePropertyMeta: + properties: + property_name: + title: property_name type: string - stored_procedures: - $ref: '#/components/schemas/Graph_stored_procedures' - schema: - $ref: '#/components/schemas/Schema' - title: Graph - type: object - x-body-name: graph - Schema: + property_type: + $ref: '#/components/schemas/GSDataType' + nullable: + title: nullable + type: boolean + default_value: + title: default_value + description: + title: description + type: string + required: + - property_name + - property_type + title: BasePropertyMeta + CreatePropertyMeta: + allOf: + - $ref: '#/components/schemas/BasePropertyMeta' example: - vertex_types: - - type_name: type_name - primary_keys: - - primary_keys - - primary_keys - type_id: 0 - properties: - - property_type: - primitive_type: DT_DOUBLE - property_id: 6 - property_name: property_name - - property_type: - primitive_type: DT_DOUBLE - property_id: 6 - property_name: property_name - - type_name: type_name - primary_keys: - - primary_keys - - primary_keys - type_id: 0 - properties: - - property_type: - primitive_type: DT_DOUBLE - property_id: 6 - property_name: property_name - - property_type: - primitive_type: DT_DOUBLE - property_id: 6 - property_name: property_name - edge_types: - - type_name: type_name - type_id: 1 - vertex_type_pair_relations: - - source_vertex: source_vertex - destination_vertex: destination_vertex - x_csr_params: - edge_storage_strategy: ONLY_IN - relation: MANY_TO_MANY - - source_vertex: source_vertex - destination_vertex: destination_vertex - x_csr_params: - edge_storage_strategy: ONLY_IN - relation: MANY_TO_MANY - properties: - - property_type: - primitive_type: DT_DOUBLE - property_id: 6 - property_name: property_name - - property_type: - primitive_type: DT_DOUBLE - property_id: 6 - property_name: property_name - - type_name: type_name - type_id: 1 - vertex_type_pair_relations: - - source_vertex: source_vertex - destination_vertex: destination_vertex - x_csr_params: - edge_storage_strategy: ONLY_IN - relation: MANY_TO_MANY - - source_vertex: source_vertex - destination_vertex: destination_vertex - x_csr_params: - edge_storage_strategy: ONLY_IN - relation: MANY_TO_MANY - properties: - - property_type: - primitive_type: DT_DOUBLE - property_id: 6 - property_name: property_name - - property_type: - primitive_type: DT_DOUBLE - property_id: 6 - property_name: property_name + nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_name: property_name + title: CreatePropertyMeta + x-body-name: create_property_meta + GetPropertyMeta: + allOf: + - $ref: '#/components/schemas/BasePropertyMeta' + - properties: + property_id: + format: int32 + type: integer + required: + - property_id + type: object + example: + nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + title: GetPropertyMeta + x-body-name: get_property_meta + BaseVertexType: properties: - vertex_types: - items: - $ref: '#/components/schemas/VertexType' - title: vertex_types - type: array - edge_types: + type_name: + title: type_name + type: string + primary_keys: items: - $ref: '#/components/schemas/EdgeType' - title: edge_types + type: string + title: primary_keys type: array - title: Schema - type: object - x-body-name: schema - VertexType: + x_csr_params: + $ref: '#/components/schemas/BaseVertexType_x_csr_params' + required: + - primary_keys + - type_name + title: BaseVertexType + CreateVertexType: + allOf: + - $ref: '#/components/schemas/BaseVertexType' + - properties: + properties: + items: + $ref: '#/components/schemas/CreatePropertyMeta' + type: array + description: + type: string + required: + - properties + type: object example: type_name: type_name primary_keys: - primary_keys - primary_keys - type_id: 0 + x_csr_params: + max_vertex_num: 0 + description: description properties: - - property_type: - primitive_type: DT_DOUBLE - property_id: 6 + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" property_name: property_name - - property_type: - primitive_type: DT_DOUBLE - property_id: 6 + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" property_name: property_name + title: CreateVertexType + x-body-name: create_vertex_type + BaseEdgeType: properties: - type_id: - format: int32 - title: type_id - type: integer type_name: title: type_name type: string - properties: + vertex_type_pair_relations: items: - $ref: '#/components/schemas/Property' - title: properties + $ref: '#/components/schemas/BaseEdgeType_vertex_type_pair_relations_inner' + title: vertex_type_pair_relations type: array + directed: + title: directed + type: boolean primary_keys: items: type: string title: primary_keys type: array - title: VertexType - type: object - x-body-name: vertex_type - EdgeType: + required: + - type_name + - vertex_type_pair_relations + title: BaseEdgeType + CreateEdgeType: + allOf: + - $ref: '#/components/schemas/BaseEdgeType' + - properties: + properties: + items: + $ref: '#/components/schemas/CreatePropertyMeta' + type: array + description: + type: string + required: + - properties + type: object example: type_name: type_name - type_id: 1 + directed: true + primary_keys: + - primary_keys + - primary_keys vertex_type_pair_relations: - source_vertex: source_vertex destination_vertex: destination_vertex @@ -2029,81 +2283,32 @@ components: x_csr_params: edge_storage_strategy: ONLY_IN relation: MANY_TO_MANY + description: description properties: - - property_type: - primitive_type: DT_DOUBLE - property_id: 6 + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" property_name: property_name - - property_type: - primitive_type: DT_DOUBLE - property_id: 6 + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" property_name: property_name - properties: - type_id: - format: int32 - title: type_id - type: integer - type_name: - title: type_name - type: string - vertex_type_pair_relations: - items: - $ref: '#/components/schemas/EdgeType_vertex_type_pair_relations_inner' - title: vertex_type_pair_relations - type: array - properties: - items: - $ref: '#/components/schemas/Property' - title: properties - type: array - title: EdgeType - type: object - x-body-name: edge_type - Property: - example: - property_type: - primitive_type: DT_DOUBLE - property_id: 6 - property_name: property_name - properties: - property_id: - format: int32 - title: property_id - type: integer - property_name: - title: property_name - type: string - property_type: - $ref: '#/components/schemas/Property_property_type' - title: Property - type: object - x-body-name: property - Procedure: + title: CreateEdgeType + x-body-name: create_edge_type + CreateProcedureRequest: example: - runnable: true - bound_graph: bound_graph - enable: true query: query name: name description: description - returns: - - name: name - type: type - - name: name - type: type type: cpp - params: - - name: name - type: type - - name: name - type: type properties: name: title: name type: string - bound_graph: - title: bound_graph - type: string description: title: description type: string @@ -2116,325 +2321,851 @@ components: query: title: query type: string - enable: - title: enable - type: boolean - runnable: - title: runnable - type: boolean - params: - items: - $ref: '#/components/schemas/Procedure_params_inner' - title: params - type: array - returns: - items: - $ref: '#/components/schemas/Procedure_params_inner' - title: returns - type: array - title: Procedure - type: object - x-body-name: procedure - DeploymentInfo: + required: + - name + - query + - type + title: CreateProcedureRequest + x-body-name: create_procedure_request + CreateProcedureResponse: example: - creation_time: creation_time - graphs_info: - key: - creation_time: creation_time - update_time: update_time - last_dataloading_time: last_dataloading_time - name: name - solution: INTERACTIVE - name: name - cluster_type: HOSTS - version: version + procedure_id: procedure_id properties: - name: - title: name - type: string - cluster_type: - enum: - - HOSTS - - KUBERNETES - title: cluster_type - type: string - version: - title: version - type: string - solution: - enum: - - INTERACTIVE - - GRAPHSCOPE_INSIGHT - title: solution + procedure_id: + title: procedure_id type: string - creation_time: - title: creation_time - type: string - graphs_info: - additionalProperties: - $ref: '#/components/schemas/DeploymentInfo_graphs_info_value' - title: graphs_info - type: object - title: DeploymentInfo - type: object - x-body-name: deployment_info - DeploymentStatus: - description: K8s only + required: + - procedure_id + title: CreateProcedureResponse + CreateGraphSchemaRequest: example: - container: - - container - - container - creation_time: creation_time - image: - - image - - image - node: node - restart_count: 0 - memory_value: 1 - cpu_value: 6 - name: name - labels: - - labels - - labels - status: status - timestamp: timestamp - properties: - name: - title: name - type: string - container: - items: - type: string - title: container - type: array - image: - items: - type: string - title: image - type: array - labels: - items: - type: string - title: labels - type: array - node: - title: node - type: string - status: - title: status - type: string - restart_count: - format: int32 - title: restart_count - type: integer - cpu_value: - description: cpu value in millicore - format: int32 - title: cpu_value - type: integer - memory_value: - description: memory value in megabytes - format: int32 - title: memory_value - type: integer - timestamp: - title: timestamp - type: string - creation_time: - title: creation_time - type: string - title: DeploymentStatus - type: object - x-body-name: deployment_status - NodeStatus: - example: - node: node - memory_usage: 6.027456183070403 - disk_usage: 1.4658129805029452 - cpu_usage: 0.8008281904610115 - properties: - node: - title: node - type: string - cpu_usage: - format: double - title: cpu_usage - type: number - memory_usage: - format: double - title: memory_usage - type: number - disk_usage: - format: double - title: disk_usage - type: number - title: NodeStatus - type: object - x-body-name: node_status - ServiceStatus: - example: - graph_name: graph_name - sdk_endpoints: - gremlin: gremlin - cypher: cypher - hqps: hqps - grpc: grpc - status: status + vertex_types: + - type_name: type_name + primary_keys: + - primary_keys + - primary_keys + x_csr_params: + max_vertex_num: 0 + description: description + properties: + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_name: property_name + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_name: property_name + - type_name: type_name + primary_keys: + - primary_keys + - primary_keys + x_csr_params: + max_vertex_num: 0 + description: description + properties: + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_name: property_name + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_name: property_name + edge_types: + - type_name: type_name + directed: true + primary_keys: + - primary_keys + - primary_keys + vertex_type_pair_relations: + - source_vertex: source_vertex + destination_vertex: destination_vertex + x_csr_params: + edge_storage_strategy: ONLY_IN + relation: MANY_TO_MANY + - source_vertex: source_vertex + destination_vertex: destination_vertex + x_csr_params: + edge_storage_strategy: ONLY_IN + relation: MANY_TO_MANY + description: description + properties: + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_name: property_name + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_name: property_name + - type_name: type_name + directed: true + primary_keys: + - primary_keys + - primary_keys + vertex_type_pair_relations: + - source_vertex: source_vertex + destination_vertex: destination_vertex + x_csr_params: + edge_storage_strategy: ONLY_IN + relation: MANY_TO_MANY + - source_vertex: source_vertex + destination_vertex: destination_vertex + x_csr_params: + edge_storage_strategy: ONLY_IN + relation: MANY_TO_MANY + description: description + properties: + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_name: property_name + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_name: property_name properties: - status: - title: status - type: string - graph_name: - description: which graph is serving now - title: graph_name - type: string - sdk_endpoints: - $ref: '#/components/schemas/ServiceStatus_sdk_endpoints' - title: ServiceStatus - type: object - x-body-name: service_status - AlertRule: + vertex_types: + items: + $ref: '#/components/schemas/CreateVertexType' + title: vertex_types + type: array + edge_types: + items: + $ref: '#/components/schemas/CreateEdgeType' + title: edge_types + type: array + required: + - edge_types + - vertex_types + title: CreateGraphSchemaRequest + x-body-name: create_graph_schema_request + CreateGraphRequest: example: - severity: warning - conditions_description: conditions_description - enable: true + schema: + vertex_types: + - type_name: type_name + primary_keys: + - primary_keys + - primary_keys + x_csr_params: + max_vertex_num: 0 + description: description + properties: + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_name: property_name + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_name: property_name + - type_name: type_name + primary_keys: + - primary_keys + - primary_keys + x_csr_params: + max_vertex_num: 0 + description: description + properties: + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_name: property_name + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_name: property_name + edge_types: + - type_name: type_name + directed: true + primary_keys: + - primary_keys + - primary_keys + vertex_type_pair_relations: + - source_vertex: source_vertex + destination_vertex: destination_vertex + x_csr_params: + edge_storage_strategy: ONLY_IN + relation: MANY_TO_MANY + - source_vertex: source_vertex + destination_vertex: destination_vertex + x_csr_params: + edge_storage_strategy: ONLY_IN + relation: MANY_TO_MANY + description: description + properties: + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_name: property_name + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_name: property_name + - type_name: type_name + directed: true + primary_keys: + - primary_keys + - primary_keys + vertex_type_pair_relations: + - source_vertex: source_vertex + destination_vertex: destination_vertex + x_csr_params: + edge_storage_strategy: ONLY_IN + relation: MANY_TO_MANY + - source_vertex: source_vertex + destination_vertex: destination_vertex + x_csr_params: + edge_storage_strategy: ONLY_IN + relation: MANY_TO_MANY + description: description + properties: + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_name: property_name + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_name: property_name + stored_procedures: + - query: query + name: name + description: description + type: cpp + - query: query + name: name + description: description + type: cpp name: name - metric_type: node - frequency: 0 + description: description properties: name: title: name type: string - severity: - enum: - - warning - - emergency - title: severity - type: string - metric_type: - enum: - - node - - service - title: metric_type - type: string - conditions_description: - title: conditions_description + description: + title: description type: string - frequency: - description: (mins) - title: frequency - type: integer - enable: - title: enable - type: boolean - title: AlertRule - type: object - x-body-name: alert_rule - AlertMessage: + stored_procedures: + items: + $ref: '#/components/schemas/CreateProcedureRequest' + title: stored_procedures + type: array + schema: + $ref: '#/components/schemas/CreateGraphSchemaRequest' + required: + - name + - schema + title: CreateGraphRequest + x-body-name: create_graph_request + CreateGraphResponse: example: - severity: warning - trigger_time: trigger_time - metric_type: node - message_id: message_id - message: message - alert_name: alert_name - target: - - target - - target - status: unsolved + graph_id: graph_id properties: - message_id: - description: Generated in server side - title: message_id - type: string - alert_name: - title: alert_name - type: string - severity: - enum: - - warning - - emergency - title: severity - type: string - metric_type: - enum: - - node - - service - title: metric_type + graph_id: + title: graph_id + type: string + required: + - graph_id + title: CreateGraphResponse + StoredProcedureMeta: + allOf: + - $ref: '#/components/schemas/CreateProcedureRequest' + - properties: + id: + type: string + library: + type: string + params: + items: + $ref: '#/components/schemas/Parameter' + type: array + returns: + items: + $ref: '#/components/schemas/Parameter' + type: array + required: + - id + - library + - params + - returns + type: object + title: StoredProcedureMeta + GetProcedureResponse: + allOf: + - $ref: '#/components/schemas/StoredProcedureMeta' + - properties: + bound_graph: + type: string + runnable: + type: boolean + required: + - bound_graph + - runnable + type: object + example: + runnable: true + bound_graph: bound_graph + title: GetProcedureResponse + UpdateProcedureRequest: + example: + description: description + properties: + description: + title: description type: string - target: - items: + required: + - description + title: UpdateProcedureRequest + x-body-name: update_procedure_request + GetVertexType: + allOf: + - $ref: '#/components/schemas/BaseVertexType' + - properties: + type_id: + format: int32 + type: integer + properties: + items: + $ref: '#/components/schemas/GetPropertyMeta' + type: array + description: type: string - title: target + required: + - properties + - type_id + type: object + example: + type_name: type_name + primary_keys: + - primary_keys + - primary_keys + x_csr_params: + max_vertex_num: 0 + type_id: 6 + description: description + properties: + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + title: GetVertexType + GetEdgeType: + allOf: + - $ref: '#/components/schemas/BaseEdgeType' + - properties: + type_id: + format: int32 + type: integer + properties: + items: + $ref: '#/components/schemas/GetPropertyMeta' + type: array + description: + type: string + required: + - properties + - type_id + type: object + example: + type_name: type_name + directed: true + primary_keys: + - primary_keys + - primary_keys + vertex_type_pair_relations: + - source_vertex: source_vertex + destination_vertex: destination_vertex + x_csr_params: + edge_storage_strategy: ONLY_IN + relation: MANY_TO_MANY + - source_vertex: source_vertex + destination_vertex: destination_vertex + x_csr_params: + edge_storage_strategy: ONLY_IN + relation: MANY_TO_MANY + type_id: 5 + description: description + properties: + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + title: GetEdgeType + GetGraphSchemaResponse: + example: + vertex_types: + - type_name: type_name + primary_keys: + - primary_keys + - primary_keys + x_csr_params: + max_vertex_num: 0 + type_id: 6 + description: description + properties: + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + - type_name: type_name + primary_keys: + - primary_keys + - primary_keys + x_csr_params: + max_vertex_num: 0 + type_id: 6 + description: description + properties: + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + edge_types: + - type_name: type_name + directed: true + primary_keys: + - primary_keys + - primary_keys + vertex_type_pair_relations: + - source_vertex: source_vertex + destination_vertex: destination_vertex + x_csr_params: + edge_storage_strategy: ONLY_IN + relation: MANY_TO_MANY + - source_vertex: source_vertex + destination_vertex: destination_vertex + x_csr_params: + edge_storage_strategy: ONLY_IN + relation: MANY_TO_MANY + type_id: 5 + description: description + properties: + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + - type_name: type_name + directed: true + primary_keys: + - primary_keys + - primary_keys + vertex_type_pair_relations: + - source_vertex: source_vertex + destination_vertex: destination_vertex + x_csr_params: + edge_storage_strategy: ONLY_IN + relation: MANY_TO_MANY + - source_vertex: source_vertex + destination_vertex: destination_vertex + x_csr_params: + edge_storage_strategy: ONLY_IN + relation: MANY_TO_MANY + type_id: 5 + description: description + properties: + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + properties: + vertex_types: + items: + $ref: '#/components/schemas/GetVertexType' + title: vertex_types type: array - trigger_time: - title: trigger_time + edge_types: + items: + $ref: '#/components/schemas/GetEdgeType' + title: edge_types + type: array + required: + - edge_types + - vertex_types + title: GetGraphSchemaResponse + GetGraphResponse: + example: + creation_time: creation_time + schema: + vertex_types: + - type_name: type_name + primary_keys: + - primary_keys + - primary_keys + x_csr_params: + max_vertex_num: 0 + type_id: 6 + description: description + properties: + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + - type_name: type_name + primary_keys: + - primary_keys + - primary_keys + x_csr_params: + max_vertex_num: 0 + type_id: 6 + description: description + properties: + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + edge_types: + - type_name: type_name + directed: true + primary_keys: + - primary_keys + - primary_keys + vertex_type_pair_relations: + - source_vertex: source_vertex + destination_vertex: destination_vertex + x_csr_params: + edge_storage_strategy: ONLY_IN + relation: MANY_TO_MANY + - source_vertex: source_vertex + destination_vertex: destination_vertex + x_csr_params: + edge_storage_strategy: ONLY_IN + relation: MANY_TO_MANY + type_id: 5 + description: description + properties: + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + - type_name: type_name + directed: true + primary_keys: + - primary_keys + - primary_keys + vertex_type_pair_relations: + - source_vertex: source_vertex + destination_vertex: destination_vertex + x_csr_params: + edge_storage_strategy: ONLY_IN + relation: MANY_TO_MANY + - source_vertex: source_vertex + destination_vertex: destination_vertex + x_csr_params: + edge_storage_strategy: ONLY_IN + relation: MANY_TO_MANY + type_id: 5 + description: description + properties: + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + - nullable: true + property_type: + primitive_type: DT_SIGNED_INT32 + description: description + default_value: "" + property_id: 1 + property_name: property_name + stored_procedures: + - runnable: true + bound_graph: bound_graph + - runnable: true + bound_graph: bound_graph + name: name + description: description + schema_update_time: schema_update_time + id: id + store_type: mutable_csr + data_update_time: data_update_time + properties: + id: + title: id type: string - status: + name: + title: name + type: string + description: + title: description + type: string + store_type: enum: - - unsolved - - solved - - dealing - title: status + - mutable_csr + title: store_type type: string - message: - title: message + creation_time: + title: creation_time type: string - title: AlertMessage - type: object - x-body-name: alert_message - AlertReceiver: + data_update_time: + title: data_update_time + type: string + schema_update_time: + title: schema_update_time + type: string + stored_procedures: + items: + $ref: '#/components/schemas/GetProcedureResponse' + title: stored_procedures + type: array + schema: + $ref: '#/components/schemas/GetGraphSchemaResponse' + required: + - creation_time + - data_update_time + - id + - name + - schema + - schema_update_time + title: GetGraphResponse + ColumnMapping: example: - webhook_url: webhook_url - is_at_all: true - receiver_id: receiver_id - enable: true - at_user_ids: - - at_user_ids - - at_user_ids - type: webhook - message: message + column: + name: name + index: 0 + property: property properties: - type: - enum: - - webhook - title: type - type: string - receiver_id: - description: Generated in server side - title: receiver_id + column: + $ref: '#/components/schemas/ColumnMapping_column' + property: + description: must align with the schema + title: property type: string - webhook_url: - title: webhook_url + required: + - column + - property + title: ColumnMapping + VertexMapping: + example: + type_name: type_name + inputs: + - file:///path/to/file.csv + - file:///path/to/file.csv + column_mappings: + - column: + name: name + index: 0 + property: property + - column: + name: name + index: 0 + property: property + properties: + type_name: + title: type_name type: string - at_user_ids: + inputs: items: + example: file:///path/to/file.csv type: string - title: at_user_ids + title: inputs type: array - is_at_all: - title: is_at_all - type: boolean - enable: - title: enable - type: boolean - message: - description: error message generated in server side - title: message - type: string - title: AlertReceiver - type: object - x-body-name: alert_receiver + column_mappings: + items: + $ref: '#/components/schemas/ColumnMapping' + title: column_mappings + type: array + required: + - column_mappings + - inputs + - type_name + title: VertexMapping + x-body-name: vertex_mapping + EdgeMapping: + example: + inputs: + - inputs + - inputs + source_vertex_mappings: + - column: + name: name + index: 0 + property: property + - column: + name: name + index: 0 + property: property + destination_vertex_mappings: + - column: + name: name + index: 0 + property: property + - column: + name: name + index: 0 + property: property + column_mappings: + - column: + name: name + index: 0 + property: property + - column: + name: name + index: 0 + property: property + type_triplet: + edge: edge + source_vertex: source_vertex + destination_vertex: destination_vertex + properties: + type_triplet: + $ref: '#/components/schemas/EdgeMapping_type_triplet' + inputs: + items: + type: string + title: inputs + type: array + source_vertex_mappings: + items: + $ref: '#/components/schemas/ColumnMapping' + title: source_vertex_mappings + type: array + destination_vertex_mappings: + items: + $ref: '#/components/schemas/ColumnMapping' + title: destination_vertex_mappings + type: array + column_mappings: + items: + $ref: '#/components/schemas/ColumnMapping' + title: column_mappings + type: array + required: + - destination_vertex_mappings + - inputs + - source_vertex_mappings + - type_triplet + title: EdgeMapping + x-body-name: edge_mapping SchemaMapping: example: - loading_config: - format: - metadata: - key: "" - type: type - import_option: init - data_source: - scheme: file edge_mappings: - inputs: - inputs @@ -2443,16 +3174,20 @@ components: - column: name: name index: 0 + property: property - column: name: name index: 0 + property: property destination_vertex_mappings: - column: name: name index: 0 + property: property - column: name: name index: 0 + property: property column_mappings: - column: name: name @@ -2473,16 +3208,20 @@ components: - column: name: name index: 0 + property: property - column: name: name index: 0 + property: property destination_vertex_mappings: - column: name: name index: 0 + property: property - column: name: name index: 0 + property: property column_mappings: - column: name: name @@ -2496,12 +3235,11 @@ components: edge: edge source_vertex: source_vertex destination_vertex: destination_vertex - graph: graph vertex_mappings: - type_name: type_name inputs: - - inputs - - inputs + - file:///path/to/file.csv + - file:///path/to/file.csv column_mappings: - column: name: name @@ -2513,155 +3251,98 @@ components: property: property - type_name: type_name inputs: - - inputs - - inputs + - file:///path/to/file.csv + - file:///path/to/file.csv column_mappings: - - column: - name: name - index: 0 - property: property - - column: - name: name - index: 0 - property: property - properties: - graph: - title: graph - type: string - loading_config: - $ref: '#/components/schemas/SchemaMapping_loading_config' - vertex_mappings: - items: - $ref: '#/components/schemas/VertexMapping' - title: vertex_mappings - type: array - edge_mappings: - items: - $ref: '#/components/schemas/EdgeMapping' - title: edge_mappings - type: array - title: SchemaMapping - type: object - x-body-name: schema_mapping - VertexMapping: - example: - type_name: type_name - inputs: - - inputs - - inputs - column_mappings: - - column: - name: name - index: 0 - property: property - - column: - name: name - index: 0 - property: property - properties: - type_name: - title: type_name - type: string - inputs: - items: - type: string - title: inputs - type: array - column_mappings: - items: - $ref: '#/components/schemas/ColumnMapping' - title: column_mappings - type: array - title: VertexMapping - type: object - x-body-name: vertex_mapping - EdgeMapping: - example: - inputs: - - inputs - - inputs - source_vertex_mappings: - - column: - name: name - index: 0 - - column: - name: name - index: 0 - destination_vertex_mappings: - - column: - name: name - index: 0 - - column: - name: name - index: 0 - column_mappings: - - column: - name: name - index: 0 - property: property - - column: - name: name - index: 0 - property: property - type_triplet: - edge: edge - source_vertex: source_vertex - destination_vertex: destination_vertex + - column: + name: name + index: 0 + property: property + - column: + name: name + index: 0 + property: property properties: - type_triplet: - $ref: '#/components/schemas/EdgeMapping_type_triplet' - inputs: + vertex_mappings: items: - type: string - title: inputs + $ref: '#/components/schemas/VertexMapping' + title: vertex_mappings type: array - source_vertex_mappings: + edge_mappings: items: - $ref: '#/components/schemas/EdgeMapping_source_vertex_mappings_inner' - title: source_vertex_mappings + $ref: '#/components/schemas/EdgeMapping' + title: edge_mappings type: array - destination_vertex_mappings: + required: + - edge_mappings + - vertex_mappings + title: SchemaMapping + x-body-name: schema_mapping + DataloadingJobConfig: + example: + schedule: schedule + loading_config: + format: + metadata: + key: "" + type: type + import_option: overwrite + vertices: + - type_name: type_name + - type_name: type_name + repeat: once + edges: + - type_name: type_name + source_vertex: source_vertex + destination_vertex: destination_vertex + - type_name: type_name + source_vertex: source_vertex + destination_vertex: destination_vertex + properties: + loading_config: + $ref: '#/components/schemas/DataloadingJobConfig_loading_config' + vertices: items: - $ref: '#/components/schemas/EdgeMapping_destination_vertex_mappings_inner' - title: destination_vertex_mappings + $ref: '#/components/schemas/DataloadingJobConfig_vertices_inner' + title: vertices type: array - column_mappings: + edges: items: - $ref: '#/components/schemas/ColumnMapping' - title: column_mappings + $ref: '#/components/schemas/DataloadingJobConfig_edges_inner' + title: edges type: array - title: EdgeMapping - type: object - x-body-name: edge_mapping - ColumnMapping: - example: - column: - name: name - index: 0 - property: property - properties: - column: - $ref: '#/components/schemas/EdgeMapping_source_vertex_mappings_inner_column' - property: - description: must align with the schema - title: property + schedule: + description: format with '2023-02-21 11:56:30' + nullable: true + title: schedule type: string - title: ColumnMapping - type: object - x-body-name: column_mapping + repeat: + enum: + - once + - day + - week + nullable: true + title: repeat + type: string + required: + - edges + - loading_config + - vertices + title: DataloadingJobConfig + x-body-name: dataloading_job_config JobStatus: example: start_time: start_time log: log - job_id: job_id end_time: end_time + id: id detail: key: "" type: type status: RUNNING properties: - job_id: - title: job_id + id: + title: id type: string type: title: type @@ -2682,465 +3363,276 @@ components: title: end_time type: string log: - description: URL or log string + description: logview URL or log string title: log type: string detail: additionalProperties: true title: detail type: object + required: + - id + - status + - type title: JobStatus - type: object - x-body-name: job_status - VertexDataSource: - example: - type_name: type_name - property_mapping: - key: "" - location: location - data_source: ODPS - properties: - data_source: - enum: - - ODPS - - FILE - title: data_source - type: string - type_name: - title: type_name - type: string - location: - title: location - type: string - property_mapping: - additionalProperties: true - title: property_mapping - type: object - title: VertexDataSource - type: object - x-body-name: vertex_data_source - EdgeDataSource: + CreateDataloadingJobResponse: example: - source_pk_column_map: - key: "" - type_name: type_name - destination_pk_column_map: - key: "" - source_vertex: source_vertex - destination_vertex: destination_vertex - property_mapping: - key: "" - location: location - data_source: ODPS + job_id: job_id properties: - data_source: - enum: - - ODPS - - FILE - title: data_source - type: string - type_name: - title: type_name - type: string - source_vertex: - title: source_vertex - type: string - destination_vertex: - title: destination_vertex - type: string - location: - title: location + job_id: + title: job_id type: string - source_pk_column_map: - additionalProperties: true - title: source_pk_column_map - type: object - destination_pk_column_map: - additionalProperties: true - title: destination_pk_column_map - type: object - property_mapping: - additionalProperties: true - title: property_mapping - type: object - title: EdgeDataSource - type: object - x-body-name: edge_data_source - DataSource: - example: - edges_datasource: - - source_pk_column_map: - key: "" - type_name: type_name - destination_pk_column_map: - key: "" - source_vertex: source_vertex - destination_vertex: destination_vertex - property_mapping: - key: "" - location: location - data_source: ODPS - - source_pk_column_map: - key: "" - type_name: type_name - destination_pk_column_map: - key: "" - source_vertex: source_vertex - destination_vertex: destination_vertex - property_mapping: - key: "" - location: location - data_source: ODPS - vertices_datasource: - - type_name: type_name - property_mapping: - key: "" - location: location - data_source: ODPS - - type_name: type_name - property_mapping: - key: "" - location: location - data_source: ODPS - properties: - vertices_datasource: - items: - $ref: '#/components/schemas/VertexDataSource' - title: vertices_datasource - type: array - edges_datasource: - items: - $ref: '#/components/schemas/EdgeDataSource' - title: edges_datasource - type: array - title: DataSource - type: object - x-body-name: data_source - GrootGraph: + required: + - job_id + title: CreateDataloadingJobResponse + CreateAlertRuleRequest: example: - creation_time: creation_time - schema: - vertices: - - label: label - properties: - - is_primary_key: true - name: name - id: 0 - type: DT_STRING - - is_primary_key: true - name: name - id: 0 - type: DT_STRING - - label: label - properties: - - is_primary_key: true - name: name - id: 0 - type: DT_STRING - - is_primary_key: true - name: name - id: 0 - type: DT_STRING - edges: - - label: label - relations: - - src_label: src_label - dst_label: dst_label - - src_label: src_label - dst_label: dst_label - properties: - - is_primary_key: true - name: name - id: 0 - type: DT_STRING - - is_primary_key: true - name: name - id: 0 - type: DT_STRING - - label: label - relations: - - src_label: src_label - dst_label: dst_label - - src_label: src_label - dst_label: dst_label - properties: - - is_primary_key: true - name: name - id: 0 - type: DT_STRING - - is_primary_key: true - name: name - id: 0 - type: DT_STRING - directed: true - gremlin_interface: - grpc_endpoint: grpc_endpoint - password: password - gremlin_endpoint: gremlin_endpoint - username: username + severity: warning + conditions_description: conditions_description + enable: true name: name - type: GrootGraph + metric_type: node + frequency: 0 properties: name: title: name type: string - type: + severity: enum: - - GrootGraph - title: type - type: string - directed: - title: directed - type: boolean - creation_time: - title: creation_time + - warning + - emergency + title: severity type: string - schema: - $ref: '#/components/schemas/GrootSchema' - gremlin_interface: - $ref: '#/components/schemas/GrootGraph_gremlin_interface' - title: GrootGraph - type: object - x-body-name: groot_graph - GrootSchema: - example: - vertices: - - label: label - properties: - - is_primary_key: true - name: name - id: 0 - type: DT_STRING - - is_primary_key: true - name: name - id: 0 - type: DT_STRING - - label: label - properties: - - is_primary_key: true - name: name - id: 0 - type: DT_STRING - - is_primary_key: true - name: name - id: 0 - type: DT_STRING - edges: - - label: label - relations: - - src_label: src_label - dst_label: dst_label - - src_label: src_label - dst_label: dst_label - properties: - - is_primary_key: true - name: name - id: 0 - type: DT_STRING - - is_primary_key: true - name: name - id: 0 - type: DT_STRING - - label: label - relations: - - src_label: src_label - dst_label: dst_label - - src_label: src_label - dst_label: dst_label - properties: - - is_primary_key: true - name: name - id: 0 - type: DT_STRING - - is_primary_key: true - name: name - id: 0 - type: DT_STRING - properties: - vertices: - items: - $ref: '#/components/schemas/GrootVertexType' - title: vertices - type: array - edges: - items: - $ref: '#/components/schemas/GrootEdgeType' - title: edges - type: array - title: GrootSchema - type: object - x-body-name: groot_schema - GrootVertexType: - example: - label: label - properties: - - is_primary_key: true - name: name - id: 0 - type: DT_STRING - - is_primary_key: true - name: name - id: 0 - type: DT_STRING - properties: - label: - title: label + metric_type: + enum: + - node + - service + title: metric_type type: string - properties: - items: - $ref: '#/components/schemas/GrootProperty' - title: properties - type: array - title: GrootVertexType - type: object - x-body-name: groot_vertex_type - GrootEdgeType: - example: - label: label - relations: - - src_label: src_label - dst_label: dst_label - - src_label: src_label - dst_label: dst_label - properties: - - is_primary_key: true - name: name - id: 0 - type: DT_STRING - - is_primary_key: true - name: name - id: 0 - type: DT_STRING - properties: - label: - title: label + conditions_description: + title: conditions_description type: string - relations: - items: - $ref: '#/components/schemas/GrootEdgeType_relations_inner' - title: relations - type: array - properties: - items: - $ref: '#/components/schemas/GrootProperty' - title: properties - type: array - title: GrootEdgeType - type: object - x-body-name: groot_edge_type - GrootProperty: + frequency: + description: (mins) + title: frequency + type: integer + enable: + title: enable + type: boolean + required: + - conditions_description + - enable + - frequency + - metric_type + - name + - severity + title: CreateAlertRuleRequest + x-body-name: create_alert_rule_request + GetAlertRuleResponse: + allOf: + - $ref: '#/components/schemas/CreateAlertRuleRequest' + - properties: + id: + type: string + required: + - id + type: object example: - is_primary_key: true + severity: warning + conditions_description: conditions_description + enable: true name: name - id: 0 - type: DT_STRING + metric_type: node + id: id + frequency: 0 + title: GetAlertRuleResponse + GetAlertMessageResponse: + example: + severity: warning + trigger_time: trigger_time + metric_type: node + id: id + message: message + alert_name: alert_name + target: + - target + - target + status: unsolved properties: id: - format: int32 + description: Generated in server side title: id - type: integer - name: - title: name type: string - type: + alert_name: + title: alert_name + type: string + severity: enum: - - DT_STRING - - DT_SIGNED_INT64 - - DT_DOUBLE - title: type + - warning + - emergency + title: severity type: string - is_primary_key: - title: is_primary_key - type: boolean - title: GrootProperty - type: object - x-body-name: groot_property - GrootDataloadingJobConfig: - example: - schedule: schedule - vertices: - - vertices - - vertices - repeat: once - edges: - - type_name: type_name - source_vertex: source_vertex - destination_vertex: destination_vertex - - type_name: type_name - source_vertex: source_vertex - destination_vertex: destination_vertex - properties: - vertices: + metric_type: + enum: + - node + - service + title: metric_type + type: string + target: items: type: string - title: vertices - type: array - edges: - items: - $ref: '#/components/schemas/GrootDataloadingJobConfig_edges_inner' - title: edges + title: target type: array - schedule: - description: format with '2023-02-21 11:56:30' - title: schedule + trigger_time: + title: trigger_time type: string - repeat: + status: enum: - - once - - day - - week - title: repeat + - unsolved + - solved + - dealing + title: status type: string - title: GrootDataloadingJobConfig - type: object - x-body-name: groot_dataloading_job_config - start_service_request: - properties: - graph_name: - title: graph_name + message: + title: message type: string - title: start_service_request - type: object - update_alert_messages_request: + required: + - alert_name + - id + - message + - metric_type + - severity + - status + - target + - trigger_time + title: GetAlertMessageResponse + UpdateAlertMessageStatusRequest: + example: + message_ids: + - message_ids + - message_ids + status: unsolved properties: - messages: + message_ids: items: - $ref: '#/components/schemas/AlertMessage' - title: messages + type: string + title: message_ids type: array - batch_status: - description: Override the status of each message + status: enum: - - solved - unsolved + - solved - dealing - title: batch_status + title: status + type: string + required: + - message_ids + - status + title: UpdateAlertMessageStatusRequest + x-body-name: update_alert_message_status_request + CreateAlertReceiverRequest: + example: + webhook_url: webhook_url + is_at_all: true + enable: true + at_user_ids: + - at_user_ids + - at_user_ids + type: webhook + properties: + type: + enum: + - webhook + title: type + type: string + webhook_url: + title: webhook_url type: string - batch_delete: - default: false - description: True will delete all the messages in request body - title: batch_delete + at_user_ids: + items: + type: string + title: at_user_ids + type: array + is_at_all: + title: is_at_all type: boolean - title: update_alert_messages_request - type: object - upload_file_request: + enable: + title: enable + type: boolean + required: + - at_user_ids + - enable + - is_at_all + - type + - webhook_url + title: CreateAlertReceiverRequest + x-body-name: create_alert_receiver_request + GetAlertReceiverResponse: + allOf: + - $ref: '#/components/schemas/CreateAlertReceiverRequest' + - properties: + id: + type: string + message: + description: Error message generated in server side + type: string + required: + - id + - message + type: object + example: + webhook_url: webhook_url + is_at_all: true + enable: true + at_user_ids: + - at_user_ids + - at_user_ids + id: id + type: webhook + message: message + title: GetAlertReceiverResponse + uploadFile_request: properties: filestorage: format: binary type: string type: object - Graph_stored_procedures: + ServiceStatus_sdk_endpoints: example: - directory: plugins + gremlin: gremlin + cypher: cypher + hqps: hqps + grpc: grpc properties: - directory: - enum: - - plugins - title: directory + cypher: + title: cypher + type: string + gremlin: + title: gremlin + type: string + hqps: + title: hqps + type: string + grpc: + title: grpc type: string - title: Graph_stored_procedures + title: ServiceStatus_sdk_endpoints + StringType_string: + oneOf: + - $ref: '#/components/schemas/LongText' + title: StringType_string + type: object + BaseVertexType_x_csr_params: + description: Used for storage optimization + example: + max_vertex_num: 0 + properties: + max_vertex_num: + title: max_vertex_num + type: integer + title: BaseVertexType_x_csr_params type: object - EdgeType_vertex_type_pair_relations_inner_x_csr_params: + BaseEdgeType_vertex_type_pair_relations_inner_x_csr_params: description: Used for storage optimization example: edge_storage_strategy: ONLY_IN @@ -3152,9 +3644,8 @@ components: - BOTH_OUT_IN title: edge_storage_strategy type: string - title: EdgeType_vertex_type_pair_relations_inner_x_csr_params - type: object - EdgeType_vertex_type_pair_relations_inner: + title: BaseEdgeType_vertex_type_pair_relations_inner_x_csr_params + BaseEdgeType_vertex_type_pair_relations_inner: example: source_vertex: source_vertex destination_vertex: destination_vertex @@ -3177,91 +3668,47 @@ components: title: relation type: string x_csr_params: - $ref: '#/components/schemas/EdgeType_vertex_type_pair_relations_inner_x_csr_params' - title: EdgeType_vertex_type_pair_relations_inner - type: object - Property_property_type: - example: - primitive_type: DT_DOUBLE - properties: - primitive_type: - enum: - - DT_DOUBLE - - DT_STRING - - DT_SIGNED_INT32 - - DT_SIGNED_INT64 - - DT_DATE32 - title: primitive_type - type: string - title: Property_property_type - type: object - Procedure_params_inner: - example: - name: name - type: type - properties: - name: - title: name - type: string - type: - title: type - type: string - title: Procedure_params_inner - type: object - DeploymentInfo_graphs_info_value: + $ref: '#/components/schemas/BaseEdgeType_vertex_type_pair_relations_inner_x_csr_params' + required: + - destination_vertex + - relation + - source_vertex + title: BaseEdgeType_vertex_type_pair_relations_inner + ColumnMapping_column: example: - creation_time: creation_time - update_time: update_time - last_dataloading_time: last_dataloading_time name: name + index: 0 properties: + index: + format: int32 + title: index + type: integer name: title: name type: string - creation_time: - title: creation_time - type: string - update_time: - title: update_time - type: string - last_dataloading_time: - title: last_dataloading_time - type: string - title: DeploymentInfo_graphs_info_value - type: object - ServiceStatus_sdk_endpoints: + title: ColumnMapping_column + EdgeMapping_type_triplet: + description: "source label -> [edge label] -> destination label" example: - gremlin: gremlin - cypher: cypher - hqps: hqps - grpc: grpc + edge: edge + source_vertex: source_vertex + destination_vertex: destination_vertex properties: - cypher: - title: cypher - type: string - gremlin: - title: gremlin - type: string - hqps: - title: hqps + edge: + title: edge type: string - grpc: - title: grpc + source_vertex: + title: source_vertex type: string - title: ServiceStatus_sdk_endpoints - type: object - SchemaMapping_loading_config_data_source: - example: - scheme: file - properties: - scheme: - enum: - - file - title: scheme + destination_vertex: + title: destination_vertex type: string - title: SchemaMapping_loading_config_data_source - type: object - SchemaMapping_loading_config_format: + required: + - destination_vertex + - edge + - source_vertex + title: EdgeMapping_type_triplet + DataloadingJobConfig_loading_config_format: example: metadata: key: "" @@ -3274,119 +3721,35 @@ components: additionalProperties: true title: metadata type: object - title: SchemaMapping_loading_config_format - type: object - SchemaMapping_loading_config: + title: DataloadingJobConfig_loading_config_format + DataloadingJobConfig_loading_config: example: format: metadata: key: "" type: type - import_option: init - data_source: - scheme: file + import_option: overwrite properties: - data_source: - $ref: '#/components/schemas/SchemaMapping_loading_config_data_source' import_option: enum: - init - overwrite + example: overwrite title: import_option type: string format: - $ref: '#/components/schemas/SchemaMapping_loading_config_format' - title: SchemaMapping_loading_config - type: object - EdgeMapping_type_triplet: - description: "source label -> [edge label] -> destination label" - example: - edge: edge - source_vertex: source_vertex - destination_vertex: destination_vertex - properties: - edge: - title: edge - type: string - source_vertex: - title: source_vertex - type: string - destination_vertex: - title: destination_vertex - type: string - title: EdgeMapping_type_triplet - type: object - EdgeMapping_source_vertex_mappings_inner_column: - example: - name: name - index: 0 - properties: - index: - format: int32 - title: index - type: integer - name: - title: name - type: string - title: EdgeMapping_source_vertex_mappings_inner_column - type: object - EdgeMapping_source_vertex_mappings_inner: - description: Mapping column index to the primary key of source vertex - example: - column: - name: name - index: 0 - properties: - column: - $ref: '#/components/schemas/EdgeMapping_source_vertex_mappings_inner_column' - title: EdgeMapping_source_vertex_mappings_inner - type: object - EdgeMapping_destination_vertex_mappings_inner: - description: Mapping column index to the primary key of destination vertex - example: - column: - name: name - index: 0 - properties: - column: - $ref: '#/components/schemas/EdgeMapping_source_vertex_mappings_inner_column' - title: EdgeMapping_destination_vertex_mappings_inner - type: object - GrootGraph_gremlin_interface: - example: - grpc_endpoint: grpc_endpoint - password: password - gremlin_endpoint: gremlin_endpoint - username: username - properties: - gremlin_endpoint: - title: gremlin_endpoint - type: string - grpc_endpoint: - title: grpc_endpoint - type: string - username: - title: username - type: string - password: - title: password - type: string - title: GrootGraph_gremlin_interface - type: object - GrootEdgeType_relations_inner: + $ref: '#/components/schemas/DataloadingJobConfig_loading_config_format' + title: DataloadingJobConfig_loading_config + DataloadingJobConfig_vertices_inner: example: - src_label: src_label - dst_label: dst_label + type_name: type_name properties: - src_label: - title: src_label - type: string - dst_label: - title: dst_label + type_name: + title: type_name type: string - title: GrootEdgeType_relations_inner + title: DataloadingJobConfig_vertices_inner type: object - GrootDataloadingJobConfig_edges_inner: + DataloadingJobConfig_edges_inner: example: type_name: type_name source_vertex: source_vertex @@ -3401,5 +3764,5 @@ components: destination_vertex: title: destination_vertex type: string - title: GrootDataloadingJobConfig_edges_inner + title: DataloadingJobConfig_edges_inner type: object diff --git a/flex/coordinator/gs_flex_coordinator/test/test_alert_controller.py b/flex/coordinator/gs_flex_coordinator/test/test_alert_controller.py index 99ccb9f5dc58..2cff1242d052 100644 --- a/flex/coordinator/gs_flex_coordinator/test/test_alert_controller.py +++ b/flex/coordinator/gs_flex_coordinator/test/test_alert_controller.py @@ -2,33 +2,57 @@ from flask import json -from gs_flex_coordinator.models.alert_message import AlertMessage # noqa: E501 -from gs_flex_coordinator.models.alert_receiver import AlertReceiver # noqa: E501 -from gs_flex_coordinator.models.alert_rule import AlertRule # noqa: E501 -from gs_flex_coordinator.models.update_alert_messages_request import UpdateAlertMessagesRequest # noqa: E501 +from gs_flex_coordinator.models.create_alert_receiver_request import CreateAlertReceiverRequest # noqa: E501 +from gs_flex_coordinator.models.create_alert_rule_request import CreateAlertRuleRequest # noqa: E501 +from gs_flex_coordinator.models.error import Error # noqa: E501 +from gs_flex_coordinator.models.get_alert_message_response import GetAlertMessageResponse # noqa: E501 +from gs_flex_coordinator.models.get_alert_receiver_response import GetAlertReceiverResponse # noqa: E501 +from gs_flex_coordinator.models.get_alert_rule_response import GetAlertRuleResponse # noqa: E501 +from gs_flex_coordinator.models.update_alert_message_status_request import UpdateAlertMessageStatusRequest # noqa: E501 from gs_flex_coordinator.test import BaseTestCase class TestAlertController(BaseTestCase): """AlertController integration test stubs""" - def test_delete_alert_rule(self): - """Test case for delete_alert_rule + def test_create_alert_receiver(self): + """Test case for create_alert_receiver """ + create_alert_receiver_request = {"webhook_url":"webhook_url","is_at_all":True,"enable":True,"at_user_ids":["at_user_ids","at_user_ids"],"type":"webhook"} headers = { 'Accept': 'application/json', + 'Content-Type': 'application/json', } response = self.client.open( - '/api/v1/alert/rule/{rule_name}'.format(rule_name='rule_name_example'), + '/api/v1/alert/receiver', + method='POST', + headers=headers, + data=json.dumps(create_alert_receiver_request), + content_type='application/json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_delete_alert_message_in_batch(self): + """Test case for delete_alert_message_in_batch + + + """ + query_string = [('message_ids', 'message_ids_example')] + headers = { + 'Accept': 'application/json', + } + response = self.client.open( + '/api/v1/alert/message-collection', method='DELETE', - headers=headers) + headers=headers, + query_string=query_string) self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) - def test_delete_receiverby_id(self): - """Test case for delete_receiverby_id + def test_delete_alert_receiver_by_id(self): + """Test case for delete_alert_receiver_by_id """ @@ -42,44 +66,45 @@ def test_delete_receiverby_id(self): self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) - def test_list_alert_messages(self): - """Test case for list_alert_messages + def test_delete_alert_rule_by_id(self): + """Test case for delete_alert_rule_by_id """ - query_string = [('type', 'type_example'), - ('status', 'status_example'), - ('severity', 'severity_example'), - ('start_time', 'start_time_example'), - ('end_time', 'end_time_example')] headers = { 'Accept': 'application/json', } response = self.client.open( - '/api/v1/alert/message', - method='GET', - headers=headers, - query_string=query_string) + '/api/v1/alert/rule/{rule_id}'.format(rule_id='rule_id_example'), + method='DELETE', + headers=headers) self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) - def test_list_alert_rules(self): - """Test case for list_alert_rules + def test_list_alert_messages(self): + """Test case for list_alert_messages """ + query_string = [('alert_type', 'alert_type_example'), + ('status', 'status_example'), + ('severity', 'severity_example'), + ('start_time', 'start_time_example'), + ('end_time', 'end_time_example'), + ('limit', 56)] headers = { 'Accept': 'application/json', } response = self.client.open( - '/api/v1/alert/rule', + '/api/v1/alert/message', method='GET', - headers=headers) + headers=headers, + query_string=query_string) self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) - def test_list_receivers(self): - """Test case for list_receivers + def test_list_alert_receivers(self): + """Test case for list_alert_receivers """ @@ -93,78 +118,74 @@ def test_list_receivers(self): self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) - def test_register_receiver(self): - """Test case for register_receiver + def test_list_alert_rules(self): + """Test case for list_alert_rules """ - alert_receiver = {"webhook_url":"webhook_url","is_at_all":True,"receiver_id":"receiver_id","enable":True,"at_user_ids":["at_user_ids","at_user_ids"],"type":"webhook","message":"message"} headers = { 'Accept': 'application/json', - 'Content-Type': 'application/json', } response = self.client.open( - '/api/v1/alert/receiver', - method='POST', - headers=headers, - data=json.dumps(alert_receiver), - content_type='application/json') + '/api/v1/alert/rule', + method='GET', + headers=headers) self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) - def test_update_alert_messages(self): - """Test case for update_alert_messages + def test_update_alert_message_in_batch(self): + """Test case for update_alert_message_in_batch """ - update_alert_messages_request = gs_flex_coordinator.UpdateAlertMessagesRequest() + update_alert_message_status_request = {"message_ids":["message_ids","message_ids"],"status":"unsolved"} headers = { 'Accept': 'application/json', 'Content-Type': 'application/json', } response = self.client.open( - '/api/v1/alert/message', + '/api/v1/alert/message-collection/status', method='PUT', headers=headers, - data=json.dumps(update_alert_messages_request), + data=json.dumps(update_alert_message_status_request), content_type='application/json') self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) - def test_update_alert_rule_by_name(self): - """Test case for update_alert_rule_by_name + def test_update_alert_receiver_by_id(self): + """Test case for update_alert_receiver_by_id """ - alert_rule = {"severity":"warning","conditions_description":"conditions_description","enable":True,"name":"name","metric_type":"node","frequency":0} + create_alert_receiver_request = {"webhook_url":"webhook_url","is_at_all":True,"enable":True,"at_user_ids":["at_user_ids","at_user_ids"],"type":"webhook"} headers = { 'Accept': 'application/json', 'Content-Type': 'application/json', } response = self.client.open( - '/api/v1/alert/rule/{rule_name}'.format(rule_name='rule_name_example'), + '/api/v1/alert/receiver/{receiver_id}'.format(receiver_id='receiver_id_example'), method='PUT', headers=headers, - data=json.dumps(alert_rule), + data=json.dumps(create_alert_receiver_request), content_type='application/json') self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) - def test_update_receiverby_id(self): - """Test case for update_receiverby_id + def test_update_alert_rule_by_id(self): + """Test case for update_alert_rule_by_id """ - alert_receiver = {"webhook_url":"webhook_url","is_at_all":True,"receiver_id":"receiver_id","enable":True,"at_user_ids":["at_user_ids","at_user_ids"],"type":"webhook","message":"message"} + create_alert_rule_request = {"severity":"warning","conditions_description":"conditions_description","enable":True,"name":"name","metric_type":"node","frequency":0} headers = { 'Accept': 'application/json', 'Content-Type': 'application/json', } response = self.client.open( - '/api/v1/alert/receiver/{receiver_id}'.format(receiver_id='receiver_id_example'), + '/api/v1/alert/rule/{rule_id}'.format(rule_id='rule_id_example'), method='PUT', headers=headers, - data=json.dumps(alert_receiver), + data=json.dumps(create_alert_rule_request), content_type='application/json') self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) diff --git a/flex/coordinator/gs_flex_coordinator/test/test_connection_controller.py b/flex/coordinator/gs_flex_coordinator/test/test_connection_controller.py deleted file mode 100644 index 949f2ac813d5..000000000000 --- a/flex/coordinator/gs_flex_coordinator/test/test_connection_controller.py +++ /dev/null @@ -1,49 +0,0 @@ -import unittest - -from flask import json - -from gs_flex_coordinator.models.connection import Connection # noqa: E501 -from gs_flex_coordinator.models.connection_status import ConnectionStatus # noqa: E501 -from gs_flex_coordinator.test import BaseTestCase - - -class TestConnectionController(BaseTestCase): - """ConnectionController integration test stubs""" - - def test_close(self): - """Test case for close - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/connection', - method='DELETE', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_connect(self): - """Test case for connect - - - """ - connection = {"coordinator_endpoint":"coordinator_endpoint"} - headers = { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - } - response = self.client.open( - '/api/v1/connection', - method='POST', - headers=headers, - data=json.dumps(connection), - content_type='application/json') - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - -if __name__ == '__main__': - unittest.main() diff --git a/flex/coordinator/gs_flex_coordinator/test/test_data_source_controller.py b/flex/coordinator/gs_flex_coordinator/test/test_data_source_controller.py new file mode 100644 index 000000000000..e0f9f936f0d3 --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/test/test_data_source_controller.py @@ -0,0 +1,82 @@ +import unittest + +from flask import json + +from gs_flex_coordinator.models.error import Error # noqa: E501 +from gs_flex_coordinator.models.schema_mapping import SchemaMapping # noqa: E501 +from gs_flex_coordinator.test import BaseTestCase + + +class TestDataSourceController(BaseTestCase): + """DataSourceController integration test stubs""" + + def test_bind_datasource_in_batch(self): + """Test case for bind_datasource_in_batch + + + """ + schema_mapping = {"edge_mappings":[{"inputs":["inputs","inputs"],"source_vertex_mappings":[{"column":{"name":"name","index":0},"property":"property"},{"column":{"name":"name","index":0},"property":"property"}],"destination_vertex_mappings":[{"column":{"name":"name","index":0},"property":"property"},{"column":{"name":"name","index":0},"property":"property"}],"column_mappings":[{"column":{"name":"name","index":0},"property":"property"},{"column":{"name":"name","index":0},"property":"property"}],"type_triplet":{"edge":"edge","source_vertex":"source_vertex","destination_vertex":"destination_vertex"}},{"inputs":["inputs","inputs"],"source_vertex_mappings":[{"column":{"name":"name","index":0},"property":"property"},{"column":{"name":"name","index":0},"property":"property"}],"destination_vertex_mappings":[{"column":{"name":"name","index":0},"property":"property"},{"column":{"name":"name","index":0},"property":"property"}],"column_mappings":[{"column":{"name":"name","index":0},"property":"property"},{"column":{"name":"name","index":0},"property":"property"}],"type_triplet":{"edge":"edge","source_vertex":"source_vertex","destination_vertex":"destination_vertex"}}],"vertex_mappings":[{"type_name":"type_name","inputs":["file:///path/to/file.csv","file:///path/to/file.csv"],"column_mappings":[{"column":{"name":"name","index":0},"property":"property"},{"column":{"name":"name","index":0},"property":"property"}]},{"type_name":"type_name","inputs":["file:///path/to/file.csv","file:///path/to/file.csv"],"column_mappings":[{"column":{"name":"name","index":0},"property":"property"},{"column":{"name":"name","index":0},"property":"property"}]}]} + headers = { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + } + response = self.client.open( + '/api/v1/graph/{graph_id}/datasource'.format(graph_id='graph_id_example'), + method='POST', + headers=headers, + data=json.dumps(schema_mapping), + content_type='application/json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_get_datasource_by_id(self): + """Test case for get_datasource_by_id + + + """ + headers = { + 'Accept': 'application/json', + } + response = self.client.open( + '/api/v1/graph/{graph_id}/datasource'.format(graph_id='graph_id_example'), + method='GET', + headers=headers) + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_unbind_edge_datasource(self): + """Test case for unbind_edge_datasource + + + """ + query_string = [('source_vertex_type', 'source_vertex_type_example'), + ('destination_vertex_type', 'destination_vertex_type_example')] + headers = { + 'Accept': 'application/json', + } + response = self.client.open( + '/api/v1/graph/{graph_id}/datasource/edge/{type_name}'.format(graph_id='graph_id_example', type_name='type_name_example'), + method='DELETE', + headers=headers, + query_string=query_string) + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_unbind_vertex_datasource(self): + """Test case for unbind_vertex_datasource + + + """ + headers = { + 'Accept': 'application/json', + } + response = self.client.open( + '/api/v1/graph/{graph_id}/datasource/vertex/{type_name}'.format(graph_id='graph_id_example', type_name='type_name_example'), + method='DELETE', + headers=headers) + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + +if __name__ == '__main__': + unittest.main() diff --git a/flex/coordinator/gs_flex_coordinator/test/test_datasource_controller.py b/flex/coordinator/gs_flex_coordinator/test/test_datasource_controller.py deleted file mode 100644 index 800687efa531..000000000000 --- a/flex/coordinator/gs_flex_coordinator/test/test_datasource_controller.py +++ /dev/null @@ -1,154 +0,0 @@ -import unittest - -from flask import json - -from gs_flex_coordinator.models.data_source import DataSource # noqa: E501 -from gs_flex_coordinator.models.edge_data_source import EdgeDataSource # noqa: E501 -from gs_flex_coordinator.models.vertex_data_source import VertexDataSource # noqa: E501 -from gs_flex_coordinator.test import BaseTestCase - - -class TestDatasourceController(BaseTestCase): - """DatasourceController integration test stubs""" - - def test_bind_edge_datasource(self): - """Test case for bind_edge_datasource - - - """ - edge_data_source = {"source_pk_column_map":{"key":""},"type_name":"type_name","destination_pk_column_map":{"key":""},"source_vertex":"source_vertex","destination_vertex":"destination_vertex","property_mapping":{"key":""},"location":"location","data_source":"ODPS"} - headers = { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - } - response = self.client.open( - '/api/v1/graph/{graph_name}/datasource/edge_datasource'.format(graph_name='graph_name_example'), - method='POST', - headers=headers, - data=json.dumps(edge_data_source), - content_type='application/json') - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_bind_vertex_datasource(self): - """Test case for bind_vertex_datasource - - - """ - vertex_data_source = {"type_name":"type_name","property_mapping":{"key":""},"location":"location","data_source":"ODPS"} - headers = { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - } - response = self.client.open( - '/api/v1/graph/{graph_name}/datasource/vertex_datasource'.format(graph_name='graph_name_example'), - method='POST', - headers=headers, - data=json.dumps(vertex_data_source), - content_type='application/json') - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_get_datasource(self): - """Test case for get_datasource - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/graph/{graph_name}/datasource'.format(graph_name='graph_name_example'), - method='GET', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_get_edge_datasource(self): - """Test case for get_edge_datasource - - - """ - query_string = [('source_vertex_type', 'source_vertex_type_example'), - ('destination_vertex_type', 'destination_vertex_type_example')] - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/graph/{graph_name}/datasource/edge_datasource/{type_name}'.format(graph_name='graph_name_example', type_name='type_name_example'), - method='GET', - headers=headers, - query_string=query_string) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_get_vertex_datasource(self): - """Test case for get_vertex_datasource - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/graph/{graph_name}/datasource/vertex_datasource/{type_name}'.format(graph_name='graph_name_example', type_name='type_name_example'), - method='GET', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_import_datasource(self): - """Test case for import_datasource - - - """ - data_source = {"edges_datasource":[{"source_pk_column_map":{"key":""},"type_name":"type_name","destination_pk_column_map":{"key":""},"source_vertex":"source_vertex","destination_vertex":"destination_vertex","property_mapping":{"key":""},"location":"location","data_source":"ODPS"},{"source_pk_column_map":{"key":""},"type_name":"type_name","destination_pk_column_map":{"key":""},"source_vertex":"source_vertex","destination_vertex":"destination_vertex","property_mapping":{"key":""},"location":"location","data_source":"ODPS"}],"vertices_datasource":[{"type_name":"type_name","property_mapping":{"key":""},"location":"location","data_source":"ODPS"},{"type_name":"type_name","property_mapping":{"key":""},"location":"location","data_source":"ODPS"}]} - headers = { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - } - response = self.client.open( - '/api/v1/graph/{graph_name}/datasource'.format(graph_name='graph_name_example'), - method='POST', - headers=headers, - data=json.dumps(data_source), - content_type='application/json') - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_unbind_edge_datasource(self): - """Test case for unbind_edge_datasource - - - """ - query_string = [('source_vertex_type', 'source_vertex_type_example'), - ('destination_vertex_type', 'destination_vertex_type_example')] - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/graph/{graph_name}/datasource/edge_datasource/{type_name}'.format(graph_name='graph_name_example', type_name='type_name_example'), - method='DELETE', - headers=headers, - query_string=query_string) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_unbind_vertex_datasource(self): - """Test case for unbind_vertex_datasource - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/graph/{graph_name}/datasource/vertex_datasource/{type_name}'.format(graph_name='graph_name_example', type_name='type_name_example'), - method='DELETE', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - -if __name__ == '__main__': - unittest.main() diff --git a/flex/coordinator/gs_flex_coordinator/test/test_deployment_controller.py b/flex/coordinator/gs_flex_coordinator/test/test_deployment_controller.py index 73a5f7f19f52..2e9b769c8441 100644 --- a/flex/coordinator/gs_flex_coordinator/test/test_deployment_controller.py +++ b/flex/coordinator/gs_flex_coordinator/test/test_deployment_controller.py @@ -2,8 +2,8 @@ from flask import json -from gs_flex_coordinator.models.deployment_info import DeploymentInfo # noqa: E501 -from gs_flex_coordinator.models.node_status import NodeStatus # noqa: E501 +from gs_flex_coordinator.models.error import Error # noqa: E501 +from gs_flex_coordinator.models.running_deployment_info import RunningDeploymentInfo # noqa: E501 from gs_flex_coordinator.test import BaseTestCase @@ -25,21 +25,6 @@ def test_get_deployment_info(self): self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) - def test_get_node_status(self): - """Test case for get_node_status - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/node/status', - method='GET', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - if __name__ == '__main__': unittest.main() diff --git a/flex/coordinator/gs_flex_coordinator/test/test_extension_controller.py b/flex/coordinator/gs_flex_coordinator/test/test_extension_controller.py deleted file mode 100644 index 69353a7fd8a9..000000000000 --- a/flex/coordinator/gs_flex_coordinator/test/test_extension_controller.py +++ /dev/null @@ -1,82 +0,0 @@ -import unittest - -from flask import json - -from gs_flex_coordinator.models.query_statement import QueryStatement # noqa: E501 -from gs_flex_coordinator.test import BaseTestCase - - -class TestExtensionController(BaseTestCase): - """ExtensionController integration test stubs""" - - def test_create_query_statements(self): - """Test case for create_query_statements - - - """ - query_statement = {"query":"query","name":"name","description":"description","statement_id":"statement_id"} - headers = { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - } - response = self.client.open( - '/api/v1/statement', - method='POST', - headers=headers, - data=json.dumps(query_statement), - content_type='application/json') - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_delete_queryby_name(self): - """Test case for delete_queryby_name - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/statement/{statement_id}'.format(statement_id='statement_id_example'), - method='DELETE', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_list_query_statement(self): - """Test case for list_query_statement - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/statement', - method='GET', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_update_query_statement_by_id(self): - """Test case for update_query_statement_by_id - - - """ - query_statement = {"query":"query","name":"name","description":"description","statement_id":"statement_id"} - headers = { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - } - response = self.client.open( - '/api/v1/statement/{statement_id}'.format(statement_id='statement_id_example'), - method='PUT', - headers=headers, - data=json.dumps(query_statement), - content_type='application/json') - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - -if __name__ == '__main__': - unittest.main() diff --git a/flex/coordinator/gs_flex_coordinator/test/test_graph_controller.py b/flex/coordinator/gs_flex_coordinator/test/test_graph_controller.py index e21b88e26140..72e904cde095 100644 --- a/flex/coordinator/gs_flex_coordinator/test/test_graph_controller.py +++ b/flex/coordinator/gs_flex_coordinator/test/test_graph_controller.py @@ -2,10 +2,14 @@ from flask import json -from gs_flex_coordinator.models.edge_type import EdgeType # noqa: E501 -from gs_flex_coordinator.models.graph import Graph # noqa: E501 -from gs_flex_coordinator.models.model_schema import ModelSchema # noqa: E501 -from gs_flex_coordinator.models.vertex_type import VertexType # noqa: E501 +from gs_flex_coordinator.models.create_edge_type import CreateEdgeType # noqa: E501 +from gs_flex_coordinator.models.create_graph_request import CreateGraphRequest # noqa: E501 +from gs_flex_coordinator.models.create_graph_response import CreateGraphResponse # noqa: E501 +from gs_flex_coordinator.models.create_graph_schema_request import CreateGraphSchemaRequest # noqa: E501 +from gs_flex_coordinator.models.create_vertex_type import CreateVertexType # noqa: E501 +from gs_flex_coordinator.models.error import Error # noqa: E501 +from gs_flex_coordinator.models.get_graph_response import GetGraphResponse # noqa: E501 +from gs_flex_coordinator.models.get_graph_schema_response import GetGraphSchemaResponse # noqa: E501 from gs_flex_coordinator.test import BaseTestCase @@ -17,16 +21,16 @@ def test_create_edge_type(self): """ - edge_type = {"type_name":"type_name","type_id":1,"vertex_type_pair_relations":[{"source_vertex":"source_vertex","destination_vertex":"destination_vertex","x_csr_params":{"edge_storage_strategy":"ONLY_IN"},"relation":"MANY_TO_MANY"},{"source_vertex":"source_vertex","destination_vertex":"destination_vertex","x_csr_params":{"edge_storage_strategy":"ONLY_IN"},"relation":"MANY_TO_MANY"}],"properties":[{"property_type":{"primitive_type":"DT_DOUBLE"},"property_id":6,"property_name":"property_name"},{"property_type":{"primitive_type":"DT_DOUBLE"},"property_id":6,"property_name":"property_name"}]} + create_edge_type = {"type_name":"type_name","directed":True,"primary_keys":["primary_keys","primary_keys"],"vertex_type_pair_relations":[{"source_vertex":"source_vertex","destination_vertex":"destination_vertex","x_csr_params":{"edge_storage_strategy":"ONLY_IN"},"relation":"MANY_TO_MANY"},{"source_vertex":"source_vertex","destination_vertex":"destination_vertex","x_csr_params":{"edge_storage_strategy":"ONLY_IN"},"relation":"MANY_TO_MANY"}],"description":"description","properties":[{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"},{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"}]} headers = { 'Accept': 'application/json', 'Content-Type': 'application/json', } response = self.client.open( - '/api/v1/graph/{graph_name}/schema/edge_type'.format(graph_name='graph_name_example'), + '/api/v1/graph/{graph_id}/schema/edge'.format(graph_id='graph_id_example'), method='POST', headers=headers, - data=json.dumps(edge_type), + data=json.dumps(create_edge_type), content_type='application/json') self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) @@ -36,7 +40,7 @@ def test_create_graph(self): """ - graph = {"schema":{"vertex_types":[{"type_name":"type_name","primary_keys":["primary_keys","primary_keys"],"type_id":0,"properties":[{"property_type":{"primitive_type":"DT_DOUBLE"},"property_id":6,"property_name":"property_name"},{"property_type":{"primitive_type":"DT_DOUBLE"},"property_id":6,"property_name":"property_name"}]},{"type_name":"type_name","primary_keys":["primary_keys","primary_keys"],"type_id":0,"properties":[{"property_type":{"primitive_type":"DT_DOUBLE"},"property_id":6,"property_name":"property_name"},{"property_type":{"primitive_type":"DT_DOUBLE"},"property_id":6,"property_name":"property_name"}]}],"edge_types":[{"type_name":"type_name","type_id":1,"vertex_type_pair_relations":[{"source_vertex":"source_vertex","destination_vertex":"destination_vertex","x_csr_params":{"edge_storage_strategy":"ONLY_IN"},"relation":"MANY_TO_MANY"},{"source_vertex":"source_vertex","destination_vertex":"destination_vertex","x_csr_params":{"edge_storage_strategy":"ONLY_IN"},"relation":"MANY_TO_MANY"}],"properties":[{"property_type":{"primitive_type":"DT_DOUBLE"},"property_id":6,"property_name":"property_name"},{"property_type":{"primitive_type":"DT_DOUBLE"},"property_id":6,"property_name":"property_name"}]},{"type_name":"type_name","type_id":1,"vertex_type_pair_relations":[{"source_vertex":"source_vertex","destination_vertex":"destination_vertex","x_csr_params":{"edge_storage_strategy":"ONLY_IN"},"relation":"MANY_TO_MANY"},{"source_vertex":"source_vertex","destination_vertex":"destination_vertex","x_csr_params":{"edge_storage_strategy":"ONLY_IN"},"relation":"MANY_TO_MANY"}],"properties":[{"property_type":{"primitive_type":"DT_DOUBLE"},"property_id":6,"property_name":"property_name"},{"property_type":{"primitive_type":"DT_DOUBLE"},"property_id":6,"property_name":"property_name"}]}]},"stored_procedures":{"directory":"plugins"},"name":"name","store_type":"mutable_csr"} + create_graph_request = {"schema":{"vertex_types":[{"type_name":"type_name","primary_keys":["primary_keys","primary_keys"],"x_csr_params":{"max_vertex_num":0},"description":"description","properties":[{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"},{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"}]},{"type_name":"type_name","primary_keys":["primary_keys","primary_keys"],"x_csr_params":{"max_vertex_num":0},"description":"description","properties":[{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"},{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"}]}],"edge_types":[{"type_name":"type_name","directed":True,"primary_keys":["primary_keys","primary_keys"],"vertex_type_pair_relations":[{"source_vertex":"source_vertex","destination_vertex":"destination_vertex","x_csr_params":{"edge_storage_strategy":"ONLY_IN"},"relation":"MANY_TO_MANY"},{"source_vertex":"source_vertex","destination_vertex":"destination_vertex","x_csr_params":{"edge_storage_strategy":"ONLY_IN"},"relation":"MANY_TO_MANY"}],"description":"description","properties":[{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"},{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"}]},{"type_name":"type_name","directed":True,"primary_keys":["primary_keys","primary_keys"],"vertex_type_pair_relations":[{"source_vertex":"source_vertex","destination_vertex":"destination_vertex","x_csr_params":{"edge_storage_strategy":"ONLY_IN"},"relation":"MANY_TO_MANY"},{"source_vertex":"source_vertex","destination_vertex":"destination_vertex","x_csr_params":{"edge_storage_strategy":"ONLY_IN"},"relation":"MANY_TO_MANY"}],"description":"description","properties":[{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"},{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"}]}]},"stored_procedures":[{"query":"query","name":"name","description":"description","type":"cpp"},{"query":"query","name":"name","description":"description","type":"cpp"}],"name":"name","description":"description"} headers = { 'Accept': 'application/json', 'Content-Type': 'application/json', @@ -45,7 +49,7 @@ def test_create_graph(self): '/api/v1/graph', method='POST', headers=headers, - data=json.dumps(graph), + data=json.dumps(create_graph_request), content_type='application/json') self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) @@ -55,22 +59,22 @@ def test_create_vertex_type(self): """ - vertex_type = {"type_name":"type_name","primary_keys":["primary_keys","primary_keys"],"type_id":0,"properties":[{"property_type":{"primitive_type":"DT_DOUBLE"},"property_id":6,"property_name":"property_name"},{"property_type":{"primitive_type":"DT_DOUBLE"},"property_id":6,"property_name":"property_name"}]} + create_vertex_type = {"type_name":"type_name","primary_keys":["primary_keys","primary_keys"],"x_csr_params":{"max_vertex_num":0},"description":"description","properties":[{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"},{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"}]} headers = { 'Accept': 'application/json', 'Content-Type': 'application/json', } response = self.client.open( - '/api/v1/graph/{graph_name}/schema/vertex_type'.format(graph_name='graph_name_example'), + '/api/v1/graph/{graph_id}/schema/vertex'.format(graph_id='graph_id_example'), method='POST', headers=headers, - data=json.dumps(vertex_type), + data=json.dumps(create_vertex_type), content_type='application/json') self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) - def test_delete_edge_type(self): - """Test case for delete_edge_type + def test_delete_edge_type_by_name(self): + """Test case for delete_edge_type_by_name """ @@ -80,15 +84,15 @@ def test_delete_edge_type(self): 'Accept': 'application/json', } response = self.client.open( - '/api/v1/graph/{graph_name}/schema/edge_edge/{type_name}'.format(graph_name='graph_name_example', type_name='type_name_example'), + '/api/v1/graph/{graph_id}/schema/edge/{type_name}'.format(graph_id='graph_id_example', type_name='type_name_example'), method='DELETE', headers=headers, query_string=query_string) self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) - def test_delete_graph(self): - """Test case for delete_graph + def test_delete_graph_by_id(self): + """Test case for delete_graph_by_id """ @@ -96,14 +100,14 @@ def test_delete_graph(self): 'Accept': 'application/json', } response = self.client.open( - '/api/v1/graph/{graph_name}'.format(graph_name='graph_name_example'), + '/api/v1/graph/{graph_id}'.format(graph_id='graph_id_example'), method='DELETE', headers=headers) self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) - def test_delete_vertex_type(self): - """Test case for delete_vertex_type + def test_delete_vertex_type_by_name(self): + """Test case for delete_vertex_type_by_name """ @@ -111,14 +115,14 @@ def test_delete_vertex_type(self): 'Accept': 'application/json', } response = self.client.open( - '/api/v1/graph/{graph_name}/schema/vertex_type/{type_name}'.format(graph_name='graph_name_example', type_name='type_name_example'), + '/api/v1/graph/{graph_id}/schema/vertex/{type_name}'.format(graph_id='graph_id_example', type_name='type_name_example'), method='DELETE', headers=headers) self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) - def test_get_schema(self): - """Test case for get_schema + def test_get_graph_by_id(self): + """Test case for get_graph_by_id """ @@ -126,12 +130,46 @@ def test_get_schema(self): 'Accept': 'application/json', } response = self.client.open( - '/api/v1/graph/{graph_name}/schema'.format(graph_name='graph_name_example'), + '/api/v1/graph/{graph_id}'.format(graph_id='graph_id_example'), method='GET', headers=headers) self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) + def test_get_schema_by_id(self): + """Test case for get_schema_by_id + + + """ + headers = { + 'Accept': 'application/json', + } + response = self.client.open( + '/api/v1/graph/{graph_id}/schema'.format(graph_id='graph_id_example'), + method='GET', + headers=headers) + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_import_schema_by_id(self): + """Test case for import_schema_by_id + + + """ + create_graph_schema_request = {"vertex_types":[{"type_name":"type_name","primary_keys":["primary_keys","primary_keys"],"x_csr_params":{"max_vertex_num":0},"description":"description","properties":[{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"},{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"}]},{"type_name":"type_name","primary_keys":["primary_keys","primary_keys"],"x_csr_params":{"max_vertex_num":0},"description":"description","properties":[{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"},{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"}]}],"edge_types":[{"type_name":"type_name","directed":True,"primary_keys":["primary_keys","primary_keys"],"vertex_type_pair_relations":[{"source_vertex":"source_vertex","destination_vertex":"destination_vertex","x_csr_params":{"edge_storage_strategy":"ONLY_IN"},"relation":"MANY_TO_MANY"},{"source_vertex":"source_vertex","destination_vertex":"destination_vertex","x_csr_params":{"edge_storage_strategy":"ONLY_IN"},"relation":"MANY_TO_MANY"}],"description":"description","properties":[{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"},{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"}]},{"type_name":"type_name","directed":True,"primary_keys":["primary_keys","primary_keys"],"vertex_type_pair_relations":[{"source_vertex":"source_vertex","destination_vertex":"destination_vertex","x_csr_params":{"edge_storage_strategy":"ONLY_IN"},"relation":"MANY_TO_MANY"},{"source_vertex":"source_vertex","destination_vertex":"destination_vertex","x_csr_params":{"edge_storage_strategy":"ONLY_IN"},"relation":"MANY_TO_MANY"}],"description":"description","properties":[{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"},{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"}]}]} + headers = { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + } + response = self.client.open( + '/api/v1/graph/{graph_id}/schema'.format(graph_id='graph_id_example'), + method='POST', + headers=headers, + data=json.dumps(create_graph_schema_request), + content_type='application/json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + def test_list_graphs(self): """Test case for list_graphs diff --git a/flex/coordinator/gs_flex_coordinator/test/test_job_controller.py b/flex/coordinator/gs_flex_coordinator/test/test_job_controller.py index 1cbd07019ce7..23e7be21e1ac 100644 --- a/flex/coordinator/gs_flex_coordinator/test/test_job_controller.py +++ b/flex/coordinator/gs_flex_coordinator/test/test_job_controller.py @@ -2,36 +2,33 @@ from flask import json -from gs_flex_coordinator.models.job_response import JobResponse # noqa: E501 +from gs_flex_coordinator.models.create_dataloading_job_response import CreateDataloadingJobResponse # noqa: E501 +from gs_flex_coordinator.models.dataloading_job_config import DataloadingJobConfig # noqa: E501 +from gs_flex_coordinator.models.error import Error # noqa: E501 from gs_flex_coordinator.models.job_status import JobStatus # noqa: E501 -from gs_flex_coordinator.models.schema_mapping import SchemaMapping # noqa: E501 from gs_flex_coordinator.test import BaseTestCase class TestJobController(BaseTestCase): """JobController integration test stubs""" - def test_create_dataloading_job(self): - """Test case for create_dataloading_job + def test_delete_job_by_id(self): + """Test case for delete_job_by_id """ - schema_mapping = {"loading_config":{"format":{"metadata":{"key":""},"type":"type"},"import_option":"init","data_source":{"scheme":"file"}},"edge_mappings":[{"inputs":["inputs","inputs"],"source_vertex_mappings":[{"column":{"name":"name","index":0}},{"column":{"name":"name","index":0}}],"destination_vertex_mappings":[{"column":{"name":"name","index":0}},{"column":{"name":"name","index":0}}],"column_mappings":[{"column":{"name":"name","index":0},"property":"property"},{"column":{"name":"name","index":0},"property":"property"}],"type_triplet":{"edge":"edge","source_vertex":"source_vertex","destination_vertex":"destination_vertex"}},{"inputs":["inputs","inputs"],"source_vertex_mappings":[{"column":{"name":"name","index":0}},{"column":{"name":"name","index":0}}],"destination_vertex_mappings":[{"column":{"name":"name","index":0}},{"column":{"name":"name","index":0}}],"column_mappings":[{"column":{"name":"name","index":0},"property":"property"},{"column":{"name":"name","index":0},"property":"property"}],"type_triplet":{"edge":"edge","source_vertex":"source_vertex","destination_vertex":"destination_vertex"}}],"graph":"graph","vertex_mappings":[{"type_name":"type_name","inputs":["inputs","inputs"],"column_mappings":[{"column":{"name":"name","index":0},"property":"property"},{"column":{"name":"name","index":0},"property":"property"}]},{"type_name":"type_name","inputs":["inputs","inputs"],"column_mappings":[{"column":{"name":"name","index":0},"property":"property"},{"column":{"name":"name","index":0},"property":"property"}]}]} headers = { 'Accept': 'application/json', - 'Content-Type': 'application/json', } response = self.client.open( - '/api/v1/graph/{graph_name}/dataloading'.format(graph_name='graph_name_example'), - method='POST', - headers=headers, - data=json.dumps(schema_mapping), - content_type='application/json') + '/ap1/v1/job/{job_id}'.format(job_id='job_id_example'), + method='DELETE', + headers=headers) self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) - def test_delete_job_by_id(self): - """Test case for delete_job_by_id + def test_get_dataloading_job_config(self): + """Test case for get_dataloading_job_config """ @@ -39,8 +36,8 @@ def test_delete_job_by_id(self): 'Accept': 'application/json', } response = self.client.open( - '/api/v1/job/{job_id}'.format(job_id='job_id_example'), - method='DELETE', + '/api/v1/graph/{graph_id}/dataloading/config'.format(graph_id='graph_id_example'), + method='GET', headers=headers) self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) @@ -54,7 +51,7 @@ def test_get_job_by_id(self): 'Accept': 'application/json', } response = self.client.open( - '/api/v1/job/{job_id}'.format(job_id='job_id_example'), + '/ap1/v1/job/{job_id}'.format(job_id='job_id_example'), method='GET', headers=headers) self.assert200(response, @@ -75,6 +72,25 @@ def test_list_jobs(self): self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) + def test_submit_dataloading_job(self): + """Test case for submit_dataloading_job + + + """ + dataloading_job_config = {"schedule":"schedule","loading_config":{"format":{"metadata":{"key":""},"type":"type"},"import_option":"overwrite"},"vertices":[{"type_name":"type_name"},{"type_name":"type_name"}],"repeat":"once","edges":[{"type_name":"type_name","source_vertex":"source_vertex","destination_vertex":"destination_vertex"},{"type_name":"type_name","source_vertex":"source_vertex","destination_vertex":"destination_vertex"}]} + headers = { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + } + response = self.client.open( + '/api/v1/graph/{graph_id}/dataloading'.format(graph_id='graph_id_example'), + method='POST', + headers=headers, + data=json.dumps(dataloading_job_config), + content_type='application/json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + if __name__ == '__main__': unittest.main() diff --git a/flex/coordinator/gs_flex_coordinator/test/test_legacy_controller.py b/flex/coordinator/gs_flex_coordinator/test/test_legacy_controller.py deleted file mode 100644 index 22439ac340ed..000000000000 --- a/flex/coordinator/gs_flex_coordinator/test/test_legacy_controller.py +++ /dev/null @@ -1,64 +0,0 @@ -import unittest - -from flask import json - -from gs_flex_coordinator.models.groot_graph import GrootGraph # noqa: E501 -from gs_flex_coordinator.models.groot_schema import GrootSchema # noqa: E501 -from gs_flex_coordinator.test import BaseTestCase - - -class TestLegacyController(BaseTestCase): - """LegacyController integration test stubs""" - - def test_get_groot_schema(self): - """Test case for get_groot_schema - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/groot/graph/{graph_name}/schema'.format(graph_name='graph_name_example'), - method='GET', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_import_schema(self): - """Test case for import_schema - - - """ - groot_schema = {"vertices":[{"label":"label","properties":[{"is_primary_key":True,"name":"name","id":0,"type":"STRING"},{"is_primary_key":True,"name":"name","id":0,"type":"STRING"}]},{"label":"label","properties":[{"is_primary_key":True,"name":"name","id":0,"type":"STRING"},{"is_primary_key":True,"name":"name","id":0,"type":"STRING"}]}],"edges":[{"label":"label","relations":[{"src_label":"src_label","dst_label":"dst_label"},{"src_label":"src_label","dst_label":"dst_label"}],"properties":[{"is_primary_key":True,"name":"name","id":0,"type":"STRING"},{"is_primary_key":True,"name":"name","id":0,"type":"STRING"}]},{"label":"label","relations":[{"src_label":"src_label","dst_label":"dst_label"},{"src_label":"src_label","dst_label":"dst_label"}],"properties":[{"is_primary_key":True,"name":"name","id":0,"type":"STRING"},{"is_primary_key":True,"name":"name","id":0,"type":"STRING"}]}]} - headers = { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - } - response = self.client.open( - '/api/v1/groot/graph/{graph_name}/schema'.format(graph_name='graph_name_example'), - method='POST', - headers=headers, - data=json.dumps(groot_schema), - content_type='application/json') - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_list_groot_graph(self): - """Test case for list_groot_graph - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/groot/graph', - method='GET', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - -if __name__ == '__main__': - unittest.main() diff --git a/flex/coordinator/gs_flex_coordinator/test/test_procedure_controller.py b/flex/coordinator/gs_flex_coordinator/test/test_procedure_controller.py index 738c353e5168..4121510f4801 100644 --- a/flex/coordinator/gs_flex_coordinator/test/test_procedure_controller.py +++ b/flex/coordinator/gs_flex_coordinator/test/test_procedure_controller.py @@ -2,7 +2,11 @@ from flask import json -from gs_flex_coordinator.models.procedure import Procedure # noqa: E501 +from gs_flex_coordinator.models.create_procedure_request import CreateProcedureRequest # noqa: E501 +from gs_flex_coordinator.models.create_procedure_response import CreateProcedureResponse # noqa: E501 +from gs_flex_coordinator.models.error import Error # noqa: E501 +from gs_flex_coordinator.models.get_procedure_response import GetProcedureResponse # noqa: E501 +from gs_flex_coordinator.models.update_procedure_request import UpdateProcedureRequest # noqa: E501 from gs_flex_coordinator.test import BaseTestCase @@ -14,22 +18,22 @@ def test_create_procedure(self): """ - procedure = {"bound_graph":"bound_graph","enable":True,"query":"query","name":"name","description":"description","returns":[{"name":"name","type":"type"},{"name":"name","type":"type"}],"type":"cpp","params":[{"name":"name","type":"type"},{"name":"name","type":"type"}]} + create_procedure_request = {"query":"query","name":"name","description":"description","type":"cpp"} headers = { 'Accept': 'application/json', 'Content-Type': 'application/json', } response = self.client.open( - '/api/v1/graph/{graph_name}/procedure'.format(graph_name='graph_name_example'), + '/v1/graph/{graph_id}/procedure'.format(graph_id='graph_id_example'), method='POST', headers=headers, - data=json.dumps(procedure), + data=json.dumps(create_procedure_request), content_type='application/json') self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) - def test_delete_procedure(self): - """Test case for delete_procedure + def test_delete_procedure_by_id(self): + """Test case for delete_procedure_by_id """ @@ -37,14 +41,14 @@ def test_delete_procedure(self): 'Accept': 'application/json', } response = self.client.open( - '/api/v1/graph/{graph_name}/procedure/{procedure_name}'.format(graph_name='graph_name_example', procedure_name='procedure_name_example'), + '/v1/graph/{graph_id}/procedure/{procedure_id}'.format(graph_id='graph_id_example', procedure_id='procedure_id_example'), method='DELETE', headers=headers) self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) - def test_list_procedures(self): - """Test case for list_procedures + def test_get_procedure_by_id(self): + """Test case for get_procedure_by_id """ @@ -52,14 +56,14 @@ def test_list_procedures(self): 'Accept': 'application/json', } response = self.client.open( - '/api/v1/procedure', + '/v1/graph/{graph_id}/procedure/{procedure_id}'.format(graph_id='graph_id_example', procedure_id='procedure_id_example'), method='GET', headers=headers) self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) - def test_list_procedures_in_graph(self): - """Test case for list_procedures_in_graph + def test_list_procedures(self): + """Test case for list_procedures """ @@ -67,27 +71,27 @@ def test_list_procedures_in_graph(self): 'Accept': 'application/json', } response = self.client.open( - '/api/v1/graph/{graph_name}/procedure'.format(graph_name='graph_name_example'), + '/v1/graph/{graph_id}/procedure'.format(graph_id='graph_id_example'), method='GET', headers=headers) self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) - def test_update_procedure(self): - """Test case for update_procedure + def test_update_procedure_by_id(self): + """Test case for update_procedure_by_id """ - procedure = {"bound_graph":"bound_graph","enable":True,"query":"query","name":"name","description":"description","returns":[{"name":"name","type":"type"},{"name":"name","type":"type"}],"type":"cpp","params":[{"name":"name","type":"type"},{"name":"name","type":"type"}]} + update_procedure_request = {"description":"description"} headers = { 'Accept': 'application/json', 'Content-Type': 'application/json', } response = self.client.open( - '/api/v1/graph/{graph_name}/procedure/{procedure_name}'.format(graph_name='graph_name_example', procedure_name='procedure_name_example'), + '/v1/graph/{graph_id}/procedure/{procedure_id}'.format(graph_id='graph_id_example', procedure_id='procedure_id_example'), method='PUT', headers=headers, - data=json.dumps(procedure), + data=json.dumps(update_procedure_request), content_type='application/json') self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) diff --git a/flex/coordinator/gs_flex_coordinator/test/test_service_controller.py b/flex/coordinator/gs_flex_coordinator/test/test_service_controller.py index c0b1441f373c..c92cda14693e 100644 --- a/flex/coordinator/gs_flex_coordinator/test/test_service_controller.py +++ b/flex/coordinator/gs_flex_coordinator/test/test_service_controller.py @@ -2,6 +2,7 @@ from flask import json +from gs_flex_coordinator.models.error import Error # noqa: E501 from gs_flex_coordinator.models.service_status import ServiceStatus # noqa: E501 from gs_flex_coordinator.models.start_service_request import StartServiceRequest # noqa: E501 from gs_flex_coordinator.test import BaseTestCase @@ -45,7 +46,7 @@ def test_start_service(self): """ - start_service_request = gs_flex_coordinator.StartServiceRequest() + start_service_request = {"graph_id":"graph_id"} headers = { 'Accept': 'application/json', 'Content-Type': 'application/json', diff --git a/flex/coordinator/gs_flex_coordinator/test/test_utils_controller.py b/flex/coordinator/gs_flex_coordinator/test/test_utils_controller.py index 783a4d2810a1..f48c9bff8701 100644 --- a/flex/coordinator/gs_flex_coordinator/test/test_utils_controller.py +++ b/flex/coordinator/gs_flex_coordinator/test/test_utils_controller.py @@ -2,29 +2,31 @@ from flask import json +from gs_flex_coordinator.models.error import Error # noqa: E501 +from gs_flex_coordinator.models.upload_file_response import UploadFileResponse # noqa: E501 from gs_flex_coordinator.test import BaseTestCase class TestUtilsController(BaseTestCase): """UtilsController integration test stubs""" - @unittest.skip("application/octet-stream not supported by Connexion") + @unittest.skip("multipart/form-data not supported by Connexion") def test_upload_file(self): """Test case for upload_file """ - body = '/path/to/file' headers = { 'Accept': 'application/json', - 'Content-Type': 'application/octet-stream', + 'Content-Type': 'multipart/form-data', } + data = dict(filestorage='/path/to/file') response = self.client.open( '/api/v1/file/uploading', method='POST', headers=headers, - data=json.dumps(body), - content_type='application/octet-stream') + data=data, + content_type='multipart/form-data') self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) diff --git a/flex/coordinator/setup.py b/flex/coordinator/setup.py index 48beab34fd92..54df7584d2d9 100644 --- a/flex/coordinator/setup.py +++ b/flex/coordinator/setup.py @@ -73,53 +73,6 @@ def run(self): ) -class GenerateInteractiveSDK(Command): - description = "generate interactive client sdk from openapi specification file" - user_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - # remove - tempdir = os.path.join("/", tempfile.gettempprefix(), "flex_interactive") - if os.path.exists(tempdir): - shutil.rmtree(tempdir) - targetdir = os.path.join( - pkg_root, "gs_flex_coordinator", "core", "interactive", "hqps_client" - ) - if os.path.exists(targetdir): - shutil.rmtree(targetdir) - # generate - specification = os.path.join( - pkg_root, "..", "openapi", "openapi_interactive.yaml" - ) - cmd = [ - "openapi-generator-cli", - "generate", - "-g", - "python", - "-i", - str(specification), - "-o", - str(tempdir), - "--package-name", - "hqps_client", - ] - print(" ".join(cmd)) - env = os.environ.copy() - env["OPENAPI_GENERATOR_VERSION"] = "7.3.0" - subprocess.check_call( - cmd, - env=env, - ) - # cp - subprocess.run(["cp", "-r", os.path.join(tempdir, "hqps_client"), targetdir]) - - setup( name=NAME, version=VERSION, @@ -132,7 +85,6 @@ def run(self): package_data={"": ["openapi/openapi.yaml", "VERSION"]}, cmdclass={ "generate_flex_server": GenerateFlexServer, - "generate_interactive_sdk": GenerateInteractiveSDK, }, include_package_data=True, entry_points={ diff --git a/flex/openapi/openapi_coordinator.yaml b/flex/openapi/openapi_coordinator.yaml index 0513ffabb3cd..eda59ec3d48e 100644 --- a/flex/openapi/openapi_coordinator.yaml +++ b/flex/openapi/openapi_coordinator.yaml @@ -1,4 +1,5 @@ openapi: 3.0.3 + info: title: GraphScope FLEX HTTP SERVICE API description: |- @@ -14,504 +15,1064 @@ info: license: name: Apache 2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html - version: 0.9.1 + version: 1.0.0 + externalDocs: description: Find out More about GraphScope url: http://graphscope.io -paths: - /api/v1/connection: - post: - tags: - - connection - description: Connect to coordinator service - operationId: connect - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Connection' - required: true - responses: - '200': - description: Connect coordinator service successfully - content: - application/json: - schema: - $ref: '#/components/schemas/ConnectionStatus' - delete: - tags: - - connection - description: Close the connection with coordinator - operationId: close - responses: - '200': - description: Close connection successfully - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - /api/v1/graph: - post: - tags: - - graph - description: Create a new graph - operationId: create_graph - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Graph' - required: true - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - get: - tags: - - graph - description: List all graphs - operationId: list_graphs - responses: - '200': - description: Successful operation - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Graph' - example: - - name: demo - store_type: mutable_csr - stored_procedures: - directory: plugins - schema: - vertex_types: - - type_id: 0 - type_name: person - properties: - - property_id: 0 - property_name: id - property_type: - primitive_type: DT_STRING - - property_id: 1 - property_name: name - property_type: - primitive_type: DT_STRING - primary_keys: - - id - - type_id: 1 - type_name: software - properties: - - property_id: 0 - property_name: id - property_type: - primitive_type: DT_STRING - - property_id: 1 - property_name: name - property_type: - primitive_type: DT_STRING - primary_keys: - - id - edge_types: - - type_id: 0 - type_name: knows - vertex_type_pair_relations: - - source_vertex: person - destination_vertex: person - relation: MANY_TO_MANY - x_csr_params: - edge_storage_strategy: ONLY_IN - properties: - - property_id: 0 - property_name: weight - property_type: - primitive_type: DT_STRING - - type_id: 1 - type_name: created - vertex_type_pair_relations: - - source_vertex: person - destination_vertex: software - relation: MANY_TO_MANY - x_csr_params: - edge_storage_strategy: ONLY_IN - properties: - - property_id: 0 - property_name: weight - property_type: - primitive_type: DT_STRING - /api/v1/graph/{graph_name}: - delete: - tags: - - graph - description: Delete a graph by name - operationId: delete_graph - parameters: - - name: graph_name - in: path - required: true - schema: - type: string - responses: - '200': - description: Successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - /api/v1/graph/{graph_name}/schema: - get: - tags: - - graph - description: Get graph schema by name - operationId: get_schema - parameters: - - name: graph_name - in: path - required: true - schema: - type: string - responses: - '200': - description: Successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/Schema' - example: - vertex_types: - - type_id: 0 - type_name: person - properties: - - property_id: 0 - property_name: id - property_type: - primitive_type: DT_STRING - - property_id: 1 - property_name: name - property_type: - primitive_type: DT_STRING - primary_keys: - - id - - type_id: 1 - type_name: software - properties: - - property_id: 0 - property_name: id - property_type: - primitive_type: DT_STRING - - property_id: 1 - property_name: name - property_type: - primitive_type: DT_STRING - primary_keys: - - id - edge_types: - - type_id: 0 - type_name: knows - vertex_type_pair_relations: - - source_vertex: person - destination_vertex: person - relation: MANY_TO_MANY - x_csr_params: - edge_storage_strategy: ONLY_IN - properties: - - property_id: 0 - property_name: weight - property_type: - primitive_type: DT_STRING - - type_id: 1 - type_name: created - vertex_type_pair_relations: - - source_vertex: person - destination_vertex: software - relation: MANY_TO_MANY - x_csr_params: - edge_storage_strategy: ONLY_IN - properties: - - property_id: 0 - property_name: weight - property_type: - primitive_type: DT_STRING - /api/v1/graph/{graph_name}/schema/vertex_type: - post: - tags: - - graph - description: Create a vertex type - operationId: create_vertex_type - parameters: - - name: graph_name - in: path - required: true + +components: + responses: + 400: + description: Bad request + content: + application/json: schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/VertexType' - required: true - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - /api/v1/graph/{graph_name}/schema/vertex_type/{type_name}: - delete: - tags: - - graph - description: Delete a vertex type by name - operationId: delete_vertex_type - parameters: - - name: graph_name - in: path - required: true + $ref: "#/components/schemas/Error" + 404: + description: Not found + content: + application/json: schema: - type: string - - name: type_name - in: path - required: true + $ref: "#/components/schemas/Error" + 500: + description: Server error + content: + application/json: schema: + $ref: "#/components/schemas/Error" + + schemas: + APIResponse: + type: string + + Error: + required: + - code + - message + properties: + code: + type: integer + format: int32 + description: Error code + message: + type: string + description: Error message + + # https://swagger.io/docs/specification/data-models/data-types/#any + # {} is shorthand syntax for an arbitrary-type schema + AnyValue: {} + + RunningDeploymentInfo: + required: + - instance_name + - cluster_type + - version + - solution + - creation_time + properties: + instance_name: + type: string + cluster_type: + type: string + enum: + - HOSTS + - KUBERNETES + version: + type: string + solution: + type: string + enum: + - INTERACTIVE + - GRAPHSCOPE_INSIGHT + creation_time: + type: string + + StartServiceRequest: + x-body-name: start_service_request + properties: + graph_id: + type: string + + ServiceStatus: + required: + - status + properties: + status: + type: string + enum: + - Running + - Stopped + graph: + $ref: '#/components/schemas/GetGraphResponse' + sdk_endpoints: + properties: + cypher: + type: string + gremlin: + type: string + hqps: + type: string + grpc: + type: string + + UploadFileResponse: + required: + - file_path + properties: + file_path: + type: string + + LongText: + required: + - long_text + properties: + long_text: + type: string + nullable: true + + PrimitiveType: + required: + - primitive_type + properties: + primitive_type: + type: string + enum: [DT_SIGNED_INT32, DT_UNSIGNED_INT32, DT_SIGNED_INT64, DT_UNSIGNED_INT64, + DT_BOOL, DT_FLOAT, DT_DOUBLE] + + StringType: + required: + - string + properties: + string: + type: object + oneOf: + - $ref: '#/components/schemas/LongText' + + GSDataType: + oneOf: + - $ref: '#/components/schemas/PrimitiveType' + - $ref: '#/components/schemas/StringType' + + Parameter: + required: + - name + - type + properties: + name: + type: string + type: + $ref: '#/components/schemas/GSDataType' + + BasePropertyMeta: + required: + - property_name + - property_type + properties: + property_name: + type: string + property_type: + $ref: '#/components/schemas/GSDataType' + nullable: + type: boolean + default_value: + $ref: '#/components/schemas/AnyValue' + description: + type: string + + CreatePropertyMeta: + x-body-name: create_property_meta + allOf: + - $ref: '#/components/schemas/BasePropertyMeta' + + GetPropertyMeta: + x-body-name: get_property_meta + allOf: + - $ref: '#/components/schemas/BasePropertyMeta' + - type: object + required: + - property_id + properties: + property_id: + type: integer + format: int32 + + BaseVertexType: + required: + - type_name + - primary_keys + properties: + type_name: + type: string + primary_keys: + type: array + items: type: string - responses: - '200': - description: Successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - /api/v1/graph/{graph_name}/schema/edge_type: - post: - tags: - - graph - description: Create a edge type - operationId: create_edge_type - parameters: - - name: graph_name - in: path - required: true - schema: + x_csr_params: + type: object + description: Used for storage optimization + properties: + max_vertex_num: + type: integer + + CreateVertexType: + x-body-name: create_vertex_type + allOf: + - $ref: '#/components/schemas/BaseVertexType' + - type: object + required: + - properties + properties: + properties: + type: array + items: + $ref: '#/components/schemas/CreatePropertyMeta' + description: + type: string + + BaseEdgeType: + required: + - type_name + - vertex_type_pair_relations + properties: + type_name: + type: string + vertex_type_pair_relations: + type: array + items: + required: + - source_vertex + - destination_vertex + - relation + properties: + source_vertex: + type: string + destination_vertex: + type: string + relation: + type: string + enum: + - MANY_TO_MANY + - ONE_TO_MANY + - MANY_TO_ONE + - ONE_TO_ONE + x_csr_params: + description: Used for storage optimization + properties: + edge_storage_strategy: + type: string + enum: + - ONLY_IN + - ONLY_OUT + - BOTH_OUT_IN + directed: + type: boolean + primary_keys: + type: array + items: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EdgeType' - required: true - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - /api/v1/graph/{graph_name}/schema/edge_edge/{type_name}: - delete: - tags: - - graph - description: Delete a edge type by name - operationId: delete_edge_type - parameters: - - name: graph_name - in: path - required: true - schema: + + CreateEdgeType: + x-body-name: create_edge_type + allOf: + - $ref: '#/components/schemas/BaseEdgeType' + - type: object + required: + - properties + properties: + properties: + type: array + items: + $ref: '#/components/schemas/CreatePropertyMeta' + description: + type: string + + CreateProcedureRequest: + x-body-name: create_procedure_request + required: + - name + - type + - query + properties: + name: + type: string + description: + type: string + type: + type: string + enum: + - cpp + - cypher + query: + type: string + + CreateProcedureResponse: + required: + - procedure_id + properties: + procedure_id: + type: string + + CreateGraphSchemaRequest: + x-body-name: create_graph_schema_request + required: + - vertex_types + - edge_types + properties: + vertex_types: + type: array + items: + $ref: '#/components/schemas/CreateVertexType' + edge_types: + type: array + items: + $ref: '#/components/schemas/CreateEdgeType' + + CreateGraphRequest: + x-body-name: create_graph_request + required: + - name + - schema + properties: + name: + type: string + description: + type: string + stored_procedures: + type: array + items: + $ref: '#/components/schemas/CreateProcedureRequest' + schema: + $ref: '#/components/schemas/CreateGraphSchemaRequest' + + CreateGraphResponse: + required: + - graph_id + properties: + graph_id: + type: string + + StoredProcedureMeta: + allOf: + - $ref: '#/components/schemas/CreateProcedureRequest' + - type: object + required: + - id + - library + - params + - returns + properties: + id: + type: string + library: + type: string + params: + type: array + items: + $ref: '#/components/schemas/Parameter' + returns: + type: array + items: + $ref: '#/components/schemas/Parameter' + + GetProcedureResponse: + allOf: + - $ref: '#/components/schemas/StoredProcedureMeta' + - type: object + required: + - bound_graph + - runnable + properties: + bound_graph: + type: string + runnable: + type: boolean + + UpdateProcedureRequest: + x-body-name: update_procedure_request + required: + - description + properties: + description: + type: string + + GetVertexType: + allOf: + - $ref: '#/components/schemas/BaseVertexType' + - type: object + required: + - type_id + - properties + properties: + type_id: + type: integer + format: int32 + properties: + type: array + items: + $ref: '#/components/schemas/GetPropertyMeta' + description: + type: string + + GetEdgeType: + allOf: + - $ref: '#/components/schemas/BaseEdgeType' + - type: object + required: + - type_id + - properties + properties: + type_id: + type: integer + format: int32 + properties: + type: array + items: + $ref: '#/components/schemas/GetPropertyMeta' + description: + type: string + + GetGraphSchemaResponse: + required: + - vertex_types + - edge_types + properties: + vertex_types: + type: array + items: + $ref: '#/components/schemas/GetVertexType' + edge_types: + type: array + items: + $ref: '#/components/schemas/GetEdgeType' + + GetGraphResponse: + required: + - id + - name + - schema + - creation_time + - data_update_time + - schema_update_time + properties: + id: + type: string + name: + type: string + description: + type: string + store_type: + type: string + enum: + - mutable_csr + creation_time: + type: string + data_update_time: + type: string + schema_update_time: + type: string + stored_procedures: + type: array + items: + $ref: '#/components/schemas/GetProcedureResponse' + schema: + $ref: '#/components/schemas/GetGraphSchemaResponse' + + ColumnMapping: + required: + - column + - property + properties: + column: + properties: + index: + type: integer + format: int32 + name: + type: string + property: + type: string + description: must align with the schema + + VertexMapping: + x-body-name: vertex_mapping + required: + - type_name + - inputs + - column_mappings + properties: + type_name: + type: string + inputs: + type: array + items: type: string - - name: type_name - in: path - required: true - schema: + example: file:///path/to/file.csv + column_mappings: + type: array + items: + $ref: '#/components/schemas/ColumnMapping' + + EdgeMapping: + x-body-name: edge_mapping + required: + - type_triplet + - inputs + - source_vertex_mappings + - destination_vertex_mappings + properties: + type_triplet: + required: + - edge + - source_vertex + - destination_vertex + description: source label -> [edge label] -> destination label + properties: + edge: + type: string + source_vertex: + type: string + destination_vertex: + type: string + inputs: + type: array + items: + type: string + source_vertex_mappings: + type: array + items: + $ref: '#/components/schemas/ColumnMapping' + destination_vertex_mappings: + type: array + items: + $ref: '#/components/schemas/ColumnMapping' + column_mappings: + type: array + items: + $ref: '#/components/schemas/ColumnMapping' + + SchemaMapping: + x-body-name: schema_mapping + required: + - vertex_mappings + - edge_mappings + properties: + vertex_mappings: + type: array + items: + $ref: '#/components/schemas/VertexMapping' + edge_mappings: + type: array + items: + $ref: '#/components/schemas/EdgeMapping' + + DataloadingJobConfig: + x-body-name: dataloading_job_config + required: + - loading_config + - vertices + - edges + properties: + loading_config: + properties: + import_option: + type: string + enum: + - init + - overwrite + example: overwrite + format: + properties: + type: + type: string + metadata: + type: object + additionalProperties: true + vertices: + type: array + items: + type: object + properties: + type_name: + type: string + edges: + type: array + items: + type: object + properties: + type_name: + type: string + source_vertex: + type: string + destination_vertex: + type: string + schedule: + type: string + nullable: true + description: "format with '2023-02-21 11:56:30'" + repeat: + type: string + nullable: true + enum: + - once + - day + - week + + JobStatus: + required: + - id + - type + - status + properties: + id: + type: string + type: + type: string + status: + type: string + enum: + - RUNNING + - SUCCESS + - FAILED + - CANCELLED + - WAITING + start_time: + type: string + end_time: + type: string + log: + type: string + description: logview URL or log string + detail: + type: object + additionalProperties: true + + CreateDataloadingJobResponse: + required: + - job_id + properties: + job_id: + type: string + + CreateAlertRuleRequest: + x-body-name: create_alert_rule_request + required: + - name + - severity + - metric_type + - conditions_description + - frequency + - enable + properties: + name: + type: string + severity: + type: string + enum: + - warning + - emergency + metric_type: + type: string + enum: + - node + - service + conditions_description: + type: string + frequency: + type: integer + description: (mins) + enable: + type: boolean + + GetAlertRuleResponse: + allOf: + - $ref: '#/components/schemas/CreateAlertRuleRequest' + - type: object + required: + - id + properties: + id: + type: string + + GetAlertMessageResponse: + required: + - id + - alert_name + - severity + - metric_type + - target + - trigger_time + - status + - message + properties: + id: + type: string + description: Generated in server side + alert_name: + type: string + severity: + type: string + enum: + - warning + - emergency + metric_type: + type: string + enum: + - node + - service + target: + type: array + items: type: string - - name: source_vertex_type - in: query - required: true - schema: + trigger_time: + type: string + status: + type: string + enum: + - unsolved + - solved + - dealing + message: + type: string + + UpdateAlertMessageStatusRequest: + x-body-name: update_alert_message_status_request + required: + - message_ids + - status + properties: + message_ids: + type: array + items: type: string - - name: destination_vertex_type - in: query - required: true - schema: + status: + type: string + enum: + - unsolved + - solved + - dealing + + CreateAlertReceiverRequest: + x-body-name: create_alert_receiver_request + required: + - type + - webhook_url + - at_user_ids + - is_at_all + - enable + properties: + type: + type: string + enum: + - webhook + webhook_url: + type: string + at_user_ids: + type: array + items: type: string + is_at_all: + type: boolean + enable: + type: boolean + + GetAlertReceiverResponse: + allOf: + - $ref: '#/components/schemas/CreateAlertReceiverRequest' + - type: object + required: + - id + - message + properties: + id: + type: string + message: + type: string + description: Error message generated in server side + +tags: + - name: Deployment + - name: Graph + - name: DataSource + - name: Job + - name: Procedure + - name: Service + - name: Alert + - name: Utils + +paths: + /api/v1/deployment/info: + get: + description: Deployment information + tags: [Deployment] + operationId: getDeploymentInfo responses: - '200': - description: Successful operation + 200: + description: Successfully returned the deployment information content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - /api/v1/graph/{graph_name}/datasource: + $ref: '#/components/schemas/RunningDeploymentInfo' + example: + cluster_type: HOSTS + creation_time: 2024-01-01 00:00:00 + instance_name: demo + solution: INTERACTIVE + version: 0.27.0 + 500: + $ref: "#/components/responses/500" + + /api/v1/graph: post: - tags: - - datasource - description: Import data source in batch - operationId: import_datasource - parameters: - - name: graph_name - in: path - required: true - schema: - type: string + description: Create a new graph + tags: [Graph] + operationId: createGraph requestBody: + required: true content: application/json: schema: - $ref: '#/components/schemas/DataSource' - required: true + $ref: '#/components/schemas/CreateGraphRequest' responses: - '200': - description: successful operation + 200: + description: The graph was created content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' + $ref: '#/components/schemas/CreateGraphResponse' + 400: + $ref: "#/components/responses/400" + 500: + $ref: "#/components/responses/500" get: - tags: - - datasource - description: List data source on graph - operationId: get_datasource - parameters: - - name: graph_name - in: path - required: true - schema: - type: string + description: List all graphs + tags: [Graph] + operationId: listGraphs responses: - '200': - description: Successful operation + 200: + description: Successfully returned all graphs content: application/json: schema: - $ref: '#/components/schemas/DataSource' + type: array + items: + $ref: "#/components/schemas/GetGraphResponse" example: - vertices_datasource: - - data_source: FILE - type_name: person - location: /home/graphscope/path/to/person.csv - property_mapping: - "0": id - "1": name - - data_source: FILE - type_name: software - location: /home/graphscope/path/to/software.csv - property_mapping: - "0": id - "1": name - edges_datasource: - - data_source: FILE - type_name: knows - source_vertex: person - destination_vertex: person - location: /home/graphscope/path/to/person_knows_person.csv - source_pk_column_map: - "0": id - destination_pk_column_map: - "1": id - property_mapping: - "2": weight - - data_source: FILE - type_name: created - source_vertex: person - destination_vertex: software - location: /home/graphscope/path/to/person_created_software.csv - source_pk_column_map: - "0": id - destination_pk_column_map: - "1": id - property_mapping: - "2": weight - /api/v1/graph/{graph_name}/datasource/vertex_datasource: - post: - tags: - - datasource - description: Bind data source on vertex type - operationId: bind_vertex_datasource - parameters: - - name: graph_name - in: path - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/VertexDataSource' - required: true - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - /api/v1/graph/{graph_name}/datasource/vertex_datasource/{type_name}: + - id: GRAPHID + name: demo + creation_time: "2024-01-01 00:00:00" + schema_update_time: "2024-01-02 00:00:00" + data_update_time: "2024-01-03 00:00:00" + stored_procedures: + - id: PROCEDUREID + name: procedure_name + type: cypher + query: "MATCH(a) return COUNT(a);" + library: /path/to/library + params: + - name: param1 + type: + string: + long_text: null + returns: + - name: return1 + type: + PrimitiveType: DT_SIGNED_INT64 + bound_graph: demo + runnable: true + schema: + vertex_types: + - type_id: 0 + type_name: person + properties: + - property_id: 0 + property_name: id + property_type: + string: + long_text: null + - property_id: 1 + property_name: name + property_type: + string: + long_text: null + primary_keys: + - id + - type_id: 1 + type_name: software + properties: + - property_id: 0 + property_name: id + property_type: + string: + long_text: null + - property_id: 1 + property_name: name + property_type: + string: + long_text: null + primary_keys: + - id + edge_types: + - type_id: 0 + type_name: knows + vertex_type_pair_relations: + - source_vertex: person + destination_vertex: person + relation: MANY_TO_MANY + x_csr_params: + edge_storage_strategy: ONLY_IN + properties: + - property_id: 0 + property_name: weight + property_type: + primitive_type: DT_DOUBLE + - type_id: 1 + type_name: created + vertex_type_pair_relations: + - source_vertex: person + destination_vertex: software + relation: MANY_TO_MANY + x_csr_params: + edge_storage_strategy: ONLY_IN + properties: + - property_id: 0 + property_name: weight + property_type: + primitive_type: DT_DOUBLE + 500: + $ref: "#/components/responses/500" + + /api/v1/graph/{graph_id}: get: - tags: - - datasource - description: Get vertex data source - operationId: get_vertex_datasource + description: Get graph by ID + tags: [Graph] + operationId: getGraphById parameters: - - name: graph_name - in: path - required: true - schema: - type: string - - name: type_name - in: path + - name: graph_id + in : path required: true schema: type: string responses: - '200': - description: Successful operation + 200: + description: Successfully returned the graph content: application/json: schema: - $ref: '#/components/schemas/VertexDataSource' + $ref: "#/components/schemas/GetGraphResponse" example: - data_source: FILE - type_name: person - location: /home/graphscope/path/to/person.csv - property_mapping: - "0": id - "1": name + id: GRAPHID + name: demo + creation_time: "2024-01-01 00:00:00" + schema_update_time: "2024-01-02 00:00:00" + data_update_time: "2024-01-03 00:00:00" + stored_procedures: + - id: PROCEDUREID + name: procedure_name + type: cypher + query: "MATCH(a) return COUNT(a);" + library: /path/to/library + params: + - name: param1 + type: + string: + long_text: null + returns: + - name: return1 + type: + PrimitiveType: DT_SIGNED_INT64 + bound_graph: demo + runnable: true + schema: + vertex_types: + - type_id: 0 + type_name: person + properties: + - property_id: 0 + property_name: id + property_type: + string: + long_text: null + - property_id: 1 + property_name: name + property_type: + string: + long_text: null + primary_keys: + - id + - type_id: 1 + type_name: software + properties: + - property_id: 0 + property_name: id + property_type: + string: + long_text: null + - property_id: 1 + property_name: name + property_type: + string: + long_text: null + primary_keys: + - id + edge_types: + - type_id: 0 + type_name: knows + vertex_type_pair_relations: + - source_vertex: person + destination_vertex: person + relation: MANY_TO_MANY + x_csr_params: + edge_storage_strategy: ONLY_IN + properties: + - property_id: 0 + property_name: weight + property_type: + primitive_type: DT_DOUBLE + - type_id: 1 + type_name: created + vertex_type_pair_relations: + - source_vertex: person + destination_vertex: software + relation: MANY_TO_MANY + x_csr_params: + edge_storage_strategy: ONLY_IN + properties: + - property_id: 0 + property_name: weight + property_type: + primitive_type: DT_DOUBLE + 500: + $ref: "#/components/responses/500" + delete: - tags: - - datasource - description: Unbind datasource on a vertex type - operationId: unbind_vertex_datasource + description: Delete graph by ID + tags: [Graph] + operationId: deleteGraphById parameters: - - name: graph_name - in: path - required: true - schema: - type: string - - name: type_name - in: path + - name: graph_id + in : path required: true schema: type: string responses: - '200': - description: Successful operation + 200: + description: Successfully deleted the graph content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - /api/v1/graph/{graph_name}/datasource/edge_datasource: + $ref: '#/components/schemas/APIResponse' + 500: + $ref: "#/components/responses/500" + + /api/v1/graph/{graph_id}/schema: post: - tags: - - datasource - description: Bind data source on edge type - operationId: bind_edge_datasource + tags: [Graph] + description: Import graph schema + operationId: importSchemaById parameters: - - name: graph_name - in: path + - name: graph_id + in : path required: true schema: type: string @@ -519,163 +1080,106 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/EdgeDataSource' + $ref: '#/components/schemas/CreateGraphSchemaRequest' required: true responses: - '200': - description: successful operation + 200: + description: Successful imported the graph schema content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - /api/v1/graph/{graph_name}/datasource/edge_datasource/{type_name}: + $ref: '#/components/schemas/APIResponse' + 400: + $ref: "#/components/responses/400" + 500: + $ref: "#/components/responses/500" + get: - tags: - - datasource - description: Get edge data source - operationId: get_edge_datasource - parameters: - - name: graph_name - in: path - required: true - schema: - type: string - - name: type_name - in: path - required: true - schema: - type: string - - name: source_vertex_type - in: query - required: true - schema: - type: string - - name: destination_vertex_type - in: query - required: true - schema: - type: string - responses: - '200': - description: Successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/EdgeDataSource' - example: - data_source: FILE - type_name: created - source_vertex: person - destination_vertex: software - location: /home/graphscope/path/to/person_created_software.csv - source_pk_column_map: - "0": id - destination_pk_column_map: - "1": id - property_mapping: - "2": weight - delete: - tags: - - datasource - description: Unbind datasource on an edge type - operationId: unbind_edge_datasource + tags: [Graph] + description: Get graph schema by ID + operationId: getSchemaById parameters: - - name: graph_name - in: path - required: true - schema: - type: string - - name: type_name - in: path - required: true - schema: - type: string - - name: source_vertex_type - in: query - required: true - schema: - type: string - - name: destination_vertex_type - in: query + - name: graph_id + in : path required: true schema: type: string responses: - '200': - description: Successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - /api/v1/groot/graph: - get: - tags: - - legacy - description: list groot graph - operationId: list_groot_graph - responses: - '200': - description: Successful operation + 200: + description: Successfully returned the graph schema content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/GrootGraph' + $ref: '#/components/schemas/GetGraphSchemaResponse' example: - - name: demo - type: GrootGraph - directed: true - creation_time: 2024-04-01 12:00:00 - schema: - vertices: - - label: person - properties: - - id: 0 - name: id - type: STRING - is_primary_key: true - - id: 1 - name: name - type: STRING - is_primary_key: false - - label: software - properties: - - id: 0 - name: id - type: STRING - is_primary_key: true - - id: 1 - name: name - type: STRING - is_primary_key: false - edges: - - label: knows - relations: - - src_label: person - dst_label: person - properties: - - id: 0 - name: weight - type: DOUBLE - is_primary_key: false - - label: created - relations: - - src_label: person - dst_label: software - properties: - - id: 0 - name: weight - type: DOUBLE - is_primary_key: false - /api/v1/groot/graph/{graph_name}/schema: + vertex_types: + - type_id: 0 + type_name: person + properties: + - property_id: 0 + property_name: id + property_type: + string: + long_text: null + - property_id: 1 + property_name: name + property_type: + string: + long_text: null + primary_keys: + - id + - type_id: 1 + type_name: software + properties: + - property_id: 0 + property_name: id + property_type: + string: + long_text: null + - property_id: 1 + property_name: name + property_type: + string: + long_text: null + primary_keys: + - id + edge_types: + - type_id: 0 + type_name: knows + vertex_type_pair_relations: + - source_vertex: person + destination_vertex: person + relation: MANY_TO_MANY + x_csr_params: + edge_storage_strategy: ONLY_IN + properties: + - property_id: 0 + property_name: weight + property_type: + primitive_type: DT_DOUBLE + - type_id: 1 + type_name: created + vertex_type_pair_relations: + - source_vertex: person + destination_vertex: software + relation: MANY_TO_MANY + x_csr_params: + edge_storage_strategy: ONLY_IN + properties: + - property_id: 0 + property_name: weight + property_type: + primitive_type: DT_DOUBLE + 500: + $ref: "#/components/responses/500" + + /api/v1/graph/{graph_id}/schema/vertex: post: - tags: - - legacy - description: Import schema to groot graph - operationId: import_groot_schema + tags: [Graph] + description: Create a vertex type + operationId: createVertexType parameters: - - name: graph_name + - name: graph_id in: path required: true schema: @@ -684,205 +1188,121 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/GrootSchema' + $ref: '#/components/schemas/CreateVertexType' required: true responses: - '200': - description: successful operation + 200: + description: Successful created a vertex type content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - get: - tags: - - legacy - description: Get graph schema by name - operationId: get_groot_schema + $ref: '#/components/schemas/APIResponse' + 400: + $ref: "#/components/responses/400" + 500: + $ref: "#/components/responses/500" + + /api/v1/graph/{graph_id}/schema/vertex/{type_name}: + delete: + tags: [Graph] + description: Delete vertex type by name + operationId: deleteVertexTypeByName parameters: - - name: graph_name + - name: graph_id + in: path + required: true + schema: + type: string + - name: type_name in: path required: true schema: type: string responses: - '200': - description: Successful operation + 200: + description: Successful deleted the vertex type content: application/json: schema: - $ref: '#/components/schemas/GrootSchema' - example: - vertices: - - label: person - properties: - - id: 0 - name: id - type: STRING - is_primary_key: true - - id: 1 - name: name - type: STRING - is_primary_key: false - - label: software - properties: - - id: 0 - name: id - type: STRING - is_primary_key: true - - id: 1 - name: name - type: STRING - is_primary_key: false - edges: - - label: knows - relations: - - src_label: person - dst_label: person - properties: - - id: 0 - name: weight - type: DOUBLE - is_primary_key: false - - label: created - relations: - - src_label: person - dst_label: software - properties: - - id: 0 - name: weight - type: DOUBLE - is_primary_key: false - /api/v1/groot/graph/{graph_name}/dataloading: + $ref: '#/components/schemas/APIResponse' + 500: + $ref: "#/components/responses/500" + + /api/v1/graph/{graph_id}/schema/edge: post: - tags: - - legacy - operationId: create_groot_dataloading_job + tags: [Graph] + description: Create a edge type + operationId: createEdgeType parameters: - - name: graph_name - in: path - required: true - schema: - type: string + - name: graph_id + in: path + required: true + schema: + type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/GrootDataloadingJobConfig' - required: true - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - /api/v1/job: - get: - tags: - - job - operationId: list_jobs + $ref: '#/components/schemas/CreateEdgeType' responses: - '200': - description: successful operation + 200: + description: Successful created the edge type content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/JobStatus' - example: - - job_id: JOB-QWERTYUIOPASDFGH-1 - type: DATA IMPORT - status: RUNNING - start_time: 2024-02-24 00:00:00 - end_time: null - log: logging... - detail: - graph_name: demo - - job_id: JOB-QWERTYUIOPASDFGH-2 - type: DATA IMPORT - status: CANCELLED - start_time: 2024-02-24 00:00:00 - end_time: null - log: logging... - detail: - graph_name: demo - - job_id: JOB-QWERTYUIOPASDFGH-3 - type: DATA IMPORT - status: SUCCESS - start_time: 2024-02-24 00:00:00 - end_time: 2024-02-24 12:00:00 - log: logging... - detail: - graph_name: demo - - job_id: JOB-QWERTYUIOPASDFGH-4 - type: DATA IMPORT - status: FAILED - start_time: 2024-02-24 00:00:00 - end_time: 2024-02-24 12:00:00 - log: logging... - detail: - graph_name: demo - - job_id: JOB-QWERTYUIOPASDFGH-5 - type: DATA IMPORT - status: WAITING - start_time: null - end_time: null - detail: - graph_name: demo - /api/v1/job/{job_id}: - get: - tags: - - job - operationId: get_job_by_id + $ref: '#/components/schemas/APIResponse' + 400: + $ref: "#/components/responses/400" + 500: + $ref: "#/components/responses/500" + + /api/v1/graph/{graph_id}/schema/edge/{type_name}: + delete: + tags: [Graph] + description: Delete edge type by name + operationId: deleteEdgeTypeByName parameters: - - name: job_id + - name: graph_id in: path required: true schema: type: string - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/JobStatus' - example: - job_id: JOB-QWERTYUIOPASDFGH-1 - type: DATA IMPORT - status: RUNNING - start_time: 2024-02-24 00:00:00 - end_time: null - log: logging... - delete: - tags: - - job - operationId: delete_job_by_id - parameters: - - name: job_id + - name: type_name in: path required: true schema: type: string + - name: source_vertex_type + in: query + required: true + schema: + type: string + - name: destination_vertex_type + in: query + required: true + schema: + type: string responses: - '200': - description: Successful operation + 200: + description: Successful deleted the edge type content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - /api/v1/graph/{graph_name}/dataloading: + $ref: '#/components/schemas/APIResponse' + 500: + $ref: "#/components/responses/500" + + /api/v1/graph/{graph_id}/datasource: post: - tags: - - job - operationId: create_dataloading_job + tags: [DataSource] + description: Bind data sources in batches + operationId: bindDatasourceInBatch parameters: - - name: graph_name - in: path - required: true - schema: - type: string + - name: graph_id + in: path + required: true + schema: + type: string requestBody: content: application/json: @@ -890,42 +1310,38 @@ paths: $ref: '#/components/schemas/SchemaMapping' required: true responses: - '200': - description: successful operation + 200: + description: Successful bind the data sources content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - /api/v1/graph/{graph_name}/dataloading/config: + $ref: '#/components/schemas/APIResponse' + 400: + $ref: "#/components/responses/400" + 500: + $ref: "#/components/responses/500" get: - tags: - - job - description: get dataloading configuration - operationId: get_dataloading_config + tags: [DataSource] + description: Get data source by ID + operationId: getDatasourceById parameters: - - name: graph_name - in: path - required: true - schema: - type: string + - name: graph_id + in: path + required: true + schema: + type: string responses: - '200': - description: Successful operation + 200: + description: Successful returned all data sources content: application/json: schema: $ref: '#/components/schemas/SchemaMapping' example: - graph: demo - loading_config: overwrite - format: - type: csv - metadata: - delimiter: "|" vertex_mappings: - type_name: person inputs: - - /home/graphscope/path/to/person.csv + - file:///path/to/person.csv column_mappings: - column: index: 0 @@ -937,7 +1353,7 @@ paths: property: name - type_name: software inputs: - - /home/graphscope/path/to/software.csv + - file:///path/to/software.csv column_mappings: - column: index: 0 @@ -950,1336 +1366,916 @@ paths: edge_mappings: - type_triplet: edge: knows - source_vertex: person - destination_vertex: person - inputs: - - /home/graphscope/path/to/person_knows_person.csv - source_vertex_mappings: - - column: - index: 0 - name: id - destination_vertex_mappings: - - column: - index: 1 - name: id - column_mappings: - - column: - index: 2 - name: weight - property: weight + source_vertex: person + destination_vertex: person + inputs: + - file:///path/to/knows.csv + source_vertex_mappings: + - column: + index: 0 + name: id + property: id + destination_vertex_mappings: + - column: + index: 1 + name: id + property: id + column_mappings: + - column: + index: 2 + name: weight + property: weight - type_triplet: edge: created - source_vertex: person - destination_vertex: software - inputs: - - /home/graphscope/path/to/person_created_software.csv - source_vertex_mappings: - - column: - index: 0 - name: id - destination_vertex_mappings: - - column: - index: 1 - name: id - column_mappings: - - column: - index: 2 - name: weight - property: weight - /api/v1/procedure: - get: - tags: - - procedure - description: List all the stored procedures - operationId: list_procedures - responses: - '200': - description: Successful operation - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Procedure' - example: - - bound_graph: demo - description: "stored procedure 1" - enable: true - runnable: true - name: procedure-1 - query: "MATCH (u: person) Return u.id, u.name LIMIT 5;" - type: cypher - params: - - name: id - type: DT_STRING - returns: - - name: name - type: DT_STRING - /api/v1/graph/{graph_name}/procedure: - post: - tags: - - procedure - description: Create a new stored procedure on a certain graph - operationId: create_procedure - parameters: - - name: graph_name - in: path - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Procedure' - required: true - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - get: - tags: - - procedure - description: List stored procedures on a certain graph - operationId: list_procedures_by_graph - parameters: - - name: graph_name - in: path - required: true - schema: - type: string - responses: - '200': - description: Successful operation - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Procedure' - example: - - bound_graph: demo - description: "stored procedure 1" - enable: true - runnable: true - name: procedure-1 - query: "MATCH (u: person) Return u.id, u.name LIMIT 5;" - type: cypher - params: - - name: id - type: DT_STRING - returns: - - name: name - type: DT_STRING - /api/v1/graph/{graph_name}/procedure/{procedure_name}: - get: - tags: - - procedure - description: Get a procedure by name - operationId: get_procedure - parameters: - - name: graph_name - in : path - required: true - schema: - type: string - - name: procedure_name - in : path - required: true - schema: - type: string - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/Procedure' - example: - bound_graph: demo - description: "stored procedure 1" - enable: true - runnable: true - name: procedure-1 - query: "MATCH (u: person) Return u.id, u.name LIMIT 5;" - type: cypher - params: - - name: id - type: DT_STRING - returns: - - name: name - type: DT_STRING - put: - tags: - - procedure - description: Update stored procedure on a certain graph - operationId: update_procedure - parameters: - - name: graph_name - in: path - required: true - schema: - type: string - - name: procedure_name - in : path - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Procedure' - responses: - '200': - description: Successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - delete: - tags: - - procedure - description: Delete a stored procedure on a certain graph - operationId: delete_procedure - parameters: - - name: graph_name - in: path - required: true - schema: - type: string - - name: procedure_name - in : path - required: true - schema: - type: string - responses: - '200': - description: Successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - /api/v1/deployment/info: - get: - tags: - - deployment - description: Get deployment's meta info - operationId: get_deployment_info - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/DeploymentInfo' - example: - cluster_type: HOSTS - creation_time: 2024-02-07 14:21:28 - graphs_info: - demo: - creation_time: 2024-02-07 14:21:28 - last_dataloading_time: 2024-02-08 14:21:28 - name: demo - update_time: 2024-02-07 14:21:28 - name: demo - solution: INTERACTIVE - version: 0.27.0 - /api/v1/deployment/status: - get: - tags: - - deployment - description: Get deployment's status (k8s only) - operationId: get_deployment_status + source_vertex: person + destination_vertex: software + inputs: + - file:///path/to/created.csv + source_vertex_mappings: + - column: + index: 0 + name: id + property: id + destination_vertex_mappings: + - column: + index: 1 + name: id + property: id + column_mappings: + - column: + index: 2 + name: weight + property: weight + 500: + $ref: "#/components/responses/500" + + /api/v1/graph/{graph_id}/datasource/vertex/{type_name}: + delete: + tags: [DataSource] + description: Unbind data source on a vertex type + operationId: unbindVertexDatasource + parameters: + - name: graph_id + in: path + required: true + schema: + type: string + - name: type_name + in: path + required: true + schema: + type: string responses: - '200': - description: successful operation + 200: + description: Successfully unbind the data source content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/DeploymentStatus' - /api/v1/deployment/log: - get: - tags: - - deployment - operationId: fetch_log + $ref: '#/components/schemas/APIResponse' + 500: + $ref: "#/components/responses/500" + + /api/v1/graph/{graph_id}/datasource/edge/{type_name}: + delete: + tags: [DataSource] + description: Unbind datas ource on an edge type + operationId: unbindEdgeDatasource parameters: - - name: component - in: query + - name: graph_id + in: path required: true schema: type: string - - name: pod_name - in: query + - name: type_name + in: path required: true schema: type: string - - name: container_name + - name: source_vertex_type in: query required: true schema: type: string - - name: since_seconds + - name: destination_vertex_type in: query required: true schema: - type: integer + type: string responses: - '200': - description: successful operation + 200: + description: Successfully unbind the data source content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/DeploymentStatus' - /api/v1/node/status: + $ref: '#/components/schemas/APIResponse' + 500: + $ref: "#/components/responses/500" + + /api/v1/job: get: - tags: - - deployment - description: Get node status (cpu/memory/disk, local only) - operationId: get_node_status + tags: [Job] + description: List all jobs + operationId: listJobs responses: - '200': - description: successful operation + 200: + description: Successful returned all the jobs content: application/json: schema: type: array items: - $ref: '#/components/schemas/NodeStatus' + $ref: '#/components/schemas/JobStatus' example: - - node: hostname-1 - cpu_usage: 80 - memory_usage: 40 - disk_usage: 85 - /api/v1/service/start: - post: - tags: - - service - description: Start service - operationId: start_service - requestBody: - content: - application/json: - schema: - type: object - properties: - graph_name: - type: string - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - /api/v1/service/stop: - post: - tags: - - service - description: Stop current service - operationId: stop_service - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - /api/v1/service/restart: - post: - tags: - - service - description: Restart current service - operationId: restart_service - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - /api/v1/service/status: + - id: JOB-QWERTYUIOPASDFGH-1 + type: DATA IMPORT + status: RUNNING + start_time: 2024-02-24 00:00:00 + log: logging... + detail: + graph_name: demo + - id: JOB-QWERTYUIOPASDFGH-2 + type: DATA IMPORT + status: CANCELLED + start_time: 2024-02-24 00:00:00 + log: logging... + detail: + graph_name: demo + - id: JOB-QWERTYUIOPASDFGH-3 + type: DATA IMPORT + status: SUCCESS + start_time: 2024-02-24 00:00:00 + end_time: 2024-02-24 12:00:00 + detail: + graph_name: demo + - id: JOB-QWERTYUIOPASDFGH-4 + type: DATA IMPORT + status: FAILED + start_time: 2024-02-24 00:00:00 + end_time: 2024-02-24 12:00:00 + log: logging... + detail: + graph_name: demo + - id: JOB-QWERTYUIOPASDFGH-5 + type: DATA IMPORT + status: WAITING + detail: + graph_name: demo + 500: + $ref: "#/components/responses/500" + + /api/v1/job/{job_id}: get: - tags: - - service - description: Get service status - operationId: get_service_status + tags: [Job] + description: Get job status by ID + operationId: getJobById + parameters: + - name: job_id + in: path + required: true + schema: + type: string responses: - '200': - description: successful operation + 200: + description: Successfully returned the job status content: application/json: schema: - $ref: '#/components/schemas/ServiceStatus' - example: - status: running - graph_name: demo - sdk_endpoints: - cypher: neo4j://mock.api.cypher:7676 - gremlin: ws://mock.api.gremlin/gremlin - hqps: http://mock.api.hqps:10000 - grpc: http://mock.api.grpc:10000 - /api/v1/alert/message: - get: - tags: - - alert - operationId: list_alert_messages + $ref: '#/components/schemas/JobStatus' + 500: + $ref: "#/components/responses/500" + + delete: + tags: [Job] + description: Delete job by ID + operationId: deleteJobById parameters: - - name: alert_type - in: query - required: false - schema: - type: string - - name: status - in: query - required: false - schema: - type: string - enum: - - solved - - unsolved - - dealing - - name: severity - in: query - required: false - schema: - type: string - enum: - - warning - - emergency - - name: start_time - in: query - required: false - description: format with "2023-02-21-11-56-30" - schema: - type: string - - name: end_time - in: query - required: false - description: format with "2023-02-21-11-56-30" + - name: job_id + in: path + required: true schema: type: string responses: - '200': - description: Successful operation + 200: + description: Successfuly cancelled the job content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/AlertMessage' - example: - - message_id: ALERT-MESSAGE-QWERTYUIOP-1 - alert_name: HighDiskUtilization - severity: warning - metric_type: node - target: - - hostname-1 - trigger_time: 2023-02-21 11:56:30 - status: unsolved - message: Disk usage node1 85.12%, exceeds threshold - - message_id: ALERT-MESSAGE-QWERTYUIOP-2 - alert_name: HighDiskUtilization - severity: emergency - metric_type: node - target: - - hostname-1 - trigger_time: 2023-02-21 11:56:30 - status: solved - message: Disk usage node1 85.12%, exceeds threshold - - message_id: ALERT-MESSAGE-QWERTYUIOP-3 - alert_name: HighDiskUtilization - severity: warning - metric_type: node - target: - - hostname-1 - trigger_time: 2023-02-21 11:56:30 - status: dealing - message: Disk usage node1 85.12%, exceeds threshold - put: - tags: - - alert - operationId: update_alert_messages - description: Update alert messages in batch + $ref: '#/components/schemas/APIResponse' + 500: + $ref: "#/components/responses/500" + + /api/v1/graph/{graph_id}/dataloading: + post: + tags: [Job] + description: Submit a dataloading job + operationId: submitDataloadingJob + parameters: + - name: graph_id + in: path + required: true + schema: + type: string requestBody: content: application/json: schema: - type: object - properties: - messages: - type: array - items: - $ref: '#/components/schemas/AlertMessage' - batch_status: - type: string - description: Override the status of each message - enum: - - solved - - unsolved - - dealing - batch_delete: - type: boolean - description: True will delete all the messages in request body - default: false + $ref: '#/components/schemas/DataloadingJobConfig' + required: true responses: - '200': - description: Successful operation + 200: + description: Successfully submitted the job content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - '404': - description: Alert message not found - /api/v1/alert/rule: + $ref: '#/components/schemas/CreateDataloadingJobResponse' + 400: + $ref: "#/components/responses/400" + 500: + $ref: "#/components/responses/500" + + /api/v1/graph/{graph_id}/dataloading/config: get: - tags: - - alert - operationId: list_alert_rules - responses: - '200': - description: Successful operation - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/AlertRule' - example: - - name: HighDiskUtilization - severity: warning - metric_type: node - conditions_description: disk usage >= 85 - enable: true - - name: GremlinServiceAvailable - severity: emergency - metric_type: node - conditions_description: g.V().limit(1) failed - enable: false - /api/v1/alert/rule/{rule_name}: - put: - tags: - - alert - operationId: update_alert_rule_by_name + tags: [Job] + description: Get the data loading configuration + operationId: getDataloadingJobConfig parameters: - - name: rule_name + - name: graph_id in: path required: true schema: type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/AlertRule' responses: - '200': - description: Successful operation + 200: + description: Successfully returned the dataloading job configuration content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - delete: - tags: - - alert - operationId: delete_alert_rule_by_name + $ref: '#/components/schemas/DataloadingJobConfig' + 500: + $ref: "#/components/responses/500" + + /v1/graph/{graph_id}/procedure: + post: + tags: [Procedure] + description: Create a new stored procedure on a certain graph + operationId: createProcedure parameters: - - name: rule_name + - name: graph_id in: path required: true schema: type: string - responses: - '200': - description: Successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - /api/v1/alert/receiver: - post: - tags: - - alert - operationId: register_receiver requestBody: content: application/json: schema: - $ref: '#/components/schemas/AlertReceiver' + $ref: '#/components/schemas/CreateProcedureRequest' required: true responses: - '200': - description: successful operation + 200: + description: Successfully created a procedure content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' + $ref: '#/components/schemas/CreateProcedureResponse' + 400: + $ref: "#/components/responses/400" + 500: + $ref: "#/components/responses/500" + get: - tags: - - alert - operationId: list_receivers + tags: [Procedure] + description: List all stored procedures on a certain graph + operationId: listProcedures + parameters: + - name: graph_id + in: path + required: true + schema: + type: string responses: - '200': + 200: description: Successful operation content: application/json: schema: type: array items: - $ref: '#/components/schemas/AlertReceiver' + $ref: '#/components/schemas/GetProcedureResponse' example: - - type: webhook - receiver_id: RECEIVER-QWERTYUIOP-1 - webhook_url: http://webhook.com - is_at_all: false - at_user_ids: - - 111111 - - 222222 - enable: false - - type: webhook - receiver_id: RECEIVER-QWERTYUIOP-2 - webhook_url: http://webhook.com - is_at_all: false - at_user_ids: - - 111111 - - 222222 - enable: true - message: error message - /api/v1/alert/receiver/{receiver_id}: + - id: PROCEDUREID-1 + name: procedure_name_1 + type: cypher + query: "MATCH(a) return COUNT(a);" + library: /path/to/library + params: + - name: param1 + type: + string: + long_text: null + returns: + - name: return1 + type: + PrimitiveType: DT_SIGNED_INT64 + bound_graph: demo + runnable: true + - id: PROCEDUREID-2 + name: procedure_name_2 + type: cypher + query: "MATCH(a) return COUNT(a);" + library: /path/to/library + params: + - name: param1 + type: + string: + long_text: null + returns: + - name: return1 + type: + PrimitiveType: DT_SIGNED_INT64 + bound_graph: demo + runnable: false + 400: + $ref: "#/components/responses/400" + 500: + $ref: "#/components/responses/500" + + /v1/graph/{graph_id}/procedure/{procedure_id}: + get: + tags: [Procedure] + description: Get a stored procedure by ID + operationId: getProcedureById + parameters: + - name: graph_id + in : path + required: true + schema: + type: string + - name: procedure_id + in : path + required: true + schema: + type: string + responses: + 200: + description: Successfully returned the procedure + content: + application/json: + schema: + $ref: '#/components/schemas/GetProcedureResponse' + example: + id: PROCEDUREID + name: procedure_name + type: cypher + query: "MATCH(a) return COUNT(a);" + library: /path/to/library + params: + - name: param1 + type: + string: + long_text: null + returns: + - name: return1 + type: + PrimitiveType: DT_SIGNED_INT64 + bound_graph: demo + runnable: true + 500: + $ref: "#/components/responses/500" + put: - tags: - - alert - operationId: update_receiver_by_id + tags: [Procedure] + description: Update a stored procedure by ID + operationId: updateProcedureById parameters: - - name: receiver_id + - name: graph_id in: path required: true schema: type: string + - name: procedure_id + in : path + required: true + schema: + type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/AlertReceiver' + $ref: '#/components/schemas/UpdateProcedureRequest' responses: - '200': - description: Successful operation + 200: + description: Successfully updated the stored procedure content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - '404': - description: Receiver not found + $ref: '#/components/schemas/APIResponse' + 500: + $ref: "#/components/responses/500" + delete: - tags: - - alert - operationId: delete_receiver_by_id + tags: [Procedure] + description: Delete a stored procedure by ID + operationId: deleteProcedureById parameters: - - name: receiver_id + - name: graph_id in: path required: true schema: type: string + - name: procedure_id + in : path + required: true + schema: + type: string responses: - '200': - description: Successful operation + 200: + description: Successfully deleted the stored procedure content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - '404': - description: Receiver not found - /api/v1/file/uploading: + $ref: '#/components/schemas/APIResponse' + 500: + $ref: "#/components/responses/500" + + /api/v1/service/start: post: - tags: - - utils - operationId: upload_file + tags: [Service] + description: Start service + operationId: startService requestBody: - required: true content: - multipart/form-data: + application/json: schema: - type: object - properties: - filestorage: - type: string - format: binary + $ref: '#/components/schemas/StartServiceRequest' responses: - '200': - description: successful operation + 200: + description: Successfully started the service content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' -components: - schemas: - ApiResponse: - type: string - example: operation successful - Connection: - x-body-name: connection - type: object - properties: - coordinator_endpoint: - type: string - ConnectionStatus: - x-body-name: connection_status - type: object - properties: - status: - type: string - enum: - - CONNECTED - solution: - type: string - enum: - - INTERACTIVE - - GRAPHSCOPE_INSIGHT - Graph: - x-body-name: graph - type: object - properties: - name: - type: string - store_type: - type: string - enum: - - mutable_csr - stored_procedures: - type: object - properties: - directory: - type: string - enum: - - plugins - schema: - $ref: '#/components/schemas/Schema' - Schema: - x-body-name: schema - type: object - properties: - vertex_types: - type: array - items: - $ref: '#/components/schemas/VertexType' - edge_types: - type: array - items: - $ref: '#/components/schemas/EdgeType' - VertexType: - x-body-name: vertex_type - type: object - properties: - type_id: - type: integer - format: int32 - type_name: - type: string - properties: - type: array - items: - $ref: '#/components/schemas/Property' - primary_keys: - type: array - items: - type: string - EdgeType: - x-body-name: edge_type - type: object - properties: - type_id: - type: integer - format: int32 - type_name: - type: string - vertex_type_pair_relations: - type: array - items: - type: object - properties: - source_vertex: - type: string - destination_vertex: - type: string - relation: - type: string - enum: - - MANY_TO_MANY - - ONE_TO_MANY - - MANY_TO_ONE - - ONE_TO_ONE - x_csr_params: - type: object - description: Used for storage optimization - properties: - edge_storage_strategy: - type: string - enum: - - ONLY_IN - - ONLY_OUT - - BOTH_OUT_IN - properties: - type: array - items: - $ref: '#/components/schemas/Property' - Property: - x-body-name: property - type: object - properties: - property_id: - type: integer - format: int32 - property_name: - type: string - property_type: - type: object - properties: - primitive_type: - type: string - enum: - - DT_DOUBLE - - DT_STRING - - DT_SIGNED_INT32 - - DT_SIGNED_INT64 - - DT_DATE32 - Procedure: - x-body-name: procedure - type: object - properties: - name: - type: string - bound_graph: - type: string - description: - type: string - type: - type: string - enum: - - cpp - - cypher - query: - type: string - enable: - type: boolean - runnable: - type: boolean - params: - type: array - items: - type: object - properties: - name: - type: string - type: - type: string - returns: - type: array - items: - type: object - properties: - name: - type: string - type: - type: string - DeploymentInfo: - x-body-name: deployment_info - type: object - properties: - name: - type: string - cluster_type: - type: string - enum: - - HOSTS - - KUBERNETES - version: - type: string - solution: - type: string - enum: - - INTERACTIVE - - GRAPHSCOPE_INSIGHT - creation_time: - type: string - graphs_info: - type: object - additionalProperties: - type: object - properties: - name: - type: string - creation_time: - type: string - update_time: - type: string - last_dataloading_time: - type: string - DeploymentStatus: - x-body-name: deployment_status - type: object - description: K8s only - properties: - name: - type: string - container: - type: array - items: + $ref: '#/components/schemas/APIResponse' + 400: + $ref: "#/components/responses/400" + 500: + $ref: "#/components/responses/500" + + /api/v1/service/stop: + post: + tags: [Service] + description: Stop current service + operationId: stopService + responses: + 200: + description: Successfully stopped the service + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + 500: + $ref: "#/components/responses/500" + + /api/v1/service/restart: + post: + tags: [Service] + description: Restart current service + operationId: restartService + responses: + 200: + description: Successfully restarted the service + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + 500: + $ref: "#/components/responses/500" + + /api/v1/service/status: + get: + tags: [Service] + description: Get service status + operationId: getServiceStatus + responses: + 200: + description: Successfully returned current service status + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceStatus' + example: + status: Running + graph: + id: GRAPHID + name: demo + creation_time: "2024-01-01 00:00:00" + schema_update_time: "2024-01-02 00:00:00" + data_update_time: "2024-01-03 00:00:00" + stored_procedures: + - id: PROCEDUREID + name: procedure_name + type: cypher + query: "MATCH(a) return COUNT(a);" + library: /path/to/library + params: + - name: param1 + type: + string: + long_text: null + returns: + - name: return1 + type: + PrimitiveType: DT_SIGNED_INT64 + bound_graph: demo + runnable: true + schema: + vertex_types: + - type_id: 0 + type_name: person + properties: + - property_id: 0 + property_name: id + property_type: + string: + long_text: null + - property_id: 1 + property_name: name + property_type: + string: + long_text: null + primary_keys: + - id + - type_id: 1 + type_name: software + properties: + - property_id: 0 + property_name: id + property_type: + string: + long_text: null + - property_id: 1 + property_name: name + property_type: + string: + long_text: null + primary_keys: + - id + edge_types: + - type_id: 0 + type_name: knows + vertex_type_pair_relations: + - source_vertex: person + destination_vertex: person + relation: MANY_TO_MANY + x_csr_params: + edge_storage_strategy: ONLY_IN + properties: + - property_id: 0 + property_name: weight + property_type: + primitive_type: DT_DOUBLE + - type_id: 1 + type_name: created + vertex_type_pair_relations: + - source_vertex: person + destination_vertex: software + relation: MANY_TO_MANY + x_csr_params: + edge_storage_strategy: ONLY_IN + properties: + - property_id: 0 + property_name: weight + property_type: + primitive_type: DT_DOUBLE + sdk_endpoints: + cypher: neo4j://mock.api.cypher:7676 + gremlin: ws://mock.api.gremlin/gremlin + hqps: http://mock.api.hqps:10000 + grpc: http://mock.api.grpc:10000 + 500: + $ref: "#/components/responses/500" + + /api/v1/alert/rule: + get: + tags: [Alert] + description: List all alert rules + operationId: listAlertRules + responses: + 200: + description: Successfully returned the alert rules + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GetAlertRuleResponse' + example: + - id: ALERTRULE-1 + name: HighDiskUtilization + severity: warning + metric_type: node + conditions_description: disk usage >= 85 + enable: true + - id: ALERTRULE-2 + name: GremlinServiceAvailable + severity: emergency + metric_type: node + conditions_description: g.V().limit(1) failed + enable: false + 500: + $ref: "#/components/responses/500" + + /api/v1/alert/rule/{rule_id}: + put: + tags: [Alert] + operationId: Update alert rule by ID + parameters: + - name: rule_id + in: path + required: true + schema: type: string - image: - type: array - items: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateAlertRuleRequest' + responses: + 200: + description: Successfully updated the alert rule + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + 500: + $ref: "#/components/responses/500" + delete: + tags: [Alert] + operationId: Delete alert rule by ID + parameters: + - name: rule_id + in: path + required: true + schema: type: string - labels: - type: array - items: + responses: + 200: + description: Successfully deleted the alert rule + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + 500: + $ref: "#/components/responses/500" + + /api/v1/alert/message: + get: + tags: [Alert] + description: List all alert messages + operationId: listAlertMessages + parameters: + - name: alert_type + in: query + required: false + schema: type: string - node: - type: string - status: - type: string - restart_count: - type: integer - format: int32 - cpu_value: - type: integer - format: int32 - description: cpu value in millicore - memory_value: - type: integer - format: int32 - description: memory value in megabytes - timestamp: - type: string - creation_time: - type: string - NodeStatus: - x-body-name: node_status - type: object - properties: - node: - type: string - cpu_usage: - type: number - format: double - memory_usage: - type: number - format: double - disk_usage: - type: number - format: double - ServiceStatus: - x-body-name: service_status - type: object - properties: - status: - type: string - graph_name: - description: which graph is serving now - type: string - sdk_endpoints: - type: object - properties: - cypher: - type: string - gremlin: - type: string - hqps: - type: string - grpc: - type: string - AlertRule: - type: object - x-body-name: alert_rule - properties: - name: - type: string - severity: - type: string - enum: - - warning - - emergency - metric_type: - type: string - enum: - - node - - service - conditions_description: - type: string - frequency: - type: integer - description: (mins) - enable: - type: boolean - AlertMessage: - type: object - x-body-name: alert_message - properties: - message_id: - type: string - description: Generated in server side - alert_name: - type: string - severity: - type: string - enum: - - warning - - emergency - metric_type: - type: string - enum: - - node - - service - target: - type: array - items: + - name: status + in: query + required: false + schema: type: string - trigger_time: - type: string - status: - type: string - enum: - - unsolved - - solved - - dealing - message: - type: string - AlertReceiver: - type: object - x-body-name: alert_receiver - properties: - type: - type: string - enum: - - webhook - receiver_id: - type: string - description: Generated in server side - webhook_url: - type: string - at_user_ids: - type: array - items: + enum: + - solved + - unsolved + - dealing + - name: severity + in: query + required: false + schema: + type: string + enum: + - warning + - emergency + - name: start_time + in: query + required: false + description: format with "2023-02-21-11-56-30" + schema: + type: string + - name: end_time + in: query + required: false + description: format with "2023-02-21-11-56-30" + schema: + type: string + - name: limit + in: query + required: false + schema: + type: integer + format: int32 + responses: + 200: + description: Successfully returned the alert messages + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GetAlertMessageResponse' + example: + - id: ALERT-MESSAGE-QWERTYUIOP-1 + alert_name: HighDiskUtilization + severity: warning + metric_type: node + target: + - hostname-1 + trigger_time: 2023-02-21 11:56:30 + status: unsolved + message: Disk usage node1 85.12%, exceeds threshold + - id: ALERT-MESSAGE-QWERTYUIOP-2 + alert_name: HighDiskUtilization + severity: emergency + metric_type: node + target: + - hostname-1 + trigger_time: 2023-02-21 11:56:30 + status: solved + message: Disk usage node1 85.12%, exceeds threshold + - id: ALERT-MESSAGE-QWERTYUIOP-3 + alert_name: HighDiskUtilization + severity: warning + metric_type: node + target: + - hostname-1 + trigger_time: 2023-02-21 11:56:30 + status: dealing + message: Disk usage node1 85.12%, exceeds threshold + 500: + $ref: "#/components/responses/500" + + /api/v1/alert/message-collection: + delete: + tags: [Alert] + description: Delete alert message in batch + operationId: deleteAlertMessageInBatch + parameters: + - name: message_ids + in: query + required: true + schema: + type: string + description: A list of message id separated by comma, e.g. id1,id2,id3 + responses: + 200: + description: Successfully deleted the alert message + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + 500: + $ref: "#/components/responses/500" + + /api/v1/alert/message-collection/status: + put: + tags: [Alert] + description: Update the message status in batch + operationId: updateAlertMessageInBatch + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateAlertMessageStatusRequest' + responses: + 200: + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + 500: + $ref: "#/components/responses/500" + + /api/v1/alert/receiver: + post: + tags: [Alert] + description: Create a new alert receiver + operationId: createAlertReceiver + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateAlertReceiverRequest' + required: true + responses: + 200: + description: Successfully created the alert receiver + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + 500: + $ref: "#/components/responses/500" + + get: + tags: [Alert] + description: List all alert receivers + operationId: listAlertReceivers + responses: + 200: + description: Successfully returned the alert receivers + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/GetAlertReceiverResponse" + example: + - id: RECEIVER-QWERTYUIOP-1 + type: webhook + webhook_url: http://webhook.com + is_at_all: false + at_user_ids: + - 111111 + - 222222 + enable: false + - id: RECEIVER-QWERTYUIOP-2 + type: webhook + webhook_url: http://webhook.com + is_at_all: false + at_user_ids: + - 111111 + - 222222 + enable: true + message: error message + 500: + $ref: "#/components/responses/500" + + /api/v1/alert/receiver/{receiver_id}: + put: + tags: [Alert] + description: Update alert receiver by ID + operationId: updateAlertReceiverById + parameters: + - name: receiver_id + in: path + required: true + schema: type: string - is_at_all: - type: boolean - enable: - type: boolean - message: - type: string - description: error message generated in server side - SchemaMapping: - x-body-name: schema_mapping - type: object - properties: - graph: - type: string - loading_config: - type: object - properties: - data_source: - type: object - properties: - scheme: - type: string - enum: - - file - import_option: - type: string - enum: - - init - - overwrite - format: + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateAlertReceiverRequest' + responses: + 200: + description: Successfully updated the alert receiver + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + 500: + $ref: "#/components/responses/500" + + delete: + tags: [Alert] + description: Delete the alert receiver by ID + operationId: deleteAlertReceiverById + parameters: + - name: receiver_id + in: path + required: true + schema: + type: string + responses: + 200: + description: Successfully deleted the alert receiver + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + 500: + $ref: "#/components/responses/500" + + /api/v1/file/uploading: + post: + tags: [Utils] + operationId: uploadFile + requestBody: + required: true + content: + multipart/form-data: + schema: type: object properties: - type: + filestorage: type: string - metadata: - type: object - additionalProperties: true - vertex_mappings: - type: array - items: - $ref: '#/components/schemas/VertexMapping' - edge_mappings: - type: array - items: - $ref: '#/components/schemas/EdgeMapping' - VertexMapping: - x-body-name: vertex_mapping - type: object - properties: - type_name: - type: string - inputs: - type: array - items: - type: string - column_mappings: - type: array - items: - $ref: '#/components/schemas/ColumnMapping' - EdgeMapping: - x-body-name: edge_mapping - type: object - properties: - type_triplet: - type: object - description: source label -> [edge label] -> destination label - properties: - edge: - type: string - source_vertex: - type: string - destination_vertex: - type: string - inputs: - type: array - items: - type: string - source_vertex_mappings: - type: array - items: - type: object - description: Mapping column index to the primary key of source vertex - properties: - column: - type: object - properties: - index: - type: integer - format: int32 - name: - type: string - destination_vertex_mappings: - type: array - items: - type: object - description: Mapping column index to the primary key of destination vertex - properties: - column: - type: object - properties: - index: - type: integer - format: int32 - name: - type: string - column_mappings: - type: array - items: - $ref: '#/components/schemas/ColumnMapping' - ColumnMapping: - x-body-name: column_mapping - type: object - properties: - column: - type: object - properties: - index: - type: integer - format: int32 - name: - type: string - property: - type: string - description: must align with the schema - JobStatus: - type: object - x-body-name: job_status - properties: - job_id: - type: string - type: - type: string - status: - type: string - enum: - - RUNNING - - SUCCESS - - FAILED - - CANCELLED - - WAITING - start_time: - type: string - end_time: - type: string - log: - type: string - description: URL or log string - detail: - type: object - additionalProperties: true - VertexDataSource: - x-body-name: vertex_data_source - type: object - properties: - data_source: - type: string - enum: - - ODPS - - FILE - type_name: - type: string - location: - type: string - property_mapping: - type: object - additionalProperties: true - EdgeDataSource: - x-body-name: edge_data_source - type: object - properties: - data_source: - type: string - enum: - - ODPS - - FILE - type_name: - type: string - source_vertex: - type: string - destination_vertex: - type: string - location: - type: string - source_pk_column_map: - type: object - additionalProperties: true - destination_pk_column_map: - type: object - additionalProperties: true - property_mapping: - type: object - additionalProperties: true - DataSource: - x-body-name: data_source - type: object - properties: - vertices_datasource: - type: array - items: - $ref: '#/components/schemas/VertexDataSource' - edges_datasource: - type: array - items: - $ref: '#/components/schemas/EdgeDataSource' - GrootGraph: - x-body-name: groot_graph - type: object - properties: - name: - type: string - type: - type: string - enum: - - GrootGraph - directed: - type: boolean - creation_time: - type: string - schema: - $ref: '#/components/schemas/GrootSchema' - gremlin_interface: - type: object - properties: - gremlin_endpoint: - type: string - grpc_endpoint: - type: string - username: - type: string - password: - type: string - GrootSchema: - x-body-name: groot_schema - type: object - properties: - vertices: - type: array - items: - $ref: '#/components/schemas/GrootVertexType' - edges: - type: array - items: - $ref: '#/components/schemas/GrootEdgeType' - GrootVertexType: - x-body-name: groot_vertex_type - type: object - properties: - label: - type: string - properties: - type: array - items: - $ref: '#/components/schemas/GrootProperty' - GrootEdgeType: - x-body-name: groot_edge_type - type: object - properties: - label: - type: string - relations: - type: array - items: - type: object - properties: - src_label: - type: string - dst_label: - type: string - properties: - type: array - items: - $ref: '#/components/schemas/GrootProperty' - GrootProperty: - x-body-name: groot_property - type: object - properties: - id: - type: integer - format: int32 - name: - type: string - type: - type: string - enum: - - DT_STRING - - DT_SIGNED_INT64 - - DT_DOUBLE - is_primary_key: - type: boolean - GrootDataloadingJobConfig: - x-body-name: groot_dataloading_job_config - type: object - properties: - vertices: - type: array - items: - type: string - edges: - type: array - items: - type: object - properties: - type_name: - type: string - source_vertex: - type: string - destination_vertex: - type: string - schedule: - type: string - description: "format with '2023-02-21 11:56:30'" - repeat: - type: string - enum: - - once - - day - - week \ No newline at end of file + format: binary + responses: + 200: + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/UploadFileResponse' + 500: + $ref: "#/components/responses/500" diff --git a/python/graphscope/flex/rest/__init__.py b/python/graphscope/flex/rest/__init__.py index 7b1b19539217..b146c43ab40e 100644 --- a/python/graphscope/flex/rest/__init__.py +++ b/python/graphscope/flex/rest/__init__.py @@ -7,7 +7,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,12 +19,10 @@ # import apis into sdk package from graphscope.flex.rest.api.alert_api import AlertApi -from graphscope.flex.rest.api.connection_api import ConnectionApi -from graphscope.flex.rest.api.datasource_api import DatasourceApi +from graphscope.flex.rest.api.data_source_api import DataSourceApi from graphscope.flex.rest.api.deployment_api import DeploymentApi from graphscope.flex.rest.api.graph_api import GraphApi from graphscope.flex.rest.api.job_api import JobApi -from graphscope.flex.rest.api.legacy_api import LegacyApi from graphscope.flex.rest.api.procedure_api import ProcedureApi from graphscope.flex.rest.api.service_api import ServiceApi from graphscope.flex.rest.api.utils_api import UtilsApi @@ -41,51 +39,56 @@ from graphscope.flex.rest.exceptions import ApiException # import models into sdk package -from graphscope.flex.rest.models.alert_message import AlertMessage -from graphscope.flex.rest.models.alert_receiver import AlertReceiver -from graphscope.flex.rest.models.alert_rule import AlertRule +from graphscope.flex.rest.models.base_edge_type import BaseEdgeType +from graphscope.flex.rest.models.base_edge_type_vertex_type_pair_relations_inner import BaseEdgeTypeVertexTypePairRelationsInner +from graphscope.flex.rest.models.base_edge_type_vertex_type_pair_relations_inner_x_csr_params import BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams +from graphscope.flex.rest.models.base_property_meta import BasePropertyMeta +from graphscope.flex.rest.models.base_vertex_type import BaseVertexType +from graphscope.flex.rest.models.base_vertex_type_x_csr_params import BaseVertexTypeXCsrParams from graphscope.flex.rest.models.column_mapping import ColumnMapping -from graphscope.flex.rest.models.connection import Connection -from graphscope.flex.rest.models.connection_status import ConnectionStatus -from graphscope.flex.rest.models.data_source import DataSource -from graphscope.flex.rest.models.deployment_info import DeploymentInfo -from graphscope.flex.rest.models.deployment_info_graphs_info_value import DeploymentInfoGraphsInfoValue -from graphscope.flex.rest.models.deployment_status import DeploymentStatus -from graphscope.flex.rest.models.edge_data_source import EdgeDataSource +from graphscope.flex.rest.models.column_mapping_column import ColumnMappingColumn +from graphscope.flex.rest.models.create_alert_receiver_request import CreateAlertReceiverRequest +from graphscope.flex.rest.models.create_alert_rule_request import CreateAlertRuleRequest +from graphscope.flex.rest.models.create_dataloading_job_response import CreateDataloadingJobResponse +from graphscope.flex.rest.models.create_edge_type import CreateEdgeType +from graphscope.flex.rest.models.create_graph_request import CreateGraphRequest +from graphscope.flex.rest.models.create_graph_response import CreateGraphResponse +from graphscope.flex.rest.models.create_graph_schema_request import CreateGraphSchemaRequest +from graphscope.flex.rest.models.create_procedure_request import CreateProcedureRequest +from graphscope.flex.rest.models.create_procedure_response import CreateProcedureResponse +from graphscope.flex.rest.models.create_property_meta import CreatePropertyMeta +from graphscope.flex.rest.models.create_vertex_type import CreateVertexType +from graphscope.flex.rest.models.dataloading_job_config import DataloadingJobConfig +from graphscope.flex.rest.models.dataloading_job_config_edges_inner import DataloadingJobConfigEdgesInner +from graphscope.flex.rest.models.dataloading_job_config_loading_config import DataloadingJobConfigLoadingConfig +from graphscope.flex.rest.models.dataloading_job_config_loading_config_format import DataloadingJobConfigLoadingConfigFormat +from graphscope.flex.rest.models.dataloading_job_config_vertices_inner import DataloadingJobConfigVerticesInner from graphscope.flex.rest.models.edge_mapping import EdgeMapping -from graphscope.flex.rest.models.edge_mapping_destination_vertex_mappings_inner import EdgeMappingDestinationVertexMappingsInner -from graphscope.flex.rest.models.edge_mapping_source_vertex_mappings_inner import EdgeMappingSourceVertexMappingsInner -from graphscope.flex.rest.models.edge_mapping_source_vertex_mappings_inner_column import EdgeMappingSourceVertexMappingsInnerColumn from graphscope.flex.rest.models.edge_mapping_type_triplet import EdgeMappingTypeTriplet -from graphscope.flex.rest.models.edge_type import EdgeType -from graphscope.flex.rest.models.edge_type_vertex_type_pair_relations_inner import EdgeTypeVertexTypePairRelationsInner -from graphscope.flex.rest.models.edge_type_vertex_type_pair_relations_inner_x_csr_params import EdgeTypeVertexTypePairRelationsInnerXCsrParams -from graphscope.flex.rest.models.graph import Graph -from graphscope.flex.rest.models.graph_stored_procedures import GraphStoredProcedures -from graphscope.flex.rest.models.groot_dataloading_job_config import GrootDataloadingJobConfig -from graphscope.flex.rest.models.groot_dataloading_job_config_edges_inner import GrootDataloadingJobConfigEdgesInner -from graphscope.flex.rest.models.groot_edge_type import GrootEdgeType -from graphscope.flex.rest.models.groot_edge_type_relations_inner import GrootEdgeTypeRelationsInner -from graphscope.flex.rest.models.groot_graph import GrootGraph -from graphscope.flex.rest.models.groot_graph_gremlin_interface import GrootGraphGremlinInterface -from graphscope.flex.rest.models.groot_property import GrootProperty -from graphscope.flex.rest.models.groot_schema import GrootSchema -from graphscope.flex.rest.models.groot_vertex_type import GrootVertexType +from graphscope.flex.rest.models.error import Error +from graphscope.flex.rest.models.gs_data_type import GSDataType +from graphscope.flex.rest.models.get_alert_message_response import GetAlertMessageResponse +from graphscope.flex.rest.models.get_alert_receiver_response import GetAlertReceiverResponse +from graphscope.flex.rest.models.get_alert_rule_response import GetAlertRuleResponse +from graphscope.flex.rest.models.get_edge_type import GetEdgeType +from graphscope.flex.rest.models.get_graph_response import GetGraphResponse +from graphscope.flex.rest.models.get_graph_schema_response import GetGraphSchemaResponse +from graphscope.flex.rest.models.get_procedure_response import GetProcedureResponse +from graphscope.flex.rest.models.get_property_meta import GetPropertyMeta +from graphscope.flex.rest.models.get_vertex_type import GetVertexType from graphscope.flex.rest.models.job_status import JobStatus -from graphscope.flex.rest.models.model_property import ModelProperty -from graphscope.flex.rest.models.model_schema import ModelSchema -from graphscope.flex.rest.models.node_status import NodeStatus -from graphscope.flex.rest.models.procedure import Procedure -from graphscope.flex.rest.models.procedure_params_inner import ProcedureParamsInner -from graphscope.flex.rest.models.property_property_type import PropertyPropertyType +from graphscope.flex.rest.models.long_text import LongText +from graphscope.flex.rest.models.parameter import Parameter +from graphscope.flex.rest.models.primitive_type import PrimitiveType +from graphscope.flex.rest.models.running_deployment_info import RunningDeploymentInfo from graphscope.flex.rest.models.schema_mapping import SchemaMapping -from graphscope.flex.rest.models.schema_mapping_loading_config import SchemaMappingLoadingConfig -from graphscope.flex.rest.models.schema_mapping_loading_config_data_source import SchemaMappingLoadingConfigDataSource -from graphscope.flex.rest.models.schema_mapping_loading_config_format import SchemaMappingLoadingConfigFormat from graphscope.flex.rest.models.service_status import ServiceStatus from graphscope.flex.rest.models.service_status_sdk_endpoints import ServiceStatusSdkEndpoints from graphscope.flex.rest.models.start_service_request import StartServiceRequest -from graphscope.flex.rest.models.update_alert_messages_request import UpdateAlertMessagesRequest -from graphscope.flex.rest.models.vertex_data_source import VertexDataSource +from graphscope.flex.rest.models.stored_procedure_meta import StoredProcedureMeta +from graphscope.flex.rest.models.string_type import StringType +from graphscope.flex.rest.models.string_type_string import StringTypeString +from graphscope.flex.rest.models.update_alert_message_status_request import UpdateAlertMessageStatusRequest +from graphscope.flex.rest.models.update_procedure_request import UpdateProcedureRequest +from graphscope.flex.rest.models.upload_file_response import UploadFileResponse from graphscope.flex.rest.models.vertex_mapping import VertexMapping -from graphscope.flex.rest.models.vertex_type import VertexType diff --git a/python/graphscope/flex/rest/api/__init__.py b/python/graphscope/flex/rest/api/__init__.py index 1394a483cf37..acdb2e891912 100644 --- a/python/graphscope/flex/rest/api/__init__.py +++ b/python/graphscope/flex/rest/api/__init__.py @@ -2,12 +2,10 @@ # import apis into api package from graphscope.flex.rest.api.alert_api import AlertApi -from graphscope.flex.rest.api.connection_api import ConnectionApi -from graphscope.flex.rest.api.datasource_api import DatasourceApi +from graphscope.flex.rest.api.data_source_api import DataSourceApi from graphscope.flex.rest.api.deployment_api import DeploymentApi from graphscope.flex.rest.api.graph_api import GraphApi from graphscope.flex.rest.api.job_api import JobApi -from graphscope.flex.rest.api.legacy_api import LegacyApi from graphscope.flex.rest.api.procedure_api import ProcedureApi from graphscope.flex.rest.api.service_api import ServiceApi from graphscope.flex.rest.api.utils_api import UtilsApi diff --git a/python/graphscope/flex/rest/api/alert_api.py b/python/graphscope/flex/rest/api/alert_api.py index 7fb1c8546b66..060a10909a23 100644 --- a/python/graphscope/flex/rest/api/alert_api.py +++ b/python/graphscope/flex/rest/api/alert_api.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -17,13 +17,15 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictStr, field_validator +from pydantic import Field, StrictInt, StrictStr, field_validator from typing import Optional from typing_extensions import Annotated -from graphscope.flex.rest.models.alert_message import AlertMessage -from graphscope.flex.rest.models.alert_receiver import AlertReceiver -from graphscope.flex.rest.models.alert_rule import AlertRule -from graphscope.flex.rest.models.update_alert_messages_request import UpdateAlertMessagesRequest +from graphscope.flex.rest.models.create_alert_receiver_request import CreateAlertReceiverRequest +from graphscope.flex.rest.models.create_alert_rule_request import CreateAlertRuleRequest +from graphscope.flex.rest.models.get_alert_message_response import GetAlertMessageResponse +from graphscope.flex.rest.models.get_alert_receiver_response import GetAlertReceiverResponse +from graphscope.flex.rest.models.get_alert_rule_response import GetAlertRuleResponse +from graphscope.flex.rest.models.update_alert_message_status_request import UpdateAlertMessageStatusRequest from graphscope.flex.rest.api_client import ApiClient, RequestSerialized from graphscope.flex.rest.api_response import ApiResponse @@ -44,9 +46,9 @@ def __init__(self, api_client=None) -> None: @validate_call - def delete_alert_rule_by_name( + def create_alert_receiver( self, - rule_name: StrictStr, + create_alert_receiver_request: CreateAlertReceiverRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -60,11 +62,12 @@ def delete_alert_rule_by_name( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> str: - """delete_alert_rule_by_name + """create_alert_receiver + Create a new alert receiver - :param rule_name: (required) - :type rule_name: str + :param create_alert_receiver_request: (required) + :type create_alert_receiver_request: CreateAlertReceiverRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -87,8 +90,8 @@ def delete_alert_rule_by_name( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_alert_rule_by_name_serialize( - rule_name=rule_name, + _param = self._create_alert_receiver_serialize( + create_alert_receiver_request=create_alert_receiver_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -97,6 +100,7 @@ def delete_alert_rule_by_name( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -110,9 +114,9 @@ def delete_alert_rule_by_name( @validate_call - def delete_alert_rule_by_name_with_http_info( + def create_alert_receiver_with_http_info( self, - rule_name: StrictStr, + create_alert_receiver_request: CreateAlertReceiverRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -126,11 +130,12 @@ def delete_alert_rule_by_name_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[str]: - """delete_alert_rule_by_name + """create_alert_receiver + Create a new alert receiver - :param rule_name: (required) - :type rule_name: str + :param create_alert_receiver_request: (required) + :type create_alert_receiver_request: CreateAlertReceiverRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -153,8 +158,8 @@ def delete_alert_rule_by_name_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_alert_rule_by_name_serialize( - rule_name=rule_name, + _param = self._create_alert_receiver_serialize( + create_alert_receiver_request=create_alert_receiver_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -163,6 +168,7 @@ def delete_alert_rule_by_name_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -176,9 +182,9 @@ def delete_alert_rule_by_name_with_http_info( @validate_call - def delete_alert_rule_by_name_without_preload_content( + def create_alert_receiver_without_preload_content( self, - rule_name: StrictStr, + create_alert_receiver_request: CreateAlertReceiverRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -192,11 +198,12 @@ def delete_alert_rule_by_name_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_alert_rule_by_name + """create_alert_receiver + Create a new alert receiver - :param rule_name: (required) - :type rule_name: str + :param create_alert_receiver_request: (required) + :type create_alert_receiver_request: CreateAlertReceiverRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -219,8 +226,8 @@ def delete_alert_rule_by_name_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_alert_rule_by_name_serialize( - rule_name=rule_name, + _param = self._create_alert_receiver_serialize( + create_alert_receiver_request=create_alert_receiver_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -229,6 +236,7 @@ def delete_alert_rule_by_name_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -237,9 +245,9 @@ def delete_alert_rule_by_name_without_preload_content( return response_data.response - def _delete_alert_rule_by_name_serialize( + def _create_alert_receiver_serialize( self, - rule_name, + create_alert_receiver_request, _request_auth, _content_type, _headers, @@ -259,12 +267,287 @@ def _delete_alert_rule_by_name_serialize( _body_params: Optional[bytes] = None # process the path parameters - if rule_name is not None: - _path_params['rule_name'] = rule_name # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if create_alert_receiver_request is not None: + _body_params = create_alert_receiver_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/alert/receiver', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_alert_message_in_batch( + self, + message_ids: Annotated[StrictStr, Field(description="A list of message id separated by comma, e.g. id1,id2,id3")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> str: + """delete_alert_message_in_batch + + Delete alert message in batch + + :param message_ids: A list of message id separated by comma, e.g. id1,id2,id3 (required) + :type message_ids: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_alert_message_in_batch_serialize( + message_ids=message_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_alert_message_in_batch_with_http_info( + self, + message_ids: Annotated[StrictStr, Field(description="A list of message id separated by comma, e.g. id1,id2,id3")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[str]: + """delete_alert_message_in_batch + + Delete alert message in batch + + :param message_ids: A list of message id separated by comma, e.g. id1,id2,id3 (required) + :type message_ids: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_alert_message_in_batch_serialize( + message_ids=message_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_alert_message_in_batch_without_preload_content( + self, + message_ids: Annotated[StrictStr, Field(description="A list of message id separated by comma, e.g. id1,id2,id3")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """delete_alert_message_in_batch + + Delete alert message in batch + + :param message_ids: A list of message id separated by comma, e.g. id1,id2,id3 (required) + :type message_ids: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_alert_message_in_batch_serialize( + message_ids=message_ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_alert_message_in_batch_serialize( + self, + message_ids, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if message_ids is not None: + + _query_params.append(('message_ids', message_ids)) + + # process the header parameters + # process the form parameters + # process the body parameter # set the HTTP header `Accept` @@ -281,7 +564,7 @@ def _delete_alert_rule_by_name_serialize( return self.api_client.param_serialize( method='DELETE', - resource_path='/api/v1/alert/rule/{rule_name}', + resource_path='/api/v1/alert/message-collection', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -298,7 +581,7 @@ def _delete_alert_rule_by_name_serialize( @validate_call - def delete_receiver_by_id( + def delete_alert_receiver_by_id( self, receiver_id: StrictStr, _request_timeout: Union[ @@ -314,8 +597,9 @@ def delete_receiver_by_id( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> str: - """delete_receiver_by_id + """delete_alert_receiver_by_id + Delete the alert receiver by ID :param receiver_id: (required) :type receiver_id: str @@ -341,7 +625,7 @@ def delete_receiver_by_id( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_receiver_by_id_serialize( + _param = self._delete_alert_receiver_by_id_serialize( receiver_id=receiver_id, _request_auth=_request_auth, _content_type=_content_type, @@ -351,7 +635,7 @@ def delete_receiver_by_id( _response_types_map: Dict[str, Optional[str]] = { '200': "str", - '404': None, + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -365,7 +649,7 @@ def delete_receiver_by_id( @validate_call - def delete_receiver_by_id_with_http_info( + def delete_alert_receiver_by_id_with_http_info( self, receiver_id: StrictStr, _request_timeout: Union[ @@ -381,8 +665,9 @@ def delete_receiver_by_id_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[str]: - """delete_receiver_by_id + """delete_alert_receiver_by_id + Delete the alert receiver by ID :param receiver_id: (required) :type receiver_id: str @@ -408,7 +693,7 @@ def delete_receiver_by_id_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_receiver_by_id_serialize( + _param = self._delete_alert_receiver_by_id_serialize( receiver_id=receiver_id, _request_auth=_request_auth, _content_type=_content_type, @@ -418,7 +703,7 @@ def delete_receiver_by_id_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "str", - '404': None, + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -432,7 +717,7 @@ def delete_receiver_by_id_with_http_info( @validate_call - def delete_receiver_by_id_without_preload_content( + def delete_alert_receiver_by_id_without_preload_content( self, receiver_id: StrictStr, _request_timeout: Union[ @@ -448,8 +733,9 @@ def delete_receiver_by_id_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_receiver_by_id + """delete_alert_receiver_by_id + Delete the alert receiver by ID :param receiver_id: (required) :type receiver_id: str @@ -475,7 +761,7 @@ def delete_receiver_by_id_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_receiver_by_id_serialize( + _param = self._delete_alert_receiver_by_id_serialize( receiver_id=receiver_id, _request_auth=_request_auth, _content_type=_content_type, @@ -485,7 +771,7 @@ def delete_receiver_by_id_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "str", - '404': None, + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -494,7 +780,7 @@ def delete_receiver_by_id_without_preload_content( return response_data.response - def _delete_receiver_by_id_serialize( + def _delete_alert_receiver_by_id_serialize( self, receiver_id, _request_auth, @@ -555,13 +841,9 @@ def _delete_receiver_by_id_serialize( @validate_call - def list_alert_messages( + def delete_alert_rule_by_id( self, - alert_type: Optional[StrictStr] = None, - status: Optional[StrictStr] = None, - severity: Optional[StrictStr] = None, - start_time: Annotated[Optional[StrictStr], Field(description="format with \"2023-02-21-11-56-30\"")] = None, - end_time: Annotated[Optional[StrictStr], Field(description="format with \"2023-02-21-11-56-30\"")] = None, + rule_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -574,20 +856,12 @@ def list_alert_messages( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[AlertMessage]: - """list_alert_messages + ) -> str: + """delete_alert_rule_by_id - :param alert_type: - :type alert_type: str - :param status: - :type status: str - :param severity: - :type severity: str - :param start_time: format with \"2023-02-21-11-56-30\" - :type start_time: str - :param end_time: format with \"2023-02-21-11-56-30\" - :type end_time: str + :param rule_id: (required) + :type rule_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -607,15 +881,11 @@ def list_alert_messages( request; this effectively ignores the host_index in the spec for a single request. :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_alert_messages_serialize( - alert_type=alert_type, - status=status, - severity=severity, - start_time=start_time, - end_time=end_time, + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_alert_rule_by_id_serialize( + rule_id=rule_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -623,7 +893,8 @@ def list_alert_messages( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[AlertMessage]", + '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -637,13 +908,9 @@ def list_alert_messages( @validate_call - def list_alert_messages_with_http_info( + def delete_alert_rule_by_id_with_http_info( self, - alert_type: Optional[StrictStr] = None, - status: Optional[StrictStr] = None, - severity: Optional[StrictStr] = None, - start_time: Annotated[Optional[StrictStr], Field(description="format with \"2023-02-21-11-56-30\"")] = None, - end_time: Annotated[Optional[StrictStr], Field(description="format with \"2023-02-21-11-56-30\"")] = None, + rule_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -656,20 +923,12 @@ def list_alert_messages_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[AlertMessage]]: - """list_alert_messages + ) -> ApiResponse[str]: + """delete_alert_rule_by_id - :param alert_type: - :type alert_type: str - :param status: - :type status: str - :param severity: - :type severity: str - :param start_time: format with \"2023-02-21-11-56-30\" - :type start_time: str - :param end_time: format with \"2023-02-21-11-56-30\" - :type end_time: str + :param rule_id: (required) + :type rule_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -692,12 +951,8 @@ def list_alert_messages_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alert_messages_serialize( - alert_type=alert_type, - status=status, - severity=severity, - start_time=start_time, - end_time=end_time, + _param = self._delete_alert_rule_by_id_serialize( + rule_id=rule_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -705,7 +960,8 @@ def list_alert_messages_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[AlertMessage]", + '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -719,13 +975,9 @@ def list_alert_messages_with_http_info( @validate_call - def list_alert_messages_without_preload_content( + def delete_alert_rule_by_id_without_preload_content( self, - alert_type: Optional[StrictStr] = None, - status: Optional[StrictStr] = None, - severity: Optional[StrictStr] = None, - start_time: Annotated[Optional[StrictStr], Field(description="format with \"2023-02-21-11-56-30\"")] = None, - end_time: Annotated[Optional[StrictStr], Field(description="format with \"2023-02-21-11-56-30\"")] = None, + rule_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -739,19 +991,11 @@ def list_alert_messages_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """list_alert_messages + """delete_alert_rule_by_id - :param alert_type: - :type alert_type: str - :param status: - :type status: str - :param severity: - :type severity: str - :param start_time: format with \"2023-02-21-11-56-30\" - :type start_time: str - :param end_time: format with \"2023-02-21-11-56-30\" - :type end_time: str + :param rule_id: (required) + :type rule_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -774,12 +1018,8 @@ def list_alert_messages_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alert_messages_serialize( - alert_type=alert_type, - status=status, - severity=severity, - start_time=start_time, - end_time=end_time, + _param = self._delete_alert_rule_by_id_serialize( + rule_id=rule_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -787,7 +1027,8 @@ def list_alert_messages_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[AlertMessage]", + '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -796,13 +1037,9 @@ def list_alert_messages_without_preload_content( return response_data.response - def _list_alert_messages_serialize( + def _delete_alert_rule_by_id_serialize( self, - alert_type, - status, - severity, - start_time, - end_time, + rule_id, _request_auth, _content_type, _headers, @@ -822,27 +1059,9 @@ def _list_alert_messages_serialize( _body_params: Optional[bytes] = None # process the path parameters + if rule_id is not None: + _path_params['rule_id'] = rule_id # process the query parameters - if alert_type is not None: - - _query_params.append(('alert_type', alert_type)) - - if status is not None: - - _query_params.append(('status', status)) - - if severity is not None: - - _query_params.append(('severity', severity)) - - if start_time is not None: - - _query_params.append(('start_time', start_time)) - - if end_time is not None: - - _query_params.append(('end_time', end_time)) - # process the header parameters # process the form parameters # process the body parameter @@ -861,8 +1080,8 @@ def _list_alert_messages_serialize( ] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/alert/message', + method='DELETE', + resource_path='/api/v1/alert/rule/{rule_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -879,8 +1098,14 @@ def _list_alert_messages_serialize( @validate_call - def list_alert_rules( + def list_alert_messages( self, + alert_type: Optional[StrictStr] = None, + status: Optional[StrictStr] = None, + severity: Optional[StrictStr] = None, + start_time: Annotated[Optional[StrictStr], Field(description="format with \"2023-02-21-11-56-30\"")] = None, + end_time: Annotated[Optional[StrictStr], Field(description="format with \"2023-02-21-11-56-30\"")] = None, + limit: Optional[StrictInt] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -893,10 +1118,23 @@ def list_alert_rules( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[AlertRule]: - """list_alert_rules + ) -> List[GetAlertMessageResponse]: + """list_alert_messages + List all alert messages + :param alert_type: + :type alert_type: str + :param status: + :type status: str + :param severity: + :type severity: str + :param start_time: format with \"2023-02-21-11-56-30\" + :type start_time: str + :param end_time: format with \"2023-02-21-11-56-30\" + :type end_time: str + :param limit: + :type limit: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -919,7 +1157,13 @@ def list_alert_rules( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alert_rules_serialize( + _param = self._list_alert_messages_serialize( + alert_type=alert_type, + status=status, + severity=severity, + start_time=start_time, + end_time=end_time, + limit=limit, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -927,7 +1171,8 @@ def list_alert_rules( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[AlertRule]", + '200': "List[GetAlertMessageResponse]", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -941,8 +1186,14 @@ def list_alert_rules( @validate_call - def list_alert_rules_with_http_info( + def list_alert_messages_with_http_info( self, + alert_type: Optional[StrictStr] = None, + status: Optional[StrictStr] = None, + severity: Optional[StrictStr] = None, + start_time: Annotated[Optional[StrictStr], Field(description="format with \"2023-02-21-11-56-30\"")] = None, + end_time: Annotated[Optional[StrictStr], Field(description="format with \"2023-02-21-11-56-30\"")] = None, + limit: Optional[StrictInt] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -955,10 +1206,23 @@ def list_alert_rules_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[AlertRule]]: - """list_alert_rules + ) -> ApiResponse[List[GetAlertMessageResponse]]: + """list_alert_messages + List all alert messages + :param alert_type: + :type alert_type: str + :param status: + :type status: str + :param severity: + :type severity: str + :param start_time: format with \"2023-02-21-11-56-30\" + :type start_time: str + :param end_time: format with \"2023-02-21-11-56-30\" + :type end_time: str + :param limit: + :type limit: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -981,7 +1245,13 @@ def list_alert_rules_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alert_rules_serialize( + _param = self._list_alert_messages_serialize( + alert_type=alert_type, + status=status, + severity=severity, + start_time=start_time, + end_time=end_time, + limit=limit, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -989,7 +1259,8 @@ def list_alert_rules_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[AlertRule]", + '200': "List[GetAlertMessageResponse]", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1003,8 +1274,14 @@ def list_alert_rules_with_http_info( @validate_call - def list_alert_rules_without_preload_content( + def list_alert_messages_without_preload_content( self, + alert_type: Optional[StrictStr] = None, + status: Optional[StrictStr] = None, + severity: Optional[StrictStr] = None, + start_time: Annotated[Optional[StrictStr], Field(description="format with \"2023-02-21-11-56-30\"")] = None, + end_time: Annotated[Optional[StrictStr], Field(description="format with \"2023-02-21-11-56-30\"")] = None, + limit: Optional[StrictInt] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1018,9 +1295,22 @@ def list_alert_rules_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """list_alert_rules + """list_alert_messages + List all alert messages + :param alert_type: + :type alert_type: str + :param status: + :type status: str + :param severity: + :type severity: str + :param start_time: format with \"2023-02-21-11-56-30\" + :type start_time: str + :param end_time: format with \"2023-02-21-11-56-30\" + :type end_time: str + :param limit: + :type limit: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1043,7 +1333,13 @@ def list_alert_rules_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_alert_rules_serialize( + _param = self._list_alert_messages_serialize( + alert_type=alert_type, + status=status, + severity=severity, + start_time=start_time, + end_time=end_time, + limit=limit, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1051,7 +1347,8 @@ def list_alert_rules_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[AlertRule]", + '200': "List[GetAlertMessageResponse]", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1060,8 +1357,14 @@ def list_alert_rules_without_preload_content( return response_data.response - def _list_alert_rules_serialize( + def _list_alert_messages_serialize( self, + alert_type, + status, + severity, + start_time, + end_time, + limit, _request_auth, _content_type, _headers, @@ -1082,6 +1385,30 @@ def _list_alert_rules_serialize( # process the path parameters # process the query parameters + if alert_type is not None: + + _query_params.append(('alert_type', alert_type)) + + if status is not None: + + _query_params.append(('status', status)) + + if severity is not None: + + _query_params.append(('severity', severity)) + + if start_time is not None: + + _query_params.append(('start_time', start_time)) + + if end_time is not None: + + _query_params.append(('end_time', end_time)) + + if limit is not None: + + _query_params.append(('limit', limit)) + # process the header parameters # process the form parameters # process the body parameter @@ -1101,7 +1428,7 @@ def _list_alert_rules_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/alert/rule', + resource_path='/api/v1/alert/message', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1118,7 +1445,7 @@ def _list_alert_rules_serialize( @validate_call - def list_receivers( + def list_alert_receivers( self, _request_timeout: Union[ None, @@ -1132,9 +1459,10 @@ def list_receivers( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[AlertReceiver]: - """list_receivers + ) -> List[GetAlertReceiverResponse]: + """list_alert_receivers + List all alert receivers :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1158,7 +1486,7 @@ def list_receivers( :return: Returns the result object. """ # noqa: E501 - _param = self._list_receivers_serialize( + _param = self._list_alert_receivers_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1166,7 +1494,8 @@ def list_receivers( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[AlertReceiver]", + '200': "List[GetAlertReceiverResponse]", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1180,7 +1509,7 @@ def list_receivers( @validate_call - def list_receivers_with_http_info( + def list_alert_receivers_with_http_info( self, _request_timeout: Union[ None, @@ -1194,9 +1523,10 @@ def list_receivers_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[AlertReceiver]]: - """list_receivers + ) -> ApiResponse[List[GetAlertReceiverResponse]]: + """list_alert_receivers + List all alert receivers :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1220,7 +1550,7 @@ def list_receivers_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_receivers_serialize( + _param = self._list_alert_receivers_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1228,7 +1558,8 @@ def list_receivers_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[AlertReceiver]", + '200': "List[GetAlertReceiverResponse]", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1242,7 +1573,7 @@ def list_receivers_with_http_info( @validate_call - def list_receivers_without_preload_content( + def list_alert_receivers_without_preload_content( self, _request_timeout: Union[ None, @@ -1257,8 +1588,9 @@ def list_receivers_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """list_receivers + """list_alert_receivers + List all alert receivers :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1282,7 +1614,7 @@ def list_receivers_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_receivers_serialize( + _param = self._list_alert_receivers_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1290,7 +1622,8 @@ def list_receivers_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[AlertReceiver]", + '200': "List[GetAlertReceiverResponse]", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1299,7 +1632,7 @@ def list_receivers_without_preload_content( return response_data.response - def _list_receivers_serialize( + def _list_alert_receivers_serialize( self, _request_auth, _content_type, @@ -1357,9 +1690,8 @@ def _list_receivers_serialize( @validate_call - def register_receiver( + def list_alert_rules( self, - alert_receiver: AlertReceiver, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1372,12 +1704,11 @@ def register_receiver( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> str: - """register_receiver + ) -> List[GetAlertRuleResponse]: + """list_alert_rules + List all alert rules - :param alert_receiver: (required) - :type alert_receiver: AlertReceiver :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1400,8 +1731,7 @@ def register_receiver( :return: Returns the result object. """ # noqa: E501 - _param = self._register_receiver_serialize( - alert_receiver=alert_receiver, + _param = self._list_alert_rules_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1409,7 +1739,8 @@ def register_receiver( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "str", + '200': "List[GetAlertRuleResponse]", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1423,9 +1754,8 @@ def register_receiver( @validate_call - def register_receiver_with_http_info( + def list_alert_rules_with_http_info( self, - alert_receiver: AlertReceiver, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1438,12 +1768,11 @@ def register_receiver_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[str]: - """register_receiver + ) -> ApiResponse[List[GetAlertRuleResponse]]: + """list_alert_rules + List all alert rules - :param alert_receiver: (required) - :type alert_receiver: AlertReceiver :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1466,8 +1795,7 @@ def register_receiver_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._register_receiver_serialize( - alert_receiver=alert_receiver, + _param = self._list_alert_rules_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1475,7 +1803,8 @@ def register_receiver_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "str", + '200': "List[GetAlertRuleResponse]", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1489,9 +1818,8 @@ def register_receiver_with_http_info( @validate_call - def register_receiver_without_preload_content( + def list_alert_rules_without_preload_content( self, - alert_receiver: AlertReceiver, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1505,11 +1833,10 @@ def register_receiver_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """register_receiver + """list_alert_rules + List all alert rules - :param alert_receiver: (required) - :type alert_receiver: AlertReceiver :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1532,8 +1859,7 @@ def register_receiver_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._register_receiver_serialize( - alert_receiver=alert_receiver, + _param = self._list_alert_rules_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1541,7 +1867,8 @@ def register_receiver_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "str", + '200': "List[GetAlertRuleResponse]", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1550,9 +1877,8 @@ def register_receiver_without_preload_content( return response_data.response - def _register_receiver_serialize( + def _list_alert_rules_serialize( self, - alert_receiver, _request_auth, _content_type, _headers, @@ -1576,8 +1902,6 @@ def _register_receiver_serialize( # process the header parameters # process the form parameters # process the body parameter - if alert_receiver is not None: - _body_params = alert_receiver # set the HTTP header `Accept` @@ -1587,27 +1911,14 @@ def _register_receiver_serialize( ] ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ ] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/alert/receiver', + method='GET', + resource_path='/api/v1/alert/rule', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1624,9 +1935,9 @@ def _register_receiver_serialize( @validate_call - def update_alert_messages( + def update_alert_message_in_batch( self, - update_alert_messages_request: Optional[UpdateAlertMessagesRequest] = None, + update_alert_message_status_request: Optional[UpdateAlertMessageStatusRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1640,12 +1951,12 @@ def update_alert_messages( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> str: - """update_alert_messages + """update_alert_message_in_batch - Update alert messages in batch + Update the message status in batch - :param update_alert_messages_request: - :type update_alert_messages_request: UpdateAlertMessagesRequest + :param update_alert_message_status_request: + :type update_alert_message_status_request: UpdateAlertMessageStatusRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1668,8 +1979,8 @@ def update_alert_messages( :return: Returns the result object. """ # noqa: E501 - _param = self._update_alert_messages_serialize( - update_alert_messages_request=update_alert_messages_request, + _param = self._update_alert_message_in_batch_serialize( + update_alert_message_status_request=update_alert_message_status_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1678,7 +1989,7 @@ def update_alert_messages( _response_types_map: Dict[str, Optional[str]] = { '200': "str", - '404': None, + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1692,9 +2003,9 @@ def update_alert_messages( @validate_call - def update_alert_messages_with_http_info( + def update_alert_message_in_batch_with_http_info( self, - update_alert_messages_request: Optional[UpdateAlertMessagesRequest] = None, + update_alert_message_status_request: Optional[UpdateAlertMessageStatusRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1708,12 +2019,12 @@ def update_alert_messages_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[str]: - """update_alert_messages + """update_alert_message_in_batch - Update alert messages in batch + Update the message status in batch - :param update_alert_messages_request: - :type update_alert_messages_request: UpdateAlertMessagesRequest + :param update_alert_message_status_request: + :type update_alert_message_status_request: UpdateAlertMessageStatusRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1736,8 +2047,8 @@ def update_alert_messages_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_alert_messages_serialize( - update_alert_messages_request=update_alert_messages_request, + _param = self._update_alert_message_in_batch_serialize( + update_alert_message_status_request=update_alert_message_status_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1746,7 +2057,7 @@ def update_alert_messages_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "str", - '404': None, + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1760,9 +2071,9 @@ def update_alert_messages_with_http_info( @validate_call - def update_alert_messages_without_preload_content( + def update_alert_message_in_batch_without_preload_content( self, - update_alert_messages_request: Optional[UpdateAlertMessagesRequest] = None, + update_alert_message_status_request: Optional[UpdateAlertMessageStatusRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1776,12 +2087,12 @@ def update_alert_messages_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """update_alert_messages + """update_alert_message_in_batch - Update alert messages in batch + Update the message status in batch - :param update_alert_messages_request: - :type update_alert_messages_request: UpdateAlertMessagesRequest + :param update_alert_message_status_request: + :type update_alert_message_status_request: UpdateAlertMessageStatusRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1804,8 +2115,8 @@ def update_alert_messages_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._update_alert_messages_serialize( - update_alert_messages_request=update_alert_messages_request, + _param = self._update_alert_message_in_batch_serialize( + update_alert_message_status_request=update_alert_message_status_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1814,7 +2125,7 @@ def update_alert_messages_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "str", - '404': None, + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1823,9 +2134,9 @@ def update_alert_messages_without_preload_content( return response_data.response - def _update_alert_messages_serialize( + def _update_alert_message_in_batch_serialize( self, - update_alert_messages_request, + update_alert_message_status_request, _request_auth, _content_type, _headers, @@ -1849,8 +2160,8 @@ def _update_alert_messages_serialize( # process the header parameters # process the form parameters # process the body parameter - if update_alert_messages_request is not None: - _body_params = update_alert_messages_request + if update_alert_message_status_request is not None: + _body_params = update_alert_message_status_request # set the HTTP header `Accept` @@ -1880,7 +2191,7 @@ def _update_alert_messages_serialize( return self.api_client.param_serialize( method='PUT', - resource_path='/api/v1/alert/message', + resource_path='/api/v1/alert/message-collection/status', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1897,10 +2208,10 @@ def _update_alert_messages_serialize( @validate_call - def update_alert_rule_by_name( + def update_alert_receiver_by_id( self, - rule_name: StrictStr, - alert_rule: Optional[AlertRule] = None, + receiver_id: StrictStr, + create_alert_receiver_request: Optional[CreateAlertReceiverRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1914,13 +2225,14 @@ def update_alert_rule_by_name( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> str: - """update_alert_rule_by_name + """update_alert_receiver_by_id + Update alert receiver by ID - :param rule_name: (required) - :type rule_name: str - :param alert_rule: - :type alert_rule: AlertRule + :param receiver_id: (required) + :type receiver_id: str + :param create_alert_receiver_request: + :type create_alert_receiver_request: CreateAlertReceiverRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1943,9 +2255,9 @@ def update_alert_rule_by_name( :return: Returns the result object. """ # noqa: E501 - _param = self._update_alert_rule_by_name_serialize( - rule_name=rule_name, - alert_rule=alert_rule, + _param = self._update_alert_receiver_by_id_serialize( + receiver_id=receiver_id, + create_alert_receiver_request=create_alert_receiver_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1954,6 +2266,7 @@ def update_alert_rule_by_name( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1967,10 +2280,10 @@ def update_alert_rule_by_name( @validate_call - def update_alert_rule_by_name_with_http_info( + def update_alert_receiver_by_id_with_http_info( self, - rule_name: StrictStr, - alert_rule: Optional[AlertRule] = None, + receiver_id: StrictStr, + create_alert_receiver_request: Optional[CreateAlertReceiverRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1984,13 +2297,14 @@ def update_alert_rule_by_name_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[str]: - """update_alert_rule_by_name + """update_alert_receiver_by_id + Update alert receiver by ID - :param rule_name: (required) - :type rule_name: str - :param alert_rule: - :type alert_rule: AlertRule + :param receiver_id: (required) + :type receiver_id: str + :param create_alert_receiver_request: + :type create_alert_receiver_request: CreateAlertReceiverRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2013,9 +2327,9 @@ def update_alert_rule_by_name_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_alert_rule_by_name_serialize( - rule_name=rule_name, - alert_rule=alert_rule, + _param = self._update_alert_receiver_by_id_serialize( + receiver_id=receiver_id, + create_alert_receiver_request=create_alert_receiver_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2024,6 +2338,7 @@ def update_alert_rule_by_name_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -2037,10 +2352,10 @@ def update_alert_rule_by_name_with_http_info( @validate_call - def update_alert_rule_by_name_without_preload_content( + def update_alert_receiver_by_id_without_preload_content( self, - rule_name: StrictStr, - alert_rule: Optional[AlertRule] = None, + receiver_id: StrictStr, + create_alert_receiver_request: Optional[CreateAlertReceiverRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2054,13 +2369,14 @@ def update_alert_rule_by_name_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """update_alert_rule_by_name + """update_alert_receiver_by_id + Update alert receiver by ID - :param rule_name: (required) - :type rule_name: str - :param alert_rule: - :type alert_rule: AlertRule + :param receiver_id: (required) + :type receiver_id: str + :param create_alert_receiver_request: + :type create_alert_receiver_request: CreateAlertReceiverRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2083,9 +2399,9 @@ def update_alert_rule_by_name_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._update_alert_rule_by_name_serialize( - rule_name=rule_name, - alert_rule=alert_rule, + _param = self._update_alert_receiver_by_id_serialize( + receiver_id=receiver_id, + create_alert_receiver_request=create_alert_receiver_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2094,6 +2410,7 @@ def update_alert_rule_by_name_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -2102,10 +2419,10 @@ def update_alert_rule_by_name_without_preload_content( return response_data.response - def _update_alert_rule_by_name_serialize( + def _update_alert_receiver_by_id_serialize( self, - rule_name, - alert_rule, + receiver_id, + create_alert_receiver_request, _request_auth, _content_type, _headers, @@ -2125,14 +2442,14 @@ def _update_alert_rule_by_name_serialize( _body_params: Optional[bytes] = None # process the path parameters - if rule_name is not None: - _path_params['rule_name'] = rule_name + if receiver_id is not None: + _path_params['receiver_id'] = receiver_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if alert_rule is not None: - _body_params = alert_rule + if create_alert_receiver_request is not None: + _body_params = create_alert_receiver_request # set the HTTP header `Accept` @@ -2162,7 +2479,7 @@ def _update_alert_rule_by_name_serialize( return self.api_client.param_serialize( method='PUT', - resource_path='/api/v1/alert/rule/{rule_name}', + resource_path='/api/v1/alert/receiver/{receiver_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2179,10 +2496,10 @@ def _update_alert_rule_by_name_serialize( @validate_call - def update_receiver_by_id( + def update_alert_rule_by_id( self, - receiver_id: StrictStr, - alert_receiver: Optional[AlertReceiver] = None, + rule_id: StrictStr, + create_alert_rule_request: Optional[CreateAlertRuleRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2196,13 +2513,13 @@ def update_receiver_by_id( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> str: - """update_receiver_by_id + """update_alert_rule_by_id - :param receiver_id: (required) - :type receiver_id: str - :param alert_receiver: - :type alert_receiver: AlertReceiver + :param rule_id: (required) + :type rule_id: str + :param create_alert_rule_request: + :type create_alert_rule_request: CreateAlertRuleRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2225,9 +2542,9 @@ def update_receiver_by_id( :return: Returns the result object. """ # noqa: E501 - _param = self._update_receiver_by_id_serialize( - receiver_id=receiver_id, - alert_receiver=alert_receiver, + _param = self._update_alert_rule_by_id_serialize( + rule_id=rule_id, + create_alert_rule_request=create_alert_rule_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2236,7 +2553,7 @@ def update_receiver_by_id( _response_types_map: Dict[str, Optional[str]] = { '200': "str", - '404': None, + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -2250,10 +2567,10 @@ def update_receiver_by_id( @validate_call - def update_receiver_by_id_with_http_info( + def update_alert_rule_by_id_with_http_info( self, - receiver_id: StrictStr, - alert_receiver: Optional[AlertReceiver] = None, + rule_id: StrictStr, + create_alert_rule_request: Optional[CreateAlertRuleRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2267,13 +2584,13 @@ def update_receiver_by_id_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[str]: - """update_receiver_by_id + """update_alert_rule_by_id - :param receiver_id: (required) - :type receiver_id: str - :param alert_receiver: - :type alert_receiver: AlertReceiver + :param rule_id: (required) + :type rule_id: str + :param create_alert_rule_request: + :type create_alert_rule_request: CreateAlertRuleRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2296,9 +2613,9 @@ def update_receiver_by_id_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_receiver_by_id_serialize( - receiver_id=receiver_id, - alert_receiver=alert_receiver, + _param = self._update_alert_rule_by_id_serialize( + rule_id=rule_id, + create_alert_rule_request=create_alert_rule_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2307,7 +2624,7 @@ def update_receiver_by_id_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "str", - '404': None, + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -2321,10 +2638,10 @@ def update_receiver_by_id_with_http_info( @validate_call - def update_receiver_by_id_without_preload_content( + def update_alert_rule_by_id_without_preload_content( self, - receiver_id: StrictStr, - alert_receiver: Optional[AlertReceiver] = None, + rule_id: StrictStr, + create_alert_rule_request: Optional[CreateAlertRuleRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2338,13 +2655,13 @@ def update_receiver_by_id_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """update_receiver_by_id + """update_alert_rule_by_id - :param receiver_id: (required) - :type receiver_id: str - :param alert_receiver: - :type alert_receiver: AlertReceiver + :param rule_id: (required) + :type rule_id: str + :param create_alert_rule_request: + :type create_alert_rule_request: CreateAlertRuleRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2367,9 +2684,9 @@ def update_receiver_by_id_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._update_receiver_by_id_serialize( - receiver_id=receiver_id, - alert_receiver=alert_receiver, + _param = self._update_alert_rule_by_id_serialize( + rule_id=rule_id, + create_alert_rule_request=create_alert_rule_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2378,7 +2695,7 @@ def update_receiver_by_id_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "str", - '404': None, + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -2387,10 +2704,10 @@ def update_receiver_by_id_without_preload_content( return response_data.response - def _update_receiver_by_id_serialize( + def _update_alert_rule_by_id_serialize( self, - receiver_id, - alert_receiver, + rule_id, + create_alert_rule_request, _request_auth, _content_type, _headers, @@ -2410,14 +2727,14 @@ def _update_receiver_by_id_serialize( _body_params: Optional[bytes] = None # process the path parameters - if receiver_id is not None: - _path_params['receiver_id'] = receiver_id + if rule_id is not None: + _path_params['rule_id'] = rule_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if alert_receiver is not None: - _body_params = alert_receiver + if create_alert_rule_request is not None: + _body_params = create_alert_rule_request # set the HTTP header `Accept` @@ -2447,7 +2764,7 @@ def _update_receiver_by_id_serialize( return self.api_client.param_serialize( method='PUT', - resource_path='/api/v1/alert/receiver/{receiver_id}', + resource_path='/api/v1/alert/rule/{rule_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/python/graphscope/flex/rest/api/connection_api.py b/python/graphscope/flex/rest/api/connection_api.py deleted file mode 100644 index f1a5322c8656..000000000000 --- a/python/graphscope/flex/rest/api/connection_api.py +++ /dev/null @@ -1,550 +0,0 @@ -# coding: utf-8 - -""" - GraphScope FLEX HTTP SERVICE API - - 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) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from graphscope.flex.rest.models.connection import Connection -from graphscope.flex.rest.models.connection_status import ConnectionStatus - -from graphscope.flex.rest.api_client import ApiClient, RequestSerialized -from graphscope.flex.rest.api_response import ApiResponse -from graphscope.flex.rest.rest import RESTResponseType - - -class ConnectionApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def close( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> str: - """close - - Close the connection with coordinator - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._close_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def close_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[str]: - """close - - Close the connection with coordinator - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._close_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def close_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """close - - Close the connection with coordinator - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._close_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _close_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/connection', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def connect( - self, - connection: Connection, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ConnectionStatus: - """connect - - Connect to coordinator service - - :param connection: (required) - :type connection: Connection - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._connect_serialize( - connection=connection, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ConnectionStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def connect_with_http_info( - self, - connection: Connection, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ConnectionStatus]: - """connect - - Connect to coordinator service - - :param connection: (required) - :type connection: Connection - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._connect_serialize( - connection=connection, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ConnectionStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def connect_without_preload_content( - self, - connection: Connection, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """connect - - Connect to coordinator service - - :param connection: (required) - :type connection: Connection - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._connect_serialize( - connection=connection, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "ConnectionStatus", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _connect_serialize( - self, - connection, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if connection is not None: - _body_params = connection - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/connection', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/python/graphscope/flex/rest/api/legacy_api.py b/python/graphscope/flex/rest/api/data_source_api.py similarity index 80% rename from python/graphscope/flex/rest/api/legacy_api.py rename to python/graphscope/flex/rest/api/data_source_api.py index b1f32984004e..13b53166d849 100644 --- a/python/graphscope/flex/rest/api/legacy_api.py +++ b/python/graphscope/flex/rest/api/data_source_api.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,16 +18,14 @@ from typing_extensions import Annotated from pydantic import StrictStr -from graphscope.flex.rest.models.groot_dataloading_job_config import GrootDataloadingJobConfig -from graphscope.flex.rest.models.groot_graph import GrootGraph -from graphscope.flex.rest.models.groot_schema import GrootSchema +from graphscope.flex.rest.models.schema_mapping import SchemaMapping from graphscope.flex.rest.api_client import ApiClient, RequestSerialized from graphscope.flex.rest.api_response import ApiResponse from graphscope.flex.rest.rest import RESTResponseType -class LegacyApi: +class DataSourceApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech @@ -41,10 +39,10 @@ def __init__(self, api_client=None) -> None: @validate_call - def create_groot_dataloading_job( + def bind_datasource_in_batch( self, - graph_name: StrictStr, - groot_dataloading_job_config: GrootDataloadingJobConfig, + graph_id: StrictStr, + schema_mapping: SchemaMapping, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -58,13 +56,14 @@ def create_groot_dataloading_job( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> str: - """create_groot_dataloading_job + """bind_datasource_in_batch + Bind data sources in batches - :param graph_name: (required) - :type graph_name: str - :param groot_dataloading_job_config: (required) - :type groot_dataloading_job_config: GrootDataloadingJobConfig + :param graph_id: (required) + :type graph_id: str + :param schema_mapping: (required) + :type schema_mapping: SchemaMapping :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -87,9 +86,9 @@ def create_groot_dataloading_job( :return: Returns the result object. """ # noqa: E501 - _param = self._create_groot_dataloading_job_serialize( - graph_name=graph_name, - groot_dataloading_job_config=groot_dataloading_job_config, + _param = self._bind_datasource_in_batch_serialize( + graph_id=graph_id, + schema_mapping=schema_mapping, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -98,6 +97,8 @@ def create_groot_dataloading_job( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '400': "Error", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -111,10 +112,10 @@ def create_groot_dataloading_job( @validate_call - def create_groot_dataloading_job_with_http_info( + def bind_datasource_in_batch_with_http_info( self, - graph_name: StrictStr, - groot_dataloading_job_config: GrootDataloadingJobConfig, + graph_id: StrictStr, + schema_mapping: SchemaMapping, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -128,13 +129,14 @@ def create_groot_dataloading_job_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[str]: - """create_groot_dataloading_job + """bind_datasource_in_batch + Bind data sources in batches - :param graph_name: (required) - :type graph_name: str - :param groot_dataloading_job_config: (required) - :type groot_dataloading_job_config: GrootDataloadingJobConfig + :param graph_id: (required) + :type graph_id: str + :param schema_mapping: (required) + :type schema_mapping: SchemaMapping :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -157,9 +159,9 @@ def create_groot_dataloading_job_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_groot_dataloading_job_serialize( - graph_name=graph_name, - groot_dataloading_job_config=groot_dataloading_job_config, + _param = self._bind_datasource_in_batch_serialize( + graph_id=graph_id, + schema_mapping=schema_mapping, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -168,6 +170,8 @@ def create_groot_dataloading_job_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '400': "Error", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -181,10 +185,10 @@ def create_groot_dataloading_job_with_http_info( @validate_call - def create_groot_dataloading_job_without_preload_content( + def bind_datasource_in_batch_without_preload_content( self, - graph_name: StrictStr, - groot_dataloading_job_config: GrootDataloadingJobConfig, + graph_id: StrictStr, + schema_mapping: SchemaMapping, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -198,13 +202,14 @@ def create_groot_dataloading_job_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """create_groot_dataloading_job + """bind_datasource_in_batch + Bind data sources in batches - :param graph_name: (required) - :type graph_name: str - :param groot_dataloading_job_config: (required) - :type groot_dataloading_job_config: GrootDataloadingJobConfig + :param graph_id: (required) + :type graph_id: str + :param schema_mapping: (required) + :type schema_mapping: SchemaMapping :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -227,9 +232,9 @@ def create_groot_dataloading_job_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._create_groot_dataloading_job_serialize( - graph_name=graph_name, - groot_dataloading_job_config=groot_dataloading_job_config, + _param = self._bind_datasource_in_batch_serialize( + graph_id=graph_id, + schema_mapping=schema_mapping, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -238,6 +243,8 @@ def create_groot_dataloading_job_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '400': "Error", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -246,10 +253,10 @@ def create_groot_dataloading_job_without_preload_content( return response_data.response - def _create_groot_dataloading_job_serialize( + def _bind_datasource_in_batch_serialize( self, - graph_name, - groot_dataloading_job_config, + graph_id, + schema_mapping, _request_auth, _content_type, _headers, @@ -269,14 +276,14 @@ def _create_groot_dataloading_job_serialize( _body_params: Optional[bytes] = None # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name + if graph_id is not None: + _path_params['graph_id'] = graph_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if groot_dataloading_job_config is not None: - _body_params = groot_dataloading_job_config + if schema_mapping is not None: + _body_params = schema_mapping # set the HTTP header `Accept` @@ -306,7 +313,7 @@ def _create_groot_dataloading_job_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/api/v1/groot/graph/{graph_name}/dataloading', + resource_path='/api/v1/graph/{graph_id}/datasource', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -323,9 +330,9 @@ def _create_groot_dataloading_job_serialize( @validate_call - def get_groot_schema( + def get_datasource_by_id( self, - graph_name: StrictStr, + graph_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -338,13 +345,13 @@ def get_groot_schema( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GrootSchema: - """get_groot_schema + ) -> SchemaMapping: + """get_datasource_by_id - Get graph schema by name + Get data source by ID - :param graph_name: (required) - :type graph_name: str + :param graph_id: (required) + :type graph_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -367,8 +374,8 @@ def get_groot_schema( :return: Returns the result object. """ # noqa: E501 - _param = self._get_groot_schema_serialize( - graph_name=graph_name, + _param = self._get_datasource_by_id_serialize( + graph_id=graph_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -376,7 +383,8 @@ def get_groot_schema( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GrootSchema", + '200': "SchemaMapping", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -390,9 +398,9 @@ def get_groot_schema( @validate_call - def get_groot_schema_with_http_info( + def get_datasource_by_id_with_http_info( self, - graph_name: StrictStr, + graph_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -405,13 +413,13 @@ def get_groot_schema_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GrootSchema]: - """get_groot_schema + ) -> ApiResponse[SchemaMapping]: + """get_datasource_by_id - Get graph schema by name + Get data source by ID - :param graph_name: (required) - :type graph_name: str + :param graph_id: (required) + :type graph_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -434,8 +442,8 @@ def get_groot_schema_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_groot_schema_serialize( - graph_name=graph_name, + _param = self._get_datasource_by_id_serialize( + graph_id=graph_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -443,7 +451,8 @@ def get_groot_schema_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GrootSchema", + '200': "SchemaMapping", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -457,9 +466,9 @@ def get_groot_schema_with_http_info( @validate_call - def get_groot_schema_without_preload_content( + def get_datasource_by_id_without_preload_content( self, - graph_name: StrictStr, + graph_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -473,12 +482,12 @@ def get_groot_schema_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_groot_schema + """get_datasource_by_id - Get graph schema by name + Get data source by ID - :param graph_name: (required) - :type graph_name: str + :param graph_id: (required) + :type graph_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -501,8 +510,8 @@ def get_groot_schema_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_groot_schema_serialize( - graph_name=graph_name, + _param = self._get_datasource_by_id_serialize( + graph_id=graph_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -510,7 +519,8 @@ def get_groot_schema_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GrootSchema", + '200': "SchemaMapping", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -519,9 +529,9 @@ def get_groot_schema_without_preload_content( return response_data.response - def _get_groot_schema_serialize( + def _get_datasource_by_id_serialize( self, - graph_name, + graph_id, _request_auth, _content_type, _headers, @@ -541,8 +551,8 @@ def _get_groot_schema_serialize( _body_params: Optional[bytes] = None # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name + if graph_id is not None: + _path_params['graph_id'] = graph_id # process the query parameters # process the header parameters # process the form parameters @@ -563,7 +573,7 @@ def _get_groot_schema_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/groot/graph/{graph_name}/schema', + resource_path='/api/v1/graph/{graph_id}/datasource', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -580,10 +590,12 @@ def _get_groot_schema_serialize( @validate_call - def import_groot_schema( + def unbind_edge_datasource( self, - graph_name: StrictStr, - groot_schema: GrootSchema, + graph_id: StrictStr, + type_name: StrictStr, + source_vertex_type: StrictStr, + destination_vertex_type: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -597,14 +609,18 @@ def import_groot_schema( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> str: - """import_groot_schema - - Import schema to groot graph - - :param graph_name: (required) - :type graph_name: str - :param groot_schema: (required) - :type groot_schema: GrootSchema + """unbind_edge_datasource + + Unbind datas ource on an edge type + + :param graph_id: (required) + :type graph_id: str + :param type_name: (required) + :type type_name: str + :param source_vertex_type: (required) + :type source_vertex_type: str + :param destination_vertex_type: (required) + :type destination_vertex_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -627,9 +643,11 @@ def import_groot_schema( :return: Returns the result object. """ # noqa: E501 - _param = self._import_groot_schema_serialize( - graph_name=graph_name, - groot_schema=groot_schema, + _param = self._unbind_edge_datasource_serialize( + graph_id=graph_id, + type_name=type_name, + source_vertex_type=source_vertex_type, + destination_vertex_type=destination_vertex_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -638,6 +656,7 @@ def import_groot_schema( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -651,10 +670,12 @@ def import_groot_schema( @validate_call - def import_groot_schema_with_http_info( + def unbind_edge_datasource_with_http_info( self, - graph_name: StrictStr, - groot_schema: GrootSchema, + graph_id: StrictStr, + type_name: StrictStr, + source_vertex_type: StrictStr, + destination_vertex_type: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -668,14 +689,18 @@ def import_groot_schema_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[str]: - """import_groot_schema - - Import schema to groot graph - - :param graph_name: (required) - :type graph_name: str - :param groot_schema: (required) - :type groot_schema: GrootSchema + """unbind_edge_datasource + + Unbind datas ource on an edge type + + :param graph_id: (required) + :type graph_id: str + :param type_name: (required) + :type type_name: str + :param source_vertex_type: (required) + :type source_vertex_type: str + :param destination_vertex_type: (required) + :type destination_vertex_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -698,9 +723,11 @@ def import_groot_schema_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._import_groot_schema_serialize( - graph_name=graph_name, - groot_schema=groot_schema, + _param = self._unbind_edge_datasource_serialize( + graph_id=graph_id, + type_name=type_name, + source_vertex_type=source_vertex_type, + destination_vertex_type=destination_vertex_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -709,6 +736,7 @@ def import_groot_schema_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -722,10 +750,12 @@ def import_groot_schema_with_http_info( @validate_call - def import_groot_schema_without_preload_content( + def unbind_edge_datasource_without_preload_content( self, - graph_name: StrictStr, - groot_schema: GrootSchema, + graph_id: StrictStr, + type_name: StrictStr, + source_vertex_type: StrictStr, + destination_vertex_type: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -739,14 +769,18 @@ def import_groot_schema_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """import_groot_schema - - Import schema to groot graph - - :param graph_name: (required) - :type graph_name: str - :param groot_schema: (required) - :type groot_schema: GrootSchema + """unbind_edge_datasource + + Unbind datas ource on an edge type + + :param graph_id: (required) + :type graph_id: str + :param type_name: (required) + :type type_name: str + :param source_vertex_type: (required) + :type source_vertex_type: str + :param destination_vertex_type: (required) + :type destination_vertex_type: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -769,9 +803,11 @@ def import_groot_schema_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._import_groot_schema_serialize( - graph_name=graph_name, - groot_schema=groot_schema, + _param = self._unbind_edge_datasource_serialize( + graph_id=graph_id, + type_name=type_name, + source_vertex_type=source_vertex_type, + destination_vertex_type=destination_vertex_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -780,6 +816,7 @@ def import_groot_schema_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -788,10 +825,12 @@ def import_groot_schema_without_preload_content( return response_data.response - def _import_groot_schema_serialize( + def _unbind_edge_datasource_serialize( self, - graph_name, - groot_schema, + graph_id, + type_name, + source_vertex_type, + destination_vertex_type, _request_auth, _content_type, _headers, @@ -811,14 +850,22 @@ def _import_groot_schema_serialize( _body_params: Optional[bytes] = None # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name + if graph_id is not None: + _path_params['graph_id'] = graph_id + if type_name is not None: + _path_params['type_name'] = type_name # process the query parameters + if source_vertex_type is not None: + + _query_params.append(('source_vertex_type', source_vertex_type)) + + if destination_vertex_type is not None: + + _query_params.append(('destination_vertex_type', destination_vertex_type)) + # process the header parameters # process the form parameters # process the body parameter - if groot_schema is not None: - _body_params = groot_schema # set the HTTP header `Accept` @@ -828,27 +875,14 @@ def _import_groot_schema_serialize( ] ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ ] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/groot/graph/{graph_name}/schema', + method='DELETE', + resource_path='/api/v1/graph/{graph_id}/datasource/edge/{type_name}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -865,8 +899,10 @@ def _import_groot_schema_serialize( @validate_call - def list_groot_graph( + def unbind_vertex_datasource( self, + graph_id: StrictStr, + type_name: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -879,11 +915,15 @@ def list_groot_graph( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[GrootGraph]: - """list_groot_graph + ) -> str: + """unbind_vertex_datasource - list groot graph + Unbind data source on a vertex type + :param graph_id: (required) + :type graph_id: str + :param type_name: (required) + :type type_name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -906,7 +946,9 @@ def list_groot_graph( :return: Returns the result object. """ # noqa: E501 - _param = self._list_groot_graph_serialize( + _param = self._unbind_vertex_datasource_serialize( + graph_id=graph_id, + type_name=type_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -914,7 +956,8 @@ def list_groot_graph( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[GrootGraph]", + '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -928,8 +971,10 @@ def list_groot_graph( @validate_call - def list_groot_graph_with_http_info( + def unbind_vertex_datasource_with_http_info( self, + graph_id: StrictStr, + type_name: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -942,11 +987,15 @@ def list_groot_graph_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[GrootGraph]]: - """list_groot_graph + ) -> ApiResponse[str]: + """unbind_vertex_datasource - list groot graph + Unbind data source on a vertex type + :param graph_id: (required) + :type graph_id: str + :param type_name: (required) + :type type_name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -969,7 +1018,9 @@ def list_groot_graph_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_groot_graph_serialize( + _param = self._unbind_vertex_datasource_serialize( + graph_id=graph_id, + type_name=type_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -977,7 +1028,8 @@ def list_groot_graph_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[GrootGraph]", + '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -991,8 +1043,10 @@ def list_groot_graph_with_http_info( @validate_call - def list_groot_graph_without_preload_content( + def unbind_vertex_datasource_without_preload_content( self, + graph_id: StrictStr, + type_name: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1006,10 +1060,14 @@ def list_groot_graph_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """list_groot_graph + """unbind_vertex_datasource - list groot graph + Unbind data source on a vertex type + :param graph_id: (required) + :type graph_id: str + :param type_name: (required) + :type type_name: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1032,7 +1090,9 @@ def list_groot_graph_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_groot_graph_serialize( + _param = self._unbind_vertex_datasource_serialize( + graph_id=graph_id, + type_name=type_name, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1040,7 +1100,8 @@ def list_groot_graph_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[GrootGraph]", + '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1049,8 +1110,10 @@ def list_groot_graph_without_preload_content( return response_data.response - def _list_groot_graph_serialize( + def _unbind_vertex_datasource_serialize( self, + graph_id, + type_name, _request_auth, _content_type, _headers, @@ -1070,6 +1133,10 @@ def _list_groot_graph_serialize( _body_params: Optional[bytes] = None # process the path parameters + if graph_id is not None: + _path_params['graph_id'] = graph_id + if type_name is not None: + _path_params['type_name'] = type_name # process the query parameters # process the header parameters # process the form parameters @@ -1089,8 +1156,8 @@ def _list_groot_graph_serialize( ] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/groot/graph', + method='DELETE', + resource_path='/api/v1/graph/{graph_id}/datasource/vertex/{type_name}', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/python/graphscope/flex/rest/api/datasource_api.py b/python/graphscope/flex/rest/api/datasource_api.py deleted file mode 100644 index e38b6c6d78a5..000000000000 --- a/python/graphscope/flex/rest/api/datasource_api.py +++ /dev/null @@ -1,2308 +0,0 @@ -# coding: utf-8 - -""" - GraphScope FLEX HTTP SERVICE API - - 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) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - -import warnings -from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt -from typing import Any, Dict, List, Optional, Tuple, Union -from typing_extensions import Annotated - -from pydantic import StrictStr -from graphscope.flex.rest.models.data_source import DataSource -from graphscope.flex.rest.models.edge_data_source import EdgeDataSource -from graphscope.flex.rest.models.vertex_data_source import VertexDataSource - -from graphscope.flex.rest.api_client import ApiClient, RequestSerialized -from graphscope.flex.rest.api_response import ApiResponse -from graphscope.flex.rest.rest import RESTResponseType - - -class DatasourceApi: - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - def __init__(self, api_client=None) -> None: - if api_client is None: - api_client = ApiClient.get_default() - self.api_client = api_client - - - @validate_call - def bind_edge_datasource( - self, - graph_name: StrictStr, - edge_data_source: EdgeDataSource, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> str: - """bind_edge_datasource - - Bind data source on edge type - - :param graph_name: (required) - :type graph_name: str - :param edge_data_source: (required) - :type edge_data_source: EdgeDataSource - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._bind_edge_datasource_serialize( - graph_name=graph_name, - edge_data_source=edge_data_source, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def bind_edge_datasource_with_http_info( - self, - graph_name: StrictStr, - edge_data_source: EdgeDataSource, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[str]: - """bind_edge_datasource - - Bind data source on edge type - - :param graph_name: (required) - :type graph_name: str - :param edge_data_source: (required) - :type edge_data_source: EdgeDataSource - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._bind_edge_datasource_serialize( - graph_name=graph_name, - edge_data_source=edge_data_source, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def bind_edge_datasource_without_preload_content( - self, - graph_name: StrictStr, - edge_data_source: EdgeDataSource, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """bind_edge_datasource - - Bind data source on edge type - - :param graph_name: (required) - :type graph_name: str - :param edge_data_source: (required) - :type edge_data_source: EdgeDataSource - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._bind_edge_datasource_serialize( - graph_name=graph_name, - edge_data_source=edge_data_source, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _bind_edge_datasource_serialize( - self, - graph_name, - edge_data_source, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if edge_data_source is not None: - _body_params = edge_data_source - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/graph/{graph_name}/datasource/edge_datasource', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def bind_vertex_datasource( - self, - graph_name: StrictStr, - vertex_data_source: VertexDataSource, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> str: - """bind_vertex_datasource - - Bind data source on vertex type - - :param graph_name: (required) - :type graph_name: str - :param vertex_data_source: (required) - :type vertex_data_source: VertexDataSource - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._bind_vertex_datasource_serialize( - graph_name=graph_name, - vertex_data_source=vertex_data_source, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def bind_vertex_datasource_with_http_info( - self, - graph_name: StrictStr, - vertex_data_source: VertexDataSource, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[str]: - """bind_vertex_datasource - - Bind data source on vertex type - - :param graph_name: (required) - :type graph_name: str - :param vertex_data_source: (required) - :type vertex_data_source: VertexDataSource - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._bind_vertex_datasource_serialize( - graph_name=graph_name, - vertex_data_source=vertex_data_source, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def bind_vertex_datasource_without_preload_content( - self, - graph_name: StrictStr, - vertex_data_source: VertexDataSource, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """bind_vertex_datasource - - Bind data source on vertex type - - :param graph_name: (required) - :type graph_name: str - :param vertex_data_source: (required) - :type vertex_data_source: VertexDataSource - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._bind_vertex_datasource_serialize( - graph_name=graph_name, - vertex_data_source=vertex_data_source, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _bind_vertex_datasource_serialize( - self, - graph_name, - vertex_data_source, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if vertex_data_source is not None: - _body_params = vertex_data_source - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/graph/{graph_name}/datasource/vertex_datasource', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def get_datasource( - self, - graph_name: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> DataSource: - """get_datasource - - List data source on graph - - :param graph_name: (required) - :type graph_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_datasource_serialize( - graph_name=graph_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "DataSource", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def get_datasource_with_http_info( - self, - graph_name: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[DataSource]: - """get_datasource - - List data source on graph - - :param graph_name: (required) - :type graph_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_datasource_serialize( - graph_name=graph_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "DataSource", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def get_datasource_without_preload_content( - self, - graph_name: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """get_datasource - - List data source on graph - - :param graph_name: (required) - :type graph_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_datasource_serialize( - graph_name=graph_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "DataSource", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_datasource_serialize( - self, - graph_name, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/graph/{graph_name}/datasource', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def get_edge_datasource( - self, - graph_name: StrictStr, - type_name: StrictStr, - source_vertex_type: StrictStr, - destination_vertex_type: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> EdgeDataSource: - """get_edge_datasource - - Get edge data source - - :param graph_name: (required) - :type graph_name: str - :param type_name: (required) - :type type_name: str - :param source_vertex_type: (required) - :type source_vertex_type: str - :param destination_vertex_type: (required) - :type destination_vertex_type: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_edge_datasource_serialize( - graph_name=graph_name, - type_name=type_name, - source_vertex_type=source_vertex_type, - destination_vertex_type=destination_vertex_type, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EdgeDataSource", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def get_edge_datasource_with_http_info( - self, - graph_name: StrictStr, - type_name: StrictStr, - source_vertex_type: StrictStr, - destination_vertex_type: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[EdgeDataSource]: - """get_edge_datasource - - Get edge data source - - :param graph_name: (required) - :type graph_name: str - :param type_name: (required) - :type type_name: str - :param source_vertex_type: (required) - :type source_vertex_type: str - :param destination_vertex_type: (required) - :type destination_vertex_type: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_edge_datasource_serialize( - graph_name=graph_name, - type_name=type_name, - source_vertex_type=source_vertex_type, - destination_vertex_type=destination_vertex_type, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EdgeDataSource", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def get_edge_datasource_without_preload_content( - self, - graph_name: StrictStr, - type_name: StrictStr, - source_vertex_type: StrictStr, - destination_vertex_type: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """get_edge_datasource - - Get edge data source - - :param graph_name: (required) - :type graph_name: str - :param type_name: (required) - :type type_name: str - :param source_vertex_type: (required) - :type source_vertex_type: str - :param destination_vertex_type: (required) - :type destination_vertex_type: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_edge_datasource_serialize( - graph_name=graph_name, - type_name=type_name, - source_vertex_type=source_vertex_type, - destination_vertex_type=destination_vertex_type, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "EdgeDataSource", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_edge_datasource_serialize( - self, - graph_name, - type_name, - source_vertex_type, - destination_vertex_type, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name - if type_name is not None: - _path_params['type_name'] = type_name - # process the query parameters - if source_vertex_type is not None: - - _query_params.append(('source_vertex_type', source_vertex_type)) - - if destination_vertex_type is not None: - - _query_params.append(('destination_vertex_type', destination_vertex_type)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/graph/{graph_name}/datasource/edge_datasource/{type_name}', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def get_vertex_datasource( - self, - graph_name: StrictStr, - type_name: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> VertexDataSource: - """get_vertex_datasource - - Get vertex data source - - :param graph_name: (required) - :type graph_name: str - :param type_name: (required) - :type type_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_vertex_datasource_serialize( - graph_name=graph_name, - type_name=type_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "VertexDataSource", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def get_vertex_datasource_with_http_info( - self, - graph_name: StrictStr, - type_name: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[VertexDataSource]: - """get_vertex_datasource - - Get vertex data source - - :param graph_name: (required) - :type graph_name: str - :param type_name: (required) - :type type_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_vertex_datasource_serialize( - graph_name=graph_name, - type_name=type_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "VertexDataSource", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def get_vertex_datasource_without_preload_content( - self, - graph_name: StrictStr, - type_name: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """get_vertex_datasource - - Get vertex data source - - :param graph_name: (required) - :type graph_name: str - :param type_name: (required) - :type type_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_vertex_datasource_serialize( - graph_name=graph_name, - type_name=type_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "VertexDataSource", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_vertex_datasource_serialize( - self, - graph_name, - type_name, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name - if type_name is not None: - _path_params['type_name'] = type_name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/graph/{graph_name}/datasource/vertex_datasource/{type_name}', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def import_datasource( - self, - graph_name: StrictStr, - data_source: DataSource, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> str: - """import_datasource - - Import data source in batch - - :param graph_name: (required) - :type graph_name: str - :param data_source: (required) - :type data_source: DataSource - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._import_datasource_serialize( - graph_name=graph_name, - data_source=data_source, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def import_datasource_with_http_info( - self, - graph_name: StrictStr, - data_source: DataSource, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[str]: - """import_datasource - - Import data source in batch - - :param graph_name: (required) - :type graph_name: str - :param data_source: (required) - :type data_source: DataSource - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._import_datasource_serialize( - graph_name=graph_name, - data_source=data_source, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def import_datasource_without_preload_content( - self, - graph_name: StrictStr, - data_source: DataSource, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """import_datasource - - Import data source in batch - - :param graph_name: (required) - :type graph_name: str - :param data_source: (required) - :type data_source: DataSource - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._import_datasource_serialize( - graph_name=graph_name, - data_source=data_source, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _import_datasource_serialize( - self, - graph_name, - data_source, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - if data_source is not None: - _body_params = data_source - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/graph/{graph_name}/datasource', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def unbind_edge_datasource( - self, - graph_name: StrictStr, - type_name: StrictStr, - source_vertex_type: StrictStr, - destination_vertex_type: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> str: - """unbind_edge_datasource - - Unbind datasource on an edge type - - :param graph_name: (required) - :type graph_name: str - :param type_name: (required) - :type type_name: str - :param source_vertex_type: (required) - :type source_vertex_type: str - :param destination_vertex_type: (required) - :type destination_vertex_type: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._unbind_edge_datasource_serialize( - graph_name=graph_name, - type_name=type_name, - source_vertex_type=source_vertex_type, - destination_vertex_type=destination_vertex_type, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def unbind_edge_datasource_with_http_info( - self, - graph_name: StrictStr, - type_name: StrictStr, - source_vertex_type: StrictStr, - destination_vertex_type: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[str]: - """unbind_edge_datasource - - Unbind datasource on an edge type - - :param graph_name: (required) - :type graph_name: str - :param type_name: (required) - :type type_name: str - :param source_vertex_type: (required) - :type source_vertex_type: str - :param destination_vertex_type: (required) - :type destination_vertex_type: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._unbind_edge_datasource_serialize( - graph_name=graph_name, - type_name=type_name, - source_vertex_type=source_vertex_type, - destination_vertex_type=destination_vertex_type, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def unbind_edge_datasource_without_preload_content( - self, - graph_name: StrictStr, - type_name: StrictStr, - source_vertex_type: StrictStr, - destination_vertex_type: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """unbind_edge_datasource - - Unbind datasource on an edge type - - :param graph_name: (required) - :type graph_name: str - :param type_name: (required) - :type type_name: str - :param source_vertex_type: (required) - :type source_vertex_type: str - :param destination_vertex_type: (required) - :type destination_vertex_type: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._unbind_edge_datasource_serialize( - graph_name=graph_name, - type_name=type_name, - source_vertex_type=source_vertex_type, - destination_vertex_type=destination_vertex_type, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _unbind_edge_datasource_serialize( - self, - graph_name, - type_name, - source_vertex_type, - destination_vertex_type, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name - if type_name is not None: - _path_params['type_name'] = type_name - # process the query parameters - if source_vertex_type is not None: - - _query_params.append(('source_vertex_type', source_vertex_type)) - - if destination_vertex_type is not None: - - _query_params.append(('destination_vertex_type', destination_vertex_type)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/graph/{graph_name}/datasource/edge_datasource/{type_name}', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def unbind_vertex_datasource( - self, - graph_name: StrictStr, - type_name: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> str: - """unbind_vertex_datasource - - Unbind datasource on a vertex type - - :param graph_name: (required) - :type graph_name: str - :param type_name: (required) - :type type_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._unbind_vertex_datasource_serialize( - graph_name=graph_name, - type_name=type_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def unbind_vertex_datasource_with_http_info( - self, - graph_name: StrictStr, - type_name: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[str]: - """unbind_vertex_datasource - - Unbind datasource on a vertex type - - :param graph_name: (required) - :type graph_name: str - :param type_name: (required) - :type type_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._unbind_vertex_datasource_serialize( - graph_name=graph_name, - type_name=type_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def unbind_vertex_datasource_without_preload_content( - self, - graph_name: StrictStr, - type_name: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """unbind_vertex_datasource - - Unbind datasource on a vertex type - - :param graph_name: (required) - :type graph_name: str - :param type_name: (required) - :type type_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._unbind_vertex_datasource_serialize( - graph_name=graph_name, - type_name=type_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "str", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _unbind_vertex_datasource_serialize( - self, - graph_name, - type_name, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name - if type_name is not None: - _path_params['type_name'] = type_name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/graph/{graph_name}/datasource/vertex_datasource/{type_name}', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/python/graphscope/flex/rest/api/deployment_api.py b/python/graphscope/flex/rest/api/deployment_api.py index 4b7b1e24822d..334e6fd3ad0b 100644 --- a/python/graphscope/flex/rest/api/deployment_api.py +++ b/python/graphscope/flex/rest/api/deployment_api.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -17,10 +17,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import StrictInt, StrictStr -from graphscope.flex.rest.models.deployment_info import DeploymentInfo -from graphscope.flex.rest.models.deployment_status import DeploymentStatus -from graphscope.flex.rest.models.node_status import NodeStatus +from graphscope.flex.rest.models.running_deployment_info import RunningDeploymentInfo from graphscope.flex.rest.api_client import ApiClient, RequestSerialized from graphscope.flex.rest.api_response import ApiResponse @@ -40,313 +37,6 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client - @validate_call - def fetch_log( - self, - component: StrictStr, - pod_name: StrictStr, - container_name: StrictStr, - since_seconds: StrictInt, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[DeploymentStatus]: - """fetch_log - - - :param component: (required) - :type component: str - :param pod_name: (required) - :type pod_name: str - :param container_name: (required) - :type container_name: str - :param since_seconds: (required) - :type since_seconds: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._fetch_log_serialize( - component=component, - pod_name=pod_name, - container_name=container_name, - since_seconds=since_seconds, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[DeploymentStatus]", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def fetch_log_with_http_info( - self, - component: StrictStr, - pod_name: StrictStr, - container_name: StrictStr, - since_seconds: StrictInt, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[DeploymentStatus]]: - """fetch_log - - - :param component: (required) - :type component: str - :param pod_name: (required) - :type pod_name: str - :param container_name: (required) - :type container_name: str - :param since_seconds: (required) - :type since_seconds: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._fetch_log_serialize( - component=component, - pod_name=pod_name, - container_name=container_name, - since_seconds=since_seconds, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[DeploymentStatus]", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def fetch_log_without_preload_content( - self, - component: StrictStr, - pod_name: StrictStr, - container_name: StrictStr, - since_seconds: StrictInt, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """fetch_log - - - :param component: (required) - :type component: str - :param pod_name: (required) - :type pod_name: str - :param container_name: (required) - :type container_name: str - :param since_seconds: (required) - :type since_seconds: int - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._fetch_log_serialize( - component=component, - pod_name=pod_name, - container_name=container_name, - since_seconds=since_seconds, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[DeploymentStatus]", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _fetch_log_serialize( - self, - component, - pod_name, - container_name, - since_seconds, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - if component is not None: - - _query_params.append(('component', component)) - - if pod_name is not None: - - _query_params.append(('pod_name', pod_name)) - - if container_name is not None: - - _query_params.append(('container_name', container_name)) - - if since_seconds is not None: - - _query_params.append(('since_seconds', since_seconds)) - - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/deployment/log', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - @validate_call def get_deployment_info( self, @@ -362,10 +52,10 @@ def get_deployment_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> DeploymentInfo: + ) -> RunningDeploymentInfo: """get_deployment_info - Get deployment's meta info + Deployment information :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -397,7 +87,8 @@ def get_deployment_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "DeploymentInfo", + '200': "RunningDeploymentInfo", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -425,10 +116,10 @@ def get_deployment_info_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[DeploymentInfo]: + ) -> ApiResponse[RunningDeploymentInfo]: """get_deployment_info - Get deployment's meta info + Deployment information :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -460,7 +151,8 @@ def get_deployment_info_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "DeploymentInfo", + '200': "RunningDeploymentInfo", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -491,7 +183,7 @@ def get_deployment_info_without_preload_content( ) -> RESTResponseType: """get_deployment_info - Get deployment's meta info + Deployment information :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -523,7 +215,8 @@ def get_deployment_info_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "DeploymentInfo", + '200': "RunningDeploymentInfo", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -587,487 +280,3 @@ def _get_deployment_info_serialize( ) - - - @validate_call - def get_deployment_status( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[DeploymentStatus]: - """get_deployment_status - - Get deployment's status (k8s only) - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_deployment_status_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[DeploymentStatus]", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def get_deployment_status_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[DeploymentStatus]]: - """get_deployment_status - - Get deployment's status (k8s only) - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_deployment_status_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[DeploymentStatus]", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def get_deployment_status_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """get_deployment_status - - Get deployment's status (k8s only) - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_deployment_status_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[DeploymentStatus]", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_deployment_status_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/deployment/status', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def get_node_status( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[NodeStatus]: - """get_node_status - - Get node status (cpu/memory/disk, local only) - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_node_status_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[NodeStatus]", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def get_node_status_with_http_info( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[NodeStatus]]: - """get_node_status - - Get node status (cpu/memory/disk, local only) - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_node_status_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[NodeStatus]", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def get_node_status_without_preload_content( - self, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """get_node_status - - Get node status (cpu/memory/disk, local only) - - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._get_node_status_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[NodeStatus]", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_node_status_serialize( - self, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/node/status', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - diff --git a/python/graphscope/flex/rest/api/graph_api.py b/python/graphscope/flex/rest/api/graph_api.py index ce0aa1782961..bc2f2fcdd2a7 100644 --- a/python/graphscope/flex/rest/api/graph_api.py +++ b/python/graphscope/flex/rest/api/graph_api.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,10 +18,14 @@ from typing_extensions import Annotated from pydantic import StrictStr -from graphscope.flex.rest.models.edge_type import EdgeType -from graphscope.flex.rest.models.graph import Graph -from graphscope.flex.rest.models.model_schema import ModelSchema -from graphscope.flex.rest.models.vertex_type import VertexType +from typing import Optional +from graphscope.flex.rest.models.create_edge_type import CreateEdgeType +from graphscope.flex.rest.models.create_graph_request import CreateGraphRequest +from graphscope.flex.rest.models.create_graph_response import CreateGraphResponse +from graphscope.flex.rest.models.create_graph_schema_request import CreateGraphSchemaRequest +from graphscope.flex.rest.models.create_vertex_type import CreateVertexType +from graphscope.flex.rest.models.get_graph_response import GetGraphResponse +from graphscope.flex.rest.models.get_graph_schema_response import GetGraphSchemaResponse from graphscope.flex.rest.api_client import ApiClient, RequestSerialized from graphscope.flex.rest.api_response import ApiResponse @@ -44,8 +48,8 @@ def __init__(self, api_client=None) -> None: @validate_call def create_edge_type( self, - graph_name: StrictStr, - edge_type: EdgeType, + graph_id: StrictStr, + create_edge_type: Optional[CreateEdgeType] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -63,10 +67,10 @@ def create_edge_type( Create a edge type - :param graph_name: (required) - :type graph_name: str - :param edge_type: (required) - :type edge_type: EdgeType + :param graph_id: (required) + :type graph_id: str + :param create_edge_type: + :type create_edge_type: CreateEdgeType :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -90,8 +94,8 @@ def create_edge_type( """ # noqa: E501 _param = self._create_edge_type_serialize( - graph_name=graph_name, - edge_type=edge_type, + graph_id=graph_id, + create_edge_type=create_edge_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -100,6 +104,8 @@ def create_edge_type( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '400': "Error", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -115,8 +121,8 @@ def create_edge_type( @validate_call def create_edge_type_with_http_info( self, - graph_name: StrictStr, - edge_type: EdgeType, + graph_id: StrictStr, + create_edge_type: Optional[CreateEdgeType] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -134,10 +140,10 @@ def create_edge_type_with_http_info( Create a edge type - :param graph_name: (required) - :type graph_name: str - :param edge_type: (required) - :type edge_type: EdgeType + :param graph_id: (required) + :type graph_id: str + :param create_edge_type: + :type create_edge_type: CreateEdgeType :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -161,8 +167,8 @@ def create_edge_type_with_http_info( """ # noqa: E501 _param = self._create_edge_type_serialize( - graph_name=graph_name, - edge_type=edge_type, + graph_id=graph_id, + create_edge_type=create_edge_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -171,6 +177,8 @@ def create_edge_type_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '400': "Error", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -186,8 +194,8 @@ def create_edge_type_with_http_info( @validate_call def create_edge_type_without_preload_content( self, - graph_name: StrictStr, - edge_type: EdgeType, + graph_id: StrictStr, + create_edge_type: Optional[CreateEdgeType] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -205,10 +213,10 @@ def create_edge_type_without_preload_content( Create a edge type - :param graph_name: (required) - :type graph_name: str - :param edge_type: (required) - :type edge_type: EdgeType + :param graph_id: (required) + :type graph_id: str + :param create_edge_type: + :type create_edge_type: CreateEdgeType :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -232,8 +240,8 @@ def create_edge_type_without_preload_content( """ # noqa: E501 _param = self._create_edge_type_serialize( - graph_name=graph_name, - edge_type=edge_type, + graph_id=graph_id, + create_edge_type=create_edge_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -242,6 +250,8 @@ def create_edge_type_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '400': "Error", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -252,8 +262,8 @@ def create_edge_type_without_preload_content( def _create_edge_type_serialize( self, - graph_name, - edge_type, + graph_id, + create_edge_type, _request_auth, _content_type, _headers, @@ -273,14 +283,14 @@ def _create_edge_type_serialize( _body_params: Optional[bytes] = None # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name + if graph_id is not None: + _path_params['graph_id'] = graph_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if edge_type is not None: - _body_params = edge_type + if create_edge_type is not None: + _body_params = create_edge_type # set the HTTP header `Accept` @@ -310,7 +320,7 @@ def _create_edge_type_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/api/v1/graph/{graph_name}/schema/edge_type', + resource_path='/api/v1/graph/{graph_id}/schema/edge', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -329,7 +339,7 @@ def _create_edge_type_serialize( @validate_call def create_graph( self, - graph: Graph, + create_graph_request: CreateGraphRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -342,13 +352,13 @@ def create_graph( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> str: + ) -> CreateGraphResponse: """create_graph Create a new graph - :param graph: (required) - :type graph: Graph + :param create_graph_request: (required) + :type create_graph_request: CreateGraphRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -372,7 +382,7 @@ def create_graph( """ # noqa: E501 _param = self._create_graph_serialize( - graph=graph, + create_graph_request=create_graph_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -380,7 +390,9 @@ def create_graph( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "str", + '200': "CreateGraphResponse", + '400': "Error", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -396,7 +408,7 @@ def create_graph( @validate_call def create_graph_with_http_info( self, - graph: Graph, + create_graph_request: CreateGraphRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -409,13 +421,13 @@ def create_graph_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[str]: + ) -> ApiResponse[CreateGraphResponse]: """create_graph Create a new graph - :param graph: (required) - :type graph: Graph + :param create_graph_request: (required) + :type create_graph_request: CreateGraphRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -439,7 +451,7 @@ def create_graph_with_http_info( """ # noqa: E501 _param = self._create_graph_serialize( - graph=graph, + create_graph_request=create_graph_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -447,7 +459,9 @@ def create_graph_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "str", + '200': "CreateGraphResponse", + '400': "Error", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -463,7 +477,7 @@ def create_graph_with_http_info( @validate_call def create_graph_without_preload_content( self, - graph: Graph, + create_graph_request: CreateGraphRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -481,8 +495,8 @@ def create_graph_without_preload_content( Create a new graph - :param graph: (required) - :type graph: Graph + :param create_graph_request: (required) + :type create_graph_request: CreateGraphRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -506,7 +520,7 @@ def create_graph_without_preload_content( """ # noqa: E501 _param = self._create_graph_serialize( - graph=graph, + create_graph_request=create_graph_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -514,7 +528,9 @@ def create_graph_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "str", + '200': "CreateGraphResponse", + '400': "Error", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -525,7 +541,7 @@ def create_graph_without_preload_content( def _create_graph_serialize( self, - graph, + create_graph_request, _request_auth, _content_type, _headers, @@ -549,8 +565,8 @@ def _create_graph_serialize( # process the header parameters # process the form parameters # process the body parameter - if graph is not None: - _body_params = graph + if create_graph_request is not None: + _body_params = create_graph_request # set the HTTP header `Accept` @@ -599,8 +615,8 @@ def _create_graph_serialize( @validate_call def create_vertex_type( self, - graph_name: StrictStr, - vertex_type: VertexType, + graph_id: StrictStr, + create_vertex_type: CreateVertexType, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -618,10 +634,10 @@ def create_vertex_type( Create a vertex type - :param graph_name: (required) - :type graph_name: str - :param vertex_type: (required) - :type vertex_type: VertexType + :param graph_id: (required) + :type graph_id: str + :param create_vertex_type: (required) + :type create_vertex_type: CreateVertexType :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -645,8 +661,8 @@ def create_vertex_type( """ # noqa: E501 _param = self._create_vertex_type_serialize( - graph_name=graph_name, - vertex_type=vertex_type, + graph_id=graph_id, + create_vertex_type=create_vertex_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -655,6 +671,8 @@ def create_vertex_type( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '400': "Error", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -670,8 +688,8 @@ def create_vertex_type( @validate_call def create_vertex_type_with_http_info( self, - graph_name: StrictStr, - vertex_type: VertexType, + graph_id: StrictStr, + create_vertex_type: CreateVertexType, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -689,10 +707,10 @@ def create_vertex_type_with_http_info( Create a vertex type - :param graph_name: (required) - :type graph_name: str - :param vertex_type: (required) - :type vertex_type: VertexType + :param graph_id: (required) + :type graph_id: str + :param create_vertex_type: (required) + :type create_vertex_type: CreateVertexType :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -716,8 +734,8 @@ def create_vertex_type_with_http_info( """ # noqa: E501 _param = self._create_vertex_type_serialize( - graph_name=graph_name, - vertex_type=vertex_type, + graph_id=graph_id, + create_vertex_type=create_vertex_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -726,6 +744,8 @@ def create_vertex_type_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '400': "Error", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -741,8 +761,8 @@ def create_vertex_type_with_http_info( @validate_call def create_vertex_type_without_preload_content( self, - graph_name: StrictStr, - vertex_type: VertexType, + graph_id: StrictStr, + create_vertex_type: CreateVertexType, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -760,10 +780,10 @@ def create_vertex_type_without_preload_content( Create a vertex type - :param graph_name: (required) - :type graph_name: str - :param vertex_type: (required) - :type vertex_type: VertexType + :param graph_id: (required) + :type graph_id: str + :param create_vertex_type: (required) + :type create_vertex_type: CreateVertexType :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -787,8 +807,8 @@ def create_vertex_type_without_preload_content( """ # noqa: E501 _param = self._create_vertex_type_serialize( - graph_name=graph_name, - vertex_type=vertex_type, + graph_id=graph_id, + create_vertex_type=create_vertex_type, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -797,6 +817,8 @@ def create_vertex_type_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '400': "Error", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -807,8 +829,8 @@ def create_vertex_type_without_preload_content( def _create_vertex_type_serialize( self, - graph_name, - vertex_type, + graph_id, + create_vertex_type, _request_auth, _content_type, _headers, @@ -828,14 +850,14 @@ def _create_vertex_type_serialize( _body_params: Optional[bytes] = None # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name + if graph_id is not None: + _path_params['graph_id'] = graph_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if vertex_type is not None: - _body_params = vertex_type + if create_vertex_type is not None: + _body_params = create_vertex_type # set the HTTP header `Accept` @@ -865,7 +887,7 @@ def _create_vertex_type_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/api/v1/graph/{graph_name}/schema/vertex_type', + resource_path='/api/v1/graph/{graph_id}/schema/vertex', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -882,9 +904,9 @@ def _create_vertex_type_serialize( @validate_call - def delete_edge_type( + def delete_edge_type_by_name( self, - graph_name: StrictStr, + graph_id: StrictStr, type_name: StrictStr, source_vertex_type: StrictStr, destination_vertex_type: StrictStr, @@ -901,12 +923,12 @@ def delete_edge_type( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> str: - """delete_edge_type + """delete_edge_type_by_name - Delete a edge type by name + Delete edge type by name - :param graph_name: (required) - :type graph_name: str + :param graph_id: (required) + :type graph_id: str :param type_name: (required) :type type_name: str :param source_vertex_type: (required) @@ -935,8 +957,8 @@ def delete_edge_type( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_edge_type_serialize( - graph_name=graph_name, + _param = self._delete_edge_type_by_name_serialize( + graph_id=graph_id, type_name=type_name, source_vertex_type=source_vertex_type, destination_vertex_type=destination_vertex_type, @@ -948,6 +970,7 @@ def delete_edge_type( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -961,9 +984,9 @@ def delete_edge_type( @validate_call - def delete_edge_type_with_http_info( + def delete_edge_type_by_name_with_http_info( self, - graph_name: StrictStr, + graph_id: StrictStr, type_name: StrictStr, source_vertex_type: StrictStr, destination_vertex_type: StrictStr, @@ -980,12 +1003,12 @@ def delete_edge_type_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[str]: - """delete_edge_type + """delete_edge_type_by_name - Delete a edge type by name + Delete edge type by name - :param graph_name: (required) - :type graph_name: str + :param graph_id: (required) + :type graph_id: str :param type_name: (required) :type type_name: str :param source_vertex_type: (required) @@ -1014,8 +1037,8 @@ def delete_edge_type_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_edge_type_serialize( - graph_name=graph_name, + _param = self._delete_edge_type_by_name_serialize( + graph_id=graph_id, type_name=type_name, source_vertex_type=source_vertex_type, destination_vertex_type=destination_vertex_type, @@ -1027,6 +1050,7 @@ def delete_edge_type_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1040,9 +1064,9 @@ def delete_edge_type_with_http_info( @validate_call - def delete_edge_type_without_preload_content( + def delete_edge_type_by_name_without_preload_content( self, - graph_name: StrictStr, + graph_id: StrictStr, type_name: StrictStr, source_vertex_type: StrictStr, destination_vertex_type: StrictStr, @@ -1059,12 +1083,12 @@ def delete_edge_type_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_edge_type + """delete_edge_type_by_name - Delete a edge type by name + Delete edge type by name - :param graph_name: (required) - :type graph_name: str + :param graph_id: (required) + :type graph_id: str :param type_name: (required) :type type_name: str :param source_vertex_type: (required) @@ -1093,8 +1117,8 @@ def delete_edge_type_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_edge_type_serialize( - graph_name=graph_name, + _param = self._delete_edge_type_by_name_serialize( + graph_id=graph_id, type_name=type_name, source_vertex_type=source_vertex_type, destination_vertex_type=destination_vertex_type, @@ -1106,6 +1130,7 @@ def delete_edge_type_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1114,9 +1139,9 @@ def delete_edge_type_without_preload_content( return response_data.response - def _delete_edge_type_serialize( + def _delete_edge_type_by_name_serialize( self, - graph_name, + graph_id, type_name, source_vertex_type, destination_vertex_type, @@ -1139,8 +1164,8 @@ def _delete_edge_type_serialize( _body_params: Optional[bytes] = None # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name + if graph_id is not None: + _path_params['graph_id'] = graph_id if type_name is not None: _path_params['type_name'] = type_name # process the query parameters @@ -1171,7 +1196,7 @@ def _delete_edge_type_serialize( return self.api_client.param_serialize( method='DELETE', - resource_path='/api/v1/graph/{graph_name}/schema/edge_edge/{type_name}', + resource_path='/api/v1/graph/{graph_id}/schema/edge/{type_name}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1188,9 +1213,9 @@ def _delete_edge_type_serialize( @validate_call - def delete_graph( + def delete_graph_by_id( self, - graph_name: StrictStr, + graph_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1204,12 +1229,12 @@ def delete_graph( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> str: - """delete_graph + """delete_graph_by_id - Delete a graph by name + Delete graph by ID - :param graph_name: (required) - :type graph_name: str + :param graph_id: (required) + :type graph_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1232,8 +1257,8 @@ def delete_graph( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_graph_serialize( - graph_name=graph_name, + _param = self._delete_graph_by_id_serialize( + graph_id=graph_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1242,6 +1267,7 @@ def delete_graph( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1255,9 +1281,9 @@ def delete_graph( @validate_call - def delete_graph_with_http_info( + def delete_graph_by_id_with_http_info( self, - graph_name: StrictStr, + graph_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1271,12 +1297,12 @@ def delete_graph_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[str]: - """delete_graph + """delete_graph_by_id - Delete a graph by name + Delete graph by ID - :param graph_name: (required) - :type graph_name: str + :param graph_id: (required) + :type graph_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1299,8 +1325,8 @@ def delete_graph_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_graph_serialize( - graph_name=graph_name, + _param = self._delete_graph_by_id_serialize( + graph_id=graph_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1309,6 +1335,7 @@ def delete_graph_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1322,9 +1349,9 @@ def delete_graph_with_http_info( @validate_call - def delete_graph_without_preload_content( + def delete_graph_by_id_without_preload_content( self, - graph_name: StrictStr, + graph_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1338,12 +1365,12 @@ def delete_graph_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_graph + """delete_graph_by_id - Delete a graph by name + Delete graph by ID - :param graph_name: (required) - :type graph_name: str + :param graph_id: (required) + :type graph_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1366,8 +1393,8 @@ def delete_graph_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_graph_serialize( - graph_name=graph_name, + _param = self._delete_graph_by_id_serialize( + graph_id=graph_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1376,6 +1403,7 @@ def delete_graph_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1384,9 +1412,9 @@ def delete_graph_without_preload_content( return response_data.response - def _delete_graph_serialize( + def _delete_graph_by_id_serialize( self, - graph_name, + graph_id, _request_auth, _content_type, _headers, @@ -1406,8 +1434,8 @@ def _delete_graph_serialize( _body_params: Optional[bytes] = None # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name + if graph_id is not None: + _path_params['graph_id'] = graph_id # process the query parameters # process the header parameters # process the form parameters @@ -1428,7 +1456,7 @@ def _delete_graph_serialize( return self.api_client.param_serialize( method='DELETE', - resource_path='/api/v1/graph/{graph_name}', + resource_path='/api/v1/graph/{graph_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1445,9 +1473,9 @@ def _delete_graph_serialize( @validate_call - def delete_vertex_type( + def delete_vertex_type_by_name( self, - graph_name: StrictStr, + graph_id: StrictStr, type_name: StrictStr, _request_timeout: Union[ None, @@ -1462,12 +1490,12 @@ def delete_vertex_type( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> str: - """delete_vertex_type + """delete_vertex_type_by_name - Delete a vertex type by name + Delete vertex type by name - :param graph_name: (required) - :type graph_name: str + :param graph_id: (required) + :type graph_id: str :param type_name: (required) :type type_name: str :param _request_timeout: timeout setting for this request. If one @@ -1492,8 +1520,8 @@ def delete_vertex_type( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_vertex_type_serialize( - graph_name=graph_name, + _param = self._delete_vertex_type_by_name_serialize( + graph_id=graph_id, type_name=type_name, _request_auth=_request_auth, _content_type=_content_type, @@ -1503,6 +1531,7 @@ def delete_vertex_type( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1516,9 +1545,9 @@ def delete_vertex_type( @validate_call - def delete_vertex_type_with_http_info( + def delete_vertex_type_by_name_with_http_info( self, - graph_name: StrictStr, + graph_id: StrictStr, type_name: StrictStr, _request_timeout: Union[ None, @@ -1533,12 +1562,12 @@ def delete_vertex_type_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[str]: - """delete_vertex_type + """delete_vertex_type_by_name - Delete a vertex type by name + Delete vertex type by name - :param graph_name: (required) - :type graph_name: str + :param graph_id: (required) + :type graph_id: str :param type_name: (required) :type type_name: str :param _request_timeout: timeout setting for this request. If one @@ -1563,8 +1592,8 @@ def delete_vertex_type_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_vertex_type_serialize( - graph_name=graph_name, + _param = self._delete_vertex_type_by_name_serialize( + graph_id=graph_id, type_name=type_name, _request_auth=_request_auth, _content_type=_content_type, @@ -1574,6 +1603,7 @@ def delete_vertex_type_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1587,9 +1617,9 @@ def delete_vertex_type_with_http_info( @validate_call - def delete_vertex_type_without_preload_content( + def delete_vertex_type_by_name_without_preload_content( self, - graph_name: StrictStr, + graph_id: StrictStr, type_name: StrictStr, _request_timeout: Union[ None, @@ -1604,12 +1634,12 @@ def delete_vertex_type_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_vertex_type + """delete_vertex_type_by_name - Delete a vertex type by name + Delete vertex type by name - :param graph_name: (required) - :type graph_name: str + :param graph_id: (required) + :type graph_id: str :param type_name: (required) :type type_name: str :param _request_timeout: timeout setting for this request. If one @@ -1634,8 +1664,8 @@ def delete_vertex_type_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_vertex_type_serialize( - graph_name=graph_name, + _param = self._delete_vertex_type_by_name_serialize( + graph_id=graph_id, type_name=type_name, _request_auth=_request_auth, _content_type=_content_type, @@ -1645,6 +1675,7 @@ def delete_vertex_type_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1653,9 +1684,9 @@ def delete_vertex_type_without_preload_content( return response_data.response - def _delete_vertex_type_serialize( + def _delete_vertex_type_by_name_serialize( self, - graph_name, + graph_id, type_name, _request_auth, _content_type, @@ -1676,8 +1707,8 @@ def _delete_vertex_type_serialize( _body_params: Optional[bytes] = None # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name + if graph_id is not None: + _path_params['graph_id'] = graph_id if type_name is not None: _path_params['type_name'] = type_name # process the query parameters @@ -1700,7 +1731,7 @@ def _delete_vertex_type_serialize( return self.api_client.param_serialize( method='DELETE', - resource_path='/api/v1/graph/{graph_name}/schema/vertex_type/{type_name}', + resource_path='/api/v1/graph/{graph_id}/schema/vertex/{type_name}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1717,9 +1748,9 @@ def _delete_vertex_type_serialize( @validate_call - def get_schema( + def get_graph_by_id( self, - graph_name: StrictStr, + graph_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1732,13 +1763,13 @@ def get_schema( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ModelSchema: - """get_schema + ) -> GetGraphResponse: + """get_graph_by_id - Get graph schema by name + Get graph by ID - :param graph_name: (required) - :type graph_name: str + :param graph_id: (required) + :type graph_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1761,8 +1792,8 @@ def get_schema( :return: Returns the result object. """ # noqa: E501 - _param = self._get_schema_serialize( - graph_name=graph_name, + _param = self._get_graph_by_id_serialize( + graph_id=graph_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1770,7 +1801,8 @@ def get_schema( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ModelSchema", + '200': "GetGraphResponse", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1784,9 +1816,9 @@ def get_schema( @validate_call - def get_schema_with_http_info( + def get_graph_by_id_with_http_info( self, - graph_name: StrictStr, + graph_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1799,13 +1831,13 @@ def get_schema_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ModelSchema]: - """get_schema + ) -> ApiResponse[GetGraphResponse]: + """get_graph_by_id - Get graph schema by name + Get graph by ID - :param graph_name: (required) - :type graph_name: str + :param graph_id: (required) + :type graph_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1828,8 +1860,8 @@ def get_schema_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_schema_serialize( - graph_name=graph_name, + _param = self._get_graph_by_id_serialize( + graph_id=graph_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1837,7 +1869,8 @@ def get_schema_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ModelSchema", + '200': "GetGraphResponse", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1851,9 +1884,9 @@ def get_schema_with_http_info( @validate_call - def get_schema_without_preload_content( + def get_graph_by_id_without_preload_content( self, - graph_name: StrictStr, + graph_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1867,12 +1900,12 @@ def get_schema_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_schema + """get_graph_by_id - Get graph schema by name + Get graph by ID - :param graph_name: (required) - :type graph_name: str + :param graph_id: (required) + :type graph_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1895,8 +1928,8 @@ def get_schema_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_schema_serialize( - graph_name=graph_name, + _param = self._get_graph_by_id_serialize( + graph_id=graph_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1904,7 +1937,8 @@ def get_schema_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ModelSchema", + '200': "GetGraphResponse", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1913,9 +1947,9 @@ def get_schema_without_preload_content( return response_data.response - def _get_schema_serialize( + def _get_graph_by_id_serialize( self, - graph_name, + graph_id, _request_auth, _content_type, _headers, @@ -1935,8 +1969,8 @@ def _get_schema_serialize( _body_params: Optional[bytes] = None # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name + if graph_id is not None: + _path_params['graph_id'] = graph_id # process the query parameters # process the header parameters # process the form parameters @@ -1957,7 +1991,558 @@ def _get_schema_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/graph/{graph_name}/schema', + resource_path='/api/v1/graph/{graph_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_schema_by_id( + self, + graph_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetGraphSchemaResponse: + """get_schema_by_id + + Get graph schema by ID + + :param graph_id: (required) + :type graph_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_schema_by_id_serialize( + graph_id=graph_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetGraphSchemaResponse", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_schema_by_id_with_http_info( + self, + graph_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetGraphSchemaResponse]: + """get_schema_by_id + + Get graph schema by ID + + :param graph_id: (required) + :type graph_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_schema_by_id_serialize( + graph_id=graph_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetGraphSchemaResponse", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_schema_by_id_without_preload_content( + self, + graph_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_schema_by_id + + Get graph schema by ID + + :param graph_id: (required) + :type graph_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_schema_by_id_serialize( + graph_id=graph_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetGraphSchemaResponse", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_schema_by_id_serialize( + self, + graph_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if graph_id is not None: + _path_params['graph_id'] = graph_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/graph/{graph_id}/schema', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def import_schema_by_id( + self, + graph_id: StrictStr, + create_graph_schema_request: CreateGraphSchemaRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> str: + """import_schema_by_id + + Import graph schema + + :param graph_id: (required) + :type graph_id: str + :param create_graph_schema_request: (required) + :type create_graph_schema_request: CreateGraphSchemaRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._import_schema_by_id_serialize( + graph_id=graph_id, + create_graph_schema_request=create_graph_schema_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + '400': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def import_schema_by_id_with_http_info( + self, + graph_id: StrictStr, + create_graph_schema_request: CreateGraphSchemaRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[str]: + """import_schema_by_id + + Import graph schema + + :param graph_id: (required) + :type graph_id: str + :param create_graph_schema_request: (required) + :type create_graph_schema_request: CreateGraphSchemaRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._import_schema_by_id_serialize( + graph_id=graph_id, + create_graph_schema_request=create_graph_schema_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + '400': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def import_schema_by_id_without_preload_content( + self, + graph_id: StrictStr, + create_graph_schema_request: CreateGraphSchemaRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """import_schema_by_id + + Import graph schema + + :param graph_id: (required) + :type graph_id: str + :param create_graph_schema_request: (required) + :type create_graph_schema_request: CreateGraphSchemaRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._import_schema_by_id_serialize( + graph_id=graph_id, + create_graph_schema_request=create_graph_schema_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "str", + '400': "Error", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _import_schema_by_id_serialize( + self, + graph_id, + create_graph_schema_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if graph_id is not None: + _path_params['graph_id'] = graph_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if create_graph_schema_request is not None: + _body_params = create_graph_schema_request + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/graph/{graph_id}/schema', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1988,7 +2573,7 @@ def list_graphs( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[Graph]: + ) -> List[GetGraphResponse]: """list_graphs List all graphs @@ -2023,7 +2608,8 @@ def list_graphs( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[Graph]", + '200': "List[GetGraphResponse]", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -2051,7 +2637,7 @@ def list_graphs_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[Graph]]: + ) -> ApiResponse[List[GetGraphResponse]]: """list_graphs List all graphs @@ -2086,7 +2672,8 @@ def list_graphs_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[Graph]", + '200': "List[GetGraphResponse]", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -2149,7 +2736,8 @@ def list_graphs_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[Graph]", + '200': "List[GetGraphResponse]", + '500': "Error", } response_data = self.api_client.call_api( *_param, diff --git a/python/graphscope/flex/rest/api/job_api.py b/python/graphscope/flex/rest/api/job_api.py index 211269140468..a124ab8c98bb 100644 --- a/python/graphscope/flex/rest/api/job_api.py +++ b/python/graphscope/flex/rest/api/job_api.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,8 +18,9 @@ from typing_extensions import Annotated from pydantic import StrictStr +from graphscope.flex.rest.models.create_dataloading_job_response import CreateDataloadingJobResponse +from graphscope.flex.rest.models.dataloading_job_config import DataloadingJobConfig from graphscope.flex.rest.models.job_status import JobStatus -from graphscope.flex.rest.models.schema_mapping import SchemaMapping from graphscope.flex.rest.api_client import ApiClient, RequestSerialized from graphscope.flex.rest.api_response import ApiResponse @@ -40,10 +41,9 @@ def __init__(self, api_client=None) -> None: @validate_call - def create_dataloading_job( + def delete_job_by_id( self, - graph_name: StrictStr, - schema_mapping: SchemaMapping, + job_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -57,13 +57,12 @@ def create_dataloading_job( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> str: - """create_dataloading_job + """delete_job_by_id + Delete job by ID - :param graph_name: (required) - :type graph_name: str - :param schema_mapping: (required) - :type schema_mapping: SchemaMapping + :param job_id: (required) + :type job_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -86,9 +85,8 @@ def create_dataloading_job( :return: Returns the result object. """ # noqa: E501 - _param = self._create_dataloading_job_serialize( - graph_name=graph_name, - schema_mapping=schema_mapping, + _param = self._delete_job_by_id_serialize( + job_id=job_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -97,6 +95,7 @@ def create_dataloading_job( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -110,10 +109,9 @@ def create_dataloading_job( @validate_call - def create_dataloading_job_with_http_info( + def delete_job_by_id_with_http_info( self, - graph_name: StrictStr, - schema_mapping: SchemaMapping, + job_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -127,13 +125,12 @@ def create_dataloading_job_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[str]: - """create_dataloading_job + """delete_job_by_id + Delete job by ID - :param graph_name: (required) - :type graph_name: str - :param schema_mapping: (required) - :type schema_mapping: SchemaMapping + :param job_id: (required) + :type job_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -156,9 +153,8 @@ def create_dataloading_job_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_dataloading_job_serialize( - graph_name=graph_name, - schema_mapping=schema_mapping, + _param = self._delete_job_by_id_serialize( + job_id=job_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -167,6 +163,7 @@ def create_dataloading_job_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -180,10 +177,9 @@ def create_dataloading_job_with_http_info( @validate_call - def create_dataloading_job_without_preload_content( + def delete_job_by_id_without_preload_content( self, - graph_name: StrictStr, - schema_mapping: SchemaMapping, + job_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -197,13 +193,12 @@ def create_dataloading_job_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """create_dataloading_job + """delete_job_by_id + Delete job by ID - :param graph_name: (required) - :type graph_name: str - :param schema_mapping: (required) - :type schema_mapping: SchemaMapping + :param job_id: (required) + :type job_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -226,9 +221,8 @@ def create_dataloading_job_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._create_dataloading_job_serialize( - graph_name=graph_name, - schema_mapping=schema_mapping, + _param = self._delete_job_by_id_serialize( + job_id=job_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -237,6 +231,7 @@ def create_dataloading_job_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -245,10 +240,9 @@ def create_dataloading_job_without_preload_content( return response_data.response - def _create_dataloading_job_serialize( + def _delete_job_by_id_serialize( self, - graph_name, - schema_mapping, + job_id, _request_auth, _content_type, _headers, @@ -268,14 +262,12 @@ def _create_dataloading_job_serialize( _body_params: Optional[bytes] = None # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name + if job_id is not None: + _path_params['job_id'] = job_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if schema_mapping is not None: - _body_params = schema_mapping # set the HTTP header `Accept` @@ -285,27 +277,14 @@ def _create_dataloading_job_serialize( ] ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ ] return self.api_client.param_serialize( - method='POST', - resource_path='/api/v1/graph/{graph_name}/dataloading', + method='DELETE', + resource_path='/api/v1/job/{job_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -322,9 +301,9 @@ def _create_dataloading_job_serialize( @validate_call - def delete_job_by_id( + def get_dataloading_job_config( self, - job_id: StrictStr, + graph_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -337,12 +316,13 @@ def delete_job_by_id( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> str: - """delete_job_by_id + ) -> DataloadingJobConfig: + """get_dataloading_job_config + Get the data loading configuration - :param job_id: (required) - :type job_id: str + :param graph_id: (required) + :type graph_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -365,8 +345,8 @@ def delete_job_by_id( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_job_by_id_serialize( - job_id=job_id, + _param = self._get_dataloading_job_config_serialize( + graph_id=graph_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -374,7 +354,8 @@ def delete_job_by_id( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "str", + '200': "DataloadingJobConfig", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -388,9 +369,9 @@ def delete_job_by_id( @validate_call - def delete_job_by_id_with_http_info( + def get_dataloading_job_config_with_http_info( self, - job_id: StrictStr, + graph_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -403,12 +384,13 @@ def delete_job_by_id_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[str]: - """delete_job_by_id + ) -> ApiResponse[DataloadingJobConfig]: + """get_dataloading_job_config + Get the data loading configuration - :param job_id: (required) - :type job_id: str + :param graph_id: (required) + :type graph_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -431,8 +413,8 @@ def delete_job_by_id_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_job_by_id_serialize( - job_id=job_id, + _param = self._get_dataloading_job_config_serialize( + graph_id=graph_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -440,7 +422,8 @@ def delete_job_by_id_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "str", + '200': "DataloadingJobConfig", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -454,9 +437,9 @@ def delete_job_by_id_with_http_info( @validate_call - def delete_job_by_id_without_preload_content( + def get_dataloading_job_config_without_preload_content( self, - job_id: StrictStr, + graph_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -470,11 +453,12 @@ def delete_job_by_id_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_job_by_id + """get_dataloading_job_config + Get the data loading configuration - :param job_id: (required) - :type job_id: str + :param graph_id: (required) + :type graph_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -497,8 +481,8 @@ def delete_job_by_id_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_job_by_id_serialize( - job_id=job_id, + _param = self._get_dataloading_job_config_serialize( + graph_id=graph_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -506,7 +490,8 @@ def delete_job_by_id_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "str", + '200': "DataloadingJobConfig", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -515,9 +500,9 @@ def delete_job_by_id_without_preload_content( return response_data.response - def _delete_job_by_id_serialize( + def _get_dataloading_job_config_serialize( self, - job_id, + graph_id, _request_auth, _content_type, _headers, @@ -537,8 +522,8 @@ def _delete_job_by_id_serialize( _body_params: Optional[bytes] = None # process the path parameters - if job_id is not None: - _path_params['job_id'] = job_id + if graph_id is not None: + _path_params['graph_id'] = graph_id # process the query parameters # process the header parameters # process the form parameters @@ -558,8 +543,8 @@ def _delete_job_by_id_serialize( ] return self.api_client.param_serialize( - method='DELETE', - resource_path='/api/v1/job/{job_id}', + method='GET', + resource_path='/api/v1/graph/{graph_id}/dataloading/config', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -576,9 +561,9 @@ def _delete_job_by_id_serialize( @validate_call - def get_dataloading_config( + def get_job_by_id( self, - graph_name: StrictStr, + job_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -591,13 +576,13 @@ def get_dataloading_config( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> SchemaMapping: - """get_dataloading_config + ) -> JobStatus: + """get_job_by_id - get dataloading configuration + Get job status by ID - :param graph_name: (required) - :type graph_name: str + :param job_id: (required) + :type job_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -620,8 +605,8 @@ def get_dataloading_config( :return: Returns the result object. """ # noqa: E501 - _param = self._get_dataloading_config_serialize( - graph_name=graph_name, + _param = self._get_job_by_id_serialize( + job_id=job_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -629,7 +614,8 @@ def get_dataloading_config( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SchemaMapping", + '200': "JobStatus", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -643,9 +629,9 @@ def get_dataloading_config( @validate_call - def get_dataloading_config_with_http_info( + def get_job_by_id_with_http_info( self, - graph_name: StrictStr, + job_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -658,13 +644,13 @@ def get_dataloading_config_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[SchemaMapping]: - """get_dataloading_config + ) -> ApiResponse[JobStatus]: + """get_job_by_id - get dataloading configuration + Get job status by ID - :param graph_name: (required) - :type graph_name: str + :param job_id: (required) + :type job_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -687,8 +673,8 @@ def get_dataloading_config_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_dataloading_config_serialize( - graph_name=graph_name, + _param = self._get_job_by_id_serialize( + job_id=job_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -696,7 +682,8 @@ def get_dataloading_config_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SchemaMapping", + '200': "JobStatus", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -710,9 +697,9 @@ def get_dataloading_config_with_http_info( @validate_call - def get_dataloading_config_without_preload_content( + def get_job_by_id_without_preload_content( self, - graph_name: StrictStr, + job_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -726,12 +713,12 @@ def get_dataloading_config_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_dataloading_config + """get_job_by_id - get dataloading configuration + Get job status by ID - :param graph_name: (required) - :type graph_name: str + :param job_id: (required) + :type job_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -754,8 +741,8 @@ def get_dataloading_config_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_dataloading_config_serialize( - graph_name=graph_name, + _param = self._get_job_by_id_serialize( + job_id=job_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -763,7 +750,8 @@ def get_dataloading_config_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "SchemaMapping", + '200': "JobStatus", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -772,9 +760,9 @@ def get_dataloading_config_without_preload_content( return response_data.response - def _get_dataloading_config_serialize( + def _get_job_by_id_serialize( self, - graph_name, + job_id, _request_auth, _content_type, _headers, @@ -794,8 +782,8 @@ def _get_dataloading_config_serialize( _body_params: Optional[bytes] = None # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name + if job_id is not None: + _path_params['job_id'] = job_id # process the query parameters # process the header parameters # process the form parameters @@ -816,7 +804,7 @@ def _get_dataloading_config_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/graph/{graph_name}/dataloading/config', + resource_path='/api/v1/job/{job_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -833,9 +821,8 @@ def _get_dataloading_config_serialize( @validate_call - def get_job_by_id( + def list_jobs( self, - job_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -848,12 +835,11 @@ def get_job_by_id( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> JobStatus: - """get_job_by_id + ) -> List[JobStatus]: + """list_jobs + List all jobs - :param job_id: (required) - :type job_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -876,8 +862,7 @@ def get_job_by_id( :return: Returns the result object. """ # noqa: E501 - _param = self._get_job_by_id_serialize( - job_id=job_id, + _param = self._list_jobs_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -885,7 +870,8 @@ def get_job_by_id( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "JobStatus", + '200': "List[JobStatus]", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -899,9 +885,8 @@ def get_job_by_id( @validate_call - def get_job_by_id_with_http_info( + def list_jobs_with_http_info( self, - job_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -914,12 +899,11 @@ def get_job_by_id_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[JobStatus]: - """get_job_by_id + ) -> ApiResponse[List[JobStatus]]: + """list_jobs + List all jobs - :param job_id: (required) - :type job_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -942,8 +926,7 @@ def get_job_by_id_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_job_by_id_serialize( - job_id=job_id, + _param = self._list_jobs_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -951,7 +934,8 @@ def get_job_by_id_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "JobStatus", + '200': "List[JobStatus]", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -965,9 +949,8 @@ def get_job_by_id_with_http_info( @validate_call - def get_job_by_id_without_preload_content( + def list_jobs_without_preload_content( self, - job_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -981,11 +964,10 @@ def get_job_by_id_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_job_by_id + """list_jobs + List all jobs - :param job_id: (required) - :type job_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1008,8 +990,7 @@ def get_job_by_id_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_job_by_id_serialize( - job_id=job_id, + _param = self._list_jobs_serialize( _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1017,7 +998,8 @@ def get_job_by_id_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "JobStatus", + '200': "List[JobStatus]", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1026,9 +1008,8 @@ def get_job_by_id_without_preload_content( return response_data.response - def _get_job_by_id_serialize( + def _list_jobs_serialize( self, - job_id, _request_auth, _content_type, _headers, @@ -1048,8 +1029,6 @@ def _get_job_by_id_serialize( _body_params: Optional[bytes] = None # process the path parameters - if job_id is not None: - _path_params['job_id'] = job_id # process the query parameters # process the header parameters # process the form parameters @@ -1070,7 +1049,7 @@ def _get_job_by_id_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/job/{job_id}', + resource_path='/api/v1/job', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1087,8 +1066,10 @@ def _get_job_by_id_serialize( @validate_call - def list_jobs( + def submit_dataloading_job( self, + graph_id: StrictStr, + dataloading_job_config: DataloadingJobConfig, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1101,10 +1082,15 @@ def list_jobs( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[JobStatus]: - """list_jobs + ) -> CreateDataloadingJobResponse: + """submit_dataloading_job + Submit a dataloading job + :param graph_id: (required) + :type graph_id: str + :param dataloading_job_config: (required) + :type dataloading_job_config: DataloadingJobConfig :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1127,7 +1113,9 @@ def list_jobs( :return: Returns the result object. """ # noqa: E501 - _param = self._list_jobs_serialize( + _param = self._submit_dataloading_job_serialize( + graph_id=graph_id, + dataloading_job_config=dataloading_job_config, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1135,7 +1123,9 @@ def list_jobs( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[JobStatus]", + '200': "CreateDataloadingJobResponse", + '400': "Error", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1149,8 +1139,10 @@ def list_jobs( @validate_call - def list_jobs_with_http_info( + def submit_dataloading_job_with_http_info( self, + graph_id: StrictStr, + dataloading_job_config: DataloadingJobConfig, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1163,10 +1155,15 @@ def list_jobs_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[JobStatus]]: - """list_jobs + ) -> ApiResponse[CreateDataloadingJobResponse]: + """submit_dataloading_job + Submit a dataloading job + :param graph_id: (required) + :type graph_id: str + :param dataloading_job_config: (required) + :type dataloading_job_config: DataloadingJobConfig :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1189,7 +1186,9 @@ def list_jobs_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_jobs_serialize( + _param = self._submit_dataloading_job_serialize( + graph_id=graph_id, + dataloading_job_config=dataloading_job_config, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1197,7 +1196,9 @@ def list_jobs_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[JobStatus]", + '200': "CreateDataloadingJobResponse", + '400': "Error", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1211,8 +1212,10 @@ def list_jobs_with_http_info( @validate_call - def list_jobs_without_preload_content( + def submit_dataloading_job_without_preload_content( self, + graph_id: StrictStr, + dataloading_job_config: DataloadingJobConfig, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1226,9 +1229,14 @@ def list_jobs_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """list_jobs + """submit_dataloading_job + Submit a dataloading job + :param graph_id: (required) + :type graph_id: str + :param dataloading_job_config: (required) + :type dataloading_job_config: DataloadingJobConfig :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1251,7 +1259,9 @@ def list_jobs_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_jobs_serialize( + _param = self._submit_dataloading_job_serialize( + graph_id=graph_id, + dataloading_job_config=dataloading_job_config, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1259,7 +1269,9 @@ def list_jobs_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[JobStatus]", + '200': "CreateDataloadingJobResponse", + '400': "Error", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1268,8 +1280,10 @@ def list_jobs_without_preload_content( return response_data.response - def _list_jobs_serialize( + def _submit_dataloading_job_serialize( self, + graph_id, + dataloading_job_config, _request_auth, _content_type, _headers, @@ -1289,10 +1303,14 @@ def _list_jobs_serialize( _body_params: Optional[bytes] = None # process the path parameters + if graph_id is not None: + _path_params['graph_id'] = graph_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if dataloading_job_config is not None: + _body_params = dataloading_job_config # set the HTTP header `Accept` @@ -1302,14 +1320,27 @@ def _list_jobs_serialize( ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ ] return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/job', + method='POST', + resource_path='/api/v1/graph/{graph_id}/dataloading', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/python/graphscope/flex/rest/api/procedure_api.py b/python/graphscope/flex/rest/api/procedure_api.py index ae8366e39457..686af4a625e1 100644 --- a/python/graphscope/flex/rest/api/procedure_api.py +++ b/python/graphscope/flex/rest/api/procedure_api.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,7 +19,10 @@ from pydantic import StrictStr from typing import Optional -from graphscope.flex.rest.models.procedure import Procedure +from graphscope.flex.rest.models.create_procedure_request import CreateProcedureRequest +from graphscope.flex.rest.models.create_procedure_response import CreateProcedureResponse +from graphscope.flex.rest.models.get_procedure_response import GetProcedureResponse +from graphscope.flex.rest.models.update_procedure_request import UpdateProcedureRequest from graphscope.flex.rest.api_client import ApiClient, RequestSerialized from graphscope.flex.rest.api_response import ApiResponse @@ -42,8 +45,8 @@ def __init__(self, api_client=None) -> None: @validate_call def create_procedure( self, - graph_name: StrictStr, - procedure: Procedure, + graph_id: StrictStr, + create_procedure_request: CreateProcedureRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -56,15 +59,15 @@ def create_procedure( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> str: + ) -> CreateProcedureResponse: """create_procedure Create a new stored procedure on a certain graph - :param graph_name: (required) - :type graph_name: str - :param procedure: (required) - :type procedure: Procedure + :param graph_id: (required) + :type graph_id: str + :param create_procedure_request: (required) + :type create_procedure_request: CreateProcedureRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -88,8 +91,8 @@ def create_procedure( """ # noqa: E501 _param = self._create_procedure_serialize( - graph_name=graph_name, - procedure=procedure, + graph_id=graph_id, + create_procedure_request=create_procedure_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -97,7 +100,9 @@ def create_procedure( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "str", + '200': "CreateProcedureResponse", + '400': "Error", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -113,8 +118,8 @@ def create_procedure( @validate_call def create_procedure_with_http_info( self, - graph_name: StrictStr, - procedure: Procedure, + graph_id: StrictStr, + create_procedure_request: CreateProcedureRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -127,15 +132,15 @@ def create_procedure_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[str]: + ) -> ApiResponse[CreateProcedureResponse]: """create_procedure Create a new stored procedure on a certain graph - :param graph_name: (required) - :type graph_name: str - :param procedure: (required) - :type procedure: Procedure + :param graph_id: (required) + :type graph_id: str + :param create_procedure_request: (required) + :type create_procedure_request: CreateProcedureRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -159,8 +164,8 @@ def create_procedure_with_http_info( """ # noqa: E501 _param = self._create_procedure_serialize( - graph_name=graph_name, - procedure=procedure, + graph_id=graph_id, + create_procedure_request=create_procedure_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -168,7 +173,9 @@ def create_procedure_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "str", + '200': "CreateProcedureResponse", + '400': "Error", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -184,8 +191,8 @@ def create_procedure_with_http_info( @validate_call def create_procedure_without_preload_content( self, - graph_name: StrictStr, - procedure: Procedure, + graph_id: StrictStr, + create_procedure_request: CreateProcedureRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -203,10 +210,10 @@ def create_procedure_without_preload_content( Create a new stored procedure on a certain graph - :param graph_name: (required) - :type graph_name: str - :param procedure: (required) - :type procedure: Procedure + :param graph_id: (required) + :type graph_id: str + :param create_procedure_request: (required) + :type create_procedure_request: CreateProcedureRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -230,8 +237,8 @@ def create_procedure_without_preload_content( """ # noqa: E501 _param = self._create_procedure_serialize( - graph_name=graph_name, - procedure=procedure, + graph_id=graph_id, + create_procedure_request=create_procedure_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -239,7 +246,9 @@ def create_procedure_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "str", + '200': "CreateProcedureResponse", + '400': "Error", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -250,8 +259,8 @@ def create_procedure_without_preload_content( def _create_procedure_serialize( self, - graph_name, - procedure, + graph_id, + create_procedure_request, _request_auth, _content_type, _headers, @@ -271,14 +280,14 @@ def _create_procedure_serialize( _body_params: Optional[bytes] = None # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name + if graph_id is not None: + _path_params['graph_id'] = graph_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if procedure is not None: - _body_params = procedure + if create_procedure_request is not None: + _body_params = create_procedure_request # set the HTTP header `Accept` @@ -308,7 +317,7 @@ def _create_procedure_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/api/v1/graph/{graph_name}/procedure', + resource_path='/v1/graph/{graph_id}/procedure', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -325,10 +334,10 @@ def _create_procedure_serialize( @validate_call - def delete_procedure( + def delete_procedure_by_id( self, - graph_name: StrictStr, - procedure_name: StrictStr, + graph_id: StrictStr, + procedure_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -342,14 +351,14 @@ def delete_procedure( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> str: - """delete_procedure + """delete_procedure_by_id - Delete a stored procedure on a certain graph + Delete a stored procedure by ID - :param graph_name: (required) - :type graph_name: str - :param procedure_name: (required) - :type procedure_name: str + :param graph_id: (required) + :type graph_id: str + :param procedure_id: (required) + :type procedure_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -372,9 +381,9 @@ def delete_procedure( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_procedure_serialize( - graph_name=graph_name, - procedure_name=procedure_name, + _param = self._delete_procedure_by_id_serialize( + graph_id=graph_id, + procedure_id=procedure_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -383,6 +392,7 @@ def delete_procedure( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -396,10 +406,10 @@ def delete_procedure( @validate_call - def delete_procedure_with_http_info( + def delete_procedure_by_id_with_http_info( self, - graph_name: StrictStr, - procedure_name: StrictStr, + graph_id: StrictStr, + procedure_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -413,14 +423,14 @@ def delete_procedure_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[str]: - """delete_procedure + """delete_procedure_by_id - Delete a stored procedure on a certain graph + Delete a stored procedure by ID - :param graph_name: (required) - :type graph_name: str - :param procedure_name: (required) - :type procedure_name: str + :param graph_id: (required) + :type graph_id: str + :param procedure_id: (required) + :type procedure_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -443,9 +453,9 @@ def delete_procedure_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_procedure_serialize( - graph_name=graph_name, - procedure_name=procedure_name, + _param = self._delete_procedure_by_id_serialize( + graph_id=graph_id, + procedure_id=procedure_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -454,6 +464,7 @@ def delete_procedure_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -467,10 +478,10 @@ def delete_procedure_with_http_info( @validate_call - def delete_procedure_without_preload_content( + def delete_procedure_by_id_without_preload_content( self, - graph_name: StrictStr, - procedure_name: StrictStr, + graph_id: StrictStr, + procedure_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -484,14 +495,14 @@ def delete_procedure_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_procedure + """delete_procedure_by_id - Delete a stored procedure on a certain graph + Delete a stored procedure by ID - :param graph_name: (required) - :type graph_name: str - :param procedure_name: (required) - :type procedure_name: str + :param graph_id: (required) + :type graph_id: str + :param procedure_id: (required) + :type procedure_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -514,9 +525,9 @@ def delete_procedure_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_procedure_serialize( - graph_name=graph_name, - procedure_name=procedure_name, + _param = self._delete_procedure_by_id_serialize( + graph_id=graph_id, + procedure_id=procedure_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -525,6 +536,7 @@ def delete_procedure_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -533,10 +545,10 @@ def delete_procedure_without_preload_content( return response_data.response - def _delete_procedure_serialize( + def _delete_procedure_by_id_serialize( self, - graph_name, - procedure_name, + graph_id, + procedure_id, _request_auth, _content_type, _headers, @@ -556,10 +568,10 @@ def _delete_procedure_serialize( _body_params: Optional[bytes] = None # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name - if procedure_name is not None: - _path_params['procedure_name'] = procedure_name + if graph_id is not None: + _path_params['graph_id'] = graph_id + if procedure_id is not None: + _path_params['procedure_id'] = procedure_id # process the query parameters # process the header parameters # process the form parameters @@ -580,7 +592,7 @@ def _delete_procedure_serialize( return self.api_client.param_serialize( method='DELETE', - resource_path='/api/v1/graph/{graph_name}/procedure/{procedure_name}', + resource_path='/v1/graph/{graph_id}/procedure/{procedure_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -597,10 +609,10 @@ def _delete_procedure_serialize( @validate_call - def get_procedure( + def get_procedure_by_id( self, - graph_name: StrictStr, - procedure_name: StrictStr, + graph_id: StrictStr, + procedure_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -613,15 +625,15 @@ def get_procedure( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Procedure: - """get_procedure + ) -> GetProcedureResponse: + """get_procedure_by_id - Get a procedure by name + Get a stored procedure by ID - :param graph_name: (required) - :type graph_name: str - :param procedure_name: (required) - :type procedure_name: str + :param graph_id: (required) + :type graph_id: str + :param procedure_id: (required) + :type procedure_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -644,9 +656,9 @@ def get_procedure( :return: Returns the result object. """ # noqa: E501 - _param = self._get_procedure_serialize( - graph_name=graph_name, - procedure_name=procedure_name, + _param = self._get_procedure_by_id_serialize( + graph_id=graph_id, + procedure_id=procedure_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -654,7 +666,8 @@ def get_procedure( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Procedure", + '200': "GetProcedureResponse", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -668,10 +681,10 @@ def get_procedure( @validate_call - def get_procedure_with_http_info( + def get_procedure_by_id_with_http_info( self, - graph_name: StrictStr, - procedure_name: StrictStr, + graph_id: StrictStr, + procedure_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -684,15 +697,15 @@ def get_procedure_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Procedure]: - """get_procedure + ) -> ApiResponse[GetProcedureResponse]: + """get_procedure_by_id - Get a procedure by name + Get a stored procedure by ID - :param graph_name: (required) - :type graph_name: str - :param procedure_name: (required) - :type procedure_name: str + :param graph_id: (required) + :type graph_id: str + :param procedure_id: (required) + :type procedure_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -715,9 +728,9 @@ def get_procedure_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_procedure_serialize( - graph_name=graph_name, - procedure_name=procedure_name, + _param = self._get_procedure_by_id_serialize( + graph_id=graph_id, + procedure_id=procedure_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -725,7 +738,8 @@ def get_procedure_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Procedure", + '200': "GetProcedureResponse", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -739,10 +753,10 @@ def get_procedure_with_http_info( @validate_call - def get_procedure_without_preload_content( + def get_procedure_by_id_without_preload_content( self, - graph_name: StrictStr, - procedure_name: StrictStr, + graph_id: StrictStr, + procedure_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -756,14 +770,14 @@ def get_procedure_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_procedure + """get_procedure_by_id - Get a procedure by name + Get a stored procedure by ID - :param graph_name: (required) - :type graph_name: str - :param procedure_name: (required) - :type procedure_name: str + :param graph_id: (required) + :type graph_id: str + :param procedure_id: (required) + :type procedure_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -786,9 +800,9 @@ def get_procedure_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_procedure_serialize( - graph_name=graph_name, - procedure_name=procedure_name, + _param = self._get_procedure_by_id_serialize( + graph_id=graph_id, + procedure_id=procedure_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -796,7 +810,8 @@ def get_procedure_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Procedure", + '200': "GetProcedureResponse", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -805,10 +820,10 @@ def get_procedure_without_preload_content( return response_data.response - def _get_procedure_serialize( + def _get_procedure_by_id_serialize( self, - graph_name, - procedure_name, + graph_id, + procedure_id, _request_auth, _content_type, _headers, @@ -828,10 +843,10 @@ def _get_procedure_serialize( _body_params: Optional[bytes] = None # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name - if procedure_name is not None: - _path_params['procedure_name'] = procedure_name + if graph_id is not None: + _path_params['graph_id'] = graph_id + if procedure_id is not None: + _path_params['procedure_id'] = procedure_id # process the query parameters # process the header parameters # process the form parameters @@ -852,7 +867,7 @@ def _get_procedure_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/graph/{graph_name}/procedure/{procedure_name}', + resource_path='/v1/graph/{graph_id}/procedure/{procedure_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -871,6 +886,7 @@ def _get_procedure_serialize( @validate_call def list_procedures( self, + graph_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -883,11 +899,13 @@ def list_procedures( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[Procedure]: + ) -> List[GetProcedureResponse]: """list_procedures - List all the stored procedures + List all stored procedures on a certain graph + :param graph_id: (required) + :type graph_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -911,6 +929,7 @@ def list_procedures( """ # noqa: E501 _param = self._list_procedures_serialize( + graph_id=graph_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -918,7 +937,9 @@ def list_procedures( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[Procedure]", + '200': "List[GetProcedureResponse]", + '400': "Error", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -934,6 +955,7 @@ def list_procedures( @validate_call def list_procedures_with_http_info( self, + graph_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -946,11 +968,13 @@ def list_procedures_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[Procedure]]: + ) -> ApiResponse[List[GetProcedureResponse]]: """list_procedures - List all the stored procedures + List all stored procedures on a certain graph + :param graph_id: (required) + :type graph_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -974,6 +998,7 @@ def list_procedures_with_http_info( """ # noqa: E501 _param = self._list_procedures_serialize( + graph_id=graph_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -981,7 +1006,9 @@ def list_procedures_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[Procedure]", + '200': "List[GetProcedureResponse]", + '400': "Error", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -997,6 +1024,7 @@ def list_procedures_with_http_info( @validate_call def list_procedures_without_preload_content( self, + graph_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1012,8 +1040,10 @@ def list_procedures_without_preload_content( ) -> RESTResponseType: """list_procedures - List all the stored procedures + List all stored procedures on a certain graph + :param graph_id: (required) + :type graph_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1037,6 +1067,7 @@ def list_procedures_without_preload_content( """ # noqa: E501 _param = self._list_procedures_serialize( + graph_id=graph_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1044,7 +1075,9 @@ def list_procedures_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[Procedure]", + '200': "List[GetProcedureResponse]", + '400': "Error", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1055,6 +1088,7 @@ def list_procedures_without_preload_content( def _list_procedures_serialize( self, + graph_id, _request_auth, _content_type, _headers, @@ -1074,6 +1108,8 @@ def _list_procedures_serialize( _body_params: Optional[bytes] = None # process the path parameters + if graph_id is not None: + _path_params['graph_id'] = graph_id # process the query parameters # process the header parameters # process the form parameters @@ -1094,264 +1130,7 @@ def _list_procedures_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/procedure', - path_params=_path_params, - query_params=_query_params, - header_params=_header_params, - body=_body_params, - post_params=_form_params, - files=_files, - auth_settings=_auth_settings, - collection_formats=_collection_formats, - _host=_host, - _request_auth=_request_auth - ) - - - - - @validate_call - def list_procedures_by_graph( - self, - graph_name: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[Procedure]: - """list_procedures_by_graph - - List stored procedures on a certain graph - - :param graph_name: (required) - :type graph_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_procedures_by_graph_serialize( - graph_name=graph_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[Procedure]", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ).data - - - @validate_call - def list_procedures_by_graph_with_http_info( - self, - graph_name: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[Procedure]]: - """list_procedures_by_graph - - List stored procedures on a certain graph - - :param graph_name: (required) - :type graph_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_procedures_by_graph_serialize( - graph_name=graph_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[Procedure]", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - response_data.read() - return self.api_client.response_deserialize( - response_data=response_data, - response_types_map=_response_types_map, - ) - - - @validate_call - def list_procedures_by_graph_without_preload_content( - self, - graph_name: StrictStr, - _request_timeout: Union[ - None, - Annotated[StrictFloat, Field(gt=0)], - Tuple[ - Annotated[StrictFloat, Field(gt=0)], - Annotated[StrictFloat, Field(gt=0)] - ] - ] = None, - _request_auth: Optional[Dict[StrictStr, Any]] = None, - _content_type: Optional[StrictStr] = None, - _headers: Optional[Dict[StrictStr, Any]] = None, - _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> RESTResponseType: - """list_procedures_by_graph - - List stored procedures on a certain graph - - :param graph_name: (required) - :type graph_name: str - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :type _request_timeout: int, tuple(int, int), optional - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the - authentication in the spec for a single request. - :type _request_auth: dict, optional - :param _content_type: force content-type for the request. - :type _content_type: str, Optional - :param _headers: set to override the headers for a single - request; this effectively ignores the headers - in the spec for a single request. - :type _headers: dict, optional - :param _host_index: set to override the host_index for a single - request; this effectively ignores the host_index - in the spec for a single request. - :type _host_index: int, optional - :return: Returns the result object. - """ # noqa: E501 - - _param = self._list_procedures_by_graph_serialize( - graph_name=graph_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[Procedure]", - } - response_data = self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _list_procedures_by_graph_serialize( - self, - graph_name, - _request_auth, - _content_type, - _headers, - _host_index, - ) -> RequestSerialized: - - _host = None - - _collection_formats: Dict[str, str] = { - } - - _path_params: Dict[str, str] = {} - _query_params: List[Tuple[str, str]] = [] - _header_params: Dict[str, Optional[str]] = _headers or {} - _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name - # process the query parameters - # process the header parameters - # process the form parameters - # process the body parameter - - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - - # authentication setting - _auth_settings: List[str] = [ - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/api/v1/graph/{graph_name}/procedure', + resource_path='/v1/graph/{graph_id}/procedure', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1368,11 +1147,11 @@ def _list_procedures_by_graph_serialize( @validate_call - def update_procedure( + def update_procedure_by_id( self, - graph_name: StrictStr, - procedure_name: StrictStr, - procedure: Optional[Procedure] = None, + graph_id: StrictStr, + procedure_id: StrictStr, + update_procedure_request: Optional[UpdateProcedureRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1386,16 +1165,16 @@ def update_procedure( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> str: - """update_procedure + """update_procedure_by_id - Update stored procedure on a certain graph + Update a stored procedure by ID - :param graph_name: (required) - :type graph_name: str - :param procedure_name: (required) - :type procedure_name: str - :param procedure: - :type procedure: Procedure + :param graph_id: (required) + :type graph_id: str + :param procedure_id: (required) + :type procedure_id: str + :param update_procedure_request: + :type update_procedure_request: UpdateProcedureRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1418,10 +1197,10 @@ def update_procedure( :return: Returns the result object. """ # noqa: E501 - _param = self._update_procedure_serialize( - graph_name=graph_name, - procedure_name=procedure_name, - procedure=procedure, + _param = self._update_procedure_by_id_serialize( + graph_id=graph_id, + procedure_id=procedure_id, + update_procedure_request=update_procedure_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1430,6 +1209,7 @@ def update_procedure( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1443,11 +1223,11 @@ def update_procedure( @validate_call - def update_procedure_with_http_info( + def update_procedure_by_id_with_http_info( self, - graph_name: StrictStr, - procedure_name: StrictStr, - procedure: Optional[Procedure] = None, + graph_id: StrictStr, + procedure_id: StrictStr, + update_procedure_request: Optional[UpdateProcedureRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1461,16 +1241,16 @@ def update_procedure_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[str]: - """update_procedure + """update_procedure_by_id - Update stored procedure on a certain graph + Update a stored procedure by ID - :param graph_name: (required) - :type graph_name: str - :param procedure_name: (required) - :type procedure_name: str - :param procedure: - :type procedure: Procedure + :param graph_id: (required) + :type graph_id: str + :param procedure_id: (required) + :type procedure_id: str + :param update_procedure_request: + :type update_procedure_request: UpdateProcedureRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1493,10 +1273,10 @@ def update_procedure_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_procedure_serialize( - graph_name=graph_name, - procedure_name=procedure_name, - procedure=procedure, + _param = self._update_procedure_by_id_serialize( + graph_id=graph_id, + procedure_id=procedure_id, + update_procedure_request=update_procedure_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1505,6 +1285,7 @@ def update_procedure_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1518,11 +1299,11 @@ def update_procedure_with_http_info( @validate_call - def update_procedure_without_preload_content( + def update_procedure_by_id_without_preload_content( self, - graph_name: StrictStr, - procedure_name: StrictStr, - procedure: Optional[Procedure] = None, + graph_id: StrictStr, + procedure_id: StrictStr, + update_procedure_request: Optional[UpdateProcedureRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1536,16 +1317,16 @@ def update_procedure_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """update_procedure + """update_procedure_by_id - Update stored procedure on a certain graph + Update a stored procedure by ID - :param graph_name: (required) - :type graph_name: str - :param procedure_name: (required) - :type procedure_name: str - :param procedure: - :type procedure: Procedure + :param graph_id: (required) + :type graph_id: str + :param procedure_id: (required) + :type procedure_id: str + :param update_procedure_request: + :type update_procedure_request: UpdateProcedureRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1568,10 +1349,10 @@ def update_procedure_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._update_procedure_serialize( - graph_name=graph_name, - procedure_name=procedure_name, - procedure=procedure, + _param = self._update_procedure_by_id_serialize( + graph_id=graph_id, + procedure_id=procedure_id, + update_procedure_request=update_procedure_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1580,6 +1361,7 @@ def update_procedure_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -1588,11 +1370,11 @@ def update_procedure_without_preload_content( return response_data.response - def _update_procedure_serialize( + def _update_procedure_by_id_serialize( self, - graph_name, - procedure_name, - procedure, + graph_id, + procedure_id, + update_procedure_request, _request_auth, _content_type, _headers, @@ -1612,16 +1394,16 @@ def _update_procedure_serialize( _body_params: Optional[bytes] = None # process the path parameters - if graph_name is not None: - _path_params['graph_name'] = graph_name - if procedure_name is not None: - _path_params['procedure_name'] = procedure_name + if graph_id is not None: + _path_params['graph_id'] = graph_id + if procedure_id is not None: + _path_params['procedure_id'] = procedure_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if procedure is not None: - _body_params = procedure + if update_procedure_request is not None: + _body_params = update_procedure_request # set the HTTP header `Accept` @@ -1651,7 +1433,7 @@ def _update_procedure_serialize( return self.api_client.param_serialize( method='PUT', - resource_path='/api/v1/graph/{graph_name}/procedure/{procedure_name}', + resource_path='/v1/graph/{graph_id}/procedure/{procedure_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/python/graphscope/flex/rest/api/service_api.py b/python/graphscope/flex/rest/api/service_api.py index ad3e66205fe9..cb04b5453908 100644 --- a/python/graphscope/flex/rest/api/service_api.py +++ b/python/graphscope/flex/rest/api/service_api.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -90,6 +90,7 @@ def get_service_status( _response_types_map: Dict[str, Optional[str]] = { '200': "ServiceStatus", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -153,6 +154,7 @@ def get_service_status_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "ServiceStatus", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -216,6 +218,7 @@ def get_service_status_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "ServiceStatus", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -332,6 +335,7 @@ def restart_service( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -395,6 +399,7 @@ def restart_service_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -458,6 +463,7 @@ def restart_service_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -578,6 +584,8 @@ def start_service( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '400': "Error", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -645,6 +653,8 @@ def start_service_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '400': "Error", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -712,6 +722,8 @@ def start_service_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '400': "Error", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -844,6 +856,7 @@ def stop_service( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -907,6 +920,7 @@ def stop_service_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -970,6 +984,7 @@ def stop_service_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "str", + '500': "Error", } response_data = self.api_client.call_api( *_param, diff --git a/python/graphscope/flex/rest/api/utils_api.py b/python/graphscope/flex/rest/api/utils_api.py index f8b936fe09b8..a6bccd89ee85 100644 --- a/python/graphscope/flex/rest/api/utils_api.py +++ b/python/graphscope/flex/rest/api/utils_api.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,6 +19,7 @@ from pydantic import StrictBytes, StrictStr from typing import Optional, Union +from graphscope.flex.rest.models.upload_file_response import UploadFileResponse from graphscope.flex.rest.api_client import ApiClient, RequestSerialized from graphscope.flex.rest.api_response import ApiResponse @@ -54,7 +55,7 @@ def upload_file( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> str: + ) -> UploadFileResponse: """upload_file @@ -91,7 +92,8 @@ def upload_file( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "str", + '200': "UploadFileResponse", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -120,7 +122,7 @@ def upload_file_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[str]: + ) -> ApiResponse[UploadFileResponse]: """upload_file @@ -157,7 +159,8 @@ def upload_file_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "str", + '200': "UploadFileResponse", + '500': "Error", } response_data = self.api_client.call_api( *_param, @@ -223,7 +226,8 @@ def upload_file_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "str", + '200': "UploadFileResponse", + '500': "Error", } response_data = self.api_client.call_api( *_param, diff --git a/python/graphscope/flex/rest/api_client.py b/python/graphscope/flex/rest/api_client.py index 48481fcb6366..005ffc21b993 100644 --- a/python/graphscope/flex/rest/api_client.py +++ b/python/graphscope/flex/rest/api_client.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/python/graphscope/flex/rest/configuration.py b/python/graphscope/flex/rest/configuration.py index 110cf31214c7..a49843aeb7c7 100644 --- a/python/graphscope/flex/rest/configuration.py +++ b/python/graphscope/flex/rest/configuration.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -370,7 +370,7 @@ def to_debug_report(self): return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: 0.9.1\n"\ + "Version of the API: 1.0.0\n"\ "SDK Package Version: 1.0.0".\ format(env=sys.platform, pyversion=sys.version) diff --git a/python/graphscope/flex/rest/exceptions.py b/python/graphscope/flex/rest/exceptions.py index 8a1582bd9395..c2b39a21c846 100644 --- a/python/graphscope/flex/rest/exceptions.py +++ b/python/graphscope/flex/rest/exceptions.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/python/graphscope/flex/rest/models/__init__.py b/python/graphscope/flex/rest/models/__init__.py index ec359f781ce1..3bdfff150da7 100644 --- a/python/graphscope/flex/rest/models/__init__.py +++ b/python/graphscope/flex/rest/models/__init__.py @@ -6,7 +6,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -15,51 +15,56 @@ # import models into model package -from graphscope.flex.rest.models.alert_message import AlertMessage -from graphscope.flex.rest.models.alert_receiver import AlertReceiver -from graphscope.flex.rest.models.alert_rule import AlertRule +from graphscope.flex.rest.models.base_edge_type import BaseEdgeType +from graphscope.flex.rest.models.base_edge_type_vertex_type_pair_relations_inner import BaseEdgeTypeVertexTypePairRelationsInner +from graphscope.flex.rest.models.base_edge_type_vertex_type_pair_relations_inner_x_csr_params import BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams +from graphscope.flex.rest.models.base_property_meta import BasePropertyMeta +from graphscope.flex.rest.models.base_vertex_type import BaseVertexType +from graphscope.flex.rest.models.base_vertex_type_x_csr_params import BaseVertexTypeXCsrParams from graphscope.flex.rest.models.column_mapping import ColumnMapping -from graphscope.flex.rest.models.connection import Connection -from graphscope.flex.rest.models.connection_status import ConnectionStatus -from graphscope.flex.rest.models.data_source import DataSource -from graphscope.flex.rest.models.deployment_info import DeploymentInfo -from graphscope.flex.rest.models.deployment_info_graphs_info_value import DeploymentInfoGraphsInfoValue -from graphscope.flex.rest.models.deployment_status import DeploymentStatus -from graphscope.flex.rest.models.edge_data_source import EdgeDataSource +from graphscope.flex.rest.models.column_mapping_column import ColumnMappingColumn +from graphscope.flex.rest.models.create_alert_receiver_request import CreateAlertReceiverRequest +from graphscope.flex.rest.models.create_alert_rule_request import CreateAlertRuleRequest +from graphscope.flex.rest.models.create_dataloading_job_response import CreateDataloadingJobResponse +from graphscope.flex.rest.models.create_edge_type import CreateEdgeType +from graphscope.flex.rest.models.create_graph_request import CreateGraphRequest +from graphscope.flex.rest.models.create_graph_response import CreateGraphResponse +from graphscope.flex.rest.models.create_graph_schema_request import CreateGraphSchemaRequest +from graphscope.flex.rest.models.create_procedure_request import CreateProcedureRequest +from graphscope.flex.rest.models.create_procedure_response import CreateProcedureResponse +from graphscope.flex.rest.models.create_property_meta import CreatePropertyMeta +from graphscope.flex.rest.models.create_vertex_type import CreateVertexType +from graphscope.flex.rest.models.dataloading_job_config import DataloadingJobConfig +from graphscope.flex.rest.models.dataloading_job_config_edges_inner import DataloadingJobConfigEdgesInner +from graphscope.flex.rest.models.dataloading_job_config_loading_config import DataloadingJobConfigLoadingConfig +from graphscope.flex.rest.models.dataloading_job_config_loading_config_format import DataloadingJobConfigLoadingConfigFormat +from graphscope.flex.rest.models.dataloading_job_config_vertices_inner import DataloadingJobConfigVerticesInner from graphscope.flex.rest.models.edge_mapping import EdgeMapping -from graphscope.flex.rest.models.edge_mapping_destination_vertex_mappings_inner import EdgeMappingDestinationVertexMappingsInner -from graphscope.flex.rest.models.edge_mapping_source_vertex_mappings_inner import EdgeMappingSourceVertexMappingsInner -from graphscope.flex.rest.models.edge_mapping_source_vertex_mappings_inner_column import EdgeMappingSourceVertexMappingsInnerColumn from graphscope.flex.rest.models.edge_mapping_type_triplet import EdgeMappingTypeTriplet -from graphscope.flex.rest.models.edge_type import EdgeType -from graphscope.flex.rest.models.edge_type_vertex_type_pair_relations_inner import EdgeTypeVertexTypePairRelationsInner -from graphscope.flex.rest.models.edge_type_vertex_type_pair_relations_inner_x_csr_params import EdgeTypeVertexTypePairRelationsInnerXCsrParams -from graphscope.flex.rest.models.graph import Graph -from graphscope.flex.rest.models.graph_stored_procedures import GraphStoredProcedures -from graphscope.flex.rest.models.groot_dataloading_job_config import GrootDataloadingJobConfig -from graphscope.flex.rest.models.groot_dataloading_job_config_edges_inner import GrootDataloadingJobConfigEdgesInner -from graphscope.flex.rest.models.groot_edge_type import GrootEdgeType -from graphscope.flex.rest.models.groot_edge_type_relations_inner import GrootEdgeTypeRelationsInner -from graphscope.flex.rest.models.groot_graph import GrootGraph -from graphscope.flex.rest.models.groot_graph_gremlin_interface import GrootGraphGremlinInterface -from graphscope.flex.rest.models.groot_property import GrootProperty -from graphscope.flex.rest.models.groot_schema import GrootSchema -from graphscope.flex.rest.models.groot_vertex_type import GrootVertexType +from graphscope.flex.rest.models.error import Error +from graphscope.flex.rest.models.gs_data_type import GSDataType +from graphscope.flex.rest.models.get_alert_message_response import GetAlertMessageResponse +from graphscope.flex.rest.models.get_alert_receiver_response import GetAlertReceiverResponse +from graphscope.flex.rest.models.get_alert_rule_response import GetAlertRuleResponse +from graphscope.flex.rest.models.get_edge_type import GetEdgeType +from graphscope.flex.rest.models.get_graph_response import GetGraphResponse +from graphscope.flex.rest.models.get_graph_schema_response import GetGraphSchemaResponse +from graphscope.flex.rest.models.get_procedure_response import GetProcedureResponse +from graphscope.flex.rest.models.get_property_meta import GetPropertyMeta +from graphscope.flex.rest.models.get_vertex_type import GetVertexType from graphscope.flex.rest.models.job_status import JobStatus -from graphscope.flex.rest.models.model_property import ModelProperty -from graphscope.flex.rest.models.model_schema import ModelSchema -from graphscope.flex.rest.models.node_status import NodeStatus -from graphscope.flex.rest.models.procedure import Procedure -from graphscope.flex.rest.models.procedure_params_inner import ProcedureParamsInner -from graphscope.flex.rest.models.property_property_type import PropertyPropertyType +from graphscope.flex.rest.models.long_text import LongText +from graphscope.flex.rest.models.parameter import Parameter +from graphscope.flex.rest.models.primitive_type import PrimitiveType +from graphscope.flex.rest.models.running_deployment_info import RunningDeploymentInfo from graphscope.flex.rest.models.schema_mapping import SchemaMapping -from graphscope.flex.rest.models.schema_mapping_loading_config import SchemaMappingLoadingConfig -from graphscope.flex.rest.models.schema_mapping_loading_config_data_source import SchemaMappingLoadingConfigDataSource -from graphscope.flex.rest.models.schema_mapping_loading_config_format import SchemaMappingLoadingConfigFormat from graphscope.flex.rest.models.service_status import ServiceStatus from graphscope.flex.rest.models.service_status_sdk_endpoints import ServiceStatusSdkEndpoints from graphscope.flex.rest.models.start_service_request import StartServiceRequest -from graphscope.flex.rest.models.update_alert_messages_request import UpdateAlertMessagesRequest -from graphscope.flex.rest.models.vertex_data_source import VertexDataSource +from graphscope.flex.rest.models.stored_procedure_meta import StoredProcedureMeta +from graphscope.flex.rest.models.string_type import StringType +from graphscope.flex.rest.models.string_type_string import StringTypeString +from graphscope.flex.rest.models.update_alert_message_status_request import UpdateAlertMessageStatusRequest +from graphscope.flex.rest.models.update_procedure_request import UpdateProcedureRequest +from graphscope.flex.rest.models.upload_file_response import UploadFileResponse from graphscope.flex.rest.models.vertex_mapping import VertexMapping -from graphscope.flex.rest.models.vertex_type import VertexType diff --git a/python/graphscope/flex/rest/models/vertex_type.py b/python/graphscope/flex/rest/models/base_edge_type.py similarity index 70% rename from python/graphscope/flex/rest/models/vertex_type.py rename to python/graphscope/flex/rest/models/base_edge_type.py index f5dbfb4e1a7e..93e9b1bb75d5 100644 --- a/python/graphscope/flex/rest/models/vertex_type.py +++ b/python/graphscope/flex/rest/models/base_edge_type.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,21 +18,21 @@ import re # noqa: F401 import json -from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import BaseModel, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from graphscope.flex.rest.models.model_property import ModelProperty +from graphscope.flex.rest.models.base_edge_type_vertex_type_pair_relations_inner import BaseEdgeTypeVertexTypePairRelationsInner from typing import Optional, Set from typing_extensions import Self -class VertexType(BaseModel): +class BaseEdgeType(BaseModel): """ - VertexType + BaseEdgeType """ # noqa: E501 - type_id: Optional[StrictInt] = None - type_name: Optional[StrictStr] = None - properties: Optional[List[ModelProperty]] = None + type_name: StrictStr + vertex_type_pair_relations: List[BaseEdgeTypeVertexTypePairRelationsInner] + directed: Optional[StrictBool] = None primary_keys: Optional[List[StrictStr]] = None - __properties: ClassVar[List[str]] = ["type_id", "type_name", "properties", "primary_keys"] + __properties: ClassVar[List[str]] = ["type_name", "vertex_type_pair_relations", "directed", "primary_keys"] model_config = { "populate_by_name": True, @@ -52,7 +52,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of VertexType from a JSON string""" + """Create an instance of BaseEdgeType from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,18 +73,18 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each item in properties (list) + # override the default output from pydantic by calling `to_dict()` of each item in vertex_type_pair_relations (list) _items = [] - if self.properties: - for _item in self.properties: + if self.vertex_type_pair_relations: + for _item in self.vertex_type_pair_relations: if _item: _items.append(_item.to_dict()) - _dict['properties'] = _items + _dict['vertex_type_pair_relations'] = _items return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of VertexType from a dict""" + """Create an instance of BaseEdgeType from a dict""" if obj is None: return None @@ -92,9 +92,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "type_id": obj.get("type_id"), "type_name": obj.get("type_name"), - "properties": [ModelProperty.from_dict(_item) for _item in obj["properties"]] if obj.get("properties") is not None else None, + "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, + "directed": obj.get("directed"), "primary_keys": obj.get("primary_keys") }) return _obj diff --git a/python/graphscope/flex/rest/models/edge_type_vertex_type_pair_relations_inner.py b/python/graphscope/flex/rest/models/base_edge_type_vertex_type_pair_relations_inner.py similarity index 78% rename from python/graphscope/flex/rest/models/edge_type_vertex_type_pair_relations_inner.py rename to python/graphscope/flex/rest/models/base_edge_type_vertex_type_pair_relations_inner.py index b667f8faa10e..93d1a9e5d50b 100644 --- a/python/graphscope/flex/rest/models/edge_type_vertex_type_pair_relations_inner.py +++ b/python/graphscope/flex/rest/models/base_edge_type_vertex_type_pair_relations_inner.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -20,26 +20,23 @@ from pydantic import BaseModel, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from graphscope.flex.rest.models.edge_type_vertex_type_pair_relations_inner_x_csr_params import EdgeTypeVertexTypePairRelationsInnerXCsrParams +from graphscope.flex.rest.models.base_edge_type_vertex_type_pair_relations_inner_x_csr_params import BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams from typing import Optional, Set from typing_extensions import Self -class EdgeTypeVertexTypePairRelationsInner(BaseModel): +class BaseEdgeTypeVertexTypePairRelationsInner(BaseModel): """ - EdgeTypeVertexTypePairRelationsInner + BaseEdgeTypeVertexTypePairRelationsInner """ # noqa: E501 - source_vertex: Optional[StrictStr] = None - destination_vertex: Optional[StrictStr] = None - relation: Optional[StrictStr] = None - x_csr_params: Optional[EdgeTypeVertexTypePairRelationsInnerXCsrParams] = None + source_vertex: StrictStr + destination_vertex: StrictStr + relation: StrictStr + x_csr_params: Optional[BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams] = None __properties: ClassVar[List[str]] = ["source_vertex", "destination_vertex", "relation", "x_csr_params"] @field_validator('relation') def relation_validate_enum(cls, value): """Validates the enum""" - if value is None: - return value - if value not in set(['MANY_TO_MANY', 'ONE_TO_MANY', 'MANY_TO_ONE', 'ONE_TO_ONE']): raise ValueError("must be one of enum values ('MANY_TO_MANY', 'ONE_TO_MANY', 'MANY_TO_ONE', 'ONE_TO_ONE')") return value @@ -62,7 +59,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of EdgeTypeVertexTypePairRelationsInner from a JSON string""" + """Create an instance of BaseEdgeTypeVertexTypePairRelationsInner from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -90,7 +87,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of EdgeTypeVertexTypePairRelationsInner from a dict""" + """Create an instance of BaseEdgeTypeVertexTypePairRelationsInner from a dict""" if obj is None: return None @@ -101,7 +98,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "source_vertex": obj.get("source_vertex"), "destination_vertex": obj.get("destination_vertex"), "relation": obj.get("relation"), - "x_csr_params": EdgeTypeVertexTypePairRelationsInnerXCsrParams.from_dict(obj["x_csr_params"]) if obj.get("x_csr_params") is not None else None + "x_csr_params": BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams.from_dict(obj["x_csr_params"]) if obj.get("x_csr_params") is not None else None }) return _obj diff --git a/python/graphscope/flex/rest/models/edge_type_vertex_type_pair_relations_inner_x_csr_params.py b/python/graphscope/flex/rest/models/base_edge_type_vertex_type_pair_relations_inner_x_csr_params.py similarity index 90% rename from python/graphscope/flex/rest/models/edge_type_vertex_type_pair_relations_inner_x_csr_params.py rename to python/graphscope/flex/rest/models/base_edge_type_vertex_type_pair_relations_inner_x_csr_params.py index 2aa9c37a1568..9c95c2700a57 100644 --- a/python/graphscope/flex/rest/models/edge_type_vertex_type_pair_relations_inner_x_csr_params.py +++ b/python/graphscope/flex/rest/models/base_edge_type_vertex_type_pair_relations_inner_x_csr_params.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -23,7 +23,7 @@ from typing import Optional, Set from typing_extensions import Self -class EdgeTypeVertexTypePairRelationsInnerXCsrParams(BaseModel): +class BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams(BaseModel): """ Used for storage optimization """ # noqa: E501 @@ -58,7 +58,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of EdgeTypeVertexTypePairRelationsInnerXCsrParams from a JSON string""" + """Create an instance of BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -83,7 +83,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of EdgeTypeVertexTypePairRelationsInnerXCsrParams from a dict""" + """Create an instance of BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams from a dict""" if obj is None: return None diff --git a/python/graphscope/flex/rest/models/edge_mapping_destination_vertex_mappings_inner.py b/python/graphscope/flex/rest/models/base_property_meta.py similarity index 65% rename from python/graphscope/flex/rest/models/edge_mapping_destination_vertex_mappings_inner.py rename to python/graphscope/flex/rest/models/base_property_meta.py index d512f31ea980..7d8c53985255 100644 --- a/python/graphscope/flex/rest/models/edge_mapping_destination_vertex_mappings_inner.py +++ b/python/graphscope/flex/rest/models/base_property_meta.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,18 +18,22 @@ import re # noqa: F401 import json -from pydantic import BaseModel +from pydantic import BaseModel, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from graphscope.flex.rest.models.edge_mapping_source_vertex_mappings_inner_column import EdgeMappingSourceVertexMappingsInnerColumn +from graphscope.flex.rest.models.gs_data_type import GSDataType from typing import Optional, Set from typing_extensions import Self -class EdgeMappingDestinationVertexMappingsInner(BaseModel): +class BasePropertyMeta(BaseModel): """ - Mapping column index to the primary key of destination vertex + BasePropertyMeta """ # noqa: E501 - column: Optional[EdgeMappingSourceVertexMappingsInnerColumn] = None - __properties: ClassVar[List[str]] = ["column"] + property_name: StrictStr + property_type: GSDataType + nullable: Optional[StrictBool] = None + default_value: Optional[Any] = None + description: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["property_name", "property_type", "nullable", "default_value", "description"] model_config = { "populate_by_name": True, @@ -49,7 +53,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of EdgeMappingDestinationVertexMappingsInner from a JSON string""" + """Create an instance of BasePropertyMeta from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -70,14 +74,19 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of column - if self.column: - _dict['column'] = self.column.to_dict() + # override the default output from pydantic by calling `to_dict()` of property_type + if self.property_type: + _dict['property_type'] = self.property_type.to_dict() + # set to None if default_value (nullable) is None + # and model_fields_set contains the field + if self.default_value is None and "default_value" in self.model_fields_set: + _dict['default_value'] = None + return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of EdgeMappingDestinationVertexMappingsInner from a dict""" + """Create an instance of BasePropertyMeta from a dict""" if obj is None: return None @@ -85,7 +94,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "column": EdgeMappingSourceVertexMappingsInnerColumn.from_dict(obj["column"]) if obj.get("column") is not None else None + "property_name": obj.get("property_name"), + "property_type": GSDataType.from_dict(obj["property_type"]) if obj.get("property_type") is not None else None, + "nullable": obj.get("nullable"), + "default_value": obj.get("default_value"), + "description": obj.get("description") }) return _obj diff --git a/python/graphscope/flex/rest/models/groot_vertex_type.py b/python/graphscope/flex/rest/models/base_vertex_type.py similarity index 74% rename from python/graphscope/flex/rest/models/groot_vertex_type.py rename to python/graphscope/flex/rest/models/base_vertex_type.py index 230ce50707eb..2cd893cb24aa 100644 --- a/python/graphscope/flex/rest/models/groot_vertex_type.py +++ b/python/graphscope/flex/rest/models/base_vertex_type.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -20,17 +20,18 @@ from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from graphscope.flex.rest.models.groot_property import GrootProperty +from graphscope.flex.rest.models.base_vertex_type_x_csr_params import BaseVertexTypeXCsrParams from typing import Optional, Set from typing_extensions import Self -class GrootVertexType(BaseModel): +class BaseVertexType(BaseModel): """ - GrootVertexType + BaseVertexType """ # noqa: E501 - label: Optional[StrictStr] = None - properties: Optional[List[GrootProperty]] = None - __properties: ClassVar[List[str]] = ["label", "properties"] + type_name: StrictStr + primary_keys: List[StrictStr] + x_csr_params: Optional[BaseVertexTypeXCsrParams] = None + __properties: ClassVar[List[str]] = ["type_name", "primary_keys", "x_csr_params"] model_config = { "populate_by_name": True, @@ -50,7 +51,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of GrootVertexType from a JSON string""" + """Create an instance of BaseVertexType from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -71,18 +72,14 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each item in properties (list) - _items = [] - if self.properties: - for _item in self.properties: - if _item: - _items.append(_item.to_dict()) - _dict['properties'] = _items + # override the default output from pydantic by calling `to_dict()` of x_csr_params + if self.x_csr_params: + _dict['x_csr_params'] = self.x_csr_params.to_dict() return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GrootVertexType from a dict""" + """Create an instance of BaseVertexType from a dict""" if obj is None: return None @@ -90,8 +87,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "label": obj.get("label"), - "properties": [GrootProperty.from_dict(_item) for _item in obj["properties"]] if obj.get("properties") is not None else None + "type_name": obj.get("type_name"), + "primary_keys": obj.get("primary_keys"), + "x_csr_params": BaseVertexTypeXCsrParams.from_dict(obj["x_csr_params"]) if obj.get("x_csr_params") is not None else None }) return _obj diff --git a/python/graphscope/flex/rest/models/procedure_params_inner.py b/python/graphscope/flex/rest/models/base_vertex_type_x_csr_params.py similarity index 82% rename from python/graphscope/flex/rest/models/procedure_params_inner.py rename to python/graphscope/flex/rest/models/base_vertex_type_x_csr_params.py index 4559b124c271..df95a1512052 100644 --- a/python/graphscope/flex/rest/models/procedure_params_inner.py +++ b/python/graphscope/flex/rest/models/base_vertex_type_x_csr_params.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,18 +18,17 @@ import re # noqa: F401 import json -from pydantic import BaseModel, StrictStr +from pydantic import BaseModel, StrictInt from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self -class ProcedureParamsInner(BaseModel): +class BaseVertexTypeXCsrParams(BaseModel): """ - ProcedureParamsInner + Used for storage optimization """ # noqa: E501 - name: Optional[StrictStr] = None - type: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["name", "type"] + max_vertex_num: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["max_vertex_num"] model_config = { "populate_by_name": True, @@ -49,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ProcedureParamsInner from a JSON string""" + """Create an instance of BaseVertexTypeXCsrParams from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -74,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ProcedureParamsInner from a dict""" + """Create an instance of BaseVertexTypeXCsrParams from a dict""" if obj is None: return None @@ -82,8 +81,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "name": obj.get("name"), - "type": obj.get("type") + "max_vertex_num": obj.get("max_vertex_num") }) return _obj diff --git a/python/graphscope/flex/rest/models/column_mapping.py b/python/graphscope/flex/rest/models/column_mapping.py index 13535a072bcc..9101d053a72a 100644 --- a/python/graphscope/flex/rest/models/column_mapping.py +++ b/python/graphscope/flex/rest/models/column_mapping.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,8 +19,8 @@ import json from pydantic import BaseModel, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from graphscope.flex.rest.models.edge_mapping_source_vertex_mappings_inner_column import EdgeMappingSourceVertexMappingsInnerColumn +from typing import Any, ClassVar, Dict, List +from graphscope.flex.rest.models.column_mapping_column import ColumnMappingColumn from typing import Optional, Set from typing_extensions import Self @@ -28,8 +28,8 @@ class ColumnMapping(BaseModel): """ ColumnMapping """ # noqa: E501 - column: Optional[EdgeMappingSourceVertexMappingsInnerColumn] = None - var_property: Optional[StrictStr] = Field(default=None, description="must align with the schema", alias="property") + column: ColumnMappingColumn + var_property: StrictStr = Field(description="must align with the schema", alias="property") __properties: ClassVar[List[str]] = ["column", "property"] model_config = { @@ -86,7 +86,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "column": EdgeMappingSourceVertexMappingsInnerColumn.from_dict(obj["column"]) if obj.get("column") is not None else None, + "column": ColumnMappingColumn.from_dict(obj["column"]) if obj.get("column") is not None else None, "property": obj.get("property") }) return _obj diff --git a/python/graphscope/flex/rest/models/edge_mapping_source_vertex_mappings_inner_column.py b/python/graphscope/flex/rest/models/column_mapping_column.py similarity index 88% rename from python/graphscope/flex/rest/models/edge_mapping_source_vertex_mappings_inner_column.py rename to python/graphscope/flex/rest/models/column_mapping_column.py index 7165366b2006..5e44ab40785a 100644 --- a/python/graphscope/flex/rest/models/edge_mapping_source_vertex_mappings_inner_column.py +++ b/python/graphscope/flex/rest/models/column_mapping_column.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -23,9 +23,9 @@ from typing import Optional, Set from typing_extensions import Self -class EdgeMappingSourceVertexMappingsInnerColumn(BaseModel): +class ColumnMappingColumn(BaseModel): """ - EdgeMappingSourceVertexMappingsInnerColumn + ColumnMappingColumn """ # noqa: E501 index: Optional[StrictInt] = None name: Optional[StrictStr] = None @@ -49,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of EdgeMappingSourceVertexMappingsInnerColumn from a JSON string""" + """Create an instance of ColumnMappingColumn from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -74,7 +74,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of EdgeMappingSourceVertexMappingsInnerColumn from a dict""" + """Create an instance of ColumnMappingColumn from a dict""" if obj is None: return None diff --git a/python/graphscope/flex/rest/models/groot_property.py b/python/graphscope/flex/rest/models/create_alert_receiver_request.py similarity index 72% rename from python/graphscope/flex/rest/models/groot_property.py rename to python/graphscope/flex/rest/models/create_alert_receiver_request.py index 458688acb38f..41e80497b726 100644 --- a/python/graphscope/flex/rest/models/groot_property.py +++ b/python/graphscope/flex/rest/models/create_alert_receiver_request.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,29 +18,27 @@ import re # noqa: F401 import json -from pydantic import BaseModel, StrictBool, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self -class GrootProperty(BaseModel): +class CreateAlertReceiverRequest(BaseModel): """ - GrootProperty + CreateAlertReceiverRequest """ # noqa: E501 - id: Optional[StrictInt] = None - name: Optional[StrictStr] = None - type: Optional[StrictStr] = None - is_primary_key: Optional[StrictBool] = None - __properties: ClassVar[List[str]] = ["id", "name", "type", "is_primary_key"] + type: StrictStr + webhook_url: StrictStr + at_user_ids: List[StrictStr] + is_at_all: StrictBool + enable: StrictBool + __properties: ClassVar[List[str]] = ["type", "webhook_url", "at_user_ids", "is_at_all", "enable"] @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value is None: - return value - - if value not in set(['DT_STRING', 'DT_SIGNED_INT64', 'DT_DOUBLE']): - raise ValueError("must be one of enum values ('DT_STRING', 'DT_SIGNED_INT64', 'DT_DOUBLE')") + if value not in set(['webhook']): + raise ValueError("must be one of enum values ('webhook')") return value model_config = { @@ -61,7 +59,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of GrootProperty from a JSON string""" + """Create an instance of CreateAlertReceiverRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -86,7 +84,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GrootProperty from a dict""" + """Create an instance of CreateAlertReceiverRequest from a dict""" if obj is None: return None @@ -94,10 +92,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "id": obj.get("id"), - "name": obj.get("name"), "type": obj.get("type"), - "is_primary_key": obj.get("is_primary_key") + "webhook_url": obj.get("webhook_url"), + "at_user_ids": obj.get("at_user_ids"), + "is_at_all": obj.get("is_at_all"), + "enable": obj.get("enable") }) return _obj diff --git a/python/graphscope/flex/rest/models/alert_rule.py b/python/graphscope/flex/rest/models/create_alert_rule_request.py similarity index 83% rename from python/graphscope/flex/rest/models/alert_rule.py rename to python/graphscope/flex/rest/models/create_alert_rule_request.py index d80650145601..9cdd85175274 100644 --- a/python/graphscope/flex/rest/models/alert_rule.py +++ b/python/graphscope/flex/rest/models/create_alert_rule_request.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,28 +19,25 @@ import json from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional +from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self -class AlertRule(BaseModel): +class CreateAlertRuleRequest(BaseModel): """ - AlertRule + CreateAlertRuleRequest """ # noqa: E501 - name: Optional[StrictStr] = None - severity: Optional[StrictStr] = None - metric_type: Optional[StrictStr] = None - conditions_description: Optional[StrictStr] = None - frequency: Optional[StrictInt] = Field(default=None, description="(mins)") - enable: Optional[StrictBool] = None + name: StrictStr + severity: StrictStr + metric_type: StrictStr + conditions_description: StrictStr + frequency: StrictInt = Field(description="(mins)") + enable: StrictBool __properties: ClassVar[List[str]] = ["name", "severity", "metric_type", "conditions_description", "frequency", "enable"] @field_validator('severity') def severity_validate_enum(cls, value): """Validates the enum""" - if value is None: - return value - if value not in set(['warning', 'emergency']): raise ValueError("must be one of enum values ('warning', 'emergency')") return value @@ -48,9 +45,6 @@ def severity_validate_enum(cls, value): @field_validator('metric_type') def metric_type_validate_enum(cls, value): """Validates the enum""" - if value is None: - return value - if value not in set(['node', 'service']): raise ValueError("must be one of enum values ('node', 'service')") return value @@ -73,7 +67,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AlertRule from a JSON string""" + """Create an instance of CreateAlertRuleRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -98,7 +92,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AlertRule from a dict""" + """Create an instance of CreateAlertRuleRequest from a dict""" if obj is None: return None diff --git a/python/graphscope/flex/rest/models/create_dataloading_job_response.py b/python/graphscope/flex/rest/models/create_dataloading_job_response.py new file mode 100644 index 000000000000..0047a5d8c756 --- /dev/null +++ b/python/graphscope/flex/rest/models/create_dataloading_job_response.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + GraphScope FLEX HTTP SERVICE API + + 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) + + The version of the OpenAPI document: 1.0.0 + Contact: graphscope@alibaba-inc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class CreateDataloadingJobResponse(BaseModel): + """ + CreateDataloadingJobResponse + """ # noqa: E501 + job_id: StrictStr + __properties: ClassVar[List[str]] = ["job_id"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateDataloadingJobResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateDataloadingJobResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "job_id": obj.get("job_id") + }) + return _obj + + diff --git a/python/graphscope/flex/rest/models/edge_type.py b/python/graphscope/flex/rest/models/create_edge_type.py similarity index 69% rename from python/graphscope/flex/rest/models/edge_type.py rename to python/graphscope/flex/rest/models/create_edge_type.py index 902ab1b59fb0..d2e421eef43c 100644 --- a/python/graphscope/flex/rest/models/edge_type.py +++ b/python/graphscope/flex/rest/models/create_edge_type.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,22 +18,24 @@ import re # noqa: F401 import json -from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import BaseModel, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from graphscope.flex.rest.models.edge_type_vertex_type_pair_relations_inner import EdgeTypeVertexTypePairRelationsInner -from graphscope.flex.rest.models.model_property import ModelProperty +from graphscope.flex.rest.models.base_edge_type_vertex_type_pair_relations_inner import BaseEdgeTypeVertexTypePairRelationsInner +from graphscope.flex.rest.models.create_property_meta import CreatePropertyMeta from typing import Optional, Set from typing_extensions import Self -class EdgeType(BaseModel): +class CreateEdgeType(BaseModel): """ - EdgeType + CreateEdgeType """ # noqa: E501 - type_id: Optional[StrictInt] = None - type_name: Optional[StrictStr] = None - vertex_type_pair_relations: Optional[List[EdgeTypeVertexTypePairRelationsInner]] = None - properties: Optional[List[ModelProperty]] = None - __properties: ClassVar[List[str]] = ["type_id", "type_name", "vertex_type_pair_relations", "properties"] + type_name: StrictStr + vertex_type_pair_relations: List[BaseEdgeTypeVertexTypePairRelationsInner] + directed: Optional[StrictBool] = None + primary_keys: Optional[List[StrictStr]] = None + properties: List[CreatePropertyMeta] + description: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["type_name", "vertex_type_pair_relations", "directed", "primary_keys", "properties", "description"] model_config = { "populate_by_name": True, @@ -53,7 +55,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of EdgeType from a JSON string""" + """Create an instance of CreateEdgeType from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -92,7 +94,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of EdgeType from a dict""" + """Create an instance of CreateEdgeType from a dict""" if obj is None: return None @@ -100,10 +102,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "type_id": obj.get("type_id"), "type_name": obj.get("type_name"), - "vertex_type_pair_relations": [EdgeTypeVertexTypePairRelationsInner.from_dict(_item) for _item in obj["vertex_type_pair_relations"]] if obj.get("vertex_type_pair_relations") is not None else None, - "properties": [ModelProperty.from_dict(_item) for _item in obj["properties"]] if obj.get("properties") is not None else None + "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, + "directed": obj.get("directed"), + "primary_keys": obj.get("primary_keys"), + "properties": [CreatePropertyMeta.from_dict(_item) for _item in obj["properties"]] if obj.get("properties") is not None else None, + "description": obj.get("description") }) return _obj diff --git a/python/graphscope/flex/rest/models/graph.py b/python/graphscope/flex/rest/models/create_graph_request.py similarity index 65% rename from python/graphscope/flex/rest/models/graph.py rename to python/graphscope/flex/rest/models/create_graph_request.py index 5e7c6d5f1f29..314e73af6efd 100644 --- a/python/graphscope/flex/rest/models/graph.py +++ b/python/graphscope/flex/rest/models/create_graph_request.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,32 +18,22 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr, field_validator +from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from graphscope.flex.rest.models.graph_stored_procedures import GraphStoredProcedures -from graphscope.flex.rest.models.model_schema import ModelSchema +from graphscope.flex.rest.models.create_graph_schema_request import CreateGraphSchemaRequest +from graphscope.flex.rest.models.create_procedure_request import CreateProcedureRequest from typing import Optional, Set from typing_extensions import Self -class Graph(BaseModel): +class CreateGraphRequest(BaseModel): """ - Graph + CreateGraphRequest """ # noqa: E501 - name: Optional[StrictStr] = None - store_type: Optional[StrictStr] = None - stored_procedures: Optional[GraphStoredProcedures] = None - var_schema: Optional[ModelSchema] = Field(default=None, alias="schema") - __properties: ClassVar[List[str]] = ["name", "store_type", "stored_procedures", "schema"] - - @field_validator('store_type') - def store_type_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['mutable_csr']): - raise ValueError("must be one of enum values ('mutable_csr')") - return value + name: StrictStr + description: Optional[StrictStr] = None + stored_procedures: Optional[List[CreateProcedureRequest]] = None + var_schema: CreateGraphSchemaRequest = Field(alias="schema") + __properties: ClassVar[List[str]] = ["name", "description", "stored_procedures", "schema"] model_config = { "populate_by_name": True, @@ -63,7 +53,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Graph from a JSON string""" + """Create an instance of CreateGraphRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -84,9 +74,13 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of stored_procedures + # override the default output from pydantic by calling `to_dict()` of each item in stored_procedures (list) + _items = [] if self.stored_procedures: - _dict['stored_procedures'] = self.stored_procedures.to_dict() + for _item in self.stored_procedures: + if _item: + _items.append(_item.to_dict()) + _dict['stored_procedures'] = _items # override the default output from pydantic by calling `to_dict()` of var_schema if self.var_schema: _dict['schema'] = self.var_schema.to_dict() @@ -94,7 +88,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Graph from a dict""" + """Create an instance of CreateGraphRequest from a dict""" if obj is None: return None @@ -103,9 +97,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "name": obj.get("name"), - "store_type": obj.get("store_type"), - "stored_procedures": GraphStoredProcedures.from_dict(obj["stored_procedures"]) if obj.get("stored_procedures") is not None else None, - "schema": ModelSchema.from_dict(obj["schema"]) if obj.get("schema") is not None else None + "description": obj.get("description"), + "stored_procedures": [CreateProcedureRequest.from_dict(_item) for _item in obj["stored_procedures"]] if obj.get("stored_procedures") is not None else None, + "schema": CreateGraphSchemaRequest.from_dict(obj["schema"]) if obj.get("schema") is not None else None }) return _obj diff --git a/python/graphscope/flex/rest/models/create_graph_response.py b/python/graphscope/flex/rest/models/create_graph_response.py new file mode 100644 index 000000000000..8460f0c4d494 --- /dev/null +++ b/python/graphscope/flex/rest/models/create_graph_response.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + GraphScope FLEX HTTP SERVICE API + + 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) + + The version of the OpenAPI document: 1.0.0 + Contact: graphscope@alibaba-inc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class CreateGraphResponse(BaseModel): + """ + CreateGraphResponse + """ # noqa: E501 + graph_id: StrictStr + __properties: ClassVar[List[str]] = ["graph_id"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateGraphResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateGraphResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "graph_id": obj.get("graph_id") + }) + return _obj + + diff --git a/python/graphscope/flex/rest/models/groot_schema.py b/python/graphscope/flex/rest/models/create_graph_schema_request.py similarity index 69% rename from python/graphscope/flex/rest/models/groot_schema.py rename to python/graphscope/flex/rest/models/create_graph_schema_request.py index 455f519ee02c..16c02e9e1497 100644 --- a/python/graphscope/flex/rest/models/groot_schema.py +++ b/python/graphscope/flex/rest/models/create_graph_schema_request.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,19 +19,19 @@ import json from pydantic import BaseModel -from typing import Any, ClassVar, Dict, List, Optional -from graphscope.flex.rest.models.groot_edge_type import GrootEdgeType -from graphscope.flex.rest.models.groot_vertex_type import GrootVertexType +from typing import Any, ClassVar, Dict, List +from graphscope.flex.rest.models.create_edge_type import CreateEdgeType +from graphscope.flex.rest.models.create_vertex_type import CreateVertexType from typing import Optional, Set from typing_extensions import Self -class GrootSchema(BaseModel): +class CreateGraphSchemaRequest(BaseModel): """ - GrootSchema + CreateGraphSchemaRequest """ # noqa: E501 - vertices: Optional[List[GrootVertexType]] = None - edges: Optional[List[GrootEdgeType]] = None - __properties: ClassVar[List[str]] = ["vertices", "edges"] + vertex_types: List[CreateVertexType] + edge_types: List[CreateEdgeType] + __properties: ClassVar[List[str]] = ["vertex_types", "edge_types"] model_config = { "populate_by_name": True, @@ -51,7 +51,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of GrootSchema from a JSON string""" + """Create an instance of CreateGraphSchemaRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -72,25 +72,25 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each item in vertices (list) + # override the default output from pydantic by calling `to_dict()` of each item in vertex_types (list) _items = [] - if self.vertices: - for _item in self.vertices: + if self.vertex_types: + for _item in self.vertex_types: if _item: _items.append(_item.to_dict()) - _dict['vertices'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in edges (list) + _dict['vertex_types'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in edge_types (list) _items = [] - if self.edges: - for _item in self.edges: + if self.edge_types: + for _item in self.edge_types: if _item: _items.append(_item.to_dict()) - _dict['edges'] = _items + _dict['edge_types'] = _items return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GrootSchema from a dict""" + """Create an instance of CreateGraphSchemaRequest from a dict""" if obj is None: return None @@ -98,8 +98,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "vertices": [GrootVertexType.from_dict(_item) for _item in obj["vertices"]] if obj.get("vertices") is not None else None, - "edges": [GrootEdgeType.from_dict(_item) for _item in obj["edges"]] if obj.get("edges") is not None else None + "vertex_types": [CreateVertexType.from_dict(_item) for _item in obj["vertex_types"]] if obj.get("vertex_types") is not None else None, + "edge_types": [CreateEdgeType.from_dict(_item) for _item in obj["edge_types"]] if obj.get("edge_types") is not None else None }) return _obj diff --git a/python/graphscope/flex/rest/models/schema_mapping_loading_config_data_source.py b/python/graphscope/flex/rest/models/create_procedure_request.py similarity index 76% rename from python/graphscope/flex/rest/models/schema_mapping_loading_config_data_source.py rename to python/graphscope/flex/rest/models/create_procedure_request.py index d792e3eb5409..2232a27db6b6 100644 --- a/python/graphscope/flex/rest/models/schema_mapping_loading_config_data_source.py +++ b/python/graphscope/flex/rest/models/create_procedure_request.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -23,21 +23,21 @@ from typing import Optional, Set from typing_extensions import Self -class SchemaMappingLoadingConfigDataSource(BaseModel): +class CreateProcedureRequest(BaseModel): """ - SchemaMappingLoadingConfigDataSource + CreateProcedureRequest """ # noqa: E501 - scheme: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["scheme"] - - @field_validator('scheme') - def scheme_validate_enum(cls, value): + name: StrictStr + description: Optional[StrictStr] = None + type: StrictStr + query: StrictStr + __properties: ClassVar[List[str]] = ["name", "description", "type", "query"] + + @field_validator('type') + def type_validate_enum(cls, value): """Validates the enum""" - if value is None: - return value - - if value not in set(['file']): - raise ValueError("must be one of enum values ('file')") + if value not in set(['cpp', 'cypher']): + raise ValueError("must be one of enum values ('cpp', 'cypher')") return value model_config = { @@ -58,7 +58,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SchemaMappingLoadingConfigDataSource from a JSON string""" + """Create an instance of CreateProcedureRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -83,7 +83,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SchemaMappingLoadingConfigDataSource from a dict""" + """Create an instance of CreateProcedureRequest from a dict""" if obj is None: return None @@ -91,7 +91,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "scheme": obj.get("scheme") + "name": obj.get("name"), + "description": obj.get("description"), + "type": obj.get("type"), + "query": obj.get("query") }) return _obj diff --git a/python/graphscope/flex/rest/models/create_procedure_response.py b/python/graphscope/flex/rest/models/create_procedure_response.py new file mode 100644 index 000000000000..5f7d7ee276a0 --- /dev/null +++ b/python/graphscope/flex/rest/models/create_procedure_response.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + GraphScope FLEX HTTP SERVICE API + + 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) + + The version of the OpenAPI document: 1.0.0 + Contact: graphscope@alibaba-inc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class CreateProcedureResponse(BaseModel): + """ + CreateProcedureResponse + """ # noqa: E501 + procedure_id: StrictStr + __properties: ClassVar[List[str]] = ["procedure_id"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateProcedureResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateProcedureResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "procedure_id": obj.get("procedure_id") + }) + return _obj + + diff --git a/python/graphscope/flex/rest/models/model_property.py b/python/graphscope/flex/rest/models/create_property_meta.py similarity index 73% rename from python/graphscope/flex/rest/models/model_property.py rename to python/graphscope/flex/rest/models/create_property_meta.py index d8b32e230af3..21f5dc94d620 100644 --- a/python/graphscope/flex/rest/models/model_property.py +++ b/python/graphscope/flex/rest/models/create_property_meta.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,20 +18,22 @@ import re # noqa: F401 import json -from pydantic import BaseModel, StrictInt, StrictStr +from pydantic import BaseModel, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from graphscope.flex.rest.models.property_property_type import PropertyPropertyType +from graphscope.flex.rest.models.gs_data_type import GSDataType from typing import Optional, Set from typing_extensions import Self -class ModelProperty(BaseModel): +class CreatePropertyMeta(BaseModel): """ - ModelProperty + CreatePropertyMeta """ # noqa: E501 - property_id: Optional[StrictInt] = None - property_name: Optional[StrictStr] = None - property_type: Optional[PropertyPropertyType] = None - __properties: ClassVar[List[str]] = ["property_id", "property_name", "property_type"] + property_name: StrictStr + property_type: GSDataType + nullable: Optional[StrictBool] = None + default_value: Optional[Dict[str, Any]] = None + description: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["property_name", "property_type", "nullable", "default_value", "description"] model_config = { "populate_by_name": True, @@ -51,7 +53,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ModelProperty from a JSON string""" + """Create an instance of CreatePropertyMeta from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -79,7 +81,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ModelProperty from a dict""" + """Create an instance of CreatePropertyMeta from a dict""" if obj is None: return None @@ -87,9 +89,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "property_id": obj.get("property_id"), "property_name": obj.get("property_name"), - "property_type": PropertyPropertyType.from_dict(obj["property_type"]) if obj.get("property_type") is not None else None + "property_type": GSDataType.from_dict(obj["property_type"]) if obj.get("property_type") is not None else None, + "nullable": obj.get("nullable"), + "default_value": obj.get("default_value"), + "description": obj.get("description") }) return _obj diff --git a/python/graphscope/flex/rest/models/groot_edge_type.py b/python/graphscope/flex/rest/models/create_vertex_type.py similarity index 69% rename from python/graphscope/flex/rest/models/groot_edge_type.py rename to python/graphscope/flex/rest/models/create_vertex_type.py index ddabe2ac0b87..e5322ba4680f 100644 --- a/python/graphscope/flex/rest/models/groot_edge_type.py +++ b/python/graphscope/flex/rest/models/create_vertex_type.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -20,19 +20,21 @@ from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from graphscope.flex.rest.models.groot_edge_type_relations_inner import GrootEdgeTypeRelationsInner -from graphscope.flex.rest.models.groot_property import GrootProperty +from graphscope.flex.rest.models.base_vertex_type_x_csr_params import BaseVertexTypeXCsrParams +from graphscope.flex.rest.models.create_property_meta import CreatePropertyMeta from typing import Optional, Set from typing_extensions import Self -class GrootEdgeType(BaseModel): +class CreateVertexType(BaseModel): """ - GrootEdgeType + CreateVertexType """ # noqa: E501 - label: Optional[StrictStr] = None - relations: Optional[List[GrootEdgeTypeRelationsInner]] = None - properties: Optional[List[GrootProperty]] = None - __properties: ClassVar[List[str]] = ["label", "relations", "properties"] + type_name: StrictStr + primary_keys: List[StrictStr] + x_csr_params: Optional[BaseVertexTypeXCsrParams] = None + properties: List[CreatePropertyMeta] + description: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["type_name", "primary_keys", "x_csr_params", "properties", "description"] model_config = { "populate_by_name": True, @@ -52,7 +54,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of GrootEdgeType from a JSON string""" + """Create an instance of CreateVertexType from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,13 +75,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each item in relations (list) - _items = [] - if self.relations: - for _item in self.relations: - if _item: - _items.append(_item.to_dict()) - _dict['relations'] = _items + # override the default output from pydantic by calling `to_dict()` of x_csr_params + if self.x_csr_params: + _dict['x_csr_params'] = self.x_csr_params.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in properties (list) _items = [] if self.properties: @@ -91,7 +89,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GrootEdgeType from a dict""" + """Create an instance of CreateVertexType from a dict""" if obj is None: return None @@ -99,9 +97,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "label": obj.get("label"), - "relations": [GrootEdgeTypeRelationsInner.from_dict(_item) for _item in obj["relations"]] if obj.get("relations") is not None else None, - "properties": [GrootProperty.from_dict(_item) for _item in obj["properties"]] if obj.get("properties") is not None else None + "type_name": obj.get("type_name"), + "primary_keys": obj.get("primary_keys"), + "x_csr_params": BaseVertexTypeXCsrParams.from_dict(obj["x_csr_params"]) if obj.get("x_csr_params") is not None else None, + "properties": [CreatePropertyMeta.from_dict(_item) for _item in obj["properties"]] if obj.get("properties") is not None else None, + "description": obj.get("description") }) return _obj diff --git a/python/graphscope/flex/rest/models/data_source.py b/python/graphscope/flex/rest/models/data_source.py deleted file mode 100644 index 205e431024ef..000000000000 --- a/python/graphscope/flex/rest/models/data_source.py +++ /dev/null @@ -1,106 +0,0 @@ -# coding: utf-8 - -""" - GraphScope FLEX HTTP SERVICE API - - 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) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel -from typing import Any, ClassVar, Dict, List, Optional -from graphscope.flex.rest.models.edge_data_source import EdgeDataSource -from graphscope.flex.rest.models.vertex_data_source import VertexDataSource -from typing import Optional, Set -from typing_extensions import Self - -class DataSource(BaseModel): - """ - DataSource - """ # noqa: E501 - vertices_datasource: Optional[List[VertexDataSource]] = None - edges_datasource: Optional[List[EdgeDataSource]] = None - __properties: ClassVar[List[str]] = ["vertices_datasource", "edges_datasource"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DataSource from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in vertices_datasource (list) - _items = [] - if self.vertices_datasource: - for _item in self.vertices_datasource: - if _item: - _items.append(_item.to_dict()) - _dict['vertices_datasource'] = _items - # override the default output from pydantic by calling `to_dict()` of each item in edges_datasource (list) - _items = [] - if self.edges_datasource: - for _item in self.edges_datasource: - if _item: - _items.append(_item.to_dict()) - _dict['edges_datasource'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of DataSource from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "vertices_datasource": [VertexDataSource.from_dict(_item) for _item in obj["vertices_datasource"]] if obj.get("vertices_datasource") is not None else None, - "edges_datasource": [EdgeDataSource.from_dict(_item) for _item in obj["edges_datasource"]] if obj.get("edges_datasource") is not None else None - }) - return _obj - - diff --git a/python/graphscope/flex/rest/models/groot_dataloading_job_config.py b/python/graphscope/flex/rest/models/dataloading_job_config.py similarity index 60% rename from python/graphscope/flex/rest/models/groot_dataloading_job_config.py rename to python/graphscope/flex/rest/models/dataloading_job_config.py index 797680a17994..45c5070a5822 100644 --- a/python/graphscope/flex/rest/models/groot_dataloading_job_config.py +++ b/python/graphscope/flex/rest/models/dataloading_job_config.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -20,19 +20,22 @@ from pydantic import BaseModel, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from graphscope.flex.rest.models.groot_dataloading_job_config_edges_inner import GrootDataloadingJobConfigEdgesInner +from graphscope.flex.rest.models.dataloading_job_config_edges_inner import DataloadingJobConfigEdgesInner +from graphscope.flex.rest.models.dataloading_job_config_loading_config import DataloadingJobConfigLoadingConfig +from graphscope.flex.rest.models.dataloading_job_config_vertices_inner import DataloadingJobConfigVerticesInner from typing import Optional, Set from typing_extensions import Self -class GrootDataloadingJobConfig(BaseModel): +class DataloadingJobConfig(BaseModel): """ - GrootDataloadingJobConfig + DataloadingJobConfig """ # noqa: E501 - vertices: Optional[List[StrictStr]] = None - edges: Optional[List[GrootDataloadingJobConfigEdgesInner]] = None + loading_config: DataloadingJobConfigLoadingConfig + vertices: List[DataloadingJobConfigVerticesInner] + edges: List[DataloadingJobConfigEdgesInner] schedule: Optional[StrictStr] = Field(default=None, description="format with '2023-02-21 11:56:30'") repeat: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["vertices", "edges", "schedule", "repeat"] + __properties: ClassVar[List[str]] = ["loading_config", "vertices", "edges", "schedule", "repeat"] @field_validator('repeat') def repeat_validate_enum(cls, value): @@ -62,7 +65,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of GrootDataloadingJobConfig from a JSON string""" + """Create an instance of DataloadingJobConfig from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -83,6 +86,16 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of loading_config + if self.loading_config: + _dict['loading_config'] = self.loading_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in vertices (list) + _items = [] + if self.vertices: + for _item in self.vertices: + if _item: + _items.append(_item.to_dict()) + _dict['vertices'] = _items # override the default output from pydantic by calling `to_dict()` of each item in edges (list) _items = [] if self.edges: @@ -90,11 +103,21 @@ def to_dict(self) -> Dict[str, Any]: if _item: _items.append(_item.to_dict()) _dict['edges'] = _items + # set to None if schedule (nullable) is None + # and model_fields_set contains the field + if self.schedule is None and "schedule" in self.model_fields_set: + _dict['schedule'] = None + + # set to None if repeat (nullable) is None + # and model_fields_set contains the field + if self.repeat is None and "repeat" in self.model_fields_set: + _dict['repeat'] = None + return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GrootDataloadingJobConfig from a dict""" + """Create an instance of DataloadingJobConfig from a dict""" if obj is None: return None @@ -102,8 +125,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "vertices": obj.get("vertices"), - "edges": [GrootDataloadingJobConfigEdgesInner.from_dict(_item) for _item in obj["edges"]] if obj.get("edges") is not None else None, + "loading_config": DataloadingJobConfigLoadingConfig.from_dict(obj["loading_config"]) if obj.get("loading_config") is not None else None, + "vertices": [DataloadingJobConfigVerticesInner.from_dict(_item) for _item in obj["vertices"]] if obj.get("vertices") is not None else None, + "edges": [DataloadingJobConfigEdgesInner.from_dict(_item) for _item in obj["edges"]] if obj.get("edges") is not None else None, "schedule": obj.get("schedule"), "repeat": obj.get("repeat") }) diff --git a/python/graphscope/flex/rest/models/groot_dataloading_job_config_edges_inner.py b/python/graphscope/flex/rest/models/dataloading_job_config_edges_inner.py similarity index 90% rename from python/graphscope/flex/rest/models/groot_dataloading_job_config_edges_inner.py rename to python/graphscope/flex/rest/models/dataloading_job_config_edges_inner.py index 290867957708..485c97a4dc98 100644 --- a/python/graphscope/flex/rest/models/groot_dataloading_job_config_edges_inner.py +++ b/python/graphscope/flex/rest/models/dataloading_job_config_edges_inner.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -23,9 +23,9 @@ from typing import Optional, Set from typing_extensions import Self -class GrootDataloadingJobConfigEdgesInner(BaseModel): +class DataloadingJobConfigEdgesInner(BaseModel): """ - GrootDataloadingJobConfigEdgesInner + DataloadingJobConfigEdgesInner """ # noqa: E501 type_name: Optional[StrictStr] = None source_vertex: Optional[StrictStr] = None @@ -50,7 +50,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of GrootDataloadingJobConfigEdgesInner from a JSON string""" + """Create an instance of DataloadingJobConfigEdgesInner from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -75,7 +75,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GrootDataloadingJobConfigEdgesInner from a dict""" + """Create an instance of DataloadingJobConfigEdgesInner from a dict""" if obj is None: return None diff --git a/python/graphscope/flex/rest/models/schema_mapping_loading_config.py b/python/graphscope/flex/rest/models/dataloading_job_config_loading_config.py similarity index 72% rename from python/graphscope/flex/rest/models/schema_mapping_loading_config.py rename to python/graphscope/flex/rest/models/dataloading_job_config_loading_config.py index efad1d4b01f8..8c9d944feca2 100644 --- a/python/graphscope/flex/rest/models/schema_mapping_loading_config.py +++ b/python/graphscope/flex/rest/models/dataloading_job_config_loading_config.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -20,19 +20,17 @@ from pydantic import BaseModel, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from graphscope.flex.rest.models.schema_mapping_loading_config_data_source import SchemaMappingLoadingConfigDataSource -from graphscope.flex.rest.models.schema_mapping_loading_config_format import SchemaMappingLoadingConfigFormat +from graphscope.flex.rest.models.dataloading_job_config_loading_config_format import DataloadingJobConfigLoadingConfigFormat from typing import Optional, Set from typing_extensions import Self -class SchemaMappingLoadingConfig(BaseModel): +class DataloadingJobConfigLoadingConfig(BaseModel): """ - SchemaMappingLoadingConfig + DataloadingJobConfigLoadingConfig """ # noqa: E501 - data_source: Optional[SchemaMappingLoadingConfigDataSource] = None import_option: Optional[StrictStr] = None - format: Optional[SchemaMappingLoadingConfigFormat] = None - __properties: ClassVar[List[str]] = ["data_source", "import_option", "format"] + format: Optional[DataloadingJobConfigLoadingConfigFormat] = None + __properties: ClassVar[List[str]] = ["import_option", "format"] @field_validator('import_option') def import_option_validate_enum(cls, value): @@ -62,7 +60,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SchemaMappingLoadingConfig from a JSON string""" + """Create an instance of DataloadingJobConfigLoadingConfig from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -83,9 +81,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of data_source - if self.data_source: - _dict['data_source'] = self.data_source.to_dict() # override the default output from pydantic by calling `to_dict()` of format if self.format: _dict['format'] = self.format.to_dict() @@ -93,7 +88,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SchemaMappingLoadingConfig from a dict""" + """Create an instance of DataloadingJobConfigLoadingConfig from a dict""" if obj is None: return None @@ -101,9 +96,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "data_source": SchemaMappingLoadingConfigDataSource.from_dict(obj["data_source"]) if obj.get("data_source") is not None else None, "import_option": obj.get("import_option"), - "format": SchemaMappingLoadingConfigFormat.from_dict(obj["format"]) if obj.get("format") is not None else None + "format": DataloadingJobConfigLoadingConfigFormat.from_dict(obj["format"]) if obj.get("format") is not None else None }) return _obj diff --git a/python/graphscope/flex/rest/models/schema_mapping_loading_config_format.py b/python/graphscope/flex/rest/models/dataloading_job_config_loading_config_format.py similarity index 89% rename from python/graphscope/flex/rest/models/schema_mapping_loading_config_format.py rename to python/graphscope/flex/rest/models/dataloading_job_config_loading_config_format.py index 0dfa09824412..af13cffba0b5 100644 --- a/python/graphscope/flex/rest/models/schema_mapping_loading_config_format.py +++ b/python/graphscope/flex/rest/models/dataloading_job_config_loading_config_format.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -23,9 +23,9 @@ from typing import Optional, Set from typing_extensions import Self -class SchemaMappingLoadingConfigFormat(BaseModel): +class DataloadingJobConfigLoadingConfigFormat(BaseModel): """ - SchemaMappingLoadingConfigFormat + DataloadingJobConfigLoadingConfigFormat """ # noqa: E501 type: Optional[StrictStr] = None metadata: Optional[Dict[str, Any]] = None @@ -49,7 +49,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SchemaMappingLoadingConfigFormat from a JSON string""" + """Create an instance of DataloadingJobConfigLoadingConfigFormat from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -74,7 +74,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SchemaMappingLoadingConfigFormat from a dict""" + """Create an instance of DataloadingJobConfigLoadingConfigFormat from a dict""" if obj is None: return None diff --git a/python/graphscope/flex/rest/models/connection.py b/python/graphscope/flex/rest/models/dataloading_job_config_vertices_inner.py similarity index 84% rename from python/graphscope/flex/rest/models/connection.py rename to python/graphscope/flex/rest/models/dataloading_job_config_vertices_inner.py index c0ec9fac7e00..0e8ad5b83127 100644 --- a/python/graphscope/flex/rest/models/connection.py +++ b/python/graphscope/flex/rest/models/dataloading_job_config_vertices_inner.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -23,12 +23,12 @@ from typing import Optional, Set from typing_extensions import Self -class Connection(BaseModel): +class DataloadingJobConfigVerticesInner(BaseModel): """ - Connection + DataloadingJobConfigVerticesInner """ # noqa: E501 - coordinator_endpoint: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["coordinator_endpoint"] + type_name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["type_name"] model_config = { "populate_by_name": True, @@ -48,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Connection from a JSON string""" + """Create an instance of DataloadingJobConfigVerticesInner from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Connection from a dict""" + """Create an instance of DataloadingJobConfigVerticesInner from a dict""" if obj is None: return None @@ -81,7 +81,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "coordinator_endpoint": obj.get("coordinator_endpoint") + "type_name": obj.get("type_name") }) return _obj diff --git a/python/graphscope/flex/rest/models/deployment_info.py b/python/graphscope/flex/rest/models/deployment_info.py deleted file mode 100644 index d95b41676d1d..000000000000 --- a/python/graphscope/flex/rest/models/deployment_info.py +++ /dev/null @@ -1,131 +0,0 @@ -# coding: utf-8 - -""" - GraphScope FLEX HTTP SERVICE API - - 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) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from graphscope.flex.rest.models.deployment_info_graphs_info_value import DeploymentInfoGraphsInfoValue -from typing import Optional, Set -from typing_extensions import Self - -class DeploymentInfo(BaseModel): - """ - DeploymentInfo - """ # noqa: E501 - name: Optional[StrictStr] = None - cluster_type: Optional[StrictStr] = None - version: Optional[StrictStr] = None - solution: Optional[StrictStr] = None - creation_time: Optional[StrictStr] = None - graphs_info: Optional[Dict[str, DeploymentInfoGraphsInfoValue]] = None - __properties: ClassVar[List[str]] = ["name", "cluster_type", "version", "solution", "creation_time", "graphs_info"] - - @field_validator('cluster_type') - def cluster_type_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['HOSTS', 'KUBERNETES']): - raise ValueError("must be one of enum values ('HOSTS', 'KUBERNETES')") - return value - - @field_validator('solution') - def solution_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['INTERACTIVE', 'GRAPHSCOPE_INSIGHT']): - raise ValueError("must be one of enum values ('INTERACTIVE', 'GRAPHSCOPE_INSIGHT')") - return value - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DeploymentInfo from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each value in graphs_info (dict) - _field_dict = {} - if self.graphs_info: - for _key in self.graphs_info: - if self.graphs_info[_key]: - _field_dict[_key] = self.graphs_info[_key].to_dict() - _dict['graphs_info'] = _field_dict - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of DeploymentInfo from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name"), - "cluster_type": obj.get("cluster_type"), - "version": obj.get("version"), - "solution": obj.get("solution"), - "creation_time": obj.get("creation_time"), - "graphs_info": dict( - (_k, DeploymentInfoGraphsInfoValue.from_dict(_v)) - for _k, _v in obj["graphs_info"].items() - ) - if obj.get("graphs_info") is not None - else None - }) - return _obj - - diff --git a/python/graphscope/flex/rest/models/deployment_info_graphs_info_value.py b/python/graphscope/flex/rest/models/deployment_info_graphs_info_value.py deleted file mode 100644 index 5c925517d3dd..000000000000 --- a/python/graphscope/flex/rest/models/deployment_info_graphs_info_value.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - GraphScope FLEX HTTP SERVICE API - - 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) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class DeploymentInfoGraphsInfoValue(BaseModel): - """ - DeploymentInfoGraphsInfoValue - """ # noqa: E501 - name: Optional[StrictStr] = None - creation_time: Optional[StrictStr] = None - update_time: Optional[StrictStr] = None - last_dataloading_time: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["name", "creation_time", "update_time", "last_dataloading_time"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DeploymentInfoGraphsInfoValue from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of DeploymentInfoGraphsInfoValue from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name"), - "creation_time": obj.get("creation_time"), - "update_time": obj.get("update_time"), - "last_dataloading_time": obj.get("last_dataloading_time") - }) - return _obj - - diff --git a/python/graphscope/flex/rest/models/deployment_status.py b/python/graphscope/flex/rest/models/deployment_status.py deleted file mode 100644 index 7285851c4830..000000000000 --- a/python/graphscope/flex/rest/models/deployment_status.py +++ /dev/null @@ -1,108 +0,0 @@ -# coding: utf-8 - -""" - GraphScope FLEX HTTP SERVICE API - - 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) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, Field, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class DeploymentStatus(BaseModel): - """ - K8s only - """ # noqa: E501 - name: Optional[StrictStr] = None - container: Optional[List[StrictStr]] = None - image: Optional[List[StrictStr]] = None - labels: Optional[List[StrictStr]] = None - node: Optional[StrictStr] = None - status: Optional[StrictStr] = None - restart_count: Optional[StrictInt] = None - cpu_value: Optional[StrictInt] = Field(default=None, description="cpu value in millicore") - memory_value: Optional[StrictInt] = Field(default=None, description="memory value in megabytes") - timestamp: Optional[StrictStr] = None - creation_time: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["name", "container", "image", "labels", "node", "status", "restart_count", "cpu_value", "memory_value", "timestamp", "creation_time"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DeploymentStatus from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of DeploymentStatus from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "name": obj.get("name"), - "container": obj.get("container"), - "image": obj.get("image"), - "labels": obj.get("labels"), - "node": obj.get("node"), - "status": obj.get("status"), - "restart_count": obj.get("restart_count"), - "cpu_value": obj.get("cpu_value"), - "memory_value": obj.get("memory_value"), - "timestamp": obj.get("timestamp"), - "creation_time": obj.get("creation_time") - }) - return _obj - - diff --git a/python/graphscope/flex/rest/models/edge_data_source.py b/python/graphscope/flex/rest/models/edge_data_source.py deleted file mode 100644 index 2dff3c7acde0..000000000000 --- a/python/graphscope/flex/rest/models/edge_data_source.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" - GraphScope FLEX HTTP SERVICE API - - 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) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class EdgeDataSource(BaseModel): - """ - EdgeDataSource - """ # noqa: E501 - data_source: Optional[StrictStr] = None - type_name: Optional[StrictStr] = None - source_vertex: Optional[StrictStr] = None - destination_vertex: Optional[StrictStr] = None - location: Optional[StrictStr] = None - source_pk_column_map: Optional[Dict[str, Any]] = None - destination_pk_column_map: Optional[Dict[str, Any]] = None - property_mapping: Optional[Dict[str, Any]] = None - __properties: ClassVar[List[str]] = ["data_source", "type_name", "source_vertex", "destination_vertex", "location", "source_pk_column_map", "destination_pk_column_map", "property_mapping"] - - @field_validator('data_source') - def data_source_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['ODPS', 'FILE']): - raise ValueError("must be one of enum values ('ODPS', 'FILE')") - return value - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of EdgeDataSource from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of EdgeDataSource from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "data_source": obj.get("data_source"), - "type_name": obj.get("type_name"), - "source_vertex": obj.get("source_vertex"), - "destination_vertex": obj.get("destination_vertex"), - "location": obj.get("location"), - "source_pk_column_map": obj.get("source_pk_column_map"), - "destination_pk_column_map": obj.get("destination_pk_column_map"), - "property_mapping": obj.get("property_mapping") - }) - return _obj - - diff --git a/python/graphscope/flex/rest/models/edge_mapping.py b/python/graphscope/flex/rest/models/edge_mapping.py index 1ad3eef41cf1..3d73295a8be4 100644 --- a/python/graphscope/flex/rest/models/edge_mapping.py +++ b/python/graphscope/flex/rest/models/edge_mapping.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -21,8 +21,6 @@ from pydantic import BaseModel, StrictStr from typing import Any, ClassVar, Dict, List, Optional from graphscope.flex.rest.models.column_mapping import ColumnMapping -from graphscope.flex.rest.models.edge_mapping_destination_vertex_mappings_inner import EdgeMappingDestinationVertexMappingsInner -from graphscope.flex.rest.models.edge_mapping_source_vertex_mappings_inner import EdgeMappingSourceVertexMappingsInner from graphscope.flex.rest.models.edge_mapping_type_triplet import EdgeMappingTypeTriplet from typing import Optional, Set from typing_extensions import Self @@ -31,10 +29,10 @@ class EdgeMapping(BaseModel): """ EdgeMapping """ # noqa: E501 - type_triplet: Optional[EdgeMappingTypeTriplet] = None - inputs: Optional[List[StrictStr]] = None - source_vertex_mappings: Optional[List[EdgeMappingSourceVertexMappingsInner]] = None - destination_vertex_mappings: Optional[List[EdgeMappingDestinationVertexMappingsInner]] = None + type_triplet: EdgeMappingTypeTriplet + inputs: List[StrictStr] + source_vertex_mappings: List[ColumnMapping] + destination_vertex_mappings: List[ColumnMapping] column_mappings: Optional[List[ColumnMapping]] = None __properties: ClassVar[List[str]] = ["type_triplet", "inputs", "source_vertex_mappings", "destination_vertex_mappings", "column_mappings"] @@ -115,8 +113,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "type_triplet": EdgeMappingTypeTriplet.from_dict(obj["type_triplet"]) if obj.get("type_triplet") is not None else None, "inputs": obj.get("inputs"), - "source_vertex_mappings": [EdgeMappingSourceVertexMappingsInner.from_dict(_item) for _item in obj["source_vertex_mappings"]] if obj.get("source_vertex_mappings") is not None else None, - "destination_vertex_mappings": [EdgeMappingDestinationVertexMappingsInner.from_dict(_item) for _item in obj["destination_vertex_mappings"]] if obj.get("destination_vertex_mappings") is not None else None, + "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, + "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, "column_mappings": [ColumnMapping.from_dict(_item) for _item in obj["column_mappings"]] if obj.get("column_mappings") is not None else None }) return _obj diff --git a/python/graphscope/flex/rest/models/edge_mapping_type_triplet.py b/python/graphscope/flex/rest/models/edge_mapping_type_triplet.py index 17908439cd58..40f47de5667f 100644 --- a/python/graphscope/flex/rest/models/edge_mapping_type_triplet.py +++ b/python/graphscope/flex/rest/models/edge_mapping_type_triplet.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,7 +19,7 @@ import json from pydantic import BaseModel, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self @@ -27,9 +27,9 @@ class EdgeMappingTypeTriplet(BaseModel): """ source label -> [edge label] -> destination label """ # noqa: E501 - edge: Optional[StrictStr] = None - source_vertex: Optional[StrictStr] = None - destination_vertex: Optional[StrictStr] = None + edge: StrictStr + source_vertex: StrictStr + destination_vertex: StrictStr __properties: ClassVar[List[str]] = ["edge", "source_vertex", "destination_vertex"] model_config = { diff --git a/python/graphscope/flex/rest/models/error.py b/python/graphscope/flex/rest/models/error.py new file mode 100644 index 000000000000..d157ebab4210 --- /dev/null +++ b/python/graphscope/flex/rest/models/error.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + GraphScope FLEX HTTP SERVICE API + + 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) + + The version of the OpenAPI document: 1.0.0 + Contact: graphscope@alibaba-inc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class Error(BaseModel): + """ + Error + """ # noqa: E501 + code: StrictInt = Field(description="Error code") + message: StrictStr = Field(description="Error message") + __properties: ClassVar[List[str]] = ["code", "message"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Error from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Error from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "message": obj.get("message") + }) + return _obj + + diff --git a/python/graphscope/flex/rest/models/alert_message.py b/python/graphscope/flex/rest/models/get_alert_message_response.py similarity index 77% rename from python/graphscope/flex/rest/models/alert_message.py rename to python/graphscope/flex/rest/models/get_alert_message_response.py index 283b36ff7c5b..69e3962ad0f0 100644 --- a/python/graphscope/flex/rest/models/alert_message.py +++ b/python/graphscope/flex/rest/models/get_alert_message_response.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,30 +19,27 @@ import json from pydantic import BaseModel, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional +from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self -class AlertMessage(BaseModel): +class GetAlertMessageResponse(BaseModel): """ - AlertMessage + GetAlertMessageResponse """ # noqa: E501 - message_id: Optional[StrictStr] = Field(default=None, description="Generated in server side") - alert_name: Optional[StrictStr] = None - severity: Optional[StrictStr] = None - metric_type: Optional[StrictStr] = None - target: Optional[List[StrictStr]] = None - trigger_time: Optional[StrictStr] = None - status: Optional[StrictStr] = None - message: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["message_id", "alert_name", "severity", "metric_type", "target", "trigger_time", "status", "message"] + id: StrictStr = Field(description="Generated in server side") + alert_name: StrictStr + severity: StrictStr + metric_type: StrictStr + target: List[StrictStr] + trigger_time: StrictStr + status: StrictStr + message: StrictStr + __properties: ClassVar[List[str]] = ["id", "alert_name", "severity", "metric_type", "target", "trigger_time", "status", "message"] @field_validator('severity') def severity_validate_enum(cls, value): """Validates the enum""" - if value is None: - return value - if value not in set(['warning', 'emergency']): raise ValueError("must be one of enum values ('warning', 'emergency')") return value @@ -50,9 +47,6 @@ def severity_validate_enum(cls, value): @field_validator('metric_type') def metric_type_validate_enum(cls, value): """Validates the enum""" - if value is None: - return value - if value not in set(['node', 'service']): raise ValueError("must be one of enum values ('node', 'service')") return value @@ -60,9 +54,6 @@ def metric_type_validate_enum(cls, value): @field_validator('status') def status_validate_enum(cls, value): """Validates the enum""" - if value is None: - return value - if value not in set(['unsolved', 'solved', 'dealing']): raise ValueError("must be one of enum values ('unsolved', 'solved', 'dealing')") return value @@ -85,7 +76,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AlertMessage from a JSON string""" + """Create an instance of GetAlertMessageResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -110,7 +101,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AlertMessage from a dict""" + """Create an instance of GetAlertMessageResponse from a dict""" if obj is None: return None @@ -118,7 +109,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "message_id": obj.get("message_id"), + "id": obj.get("id"), "alert_name": obj.get("alert_name"), "severity": obj.get("severity"), "metric_type": obj.get("metric_type"), diff --git a/python/graphscope/flex/rest/models/alert_receiver.py b/python/graphscope/flex/rest/models/get_alert_receiver_response.py similarity index 76% rename from python/graphscope/flex/rest/models/alert_receiver.py rename to python/graphscope/flex/rest/models/get_alert_receiver_response.py index ddb507eaae3a..922c423a9fad 100644 --- a/python/graphscope/flex/rest/models/alert_receiver.py +++ b/python/graphscope/flex/rest/models/get_alert_receiver_response.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,29 +19,26 @@ import json from pydantic import BaseModel, Field, StrictBool, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional +from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self -class AlertReceiver(BaseModel): +class GetAlertReceiverResponse(BaseModel): """ - AlertReceiver + GetAlertReceiverResponse """ # noqa: E501 - type: Optional[StrictStr] = None - receiver_id: Optional[StrictStr] = Field(default=None, description="Generated in server side") - webhook_url: Optional[StrictStr] = None - at_user_ids: Optional[List[StrictStr]] = None - is_at_all: Optional[StrictBool] = None - enable: Optional[StrictBool] = None - message: Optional[StrictStr] = Field(default=None, description="error message generated in server side") - __properties: ClassVar[List[str]] = ["type", "receiver_id", "webhook_url", "at_user_ids", "is_at_all", "enable", "message"] + type: StrictStr + webhook_url: StrictStr + at_user_ids: List[StrictStr] + is_at_all: StrictBool + enable: StrictBool + id: StrictStr + message: StrictStr = Field(description="Error message generated in server side") + __properties: ClassVar[List[str]] = ["type", "webhook_url", "at_user_ids", "is_at_all", "enable", "id", "message"] @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value is None: - return value - if value not in set(['webhook']): raise ValueError("must be one of enum values ('webhook')") return value @@ -64,7 +61,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AlertReceiver from a JSON string""" + """Create an instance of GetAlertReceiverResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -89,7 +86,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AlertReceiver from a dict""" + """Create an instance of GetAlertReceiverResponse from a dict""" if obj is None: return None @@ -98,11 +95,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "type": obj.get("type"), - "receiver_id": obj.get("receiver_id"), "webhook_url": obj.get("webhook_url"), "at_user_ids": obj.get("at_user_ids"), "is_at_all": obj.get("is_at_all"), "enable": obj.get("enable"), + "id": obj.get("id"), "message": obj.get("message") }) return _obj diff --git a/python/graphscope/flex/rest/models/get_alert_rule_response.py b/python/graphscope/flex/rest/models/get_alert_rule_response.py new file mode 100644 index 000000000000..cc8623bc32dd --- /dev/null +++ b/python/graphscope/flex/rest/models/get_alert_rule_response.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + GraphScope FLEX HTTP SERVICE API + + 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) + + The version of the OpenAPI document: 1.0.0 + Contact: graphscope@alibaba-inc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class GetAlertRuleResponse(BaseModel): + """ + GetAlertRuleResponse + """ # noqa: E501 + name: StrictStr + severity: StrictStr + metric_type: StrictStr + conditions_description: StrictStr + frequency: StrictInt = Field(description="(mins)") + enable: StrictBool + id: StrictStr + __properties: ClassVar[List[str]] = ["name", "severity", "metric_type", "conditions_description", "frequency", "enable", "id"] + + @field_validator('severity') + def severity_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['warning', 'emergency']): + raise ValueError("must be one of enum values ('warning', 'emergency')") + return value + + @field_validator('metric_type') + def metric_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['node', 'service']): + raise ValueError("must be one of enum values ('node', 'service')") + return value + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GetAlertRuleResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetAlertRuleResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "severity": obj.get("severity"), + "metric_type": obj.get("metric_type"), + "conditions_description": obj.get("conditions_description"), + "frequency": obj.get("frequency"), + "enable": obj.get("enable"), + "id": obj.get("id") + }) + return _obj + + diff --git a/python/graphscope/flex/rest/models/get_edge_type.py b/python/graphscope/flex/rest/models/get_edge_type.py new file mode 100644 index 000000000000..024c96c9b512 --- /dev/null +++ b/python/graphscope/flex/rest/models/get_edge_type.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + GraphScope FLEX HTTP SERVICE API + + 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) + + The version of the OpenAPI document: 1.0.0 + Contact: graphscope@alibaba-inc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from graphscope.flex.rest.models.base_edge_type_vertex_type_pair_relations_inner import BaseEdgeTypeVertexTypePairRelationsInner +from graphscope.flex.rest.models.get_property_meta import GetPropertyMeta +from typing import Optional, Set +from typing_extensions import Self + +class GetEdgeType(BaseModel): + """ + GetEdgeType + """ # noqa: E501 + type_name: StrictStr + vertex_type_pair_relations: List[BaseEdgeTypeVertexTypePairRelationsInner] + directed: Optional[StrictBool] = None + primary_keys: Optional[List[StrictStr]] = None + type_id: StrictInt + properties: List[GetPropertyMeta] + description: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["type_name", "vertex_type_pair_relations", "directed", "primary_keys", "type_id", "properties", "description"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GetEdgeType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in vertex_type_pair_relations (list) + _items = [] + if self.vertex_type_pair_relations: + for _item in self.vertex_type_pair_relations: + if _item: + _items.append(_item.to_dict()) + _dict['vertex_type_pair_relations'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in properties (list) + _items = [] + if self.properties: + for _item in self.properties: + if _item: + _items.append(_item.to_dict()) + _dict['properties'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetEdgeType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type_name": obj.get("type_name"), + "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, + "directed": obj.get("directed"), + "primary_keys": obj.get("primary_keys"), + "type_id": obj.get("type_id"), + "properties": [GetPropertyMeta.from_dict(_item) for _item in obj["properties"]] if obj.get("properties") is not None else None, + "description": obj.get("description") + }) + return _obj + + diff --git a/python/graphscope/flex/rest/models/get_graph_response.py b/python/graphscope/flex/rest/models/get_graph_response.py new file mode 100644 index 000000000000..fd405d1d9d65 --- /dev/null +++ b/python/graphscope/flex/rest/models/get_graph_response.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + GraphScope FLEX HTTP SERVICE API + + 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) + + The version of the OpenAPI document: 1.0.0 + Contact: graphscope@alibaba-inc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from graphscope.flex.rest.models.get_graph_schema_response import GetGraphSchemaResponse +from graphscope.flex.rest.models.get_procedure_response import GetProcedureResponse +from typing import Optional, Set +from typing_extensions import Self + +class GetGraphResponse(BaseModel): + """ + GetGraphResponse + """ # noqa: E501 + id: StrictStr + name: StrictStr + description: Optional[StrictStr] = None + store_type: Optional[StrictStr] = None + creation_time: StrictStr + data_update_time: StrictStr + schema_update_time: StrictStr + stored_procedures: Optional[List[GetProcedureResponse]] = None + var_schema: GetGraphSchemaResponse = Field(alias="schema") + __properties: ClassVar[List[str]] = ["id", "name", "description", "store_type", "creation_time", "data_update_time", "schema_update_time", "stored_procedures", "schema"] + + @field_validator('store_type') + def store_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['mutable_csr']): + raise ValueError("must be one of enum values ('mutable_csr')") + return value + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GetGraphResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in stored_procedures (list) + _items = [] + if self.stored_procedures: + for _item in self.stored_procedures: + if _item: + _items.append(_item.to_dict()) + _dict['stored_procedures'] = _items + # override the default output from pydantic by calling `to_dict()` of var_schema + if self.var_schema: + _dict['schema'] = self.var_schema.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetGraphResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "description": obj.get("description"), + "store_type": obj.get("store_type"), + "creation_time": obj.get("creation_time"), + "data_update_time": obj.get("data_update_time"), + "schema_update_time": obj.get("schema_update_time"), + "stored_procedures": [GetProcedureResponse.from_dict(_item) for _item in obj["stored_procedures"]] if obj.get("stored_procedures") is not None else None, + "schema": GetGraphSchemaResponse.from_dict(obj["schema"]) if obj.get("schema") is not None else None + }) + return _obj + + diff --git a/python/graphscope/flex/rest/models/model_schema.py b/python/graphscope/flex/rest/models/get_graph_schema_response.py similarity index 79% rename from python/graphscope/flex/rest/models/model_schema.py rename to python/graphscope/flex/rest/models/get_graph_schema_response.py index 83e09f2532c2..b77a86650d58 100644 --- a/python/graphscope/flex/rest/models/model_schema.py +++ b/python/graphscope/flex/rest/models/get_graph_schema_response.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,18 +19,18 @@ import json from pydantic import BaseModel -from typing import Any, ClassVar, Dict, List, Optional -from graphscope.flex.rest.models.edge_type import EdgeType -from graphscope.flex.rest.models.vertex_type import VertexType +from typing import Any, ClassVar, Dict, List +from graphscope.flex.rest.models.get_edge_type import GetEdgeType +from graphscope.flex.rest.models.get_vertex_type import GetVertexType from typing import Optional, Set from typing_extensions import Self -class ModelSchema(BaseModel): +class GetGraphSchemaResponse(BaseModel): """ - ModelSchema + GetGraphSchemaResponse """ # noqa: E501 - vertex_types: Optional[List[VertexType]] = None - edge_types: Optional[List[EdgeType]] = None + vertex_types: List[GetVertexType] + edge_types: List[GetEdgeType] __properties: ClassVar[List[str]] = ["vertex_types", "edge_types"] model_config = { @@ -51,7 +51,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ModelSchema from a JSON string""" + """Create an instance of GetGraphSchemaResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -90,7 +90,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ModelSchema from a dict""" + """Create an instance of GetGraphSchemaResponse from a dict""" if obj is None: return None @@ -98,8 +98,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "vertex_types": [VertexType.from_dict(_item) for _item in obj["vertex_types"]] if obj.get("vertex_types") is not None else None, - "edge_types": [EdgeType.from_dict(_item) for _item in obj["edge_types"]] if obj.get("edge_types") is not None else None + "vertex_types": [GetVertexType.from_dict(_item) for _item in obj["vertex_types"]] if obj.get("vertex_types") is not None else None, + "edge_types": [GetEdgeType.from_dict(_item) for _item in obj["edge_types"]] if obj.get("edge_types") is not None else None }) return _obj diff --git a/python/graphscope/flex/rest/models/procedure.py b/python/graphscope/flex/rest/models/get_procedure_response.py similarity index 75% rename from python/graphscope/flex/rest/models/procedure.py rename to python/graphscope/flex/rest/models/get_procedure_response.py index 4f69cdc229b8..afa4de1ff084 100644 --- a/python/graphscope/flex/rest/models/procedure.py +++ b/python/graphscope/flex/rest/models/get_procedure_response.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -20,31 +20,29 @@ from pydantic import BaseModel, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from graphscope.flex.rest.models.procedure_params_inner import ProcedureParamsInner +from graphscope.flex.rest.models.parameter import Parameter from typing import Optional, Set from typing_extensions import Self -class Procedure(BaseModel): +class GetProcedureResponse(BaseModel): """ - Procedure + GetProcedureResponse """ # noqa: E501 - name: Optional[StrictStr] = None - bound_graph: Optional[StrictStr] = None + name: StrictStr description: Optional[StrictStr] = None - type: Optional[StrictStr] = None - query: Optional[StrictStr] = None - enable: Optional[StrictBool] = None - runnable: Optional[StrictBool] = None - params: Optional[List[ProcedureParamsInner]] = None - returns: Optional[List[ProcedureParamsInner]] = None - __properties: ClassVar[List[str]] = ["name", "bound_graph", "description", "type", "query", "enable", "runnable", "params", "returns"] + type: StrictStr + query: StrictStr + id: StrictStr + library: StrictStr + params: List[Parameter] + returns: List[Parameter] + bound_graph: StrictStr + runnable: StrictBool + __properties: ClassVar[List[str]] = ["name", "description", "type", "query", "id", "library", "params", "returns", "bound_graph", "runnable"] @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value is None: - return value - if value not in set(['cpp', 'cypher']): raise ValueError("must be one of enum values ('cpp', 'cypher')") return value @@ -67,7 +65,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of Procedure from a JSON string""" + """Create an instance of GetProcedureResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -106,7 +104,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of Procedure from a dict""" + """Create an instance of GetProcedureResponse from a dict""" if obj is None: return None @@ -115,14 +113,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "name": obj.get("name"), - "bound_graph": obj.get("bound_graph"), "description": obj.get("description"), "type": obj.get("type"), "query": obj.get("query"), - "enable": obj.get("enable"), - "runnable": obj.get("runnable"), - "params": [ProcedureParamsInner.from_dict(_item) for _item in obj["params"]] if obj.get("params") is not None else None, - "returns": [ProcedureParamsInner.from_dict(_item) for _item in obj["returns"]] if obj.get("returns") is not None else None + "id": obj.get("id"), + "library": obj.get("library"), + "params": [Parameter.from_dict(_item) for _item in obj["params"]] if obj.get("params") is not None else None, + "returns": [Parameter.from_dict(_item) for _item in obj["returns"]] if obj.get("returns") is not None else None, + "bound_graph": obj.get("bound_graph"), + "runnable": obj.get("runnable") }) return _obj diff --git a/python/graphscope/flex/rest/models/edge_mapping_source_vertex_mappings_inner.py b/python/graphscope/flex/rest/models/get_property_meta.py similarity index 67% rename from python/graphscope/flex/rest/models/edge_mapping_source_vertex_mappings_inner.py rename to python/graphscope/flex/rest/models/get_property_meta.py index 267c95d887bf..f1e4c5269056 100644 --- a/python/graphscope/flex/rest/models/edge_mapping_source_vertex_mappings_inner.py +++ b/python/graphscope/flex/rest/models/get_property_meta.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,18 +18,23 @@ import re # noqa: F401 import json -from pydantic import BaseModel +from pydantic import BaseModel, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from graphscope.flex.rest.models.edge_mapping_source_vertex_mappings_inner_column import EdgeMappingSourceVertexMappingsInnerColumn +from graphscope.flex.rest.models.gs_data_type import GSDataType from typing import Optional, Set from typing_extensions import Self -class EdgeMappingSourceVertexMappingsInner(BaseModel): +class GetPropertyMeta(BaseModel): """ - Mapping column index to the primary key of source vertex + GetPropertyMeta """ # noqa: E501 - column: Optional[EdgeMappingSourceVertexMappingsInnerColumn] = None - __properties: ClassVar[List[str]] = ["column"] + property_name: StrictStr + property_type: GSDataType + nullable: Optional[StrictBool] = None + default_value: Optional[Dict[str, Any]] = None + description: Optional[StrictStr] = None + property_id: StrictInt + __properties: ClassVar[List[str]] = ["property_name", "property_type", "nullable", "default_value", "description", "property_id"] model_config = { "populate_by_name": True, @@ -49,7 +54,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of EdgeMappingSourceVertexMappingsInner from a JSON string""" + """Create an instance of GetPropertyMeta from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -70,14 +75,14 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of column - if self.column: - _dict['column'] = self.column.to_dict() + # override the default output from pydantic by calling `to_dict()` of property_type + if self.property_type: + _dict['property_type'] = self.property_type.to_dict() return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of EdgeMappingSourceVertexMappingsInner from a dict""" + """Create an instance of GetPropertyMeta from a dict""" if obj is None: return None @@ -85,7 +90,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "column": EdgeMappingSourceVertexMappingsInnerColumn.from_dict(obj["column"]) if obj.get("column") is not None else None + "property_name": obj.get("property_name"), + "property_type": GSDataType.from_dict(obj["property_type"]) if obj.get("property_type") is not None else None, + "nullable": obj.get("nullable"), + "default_value": obj.get("default_value"), + "description": obj.get("description"), + "property_id": obj.get("property_id") }) return _obj diff --git a/python/graphscope/flex/rest/models/get_vertex_type.py b/python/graphscope/flex/rest/models/get_vertex_type.py new file mode 100644 index 000000000000..3dd188016371 --- /dev/null +++ b/python/graphscope/flex/rest/models/get_vertex_type.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + GraphScope FLEX HTTP SERVICE API + + 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) + + The version of the OpenAPI document: 1.0.0 + Contact: graphscope@alibaba-inc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from graphscope.flex.rest.models.base_vertex_type_x_csr_params import BaseVertexTypeXCsrParams +from graphscope.flex.rest.models.get_property_meta import GetPropertyMeta +from typing import Optional, Set +from typing_extensions import Self + +class GetVertexType(BaseModel): + """ + GetVertexType + """ # noqa: E501 + type_name: StrictStr + primary_keys: List[StrictStr] + x_csr_params: Optional[BaseVertexTypeXCsrParams] = None + type_id: StrictInt + properties: List[GetPropertyMeta] + description: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["type_name", "primary_keys", "x_csr_params", "type_id", "properties", "description"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GetVertexType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of x_csr_params + if self.x_csr_params: + _dict['x_csr_params'] = self.x_csr_params.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in properties (list) + _items = [] + if self.properties: + for _item in self.properties: + if _item: + _items.append(_item.to_dict()) + _dict['properties'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetVertexType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type_name": obj.get("type_name"), + "primary_keys": obj.get("primary_keys"), + "x_csr_params": BaseVertexTypeXCsrParams.from_dict(obj["x_csr_params"]) if obj.get("x_csr_params") is not None else None, + "type_id": obj.get("type_id"), + "properties": [GetPropertyMeta.from_dict(_item) for _item in obj["properties"]] if obj.get("properties") is not None else None, + "description": obj.get("description") + }) + return _obj + + diff --git a/python/graphscope/flex/rest/models/groot_graph_gremlin_interface.py b/python/graphscope/flex/rest/models/groot_graph_gremlin_interface.py deleted file mode 100644 index 05cbf433bd31..000000000000 --- a/python/graphscope/flex/rest/models/groot_graph_gremlin_interface.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - GraphScope FLEX HTTP SERVICE API - - 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) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class GrootGraphGremlinInterface(BaseModel): - """ - GrootGraphGremlinInterface - """ # noqa: E501 - gremlin_endpoint: Optional[StrictStr] = None - grpc_endpoint: Optional[StrictStr] = None - username: Optional[StrictStr] = None - password: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["gremlin_endpoint", "grpc_endpoint", "username", "password"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of GrootGraphGremlinInterface from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GrootGraphGremlinInterface from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "gremlin_endpoint": obj.get("gremlin_endpoint"), - "grpc_endpoint": obj.get("grpc_endpoint"), - "username": obj.get("username"), - "password": obj.get("password") - }) - return _obj - - diff --git a/python/graphscope/flex/rest/models/gs_data_type.py b/python/graphscope/flex/rest/models/gs_data_type.py new file mode 100644 index 000000000000..afb0721dee58 --- /dev/null +++ b/python/graphscope/flex/rest/models/gs_data_type.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + GraphScope FLEX HTTP SERVICE API + + 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) + + The version of the OpenAPI document: 1.0.0 + Contact: graphscope@alibaba-inc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from graphscope.flex.rest.models.primitive_type import PrimitiveType +from graphscope.flex.rest.models.string_type import StringType +from pydantic import StrictStr, Field +from typing import Union, List, Optional, Dict +from typing_extensions import Literal, Self + +GSDATATYPE_ONE_OF_SCHEMAS = ["PrimitiveType", "StringType"] + +class GSDataType(BaseModel): + """ + GSDataType + """ + # data type: PrimitiveType + oneof_schema_1_validator: Optional[PrimitiveType] = None + # data type: StringType + oneof_schema_2_validator: Optional[StringType] = None + actual_instance: Optional[Union[PrimitiveType, StringType]] = None + one_of_schemas: List[str] = Field(default=Literal["PrimitiveType", "StringType"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = GSDataType.model_construct() + error_messages = [] + match = 0 + # validate data type: PrimitiveType + if not isinstance(v, PrimitiveType): + error_messages.append(f"Error! Input type `{type(v)}` is not `PrimitiveType`") + else: + match += 1 + # validate data type: StringType + if not isinstance(v, StringType): + error_messages.append(f"Error! Input type `{type(v)}` is not `StringType`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in GSDataType with oneOf schemas: PrimitiveType, StringType. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in GSDataType with oneOf schemas: PrimitiveType, StringType. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into PrimitiveType + try: + instance.actual_instance = PrimitiveType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into StringType + try: + instance.actual_instance = StringType.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into GSDataType with oneOf schemas: PrimitiveType, StringType. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into GSDataType with oneOf schemas: PrimitiveType, StringType. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], PrimitiveType, StringType]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/python/graphscope/flex/rest/models/job_status.py b/python/graphscope/flex/rest/models/job_status.py index 15001b11fc7c..bbdbc98f0bbc 100644 --- a/python/graphscope/flex/rest/models/job_status.py +++ b/python/graphscope/flex/rest/models/job_status.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -27,21 +27,18 @@ class JobStatus(BaseModel): """ JobStatus """ # noqa: E501 - job_id: Optional[StrictStr] = None - type: Optional[StrictStr] = None - status: Optional[StrictStr] = None + id: StrictStr + type: StrictStr + status: StrictStr start_time: Optional[StrictStr] = None end_time: Optional[StrictStr] = None - log: Optional[StrictStr] = Field(default=None, description="URL or log string") + log: Optional[StrictStr] = Field(default=None, description="logview URL or log string") detail: Optional[Dict[str, Any]] = None - __properties: ClassVar[List[str]] = ["job_id", "type", "status", "start_time", "end_time", "log", "detail"] + __properties: ClassVar[List[str]] = ["id", "type", "status", "start_time", "end_time", "log", "detail"] @field_validator('status') def status_validate_enum(cls, value): """Validates the enum""" - if value is None: - return value - if value not in set(['RUNNING', 'SUCCESS', 'FAILED', 'CANCELLED', 'WAITING']): raise ValueError("must be one of enum values ('RUNNING', 'SUCCESS', 'FAILED', 'CANCELLED', 'WAITING')") return value @@ -97,7 +94,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "job_id": obj.get("job_id"), + "id": obj.get("id"), "type": obj.get("type"), "status": obj.get("status"), "start_time": obj.get("start_time"), diff --git a/python/graphscope/flex/rest/models/groot_edge_type_relations_inner.py b/python/graphscope/flex/rest/models/long_text.py similarity index 81% rename from python/graphscope/flex/rest/models/groot_edge_type_relations_inner.py rename to python/graphscope/flex/rest/models/long_text.py index fcdc83aa2235..51d739eab46e 100644 --- a/python/graphscope/flex/rest/models/groot_edge_type_relations_inner.py +++ b/python/graphscope/flex/rest/models/long_text.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -23,13 +23,12 @@ from typing import Optional, Set from typing_extensions import Self -class GrootEdgeTypeRelationsInner(BaseModel): +class LongText(BaseModel): """ - GrootEdgeTypeRelationsInner + LongText """ # noqa: E501 - src_label: Optional[StrictStr] = None - dst_label: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["src_label", "dst_label"] + long_text: Optional[StrictStr] + __properties: ClassVar[List[str]] = ["long_text"] model_config = { "populate_by_name": True, @@ -49,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of GrootEdgeTypeRelationsInner from a JSON string""" + """Create an instance of LongText from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -70,11 +69,16 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # set to None if long_text (nullable) is None + # and model_fields_set contains the field + if self.long_text is None and "long_text" in self.model_fields_set: + _dict['long_text'] = None + return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GrootEdgeTypeRelationsInner from a dict""" + """Create an instance of LongText from a dict""" if obj is None: return None @@ -82,8 +86,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "src_label": obj.get("src_label"), - "dst_label": obj.get("dst_label") + "long_text": obj.get("long_text") }) return _obj diff --git a/python/graphscope/flex/rest/models/node_status.py b/python/graphscope/flex/rest/models/node_status.py deleted file mode 100644 index b1bb1c6b6634..000000000000 --- a/python/graphscope/flex/rest/models/node_status.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - GraphScope FLEX HTTP SERVICE API - - 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) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Optional, Union -from typing import Optional, Set -from typing_extensions import Self - -class NodeStatus(BaseModel): - """ - NodeStatus - """ # noqa: E501 - node: Optional[StrictStr] = None - cpu_usage: Optional[Union[StrictFloat, StrictInt]] = None - memory_usage: Optional[Union[StrictFloat, StrictInt]] = None - disk_usage: Optional[Union[StrictFloat, StrictInt]] = None - __properties: ClassVar[List[str]] = ["node", "cpu_usage", "memory_usage", "disk_usage"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of NodeStatus from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of NodeStatus from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "node": obj.get("node"), - "cpu_usage": obj.get("cpu_usage"), - "memory_usage": obj.get("memory_usage"), - "disk_usage": obj.get("disk_usage") - }) - return _obj - - diff --git a/python/graphscope/flex/rest/models/parameter.py b/python/graphscope/flex/rest/models/parameter.py new file mode 100644 index 000000000000..c8cbd43939e7 --- /dev/null +++ b/python/graphscope/flex/rest/models/parameter.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + GraphScope FLEX HTTP SERVICE API + + 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) + + The version of the OpenAPI document: 1.0.0 + Contact: graphscope@alibaba-inc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List +from graphscope.flex.rest.models.gs_data_type import GSDataType +from typing import Optional, Set +from typing_extensions import Self + +class Parameter(BaseModel): + """ + Parameter + """ # noqa: E501 + name: StrictStr + type: GSDataType + __properties: ClassVar[List[str]] = ["name", "type"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Parameter from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of type + if self.type: + _dict['type'] = self.type.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Parameter from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "type": GSDataType.from_dict(obj["type"]) if obj.get("type") is not None else None + }) + return _obj + + diff --git a/python/graphscope/flex/rest/models/property_property_type.py b/python/graphscope/flex/rest/models/primitive_type.py similarity index 80% rename from python/graphscope/flex/rest/models/property_property_type.py rename to python/graphscope/flex/rest/models/primitive_type.py index 72cd19b367e3..e1302b46a94e 100644 --- a/python/graphscope/flex/rest/models/property_property_type.py +++ b/python/graphscope/flex/rest/models/primitive_type.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,25 +19,22 @@ import json from pydantic import BaseModel, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional +from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self -class PropertyPropertyType(BaseModel): +class PrimitiveType(BaseModel): """ - PropertyPropertyType + PrimitiveType """ # noqa: E501 - primitive_type: Optional[StrictStr] = None + primitive_type: StrictStr __properties: ClassVar[List[str]] = ["primitive_type"] @field_validator('primitive_type') def primitive_type_validate_enum(cls, value): """Validates the enum""" - if value is None: - return value - - if value not in set(['DT_DOUBLE', 'DT_STRING', 'DT_SIGNED_INT32', 'DT_SIGNED_INT64', 'DT_DATE32']): - raise ValueError("must be one of enum values ('DT_DOUBLE', 'DT_STRING', 'DT_SIGNED_INT32', 'DT_SIGNED_INT64', 'DT_DATE32')") + if value not in set(['DT_SIGNED_INT32', 'DT_UNSIGNED_INT32', 'DT_SIGNED_INT64', 'DT_UNSIGNED_INT64', 'DT_BOOL', 'DT_FLOAT', 'DT_DOUBLE']): + raise ValueError("must be one of enum values ('DT_SIGNED_INT32', 'DT_UNSIGNED_INT32', 'DT_SIGNED_INT64', 'DT_UNSIGNED_INT64', 'DT_BOOL', 'DT_FLOAT', 'DT_DOUBLE')") return value model_config = { @@ -58,7 +55,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of PropertyPropertyType from a JSON string""" + """Create an instance of PrimitiveType from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -83,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of PropertyPropertyType from a dict""" + """Create an instance of PrimitiveType from a dict""" if obj is None: return None diff --git a/python/graphscope/flex/rest/models/connection_status.py b/python/graphscope/flex/rest/models/running_deployment_info.py similarity index 73% rename from python/graphscope/flex/rest/models/connection_status.py rename to python/graphscope/flex/rest/models/running_deployment_info.py index 206f02bb24d5..87685e55119e 100644 --- a/python/graphscope/flex/rest/models/connection_status.py +++ b/python/graphscope/flex/rest/models/running_deployment_info.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,34 +19,31 @@ import json from pydantic import BaseModel, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional +from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self -class ConnectionStatus(BaseModel): +class RunningDeploymentInfo(BaseModel): """ - ConnectionStatus + RunningDeploymentInfo """ # noqa: E501 - status: Optional[StrictStr] = None - solution: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["status", "solution"] - - @field_validator('status') - def status_validate_enum(cls, value): + instance_name: StrictStr + cluster_type: StrictStr + version: StrictStr + solution: StrictStr + creation_time: StrictStr + __properties: ClassVar[List[str]] = ["instance_name", "cluster_type", "version", "solution", "creation_time"] + + @field_validator('cluster_type') + def cluster_type_validate_enum(cls, value): """Validates the enum""" - if value is None: - return value - - if value not in set(['CONNECTED']): - raise ValueError("must be one of enum values ('CONNECTED')") + if value not in set(['HOSTS', 'KUBERNETES']): + raise ValueError("must be one of enum values ('HOSTS', 'KUBERNETES')") return value @field_validator('solution') def solution_validate_enum(cls, value): """Validates the enum""" - if value is None: - return value - if value not in set(['INTERACTIVE', 'GRAPHSCOPE_INSIGHT']): raise ValueError("must be one of enum values ('INTERACTIVE', 'GRAPHSCOPE_INSIGHT')") return value @@ -69,7 +66,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ConnectionStatus from a JSON string""" + """Create an instance of RunningDeploymentInfo from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -94,7 +91,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ConnectionStatus from a dict""" + """Create an instance of RunningDeploymentInfo from a dict""" if obj is None: return None @@ -102,8 +99,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "status": obj.get("status"), - "solution": obj.get("solution") + "instance_name": obj.get("instance_name"), + "cluster_type": obj.get("cluster_type"), + "version": obj.get("version"), + "solution": obj.get("solution"), + "creation_time": obj.get("creation_time") }) return _obj diff --git a/python/graphscope/flex/rest/models/schema_mapping.py b/python/graphscope/flex/rest/models/schema_mapping.py index e84c4fbb047e..48db48043733 100644 --- a/python/graphscope/flex/rest/models/schema_mapping.py +++ b/python/graphscope/flex/rest/models/schema_mapping.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,10 +18,9 @@ import re # noqa: F401 import json -from pydantic import BaseModel, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel +from typing import Any, ClassVar, Dict, List from graphscope.flex.rest.models.edge_mapping import EdgeMapping -from graphscope.flex.rest.models.schema_mapping_loading_config import SchemaMappingLoadingConfig from graphscope.flex.rest.models.vertex_mapping import VertexMapping from typing import Optional, Set from typing_extensions import Self @@ -30,11 +29,9 @@ class SchemaMapping(BaseModel): """ SchemaMapping """ # noqa: E501 - graph: Optional[StrictStr] = None - loading_config: Optional[SchemaMappingLoadingConfig] = None - vertex_mappings: Optional[List[VertexMapping]] = None - edge_mappings: Optional[List[EdgeMapping]] = None - __properties: ClassVar[List[str]] = ["graph", "loading_config", "vertex_mappings", "edge_mappings"] + vertex_mappings: List[VertexMapping] + edge_mappings: List[EdgeMapping] + __properties: ClassVar[List[str]] = ["vertex_mappings", "edge_mappings"] model_config = { "populate_by_name": True, @@ -75,9 +72,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of loading_config - if self.loading_config: - _dict['loading_config'] = self.loading_config.to_dict() # override the default output from pydantic by calling `to_dict()` of each item in vertex_mappings (list) _items = [] if self.vertex_mappings: @@ -104,8 +98,6 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "graph": obj.get("graph"), - "loading_config": SchemaMappingLoadingConfig.from_dict(obj["loading_config"]) if obj.get("loading_config") is not None else None, "vertex_mappings": [VertexMapping.from_dict(_item) for _item in obj["vertex_mappings"]] if obj.get("vertex_mappings") is not None else None, "edge_mappings": [EdgeMapping.from_dict(_item) for _item in obj["edge_mappings"]] if obj.get("edge_mappings") is not None else None }) diff --git a/python/graphscope/flex/rest/models/service_status.py b/python/graphscope/flex/rest/models/service_status.py index a72e8b08e19e..e727cebd5c3d 100644 --- a/python/graphscope/flex/rest/models/service_status.py +++ b/python/graphscope/flex/rest/models/service_status.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,8 +18,9 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional +from graphscope.flex.rest.models.get_graph_response import GetGraphResponse from graphscope.flex.rest.models.service_status_sdk_endpoints import ServiceStatusSdkEndpoints from typing import Optional, Set from typing_extensions import Self @@ -28,10 +29,17 @@ class ServiceStatus(BaseModel): """ ServiceStatus """ # noqa: E501 - status: Optional[StrictStr] = None - graph_name: Optional[StrictStr] = Field(default=None, description="which graph is serving now") + status: StrictStr + graph: Optional[GetGraphResponse] = None sdk_endpoints: Optional[ServiceStatusSdkEndpoints] = None - __properties: ClassVar[List[str]] = ["status", "graph_name", "sdk_endpoints"] + __properties: ClassVar[List[str]] = ["status", "graph", "sdk_endpoints"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['Running', 'Stopped']): + raise ValueError("must be one of enum values ('Running', 'Stopped')") + return value model_config = { "populate_by_name": True, @@ -72,6 +80,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of graph + if self.graph: + _dict['graph'] = self.graph.to_dict() # override the default output from pydantic by calling `to_dict()` of sdk_endpoints if self.sdk_endpoints: _dict['sdk_endpoints'] = self.sdk_endpoints.to_dict() @@ -88,7 +99,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "status": obj.get("status"), - "graph_name": obj.get("graph_name"), + "graph": GetGraphResponse.from_dict(obj["graph"]) if obj.get("graph") is not None else None, "sdk_endpoints": ServiceStatusSdkEndpoints.from_dict(obj["sdk_endpoints"]) if obj.get("sdk_endpoints") is not None else None }) return _obj diff --git a/python/graphscope/flex/rest/models/service_status_sdk_endpoints.py b/python/graphscope/flex/rest/models/service_status_sdk_endpoints.py index a37eb9309564..f811522ca475 100644 --- a/python/graphscope/flex/rest/models/service_status_sdk_endpoints.py +++ b/python/graphscope/flex/rest/models/service_status_sdk_endpoints.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/python/graphscope/flex/rest/models/start_service_request.py b/python/graphscope/flex/rest/models/start_service_request.py index 901009e11692..ad3127b9c09b 100644 --- a/python/graphscope/flex/rest/models/start_service_request.py +++ b/python/graphscope/flex/rest/models/start_service_request.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -27,8 +27,8 @@ class StartServiceRequest(BaseModel): """ StartServiceRequest """ # noqa: E501 - graph_name: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["graph_name"] + graph_id: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["graph_id"] model_config = { "populate_by_name": True, @@ -81,7 +81,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "graph_name": obj.get("graph_name") + "graph_id": obj.get("graph_id") }) return _obj diff --git a/python/graphscope/flex/rest/models/groot_graph.py b/python/graphscope/flex/rest/models/stored_procedure_meta.py similarity index 61% rename from python/graphscope/flex/rest/models/groot_graph.py rename to python/graphscope/flex/rest/models/stored_procedure_meta.py index 890844de4ca9..e847f327a15b 100644 --- a/python/graphscope/flex/rest/models/groot_graph.py +++ b/python/graphscope/flex/rest/models/stored_procedure_meta.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,33 +18,31 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictBool, StrictStr, field_validator +from pydantic import BaseModel, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from graphscope.flex.rest.models.groot_graph_gremlin_interface import GrootGraphGremlinInterface -from graphscope.flex.rest.models.groot_schema import GrootSchema +from graphscope.flex.rest.models.parameter import Parameter from typing import Optional, Set from typing_extensions import Self -class GrootGraph(BaseModel): +class StoredProcedureMeta(BaseModel): """ - GrootGraph + StoredProcedureMeta """ # noqa: E501 - name: Optional[StrictStr] = None - type: Optional[StrictStr] = None - directed: Optional[StrictBool] = None - creation_time: Optional[StrictStr] = None - var_schema: Optional[GrootSchema] = Field(default=None, alias="schema") - gremlin_interface: Optional[GrootGraphGremlinInterface] = None - __properties: ClassVar[List[str]] = ["name", "type", "directed", "creation_time", "schema", "gremlin_interface"] + name: StrictStr + description: Optional[StrictStr] = None + type: StrictStr + query: StrictStr + id: StrictStr + library: StrictStr + params: List[Parameter] + returns: List[Parameter] + __properties: ClassVar[List[str]] = ["name", "description", "type", "query", "id", "library", "params", "returns"] @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value is None: - return value - - if value not in set(['GrootGraph']): - raise ValueError("must be one of enum values ('GrootGraph')") + if value not in set(['cpp', 'cypher']): + raise ValueError("must be one of enum values ('cpp', 'cypher')") return value model_config = { @@ -65,7 +63,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of GrootGraph from a JSON string""" + """Create an instance of StoredProcedureMeta from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -86,17 +84,25 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of var_schema - if self.var_schema: - _dict['schema'] = self.var_schema.to_dict() - # override the default output from pydantic by calling `to_dict()` of gremlin_interface - if self.gremlin_interface: - _dict['gremlin_interface'] = self.gremlin_interface.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in params (list) + _items = [] + if self.params: + for _item in self.params: + if _item: + _items.append(_item.to_dict()) + _dict['params'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in returns (list) + _items = [] + if self.returns: + for _item in self.returns: + if _item: + _items.append(_item.to_dict()) + _dict['returns'] = _items return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GrootGraph from a dict""" + """Create an instance of StoredProcedureMeta from a dict""" if obj is None: return None @@ -105,11 +111,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "name": obj.get("name"), + "description": obj.get("description"), "type": obj.get("type"), - "directed": obj.get("directed"), - "creation_time": obj.get("creation_time"), - "schema": GrootSchema.from_dict(obj["schema"]) if obj.get("schema") is not None else None, - "gremlin_interface": GrootGraphGremlinInterface.from_dict(obj["gremlin_interface"]) if obj.get("gremlin_interface") is not None else None + "query": obj.get("query"), + "id": obj.get("id"), + "library": obj.get("library"), + "params": [Parameter.from_dict(_item) for _item in obj["params"]] if obj.get("params") is not None else None, + "returns": [Parameter.from_dict(_item) for _item in obj["returns"]] if obj.get("returns") is not None else None }) return _obj diff --git a/python/graphscope/flex/rest/models/string_type.py b/python/graphscope/flex/rest/models/string_type.py new file mode 100644 index 000000000000..3c44c4e3cbec --- /dev/null +++ b/python/graphscope/flex/rest/models/string_type.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + GraphScope FLEX HTTP SERVICE API + + 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) + + The version of the OpenAPI document: 1.0.0 + Contact: graphscope@alibaba-inc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel +from typing import Any, ClassVar, Dict, List +from graphscope.flex.rest.models.string_type_string import StringTypeString +from typing import Optional, Set +from typing_extensions import Self + +class StringType(BaseModel): + """ + StringType + """ # noqa: E501 + string: StringTypeString + __properties: ClassVar[List[str]] = ["string"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of StringType from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of string + if self.string: + _dict['string'] = self.string.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of StringType from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "string": StringTypeString.from_dict(obj["string"]) if obj.get("string") is not None else None + }) + return _obj + + diff --git a/python/graphscope/flex/rest/models/string_type_string.py b/python/graphscope/flex/rest/models/string_type_string.py new file mode 100644 index 000000000000..8ed931db3b49 --- /dev/null +++ b/python/graphscope/flex/rest/models/string_type_string.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + GraphScope FLEX HTTP SERVICE API + + 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) + + The version of the OpenAPI document: 1.0.0 + Contact: graphscope@alibaba-inc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from graphscope.flex.rest.models.long_text import LongText +from pydantic import StrictStr, Field +from typing import Union, List, Optional, Dict +from typing_extensions import Literal, Self + +STRINGTYPESTRING_ONE_OF_SCHEMAS = ["LongText"] + +class StringTypeString(BaseModel): + """ + StringTypeString + """ + # data type: LongText + oneof_schema_1_validator: Optional[LongText] = None + actual_instance: Optional[Union[LongText]] = None + one_of_schemas: List[str] = Field(default=Literal["LongText"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = StringTypeString.model_construct() + error_messages = [] + match = 0 + # validate data type: LongText + if not isinstance(v, LongText): + error_messages.append(f"Error! Input type `{type(v)}` is not `LongText`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in StringTypeString with oneOf schemas: LongText. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in StringTypeString with oneOf schemas: LongText. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into LongText + try: + instance.actual_instance = LongText.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into StringTypeString with oneOf schemas: LongText. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into StringTypeString with oneOf schemas: LongText. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], LongText]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/python/graphscope/flex/rest/models/graph_stored_procedures.py b/python/graphscope/flex/rest/models/update_alert_message_status_request.py similarity index 76% rename from python/graphscope/flex/rest/models/graph_stored_procedures.py rename to python/graphscope/flex/rest/models/update_alert_message_status_request.py index 8bb62181e02c..56dd5eef2682 100644 --- a/python/graphscope/flex/rest/models/graph_stored_procedures.py +++ b/python/graphscope/flex/rest/models/update_alert_message_status_request.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,25 +19,23 @@ import json from pydantic import BaseModel, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional +from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self -class GraphStoredProcedures(BaseModel): +class UpdateAlertMessageStatusRequest(BaseModel): """ - GraphStoredProcedures + UpdateAlertMessageStatusRequest """ # noqa: E501 - directory: Optional[StrictStr] = None - __properties: ClassVar[List[str]] = ["directory"] + message_ids: List[StrictStr] + status: StrictStr + __properties: ClassVar[List[str]] = ["message_ids", "status"] - @field_validator('directory') - def directory_validate_enum(cls, value): + @field_validator('status') + def status_validate_enum(cls, value): """Validates the enum""" - if value is None: - return value - - if value not in set(['plugins']): - raise ValueError("must be one of enum values ('plugins')") + if value not in set(['unsolved', 'solved', 'dealing']): + raise ValueError("must be one of enum values ('unsolved', 'solved', 'dealing')") return value model_config = { @@ -58,7 +56,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of GraphStoredProcedures from a JSON string""" + """Create an instance of UpdateAlertMessageStatusRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -83,7 +81,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GraphStoredProcedures from a dict""" + """Create an instance of UpdateAlertMessageStatusRequest from a dict""" if obj is None: return None @@ -91,7 +89,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "directory": obj.get("directory") + "message_ids": obj.get("message_ids"), + "status": obj.get("status") }) return _obj diff --git a/python/graphscope/flex/rest/models/update_alert_messages_request.py b/python/graphscope/flex/rest/models/update_alert_messages_request.py deleted file mode 100644 index b7c3b38ecf9a..000000000000 --- a/python/graphscope/flex/rest/models/update_alert_messages_request.py +++ /dev/null @@ -1,110 +0,0 @@ -# coding: utf-8 - -""" - GraphScope FLEX HTTP SERVICE API - - 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) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, Field, StrictBool, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from graphscope.flex.rest.models.alert_message import AlertMessage -from typing import Optional, Set -from typing_extensions import Self - -class UpdateAlertMessagesRequest(BaseModel): - """ - UpdateAlertMessagesRequest - """ # noqa: E501 - messages: Optional[List[AlertMessage]] = None - batch_status: Optional[StrictStr] = Field(default=None, description="Override the status of each message") - batch_delete: Optional[StrictBool] = Field(default=False, description="True will delete all the messages in request body") - __properties: ClassVar[List[str]] = ["messages", "batch_status", "batch_delete"] - - @field_validator('batch_status') - def batch_status_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['solved', 'unsolved', 'dealing']): - raise ValueError("must be one of enum values ('solved', 'unsolved', 'dealing')") - return value - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UpdateAlertMessagesRequest from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in messages (list) - _items = [] - if self.messages: - for _item in self.messages: - if _item: - _items.append(_item.to_dict()) - _dict['messages'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UpdateAlertMessagesRequest from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "messages": [AlertMessage.from_dict(_item) for _item in obj["messages"]] if obj.get("messages") is not None else None, - "batch_status": obj.get("batch_status"), - "batch_delete": obj.get("batch_delete") if obj.get("batch_delete") is not None else False - }) - return _obj - - diff --git a/python/graphscope/flex/rest/models/update_procedure_request.py b/python/graphscope/flex/rest/models/update_procedure_request.py new file mode 100644 index 000000000000..0b794b4d92d1 --- /dev/null +++ b/python/graphscope/flex/rest/models/update_procedure_request.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + GraphScope FLEX HTTP SERVICE API + + 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) + + The version of the OpenAPI document: 1.0.0 + Contact: graphscope@alibaba-inc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class UpdateProcedureRequest(BaseModel): + """ + UpdateProcedureRequest + """ # noqa: E501 + description: StrictStr + __properties: ClassVar[List[str]] = ["description"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateProcedureRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateProcedureRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "description": obj.get("description") + }) + return _obj + + diff --git a/python/graphscope/flex/rest/models/upload_file_response.py b/python/graphscope/flex/rest/models/upload_file_response.py new file mode 100644 index 000000000000..5d90a08bef55 --- /dev/null +++ b/python/graphscope/flex/rest/models/upload_file_response.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + GraphScope FLEX HTTP SERVICE API + + 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) + + The version of the OpenAPI document: 1.0.0 + Contact: graphscope@alibaba-inc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class UploadFileResponse(BaseModel): + """ + UploadFileResponse + """ # noqa: E501 + file_path: StrictStr + __properties: ClassVar[List[str]] = ["file_path"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UploadFileResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UploadFileResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "file_path": obj.get("file_path") + }) + return _obj + + diff --git a/python/graphscope/flex/rest/models/vertex_data_source.py b/python/graphscope/flex/rest/models/vertex_data_source.py deleted file mode 100644 index f938fe876fdc..000000000000 --- a/python/graphscope/flex/rest/models/vertex_data_source.py +++ /dev/null @@ -1,104 +0,0 @@ -# coding: utf-8 - -""" - GraphScope FLEX HTTP SERVICE API - - 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) - - The version of the OpenAPI document: 0.9.1 - Contact: graphscope@alibaba-inc.com - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import pprint -import re # noqa: F401 -import json - -from pydantic import BaseModel, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class VertexDataSource(BaseModel): - """ - VertexDataSource - """ # noqa: E501 - data_source: Optional[StrictStr] = None - type_name: Optional[StrictStr] = None - location: Optional[StrictStr] = None - property_mapping: Optional[Dict[str, Any]] = None - __properties: ClassVar[List[str]] = ["data_source", "type_name", "location", "property_mapping"] - - @field_validator('data_source') - def data_source_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['ODPS', 'FILE']): - raise ValueError("must be one of enum values ('ODPS', 'FILE')") - return value - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of VertexDataSource from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of VertexDataSource from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "data_source": obj.get("data_source"), - "type_name": obj.get("type_name"), - "location": obj.get("location"), - "property_mapping": obj.get("property_mapping") - }) - return _obj - - diff --git a/python/graphscope/flex/rest/models/vertex_mapping.py b/python/graphscope/flex/rest/models/vertex_mapping.py index 7dc951a6813f..1bd01e7ed882 100644 --- a/python/graphscope/flex/rest/models/vertex_mapping.py +++ b/python/graphscope/flex/rest/models/vertex_mapping.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,7 +19,7 @@ import json from pydantic import BaseModel, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from typing import Any, ClassVar, Dict, List from graphscope.flex.rest.models.column_mapping import ColumnMapping from typing import Optional, Set from typing_extensions import Self @@ -28,9 +28,9 @@ class VertexMapping(BaseModel): """ VertexMapping """ # noqa: E501 - type_name: Optional[StrictStr] = None - inputs: Optional[List[StrictStr]] = None - column_mappings: Optional[List[ColumnMapping]] = None + type_name: StrictStr + inputs: List[StrictStr] + column_mappings: List[ColumnMapping] __properties: ClassVar[List[str]] = ["type_name", "inputs", "column_mappings"] model_config = { diff --git a/python/graphscope/flex/rest/rest.py b/python/graphscope/flex/rest/rest.py index ecb9dc1eb11e..25ab1380fdf0 100644 --- a/python/graphscope/flex/rest/rest.py +++ b/python/graphscope/flex/rest/rest.py @@ -5,7 +5,7 @@ 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) - The version of the OpenAPI document: 0.9.1 + The version of the OpenAPI document: 1.0.0 Contact: graphscope@alibaba-inc.com Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/python/graphscope/gsctl/__init__.py b/python/graphscope/gsctl/__init__.py index 895287b8d746..92788493ca65 100644 --- a/python/graphscope/gsctl/__init__.py +++ b/python/graphscope/gsctl/__init__.py @@ -15,3 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # + +import warnings + +# Disable warnings +warnings.filterwarnings("ignore", category=Warning) diff --git a/python/graphscope/gsctl/commands/__init__.py b/python/graphscope/gsctl/commands/__init__.py index 7d5ab360d901..a42f03ad55cf 100644 --- a/python/graphscope/gsctl/commands/__init__.py +++ b/python/graphscope/gsctl/commands/__init__.py @@ -22,7 +22,7 @@ from graphscope.gsctl.commands.common import cli as common from graphscope.gsctl.commands.dev import cli as dev -from graphscope.gsctl.commands.insight.graph import cli as insight_graph +# from graphscope.gsctl.commands.insight.graph import cli as insight_graph from graphscope.gsctl.commands.interactive.glob import cli as interactive from graphscope.gsctl.commands.interactive.graph import cli as interactive_graph from graphscope.gsctl.config import Context @@ -91,6 +91,7 @@ def get_command_collection(context: Context): info("Run `gsctl use GLOBAL` to switch back to GLOBAL context.\n") commands = click.CommandCollection(sources=[common, interactive_graph]) elif context.flex == "GRAPHSCOPE_INSIGHT": - commands = click.CommandCollection(sources=[common, insight_graph]) + commands = click.CommandCollection(sources=[common]) + # commands = click.CommandCollection(sources=[common, insight_graph]) return commands diff --git a/python/graphscope/gsctl/commands/insight/graph.py b/python/graphscope/gsctl/commands/insight/graph.py deleted file mode 100644 index 81e7aaf12115..000000000000 --- a/python/graphscope/gsctl/commands/insight/graph.py +++ /dev/null @@ -1,307 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# -# Copyright 2024 Alibaba Group Holding Limited. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -import click -import yaml - -from graphscope.gsctl.impl import create_edge_type -from graphscope.gsctl.impl import create_groot_dataloading_job -from graphscope.gsctl.impl import create_vertex_type -from graphscope.gsctl.impl import delete_edge_type -from graphscope.gsctl.impl import delete_job_by_id -from graphscope.gsctl.impl import delete_vertex_type -from graphscope.gsctl.impl import get_datasource -from graphscope.gsctl.impl import get_job_by_id -from graphscope.gsctl.impl import import_datasource -from graphscope.gsctl.impl import import_groot_schema -from graphscope.gsctl.impl import list_groot_graph -from graphscope.gsctl.impl import list_jobs -from graphscope.gsctl.impl import unbind_edge_datasource -from graphscope.gsctl.impl import unbind_vertex_datasource -from graphscope.gsctl.utils import TreeDisplay -from graphscope.gsctl.utils import err -from graphscope.gsctl.utils import info -from graphscope.gsctl.utils import is_valid_file_path -from graphscope.gsctl.utils import read_yaml_file -from graphscope.gsctl.utils import succ -from graphscope.gsctl.utils import terminal_display - - -@click.group() -def cli(): - pass - - -@cli.group() -def create(): - """Create vertex/edge type, data source, loader job from file""" - pass - - -@cli.group() -def delete(): - """Delete vertex/edge type, data source, loader job by identifier""" - pass - - -@cli.group() -def desc(): - """Show details of job status by identifier""" - pass - - -@cli.command() -def ls(): # noqa: F811 - """Display schema, stored procedure, and job information""" - tree = TreeDisplay() - try: - graphs = list_groot_graph() - using_graph = graphs[0] - # schema - tree.create_graph_node_for_groot(using_graph) - # data source - datasource = get_datasource("placeholder") - tree.create_datasource_node(using_graph, datasource) - # stored procedure - tree.create_procedure_node(using_graph, []) - # job - jobs = list_jobs() - tree.create_job_node(using_graph, jobs) - except Exception as e: - err(f"Failed to display graph information: {str(e)}") - else: - tree.show(using_graph.name) - - -@create.command -@click.option( - "-f", - "--filename", - required=True, - help="Path of yaml file", -) -def schema(filename): # noqa: F811 - """Import the schema from file""" - if not is_valid_file_path(filename): - err(f"Invalid file: {filename}") - return - try: - schema = read_yaml_file(filename) - # only one graph supported int groot - import_groot_schema("placeholder", schema) - except Exception as e: - err(f"Failed to import schema: {str(e)}") - else: - succ("Import schema successfully.") - - -@create.command(name="vertex_type") -@click.option( - "-f", - "--filename", - required=True, - help="Path of yaml file", -) -def vertex_type(filename): # noqa: F811 - """Create a vertex type from file""" - if not is_valid_file_path(filename): - err(f"Invalid file: {filename}") - return - try: - vtype = read_yaml_file(filename) - # only one graph supported in groot - create_vertex_type("placeholder", vtype) - except Exception as e: - err(f"Failed to create vertex type: {str(e)}") - else: - succ(f"Create vertex type {vtype['type_name']} successfully.") - - -@delete.command(name="vertex_type") -@click.argument("vertex_type", required=True) -def vertex_type(vertex_type): # noqa: F811 - """Delete a vertex type, see identifier with `ls` command""" - try: - delete_vertex_type("placeholder", vertex_type) - except Exception as e: - err(f"Failed to delete vertex type {vertex_type}: {str(e)}") - else: - succ(f"Delete vertex type {vertex_type} successfully.") - - -@create.command(name="edge_type") -@click.option( - "-f", - "--filename", - required=True, - help="Path of yaml file", -) -def edge_type(filename): # noqa: F811 - """Create an edge type from file""" - if not is_valid_file_path(filename): - err(f"Invalid file: {filename}") - return - try: - etype = read_yaml_file(filename) - # only one graph supported in groot - create_edge_type("placeholder", etype) - except Exception as e: - err(f"Failed to create edge type: {str(e)}") - else: - succ(f"Create edge type {etype['type_name']} successfully.") - - -@delete.command(name="edge_type") -@click.argument("edge_type", required=True) -@click.option( - "-s", - "--source_vertex_type", - required=True, - help="Source vertex type of the edge", -) -@click.option( - "-d", - "--destination_vertex_type", - required=True, - help="Destination vertex type of the edge", -) -def etype(edge_type, source_vertex_type, destination_vertex_type): # noqa: F811 - """Delete an edge type, see identifier with `ls` command""" - try: - etype_full_name = ( - f"({source_vertex_type})-[{edge_type}]->({destination_vertex_type})" - ) - delete_edge_type( - "placeholder", edge_type, source_vertex_type, destination_vertex_type - ) - except Exception as e: - err(f"Failed to delete edge type {etype_full_name}: {str(e)}") - else: - succ(f"Delete edge type {etype_full_name} successfully.") - - -@create.command -@click.option( - "-f", - "--filename", - required=True, - help="Path of yaml file.", -) -def datasource(filename): # noqa: F811 - """Bind data source from file""" - if not is_valid_file_path(filename): - err(f"Invalid file: {filename}") - return - try: - datasource = read_yaml_file(filename) - # only one graph supported int groot - import_datasource("placeholder", datasource) - except Exception as e: - err(f"Failed to import data source: {str(e)}") - else: - succ("Bind data source successfully.") - - -@delete.command(name="vertex_source") -@click.argument("vertex_type", required=True) -def vertex_source(vertex_type): # noqa: F811 - """Unbind the data source on vertex type""" - try: - unbind_vertex_datasource("placeholder", vertex_type) - except Exception as e: - err(f"Failed to unbind data source on {vertex_type}: {str(e)}") - else: - succ(f"Unbind data source on {vertex_type} successfully.") - - -@delete.command(name="edge_source") -@click.argument("edge_type", required=True) -@click.option( - "-s", - "--source_vertex_type", - required=True, - help="Source vertex type of the edge", -) -@click.option( - "-d", - "--destination_vertex_type", - required=True, - help="Destination vertex type of the edge", -) -def edge_source(edge_type, source_vertex_type, destination_vertex_type): # noqa: F811 - """Unbind the data source on edge type""" - try: - etype_full_name = ( - f"({source_vertex_type})-[{edge_type}]->({destination_vertex_type})" - ) - unbind_edge_datasource( - "placeholder", edge_type, source_vertex_type, destination_vertex_type - ) - except Exception as e: - err(f"Failed to unbind data source on {etype_full_name}: {str(e)}") - else: - succ(f"Unbind data source on {etype_full_name} successfully.") - - -@create.command() -@click.option( - "-f", - "--filename", - required=True, - help="Path of yaml file", -) -def loaderjob(filename): # noqa: F811 - """Create a dataloading job from file""" - if not is_valid_file_path(filename): - err(f"Invalid file: {filename}") - return - try: - config = read_yaml_file(filename) - jobid = create_groot_dataloading_job("placeholder", config) - except Exception as e: - err(f"Failed to create a job: {str(e)}") - else: - succ(f"Create job {jobid} successfully.") - - -@desc.command() -@click.argument("identifier", required=True) -def job(identifier): # noqa: F811 - """Show details of job, see identifier with `ls` command""" - try: - job = get_job_by_id(identifier) - except Exception as e: - err(f"Failed to get job: {str(e)}") - else: - info(yaml.dump(job.to_dict())) - - -@delete.command() -@click.argument("identifier", required=True) -def job(identifier): # noqa: F811 - """Cancel a job, see identifier with `ls` command""" - try: - delete_job_by_id(identifier) - except Exception as e: - err(f"Failed to cancel job {identifier}: {str(e)}") - else: - succ(f"Cancel job {identifier} successfully.") - - -if __name__ == "__main__": - cli() diff --git a/python/graphscope/gsctl/commands/interactive/glob.py b/python/graphscope/gsctl/commands/interactive/glob.py index 8da1cbc8eab1..0f81283310e9 100644 --- a/python/graphscope/gsctl/commands/interactive/glob.py +++ b/python/graphscope/gsctl/commands/interactive/glob.py @@ -20,8 +20,7 @@ import yaml from graphscope.gsctl.impl import create_graph -from graphscope.gsctl.impl import delete_graph_by_name -from graphscope.gsctl.impl import get_dataloading_config +from graphscope.gsctl.impl import delete_graph_by_id from graphscope.gsctl.impl import get_service_status from graphscope.gsctl.impl import list_graphs from graphscope.gsctl.impl import list_jobs @@ -30,6 +29,8 @@ from graphscope.gsctl.impl import start_service from graphscope.gsctl.impl import stop_service from graphscope.gsctl.impl import switch_context +from graphscope.gsctl.impl import get_datasource_by_id +from graphscope.gsctl.impl import get_graph_id_by_name from graphscope.gsctl.utils import TreeDisplay from graphscope.gsctl.utils import err from graphscope.gsctl.utils import info @@ -70,17 +71,7 @@ def service(): def use(context, graph_identifier): """Switch to GRAPH context, see identifier with `ls` command""" try: - graphs = list_graphs() - graph_exist = False - for g in graphs: - if graph_identifier == g.name: - graph_exist = True - break - if not graph_exist: - raise RuntimeError( - f"Graph '{graph_identifier}' not exists, see graph identifier with `ls` command." - ) - switch_context(graph_identifier) + switch_context(get_graph_id_by_name(graph_identifier)) except Exception as e: err(f"Failed to switch context: {str(e)}") else: @@ -98,11 +89,11 @@ def ls(l): # noqa: F811, E741 # schema tree.create_graph_node(g, recursive=l) if l: - # get data source from job configuration - job_config = get_dataloading_config(g.name) - tree.create_datasource_node_for_interactive(g, job_config) + # data source mappin + datasource_mapping = get_datasource_by_id(g.id) + tree.create_datasource_mapping_node(g, datasource_mapping) # stored procedure - procedures = list_procedures(g.name) + procedures = list_procedures(g.id) tree.create_procedure_node(g, procedures) # job jobs = list_jobs() @@ -141,7 +132,7 @@ def graph(filename): # noqa: F811 def graph(graph_identifier): # noqa: F811 """Delete a graph, see graph identifier with `ls` command""" try: - delete_graph_by_name(graph_identifier) + delete_graph_by_id(get_graph_id_by_name(graph_identifier)) except Exception as e: err(f"Failed to delete graph {graph_identifier}: {str(e)}") else: @@ -169,7 +160,7 @@ def stop(): # noqa: F811 def start(graph_identifier): # noqa: F811 """Start database service on a certain graph""" try: - start_service(graph_identifier) + start_service(get_graph_id_by_name(graph_identifier)) except Exception as e: err(f"Failed to start service on graph {graph_identifier}: {str(e)}") else: @@ -192,16 +183,20 @@ def ls(): # noqa: F811 """Display current service status""" def _construct_and_display_data(status): - head = ["STATUS", "SERVING_GRAPH", "CYPHER_ENDPOINT", "HQPS_ENDPOINT"] + head = ["STATUS", "SERVING_GRAPH(IDENTIFIER)", "CYPHER_ENDPOINT", "HQPS_ENDPOINT", "GREMLIN_ENDPOINT"] data = [head] - data.append( - [ - status.status, - status.graph_name, - status.sdk_endpoints.cypher, - status.sdk_endpoints.hqps, - ] - ) + if status.status == "Stopped": + data.append([status.status, "-", "-", "-", "-"]) + else: + data.append( + [ + status.status, + status.graph.id, + status.sdk_endpoints.cypher, + status.sdk_endpoints.hqps, + status.sdk_endpoints.gremlin, + ] + ) terminal_display(data) try: diff --git a/python/graphscope/gsctl/commands/interactive/graph.py b/python/graphscope/gsctl/commands/interactive/graph.py index d728bb38b2df..5e9ab72e3ce6 100644 --- a/python/graphscope/gsctl/commands/interactive/graph.py +++ b/python/graphscope/gsctl/commands/interactive/graph.py @@ -20,17 +20,20 @@ import yaml from graphscope.gsctl.config import get_current_context -from graphscope.gsctl.impl import create_dataloading_job +from graphscope.gsctl.impl import submit_dataloading_job from graphscope.gsctl.impl import create_procedure from graphscope.gsctl.impl import delete_job_by_id -from graphscope.gsctl.impl import delete_procedure_by_name -from graphscope.gsctl.impl import get_dataloading_config +from graphscope.gsctl.impl import delete_procedure_by_id from graphscope.gsctl.impl import get_job_by_id from graphscope.gsctl.impl import list_graphs from graphscope.gsctl.impl import list_jobs +from graphscope.gsctl.impl import bind_datasource_in_batch +from graphscope.gsctl.impl import get_datasource_by_id from graphscope.gsctl.impl import list_procedures from graphscope.gsctl.impl import switch_context -from graphscope.gsctl.impl import update_procedure +from graphscope.gsctl.impl import unbind_edge_datasource +from graphscope.gsctl.impl import unbind_vertex_datasource +from graphscope.gsctl.impl import get_graph_id_by_name from graphscope.gsctl.utils import TreeDisplay from graphscope.gsctl.utils import err from graphscope.gsctl.utils import info @@ -46,25 +49,19 @@ def cli(): @cli.group() def create(): - """Create stored procedure, loader job from file""" + """Create stored procedure, data source, loader job from file""" pass @cli.group() def delete(): - """Delete stored procedure, loader job by identifier""" - pass - - -@cli.group() -def update(): - """Update stored procedure from file""" + """Delete stored procedure, data source, loader job by id""" pass @cli.group() def desc(): - """Show details of job status and stored procedure by identifier""" + """Show details of job status and stored procedure by id""" pass @@ -84,16 +81,16 @@ def ls(): # noqa: F811 graphs = list_graphs() using_graph = None for g in graphs: - if g.name == current_context.context: + if g.id == current_context.context: using_graph = g break # schema tree.create_graph_node(using_graph) - # get data source from job configuration - job_config = get_dataloading_config(using_graph.name) - tree.create_datasource_node_for_interactive(using_graph, job_config) + # data source mapping + datasource_mapping = get_datasource_by_id(using_graph.id) + tree.create_datasource_mapping_node(using_graph, datasource_mapping) # stored procedure - procedures = list_procedures(using_graph.name) + procedures = list_procedures(using_graph.id) tree.create_procedure_node(using_graph, procedures) # job jobs = list_jobs() @@ -117,12 +114,10 @@ def procedure(filename): err(f"Invalid file: {filename}") return current_context = get_current_context() - graph_name = current_context.context + graph_identifier = current_context.context try: procedure = read_yaml_file(filename) - # overwrite graph name - procedure["bound_graph"] = graph_name - create_procedure(graph_name, procedure) + create_procedure(graph_identifier, procedure) except Exception as e: err(f"Failed to create stored procedure: {str(e)}") else: @@ -134,38 +129,72 @@ def procedure(filename): def procedure(identifier): # noqa: F811 """Delete a stored procedure, see identifier with `ls` command""" current_context = get_current_context() - graph_name = current_context.context + graph_identifier = current_context.context try: - delete_procedure_by_name(graph_name, identifier) + delete_procedure_by_id(graph_identifier, identifier) except Exception as e: err(f"Failed to delete stored procedure: {str(e)}") else: succ(f"Delete stored procedure {identifier} successfully.") -@update.command() +@create.command @click.option( "-f", "--filename", required=True, help="Path of yaml file", ) -def procedure(filename): # noqa: F811 - """Update a stored procedure from file""" +def datasource(filename): # noqa: F811 + """Bind data source mapping from file""" if not is_valid_file_path(filename): err(f"Invalid file: {filename}") return current_context = get_current_context() - graph_name = current_context.context + graph_identifier = current_context.context try: - procedure = read_yaml_file(filename) - # overwrite graph name - procedure["bound_graph"] = graph_name - update_procedure(graph_name, procedure) + datasource = read_yaml_file(filename) + bind_datasource_in_batch(graph_identifier, datasource) + except Exception as e: + err(f"Failed to bind data source: {str(e)}") + else: + succ("Bind data source successfully.") + + +@delete.command +@click.option( + "-t", + "--type", + required=True, + help="Vertex or edge type", +) +@click.option( + "-s", + "--source_vertex_type", + required=False, + help="Source vertex type of the edge [edge only]", +) +@click.option( + "-d", + "--destination_vertex_type", + required=False, + help="Destination vertex type of the edge [edge only]", +) +def datasource(type, source_vertex_type, destination_vertex_type): # noqa: F811 + """Unbind data source mapping on vertex or edge type""" + try: + current_context = get_current_context() + graph_identifier = current_context.context + if source_vertex_type is not None and destination_vertex_type is not None: + unbind_edge_datasource( + graph_identifier, type, source_vertex_type, destination_vertex_type + ) + else: + unbind_vertex_datasource(graph_identifier, type) except Exception as e: - err(f"Failed to update stored procedure: {str(e)}") + err(f"Failed to unbind data source: {str(e)}") else: - succ(f"Update stored procedure {procedure['name']} successfully.") + succ(f"Unbind data source successfully.") @create.command() @@ -176,17 +205,15 @@ def procedure(filename): # noqa: F811 help="Path of yaml file", ) def loaderjob(filename): # noqa: F811 - """Create a dataloading job from file""" + """Create a data loading job from file""" if not is_valid_file_path(filename): err(f"Invalid file: {filename}") return current_context = get_current_context() - graph_name = current_context.context + graph_identifier = current_context.context try: config = read_yaml_file(filename) - # overwrite graph name - config["graph"] = graph_name - jobid = create_dataloading_job(graph_name, config) + jobid = submit_dataloading_job(graph_identifier, config) except Exception as e: err(f"Failed to create a job: {str(e)}") else: @@ -222,23 +249,23 @@ def job(identifier): # noqa: F811 def procedure(identifier): # noqa: F811 """Show details of stored procedure, see identifier with `ls` command""" current_context = get_current_context() - graph_name = current_context.context + graph_id = current_context.context try: - procedures = list_procedures(graph_name) + procedures = list_procedures(graph_id) except Exception as e: err(f"Failed to list procedures: {str(e)}") else: if not procedures: - info(f"No stored procedures found on {graph_name}.") + info(f"No stored procedures found on {graph_id}.") return specific_procedure_exist = False for procedure in procedures: - if identifier == procedure.name: + if identifier == procedure.id: info(yaml.dump(procedure.to_dict())) specific_procedure_exist = True break if not specific_procedure_exist: - err(f"Procedure {identifier} not found on {graph_name}.") + err(f"Procedure {identifier} not found on {graph_id}.") @use.command(name="GLOBAL") diff --git a/python/graphscope/gsctl/impl/__init__.py b/python/graphscope/gsctl/impl/__init__.py index 08bab8b9501f..af0c96ae23b5 100644 --- a/python/graphscope/gsctl/impl/__init__.py +++ b/python/graphscope/gsctl/impl/__init__.py @@ -16,45 +16,34 @@ # limitations under the License. # -from graphscope.gsctl.impl.alert import delete_alert_receiver_by_id -from graphscope.gsctl.impl.alert import delete_alert_rule_by_name -from graphscope.gsctl.impl.alert import list_alert_messages -from graphscope.gsctl.impl.alert import list_alert_receivers -from graphscope.gsctl.impl.alert import list_alert_rules -from graphscope.gsctl.impl.alert import register_receiver -from graphscope.gsctl.impl.alert import update_alert_messages -from graphscope.gsctl.impl.alert import update_alert_receiver_by_id -from graphscope.gsctl.impl.alert import update_alert_rule from graphscope.gsctl.impl.common import connect_coordinator from graphscope.gsctl.impl.common import disconnect_coordinator -from graphscope.gsctl.impl.datasource import get_datasource -from graphscope.gsctl.impl.datasource import import_datasource -from graphscope.gsctl.impl.datasource import unbind_edge_datasource -from graphscope.gsctl.impl.datasource import unbind_vertex_datasource -from graphscope.gsctl.impl.deployment import get_deployment_info -from graphscope.gsctl.impl.deployment import get_node_status -from graphscope.gsctl.impl.graph import create_edge_type + from graphscope.gsctl.impl.graph import create_graph -from graphscope.gsctl.impl.graph import create_vertex_type -from graphscope.gsctl.impl.graph import delete_edge_type -from graphscope.gsctl.impl.graph import delete_graph_by_name -from graphscope.gsctl.impl.graph import delete_vertex_type -from graphscope.gsctl.impl.graph import get_schema_by_name from graphscope.gsctl.impl.graph import list_graphs -from graphscope.gsctl.impl.job import create_dataloading_job -from graphscope.gsctl.impl.job import delete_job_by_id -from graphscope.gsctl.impl.job import get_dataloading_config -from graphscope.gsctl.impl.job import get_job_by_id -from graphscope.gsctl.impl.job import list_jobs -from graphscope.gsctl.impl.legacy import create_groot_dataloading_job -from graphscope.gsctl.impl.legacy import import_groot_schema -from graphscope.gsctl.impl.legacy import list_groot_graph -from graphscope.gsctl.impl.procedure import create_procedure -from graphscope.gsctl.impl.procedure import delete_procedure_by_name -from graphscope.gsctl.impl.procedure import list_procedures -from graphscope.gsctl.impl.procedure import update_procedure -from graphscope.gsctl.impl.service import get_service_status +from graphscope.gsctl.impl.graph import delete_graph_by_id + +from graphscope.gsctl.impl.service import get_service_status from graphscope.gsctl.impl.service import restart_service from graphscope.gsctl.impl.service import start_service from graphscope.gsctl.impl.service import stop_service + from graphscope.gsctl.impl.utils import switch_context +from graphscope.gsctl.impl.utils import upload_file +from graphscope.gsctl.impl.utils import get_graph_id_by_name + +from graphscope.gsctl.impl.procedure import create_procedure +from graphscope.gsctl.impl.procedure import list_procedures +from graphscope.gsctl.impl.procedure import delete_procedure_by_id +from graphscope.gsctl.impl.procedure import update_procedure_by_id +from graphscope.gsctl.impl.procedure import get_procedure_by_id + +from graphscope.gsctl.impl.datasource import bind_datasource_in_batch +from graphscope.gsctl.impl.datasource import get_datasource_by_id +from graphscope.gsctl.impl.datasource import unbind_edge_datasource +from graphscope.gsctl.impl.datasource import unbind_vertex_datasource + +from graphscope.gsctl.impl.job import submit_dataloading_job +from graphscope.gsctl.impl.job import list_jobs +from graphscope.gsctl.impl.job import delete_job_by_id +from graphscope.gsctl.impl.job import get_job_by_id diff --git a/python/graphscope/gsctl/impl/alert.py b/python/graphscope/gsctl/impl/alert.py deleted file mode 100644 index a8b746cec7a9..000000000000 --- a/python/graphscope/gsctl/impl/alert.py +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# -# Copyright 2024 Alibaba Group Holding Limited. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -from typing import List -from typing import Union - -import graphscope.flex.rest -from graphscope.flex.rest import AlertMessage -from graphscope.flex.rest import AlertReceiver -from graphscope.flex.rest import AlertRule -from graphscope.flex.rest import UpdateAlertMessagesRequest -from graphscope.gsctl.config import get_current_context - - -def list_alert_rules() -> List[AlertRule]: - context = get_current_context() - with graphscope.flex.rest.ApiClient( - graphscope.flex.rest.Configuration(context.coordinator_endpoint) - ) as api_client: - api_instance = graphscope.flex.rest.AlertApi(api_client) - return api_instance.list_alert_rules() - - -def update_alert_rule(rule: dict) -> str: - context = get_current_context() - with graphscope.flex.rest.ApiClient( - graphscope.flex.rest.Configuration(context.coordinator_endpoint) - ) as api_client: - name = rule["name"] - api_instance = graphscope.flex.rest.AlertApi(api_client) - return api_instance.update_alert_rule_by_name(name, AlertRule.from_dict(rule)) - - -def delete_alert_rule_by_name(rule_name: str) -> str: - context = get_current_context() - with graphscope.flex.rest.ApiClient( - graphscope.flex.rest.Configuration(context.coordinator_endpoint) - ) as api_client: - api_instance = graphscope.flex.rest.AlertApi(api_client) - return api_instance.delete_alert_rule_by_name(rule_name) - - -def list_alert_messages( - status: str, severity: str, starttime: str, endtime: str -) -> List[AlertMessage]: - context = get_current_context() - with graphscope.flex.rest.ApiClient( - graphscope.flex.rest.Configuration(context.coordinator_endpoint) - ) as api_client: - api_instance = graphscope.flex.rest.AlertApi(api_client) - return api_instance.list_alert_messages( - None, status, severity, starttime, endtime - ) - - -def update_alert_messages(request: dict) -> str: - context = get_current_context() - with graphscope.flex.rest.ApiClient( - graphscope.flex.rest.Configuration(context.coordinator_endpoint) - ) as api_client: - print(request) - api_instance = graphscope.flex.rest.AlertApi(api_client) - return api_instance.update_alert_messages( - UpdateAlertMessagesRequest.from_dict(request) - ) - - -def list_alert_receivers() -> List[AlertReceiver]: - context = get_current_context() - with graphscope.flex.rest.ApiClient( - graphscope.flex.rest.Configuration(context.coordinator_endpoint) - ) as api_client: - api_instance = graphscope.flex.rest.AlertApi(api_client) - return api_instance.list_receivers() - - -def register_receiver(receiver: dict) -> str: - context = get_current_context() - with graphscope.flex.rest.ApiClient( - graphscope.flex.rest.Configuration(context.coordinator_endpoint) - ) as api_client: - api_instance = graphscope.flex.rest.AlertApi(api_client) - return api_instance.register_receiver(AlertReceiver.from_dict(receiver)) - - -def update_alert_receiver_by_id(receiver_id: str, receiver: dict) -> str: - context = get_current_context() - with graphscope.flex.rest.ApiClient( - graphscope.flex.rest.Configuration(context.coordinator_endpoint) - ) as api_client: - api_instance = graphscope.flex.rest.AlertApi(api_client) - return api_instance.update_receiver_by_id( - receiver_id, AlertReceiver.from_dict(receiver) - ) - - -def delete_alert_receiver_by_id(receiver_id: str) -> str: - context = get_current_context() - with graphscope.flex.rest.ApiClient( - graphscope.flex.rest.Configuration(context.coordinator_endpoint) - ) as api_client: - api_instance = graphscope.flex.rest.AlertApi(api_client) - return api_instance.delete_receiver_by_id(receiver_id) diff --git a/python/graphscope/gsctl/impl/common.py b/python/graphscope/gsctl/impl/common.py index 8476e80cabcc..dd12342e14c1 100644 --- a/python/graphscope/gsctl/impl/common.py +++ b/python/graphscope/gsctl/impl/common.py @@ -19,29 +19,25 @@ from typing import Union import graphscope.flex.rest -from graphscope.flex.rest import ConnectionStatus +from graphscope.flex.rest import RunningDeploymentInfo from graphscope.gsctl.config import Context from graphscope.gsctl.config import load_gs_config -def connect_coordinator(coordinator_endpoint: str) -> ConnectionStatus: +def connect_coordinator(coordinator_endpoint: str) -> RunningDeploymentInfo: with graphscope.flex.rest.ApiClient( graphscope.flex.rest.Configuration(coordinator_endpoint) ) as api_client: - api_instance = graphscope.flex.rest.ConnectionApi(api_client) - connection = graphscope.flex.rest.Connection.from_dict( - {"coordinator_endpoint": coordinator_endpoint} - ) - connection_status = api_instance.connect(connection) + api_instance = graphscope.flex.rest.DeploymentApi(api_client) + deployment_info = api_instance.get_deployment_info() # coordinator connected, set the context - if connection_status.status == "CONNECTED": - context = Context( - flex=connection_status.solution, - coordinator_endpoint=coordinator_endpoint, - ) - config = load_gs_config() - config.set_and_write(context) - return connection_status + context = Context( + flex=deployment_info.solution, + coordinator_endpoint=coordinator_endpoint, + ) + config = load_gs_config() + config.set_and_write(context) + return deployment_info def disconnect_coordinator() -> Union[None, Context]: diff --git a/python/graphscope/gsctl/impl/datasource.py b/python/graphscope/gsctl/impl/datasource.py index 3d275128f3e9..c0c41ec697d4 100644 --- a/python/graphscope/gsctl/impl/datasource.py +++ b/python/graphscope/gsctl/impl/datasource.py @@ -16,61 +16,58 @@ # limitations under the License. # -import itertools import os -from typing import List +import itertools import graphscope.flex.rest -from graphscope.flex.rest import DataSource +from graphscope.flex.rest import SchemaMapping + from graphscope.gsctl.config import get_current_context from graphscope.gsctl.impl.utils import upload_file -def import_datasource(graph_name: str, datasource: dict) -> str: +def bind_datasource_in_batch(graph_identifier: str, datasource: dict) -> str: # upload files - for item in itertools.chain( - datasource["vertices_datasource"], datasource["edges_datasource"] + for mapping in itertools.chain( + datasource["vertex_mappings"], datasource["edge_mappings"] ): - location = item["location"] - if location.startswith("@"): - location = location[1:] - filename = os.path.basename(location) - with open(location, "rb") as f: - content = f.read() - path_after_uploaded = upload_file(filename, content, location) - item["location"] = path_after_uploaded - + for index, location in enumerate(mapping["inputs"]): + # path begin with "@" represents the local file + if location.startswith("@"): + location = location[1:] + mapping["inputs"][index] = upload_file(location) + # bind data source context = get_current_context() with graphscope.flex.rest.ApiClient( graphscope.flex.rest.Configuration(context.coordinator_endpoint) ) as api_client: - api_instance = graphscope.flex.rest.DatasourceApi(api_client) - return api_instance.import_datasource( - graph_name=graph_name, data_source=DataSource.from_dict(datasource) + api_instance = graphscope.flex.rest.DataSourceApi(api_client) + return api_instance.bind_datasource_in_batch( + graph_identifier, SchemaMapping.from_dict(datasource) ) -def get_datasource(graph_name: str) -> DataSource: +def get_datasource_by_id(graph_identifier: str) -> SchemaMapping: context = get_current_context() with graphscope.flex.rest.ApiClient( graphscope.flex.rest.Configuration(context.coordinator_endpoint) ) as api_client: - api_instance = graphscope.flex.rest.DatasourceApi(api_client) - return api_instance.get_datasource(graph_name) + api_instance = graphscope.flex.rest.DataSourceApi(api_client) + return api_instance.get_datasource_by_id(graph_identifier) -def unbind_vertex_datasource(graph_name: str, vertex_type: str) -> str: +def unbind_vertex_datasource(graph_identifier: str, vertex_type: str) -> str: context = get_current_context() with graphscope.flex.rest.ApiClient( graphscope.flex.rest.Configuration(context.coordinator_endpoint) ) as api_client: - api_instance = graphscope.flex.rest.DatasourceApi(api_client) - return api_instance.unbind_vertex_datasource(graph_name, vertex_type) + api_instance = graphscope.flex.rest.DataSourceApi(api_client) + return api_instance.unbind_vertex_datasource(graph_identifier, vertex_type) def unbind_edge_datasource( - graph_name: str, - edge_type: str, + graph_identifier: str, + vertex_type: str, source_vertex_type: str, destination_vertex_type: str, ) -> str: @@ -78,7 +75,7 @@ def unbind_edge_datasource( with graphscope.flex.rest.ApiClient( graphscope.flex.rest.Configuration(context.coordinator_endpoint) ) as api_client: - api_instance = graphscope.flex.rest.DatasourceApi(api_client) + api_instance = graphscope.flex.rest.DataSourceApi(api_client) return api_instance.unbind_edge_datasource( - graph_name, edge_type, source_vertex_type, destination_vertex_type + graph_identifier, vertex_type, source_vertex_type, destination_vertex_type ) diff --git a/python/graphscope/gsctl/impl/deployment.py b/python/graphscope/gsctl/impl/deployment.py deleted file mode 100644 index 2a089efa7b49..000000000000 --- a/python/graphscope/gsctl/impl/deployment.py +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# -# Copyright 2024 Alibaba Group Holding Limited. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -from typing import List - -import graphscope.flex.rest -from graphscope.flex.rest import DeploymentInfo -from graphscope.flex.rest import NodeStatus -from graphscope.gsctl.config import get_current_context - - -def get_node_status() -> List[NodeStatus]: - context = get_current_context() - with graphscope.flex.rest.ApiClient( - graphscope.flex.rest.Configuration(context.coordinator_endpoint) - ) as api_client: - api_instance = graphscope.flex.rest.DeploymentApi(api_client) - return api_instance.get_node_status() - - -def get_deployment_info() -> DeploymentInfo: - context = get_current_context() - with graphscope.flex.rest.ApiClient( - graphscope.flex.rest.Configuration(context.coordinator_endpoint) - ) as api_client: - api_instance = graphscope.flex.rest.DeploymentApi(api_client) - return api_instance.get_deployment_info() diff --git a/python/graphscope/gsctl/impl/graph.py b/python/graphscope/gsctl/impl/graph.py index 7355152b8db6..ed091986b3d1 100644 --- a/python/graphscope/gsctl/impl/graph.py +++ b/python/graphscope/gsctl/impl/graph.py @@ -19,14 +19,12 @@ from typing import List import graphscope.flex.rest -from graphscope.flex.rest import EdgeType -from graphscope.flex.rest import Graph -from graphscope.flex.rest import ModelSchema -from graphscope.flex.rest import VertexType +from graphscope.flex.rest import CreateGraphRequest +from graphscope.flex.rest import GetGraphResponse from graphscope.gsctl.config import get_current_context -def list_graphs() -> List[Graph]: +def list_graphs() -> List[GetGraphResponse]: context = get_current_context() with graphscope.flex.rest.ApiClient( graphscope.flex.rest.Configuration(context.coordinator_endpoint) @@ -36,72 +34,20 @@ def list_graphs() -> List[Graph]: return graphs -def get_schema_by_name(graph_name: str) -> ModelSchema: - context = get_current_context() - with graphscope.flex.rest.ApiClient( - graphscope.flex.rest.Configuration(context.coordinator_endpoint) - ) as api_client: - api_instance = graphscope.flex.rest.GraphApi(api_client) - schema = api_instance.get_schema(graph_name) - return schema - - def create_graph(graph: dict) -> str: context = get_current_context() with graphscope.flex.rest.ApiClient( graphscope.flex.rest.Configuration(context.coordinator_endpoint) ) as api_client: api_instance = graphscope.flex.rest.GraphApi(api_client) - return api_instance.create_graph(Graph.from_dict(graph)) - - -def delete_graph_by_name(graph_name: str) -> str: - context = get_current_context() - with graphscope.flex.rest.ApiClient( - graphscope.flex.rest.Configuration(context.coordinator_endpoint) - ) as api_client: - api_instance = graphscope.flex.rest.GraphApi(api_client) - return api_instance.delete_graph(graph_name) - - -def create_vertex_type(graph_name: str, vtype: dict) -> str: - context = get_current_context() - with graphscope.flex.rest.ApiClient( - graphscope.flex.rest.Configuration(context.coordinator_endpoint) - ) as api_client: - api_instance = graphscope.flex.rest.GraphApi(api_client) - return api_instance.create_vertex_type(graph_name, VertexType.from_dict(vtype)) - - -def create_edge_type(graph_name: str, etype: dict) -> str: - context = get_current_context() - with graphscope.flex.rest.ApiClient( - graphscope.flex.rest.Configuration(context.coordinator_endpoint) - ) as api_client: - api_instance = graphscope.flex.rest.GraphApi(api_client) - return api_instance.create_edge_type(graph_name, EdgeType.from_dict(etype)) - - -def delete_vertex_type(graph_name: str, vertex_type: str) -> str: - context = get_current_context() - with graphscope.flex.rest.ApiClient( - graphscope.flex.rest.Configuration(context.coordinator_endpoint) - ) as api_client: - api_instance = graphscope.flex.rest.GraphApi(api_client) - return api_instance.delete_vertex_type(graph_name, vertex_type) + response = api_instance.create_graph(CreateGraphRequest.from_dict(graph)) + return response.graph_id -def delete_edge_type( - graph_name: str, - edge_type: str, - source_vertex_type: str, - destination_vertex_type: str, -) -> str: +def delete_graph_by_id(graph_identifier: str) -> str: context = get_current_context() with graphscope.flex.rest.ApiClient( graphscope.flex.rest.Configuration(context.coordinator_endpoint) ) as api_client: api_instance = graphscope.flex.rest.GraphApi(api_client) - return api_instance.delete_edge_type( - graph_name, edge_type, source_vertex_type, destination_vertex_type - ) + return api_instance.delete_graph_by_id(graph_identifier) diff --git a/python/graphscope/gsctl/impl/job.py b/python/graphscope/gsctl/impl/job.py index 2b9ebd0a7406..0eb7ee027a66 100644 --- a/python/graphscope/gsctl/impl/job.py +++ b/python/graphscope/gsctl/impl/job.py @@ -16,75 +16,48 @@ # limitations under the License. # -import itertools -import os from typing import List import graphscope.flex.rest +from graphscope.flex.rest import DataloadingJobConfig from graphscope.flex.rest import JobStatus -from graphscope.flex.rest import SchemaMapping from graphscope.gsctl.config import get_current_context -from graphscope.gsctl.impl.utils import upload_file -def list_jobs() -> List[JobStatus]: +def submit_dataloading_job(graph_identifier: str, config: dict) -> str: context = get_current_context() with graphscope.flex.rest.ApiClient( graphscope.flex.rest.Configuration(context.coordinator_endpoint) ) as api_client: api_instance = graphscope.flex.rest.JobApi(api_client) - jobs = api_instance.list_jobs() - return jobs - - -def get_job_by_id(job_id: str) -> JobStatus: - context = get_current_context() - with graphscope.flex.rest.ApiClient( - graphscope.flex.rest.Configuration(context.coordinator_endpoint) - ) as api_client: - api_instance = graphscope.flex.rest.JobApi(api_client) - job = api_instance.get_job_by_id(job_id) - return job + response = api_instance.submit_dataloading_job( + graph_identifier, DataloadingJobConfig.from_dict(config) + ) + return response.job_id -def create_dataloading_job(graph_name: str, job_config: dict) -> str: - # upload files - for mapping in itertools.chain( - job_config["vertex_mappings"], job_config["edge_mappings"] - ): - for index, location in enumerate(mapping["inputs"]): - # path begin with "@" represents the local file - if location.startswith("@"): - location = location[1:] - filename = os.path.basename(location) - with open(location, "rb") as f: - content = f.read() - path_after_uploaded = upload_file(filename, content, location) - mapping["inputs"][index] = path_after_uploaded - # create job +def list_jobs() -> List[JobStatus]: context = get_current_context() with graphscope.flex.rest.ApiClient( graphscope.flex.rest.Configuration(context.coordinator_endpoint) ) as api_client: api_instance = graphscope.flex.rest.JobApi(api_client) - return api_instance.create_dataloading_job( - graph_name, SchemaMapping.from_dict(job_config) - ) + return api_instance.list_jobs() -def get_dataloading_config(graph_name: str) -> SchemaMapping: +def delete_job_by_id(job_identifier: str) -> str: context = get_current_context() with graphscope.flex.rest.ApiClient( graphscope.flex.rest.Configuration(context.coordinator_endpoint) ) as api_client: api_instance = graphscope.flex.rest.JobApi(api_client) - return api_instance.get_dataloading_config(graph_name) + return api_instance.delete_job_by_id(job_identifier) -def delete_job_by_id(job_id: str) -> str: +def get_job_by_id(job_identifier: str) -> JobStatus: context = get_current_context() with graphscope.flex.rest.ApiClient( graphscope.flex.rest.Configuration(context.coordinator_endpoint) ) as api_client: api_instance = graphscope.flex.rest.JobApi(api_client) - return api_instance.delete_job_by_id(job_id) + return api_instance.get_job_by_id(job_identifier) diff --git a/python/graphscope/gsctl/impl/legacy.py b/python/graphscope/gsctl/impl/legacy.py deleted file mode 100644 index 8815aec7862a..000000000000 --- a/python/graphscope/gsctl/impl/legacy.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# -# Copyright 2024 Alibaba Group Holding Limited. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -from typing import List - -import graphscope.flex.rest -from graphscope.flex.rest import GrootDataloadingJobConfig -from graphscope.flex.rest import GrootGraph -from graphscope.flex.rest import GrootSchema -from graphscope.gsctl.config import get_current_context - - -def list_groot_graph() -> List[GrootGraph]: - context = get_current_context() - with graphscope.flex.rest.ApiClient( - graphscope.flex.rest.Configuration(context.coordinator_endpoint) - ) as api_client: - api_instance = graphscope.flex.rest.LegacyApi(api_client) - return api_instance.list_groot_graph() - - -def import_groot_schema(graph_name: str, schema: dict) -> str: - context = get_current_context() - with graphscope.flex.rest.ApiClient( - graphscope.flex.rest.Configuration(context.coordinator_endpoint) - ) as api_client: - api_instance = graphscope.flex.rest.LegacyApi(api_client) - return api_instance.import_groot_schema( - graph_name, GrootSchema.from_dict(schema) - ) - - -def create_groot_dataloading_job(graph_name: str, job_config: dict) -> str: - context = get_current_context() - with graphscope.flex.rest.ApiClient( - graphscope.flex.rest.Configuration(context.coordinator_endpoint) - ) as api_client: - api_instance = graphscope.flex.rest.LegacyApi(api_client) - return api_instance.create_groot_dataloading_job( - graph_name, GrootDataloadingJobConfig.from_dict(job_config) - ) diff --git a/python/graphscope/gsctl/impl/procedure.py b/python/graphscope/gsctl/impl/procedure.py index 5361a23ba1cb..cc885a6147a4 100644 --- a/python/graphscope/gsctl/impl/procedure.py +++ b/python/graphscope/gsctl/impl/procedure.py @@ -17,51 +17,67 @@ # from typing import List -from typing import Union import graphscope.flex.rest -from graphscope.flex.rest import Procedure +from graphscope.flex.rest import CreateProcedureRequest +from graphscope.flex.rest import GetProcedureResponse +from graphscope.flex.rest import UpdateProcedureRequest from graphscope.gsctl.config import get_current_context -def create_procedure(graph_name: str, procedure: dict) -> str: +def create_procedure(graph_identifier: str, procedure: dict) -> str: context = get_current_context() with graphscope.flex.rest.ApiClient( graphscope.flex.rest.Configuration(context.coordinator_endpoint) ) as api_client: api_instance = graphscope.flex.rest.ProcedureApi(api_client) - return api_instance.create_procedure(graph_name, Procedure.from_dict(procedure)) + response = api_instance.create_procedure( + graph_identifier, CreateProcedureRequest.from_dict(procedure) + ) + return response.procedure_id -def list_procedures(graph_name: Union[None, str]) -> List[Procedure]: +def list_procedures(graph_identifier: str) -> List[GetProcedureResponse]: context = get_current_context() with graphscope.flex.rest.ApiClient( graphscope.flex.rest.Configuration(context.coordinator_endpoint) ) as api_client: api_instance = graphscope.flex.rest.ProcedureApi(api_client) - if graph_name is None: - procedures = api_instance.list_procedures() - else: - procedures = api_instance.list_procedures_by_graph(graph_name) - return procedures + return api_instance.list_procedures(graph_identifier) -def update_procedure(graph_name: str, procedure: dict) -> str: +def delete_procedure_by_id(graph_identifier: str, procedure_identifier: str) -> str: context = get_current_context() with graphscope.flex.rest.ApiClient( graphscope.flex.rest.Configuration(context.coordinator_endpoint) ) as api_client: - procedure_name = procedure["name"] api_instance = graphscope.flex.rest.ProcedureApi(api_client) - return api_instance.update_procedure( - graph_name, procedure_name, Procedure.from_dict(procedure) + return api_instance.delete_procedure_by_id( + graph_identifier, procedure_identifier ) -def delete_procedure_by_name(graph_name: str, procedure_name: str) -> str: +def get_procedure_by_id( + graph_identifier: str, procedure_identifier: str +) -> GetProcedureResponse: context = get_current_context() with graphscope.flex.rest.ApiClient( graphscope.flex.rest.Configuration(context.coordinator_endpoint) ) as api_client: api_instance = graphscope.flex.rest.ProcedureApi(api_client) - return api_instance.delete_procedure(graph_name, procedure_name) + return api_instance.get_procedure_by_id(graph_identifier, procedure_identifier) + + +def update_procedure_by_id( + graph_identifier: str, procedure_identifier: str, procedure: dict +) -> str: + context = get_current_context() + with graphscope.flex.rest.ApiClient( + graphscope.flex.rest.Configuration(context.coordinator_endpoint) + ) as api_client: + api_instance = graphscope.flex.rest.ProcedureApi(api_client) + return api_instance.update_procedure_by_id( + graph_identifier, + procedure_identifier, + UpdateProcedureRequest.from_dict(procedure), + ) diff --git a/python/graphscope/gsctl/impl/service.py b/python/graphscope/gsctl/impl/service.py index 864b553e96c3..5b3352de533a 100644 --- a/python/graphscope/gsctl/impl/service.py +++ b/python/graphscope/gsctl/impl/service.py @@ -31,14 +31,14 @@ def get_service_status() -> ServiceStatus: return api_instance.get_service_status() -def start_service(graph_name: str) -> str: +def start_service(graph_identifier: str) -> str: context = get_current_context() with graphscope.flex.rest.ApiClient( graphscope.flex.rest.Configuration(context.coordinator_endpoint) ) as api_client: api_instance = graphscope.flex.rest.ServiceApi(api_client) return api_instance.start_service( - StartServiceRequest.from_dict({"graph_name": graph_name}) + StartServiceRequest.from_dict({"graph_id": graph_identifier}) ) diff --git a/python/graphscope/gsctl/impl/utils.py b/python/graphscope/gsctl/impl/utils.py index fe52b8c383cb..1b34f0ef8e8f 100644 --- a/python/graphscope/gsctl/impl/utils.py +++ b/python/graphscope/gsctl/impl/utils.py @@ -17,17 +17,18 @@ # import graphscope.flex.rest +from graphscope.gsctl.impl import list_graphs from graphscope.gsctl.config import get_current_context from graphscope.gsctl.config import load_gs_config -def upload_file(filename: str, content: bytes, location: str) -> str: +def upload_file(location: str) -> str: context = get_current_context() with graphscope.flex.rest.ApiClient( graphscope.flex.rest.Configuration(context.coordinator_endpoint) ) as api_client: api_instance = graphscope.flex.rest.UtilsApi(api_client) - return api_instance.upload_file(location) + return api_instance.upload_file(location).file_path def switch_context(context: str): @@ -35,3 +36,23 @@ def switch_context(context: str): current_context = get_current_context() current_context.switch_context(context) config.update_and_write(current_context) + + +def get_graph_id_by_name(name_or_id: str): + graphs = list_graphs() + id_candidate = [] + graph_exist = False + for g in graphs: + if name_or_id == g.id: + return name_or_id + if name_or_id == g.name: + id_candidate.append(g.id) + if not id_candidate: + raise RuntimeError( + f"Graph '{name_or_id}' not exists, see graph information with `ls` command." + ) + if len(id_candidate) > 1: + raise RuntimeError( + f"Found multiple id candidates {id_candidate} for graph {name_or_id}, please choose one." + ) + return id_candidate[0] diff --git a/python/graphscope/gsctl/utils.py b/python/graphscope/gsctl/utils.py index 460de4df3b72..47d0207a38b3 100644 --- a/python/graphscope/gsctl/utils.py +++ b/python/graphscope/gsctl/utils.py @@ -23,6 +23,9 @@ from treelib import Node from treelib import Tree +from graphscope.flex.rest import PrimitiveType +from graphscope.flex.rest import StringType + def read_yaml_file(path) -> dict: """Reads YAML file and returns as a python object.""" @@ -83,6 +86,15 @@ def __init__(self): self.root_identifier = "GRAPH" self.tree.create_node(identifier=self.root_identifier) + def parse_property_type(self, property): + actual_instance = property.actual_instance + if isinstance(actual_instance, PrimitiveType): + return actual_instance.primitive_type + elif isinstance(actual_instance, StringType): + return "string" + else: + return str(actual_instance) + def create_graph_node_for_groot(self, graph, recursive=True): # graph name must be unique self.tree.create_node( @@ -156,30 +168,32 @@ def create_schema_node_for_groot(self, graph): def create_graph_node(self, graph, recursive=True): # graph name must be unique self.tree.create_node( - tag=f"identifier: {graph.name}", - identifier=graph.name, + tag=f"{graph.name}(identifier: {graph.id})", + identifier=graph.id, parent=self.root_identifier, ) if recursive: self.create_schema_node(graph) def create_schema_node(self, graph): - schema_identifier = f"{graph.name}_schema" + schema_identifier = f"{graph.id}_schema" self.tree.create_node( - tag="schema", identifier=schema_identifier, parent=graph.name + tag="schema", identifier=schema_identifier, parent=graph.id ) # vertex type + vertex_type_identifier = f"{schema_identifier}_vertex_types" self.tree.create_node( tag="vertex types", - identifier=f"{schema_identifier}_vertex_types", + identifier=vertex_type_identifier, parent=schema_identifier, ) if graph.var_schema is not None and graph.var_schema.vertex_types is not None: for vertex in graph.var_schema.vertex_types: + vertex_identifier = f"{vertex_type_identifier}_{vertex.type_name}" self.tree.create_node( tag=f"{vertex.type_name}", - identifier=f"{graph.name}_{vertex.type_name}", - parent=f"{schema_identifier}_vertex_types", + identifier=vertex_identifier, + parent=vertex_type_identifier, ) # property if vertex.properties is not None: @@ -187,23 +201,22 @@ def create_schema_node(self, graph): is_primary_key = ( True if p.property_name in vertex.primary_keys else False ) - identifier = ( - f"{graph.name}_{vertex.type_name}_{p.property_name}" - ) + property_identifier = f"{vertex_identifier}_{p.property_name}" tag = "Property(name: {0}, type: {1}, is_primary_key: {2})".format( p.property_name, - p.property_type.primitive_type, + self.parse_property_type(p.property_type), is_primary_key, ) self.tree.create_node( tag=tag, - identifier=identifier, - parent=f"{graph.name}_{vertex.type_name}", + identifier=property_identifier, + parent=vertex_identifier, ) # edge type + edge_type_identifier = f"{schema_identifier}_edge_types" self.tree.create_node( tag="edge types", - identifier=f"{schema_identifier}_edge_types", + identifier=edge_type_identifier, parent=schema_identifier, ) if graph.var_schema is not None and graph.var_schema.edge_types is not None: @@ -214,55 +227,61 @@ def create_schema_node(self, graph): edge.type_name, relation.destination_vertex, ) + edge_identifier = f"{edge_type_identifier}_{edge_label}" self.tree.create_node( tag=f"{edge_label}", - identifier=f"{graph.name}_{edge_label}", - parent=f"{schema_identifier}_edge_types", + identifier=edge_identifier, + parent=edge_type_identifier, ) if edge.properties is not None: for p in edge.properties: - identifier = f"{graph.name}_{edge_label}_{p.property_name}" + is_primary_key = ( + True if p.property_name in edge.primary_keys else False + ) + property_identifier = f"{edge_identifier}_{p.property_name}" tag = "Property(name: {0}, type: {1}, is_primary_key: {2})".format( - p.property_name, p.property_type.primitive_type, False + p.property_name, + self.parse_property_type(p.property_type), + is_primary_key, ) self.tree.create_node( tag=tag, - identifier=identifier, - parent=f"{graph.name}_{edge_label}", + identifier=property_identifier, + parent=edge_identifier, ) def create_procedure_node(self, graph, procedures): - procedure_identifier = f"{graph.name}_procedure" + procedure_identifier = f"{graph.id}_procedure" self.tree.create_node( - tag="stored procedure", identifier=procedure_identifier, parent=graph.name + tag="stored procedure", identifier=procedure_identifier, parent=graph.id ) for p in procedures: self.tree.create_node( tag="Procedure(identifier: {0}, type: {1}, runnable: {2}, query: {3}, description: {4})".format( - p.name, p.type, p.runnable, p.query, p.description + p.id, p.type, p.runnable, p.query, p.description ), - identifier=f"{procedure_identifier}_{p.name}", + identifier=f"{procedure_identifier}_{p.id}", parent=procedure_identifier, ) def create_job_node(self, graph, jobs): - job_identifier = f"{graph.name}_job" - self.tree.create_node(tag="job", identifier=job_identifier, parent=graph.name) + job_identifier = f"{graph.id}_job" + self.tree.create_node(tag="job", identifier=job_identifier, parent=graph.id) for j in jobs: - if j.detail["graph_name"] != graph.name: + if j.detail["graph_id"] != graph.id: continue self.tree.create_node( tag="Job(identifier: {0}, type: {1}, status: {2}, start time: {3}, end time: {4})".format( - j.job_id, j.type, j.status, j.start_time, str(j.end_time) + j.id, j.type, j.status, j.start_time, str(j.end_time) ), - identifier=f"{job_identifier}_{j.job_id}", + identifier=f"{job_identifier}_{j.id}", parent=job_identifier, ) def create_datasource_node(self, graph, datasource): - datasource_identifier = f"{graph.name}_datasource" + datasource_identifier = f"{graph.id}_datasource" self.tree.create_node( - tag="data sources", identifier=datasource_identifier, parent=graph.name + tag="data sources", identifier=datasource_identifier, parent=graph.id ) # vertex mappings self.tree.create_node( @@ -351,32 +370,27 @@ def create_datasource_node(self, graph, datasource): parent=f"{datasource_identifier}_{edge_label}", ) - def create_datasource_node_for_interactive(self, graph, job_config): - """Create data source from job configuration""" - - def _get_vertex_primary_key(graph): - rlt = {} - for vertex in graph.var_schema.vertex_types: - rlt[vertex.type_name] = vertex.primary_keys[0] - return rlt - - datasource_identifier = f"{graph.name}_datasource" + def create_datasource_mapping_node(self, graph, datasource_mapping): + datasource_identifier = f"{graph.id}_datasource" self.tree.create_node( - tag="data sources", identifier=datasource_identifier, parent=graph.name + tag="data sources", identifier=datasource_identifier, parent=graph.id ) - vertex_type_2_primary_key = _get_vertex_primary_key(graph) # vertex mapping + vertex_mapping_identifier = f"{datasource_identifier}_vertex_mappings" self.tree.create_node( tag="vertex mappings", - identifier=f"{datasource_identifier}_vertex_mappings", + identifier=vertex_mapping_identifier, parent=datasource_identifier, ) - if job_config.vertex_mappings is not None: - for mapping in job_config.vertex_mappings: + if datasource_mapping.vertex_mappings is not None: + for mapping in datasource_mapping.vertex_mappings: + specific_vertex_mapping_identifier = ( + f"{vertex_mapping_identifier}_{mapping.type_name}" + ) self.tree.create_node( tag=f"{mapping.type_name}(input: {mapping.inputs[0]})", - identifier=f"{datasource_identifier}_{mapping.type_name}", - parent=f"{datasource_identifier}_vertex_mappings", + identifier=specific_vertex_mapping_identifier, + parent=vertex_mapping_identifier, ) for property_column_mapping in mapping.column_mappings: tag = "Property(name: {0}) -> DataSourceColumn(index: {1}, name: {2})".format( @@ -384,48 +398,47 @@ def _get_vertex_primary_key(graph): property_column_mapping.column.index, property_column_mapping.column.name, ) - identifier = f"{datasource_identifier}_{mapping.type_name}_{property_column_mapping.var_property}" + property_mapping_identifier = f"{specific_vertex_mapping_identifier}_{property_column_mapping.var_property}" self.tree.create_node( tag=tag, - identifier=identifier, - parent=f"{datasource_identifier}_{mapping.type_name}", + identifier=property_mapping_identifier, + parent=specific_vertex_mapping_identifier, ) # edge mapping + edge_mapping_identifier = f"{datasource_identifier}_edge_mappings" self.tree.create_node( tag="edge mappings", - identifier=f"{datasource_identifier}_edge_mappings", + identifier=edge_mapping_identifier, parent=datasource_identifier, ) - if job_config.edge_mappings is not None: - for mapping in job_config.edge_mappings: + if datasource_mapping.edge_mappings is not None: + for mapping in datasource_mapping.edge_mappings: edge_label = "({0}) -[{1}]-> ({2})".format( mapping.type_triplet.source_vertex, mapping.type_triplet.edge, mapping.type_triplet.destination_vertex, ) + specific_edge_mapping_identifier = ( + f"{edge_mapping_identifier}_{edge_label}" + ) self.tree.create_node( tag=f"{edge_label}(input: {mapping.inputs[0]})", - identifier=f"{datasource_identifier}_{edge_label}", - parent=f"{datasource_identifier}_edge_mappings", + identifier=specific_edge_mapping_identifier, + parent=edge_mapping_identifier, ) # source vertex mapping for source_vertex_column_mapping in mapping.source_vertex_mappings: self.tree.create_node( tag="SourceVertexPrimaryKey(name: {0}) -> DataSourceColumn(index: {1}, name: {2})".format( - vertex_type_2_primary_key[ - mapping.type_triplet.source_vertex - ], + source_vertex_column_mapping.var_property, source_vertex_column_mapping.column.index, source_vertex_column_mapping.column.name, ), - identifier="{0}_{1}_source_vertex_primary_key_{2}".format( - datasource_identifier, - edge_label, - vertex_type_2_primary_key[ - mapping.type_triplet.source_vertex - ], + identifier="{0}_source_vertex_primary_key_{1}".format( + specific_edge_mapping_identifier, + source_vertex_column_mapping.var_property, ), - parent=f"{datasource_identifier}_{edge_label}", + parent=specific_edge_mapping_identifier, ) # destination vertex mapping for ( @@ -433,20 +446,15 @@ def _get_vertex_primary_key(graph): ) in mapping.destination_vertex_mappings: self.tree.create_node( tag="DestinationVertexPrimaryKey(name: {0}) -> DataSourceColumn(index: {1}, name: {2})".format( - vertex_type_2_primary_key[ - mapping.type_triplet.destination_vertex - ], + destination_vertex_column_mapping.var_property, destination_vertex_column_mapping.column.index, destination_vertex_column_mapping.column.name, ), - identifier="{0}_{1}_destination_vertex_primary_key_{2}".format( - datasource_identifier, - edge_label, - vertex_type_2_primary_key[ - mapping.type_triplet.destination_vertex - ], + identifier="{0}_destination_vertex_primary_key_{1}".format( + specific_edge_mapping_identifier, + destination_vertex_column_mapping.var_property, ), - parent=f"{datasource_identifier}_{edge_label}", + parent=specific_edge_mapping_identifier, ) # property mapping for property_column_mapping in mapping.column_mappings: @@ -455,11 +463,11 @@ def _get_vertex_primary_key(graph): property_column_mapping.column.index, property_column_mapping.column.name, ) - identifier = f"{datasource_identifier}_{edge_label}_{property_column_mapping.var_property}" + property_mapping_identifier = f"{specific_edge_mapping_identifier}_{property_column_mapping.var_property}" self.tree.create_node( tag=tag, - identifier=identifier, - parent=f"{datasource_identifier}_{edge_label}", + identifier=property_mapping_identifier, + parent=specific_edge_mapping_identifier, ) def show(self, graph_identifier=None, stdout=False, sorting=False): diff --git a/python/graphscope/gsctl/commands/insight/__init__.py b/python/graphscope/tests/flex/__init__.py similarity index 100% rename from python/graphscope/gsctl/commands/insight/__init__.py rename to python/graphscope/tests/flex/__init__.py diff --git a/python/graphscope/tests/flex/test_interactive.py b/python/graphscope/tests/flex/test_interactive.py new file mode 100644 index 000000000000..8bdad35923f6 --- /dev/null +++ b/python/graphscope/tests/flex/test_interactive.py @@ -0,0 +1,351 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Copyright 2020 Alibaba Group Holding Limited. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import warnings + +# Disable warnings +warnings.filterwarnings("ignore", category=Warning) + +import time +import pytest + +from click.testing import CliRunner + +from graphscope.gsctl.impl import connect_coordinator +from graphscope.gsctl.impl import disconnect_coordinator + +from graphscope.gsctl.impl import create_graph +from graphscope.gsctl.impl import delete_graph_by_id +from graphscope.gsctl.impl import list_graphs + +from graphscope.gsctl.impl import get_service_status +from graphscope.gsctl.impl import restart_service +from graphscope.gsctl.impl import start_service +from graphscope.gsctl.impl import stop_service + +from graphscope.gsctl.impl import create_procedure +from graphscope.gsctl.impl import list_procedures +from graphscope.gsctl.impl import delete_procedure_by_id +from graphscope.gsctl.impl import update_procedure_by_id +from graphscope.gsctl.impl import get_procedure_by_id + +from graphscope.gsctl.impl import bind_datasource_in_batch +from graphscope.gsctl.impl import get_datasource_by_id +from graphscope.gsctl.impl import unbind_edge_datasource +from graphscope.gsctl.impl import unbind_vertex_datasource + +from graphscope.gsctl.impl import submit_dataloading_job +from graphscope.gsctl.impl import get_job_by_id + +from graphscope.gsctl.impl import upload_file + + +COORDINATOR_ENDPOINT = "http://127.0.0.1:8080" + + +modern_graph = { + "name": "modern_graph", + "description": "This is a test graph", + "schema": { + "vertex_types": [ + { + "type_name": "person", + "properties": [ + { + "property_name": "id", + "property_type": {"primitive_type": "DT_SIGNED_INT64"}, + }, + { + "property_name": "name", + "property_type": {"string": {"long_text": ""}}, + }, + { + "property_name": "age", + "property_type": {"primitive_type": "DT_SIGNED_INT32"}, + }, + ], + "primary_keys": ["id"], + } + ], + "edge_types": [ + { + "type_name": "knows", + "vertex_type_pair_relations": [ + { + "source_vertex": "person", + "destination_vertex": "person", + "relation": "MANY_TO_MANY", + } + ], + "properties": [ + { + "property_name": "weight", + "property_type": {"primitive_type": "DT_DOUBLE"}, + } + ], + "primary_keys": [], + } + ], + }, +} + + +modern_graph_datasource = { + "vertex_mappings": [ + { + "type_name": "person", + "inputs": ["@/home/graphscope/alibaba/test/interative/person.csv"], + "column_mappings": [ + {"column": {"index": 0, "name": "id"}, "property": "id"}, + {"column": {"index": 1, "name": "name"}, "property": "name"}, + {"column": {"index": 2, "name": "age"}, "property": "age"}, + ], + } + ], + "edge_mappings": [ + { + "type_triplet": { + "edge": "knows", + "source_vertex": "person", + "destination_vertex": "person", + }, + "inputs": [ + "@/home/graphscope/alibaba/test/interative/person_knows_person.csv" + ], + "source_vertex_mappings": [ + {"column": {"index": 0, "name": "person.id"}, "property": "id"} + ], + "destination_vertex_mappings": [ + {"column": {"index": 1, "name": "person.id"}, "property": "id"} + ], + "column_mappings": [ + {"column": {"index": 2, "name": "weight"}, "property": "weight"} + ], + } + ], +} + + +person_csv_content = "id|name|age\n1|marko|29\n2|vadas|27\n4|josh|32\n6|peter|35" +person_knows_person_csv_content = "person.id|person.id|weight\n1|2|0.5\n1|4|1.0" + + +class TestE2EInteractive(object): + def setup_class(self): + self.deployment_info = connect_coordinator(COORDINATOR_ENDPOINT) + + def test_deployment_info(self): + assert self.deployment_info.instance_name == "demo" + assert self.deployment_info.cluster_type == "HOSTS" + assert self.deployment_info.solution == "INTERACTIVE" + assert self.deployment_info.version is not None + assert self.deployment_info.creation_time is not None + + def test_graph(self): + # test create a new graph + graph_id = create_graph(modern_graph) + assert graph_id is not None + new_graph_exist = False + graphs = list_graphs() + for g in graphs: + if g.name == "modern_graph" and g.id == graph_id: + new_graph_exist = True + assert new_graph_exist + # test delete a graph by id + delete_graph_by_id(graph_id) + new_graph_exist = False + graphs = list_graphs() + for g in graphs: + if g.name == "modern_graph" and g.id == graph_id: + new_graph_exist = True + assert not new_graph_exist + + def test_bulk_loading(self, tmpdir): + # person + person = tmpdir.join("person.csv") + person.write("id|name|age\n1|marko|29\n2|vadas|27\n4|josh|32\n6|peter|35") + # person -> knows -> person + person_knows_person = tmpdir.join("person_knows_person.csv") + person_knows_person.write("person.id|person.id|weight\n1|2|0.5\n1|4|1.0") + # data source mapping + datasource = { + "vertex_mappings": [ + { + "type_name": "person", + "inputs": [upload_file(str(person))], + "column_mappings": [ + {"column": {"index": 0, "name": "id"}, "property": "id"}, + {"column": {"index": 1, "name": "name"}, "property": "name"}, + {"column": {"index": 2, "name": "age"}, "property": "age"}, + ], + } + ], + "edge_mappings": [ + { + "type_triplet": { + "edge": "knows", + "source_vertex": "person", + "destination_vertex": "person", + }, + "inputs": [upload_file(str(person_knows_person))], + "source_vertex_mappings": [ + {"column": {"index": 0, "name": "person.id"}, "property": "id"} + ], + "destination_vertex_mappings": [ + {"column": {"index": 1, "name": "person.id"}, "property": "id"} + ], + "column_mappings": [ + {"column": {"index": 2, "name": "weight"}, "property": "weight"} + ], + } + ], + } + # test bind data source + graph_id = create_graph(modern_graph) + bind_datasource_in_batch(graph_id, datasource) + ds = get_datasource_by_id(graph_id) + assert ds.to_dict() == datasource + # test bulk loading + job_config = { + "loading_config": { + "import_option": "overwrite", + "format": { + "type": "csv", + "metadata": { + "delimiter": "|", + "header_row": "true", + }, + }, + }, + "vertices": [ + { + "type_name": "person" + }, + ], + "edges": [ + { + "type_name": "knows", + "source_vertex": "person", + "destination_vertex": "person", + }, + ], + } + job_id = submit_dataloading_job(graph_id, job_config) + start_time = time.time() + # waiting for 30s + while True: + time.sleep(1) + status = get_job_by_id(job_id) + if status.status == "SUCCESS": + assert status.id == job_id + assert status.start_time is not None + assert status.end_time is not None + assert status.log is not None + assert status.detail is not None + break + if time.time() - start_time > 30: + raise TimeoutError(f"Waiting timeout for loading job {job_id}") + # test unbind data source + unbind_vertex_datasource(graph_id, "person") + unbind_edge_datasource(graph_id, "knows", "person", "person") + ds = get_datasource_by_id(graph_id).to_dict() + assert not ds["vertex_mappings"] + assert not ds["edge_mappings"] + delete_graph_by_id(graph_id) + + def test_procedure(self): + procedure_dict = { + "name": "procedure_name", + "description": "This is a test procedure", + "query": "MATCH (n) RETURN COUNT(n);", + "type": "cypher", + } + # test create a new procedure + graph_id = create_graph(modern_graph) + procedure_id = create_procedure(graph_id, procedure_dict) + assert procedure_id is not None + new_procedure_exist = False + procedures = list_procedures(graph_id) + for p in procedures: + if p.id == procedure_id and p.name == "procedure_name": + new_procedure_exist = True + assert new_procedure_exist + # test update a procedure + description = "This is an updated description" + update_procedure_by_id(graph_id, procedure_id, {"description": description}) + procedure = get_procedure_by_id(graph_id, procedure_id) + assert procedure.description == description + # test delete a procedure + delete_procedure_by_id(graph_id, procedure_id) + new_procedure_exist = False + procedures = list_procedures(graph_id) + for p in procedures: + if p.id == procedure_id and p.name == "procedure_name": + new_procedure_exist = True + assert not new_procedure_exist + delete_graph_by_id(graph_id) + + def test_service(self): + status = get_service_status() + original_graph_id = status.graph.id + assert status.status == "Running" + # start service on a new graph + new_graph_id = create_graph(modern_graph) + start_service(new_graph_id) + status = get_service_status() + assert status.status == "Running" + assert status.graph.id == new_graph_id + # restart the service + restart_service() + status = get_service_status() + assert status.status == "Running" + assert status.graph.id == new_graph_id + # stop the service + stop_service() + status = get_service_status() + assert status.status == "Stopped" + # delete graph and switch to original graph + delete_graph_by_id(new_graph_id) + start_service(original_graph_id) + status = get_service_status() + assert status.status == "Running" + assert status.graph.id == original_graph_id + + def test_suit_case(self): + # case 1: + # during deleting a graph, make sure the stored procedures + # on that graph are deleted at the same time + procedure_dict = { + "name": "procedure_name", + "description": "This is a test procedure", + "query": "MATCH (n) RETURN COUNT(n);", + "type": "cypher", + } + graph_id = create_graph(modern_graph) + graph_id_2 = create_graph(modern_graph) + # create a procedure on graph 1 + procedure_id = create_procedure(graph_id, procedure_dict) + assert procedure_id == "procedure_name" + # delete the graph 1, then create a new procedure on graph 2 + delete_graph_by_id(graph_id) + procedure_id = create_procedure(graph_id_2, procedure_dict) + assert procedure_id == "procedure_name" + delete_graph_by_id(graph_id_2) + + def teardown_class(self): + disconnect_coordinator() From 40b2c376b5476280c19312b4dcec2992fe0f25a8 Mon Sep 17 00:00:00 2001 From: Dongze Li Date: Thu, 16 May 2024 16:48:02 +0800 Subject: [PATCH 02/15] Code format --- .../gs_flex_coordinator/core/__init__.py | 4 +- .../core/alert/alert_manager.py | 21 +- .../core/alert/alert_rule.py | 6 +- .../core/alert/builtin_rules.py | 6 +- .../core/alert/message_collector.py | 10 +- .../core/client_wrapper.py | 259 +++++-------- .../gs_flex_coordinator/core/config.py | 6 +- .../gs_flex_coordinator/core/datasource.py | 8 +- .../gs_flex_coordinator/core/insight/graph.py | 35 +- .../gs_flex_coordinator/core/insight/groot.py | 362 ------------------ .../gs_flex_coordinator/core/insight/job.py | 23 +- .../core/interactive/hqps.py | 123 ++++-- .../gs_flex_coordinator/core/scheduler.py | 31 +- .../core/stoppable_thread.py | 2 +- flex/coordinator/pyproject.toml | 2 + flex/coordinator/requirements.txt | 2 +- flex/coordinator/setup.cfg | 8 + flex/coordinator/setup.py | 42 ++ python/graphscope/gsctl/commands/__init__.py | 1 + .../gsctl/commands/interactive/glob.py | 12 +- .../gsctl/commands/interactive/graph.py | 12 +- python/graphscope/gsctl/impl/__init__.py | 38 +- python/graphscope/gsctl/impl/datasource.py | 3 +- python/graphscope/gsctl/impl/utils.py | 3 +- python/graphscope/gsctl/utils.py | 8 +- .../graphscope/tests/flex/test_interactive.py | 35 +- 26 files changed, 370 insertions(+), 692 deletions(-) create mode 100644 flex/coordinator/pyproject.toml create mode 100644 flex/coordinator/setup.cfg diff --git a/flex/coordinator/gs_flex_coordinator/core/__init__.py b/flex/coordinator/gs_flex_coordinator/core/__init__.py index 53b18cdb9c65..b065ec847e9d 100644 --- a/flex/coordinator/gs_flex_coordinator/core/__init__.py +++ b/flex/coordinator/gs_flex_coordinator/core/__init__.py @@ -27,5 +27,5 @@ level=logging.INFO, ) -from gs_flex_coordinator.core.client_wrapper import client_wrapper -from gs_flex_coordinator.core.utils import handle_api_exception +from gs_flex_coordinator.core.client_wrapper import client_wrapper # noqa: F401, E402 +from gs_flex_coordinator.core.utils import handle_api_exception # noqa: F401, E402 diff --git a/flex/coordinator/gs_flex_coordinator/core/alert/alert_manager.py b/flex/coordinator/gs_flex_coordinator/core/alert/alert_manager.py index 510f8a899f3d..188813cfcd59 100644 --- a/flex/coordinator/gs_flex_coordinator/core/alert/alert_manager.py +++ b/flex/coordinator/gs_flex_coordinator/core/alert/alert_manager.py @@ -20,17 +20,19 @@ import logging import os import pickle -from typing import List, Union +from typing import List +from typing import Union from gs_flex_coordinator.core.alert.alert_receiver import DingTalkReceiver -from gs_flex_coordinator.core.alert.builtin_rules import \ - init_builtin_alert_rules -from gs_flex_coordinator.core.alert.message_collector import \ - AlertMessageCollector +from gs_flex_coordinator.core.alert.builtin_rules import init_builtin_alert_rules +from gs_flex_coordinator.core.alert.message_collector import AlertMessageCollector from gs_flex_coordinator.core.config import ALERT_WORKSPACE from gs_flex_coordinator.core.scheduler import schedule -from gs_flex_coordinator.core.utils import decode_datetimestr, encode_datetime -from gs_flex_coordinator.models import AlertMessage, AlertReceiver, AlertRule +from gs_flex_coordinator.core.utils import decode_datetimestr +from gs_flex_coordinator.core.utils import encode_datetime +from gs_flex_coordinator.models import AlertMessage +from gs_flex_coordinator.models import AlertReceiver +from gs_flex_coordinator.models import AlertRule class AlertManager(object): @@ -146,7 +148,10 @@ def list_alert_messages( return rlt def update_alert_messages( - self, messages: List[AlertMessage], batch_status: str, batch_delete: bool + self, + messages: List[AlertMessage], + batch_status: str, + batch_delete: bool, ): for message in messages: date = decode_datetimestr(message.trigger_time) diff --git a/flex/coordinator/gs_flex_coordinator/core/alert/alert_rule.py b/flex/coordinator/gs_flex_coordinator/core/alert/alert_rule.py index b71fc94a87b7..6c1597e9c3fe 100644 --- a/flex/coordinator/gs_flex_coordinator/core/alert/alert_rule.py +++ b/flex/coordinator/gs_flex_coordinator/core/alert/alert_rule.py @@ -18,10 +18,12 @@ import datetime import logging -from abc import ABCMeta, abstractmethod +from abc import ABCMeta +from abc import abstractmethod from gs_flex_coordinator.core.alert.alert_message import AlertMessage -from gs_flex_coordinator.core.scheduler import cancel_job, schedule +from gs_flex_coordinator.core.scheduler import cancel_job +from gs_flex_coordinator.core.scheduler import schedule class AlertRule(metaclass=ABCMeta): diff --git a/flex/coordinator/gs_flex_coordinator/core/alert/builtin_rules.py b/flex/coordinator/gs_flex_coordinator/core/alert/builtin_rules.py index 6a981aeaf666..eb3516e3fbdc 100644 --- a/flex/coordinator/gs_flex_coordinator/core/alert/builtin_rules.py +++ b/flex/coordinator/gs_flex_coordinator/core/alert/builtin_rules.py @@ -25,9 +25,9 @@ from gs_flex_coordinator.core import client_wrapper from gs_flex_coordinator.core.alert.alert_rule import AlertRule -from gs_flex_coordinator.core.alert.message_collector import \ - AlertMessageCollector -from gs_flex_coordinator.core.config import CLUSTER_TYPE, SOLUTION +from gs_flex_coordinator.core.alert.message_collector import AlertMessageCollector +from gs_flex_coordinator.core.config import CLUSTER_TYPE +from gs_flex_coordinator.core.config import SOLUTION class HighDiskUtilizationAlert(AlertRule): diff --git a/flex/coordinator/gs_flex_coordinator/core/alert/message_collector.py b/flex/coordinator/gs_flex_coordinator/core/alert/message_collector.py index 14547bd65631..c8246adf1c21 100644 --- a/flex/coordinator/gs_flex_coordinator/core/alert/message_collector.py +++ b/flex/coordinator/gs_flex_coordinator/core/alert/message_collector.py @@ -23,7 +23,8 @@ from gs_flex_coordinator.core.alert.alert_message import AlertMessage from gs_flex_coordinator.core.config import ALERT_WORKSPACE -from gs_flex_coordinator.core.scheduler import cancel_job, schedule +from gs_flex_coordinator.core.scheduler import cancel_job +from gs_flex_coordinator.core.scheduler import schedule from gs_flex_coordinator.core.utils import decode_datetimestr @@ -59,7 +60,9 @@ def _pickle_messages_impl(self): self.dump_to_disk() except Exception as e: logging.warn( - "Failed to dump alert message on date %s: %s", str(self._date), str(e) + "Failed to dump alert message on date %s: %s", + str(self._date), + str(e), ) def _try_to_recover_from_disk(self): @@ -109,7 +112,8 @@ def clean(self): cancel_job(self._pickle_messages_job, delete_scheduler=True) self._pickle_messages_job = None logging.info( - "%s: current alert message collector cleaned", str(self._date) + "%s: current alert message collector cleaned", + str(self._date), ) except: # noqa: E722, B110 pass diff --git a/flex/coordinator/gs_flex_coordinator/core/client_wrapper.py b/flex/coordinator/gs_flex_coordinator/core/client_wrapper.py index 9828f917de57..a756d6b8adc6 100644 --- a/flex/coordinator/gs_flex_coordinator/core/client_wrapper.py +++ b/flex/coordinator/gs_flex_coordinator/core/client_wrapper.py @@ -16,65 +16,38 @@ # limitations under the License. # -# import datetime import itertools -import logging import os -# import pickle -# import socket import threading -from typing import List, Union - -# import psutil - -from gs_flex_coordinator.core.config import ( - CLUSTER_TYPE, - CREATION_TIME, - DATASET_WORKSPACE, - INSTANCE_NAME, - SOLUTION, - WORKSPACE, -) +from typing import List + +from gs_flex_coordinator.core.config import CLUSTER_TYPE +from gs_flex_coordinator.core.config import CREATION_TIME +from gs_flex_coordinator.core.config import DATASET_WORKSPACE +from gs_flex_coordinator.core.config import INSTANCE_NAME +from gs_flex_coordinator.core.config import SOLUTION +from gs_flex_coordinator.core.datasource import DataSourceManager from gs_flex_coordinator.core.insight import init_groot_client from gs_flex_coordinator.core.interactive import init_hqps_client -from gs_flex_coordinator.core.datasource import DataSourceManager -# from gs_flex_coordinator.core.scheduler import schedule -from gs_flex_coordinator.core.utils import ( - # GraphInfo, - # decode_datetimestr, - encode_datetime, - # get_current_time, -) -from gs_flex_coordinator.models import ( - RunningDeploymentInfo, - CreateGraphRequest, - CreateGraphResponse, - GetGraphSchemaResponse, - CreateProcedureRequest, - UpdateProcedureRequest, - CreateProcedureResponse, - GetProcedureResponse, - UploadFileResponse, - DataloadingJobConfig, - CreateDataloadingJobResponse, - CreateEdgeType, - CreateVertexType, - # EdgeDataSource, - # EdgeType, - GetGraphResponse, - # GrootDataloadingJobConfig, - # GrootGraph, - # GrootSchema, - JobStatus, - # ModelSchema, - # NodeStatus, - # Procedure, - SchemaMapping, - ServiceStatus, - StartServiceRequest, - # VertexDataSource, - # VertexType, -) +from gs_flex_coordinator.core.utils import encode_datetime +from gs_flex_coordinator.models import CreateDataloadingJobResponse +from gs_flex_coordinator.models import CreateEdgeType +from gs_flex_coordinator.models import CreateGraphRequest +from gs_flex_coordinator.models import CreateGraphResponse +from gs_flex_coordinator.models import CreateProcedureRequest +from gs_flex_coordinator.models import CreateProcedureResponse +from gs_flex_coordinator.models import CreateVertexType +from gs_flex_coordinator.models import DataloadingJobConfig +from gs_flex_coordinator.models import GetGraphResponse +from gs_flex_coordinator.models import GetGraphSchemaResponse +from gs_flex_coordinator.models import GetProcedureResponse +from gs_flex_coordinator.models import JobStatus +from gs_flex_coordinator.models import RunningDeploymentInfo +from gs_flex_coordinator.models import SchemaMapping +from gs_flex_coordinator.models import ServiceStatus +from gs_flex_coordinator.models import StartServiceRequest +from gs_flex_coordinator.models import UpdateProcedureRequest +from gs_flex_coordinator.models import UploadFileResponse from gs_flex_coordinator.version import __version__ @@ -88,49 +61,6 @@ def __init__(self): self._client = self._initialize_client() # data source management self._datasource_manager = DataSourceManager() - # graphs info - # self._graphs_info = {} - # pickle path - # self._pickle_path = os.path.join(WORKSPACE, "graphs_info.pickle") - # # recover - # self._try_to_recover_from_disk() - # # sync graphs info every 60s - # self._sync_graphs_info_job = ( - # schedule.every(60) - # .seconds.do(self._sync_graphs_info_impl) - # .tag("sync", "graphs info") - # ) - - # def _try_to_recover_from_disk(self): - # try: - # if os.path.exists(self._pickle_path): - # logging.info("Recover graphs info from file %s", self._pickle_path) - # with open(self._pickle_path, "rb") as f: - # self._graphs_info = pickle.load(f) - # except Exception as e: - # logging.warn("Failed to recover graphs info: %s", str(e)) - # # set default graph info - # self._sync_graphs_info_impl() - - # def _pickle_graphs_info_impl(self): - # try: - # with open(self._pickle_path, "wb") as f: - # pickle.dump(self._graphs_info, f) - # except Exception as e: - # logging.warn("Failed to dump graphs info: %s", str(e)) - - # def _sync_graphs_info_impl(self): - # if SOLUTION == "INTERACTIVE": - # graphs = self.list_graphs() - # elif SOLUTION == "GRAPHSCOPE_INSIGHT": - # graphs = self.list_groot_graph() - # rlts = {} - # for g in graphs: - # if g.name in self._graphs_info: - # rlts[g.name] = self._graphs_info[g.name] - # else: - # rlts[g.name] = GraphInfo(name=g.name, creation_time=CREATION_TIME) - # self._graphs_info = rlts def _initialize_client(self): service_initializer = { @@ -146,9 +76,14 @@ def list_graphs(self) -> List[GetGraphResponse]: graphs = self._client.list_graphs() # fix ValueError: Invalid value for `long_text`, must not be `None` for g in graphs: - for item in itertools.chain(g["schema"]["vertex_types"], g["schema"]["edge_types"]): + for item in itertools.chain( + g["schema"]["vertex_types"], g["schema"]["edge_types"] + ): for p in item["properties"]: - if "string" in p["property_type"] and "long_text" in p["property_type"]["string"]: + if ( + "string" in p["property_type"] + and "long_text" in p["property_type"]["string"] + ): p["property_type"]["string"]["long_text"] = "" # transfer rlts = [GetGraphResponse.from_dict(g) for g in graphs] @@ -159,21 +94,13 @@ def get_schema_by_id(self, graph_id: str) -> GetGraphSchemaResponse: # fix ValueError: Invalid value for `long_text`, must not be `None` for item in itertools.chain(schema["vertex_types"], schema["edge_types"]): for p in item["properties"]: - if "string" in p["property_type"] and "long_text" in p["property_type"]["string"]: + if ( + "string" in p["property_type"] + and "long_text" in p["property_type"]["string"] + ): p["property_type"]["string"]["long_text"] = "" return GetGraphSchemaResponse.from_dict(schema) - # def get_groot_schema(self, graph_name: str) -> GrootSchema: - # return GrootSchema.from_dict(self._client.get_groot_schema(graph_name)) - - # def import_groot_schema(self, graph_name: str, schema: GrootSchema) -> str: - # rlt = self._client.import_groot_schema(graph_name, schema.to_dict()) - # self._graphs_info[INSTANCE_NAME].update_time = get_current_time() - # return rlt - - # def get_current_graph(self) -> GrootGraph: - # return self._client.get_current_graph() - def create_graph(self, graph: CreateGraphRequest) -> CreateGraphResponse: # there are some tricks here, since schema is a keyword of openapi # specification, so it will be converted into the _schema field. @@ -187,7 +114,7 @@ def create_vertex_type(self, graph_id: str, vtype: CreateVertexType) -> str: self._client.create_vertex_type(graph_id, vtype.to_dict()) return "Create vertex type successfully" # if SOLUTION == "GRAPHSCOPE_INSIGHT": - # graph_name = INSTANCE_NAME + # graph_name = INSTANCE_NAME # vtype_dict = vtype.to_dict() # rlt = self._client.create_vertex_type(graph_name, vtype_dict) # # self._graphs_info[graph_name].update_time = get_current_time() @@ -196,23 +123,12 @@ def create_vertex_type(self, graph_id: str, vtype: CreateVertexType) -> str: def create_edge_type(self, graph_id: str, etype: CreateEdgeType) -> str: self._client.create_edge_type(graph_id, etype.to_dict()) return "Create edge type successfully" - # if SOLUTION == "GRAPHSCOPE_INSIGHT": - # graph_name = INSTANCE_NAME - # etype_dict = etype.to_dict() - # rlt = self._client.create_edge_type(graph_name, etype_dict) - # self._graphs_info[graph_name].update_time = get_current_time() - # return rlt def delete_vertex_type_by_name(self, graph_id: str, type_name: str) -> str: self._client.delete_vertex_type_by_name(graph_id, type_name) # remove data source mapping self.unbind_vertex_datasource(graph_id, type_name) return f"Delete vertex type {type_name} successfully" - # if SOLUTION == "GRAPHSCOPE_INSIGHT": - # graph_name = INSTANCE_NAME - # rlt = self._client.delete_vertex_type(graph_name, vertex_type) - # self._graphs_info[graph_name].update_time = get_current_time() - # return rlt def delete_edge_type_by_name( self, @@ -225,15 +141,11 @@ def delete_edge_type_by_name( graph_id, type_name, source_vertex_type, destination_vertex_type ) # remove data source mapping - self.unbind_edge_datasource(graph_id, type_name, source_vertex_type, destination_vertex_type) - return f"Delete edge type ({source_vertex_type})->[{type_name}]->({destination_vertex_type}) successfully" - # if SOLUTION == "GRAPHSCOPE_INSIGHT": - # graph_name = INSTANCE_NAME - # rlt = self._client.delete_edge_type( - # graph_name, edge_type, source_vertex_type, destination_vertex_type - # ) - # self._graphs_info[graph_name].update_time = get_current_time() - # return rlt + self.unbind_edge_datasource( + graph_id, type_name, source_vertex_type, destination_vertex_type + ) + elabel = f"({source_vertex_type})->[{type_name}]->({destination_vertex_type})" + return f"Delete edge type {elabel} successfully" def delete_graph_by_id(self, graph_id: str) -> str: rlt = self._client.delete_graph_by_id(graph_id) @@ -243,13 +155,20 @@ def delete_graph_by_id(self, graph_id: str) -> str: def get_graph_by_id(self, graph_id: str) -> GetGraphResponse: g = self._client.get_graph_by_id(graph_id) - for item in itertools.chain(g["schema"]["vertex_types"], g["schema"]["edge_types"]): + for item in itertools.chain( + g["schema"]["vertex_types"], g["schema"]["edge_types"] + ): for p in item["properties"]: - if "string" in p["property_type"] and "long_text" in p["property_type"]["string"]: + if ( + "string" in p["property_type"] + and "long_text" in p["property_type"]["string"] + ): p["property_type"]["string"]["long_text"] = "" return GetGraphResponse.from_dict(g) - def create_procedure(self, graph_id: str, procedure: CreateProcedureRequest) -> CreateProcedureResponse: + def create_procedure( + self, graph_id: str, procedure: CreateProcedureRequest + ) -> CreateProcedureResponse: procedure_dict = procedure.to_dict() response = self._client.create_procedure(graph_id, procedure_dict) return CreateProcedureResponse.from_dict(response) @@ -261,32 +180,26 @@ def list_procedures(self, graph_id: str) -> List[GetProcedureResponse]: return rlt def update_procedure_by_id( - self, graph_id: str, procedure_id: str, procedure: UpdateProcedureRequest + self, + graph_id: str, + procedure_id: str, + procedure: UpdateProcedureRequest, ) -> str: procedure_dict = procedure.to_dict() - return self._client.update_procedure_by_id(graph_id, procedure_id, procedure_dict) + return self._client.update_procedure_by_id( + graph_id, procedure_id, procedure_dict + ) def delete_procedure_by_id(self, graph_id: str, procedure_id: str) -> str: return self._client.delete_procedure_by_id(graph_id, procedure_id) - def get_procedure_by_id(self, graph_id: str, procedure_id: str) -> GetProcedureResponse: + def get_procedure_by_id( + self, graph_id: str, procedure_id: str + ) -> GetProcedureResponse: return GetProcedureResponse.from_dict( self._client.get_procedure_by_id(graph_id, procedure_id) ) - # def get_node_status(self) -> List[NodeStatus]: - # rlt = [] - # if CLUSTER_TYPE == "HOSTS": - # disk_info = psutil.disk_usage("/") - # status = { - # "node": socket.gethostname(), - # "cpu_usage": psutil.cpu_percent(), - # "memory_usage": psutil.virtual_memory().percent, - # "disk_usage": float(f"{disk_info.used / disk_info.total * 100:.2f}"), - # } - # rlt.append(NodeStatus.from_dict(status)) - # return rlt - def get_deployment_info(self) -> RunningDeploymentInfo: info = { "instance_name": INSTANCE_NAME, @@ -304,7 +217,10 @@ def get_service_status(self) -> ServiceStatus: schema = status["graph"]["schema"] for item in itertools.chain(schema["vertex_types"], schema["edge_types"]): for p in item["properties"]: - if "string" in p["property_type"] and "long_text" in p["property_type"]["string"]: + if ( + "string" in p["property_type"] + and "long_text" in p["property_type"]["string"] + ): p["property_type"]["string"]["long_text"] = "" return ServiceStatus.from_dict(status) @@ -330,11 +246,15 @@ def submit_dataloading_job( self, graph_id: str, dataloading_job_config: DataloadingJobConfig ) -> str: config = dataloading_job_config.to_dict() - job_id = self._client.submit_dataloading_job(graph_id, config, self._datasource_manager) + job_id = self._client.submit_dataloading_job( + graph_id, config, self._datasource_manager + ) return CreateDataloadingJobResponse.from_dict({"job_id": job_id}) def get_dataloading_job_config(self, graph_id: str) -> DataloadingJobConfig: - return DataloadingJobConfig.from_dict(self._client.get_dataloading_job_config(graph_id)) + return DataloadingJobConfig.from_dict( + self._client.get_dataloading_job_config(graph_id) + ) def upload_file(self, filestorage) -> str: if CLUSTER_TYPE == "HOSTS": @@ -342,32 +262,27 @@ def upload_file(self, filestorage) -> str: filestorage.save(filepath) return UploadFileResponse.from_dict({"file_path": filepath}) - # def create_groot_dataloading_job( - # self, graph_name: str, job_config: GrootDataloadingJobConfig - # ) -> str: - # job_id = self._client.create_groot_dataloading_job( - # graph_name, job_config.to_dict() - # ) - # return job_id - - # def list_groot_graph(self) -> List[GrootGraph]: - # graphs = self._client.list_groot_graph() - # # transfer - # rlts = [GrootGraph.from_dict(g) for g in graphs] - # return rlts - - def bind_datasource_in_batch(self, graph_id: str, schema_mapping: SchemaMapping) -> str: + def bind_datasource_in_batch( + self, graph_id: str, schema_mapping: SchemaMapping + ) -> str: # there are some tricks here, since property is a keyword of openapi # specification, so it will be converted into the _property field. schema_mapping_dict = schema_mapping.to_dict() for mapping in itertools.chain( - schema_mapping_dict["vertex_mappings"], schema_mapping_dict["edge_mappings"] + schema_mapping_dict["vertex_mappings"], + schema_mapping_dict["edge_mappings"], ): for column_mapping in mapping["column_mappings"]: if "_property" in column_mapping: column_mapping["property"] = column_mapping.pop("_property") - if "source_vertex_mappings" in mapping and "destination_vertex_mappings" in mapping: - for column_mapping in itertools.chain(mapping["source_vertex_mappings"], mapping["destination_vertex_mappings"]): + if ( + "source_vertex_mappings" in mapping + and "destination_vertex_mappings" in mapping + ): + for column_mapping in itertools.chain( + mapping["source_vertex_mappings"], + mapping["destination_vertex_mappings"], + ): if "_property" in column_mapping: column_mapping["property"] = column_mapping.pop("_property") self._datasource_manager.bind_datasource_in_batch(graph_id, schema_mapping_dict) diff --git a/flex/coordinator/gs_flex_coordinator/core/config.py b/flex/coordinator/gs_flex_coordinator/core/config.py index 454d68598a22..8f4bd52cabcf 100644 --- a/flex/coordinator/gs_flex_coordinator/core/config.py +++ b/flex/coordinator/gs_flex_coordinator/core/config.py @@ -17,7 +17,6 @@ # import datetime -import logging import os import tempfile @@ -51,8 +50,9 @@ def str_to_bool(s): os.makedirs(DATASET_WORKSPACE, exist_ok=True) -# we use the solution encompasses the various applications and use cases of the -# product across different industries and business scenarios, e.g. "INTERACTIVE", +# we use the solution encompasses the various applications +# and use cases of the product across different industries +# and business scenarios, e.g. "INTERACTIVE", # "GRAPHSCOPE INSIGHT". SOLUTION = os.environ["SOLUTION"] diff --git a/flex/coordinator/gs_flex_coordinator/core/datasource.py b/flex/coordinator/gs_flex_coordinator/core/datasource.py index 2869b22199bd..2da5c7e01256 100644 --- a/flex/coordinator/gs_flex_coordinator/core/datasource.py +++ b/flex/coordinator/gs_flex_coordinator/core/datasource.py @@ -37,7 +37,8 @@ def try_to_recover_from_disk(self): try: if os.path.exists(self._pickle_path): logging.info( - "Recover data source mapping from file %s", self._pickle_path + "Recover data source mapping from file %s", + self._pickle_path, ) with open(self._pickle_path, "rb") as f: self._datasource_mapping = pickle.load(f) @@ -52,7 +53,10 @@ def dump_to_disk(self): logging.warn("Failed to dump data source mapping: %s", str(e)) def get_edge_full_label( - self, type_name: str, source_vertex_type: str, destination_vertex_type: str + self, + type_name: str, + source_vertex_type: str, + destination_vertex_type: str, ) -> str: return f"{source_vertex_type}_{type_name}_{destination_vertex_type}" diff --git a/flex/coordinator/gs_flex_coordinator/core/insight/graph.py b/flex/coordinator/gs_flex_coordinator/core/insight/graph.py index 54f2b087afa7..882e96899026 100644 --- a/flex/coordinator/gs_flex_coordinator/core/insight/graph.py +++ b/flex/coordinator/gs_flex_coordinator/core/insight/graph.py @@ -20,24 +20,31 @@ import logging import os import time -from abc import ABCMeta, abstractmethod +from abc import ABCMeta +from abc import abstractmethod import graphscope from dateutil import tz -from graphscope.deploy.kubernetes.utils import (get_service_endpoints, - resolve_api_client) +from graphscope.deploy.kubernetes.utils import get_service_endpoints +from graphscope.deploy.kubernetes.utils import resolve_api_client from gremlin_python.driver.client import Client from kubernetes import client as kube_client from kubernetes import config as kube_config -from gs_flex_coordinator.core.config import (CLUSTER_TYPE, CREATION_TIME, - ENABLE_DNS, GROOT_GREMLIN_PORT, - GROOT_GRPC_PORT, GROOT_PASSWORD, - GROOT_USERNAME, INSTANCE_NAME, - NAMESPACE, WORKSPACE) +from gs_flex_coordinator.core.config import CLUSTER_TYPE +from gs_flex_coordinator.core.config import CREATION_TIME +from gs_flex_coordinator.core.config import ENABLE_DNS +from gs_flex_coordinator.core.config import GROOT_GREMLIN_PORT +from gs_flex_coordinator.core.config import GROOT_GRPC_PORT +from gs_flex_coordinator.core.config import GROOT_PASSWORD +from gs_flex_coordinator.core.config import GROOT_USERNAME +from gs_flex_coordinator.core.config import INSTANCE_NAME +from gs_flex_coordinator.core.config import NAMESPACE +from gs_flex_coordinator.core.config import WORKSPACE from gs_flex_coordinator.core.scheduler import schedule -from gs_flex_coordinator.core.utils import (data_type_to_groot, - encode_datetime, get_internal_ip) +from gs_flex_coordinator.core.utils import data_type_to_groot +from gs_flex_coordinator.core.utils import encode_datetime +from gs_flex_coordinator.core.utils import get_internal_ip from gs_flex_coordinator.version import __version__ @@ -260,7 +267,7 @@ def delete_vertex_type(self, graph_name: str, vertex_type: str): or vertex_type == relation["dst_label"] ): raise RuntimeError( - "Can not delete '{0}' type, cause exists in edge type '{1}'".format( + "Can not delete '{0}' type, cause exists in edge '{1}'".format( vertex_type, edge_schema["label"] ), ) @@ -295,7 +302,7 @@ def get_groot_graph_from_local(): client.submit( "g.with('evaluationTimeout', 5000).V().limit(1)" ).all().result() - except Exception as e: # noqa: B110 + except Exception: # noqa: B110 pass else: break @@ -316,8 +323,8 @@ def get_groot_graph_from_k8s(): app_api = kube_client.AppsV1Api(api_client) # frontend statefulset and service name name = "{0}-graphscope-store-frontend".format(INSTANCE_NAME) - respoonse = app_api.read_namespaced_stateful_set(name, NAMESPACE) - labels = response.metadata.labels + response = app_api.read_namespaced_stateful_set(name, NAMESPACE) + app_api.read_namespaced_stateful_set(name, NAMESPACE) # creation time creation_time = response.metadata.creation_timestamp.astimezone( tz.tzlocal() diff --git a/flex/coordinator/gs_flex_coordinator/core/insight/groot.py b/flex/coordinator/gs_flex_coordinator/core/insight/groot.py index 4e63ccf5a058..07e36be36c75 100644 --- a/flex/coordinator/gs_flex_coordinator/core/insight/groot.py +++ b/flex/coordinator/gs_flex_coordinator/core/insight/groot.py @@ -16,374 +16,12 @@ # limitations under the License. # -# import itertools -# import logging -# import os -# import pickle -# from typing import List - -# from gs_flex_coordinator.core.config import (CLUSTER_TYPE, INSTANCE_NAME, - # WORKSPACE) -# from gs_flex_coordinator.core.insight.graph import get_groot_graph -# from gs_flex_coordinator.core.insight.job import DataloadingJobScheduler -# from gs_flex_coordinator.core.scheduler import schedule -# from gs_flex_coordinator.models import JobStatus - class GrootClient(object): """Class used to interact with Groot""" def __init__(self): pass - # self._graph = get_groot_graph() - # # workspace - # self._workspace = os.path.join(WORKSPACE, "groot") - # os.makedirs(self._workspace, exist_ok=True) - # # data source - # self._data_source = {"vertices_datasource": {}, "edges_datasource": {}} - # # pickle path - # self._datasource_pickle_path = os.path.join( - # self._workspace, "datasource.pickle" - # ) - # # job - # self._job_scheduler = {} - # # job status - # self._job_status = {} - # # pickle path - # self._job_status_pickle_path = os.path.join( - # self._workspace, "job_status.pickle" - # ) - # # recover - # self._try_to_recover_from_disk() - # # dump job status to disk every 10s - # self._pickle_job_status_job = ( - # schedule.every(10) - # .seconds.do(self._pickle_job_status_impl) - # .tag("pickle", "job status") - # ) - - # def _try_to_recover_from_disk(self): - # try: - # if os.path.exists(self._datasource_pickle_path): - # logging.info( - # "Recover data source from file %s", self._datasource_pickle_path - # ) - # with open(self._datasource_pickle_path, "rb") as f: - # self._data_source = pickle.load(f) - # except Exception as e: - # logging.warn("Failed to recover data source: %s", str(e)) - - # try: - # if os.path.exists(self._job_status_pickle_path): - # logging.info( - # "Recover job status from file %s", self._job_status_pickle_path - # ) - # with open(self._job_status_pickle_path, "rb") as f: - # data = pickle.load(f) - # for jobid, status in data.items(): - # self._job_status[jobid] = JobStatus.from_dict(status) - # except Exception as e: - # logging.warn("Failed to recover job status: %s", str(e)) - - # def _pickle_datasource_impl(self): - # try: - # with open(self._datasource_pickle_path, "wb") as f: - # pickle.dump(self._data_source, f) - # except Exception as e: - # logging.warn("Failed to dump data source: %s", str(e)) - - # def _pickle_job_status_impl(self): - # try: - # rlt = {} - # for jobid, status in self._job_status.items(): - # rlt[jobid] = status.to_dict() - # with open(self._job_status_pickle_path, "wb") as f: - # pickle.dump(rlt, f) - # except Exception as e: - # logging.warn("Failed to dump job status: %s", str(e)) - - # def get_edge_full_label( - # self, type_name: str, source_vertex_type: str, destination_vertex_type: str - # ) -> str: - # return f"{source_vertex_type}_{type_name}_{destination_vertex_type}" - - # def get_current_graph(self): - # return self._graph - - # def list_groot_graph(self) -> list: - # rlts = [self._graph.to_dict()] - # return rlts - - # def create_vertex_type(self, graph_name: str, vtype_dict: dict) -> str: - # return self._graph.create_vertex_type(vtype_dict) - - # def create_edge_type(self, graph_name: str, etype_dict: dict) -> str: - # return self._graph.create_edge_type(etype_dict) - - # def delete_vertex_type(self, graph_name: str, vertex_type: str) -> str: - # rlt = self._graph.delete_vertex_type(graph_name, vertex_type) - # # unbind data source - # if vertex_type in self._data_source["vertices_datasource"]: - # del self._data_source["vertices_datasource"][vertex_type] - # self._pickle_datasource_impl() - # return rlt - - # def delete_edge_type( - # self, - # graph_name: str, - # edge_type: str, - # source_vertex_type: str, - # destination_vertex_type: str, - # ) -> str: - # rlt = self._graph.delete_edge_type( - # graph_name, edge_type, source_vertex_type, destination_vertex_type - # ) - # # unbind data source - # edge_label = self.get_edge_full_label( - # edge_type, source_vertex_type, destination_vertex_type - # ) - # if edge_label in self._data_source["edges_datasource"]: - # del self._data_source["edges_datasource"][edge_label] - # self._pickle_datasource_impl() - # return rlt - - # def get_groot_schema(self, graph_name: str) -> dict: - # return self._graph.schema - - # def import_groot_schema(self, graph_name: str, schema: dict) -> str: - # def _data_type_to_groot(dt): - # if dt == "DT_DOUBLE": - # return "DOUBLE" - # elif dt == "DT_SIGNED_INT64": - # return "LONG" - # elif dt == "DT_STRING": - # return "STRING" - # else: - # return dt - - # # transfer to groot data type - # for item in itertools.chain(schema["vertices"], schema["edges"]): - # for p in item["properties"]: - # p["type"] = _data_type_to_groot(p["type"]) - # return self._graph.import_schema(schema) - - # def list_jobs(self) -> List[dict]: - # rlt = [] - # for jobid, status in self._job_status.items(): - # rlt.append(status.to_dict()) - # return rlt - - # def import_datasource(self, graph_name: str, data_source: dict) -> str: - # for vertex_data_source in data_source["vertices_datasource"]: - # self._data_source["vertices_datasource"][ - # vertex_data_source["type_name"] - # ] = vertex_data_source - # for edge_data_source in data_source["edges_datasource"]: - # edge_label = self.get_edge_full_label( - # edge_data_source["type_name"], - # edge_data_source["source_vertex"], - # edge_data_source["destination_vertex"], - # ) - # self._data_source["edges_datasource"][edge_label] = edge_data_source - # self._pickle_datasource_impl() - - # def get_service_status(self) -> dict: - # return { - # "status": "running", - # "graph_name": self._graph.name, - # "sdk_endpoints": { - # "gremlin": self._graph.gremlin_interface["gremlin_endpoint"], - # "grpc": self._graph.gremlin_interface["grpc_endpoint"], - # }, - # } - - # def get_datasource(self, graph_name: str) -> dict: - # rlts = {"vertices_datasource": [], "edges_datasource": []} - # for _, v in self._data_source["vertices_datasource"].items(): - # rlts["vertices_datasource"].append(v) - # for _, e in self._data_source["edges_datasource"].items(): - # rlts["edges_datasource"].append(e) - # return rlts - - # def bind_vertex_datasource(self, graph_name: str, vertex_data_source: dict) -> str: - # self._data_source["vertices_datasource"][ - # vertex_data_source["type_name"] - # ] = vertex_data_source - # self._pickle_datasource_impl() - # return "Bind vertex data source successfully" - - # def bind_edge_datasource(self, graph_name: str, edge_data_source: dict) -> str: - # edge_label = self.get_edge_full_label( - # edge_data_source["type_name"], - # edge_data_source["source_vertex"], - # edge_data_source["destination_vertex"], - # ) - # self._data_source["edges_datasource"][edge_label] = edge_data_source - # self._pickle_datasource_impl() - # return "Bind edge data source successfully" - - # def get_vertex_datasource(self, graph_name: str, vertex_type: str) -> dict: - # if vertex_type not in self._data_source["vertices_datasource"]: - # raise RuntimeError( - # f"Vertex type {vertex_type} does not bind any data source" - # ) - # return self._data_source["vertices_datasource"][vertex_type] - - # def get_edge_datasource( - # self, - # graph_name: str, - # edge_type: str, - # source_vertex_type: str, - # destination_vertex_type: str, - # ) -> dict: - # edge_label = self.get_edge_full_label( - # edge_type, source_vertex_type, destination_vertex_type - # ) - # if edge_label not in self._data_source["edges_datasource"]: - # raise RuntimeError(f"Edge type {edge_label} does not bind any data source") - # return self._data_source["edges_datasource"][edge_label] - - # def unbind_vertex_datasource(self, graph_name: str, vertex_type: str) -> str: - # # check - # vertex_type_exists = False - # schema = self._graph.schema - # for v in schema["vertices"]: - # if vertex_type == v["label"]: - # vertex_type_exists = True - # break - # if not vertex_type_exists: - # raise RuntimeError(f"Vertex type {vertex_type} not exists") - # if vertex_type in self._data_source["vertices_datasource"]: - # del self._data_source["vertices_datasource"][vertex_type] - # self._pickle_datasource_impl() - # return "unbind data source successfully" - - # def unbind_edge_datasource( - # self, - # graph_name: str, - # edge_type: str, - # source_vertex_type: str, - # destination_vertex_type: str, - # ) -> str: - # # check - # edge_type_exists = False - # schema = self._graph.schema - # for e in schema["edges"]: - # for relation in e["relations"]: - # if ( - # edge_type == e["label"] - # and source_vertex_type == relation["src_label"] - # and destination_vertex_type == relation["dst_label"] - # ): - # edge_type_exists = True - # break - # if not edge_type_exists: - # raise RuntimeError( - # f"Edge type ({source_vertex_type})-[{edge_type}]->({destination_vertex_type}) not exists" - # ) - # edge_label = self.get_edge_full_label( - # edge_type, source_vertex_type, destination_vertex_type - # ) - # if edge_label in self._data_source["edges_datasource"]: - # del self._data_source["edges_datasource"][edge_label] - # self._pickle_datasource_impl() - # return "unbind data source successfully" - - # def create_groot_dataloading_job(self, graph_name: str, job_config: dict) -> str: - # dataloading_job_scheduler = DataloadingJobScheduler( - # job_config=job_config, - # data_source=self._data_source, - # job_scheduler=self._job_scheduler, - # job_status=self._job_status, - # graph=self._graph, - # ) - # return dataloading_job_scheduler.schedulerid - - # def get_job_by_id(self, job_id: str) -> dict: - # if job_id not in self._job_status: - # raise RuntimeError(f"Job {job_id} not found") - # return self._job_status[job_id].to_dict() - - # def delete_job_by_id(self, job_id: str) -> str: - # if job_id not in self._job_status: - # raise RuntimeError(f"Job {job_id} not found") - # if job_id in self._job_scheduler: - # # we don't have some processes in case of restart the coordinator - # # some processes will not exist if the coordinator is restart - # self._job_scheduler[job_id].cancel() - # return f"Submit cancellation job successfully" - - # def get_dataloading_config(self, graph_name: str) -> dict: - # config = { - # "graph": INSTANCE_NAME, - # "loading_config": {}, - # "vertex_mappings": [], - # "edge_mappings": [], - # } - # # transfer - # for vtype, ds in self._data_source["vertices_datasource"].items(): - # column_mappings = [] - # if ds["property_mapping"] is not None: - # for index, property_name in ds["property_mapping"].items(): - # column_mappings.append( - # { - # "column": { - # "index": int(index), - # }, - # "property": property_name, - # } - # ) - # config["vertex_mappings"].append( - # { - # "type_name": vtype, - # "inputs": [ds["location"]], - # "column_mappings": column_mappings, - # } - # ) - # for etype, ds in self._data_source["edges_datasource"].items(): - # source_vertex_mappings = [] - # for index, _ in ds["source_pk_column_map"].items(): - # source_vertex_mappings.append( - # { - # "column": { - # "index": int(index), - # } - # } - # ) - # destination_vertex_mappings = [] - # for index, _ in ds["destination_pk_column_map"].items(): - # destination_vertex_mappings.append( - # { - # "column": { - # "index": int(index), - # } - # } - # ) - # column_mappings = [] - # if ds["property_mapping"] is not None: - # for index, property_name in ds["property_mapping"].items(): - # column_mappings.append( - # { - # "column": { - # "index": int(index), - # }, - # "property": property_name, - # } - # ) - # config["edge_mappings"].append( - # { - # "type_triplet": { - # "edge": ds["type_name"], - # "source_vertex": ds["source_vertex"], - # "destination_vertex": ds["destination_vertex"], - # }, - # "inputs": [ds["location"]], - # "source_vertex_mappings": source_vertex_mappings, - # "destination_vertex_mappings": destination_vertex_mappings, - # "column_mappings": column_mappings, - # } - # ) - # return config def init_groot_client(): diff --git a/flex/coordinator/gs_flex_coordinator/core/insight/job.py b/flex/coordinator/gs_flex_coordinator/core/insight/job.py index de4ced454095..a69555fc09fb 100644 --- a/flex/coordinator/gs_flex_coordinator/core/insight/job.py +++ b/flex/coordinator/gs_flex_coordinator/core/insight/job.py @@ -17,10 +17,12 @@ # import pandas as pd -from graphscope.framework.record import EdgeRecordKey, VertexRecordKey +from graphscope.framework.record import EdgeRecordKey +from graphscope.framework.record import VertexRecordKey from gs_flex_coordinator.core.scheduler import Scheduler -from gs_flex_coordinator.core.utils import encode_datetime, get_current_time +from gs_flex_coordinator.core.utils import encode_datetime +from gs_flex_coordinator.core.utils import get_current_time from gs_flex_coordinator.models import JobStatus @@ -56,7 +58,10 @@ def _construct_detailed_info(self): return detail def get_edge_full_label( - self, type_name: str, source_vertex_type: str, destination_vertex_type: str + self, + type_name: str, + source_vertex_type: str, + destination_vertex_type: str, ) -> str: return f"{source_vertex_type}_{type_name}_{destination_vertex_type}" @@ -66,7 +71,9 @@ def _import_data_from_local_file(self): for vlabel in self._job_config["vertices"]: primary_key = self._graph.get_vertex_primary_key(vlabel) datasource = self._data_source["vertices_datasource"][vlabel] - data = pd.read_csv(datasource["location"], sep=",|\|", engine="python") + data = pd.read_csv( + datasource["location"], sep=",|\|", engine="python" + ) # noqa: W605 for record in data.itertuples(index=False): primary_key_dict = {} property_mapping = {} @@ -76,7 +83,10 @@ def _import_data_from_local_file(self): else: property_mapping[v] = record[int(k)] vertices.append( - [VertexRecordKey(vlabel, primary_key_dict), property_mapping] + [ + VertexRecordKey(vlabel, primary_key_dict), + property_mapping, + ] ) edges = [] for e in self._job_config["edges"]: @@ -101,7 +111,8 @@ def _import_data_from_local_file(self): e["type_name"], VertexRecordKey(e["source_vertex"], source_pk_column_map), VertexRecordKey( - e["destination_vertex"], destination_pk_column_map + e["destination_vertex"], + destination_pk_column_map, ), ), property_mapping, diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps.py index bbdbc2c4ac9c..993036ec7cf6 100644 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps.py +++ b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps.py @@ -21,27 +21,24 @@ import os import pickle import time -import requests -from typing import List, Union +from typing import List +from typing import Union import interactive_sdk.openapi +import requests from interactive_sdk.openapi import CreateGraphRequest from interactive_sdk.openapi import CreateProcedureRequest -from interactive_sdk.openapi import UpdateProcedureRequest -from interactive_sdk.openapi import StartServiceRequest from interactive_sdk.openapi import SchemaMapping +from interactive_sdk.openapi import StartServiceRequest +from interactive_sdk.openapi import UpdateProcedureRequest +from gs_flex_coordinator.core.config import CLUSTER_TYPE +from gs_flex_coordinator.core.config import HQPS_ADMIN_SERVICE_PORT +from gs_flex_coordinator.core.config import WORKSPACE from gs_flex_coordinator.core.datasource import DataSourceManager -from gs_flex_coordinator.core.config import ( - CLUSTER_TYPE, - HQPS_ADMIN_SERVICE_PORT, - WORKSPACE, -) -from gs_flex_coordinator.core.utils import ( - encode_datetime, - get_internal_ip, - get_public_ip, -) +from gs_flex_coordinator.core.utils import encode_datetime +from gs_flex_coordinator.core.utils import get_internal_ip +from gs_flex_coordinator.core.utils import get_public_ip class HQPSClient(object): @@ -62,13 +59,14 @@ def dump_to_disk(self): with open(self._job_config_pickle_path, "wb") as f: pickle.dump(self._job_config, f) except Exception as e: - logging.warn("Failed to dump job config file: %s", str(e)) + logging.warn("Failed to dump job config file: %s", str(e)) def try_to_recover_from_disk(self): try: if os.path.exists(self._job_config_pickle_path): logging.info( - "Recover job config from file %s", self._job_config_pickle_path + "Recover job config from file %s", + self._job_config_pickle_path, ) with open(self._job_config_pickle_path, "rb") as f: self._job_config = pickle.load(f) @@ -90,7 +88,9 @@ def list_graphs(self) -> List[dict]: with interactive_sdk.openapi.ApiClient( interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = interactive_sdk.openapi.AdminServiceGraphManagementApi(api_client) + api_instance = interactive_sdk.openapi.AdminServiceGraphManagementApi( + api_client + ) graphs = [g.to_dict() for g in api_instance.list_graphs()] for g in graphs: # `schema_update_time` is same to `creation_time` in Interactive @@ -105,14 +105,18 @@ def get_schema_by_id(self, graph_id: str) -> dict: with interactive_sdk.openapi.ApiClient( interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = interactive_sdk.openapi.AdminServiceGraphManagementApi(api_client) + api_instance = interactive_sdk.openapi.AdminServiceGraphManagementApi( + api_client + ) return api_instance.get_schema(graph_id).to_dict() def create_graph(self, graph: dict) -> dict: with interactive_sdk.openapi.ApiClient( interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = interactive_sdk.openapi.AdminServiceGraphManagementApi(api_client) + api_instance = interactive_sdk.openapi.AdminServiceGraphManagementApi( + api_client + ) response = api_instance.create_graph(CreateGraphRequest.from_dict(graph)) return response.to_dict() @@ -120,7 +124,9 @@ def delete_graph_by_id(self, graph_id: str) -> str: with interactive_sdk.openapi.ApiClient( interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = interactive_sdk.openapi.AdminServiceGraphManagementApi(api_client) + api_instance = interactive_sdk.openapi.AdminServiceGraphManagementApi( + api_client + ) rlt = api_instance.delete_graph(graph_id) return rlt @@ -128,8 +134,9 @@ def get_graph_by_id(self, graph_id: str) -> dict: with interactive_sdk.openapi.ApiClient( interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = interactive_sdk.openapi.AdminServiceGraphManagementApi(api_client) - a = api_instance.get_graph(graph_id) + api_instance = interactive_sdk.openapi.AdminServiceGraphManagementApi( + api_client + ) g = api_instance.get_graph(graph_id).to_dict() # `schema_update_time` is same to `creation_time` in Interactive g["schema_update_time"] = g["creation_time"] @@ -148,14 +155,22 @@ def create_edge_type(self, graph_id: str, etype: dict): def delete_vertex_type_by_name(self, graph_id: str, type_name: str): raise RuntimeError("Create vertex type is not supported yet!") - def delete_edge_type_by_name(self, graph_id: str, edge_type: str, source_vertex_type: str, destination_vertex_type: str): + def delete_edge_type_by_name( + self, + graph_id: str, + edge_type: str, + source_vertex_type: str, + destination_vertex_type: str, + ): raise RuntimeError("Create vertex type is not supported yet!") def create_procedure(self, graph_id: str, procedure: dict) -> dict: with interactive_sdk.openapi.ApiClient( interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = interactive_sdk.openapi.AdminServiceProcedureManagementApi(api_client) + api_instance = interactive_sdk.openapi.AdminServiceProcedureManagementApi( + api_client + ) response = api_instance.create_procedure( graph_id, CreateProcedureRequest.from_dict(procedure) ) @@ -166,7 +181,9 @@ def list_procedures(self, graph_id: str) -> List[dict]: interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: procedures = [] - api_instance = interactive_sdk.openapi.AdminServiceProcedureManagementApi(api_client) + api_instance = interactive_sdk.openapi.AdminServiceProcedureManagementApi( + api_client + ) procedures = [p.to_dict() for p in api_instance.list_procedures(graph_id)] return procedures @@ -176,30 +193,40 @@ def update_procedure_by_id( with interactive_sdk.openapi.ApiClient( interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = interactive_sdk.openapi.AdminServiceProcedureManagementApi(api_client) + api_instance = interactive_sdk.openapi.AdminServiceProcedureManagementApi( + api_client + ) return api_instance.update_procedure( - graph_id, procedure_id, UpdateProcedureRequest.from_dict(procedure) + graph_id, + procedure_id, + UpdateProcedureRequest.from_dict(procedure), ) def delete_procedure_by_id(self, graph_id: str, procedure_id: str) -> str: with interactive_sdk.openapi.ApiClient( interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = interactive_sdk.openapi.AdminServiceProcedureManagementApi(api_client) + api_instance = interactive_sdk.openapi.AdminServiceProcedureManagementApi( + api_client + ) return api_instance.delete_procedure(graph_id, procedure_id) def get_procedure_by_id(self, graph_id: str, procedure_id: str) -> dict: with interactive_sdk.openapi.ApiClient( interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = interactive_sdk.openapi.AdminServiceProcedureManagementApi(api_client) + api_instance = interactive_sdk.openapi.AdminServiceProcedureManagementApi( + api_client + ) return api_instance.get_procedure(graph_id, procedure_id).to_dict() def get_service_status(self) -> dict: with interactive_sdk.openapi.ApiClient( interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = interactive_sdk.openapi.AdminServiceServiceManagementApi(api_client) + api_instance = interactive_sdk.openapi.AdminServiceServiceManagementApi( + api_client + ) response = api_instance.get_service_status() # transfer if CLUSTER_TYPE == "HOSTS": @@ -221,33 +248,40 @@ def get_service_status(self) -> dict: status["graph"] = graph return status - def stop_service(self) -> str: with interactive_sdk.openapi.ApiClient( interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = interactive_sdk.openapi.AdminServiceServiceManagementApi(api_client) + api_instance = interactive_sdk.openapi.AdminServiceServiceManagementApi( + api_client + ) return api_instance.stop_service() def restart_service(self) -> str: with interactive_sdk.openapi.ApiClient( interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = interactive_sdk.openapi.AdminServiceServiceManagementApi(api_client) + api_instance = interactive_sdk.openapi.AdminServiceServiceManagementApi( + api_client + ) return api_instance.restart_service() def start_service(self, graph_id: str) -> str: with interactive_sdk.openapi.ApiClient( interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = interactive_sdk.openapi.AdminServiceServiceManagementApi(api_client) + api_instance = interactive_sdk.openapi.AdminServiceServiceManagementApi( + api_client + ) return api_instance.start_service(StartServiceRequest(graph_id=graph_id)) def list_jobs(self) -> List[dict]: with interactive_sdk.openapi.ApiClient( interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = interactive_sdk.openapi.AdminServiceJobManagementApi(api_client) + api_instance = interactive_sdk.openapi.AdminServiceJobManagementApi( + api_client + ) rlt = [] for s in api_instance.list_jobs(): job_status = s.to_dict() @@ -265,7 +299,9 @@ def get_job_by_id(self, job_id: str) -> dict: with interactive_sdk.openapi.ApiClient( interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = interactive_sdk.openapi.AdminServiceJobManagementApi(api_client) + api_instance = interactive_sdk.openapi.AdminServiceJobManagementApi( + api_client + ) job_status = api_instance.get_job_by_id(job_id).to_dict() job_status["start_time"] = encode_datetime( datetime.datetime.fromtimestamp(job_status["start_time"] / 1000) @@ -280,7 +316,9 @@ def delete_job_by_id(self, job_id: str) -> str: with interactive_sdk.openapi.ApiClient( interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = interactive_sdk.openapi.AdminServiceJobManagementApi(api_client) + api_instance = interactive_sdk.openapi.AdminServiceJobManagementApi( + api_client + ) return api_instance.delete_job_by_id(job_id) def submit_dataloading_job( @@ -297,7 +335,12 @@ def submit_dataloading_job( if vds: schema_mapping["vertex_mappings"].append(vds) for e in config["edges"]: - eds = ds_manager.get_edge_datasource(graph_id, e["type_name"], e["source_vertex"], e["destination_vertex"]) + eds = ds_manager.get_edge_datasource( + graph_id, + e["type_name"], + e["source_vertex"], + e["destination_vertex"], + ) if eds: schema_mapping["edge_mappings"].append(eds) # set job configuration before submission @@ -307,7 +350,9 @@ def submit_dataloading_job( with interactive_sdk.openapi.ApiClient( interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - api_instance = interactive_sdk.openapi.AdminServiceGraphManagementApi(api_client) + api_instance = interactive_sdk.openapi.AdminServiceGraphManagementApi( + api_client + ) response = api_instance.create_dataloading_job( graph_id, SchemaMapping.from_dict(schema_mapping) ) diff --git a/flex/coordinator/gs_flex_coordinator/core/scheduler.py b/flex/coordinator/gs_flex_coordinator/core/scheduler.py index b254fe305ce2..1e7af5d85910 100644 --- a/flex/coordinator/gs_flex_coordinator/core/scheduler.py +++ b/flex/coordinator/gs_flex_coordinator/core/scheduler.py @@ -17,10 +17,10 @@ # import datetime -import json import random import time -from abc import ABCMeta, abstractmethod +from abc import ABCMeta +from abc import abstractmethod from string import ascii_uppercase import schedule @@ -38,9 +38,10 @@ class Schedule(object): def __init__(self): self._schedule = schedule.Scheduler() - self._run_pending_thread = StoppableThread(target=self.run_pending, args=()) - self._run_pending_thread.daemon = True - self._run_pending_thread.start() + # thread + self._run_pending_trd = StoppableThread(target=self.run_pending, args=()) + self._run_pending_trd.daemon = True + self._run_pending_trd.start() @property def schedule(self): @@ -80,13 +81,14 @@ def __init__(self, at_time, repeat): # repeat every day or week, or run job once(no repeat) # optional value "day", "week", "once" self._repeat = repeat - # job running thread, note that: - # the last job should be end of execution at the beginning of the next job + # job running thread, note that the last job should be + # end of execution at the beginning of the next job self._running_thread = None # tags self._tags = [] - # when the job actually scheduled, the following variables will be generated and overridden. + # the following variables will be generated and overridden + # when the job actually scheduled self._jobid = None self._last_run = None @@ -129,9 +131,7 @@ def sunday(self): @property def timestr(self): - """return str of the time object. - time([hour[, minute[, second[, microsecond[, tzinfo]]]]]) --> a time object - """ + """return str of the time object.""" return str(self._at_time.time()) @property @@ -185,9 +185,14 @@ def do_run(self): self._running_thread.start() def submit(self): - if not self._run_now and self._repeat not in ["week", "day", "once", None]: + if not self._run_now and self._repeat not in [ + "week", + "day", + "once", + None, + ]: raise RuntimeError( - "Submit schedule job failed: at_time is '{0}', repeat is '{1}'".format( + "Submit schedule job failed: at_time: '{0}', repeat: '{1}'".format( self._at_time, self._repeat ) ) diff --git a/flex/coordinator/gs_flex_coordinator/core/stoppable_thread.py b/flex/coordinator/gs_flex_coordinator/core/stoppable_thread.py index 34b332a2d208..be4fdee0313b 100644 --- a/flex/coordinator/gs_flex_coordinator/core/stoppable_thread.py +++ b/flex/coordinator/gs_flex_coordinator/core/stoppable_thread.py @@ -34,5 +34,5 @@ def stop(self): self._stop_event.set() def stopped(self): - """The thread itself should check regularly for the stopped() condition.""" + """Thread itself should check regularly for the stopped() condition.""" return self._stop_event.is_set() diff --git a/flex/coordinator/pyproject.toml b/flex/coordinator/pyproject.toml new file mode 100644 index 000000000000..8bb6ee5f516f --- /dev/null +++ b/flex/coordinator/pyproject.toml @@ -0,0 +1,2 @@ +[tool.black] +line-length = 88 diff --git a/flex/coordinator/requirements.txt b/flex/coordinator/requirements.txt index 5018f3d675f0..f3d3b4171b85 100644 --- a/flex/coordinator/requirements.txt +++ b/flex/coordinator/requirements.txt @@ -9,4 +9,4 @@ pydantic >= 2 typing-extensions >= 4.7.1 psutil schedule -graphscope-client >= 0.26.0 +interactive-sdk == 0.0.3 diff --git a/flex/coordinator/setup.cfg b/flex/coordinator/setup.cfg new file mode 100644 index 000000000000..194d641fbbc2 --- /dev/null +++ b/flex/coordinator/setup.cfg @@ -0,0 +1,8 @@ +[isort] +ensure_newline_before_comments = True +line_length = 88 +force_single_line = True + +[flake8] +max-line-length = 88 +extend-ignore = E203,F401,F401,F403,C4,I250,E402,W605 diff --git a/flex/coordinator/setup.py b/flex/coordinator/setup.py index 54df7584d2d9..78abe0932790 100644 --- a/flex/coordinator/setup.py +++ b/flex/coordinator/setup.py @@ -73,6 +73,47 @@ def run(self): ) +class FormatAndLint(Command): + description = "format and lint code" + user_options = [] + + user_options = [("inplace=", "i", "Run code formatter and linter inplace")] + + def initialize_options(self): + self.inplace = False + + def finalize_options(self): + if self.inplace or self.inplace == "True" or self.inplace == "true": + self.inplace = True + else: + self.inplace = False + + def run(self): + codedir = os.path.join(pkg_root, "gs_flex_coordinator", "core") + if self.inplace: + subprocess.check_call( + [sys.executable, "-m", "isort", codedir], cwd=pkg_root + ) + subprocess.check_call( + [sys.executable, "-m", "black", codedir], cwd=pkg_root + ) + subprocess.check_call( + [sys.executable, "-m", "flake8", codedir], cwd=pkg_root + ) + else: + subprocess.check_call( + [sys.executable, "-m", "isort", "--check", "--diff", codedir], + cwd=pkg_root, + ) + subprocess.check_call( + [sys.executable, "-m", "black", "--check", "--diff", codedir], + cwd=pkg_root, + ) + subprocess.check_call( + [sys.executable, "-m", "flake8", codedir], cwd=pkg_root + ) + + setup( name=NAME, version=VERSION, @@ -85,6 +126,7 @@ def run(self): package_data={"": ["openapi/openapi.yaml", "VERSION"]}, cmdclass={ "generate_flex_server": GenerateFlexServer, + "lint": FormatAndLint, }, include_package_data=True, entry_points={ diff --git a/python/graphscope/gsctl/commands/__init__.py b/python/graphscope/gsctl/commands/__init__.py index a42f03ad55cf..823cc85e486c 100644 --- a/python/graphscope/gsctl/commands/__init__.py +++ b/python/graphscope/gsctl/commands/__init__.py @@ -22,6 +22,7 @@ from graphscope.gsctl.commands.common import cli as common from graphscope.gsctl.commands.dev import cli as dev + # from graphscope.gsctl.commands.insight.graph import cli as insight_graph from graphscope.gsctl.commands.interactive.glob import cli as interactive from graphscope.gsctl.commands.interactive.graph import cli as interactive_graph diff --git a/python/graphscope/gsctl/commands/interactive/glob.py b/python/graphscope/gsctl/commands/interactive/glob.py index 0f81283310e9..81f2d334b5af 100644 --- a/python/graphscope/gsctl/commands/interactive/glob.py +++ b/python/graphscope/gsctl/commands/interactive/glob.py @@ -21,6 +21,8 @@ from graphscope.gsctl.impl import create_graph from graphscope.gsctl.impl import delete_graph_by_id +from graphscope.gsctl.impl import get_datasource_by_id +from graphscope.gsctl.impl import get_graph_id_by_name from graphscope.gsctl.impl import get_service_status from graphscope.gsctl.impl import list_graphs from graphscope.gsctl.impl import list_jobs @@ -29,8 +31,6 @@ from graphscope.gsctl.impl import start_service from graphscope.gsctl.impl import stop_service from graphscope.gsctl.impl import switch_context -from graphscope.gsctl.impl import get_datasource_by_id -from graphscope.gsctl.impl import get_graph_id_by_name from graphscope.gsctl.utils import TreeDisplay from graphscope.gsctl.utils import err from graphscope.gsctl.utils import info @@ -183,7 +183,13 @@ def ls(): # noqa: F811 """Display current service status""" def _construct_and_display_data(status): - head = ["STATUS", "SERVING_GRAPH(IDENTIFIER)", "CYPHER_ENDPOINT", "HQPS_ENDPOINT", "GREMLIN_ENDPOINT"] + head = [ + "STATUS", + "SERVING_GRAPH(IDENTIFIER)", + "CYPHER_ENDPOINT", + "HQPS_ENDPOINT", + "GREMLIN_ENDPOINT", + ] data = [head] if status.status == "Stopped": data.append([status.status, "-", "-", "-", "-"]) diff --git a/python/graphscope/gsctl/commands/interactive/graph.py b/python/graphscope/gsctl/commands/interactive/graph.py index 5e9ab72e3ce6..ca87b69f9a8a 100644 --- a/python/graphscope/gsctl/commands/interactive/graph.py +++ b/python/graphscope/gsctl/commands/interactive/graph.py @@ -20,20 +20,20 @@ import yaml from graphscope.gsctl.config import get_current_context -from graphscope.gsctl.impl import submit_dataloading_job +from graphscope.gsctl.impl import bind_datasource_in_batch from graphscope.gsctl.impl import create_procedure from graphscope.gsctl.impl import delete_job_by_id from graphscope.gsctl.impl import delete_procedure_by_id +from graphscope.gsctl.impl import get_datasource_by_id +from graphscope.gsctl.impl import get_graph_id_by_name from graphscope.gsctl.impl import get_job_by_id from graphscope.gsctl.impl import list_graphs from graphscope.gsctl.impl import list_jobs -from graphscope.gsctl.impl import bind_datasource_in_batch -from graphscope.gsctl.impl import get_datasource_by_id from graphscope.gsctl.impl import list_procedures +from graphscope.gsctl.impl import submit_dataloading_job from graphscope.gsctl.impl import switch_context from graphscope.gsctl.impl import unbind_edge_datasource from graphscope.gsctl.impl import unbind_vertex_datasource -from graphscope.gsctl.impl import get_graph_id_by_name from graphscope.gsctl.utils import TreeDisplay from graphscope.gsctl.utils import err from graphscope.gsctl.utils import info @@ -156,7 +156,7 @@ def datasource(filename): # noqa: F811 datasource = read_yaml_file(filename) bind_datasource_in_batch(graph_identifier, datasource) except Exception as e: - err(f"Failed to bind data source: {str(e)}") + err(f"Failed to bind data source: {str(e)}") else: succ("Bind data source successfully.") @@ -194,7 +194,7 @@ def datasource(type, source_vertex_type, destination_vertex_type): # noqa: F811 except Exception as e: err(f"Failed to unbind data source: {str(e)}") else: - succ(f"Unbind data source successfully.") + succ("Unbind data source successfully.") @create.command() diff --git a/python/graphscope/gsctl/impl/__init__.py b/python/graphscope/gsctl/impl/__init__.py index af0c96ae23b5..b2ee74ea67ba 100644 --- a/python/graphscope/gsctl/impl/__init__.py +++ b/python/graphscope/gsctl/impl/__init__.py @@ -18,32 +18,26 @@ from graphscope.gsctl.impl.common import connect_coordinator from graphscope.gsctl.impl.common import disconnect_coordinator - +from graphscope.gsctl.impl.datasource import bind_datasource_in_batch +from graphscope.gsctl.impl.datasource import get_datasource_by_id +from graphscope.gsctl.impl.datasource import unbind_edge_datasource +from graphscope.gsctl.impl.datasource import unbind_vertex_datasource from graphscope.gsctl.impl.graph import create_graph -from graphscope.gsctl.impl.graph import list_graphs from graphscope.gsctl.impl.graph import delete_graph_by_id - -from graphscope.gsctl.impl.service import get_service_status +from graphscope.gsctl.impl.graph import list_graphs +from graphscope.gsctl.impl.job import delete_job_by_id +from graphscope.gsctl.impl.job import get_job_by_id +from graphscope.gsctl.impl.job import list_jobs +from graphscope.gsctl.impl.job import submit_dataloading_job +from graphscope.gsctl.impl.procedure import create_procedure +from graphscope.gsctl.impl.procedure import delete_procedure_by_id +from graphscope.gsctl.impl.procedure import get_procedure_by_id +from graphscope.gsctl.impl.procedure import list_procedures +from graphscope.gsctl.impl.procedure import update_procedure_by_id +from graphscope.gsctl.impl.service import get_service_status from graphscope.gsctl.impl.service import restart_service from graphscope.gsctl.impl.service import start_service from graphscope.gsctl.impl.service import stop_service - +from graphscope.gsctl.impl.utils import get_graph_id_by_name from graphscope.gsctl.impl.utils import switch_context from graphscope.gsctl.impl.utils import upload_file -from graphscope.gsctl.impl.utils import get_graph_id_by_name - -from graphscope.gsctl.impl.procedure import create_procedure -from graphscope.gsctl.impl.procedure import list_procedures -from graphscope.gsctl.impl.procedure import delete_procedure_by_id -from graphscope.gsctl.impl.procedure import update_procedure_by_id -from graphscope.gsctl.impl.procedure import get_procedure_by_id - -from graphscope.gsctl.impl.datasource import bind_datasource_in_batch -from graphscope.gsctl.impl.datasource import get_datasource_by_id -from graphscope.gsctl.impl.datasource import unbind_edge_datasource -from graphscope.gsctl.impl.datasource import unbind_vertex_datasource - -from graphscope.gsctl.impl.job import submit_dataloading_job -from graphscope.gsctl.impl.job import list_jobs -from graphscope.gsctl.impl.job import delete_job_by_id -from graphscope.gsctl.impl.job import get_job_by_id diff --git a/python/graphscope/gsctl/impl/datasource.py b/python/graphscope/gsctl/impl/datasource.py index c0c41ec697d4..a78fc3c1903a 100644 --- a/python/graphscope/gsctl/impl/datasource.py +++ b/python/graphscope/gsctl/impl/datasource.py @@ -16,12 +16,11 @@ # limitations under the License. # -import os import itertools +import os import graphscope.flex.rest from graphscope.flex.rest import SchemaMapping - from graphscope.gsctl.config import get_current_context from graphscope.gsctl.impl.utils import upload_file diff --git a/python/graphscope/gsctl/impl/utils.py b/python/graphscope/gsctl/impl/utils.py index 1b34f0ef8e8f..d5d57b632a50 100644 --- a/python/graphscope/gsctl/impl/utils.py +++ b/python/graphscope/gsctl/impl/utils.py @@ -17,9 +17,9 @@ # import graphscope.flex.rest -from graphscope.gsctl.impl import list_graphs from graphscope.gsctl.config import get_current_context from graphscope.gsctl.config import load_gs_config +from graphscope.gsctl.impl import list_graphs def upload_file(location: str) -> str: @@ -41,7 +41,6 @@ def switch_context(context: str): def get_graph_id_by_name(name_or_id: str): graphs = list_graphs() id_candidate = [] - graph_exist = False for g in graphs: if name_or_id == g.id: return name_or_id diff --git a/python/graphscope/gsctl/utils.py b/python/graphscope/gsctl/utils.py index 47d0207a38b3..69eaeb70d578 100644 --- a/python/graphscope/gsctl/utils.py +++ b/python/graphscope/gsctl/utils.py @@ -398,10 +398,10 @@ def create_datasource_mapping_node(self, graph, datasource_mapping): property_column_mapping.column.index, property_column_mapping.column.name, ) - property_mapping_identifier = f"{specific_vertex_mapping_identifier}_{property_column_mapping.var_property}" + p_mapping_identifier = f"{specific_vertex_mapping_identifier}_{property_column_mapping.var_property}" self.tree.create_node( tag=tag, - identifier=property_mapping_identifier, + identifier=p_mapping_identifier, parent=specific_vertex_mapping_identifier, ) # edge mapping @@ -463,10 +463,10 @@ def create_datasource_mapping_node(self, graph, datasource_mapping): property_column_mapping.column.index, property_column_mapping.column.name, ) - property_mapping_identifier = f"{specific_edge_mapping_identifier}_{property_column_mapping.var_property}" + p_mapping_identifier = f"{specific_edge_mapping_identifier}_{property_column_mapping.var_property}" self.tree.create_node( tag=tag, - identifier=property_mapping_identifier, + identifier=p_mapping_identifier, parent=specific_edge_mapping_identifier, ) diff --git a/python/graphscope/tests/flex/test_interactive.py b/python/graphscope/tests/flex/test_interactive.py index 8bdad35923f6..50d2f37325e5 100644 --- a/python/graphscope/tests/flex/test_interactive.py +++ b/python/graphscope/tests/flex/test_interactive.py @@ -22,39 +22,32 @@ warnings.filterwarnings("ignore", category=Warning) import time -import pytest +import pytest from click.testing import CliRunner +from graphscope.gsctl.impl import bind_datasource_in_batch from graphscope.gsctl.impl import connect_coordinator -from graphscope.gsctl.impl import disconnect_coordinator - from graphscope.gsctl.impl import create_graph +from graphscope.gsctl.impl import create_procedure from graphscope.gsctl.impl import delete_graph_by_id -from graphscope.gsctl.impl import list_graphs - +from graphscope.gsctl.impl import delete_procedure_by_id +from graphscope.gsctl.impl import disconnect_coordinator +from graphscope.gsctl.impl import get_datasource_by_id +from graphscope.gsctl.impl import get_job_by_id +from graphscope.gsctl.impl import get_procedure_by_id from graphscope.gsctl.impl import get_service_status +from graphscope.gsctl.impl import list_graphs +from graphscope.gsctl.impl import list_procedures from graphscope.gsctl.impl import restart_service from graphscope.gsctl.impl import start_service from graphscope.gsctl.impl import stop_service - -from graphscope.gsctl.impl import create_procedure -from graphscope.gsctl.impl import list_procedures -from graphscope.gsctl.impl import delete_procedure_by_id -from graphscope.gsctl.impl import update_procedure_by_id -from graphscope.gsctl.impl import get_procedure_by_id - -from graphscope.gsctl.impl import bind_datasource_in_batch -from graphscope.gsctl.impl import get_datasource_by_id +from graphscope.gsctl.impl import submit_dataloading_job from graphscope.gsctl.impl import unbind_edge_datasource from graphscope.gsctl.impl import unbind_vertex_datasource - -from graphscope.gsctl.impl import submit_dataloading_job -from graphscope.gsctl.impl import get_job_by_id - +from graphscope.gsctl.impl import update_procedure_by_id from graphscope.gsctl.impl import upload_file - COORDINATOR_ENDPOINT = "http://127.0.0.1:8080" @@ -233,9 +226,7 @@ def test_bulk_loading(self, tmpdir): }, }, "vertices": [ - { - "type_name": "person" - }, + {"type_name": "person"}, ], "edges": [ { From 6a08990ab859f86e0f83758e7e03814d15ad6713 Mon Sep 17 00:00:00 2001 From: Dongze Li Date: Fri, 17 May 2024 16:51:47 +0800 Subject: [PATCH 03/15] update --- .../core/interactive/hqps.py | 24 +- .../gs_flex_coordinator/openapi/openapi.yaml | 466 +++++++++--------- flex/openapi/openapi_coordinator.yaml | 4 +- .../graphscope/flex/rest/api/procedure_api.py | 10 +- python/graphscope/gsctl/impl/__init__.py | 2 +- python/graphscope/gsctl/impl/graph.py | 19 + python/graphscope/gsctl/impl/utils.py | 20 - 7 files changed, 281 insertions(+), 264 deletions(-) diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps.py index 993036ec7cf6..431324526750 100644 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps.py +++ b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps.py @@ -93,6 +93,12 @@ def list_graphs(self) -> List[dict]: ) graphs = [g.to_dict() for g in api_instance.list_graphs()] for g in graphs: + g["creation_time"] = encode_datetime( + datetime.datetime.fromtimestamp(g["creation_time"] / 1000) + ) + g["data_update_time"] = encode_datetime( + datetime.datetime.fromtimestamp(g["data_update_time"] / 1000) + ) # `schema_update_time` is same to `creation_time` in Interactive g["schema_update_time"] = g["creation_time"] # we do not have edge's primary key in Interactive @@ -138,6 +144,12 @@ def get_graph_by_id(self, graph_id: str) -> dict: api_client ) g = api_instance.get_graph(graph_id).to_dict() + g["creation_time"] = encode_datetime( + datetime.datetime.fromtimestamp(g["creation_time"] / 1000) + ) + g["data_update_time"] = encode_datetime( + datetime.datetime.fromtimestamp(g["data_update_time"] / 1000) + ) # `schema_update_time` is same to `creation_time` in Interactive g["schema_update_time"] = g["creation_time"] # we do not have edge's primary key in Interactive @@ -242,10 +254,16 @@ def get_service_status(self) -> dict: }, } if response.graph is not None: - graph = response.graph.to_dict() + g = response.graph.to_dict() + g["creation_time"] = encode_datetime( + datetime.datetime.fromtimestamp(g["creation_time"] / 1000) + ) + g["data_update_time"] = encode_datetime( + datetime.datetime.fromtimestamp(g["data_update_time"] / 1000) + ) # `schema_update_time` is same to `creation_time` in Interactive - graph["schema_update_time"] = graph["creation_time"] - status["graph"] = graph + g["schema_update_time"] = g["creation_time"] + status["graph"] = g return status def stop_service(self) -> str: diff --git a/flex/coordinator/gs_flex_coordinator/openapi/openapi.yaml b/flex/coordinator/gs_flex_coordinator/openapi/openapi.yaml index af758d57795a..89a5a08a3e27 100644 --- a/flex/coordinator/gs_flex_coordinator/openapi/openapi.yaml +++ b/flex/coordinator/gs_flex_coordinator/openapi/openapi.yaml @@ -1016,6 +1016,239 @@ paths: tags: - DataSource x-openapi-router-controller: gs_flex_coordinator.controllers.data_source_controller + /api/v1/graph/{graph_id}/procedure: + get: + description: List all stored procedures on a certain graph + operationId: list_procedures + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + example: + - id: PROCEDUREID-1 + name: procedure_name_1 + type: cypher + query: MATCH(a) return COUNT(a); + library: /path/to/library + params: + - name: param1 + type: + string: + long_text: null + returns: + - name: return1 + type: + PrimitiveType: DT_SIGNED_INT64 + bound_graph: demo + runnable: true + - id: PROCEDUREID-2 + name: procedure_name_2 + type: cypher + query: MATCH(a) return COUNT(a); + library: /path/to/library + params: + - name: param1 + type: + string: + long_text: null + returns: + - name: return1 + type: + PrimitiveType: DT_SIGNED_INT64 + bound_graph: demo + runnable: false + schema: + items: + $ref: '#/components/schemas/GetProcedureResponse' + type: array + description: Successful operation + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Bad request + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error + tags: + - Procedure + x-openapi-router-controller: gs_flex_coordinator.controllers.procedure_controller + post: + description: Create a new stored procedure on a certain graph + operationId: create_procedure + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateProcedureRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/CreateProcedureResponse' + description: Successfully created a procedure + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Bad request + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error + tags: + - Procedure + x-openapi-router-controller: gs_flex_coordinator.controllers.procedure_controller + /api/v1/graph/{graph_id}/procedure/{procedure_id}: + delete: + description: Delete a stored procedure by ID + operationId: delete_procedure_by_id + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: procedure_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + description: Successfully deleted the stored procedure + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error + tags: + - Procedure + x-openapi-router-controller: gs_flex_coordinator.controllers.procedure_controller + get: + description: Get a stored procedure by ID + operationId: get_procedure_by_id + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: procedure_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + example: + id: PROCEDUREID + name: procedure_name + type: cypher + query: MATCH(a) return COUNT(a); + library: /path/to/library + params: + - name: param1 + type: + string: + long_text: null + returns: + - name: return1 + type: + PrimitiveType: DT_SIGNED_INT64 + bound_graph: demo + runnable: true + schema: + $ref: '#/components/schemas/GetProcedureResponse' + description: Successfully returned the procedure + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error + tags: + - Procedure + x-openapi-router-controller: gs_flex_coordinator.controllers.procedure_controller + put: + description: Update a stored procedure by ID + operationId: update_procedure_by_id + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: procedure_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateProcedureRequest' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + description: Successfully updated the stored procedure + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error + tags: + - Procedure + x-openapi-router-controller: gs_flex_coordinator.controllers.procedure_controller /api/v1/graph/{graph_id}/schema: get: description: Get graph schema by ID @@ -1597,239 +1830,6 @@ paths: tags: - Service x-openapi-router-controller: gs_flex_coordinator.controllers.service_controller - /v1/graph/{graph_id}/procedure: - get: - description: List all stored procedures on a certain graph - operationId: list_procedures - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - responses: - "200": - content: - application/json: - example: - - id: PROCEDUREID-1 - name: procedure_name_1 - type: cypher - query: MATCH(a) return COUNT(a); - library: /path/to/library - params: - - name: param1 - type: - string: - long_text: null - returns: - - name: return1 - type: - PrimitiveType: DT_SIGNED_INT64 - bound_graph: demo - runnable: true - - id: PROCEDUREID-2 - name: procedure_name_2 - type: cypher - query: MATCH(a) return COUNT(a); - library: /path/to/library - params: - - name: param1 - type: - string: - long_text: null - returns: - - name: return1 - type: - PrimitiveType: DT_SIGNED_INT64 - bound_graph: demo - runnable: false - schema: - items: - $ref: '#/components/schemas/GetProcedureResponse' - type: array - description: Successful operation - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Bad request - "500": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Server error - tags: - - Procedure - x-openapi-router-controller: gs_flex_coordinator.controllers.procedure_controller - post: - description: Create a new stored procedure on a certain graph - operationId: create_procedure - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateProcedureRequest' - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/CreateProcedureResponse' - description: Successfully created a procedure - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Bad request - "500": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Server error - tags: - - Procedure - x-openapi-router-controller: gs_flex_coordinator.controllers.procedure_controller - /v1/graph/{graph_id}/procedure/{procedure_id}: - delete: - description: Delete a stored procedure by ID - operationId: delete_procedure_by_id - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - - explode: false - in: path - name: procedure_id - required: true - schema: - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - description: Successfully deleted the stored procedure - "500": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Server error - tags: - - Procedure - x-openapi-router-controller: gs_flex_coordinator.controllers.procedure_controller - get: - description: Get a stored procedure by ID - operationId: get_procedure_by_id - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - - explode: false - in: path - name: procedure_id - required: true - schema: - type: string - style: simple - responses: - "200": - content: - application/json: - example: - id: PROCEDUREID - name: procedure_name - type: cypher - query: MATCH(a) return COUNT(a); - library: /path/to/library - params: - - name: param1 - type: - string: - long_text: null - returns: - - name: return1 - type: - PrimitiveType: DT_SIGNED_INT64 - bound_graph: demo - runnable: true - schema: - $ref: '#/components/schemas/GetProcedureResponse' - description: Successfully returned the procedure - "500": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Server error - tags: - - Procedure - x-openapi-router-controller: gs_flex_coordinator.controllers.procedure_controller - put: - description: Update a stored procedure by ID - operationId: update_procedure_by_id - parameters: - - explode: false - in: path - name: graph_id - required: true - schema: - type: string - style: simple - - explode: false - in: path - name: procedure_id - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateProcedureRequest' - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/APIResponse' - description: Successfully updated the stored procedure - "500": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Server error - tags: - - Procedure - x-openapi-router-controller: gs_flex_coordinator.controllers.procedure_controller components: responses: "400": diff --git a/flex/openapi/openapi_coordinator.yaml b/flex/openapi/openapi_coordinator.yaml index eda59ec3d48e..bd5dfef6e0a8 100644 --- a/flex/openapi/openapi_coordinator.yaml +++ b/flex/openapi/openapi_coordinator.yaml @@ -1614,7 +1614,7 @@ paths: 500: $ref: "#/components/responses/500" - /v1/graph/{graph_id}/procedure: + /api/v1/graph/{graph_id}/procedure: post: tags: [Procedure] description: Create a new stored procedure on a certain graph @@ -1700,7 +1700,7 @@ paths: 500: $ref: "#/components/responses/500" - /v1/graph/{graph_id}/procedure/{procedure_id}: + /api/v1/graph/{graph_id}/procedure/{procedure_id}: get: tags: [Procedure] description: Get a stored procedure by ID diff --git a/python/graphscope/flex/rest/api/procedure_api.py b/python/graphscope/flex/rest/api/procedure_api.py index 686af4a625e1..f7ab039d81ab 100644 --- a/python/graphscope/flex/rest/api/procedure_api.py +++ b/python/graphscope/flex/rest/api/procedure_api.py @@ -317,7 +317,7 @@ def _create_procedure_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/v1/graph/{graph_id}/procedure', + resource_path='/api/v1/graph/{graph_id}/procedure', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -592,7 +592,7 @@ def _delete_procedure_by_id_serialize( return self.api_client.param_serialize( method='DELETE', - resource_path='/v1/graph/{graph_id}/procedure/{procedure_id}', + resource_path='/api/v1/graph/{graph_id}/procedure/{procedure_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -867,7 +867,7 @@ def _get_procedure_by_id_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v1/graph/{graph_id}/procedure/{procedure_id}', + resource_path='/api/v1/graph/{graph_id}/procedure/{procedure_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1130,7 +1130,7 @@ def _list_procedures_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v1/graph/{graph_id}/procedure', + resource_path='/api/v1/graph/{graph_id}/procedure', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1433,7 +1433,7 @@ def _update_procedure_by_id_serialize( return self.api_client.param_serialize( method='PUT', - resource_path='/v1/graph/{graph_id}/procedure/{procedure_id}', + resource_path='/api/v1/graph/{graph_id}/procedure/{procedure_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/python/graphscope/gsctl/impl/__init__.py b/python/graphscope/gsctl/impl/__init__.py index b2ee74ea67ba..7f84689dfd4b 100644 --- a/python/graphscope/gsctl/impl/__init__.py +++ b/python/graphscope/gsctl/impl/__init__.py @@ -24,6 +24,7 @@ from graphscope.gsctl.impl.datasource import unbind_vertex_datasource from graphscope.gsctl.impl.graph import create_graph from graphscope.gsctl.impl.graph import delete_graph_by_id +from graphscope.gsctl.impl.graph import get_graph_id_by_name from graphscope.gsctl.impl.graph import list_graphs from graphscope.gsctl.impl.job import delete_job_by_id from graphscope.gsctl.impl.job import get_job_by_id @@ -38,6 +39,5 @@ from graphscope.gsctl.impl.service import restart_service from graphscope.gsctl.impl.service import start_service from graphscope.gsctl.impl.service import stop_service -from graphscope.gsctl.impl.utils import get_graph_id_by_name from graphscope.gsctl.impl.utils import switch_context from graphscope.gsctl.impl.utils import upload_file diff --git a/python/graphscope/gsctl/impl/graph.py b/python/graphscope/gsctl/impl/graph.py index ed091986b3d1..06399e7968d3 100644 --- a/python/graphscope/gsctl/impl/graph.py +++ b/python/graphscope/gsctl/impl/graph.py @@ -51,3 +51,22 @@ def delete_graph_by_id(graph_identifier: str) -> str: ) as api_client: api_instance = graphscope.flex.rest.GraphApi(api_client) return api_instance.delete_graph_by_id(graph_identifier) + + +def get_graph_id_by_name(name_or_id: str): + graphs = list_graphs() + id_candidate = [] + for g in graphs: + if name_or_id == g.id: + return name_or_id + if name_or_id == g.name: + id_candidate.append(g.id) + if not id_candidate: + raise RuntimeError( + f"Graph '{name_or_id}' not exists, see graph information with `ls` command." + ) + if len(id_candidate) > 1: + raise RuntimeError( + f"Found multiple id candidates {id_candidate} for graph {name_or_id}, please choose one." + ) + return id_candidate[0] diff --git a/python/graphscope/gsctl/impl/utils.py b/python/graphscope/gsctl/impl/utils.py index d5d57b632a50..cd30821bddfe 100644 --- a/python/graphscope/gsctl/impl/utils.py +++ b/python/graphscope/gsctl/impl/utils.py @@ -19,7 +19,6 @@ import graphscope.flex.rest from graphscope.gsctl.config import get_current_context from graphscope.gsctl.config import load_gs_config -from graphscope.gsctl.impl import list_graphs def upload_file(location: str) -> str: @@ -36,22 +35,3 @@ def switch_context(context: str): current_context = get_current_context() current_context.switch_context(context) config.update_and_write(current_context) - - -def get_graph_id_by_name(name_or_id: str): - graphs = list_graphs() - id_candidate = [] - for g in graphs: - if name_or_id == g.id: - return name_or_id - if name_or_id == g.name: - id_candidate.append(g.id) - if not id_candidate: - raise RuntimeError( - f"Graph '{name_or_id}' not exists, see graph information with `ls` command." - ) - if len(id_candidate) > 1: - raise RuntimeError( - f"Found multiple id candidates {id_candidate} for graph {name_or_id}, please choose one." - ) - return id_candidate[0] From 5ad298c504064ccc61fc02b7487e2537cca0decb Mon Sep 17 00:00:00 2001 From: Dongze Li Date: Fri, 24 May 2024 17:35:11 +0800 Subject: [PATCH 04/15] Add coordinator restful API doc --- docs/_static/coordinator_restful_api.html | 3272 +++++++++++++++++ docs/conf.py | 1 - docs/flex/coordinator.md | 11 + docs/flex/coordinator/restful_api.rst | 6 + docs/index.rst | 1 + flex/coordinator/.openapi-generator/FILES | 11 +- .../controllers/deployment_controller.py | 12 + .../controllers/procedure_controller.py | 98 - .../controllers/service_controller.py | 22 +- .../stored_procedure_controller.py | 98 + .../core/client_wrapper.py | 104 +- .../gs_flex_coordinator/core/config.py | 5 +- .../core/interactive/hqps.py | 86 +- .../gs_flex_coordinator/models/__init__.py | 11 +- .../models/create_graph_request.py | 20 +- .../models/create_procedure_response.py | 63 - ...quest.py => create_stored_proc_request.py} | 50 +- .../models/create_stored_proc_response.py | 63 + .../models/get_graph_response.py | 16 +- ...esponse.py => get_stored_proc_response.py} | 110 +- .../gs_flex_coordinator/models/node_status.py | 147 + .../models/running_deployment_info.py | 132 +- .../models/running_deployment_status.py | 97 + .../running_deployment_status_nodes_inner.py | 149 + .../models/service_status.py | 88 +- ...quest.py => update_stored_proc_request.py} | 20 +- .../gs_flex_coordinator/openapi/openapi.yaml | 970 +++-- .../test/test_stored_procedure_controller.py | 101 + flex/openapi/openapi_coordinator.yaml | 309 +- python/graphscope/flex/rest/__init__.py | 13 +- python/graphscope/flex/rest/api/__init__.py | 2 +- .../flex/rest/api/deployment_api.py | 248 +- .../graphscope/flex/rest/api/service_api.py | 289 +- ...ocedure_api.py => stored_procedure_api.py} | 300 +- .../graphscope/flex/rest/models/__init__.py | 11 +- .../flex/rest/models/create_graph_request.py | 10 +- ...quest.py => create_stored_proc_request.py} | 8 +- ...onse.py => create_stored_proc_response.py} | 14 +- .../flex/rest/models/get_graph_response.py | 6 +- ...esponse.py => get_stored_proc_response.py} | 8 +- .../flex/rest/models/node_status.py | 94 + .../rest/models/running_deployment_info.py | 34 +- .../rest/models/running_deployment_status.py | 105 + .../running_deployment_status_nodes_inner.py | 124 + .../flex/rest/models/service_status.py | 14 +- ...quest.py => update_stored_proc_request.py} | 8 +- python/graphscope/gsctl/commands/__init__.py | 30 +- python/graphscope/gsctl/commands/common.py | 5 +- .../gsctl/commands/interactive/glob.py | 37 +- .../gsctl/commands/interactive/graph.py | 44 +- python/graphscope/gsctl/impl/__init__.py | 12 +- python/graphscope/gsctl/impl/common.py | 7 +- python/graphscope/gsctl/impl/service.py | 6 +- .../{procedure.py => stored_procedure.py} | 56 +- python/graphscope/gsctl/utils.py | 22 +- .../graphscope/tests/flex/test_interactive.py | 89 +- 56 files changed, 6238 insertions(+), 1431 deletions(-) create mode 100644 docs/_static/coordinator_restful_api.html create mode 100644 docs/flex/coordinator.md create mode 100644 docs/flex/coordinator/restful_api.rst delete mode 100644 flex/coordinator/gs_flex_coordinator/controllers/procedure_controller.py create mode 100644 flex/coordinator/gs_flex_coordinator/controllers/stored_procedure_controller.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/create_procedure_response.py rename flex/coordinator/gs_flex_coordinator/models/{create_procedure_request.py => create_stored_proc_request.py} (61%) create mode 100644 flex/coordinator/gs_flex_coordinator/models/create_stored_proc_response.py rename flex/coordinator/gs_flex_coordinator/models/{get_procedure_response.py => get_stored_proc_response.py} (62%) create mode 100644 flex/coordinator/gs_flex_coordinator/models/node_status.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/running_deployment_status.py create mode 100644 flex/coordinator/gs_flex_coordinator/models/running_deployment_status_nodes_inner.py rename flex/coordinator/gs_flex_coordinator/models/{update_procedure_request.py => update_stored_proc_request.py} (64%) create mode 100644 flex/coordinator/gs_flex_coordinator/test/test_stored_procedure_controller.py rename python/graphscope/flex/rest/api/{procedure_api.py => stored_procedure_api.py} (86%) rename python/graphscope/flex/rest/models/{create_procedure_request.py => create_stored_proc_request.py} (93%) rename python/graphscope/flex/rest/models/{create_procedure_response.py => create_stored_proc_response.py} (86%) rename python/graphscope/flex/rest/models/{get_procedure_response.py => get_stored_proc_response.py} (95%) create mode 100644 python/graphscope/flex/rest/models/node_status.py create mode 100644 python/graphscope/flex/rest/models/running_deployment_status.py create mode 100644 python/graphscope/flex/rest/models/running_deployment_status_nodes_inner.py rename python/graphscope/flex/rest/models/{update_procedure_request.py => update_stored_proc_request.py} (92%) rename python/graphscope/gsctl/impl/{procedure.py => stored_procedure.py} (50%) diff --git a/docs/_static/coordinator_restful_api.html b/docs/_static/coordinator_restful_api.html new file mode 100644 index 000000000000..c851ee8b3bb4 --- /dev/null +++ b/docs/_static/coordinator_restful_api.html @@ -0,0 +1,3272 @@ + + + + GraphScope FLEX HTTP SERVICE API + + + +

GraphScope FLEX HTTP SERVICE API

+

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.

+

Some useful links:

+ +
+
More information: https://helloreverb.com
+ +
Version: 1.0.0
+
BasePath:/GRAPHSCOPE/flex-api/1.0.0
+
Apache 2.0
+
http://www.apache.org/licenses/LICENSE-2.0.html
+

Access

+ +

Methods

+ [ Jump to Models ] + +

Table of Contents

+
+

Alert

+ +

DataSource

+ +

Deployment

+ +

Graph

+ +

Job

+ +

Service

+ +

StoredProcedure

+ +

Utils

+ + +

Alert

+
+
+ Up +
post /api/v1/alert/receiver
+
(createAlertReceiver)
+
Create a new alert receiver
+ + +

Consumes

+ This API call consumes the following media types via the Content-Type request header: +
    +
  • application/json
  • +
+ +

Request body

+
+ + +
Body Parameter
+
+ + + + +

Return type

+
+ APIResponse + +
+ + + +

Example data

+
Content-Type: application/json
+
""
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully created the alert receiver + APIResponse +

500

+ Server error + Error +
+
+
+
+ Up +
delete /api/v1/alert/rule/{rule_id}
+
(delete alert rule by ID)
+
+ +

Path parameters

+
+
rule_id (required)
+ +
Path Parameter
+ + + + + + +

Return type

+
+ APIResponse + +
+ + + +

Example data

+
Content-Type: application/json
+
""
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully deleted the alert rule + APIResponse +

500

+ Server error + Error +
+
+
+
+ Up +
delete /api/v1/alert/message-collection
+
(deleteAlertMessageInBatch)
+
Delete alert message in batch
+ + + + + +

Query parameters

+
+
message_ids (required)
+ +
Query Parameter — A list of message id separated by comma, e.g. id1,id2,id3
+ + +

Return type

+
+ APIResponse + +
+ + + +

Example data

+
Content-Type: application/json
+
""
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully deleted the alert message + APIResponse +

500

+ Server error + Error +
+
+
+
+ Up +
delete /api/v1/alert/receiver/{receiver_id}
+
(deleteAlertReceiverById)
+
Delete the alert receiver by ID
+ +

Path parameters

+
+
receiver_id (required)
+ +
Path Parameter
+ + + + + + +

Return type

+
+ APIResponse + +
+ + + +

Example data

+
Content-Type: application/json
+
""
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully deleted the alert receiver + APIResponse +

500

+ Server error + Error +
+
+
+
+ Up +
get /api/v1/alert/message
+
(listAlertMessages)
+
List all alert messages
+ + + + + +

Query parameters

+
+
alert_type (optional)
+ +
Query Parameter
status (optional)
+ +
Query Parameter
severity (optional)
+ +
Query Parameter
start_time (optional)
+ +
Query Parameter — format with &quot;2023-02-21-11-56-30&quot;
end_time (optional)
+ +
Query Parameter — format with &quot;2023-02-21-11-56-30&quot;
limit (optional)
+ +
Query Parameter — format: int32
+ + +

Return type

+ + + + +

Example data

+
Content-Type: application/json
+
[ {
+  "severity" : "warning",
+  "trigger_time" : "trigger_time",
+  "metric_type" : "node",
+  "id" : "id",
+  "message" : "message",
+  "alert_name" : "alert_name",
+  "target" : [ "target", "target" ],
+  "status" : "unsolved"
+}, {
+  "severity" : "warning",
+  "trigger_time" : "trigger_time",
+  "metric_type" : "node",
+  "id" : "id",
+  "message" : "message",
+  "alert_name" : "alert_name",
+  "target" : [ "target", "target" ],
+  "status" : "unsolved"
+} ]
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully returned the alert messages + +

Example data

+
Content-Type: application/json
+
[{"id":"ALERT-MESSAGE-QWERTYUIOP-1","alert_name":"HighDiskUtilization","severity":"warning","metric_type":"node","target":["hostname-1"],"trigger_time":"2023-02-21T11:56:30.000Z","status":"unsolved","message":"Disk usage node1 85.12%, exceeds threshold"},{"id":"ALERT-MESSAGE-QWERTYUIOP-2","alert_name":"HighDiskUtilization","severity":"emergency","metric_type":"node","target":["hostname-1"],"trigger_time":"2023-02-21T11:56:30.000Z","status":"solved","message":"Disk usage node1 85.12%, exceeds threshold"},{"id":"ALERT-MESSAGE-QWERTYUIOP-3","alert_name":"HighDiskUtilization","severity":"warning","metric_type":"node","target":["hostname-1"],"trigger_time":"2023-02-21T11:56:30.000Z","status":"dealing","message":"Disk usage node1 85.12%, exceeds threshold"}]
+

500

+ Server error + Error +
+
+
+
+ Up +
get /api/v1/alert/receiver
+
(listAlertReceivers)
+
List all alert receivers
+ + + + + + + +

Return type

+ + + + +

Example data

+
Content-Type: application/json
+
[ "", "" ]
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully returned the alert receivers + +

Example data

+
Content-Type: application/json
+
[{"id":"RECEIVER-QWERTYUIOP-1","type":"webhook","webhook_url":"http://webhook.com","is_at_all":false,"at_user_ids":[111111,222222],"enable":false},{"id":"RECEIVER-QWERTYUIOP-2","type":"webhook","webhook_url":"http://webhook.com","is_at_all":false,"at_user_ids":[111111,222222],"enable":true,"message":"error message"}]
+

500

+ Server error + Error +
+
+
+
+ Up +
get /api/v1/alert/rule
+
(listAlertRules)
+
List all alert rules
+ + + + + + + +

Return type

+
+ array[GetAlertRuleResponse] + +
+ + + +

Example data

+
Content-Type: application/json
+
[ "", "" ]
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully returned the alert rules + +

Example data

+
Content-Type: application/json
+
[{"id":"ALERTRULE-1","name":"HighDiskUtilization","severity":"warning","metric_type":"node","conditions_description":"disk usage >= 85","enable":true},{"id":"ALERTRULE-2","name":"GremlinServiceAvailable","severity":"emergency","metric_type":"node","conditions_description":"g.V().limit(1) failed","enable":false}]
+

500

+ Server error + Error +
+
+
+
+ Up +
put /api/v1/alert/rule/{rule_id}
+
(update alert rule by ID)
+
+ +

Path parameters

+
+
rule_id (required)
+ +
Path Parameter
+ +

Consumes

+ This API call consumes the following media types via the Content-Type request header: +
    +
  • application/json
  • +
+ +

Request body

+
+
body CreateAlertRuleRequest (optional)
+ +
Body Parameter
+
+ + + + +

Return type

+
+ APIResponse + +
+ + + +

Example data

+
Content-Type: application/json
+
""
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully updated the alert rule + APIResponse +

500

+ Server error + Error +
+
+
+
+ Up +
put /api/v1/alert/message-collection/status
+
(updateAlertMessageInBatch)
+
Update the message status in batch
+ + +

Consumes

+ This API call consumes the following media types via the Content-Type request header: +
    +
  • application/json
  • +
+ +

Request body

+
+ + +
Body Parameter
+
+ + + + +

Return type

+
+ APIResponse + +
+ + + +

Example data

+
Content-Type: application/json
+
""
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successful operation + APIResponse +

500

+ Server error + Error +
+
+
+
+ Up +
put /api/v1/alert/receiver/{receiver_id}
+
(updateAlertReceiverById)
+
Update alert receiver by ID
+ +

Path parameters

+
+
receiver_id (required)
+ +
Path Parameter
+ +

Consumes

+ This API call consumes the following media types via the Content-Type request header: +
    +
  • application/json
  • +
+ +

Request body

+
+ + +
Body Parameter
+
+ + + + +

Return type

+
+ APIResponse + +
+ + + +

Example data

+
Content-Type: application/json
+
""
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully updated the alert receiver + APIResponse +

500

+ Server error + Error +
+
+

DataSource

+
+
+ Up +
post /api/v1/graph/{graph_id}/datasource
+
(bindDatasourceInBatch)
+
Bind data sources in batches
+ +

Path parameters

+
+
graph_id (required)
+ +
Path Parameter
+ +

Consumes

+ This API call consumes the following media types via the Content-Type request header: +
    +
  • application/json
  • +
+ +

Request body

+
+
body SchemaMapping (required)
+ +
Body Parameter
+
+ + + + +

Return type

+
+ APIResponse + +
+ + + +

Example data

+
Content-Type: application/json
+
""
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successful bind the data sources + APIResponse +

400

+ Bad request + Error +

500

+ Server error + Error +
+
+
+
+ Up +
get /api/v1/graph/{graph_id}/datasource
+
(getDatasourceById)
+
Get data source by ID
+ +

Path parameters

+
+
graph_id (required)
+ +
Path Parameter
+ + + + + + +

Return type

+ + + + +

Example data

+
Content-Type: application/json
+
{
+  "edge_mappings" : [ {
+    "inputs" : [ "inputs", "inputs" ],
+    "source_vertex_mappings" : [ null, null ],
+    "destination_vertex_mappings" : [ null, null ],
+    "column_mappings" : [ null, null ],
+    "type_triplet" : {
+      "edge" : "edge",
+      "source_vertex" : "source_vertex",
+      "destination_vertex" : "destination_vertex"
+    }
+  }, {
+    "inputs" : [ "inputs", "inputs" ],
+    "source_vertex_mappings" : [ null, null ],
+    "destination_vertex_mappings" : [ null, null ],
+    "column_mappings" : [ null, null ],
+    "type_triplet" : {
+      "edge" : "edge",
+      "source_vertex" : "source_vertex",
+      "destination_vertex" : "destination_vertex"
+    }
+  } ],
+  "vertex_mappings" : [ {
+    "type_name" : "type_name",
+    "inputs" : [ "file:///path/to/file.csv", "file:///path/to/file.csv" ],
+    "column_mappings" : [ {
+      "column" : {
+        "name" : "name",
+        "index" : 0
+      },
+      "property" : "property"
+    }, {
+      "column" : {
+        "name" : "name",
+        "index" : 0
+      },
+      "property" : "property"
+    } ]
+  }, {
+    "type_name" : "type_name",
+    "inputs" : [ "file:///path/to/file.csv", "file:///path/to/file.csv" ],
+    "column_mappings" : [ {
+      "column" : {
+        "name" : "name",
+        "index" : 0
+      },
+      "property" : "property"
+    }, {
+      "column" : {
+        "name" : "name",
+        "index" : 0
+      },
+      "property" : "property"
+    } ]
+  } ]
+}
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successful returned all data sources + SchemaMapping +

Example data

+
Content-Type: application/json
+
{"vertex_mappings":[{"type_name":"person","inputs":["file:///path/to/person.csv"],"column_mappings":[{"column":{"index":0,"name":"id"},"property":"id"},{"column":{"index":1,"name":"name"},"property":"name"}]},{"type_name":"software","inputs":["file:///path/to/software.csv"],"column_mappings":[{"column":{"index":0,"name":"id"},"property":"id"},{"column":{"index":1,"name":"name"},"property":"name"}]}],"edge_mappings":[{"type_triplet":{"edge":"knows","source_vertex":"person","destination_vertex":"person"},"inputs":["file:///path/to/knows.csv"],"source_vertex_mappings":[{"column":{"index":0,"name":"id"},"property":"id"}],"destination_vertex_mappings":[{"column":{"index":1,"name":"id"},"property":"id"}],"column_mappings":[{"column":{"index":2,"name":"weight"},"property":"weight"}]},{"type_triplet":{"edge":"created","source_vertex":"person","destination_vertex":"software"},"inputs":["file:///path/to/created.csv"],"source_vertex_mappings":[{"column":{"index":0,"name":"id"},"property":"id"}],"destination_vertex_mappings":[{"column":{"index":1,"name":"id"},"property":"id"}],"column_mappings":[{"column":{"index":2,"name":"weight"},"property":"weight"}]}]}
+

500

+ Server error + Error +
+
+
+
+ Up +
delete /api/v1/graph/{graph_id}/datasource/edge/{type_name}
+
(unbindEdgeDatasource)
+
Unbind datas ource on an edge type
+ +

Path parameters

+
+
graph_id (required)
+ +
Path Parameter
type_name (required)
+ +
Path Parameter
+ + + + +

Query parameters

+
+
source_vertex_type (required)
+ +
Query Parameter
destination_vertex_type (required)
+ +
Query Parameter
+ + +

Return type

+
+ APIResponse + +
+ + + +

Example data

+
Content-Type: application/json
+
""
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully unbind the data source + APIResponse +

500

+ Server error + Error +
+
+
+
+ Up +
delete /api/v1/graph/{graph_id}/datasource/vertex/{type_name}
+
(unbindVertexDatasource)
+
Unbind data source on a vertex type
+ +

Path parameters

+
+
graph_id (required)
+ +
Path Parameter
type_name (required)
+ +
Path Parameter
+ + + + + + +

Return type

+
+ APIResponse + +
+ + + +

Example data

+
Content-Type: application/json
+
""
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully unbind the data source + APIResponse +

500

+ Server error + Error +
+
+

Deployment

+
+
+ Up +
get /api/v1/deployment
+
(getDeploymentInfo)
+
Deployment information
+ + + + + + + +

Return type

+ + + + +

Example data

+
Content-Type: application/json
+
{
+  "creation_time" : "creation_time",
+  "instance_name" : "instance_name",
+  "engine" : "Hiactor",
+  "cluster_type" : "HOSTS",
+  "storage" : "MutableCSR",
+  "version" : "version",
+  "frontend" : "Cypher/Gremlin"
+}
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully returned the deployment information + RunningDeploymentInfo +

Example data

+
Content-Type: application/json
+
{"cluster_type":"HOSTS","creation_time":"2024-01-01T00:00:00.000Z","instance_name":"demo","frontend":"Cypher/Gremlin","engine":"Hiactor","storage":"MutableCSR","version":"0.27.0"}
+

500

+ Server error + Error +
+
+
+
+ Up +
get /api/v1/deployment/status
+
(getDeploymentStatus)
+
Deployment status
+ + + + + + + +

Return type

+ + + + +

Example data

+
Content-Type: application/json
+
{
+  "nodes" : [ "", "" ],
+  "cluster_type" : "HOSTS"
+}
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully returned the deployment status + RunningDeploymentStatus +

Example data

+
Content-Type: application/json
+
{"cluster_type":"HOSTS","nodes":[{"name":"HOSTNAME-1","cpu_usage":83,"memory_usage":37.5,"disk_usage":97}]}
+

500

+ Server error + Error +
+
+

Graph

+
+
+ Up +
post /api/v1/graph/{graph_id}/schema/edge
+
(createEdgeType)
+
Create a edge type
+ +

Path parameters

+
+
graph_id (required)
+ +
Path Parameter
+ +

Consumes

+ This API call consumes the following media types via the Content-Type request header: +
    +
  • application/json
  • +
+ +

Request body

+
+
body CreateEdgeType (optional)
+ +
Body Parameter
+
+ + + + +

Return type

+
+ APIResponse + +
+ + + +

Example data

+
Content-Type: application/json
+
""
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successful created the edge type + APIResponse +

400

+ Bad request + Error +

500

+ Server error + Error +
+
+
+
+ Up +
post /api/v1/graph
+
(createGraph)
+
Create a new graph
+ + +

Consumes

+ This API call consumes the following media types via the Content-Type request header: +
    +
  • application/json
  • +
+ +

Request body

+
+
body CreateGraphRequest (required)
+ +
Body Parameter
+
+ + + + +

Return type

+ + + + +

Example data

+
Content-Type: application/json
+
{
+  "graph_id" : "graph_id"
+}
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ The graph was created + CreateGraphResponse +

400

+ Bad request + Error +

500

+ Server error + Error +
+
+
+
+ Up +
post /api/v1/graph/{graph_id}/schema/vertex
+
(createVertexType)
+
Create a vertex type
+ +

Path parameters

+
+
graph_id (required)
+ +
Path Parameter
+ +

Consumes

+ This API call consumes the following media types via the Content-Type request header: +
    +
  • application/json
  • +
+ +

Request body

+
+
body CreateVertexType (required)
+ +
Body Parameter
+
+ + + + +

Return type

+
+ APIResponse + +
+ + + +

Example data

+
Content-Type: application/json
+
""
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successful created a vertex type + APIResponse +

400

+ Bad request + Error +

500

+ Server error + Error +
+
+
+
+ Up +
delete /api/v1/graph/{graph_id}/schema/edge/{type_name}
+
(deleteEdgeTypeByName)
+
Delete edge type by name
+ +

Path parameters

+
+
graph_id (required)
+ +
Path Parameter
type_name (required)
+ +
Path Parameter
+ + + + +

Query parameters

+
+
source_vertex_type (required)
+ +
Query Parameter
destination_vertex_type (required)
+ +
Query Parameter
+ + +

Return type

+
+ APIResponse + +
+ + + +

Example data

+
Content-Type: application/json
+
""
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successful deleted the edge type + APIResponse +

500

+ Server error + Error +
+
+
+
+ Up +
delete /api/v1/graph/{graph_id}
+
(deleteGraphById)
+
Delete graph by ID
+ +

Path parameters

+
+
graph_id (required)
+ +
Path Parameter
+ + + + + + +

Return type

+
+ APIResponse + +
+ + + +

Example data

+
Content-Type: application/json
+
""
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully deleted the graph + APIResponse +

500

+ Server error + Error +
+
+
+
+ Up +
delete /api/v1/graph/{graph_id}/schema/vertex/{type_name}
+
(deleteVertexTypeByName)
+
Delete vertex type by name
+ +

Path parameters

+
+
graph_id (required)
+ +
Path Parameter
type_name (required)
+ +
Path Parameter
+ + + + + + +

Return type

+
+ APIResponse + +
+ + + +

Example data

+
Content-Type: application/json
+
""
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successful deleted the vertex type + APIResponse +

500

+ Server error + Error +
+
+
+
+ Up +
get /api/v1/graph/{graph_id}
+
(getGraphById)
+
Get graph by ID
+ +

Path parameters

+
+
graph_id (required)
+ +
Path Parameter
+ + + + + + +

Return type

+ + + + +

Example data

+
Content-Type: application/json
+
{
+  "creation_time" : "creation_time",
+  "schema" : {
+    "vertex_types" : [ "", "" ],
+    "edge_types" : [ "", "" ]
+  },
+  "stored_procedures" : [ "", "" ],
+  "name" : "name",
+  "description" : "description",
+  "schema_update_time" : "schema_update_time",
+  "id" : "id",
+  "store_type" : "mutable_csr",
+  "data_update_time" : "data_update_time"
+}
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully returned the graph + GetGraphResponse +

Example data

+
Content-Type: application/json
+
{"id":"GRAPHID","name":"demo","creation_time":"2024-01-01 00:00:00","schema_update_time":"2024-01-02 00:00:00","data_update_time":"2024-01-03 00:00:00","stored_procedures":[{"id":"STORED-PROCEDURE-ID","name":"stored_procedure_name","type":"cypher","query":"MATCH(a) return COUNT(a);","library":"/path/to/library","params":[{"name":"param1","type":{"string":{}}}],"returns":[{"name":"return1","type":{"PrimitiveType":"DT_SIGNED_INT64"}}],"bound_graph":"demo","runnable":true}],"schema":{"vertex_types":[{"type_id":0,"type_name":"person","properties":[{"property_id":0,"property_name":"id","property_type":{"string":{}}},{"property_id":1,"property_name":"name","property_type":{"string":{}}}],"primary_keys":["id"]},{"type_id":1,"type_name":"software","properties":[{"property_id":0,"property_name":"id","property_type":{"string":{}}},{"property_id":1,"property_name":"name","property_type":{"string":{}}}],"primary_keys":["id"]}],"edge_types":[{"type_id":0,"type_name":"knows","vertex_type_pair_relations":[{"source_vertex":"person","destination_vertex":"person","relation":"MANY_TO_MANY","x_csr_params":{"edge_storage_strategy":"ONLY_IN"}}],"properties":[{"property_id":0,"property_name":"weight","property_type":{"primitive_type":"DT_DOUBLE"}}]},{"type_id":1,"type_name":"created","vertex_type_pair_relations":[{"source_vertex":"person","destination_vertex":"software","relation":"MANY_TO_MANY","x_csr_params":{"edge_storage_strategy":"ONLY_IN"}}],"properties":[{"property_id":0,"property_name":"weight","property_type":{"primitive_type":"DT_DOUBLE"}}]}]}}
+

500

+ Server error + Error +
+
+
+
+ Up +
get /api/v1/graph/{graph_id}/schema
+
(getSchemaById)
+
Get graph schema by ID
+ +

Path parameters

+
+
graph_id (required)
+ +
Path Parameter
+ + + + + + +

Return type

+ + + + +

Example data

+
Content-Type: application/json
+
{
+  "vertex_types" : [ "", "" ],
+  "edge_types" : [ "", "" ]
+}
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully returned the graph schema + GetGraphSchemaResponse +

Example data

+
Content-Type: application/json
+
{"vertex_types":[{"type_id":0,"type_name":"person","properties":[{"property_id":0,"property_name":"id","property_type":{"string":{}}},{"property_id":1,"property_name":"name","property_type":{"string":{}}}],"primary_keys":["id"]},{"type_id":1,"type_name":"software","properties":[{"property_id":0,"property_name":"id","property_type":{"string":{}}},{"property_id":1,"property_name":"name","property_type":{"string":{}}}],"primary_keys":["id"]}],"edge_types":[{"type_id":0,"type_name":"knows","vertex_type_pair_relations":[{"source_vertex":"person","destination_vertex":"person","relation":"MANY_TO_MANY","x_csr_params":{"edge_storage_strategy":"ONLY_IN"}}],"properties":[{"property_id":0,"property_name":"weight","property_type":{"primitive_type":"DT_DOUBLE"}}]},{"type_id":1,"type_name":"created","vertex_type_pair_relations":[{"source_vertex":"person","destination_vertex":"software","relation":"MANY_TO_MANY","x_csr_params":{"edge_storage_strategy":"ONLY_IN"}}],"properties":[{"property_id":0,"property_name":"weight","property_type":{"primitive_type":"DT_DOUBLE"}}]}]}
+

500

+ Server error + Error +
+
+
+
+ Up +
post /api/v1/graph/{graph_id}/schema
+
(importSchemaById)
+
Import graph schema
+ +

Path parameters

+
+
graph_id (required)
+ +
Path Parameter
+ +

Consumes

+ This API call consumes the following media types via the Content-Type request header: +
    +
  • application/json
  • +
+ +

Request body

+
+
body CreateGraphSchemaRequest (required)
+ +
Body Parameter
+
+ + + + +

Return type

+
+ APIResponse + +
+ + + +

Example data

+
Content-Type: application/json
+
""
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successful imported the graph schema + APIResponse +

400

+ Bad request + Error +

500

+ Server error + Error +
+
+
+
+ Up +
get /api/v1/graph
+
(listGraphs)
+
List all graphs
+ + + + + + + +

Return type

+
+ array[GetGraphResponse] + +
+ + + +

Example data

+
Content-Type: application/json
+
[ {
+  "creation_time" : "creation_time",
+  "schema" : {
+    "vertex_types" : [ "", "" ],
+    "edge_types" : [ "", "" ]
+  },
+  "stored_procedures" : [ "", "" ],
+  "name" : "name",
+  "description" : "description",
+  "schema_update_time" : "schema_update_time",
+  "id" : "id",
+  "store_type" : "mutable_csr",
+  "data_update_time" : "data_update_time"
+}, {
+  "creation_time" : "creation_time",
+  "schema" : {
+    "vertex_types" : [ "", "" ],
+    "edge_types" : [ "", "" ]
+  },
+  "stored_procedures" : [ "", "" ],
+  "name" : "name",
+  "description" : "description",
+  "schema_update_time" : "schema_update_time",
+  "id" : "id",
+  "store_type" : "mutable_csr",
+  "data_update_time" : "data_update_time"
+} ]
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully returned all graphs + +

Example data

+
Content-Type: application/json
+
[{"id":"GRAPHID","name":"demo","creation_time":"2024-01-01 00:00:00","schema_update_time":"2024-01-02 00:00:00","data_update_time":"2024-01-03 00:00:00","stored_procedures":[{"id":"STORED-PROCEDURE-ID","name":"stored_procedure_name","type":"cypher","query":"MATCH(a) return COUNT(a);","library":"/path/to/library","params":[{"name":"param1","type":{"string":{}}}],"returns":[{"name":"return1","type":{"PrimitiveType":"DT_SIGNED_INT64"}}],"bound_graph":"demo","runnable":true}],"schema":{"vertex_types":[{"type_id":0,"type_name":"person","properties":[{"property_id":0,"property_name":"id","property_type":{"string":{}}},{"property_id":1,"property_name":"name","property_type":{"string":{}}}],"primary_keys":["id"]},{"type_id":1,"type_name":"software","properties":[{"property_id":0,"property_name":"id","property_type":{"string":{}}},{"property_id":1,"property_name":"name","property_type":{"string":{}}}],"primary_keys":["id"]}],"edge_types":[{"type_id":0,"type_name":"knows","vertex_type_pair_relations":[{"source_vertex":"person","destination_vertex":"person","relation":"MANY_TO_MANY","x_csr_params":{"edge_storage_strategy":"ONLY_IN"}}],"properties":[{"property_id":0,"property_name":"weight","property_type":{"primitive_type":"DT_DOUBLE"}}]},{"type_id":1,"type_name":"created","vertex_type_pair_relations":[{"source_vertex":"person","destination_vertex":"software","relation":"MANY_TO_MANY","x_csr_params":{"edge_storage_strategy":"ONLY_IN"}}],"properties":[{"property_id":0,"property_name":"weight","property_type":{"primitive_type":"DT_DOUBLE"}}]}]}}]
+

500

+ Server error + Error +
+
+

Job

+
+
+ Up +
delete /api/v1/job/{job_id}
+
(deleteJobById)
+
Delete job by ID
+ +

Path parameters

+
+
job_id (required)
+ +
Path Parameter
+ + + + + + +

Return type

+
+ APIResponse + +
+ + + +

Example data

+
Content-Type: application/json
+
""
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfuly cancelled the job + APIResponse +

500

+ Server error + Error +
+
+
+
+ Up +
get /api/v1/graph/{graph_id}/dataloading/config
+
(getDataloadingJobConfig)
+
Get the data loading configuration
+ +

Path parameters

+
+
graph_id (required)
+ +
Path Parameter
+ + + + + + +

Return type

+ + + + +

Example data

+
Content-Type: application/json
+
{
+  "schedule" : "schedule",
+  "loading_config" : {
+    "format" : {
+      "metadata" : "",
+      "type" : "type"
+    },
+    "import_option" : "overwrite"
+  },
+  "vertices" : [ {
+    "type_name" : "type_name"
+  }, {
+    "type_name" : "type_name"
+  } ],
+  "repeat" : "once",
+  "edges" : [ {
+    "type_name" : "type_name",
+    "source_vertex" : "source_vertex",
+    "destination_vertex" : "destination_vertex"
+  }, {
+    "type_name" : "type_name",
+    "source_vertex" : "source_vertex",
+    "destination_vertex" : "destination_vertex"
+  } ]
+}
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully returned the dataloading job configuration + DataloadingJobConfig +

500

+ Server error + Error +
+
+
+
+ Up +
get /api/v1/job/{job_id}
+
(getJobById)
+
Get job status by ID
+ +

Path parameters

+
+
job_id (required)
+ +
Path Parameter
+ + + + + + +

Return type

+
+ JobStatus + +
+ + + +

Example data

+
Content-Type: application/json
+
{
+  "start_time" : "start_time",
+  "log" : "log",
+  "end_time" : "end_time",
+  "id" : "id",
+  "detail" : "",
+  "type" : "type",
+  "status" : "RUNNING"
+}
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully returned the job status + JobStatus +

500

+ Server error + Error +
+
+
+
+ Up +
get /api/v1/job
+
(listJobs)
+
List all jobs
+ + + + + + + +

Return type

+
+ array[JobStatus] + +
+ + + +

Example data

+
Content-Type: application/json
+
[ {
+  "start_time" : "start_time",
+  "log" : "log",
+  "end_time" : "end_time",
+  "id" : "id",
+  "detail" : "",
+  "type" : "type",
+  "status" : "RUNNING"
+}, {
+  "start_time" : "start_time",
+  "log" : "log",
+  "end_time" : "end_time",
+  "id" : "id",
+  "detail" : "",
+  "type" : "type",
+  "status" : "RUNNING"
+} ]
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successful returned all the jobs + +

Example data

+
Content-Type: application/json
+
[{"id":"JOB-QWERTYUIOPASDFGH-1","type":"DATA IMPORT","status":"RUNNING","start_time":"2024-02-24T00:00:00.000Z","log":"logging...","detail":{"graph_name":"demo"}},{"id":"JOB-QWERTYUIOPASDFGH-2","type":"DATA IMPORT","status":"CANCELLED","start_time":"2024-02-24T00:00:00.000Z","log":"logging...","detail":{"graph_name":"demo"}},{"id":"JOB-QWERTYUIOPASDFGH-3","type":"DATA IMPORT","status":"SUCCESS","start_time":"2024-02-24T00:00:00.000Z","end_time":"2024-02-24T12:00:00.000Z","detail":{"graph_name":"demo"}},{"id":"JOB-QWERTYUIOPASDFGH-4","type":"DATA IMPORT","status":"FAILED","start_time":"2024-02-24T00:00:00.000Z","end_time":"2024-02-24T12:00:00.000Z","log":"logging...","detail":{"graph_name":"demo"}},{"id":"JOB-QWERTYUIOPASDFGH-5","type":"DATA IMPORT","status":"WAITING","detail":{"graph_name":"demo"}}]
+

500

+ Server error + Error +
+
+
+
+ Up +
post /api/v1/graph/{graph_id}/dataloading
+
(submitDataloadingJob)
+
Submit a dataloading job
+ +

Path parameters

+
+
graph_id (required)
+ +
Path Parameter
+ +

Consumes

+ This API call consumes the following media types via the Content-Type request header: +
    +
  • application/json
  • +
+ +

Request body

+
+
body DataloadingJobConfig (required)
+ +
Body Parameter
+
+ + + + +

Return type

+ + + + +

Example data

+
Content-Type: application/json
+
{
+  "job_id" : "job_id"
+}
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully submitted the job + CreateDataloadingJobResponse +

400

+ Bad request + Error +

500

+ Server error + Error +
+
+

Service

+
+
+ Up +
get /api/v1/graph/{graph_id}/service
+
(getServiceStatusById)
+
Get service status by graph ID
+ +

Path parameters

+
+
graph_id (required)
+ +
Path Parameter
+ + + + + + +

Return type

+ + + + +

Example data

+
Content-Type: application/json
+
{
+  "start_time" : "start_time",
+  "graph_id" : "graph_id",
+  "sdk_endpoints" : {
+    "gremlin" : "gremlin",
+    "cypher" : "cypher",
+    "hqps" : "hqps",
+    "grpc" : "grpc"
+  },
+  "status" : "Running"
+}
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully returned the service status + ServiceStatus +

Example data

+
Content-Type: application/json
+
{"graph_id":"GRAPHID","status":"Running","sdk_endpoints":{"cypher":"neo4j://mock.api.cypher:7676","gremin":"ws://mock.api.gremlin/gremlin","hqps":"http://mock.api.hqps:10000"},"start_time":"2024-01-01 00:00:00"}
+

500

+ Server error + Error +
+
+
+
+ Up +
get /api/v1/service
+
(listServiceStatus)
+
List all service status
+ + + + + + + +

Return type

+
+ array[ServiceStatus] + +
+ + + +

Example data

+
Content-Type: application/json
+
[ {
+  "start_time" : "start_time",
+  "graph_id" : "graph_id",
+  "sdk_endpoints" : {
+    "gremlin" : "gremlin",
+    "cypher" : "cypher",
+    "hqps" : "hqps",
+    "grpc" : "grpc"
+  },
+  "status" : "Running"
+}, {
+  "start_time" : "start_time",
+  "graph_id" : "graph_id",
+  "sdk_endpoints" : {
+    "gremlin" : "gremlin",
+    "cypher" : "cypher",
+    "hqps" : "hqps",
+    "grpc" : "grpc"
+  },
+  "status" : "Running"
+} ]
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully returned all service status + +

Example data

+
Content-Type: application/json
+
[{"graph_id":"GRAPHID","status":"Running","sdk_endpoints":{"cypher":"neo4j://mock.api.cypher:7676","gremin":"ws://mock.api.gremlin/gremlin","hqps":"http://mock.api.hqps:10000"},"start_time":"2024-01-01 00:00:00"}]
+

500

+ Server error + Error +
+
+
+
+ Up +
post /api/v1/service/restart
+
(restartService)
+
Restart current service
+ + + + + + + +

Return type

+
+ APIResponse + +
+ + + +

Example data

+
Content-Type: application/json
+
""
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully restarted the service + APIResponse +

500

+ Server error + Error +
+
+
+
+ Up +
post /api/v1/service/start
+
(startService)
+
Start service
+ + +

Consumes

+ This API call consumes the following media types via the Content-Type request header: +
    +
  • application/json
  • +
+ +

Request body

+
+
body StartServiceRequest (optional)
+ +
Body Parameter
+
+ + + + +

Return type

+
+ APIResponse + +
+ + + +

Example data

+
Content-Type: application/json
+
""
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully started the service + APIResponse +

400

+ Bad request + Error +

500

+ Server error + Error +
+
+
+
+ Up +
post /api/v1/service/stop
+
(stopService)
+
Stop current service
+ + + + + + + +

Return type

+
+ APIResponse + +
+ + + +

Example data

+
Content-Type: application/json
+
""
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully stopped the service + APIResponse +

500

+ Server error + Error +
+
+

StoredProcedure

+
+
+ Up +
post /api/v1/graph/{graph_id}/storedproc
+
(createStoredProcedure)
+
Create a new stored procedure on a certain graph
+ +

Path parameters

+
+
graph_id (required)
+ +
Path Parameter
+ +

Consumes

+ This API call consumes the following media types via the Content-Type request header: +
    +
  • application/json
  • +
+ +

Request body

+
+
body CreateStoredProcRequest (required)
+ +
Body Parameter
+
+ + + + +

Return type

+ + + + +

Example data

+
Content-Type: application/json
+
{
+  "stored_procedure_id" : "stored_procedure_id"
+}
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully created a stored procedure + CreateStoredProcResponse +

400

+ Bad request + Error +

500

+ Server error + Error +
+
+
+
+ Up +
delete /api/v1/graph/{graph_id}/storedproc/{stored_procedure_id}
+
(deleteStoredProcedureById)
+
Delete a stored procedure by ID
+ +

Path parameters

+
+
graph_id (required)
+ +
Path Parameter
stored_procedure_id (required)
+ +
Path Parameter
+ + + + + + +

Return type

+
+ APIResponse + +
+ + + +

Example data

+
Content-Type: application/json
+
""
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully deleted the stored procedure + APIResponse +

500

+ Server error + Error +
+
+
+
+ Up +
get /api/v1/graph/{graph_id}/storedproc/{stored_procedure_id}
+
(getStoredProcedureById)
+
Get a stored procedure by ID
+ +

Path parameters

+
+
graph_id (required)
+ +
Path Parameter
stored_procedure_id (required)
+ +
Path Parameter
+ + + + + + +

Return type

+ + + + +

Example data

+
Content-Type: application/json
+
""
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully returned the stored procedure + GetStoredProcResponse +

Example data

+
Content-Type: application/json
+
{"id":"STORED-PROCEDURE-ID","name":"stored_procedure_name","type":"cypher","query":"MATCH(a) return COUNT(a);","library":"/path/to/library","params":[{"name":"param1","type":{"string":{}}}],"returns":[{"name":"return1","type":{"PrimitiveType":"DT_SIGNED_INT64"}}],"bound_graph":"demo","runnable":true}
+

500

+ Server error + Error +
+
+
+
+ Up +
get /api/v1/graph/{graph_id}/storedproc
+
(listStoredProcedures)
+
List all stored procedures on a certain graph
+ +

Path parameters

+
+
graph_id (required)
+ +
Path Parameter
+ + + + + + +

Return type

+
+ array[GetStoredProcResponse] + +
+ + + +

Example data

+
Content-Type: application/json
+
[ "", "" ]
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successful operation + +

Example data

+
Content-Type: application/json
+
[{"id":"STORED-PROCEDUREID-1","name":"stored_procedure_name_1","type":"cypher","query":"MATCH(a) return COUNT(a);","library":"/path/to/library","params":[{"name":"param1","type":{"string":{}}}],"returns":[{"name":"return1","type":{"PrimitiveType":"DT_SIGNED_INT64"}}],"bound_graph":"demo","runnable":true},{"id":"STORED-PROCEDUREID-2","name":"stored_procedure_name_2","type":"cypher","query":"MATCH(a) return COUNT(a);","library":"/path/to/library","params":[{"name":"param1","type":{"string":{}}}],"returns":[{"name":"return1","type":{"PrimitiveType":"DT_SIGNED_INT64"}}],"bound_graph":"demo","runnable":false}]
+

400

+ Bad request + Error +

500

+ Server error + Error +
+
+
+
+ Up +
put /api/v1/graph/{graph_id}/storedproc/{stored_procedure_id}
+
(updateStoredProcedureById)
+
Update a stored procedure by ID
+ +

Path parameters

+
+
graph_id (required)
+ +
Path Parameter
stored_procedure_id (required)
+ +
Path Parameter
+ +

Consumes

+ This API call consumes the following media types via the Content-Type request header: +
    +
  • application/json
  • +
+ +

Request body

+
+
body UpdateStoredProcRequest (optional)
+ +
Body Parameter
+
+ + + + +

Return type

+
+ APIResponse + +
+ + + +

Example data

+
Content-Type: application/json
+
""
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ Successfully updated the stored procedure + APIResponse +

500

+ Server error + Error +
+
+

Utils

+
+
+ Up +
post /api/v1/file/uploading
+
(uploadFile)
+
+ + +

Consumes

+ This API call consumes the following media types via the Content-Type request header: +
    +
  • multipart/form-data
  • +
+ + + + +

Form parameters

+
+
filestorage (required)
+ +
Form Parameter — format: binary
+ +

Return type

+ + + + +

Example data

+
Content-Type: application/json
+
{
+  "file_path" : "file_path"
+}
+ +

Produces

+ This API call produces the following media types according to the Accept request header; + the media type will be conveyed by the Content-Type response header. +
    +
  • application/json
  • +
+ +

Responses

+

200

+ successful operation + UploadFileResponse +

500

+ Server error + Error +
+
+ +

Models

+ [ Jump to Methods ] + +

Table of Contents

+
    +
  1. APIResponse
  2. +
  3. AnyValue
  4. +
  5. BaseEdgeType
  6. +
  7. BaseEdgeType_vertex_type_pair_relations
  8. +
  9. BaseEdgeType_x_csr_params
  10. +
  11. BasePropertyMeta
  12. +
  13. BaseVertexType
  14. +
  15. BaseVertexType_x_csr_params
  16. +
  17. ColumnMapping
  18. +
  19. ColumnMapping_column
  20. +
  21. CreateAlertReceiverRequest
  22. +
  23. CreateAlertRuleRequest
  24. +
  25. CreateDataloadingJobResponse
  26. +
  27. CreateEdgeType
  28. +
  29. CreateGraphRequest
  30. +
  31. CreateGraphResponse
  32. +
  33. CreateGraphSchemaRequest
  34. +
  35. CreatePropertyMeta
  36. +
  37. CreateStoredProcRequest
  38. +
  39. CreateStoredProcResponse
  40. +
  41. CreateVertexType
  42. +
  43. DataloadingJobConfig
  44. +
  45. DataloadingJobConfig_edges
  46. +
  47. DataloadingJobConfig_loading_config
  48. +
  49. DataloadingJobConfig_loading_config_format
  50. +
  51. DataloadingJobConfig_vertices
  52. +
  53. EdgeMapping
  54. +
  55. EdgeMapping_type_triplet
  56. +
  57. Error
  58. +
  59. GSDataType
  60. +
  61. GetAlertMessageResponse
  62. +
  63. GetAlertReceiverResponse
  64. +
  65. GetAlertRuleResponse
  66. +
  67. GetEdgeType
  68. +
  69. GetGraphResponse
  70. +
  71. GetGraphSchemaResponse
  72. +
  73. GetPropertyMeta
  74. +
  75. GetStoredProcResponse
  76. +
  77. GetVertexType
  78. +
  79. JobStatus
  80. +
  81. LongText
  82. +
  83. NodeStatus
  84. +
  85. Parameter
  86. +
  87. PrimitiveType
  88. +
  89. RunningDeploymentInfo
  90. +
  91. RunningDeploymentStatus
  92. +
  93. SchemaMapping
  94. +
  95. ServiceStatus
  96. +
  97. ServiceStatus_sdk_endpoints
  98. +
  99. StartServiceRequest
  100. +
  101. StoredProcedureMeta
  102. +
  103. StringType
  104. +
  105. UpdateAlertMessageStatusRequest
  106. +
  107. UpdateStoredProcRequest
  108. +
  109. UploadFileResponse
  110. +
  111. VertexMapping
  112. +
  113. file_uploading_body
  114. +
+ +
+

APIResponse Up

+ +
+
+
+
+

AnyValue Up

+ +
+
+
+
+

BaseEdgeType Up

+ +
+
type_name
+
vertex_type_pair_relations
+
directed (optional)
+
primary_keys (optional)
+
+
+
+

BaseEdgeType_vertex_type_pair_relations Up

+ +
+
source_vertex
+
destination_vertex
+
relation
+
Enum:
+
MANY_TO_MANY
ONE_TO_MANY
MANY_TO_ONE
ONE_TO_ONE
+
x_csr_params (optional)
+
+
+
+

BaseEdgeType_x_csr_params Up

+
Used for storage optimization
+
+
edge_storage_strategy (optional)
+
Enum:
+
ONLY_IN
ONLY_OUT
BOTH_OUT_IN
+
+
+
+

BasePropertyMeta Up

+ +
+
property_name
+
property_type
+
nullable (optional)
+
default_value (optional)
+
description (optional)
+
+
+
+

BaseVertexType Up

+ +
+
type_name
+
primary_keys
+
x_csr_params (optional)
+
+
+
+

BaseVertexType_x_csr_params Up

+
Used for storage optimization
+
+
max_vertex_num (optional)
+
+
+
+

ColumnMapping Up

+ +
+
column
+
property
String must align with the schema
+
+
+
+

ColumnMapping_column Up

+ +
+
index (optional)
Integer format: int32
+
name (optional)
+
+
+
+

CreateAlertReceiverRequest Up

+ +
+
type
+
Enum:
+
webhook
+
webhook_url
+
at_user_ids
+
is_at_all
+
enable
+
+
+
+

CreateAlertRuleRequest Up

+ +
+
name
+
severity
+
Enum:
+
warning
emergency
+
metric_type
+
Enum:
+
node
service
+
conditions_description
+
frequency
Integer (mins)
+
enable
+
+
+ +
+

CreateEdgeType Up

+ +
+
properties
+
description (optional)
+
type_name
+
vertex_type_pair_relations
+
directed (optional)
+
primary_keys (optional)
+
+
+
+

CreateGraphRequest Up

+ +
+
name (optional)
+
description (optional)
+
stored_procedures (optional)
+
schema (optional)
+
+
+
+

CreateGraphResponse Up

+ +
+
graph_id
+
+
+ +
+

CreatePropertyMeta Up

+ +
+
property_name
+
property_type
+
nullable (optional)
+
default_value (optional)
+
description (optional)
+
+
+
+

CreateStoredProcRequest Up

+ +
+
name
+
description (optional)
+
type
+
Enum:
+
cpp
cypher
+
query
+
+
+
+

CreateStoredProcResponse Up

+ +
+
stored_procedure_id
+
+
+
+

CreateVertexType Up

+ +
+
properties
+
description (optional)
+
type_name
+
primary_keys
+
x_csr_params (optional)
+
+
+
+

DataloadingJobConfig Up

+ +
+
loading_config
+
vertices
+
edges
+
schedule (optional)
String format with '2023-02-21 11:56:30'
+
repeat (optional)
+
Enum:
+
once
day
week
+
+
+
+

DataloadingJobConfig_edges Up

+ +
+
type_name (optional)
+
source_vertex (optional)
+
destination_vertex (optional)
+
+
+
+

DataloadingJobConfig_loading_config Up

+ +
+
import_option (optional)
+
Enum:
+
init
overwrite
+
example: overwrite
+
format (optional)
+
+
+
+

DataloadingJobConfig_loading_config_format Up

+ +
+
type (optional)
+
metadata (optional)
+
+
+
+

DataloadingJobConfig_vertices Up

+ +
+
type_name (optional)
+
+
+
+

EdgeMapping Up

+ +
+
type_triplet
+
inputs
+
source_vertex_mappings
+
destination_vertex_mappings
+
column_mappings (optional)
+
+
+
+

EdgeMapping_type_triplet Up

+
source label -&gt; [edge label] -&gt; destination label
+
+
edge
+
source_vertex
+
destination_vertex
+
+
+
+

Error Up

+ +
+
code
Integer Error code format: int32
+
message
String Error message
+
+
+
+

GSDataType Up

+ +
+
+
+
+

GetAlertMessageResponse Up

+ +
+
id
String Generated in server side
+
alert_name
+
severity
+
Enum:
+
warning
emergency
+
metric_type
+
Enum:
+
node
service
+
target
+
trigger_time
+
status
+
Enum:
+
unsolved
solved
dealing
+
message
+
+
+
+

GetAlertReceiverResponse Up

+ +
+
id
+
message
String Error message generated in server side
+
type
+
Enum:
+
webhook
+
webhook_url
+
at_user_ids
+
is_at_all
+
enable
+
+
+
+

GetAlertRuleResponse Up

+ +
+
id
+
name
+
severity
+
Enum:
+
warning
emergency
+
metric_type
+
Enum:
+
node
service
+
conditions_description
+
frequency
Integer (mins)
+
enable
+
+
+
+

GetEdgeType Up

+ +
+
type_id
Integer format: int32
+
properties
+
description (optional)
+
type_name
+
vertex_type_pair_relations
+
directed (optional)
+
primary_keys (optional)
+
+
+
+

GetGraphResponse Up

+ +
+
id
+
name
+
description (optional)
+
store_type (optional)
+
Enum:
+
mutable_csr
+
creation_time
+
data_update_time
+
schema_update_time
+
stored_procedures (optional)
+
schema
+
+
+
+

GetGraphSchemaResponse Up

+ +
+
vertex_types
+
edge_types
+
+
+
+

GetPropertyMeta Up

+ +
+
property_id
Integer format: int32
+
property_name
+
property_type
+
nullable (optional)
+
default_value (optional)
+
description (optional)
+
+
+
+

GetStoredProcResponse Up

+ +
+
bound_graph
+
runnable
+
id
+
library
+
params
+
returns
+
+
+
+

GetVertexType Up

+ +
+
type_id
Integer format: int32
+
properties
+
description (optional)
+
type_name
+
primary_keys
+
x_csr_params (optional)
+
+
+
+

JobStatus Up

+ +
+
id
+
type
+
status
+
Enum:
+
RUNNING
SUCCESS
FAILED
CANCELLED
WAITING
+
start_time (optional)
+
end_time (optional)
+
log (optional)
String logview URL or log string
+
detail (optional)
+
+
+
+

LongText Up

+ +
+
long_text
+
+
+
+

NodeStatus Up

+ +
+
name
+
cpu_usage
Double format: double
+
memory_usage
Double format: double
+
disk_usage
Double format: double
+
+
+
+

Parameter Up

+ +
+
name
+
type
+
+
+
+

PrimitiveType Up

+ +
+
primitive_type
+
Enum:
+
DT_SIGNED_INT32
DT_UNSIGNED_INT32
DT_SIGNED_INT64
DT_UNSIGNED_INT64
DT_BOOL
DT_FLOAT
DT_DOUBLE
+
+
+
+

RunningDeploymentInfo Up

+ +
+
instance_name
+
cluster_type
+
Enum:
+
HOSTS
KUBERNETES
+
version
+
creation_time
+
frontend
+
Enum:
+
Cypher/Gremlin
AnalyticalApps
+
engine
+
Enum:
+
Hiactor
Gaia
+
storage
+
Enum:
+
MutableCSR
+
+
+
+

RunningDeploymentStatus Up

+ +
+
cluster_type
+
Enum:
+
HOSTS
KUBERNETES
+
nodes
+
items oneOf: + NodeStatus    +
+
+
+
+

SchemaMapping Up

+ +
+
vertex_mappings
+
edge_mappings
+
+
+
+

ServiceStatus Up

+ +
+
graph_id
+
status
+
Enum:
+
Running
Stopped
+
sdk_endpoints (optional)
+
start_time (optional)
+
+
+
+

ServiceStatus_sdk_endpoints Up

+ +
+
cypher (optional)
+
gremlin (optional)
+
hqps (optional)
+
grpc (optional)
+
+
+
+

StartServiceRequest Up

+ +
+
graph_id (optional)
+
+
+
+

StoredProcedureMeta Up

+ +
+
id
+
library
+
params
+
returns
+
name
+
description (optional)
+
type
+
Enum:
+
cpp
cypher
+
query
+
+
+
+

StringType Up

+ +
+
string
+
oneOf: + LongText    +
+
+
+
+

UpdateAlertMessageStatusRequest Up

+ +
+
message_ids
+
status
+
Enum:
+
unsolved
solved
dealing
+
+
+
+

UpdateStoredProcRequest Up

+ +
+
description
+
+
+
+

UploadFileResponse Up

+ +
+
file_path
+
+
+
+

VertexMapping Up

+ +
+
type_name
+
inputs
+
column_mappings
+
+
+
+

file_uploading_body Up

+ +
+
filestorage (optional)
byte[] format: binary
+
+
+ + diff --git a/docs/conf.py b/docs/conf.py index 0be5e15d3e66..1f57a7e1add8 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -42,7 +42,6 @@ 'sphinx.ext.autosectionlabel', 'sphinx_panels', 'sphinxemoji.sphinxemoji', - "sphinxext.opengraph", "sphinx_copybutton", 'sphinx_ext', ] diff --git a/docs/flex/coordinator.md b/docs/flex/coordinator.md new file mode 100644 index 000000000000..d1290a7154c4 --- /dev/null +++ b/docs/flex/coordinator.md @@ -0,0 +1,11 @@ +# GraphScope Coordinator + +The GraphScope Coordinator serves as a centralized entry point for users, providing a RESTful API that follows the Swagger specification. It supports multiple language SDKs, including Python, and offers a unified interface. The main purpose of the Coordinator is to abstract and standardize the underlying engines and storage systems, shielding users from their complexities. This allows users to interact with the GraphScope platform through a simplified and consistent set of APIs, making it easier for users to understand and utilize the functionalities provided by GraphScope. + +```{toctree} arguments +--- +caption: +maxdepth: 2 +--- +coordinator/restful_api +``` diff --git a/docs/flex/coordinator/restful_api.rst b/docs/flex/coordinator/restful_api.rst new file mode 100644 index 000000000000..9dbc31b3b882 --- /dev/null +++ b/docs/flex/coordinator/restful_api.rst @@ -0,0 +1,6 @@ +Coordinator RESTFul API +----------------------- + +.. raw:: html + +
diff --git a/docs/index.rst b/docs/index.rst index 9eaf7edb8328..0ffd847465d0 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -49,6 +49,7 @@ and the vineyard store that offers efficient in-memory data transfers. :maxdepth: 1 :caption: GraphScope Flex + flex/coordinator flex/interactive_intro .. toctree:: diff --git a/flex/coordinator/.openapi-generator/FILES b/flex/coordinator/.openapi-generator/FILES index 4130fa8a5154..651798f63192 100644 --- a/flex/coordinator/.openapi-generator/FILES +++ b/flex/coordinator/.openapi-generator/FILES @@ -24,9 +24,9 @@ gs_flex_coordinator/models/create_edge_type.py gs_flex_coordinator/models/create_graph_request.py gs_flex_coordinator/models/create_graph_response.py gs_flex_coordinator/models/create_graph_schema_request.py -gs_flex_coordinator/models/create_procedure_request.py -gs_flex_coordinator/models/create_procedure_response.py gs_flex_coordinator/models/create_property_meta.py +gs_flex_coordinator/models/create_stored_proc_request.py +gs_flex_coordinator/models/create_stored_proc_response.py gs_flex_coordinator/models/create_vertex_type.py gs_flex_coordinator/models/dataloading_job_config.py gs_flex_coordinator/models/dataloading_job_config_edges_inner.py @@ -42,15 +42,18 @@ gs_flex_coordinator/models/get_alert_rule_response.py gs_flex_coordinator/models/get_edge_type.py gs_flex_coordinator/models/get_graph_response.py gs_flex_coordinator/models/get_graph_schema_response.py -gs_flex_coordinator/models/get_procedure_response.py gs_flex_coordinator/models/get_property_meta.py +gs_flex_coordinator/models/get_stored_proc_response.py gs_flex_coordinator/models/get_vertex_type.py gs_flex_coordinator/models/gs_data_type.py gs_flex_coordinator/models/job_status.py gs_flex_coordinator/models/long_text.py +gs_flex_coordinator/models/node_status.py gs_flex_coordinator/models/parameter.py gs_flex_coordinator/models/primitive_type.py gs_flex_coordinator/models/running_deployment_info.py +gs_flex_coordinator/models/running_deployment_status.py +gs_flex_coordinator/models/running_deployment_status_nodes_inner.py gs_flex_coordinator/models/schema_mapping.py gs_flex_coordinator/models/service_status.py gs_flex_coordinator/models/service_status_sdk_endpoints.py @@ -59,7 +62,7 @@ gs_flex_coordinator/models/stored_procedure_meta.py gs_flex_coordinator/models/string_type.py gs_flex_coordinator/models/string_type_string.py gs_flex_coordinator/models/update_alert_message_status_request.py -gs_flex_coordinator/models/update_procedure_request.py +gs_flex_coordinator/models/update_stored_proc_request.py gs_flex_coordinator/models/upload_file_response.py gs_flex_coordinator/models/vertex_mapping.py gs_flex_coordinator/openapi/openapi.yaml diff --git a/flex/coordinator/gs_flex_coordinator/controllers/deployment_controller.py b/flex/coordinator/gs_flex_coordinator/controllers/deployment_controller.py index 91880161ba09..0a8998018be1 100644 --- a/flex/coordinator/gs_flex_coordinator/controllers/deployment_controller.py +++ b/flex/coordinator/gs_flex_coordinator/controllers/deployment_controller.py @@ -5,6 +5,7 @@ from gs_flex_coordinator.models.error import Error # noqa: E501 from gs_flex_coordinator.models.running_deployment_info import RunningDeploymentInfo # noqa: E501 +from gs_flex_coordinator.models.running_deployment_status import RunningDeploymentStatus # noqa: E501 from gs_flex_coordinator import util from gs_flex_coordinator.core import client_wrapper @@ -21,3 +22,14 @@ def get_deployment_info(): # noqa: E501 :rtype: Union[RunningDeploymentInfo, Tuple[RunningDeploymentInfo, int], Tuple[RunningDeploymentInfo, int, Dict[str, str]] """ return client_wrapper.get_deployment_info() + + +def get_deployment_status(): # noqa: E501 + """get_deployment_status + + Deployment status # noqa: E501 + + + :rtype: Union[RunningDeploymentStatus, Tuple[RunningDeploymentStatus, int], Tuple[RunningDeploymentStatus, int, Dict[str, str]] + """ + return client_wrapper.get_deployment_status() diff --git a/flex/coordinator/gs_flex_coordinator/controllers/procedure_controller.py b/flex/coordinator/gs_flex_coordinator/controllers/procedure_controller.py deleted file mode 100644 index d9b9e5a259ae..000000000000 --- a/flex/coordinator/gs_flex_coordinator/controllers/procedure_controller.py +++ /dev/null @@ -1,98 +0,0 @@ -import connexion -from typing import Dict -from typing import Tuple -from typing import Union - -from gs_flex_coordinator.models.create_procedure_request import CreateProcedureRequest # noqa: E501 -from gs_flex_coordinator.models.create_procedure_response import CreateProcedureResponse # noqa: E501 -from gs_flex_coordinator.models.error import Error # noqa: E501 -from gs_flex_coordinator.models.get_procedure_response import GetProcedureResponse # noqa: E501 -from gs_flex_coordinator.models.update_procedure_request import UpdateProcedureRequest # noqa: E501 -from gs_flex_coordinator import util - -from gs_flex_coordinator.core import client_wrapper -from gs_flex_coordinator.core import handle_api_exception - - -@handle_api_exception() -def create_procedure(graph_id, create_procedure_request): # noqa: E501 - """create_procedure - - Create a new stored procedure on a certain graph # noqa: E501 - - :param graph_id: - :type graph_id: str - :param create_procedure_request: - :type create_procedure_request: dict | bytes - - :rtype: Union[CreateProcedureResponse, Tuple[CreateProcedureResponse, int], Tuple[CreateProcedureResponse, int, Dict[str, str]] - """ - if connexion.request.is_json: - create_procedure_request = CreateProcedureRequest.from_dict(connexion.request.get_json()) # noqa: E501 - return client_wrapper.create_procedure(graph_id, create_procedure_request) - - -@handle_api_exception() -def delete_procedure_by_id(graph_id, procedure_id): # noqa: E501 - """delete_procedure_by_id - - Delete a stored procedure by ID # noqa: E501 - - :param graph_id: - :type graph_id: str - :param procedure_id: - :type procedure_id: str - - :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] - """ - return client_wrapper.delete_procedure_by_id(graph_id, procedure_id) - - -@handle_api_exception() -def get_procedure_by_id(graph_id, procedure_id): # noqa: E501 - """get_procedure_by_id - - Get a stored procedure by ID # noqa: E501 - - :param graph_id: - :type graph_id: str - :param procedure_id: - :type procedure_id: str - - :rtype: Union[GetProcedureResponse, Tuple[GetProcedureResponse, int], Tuple[GetProcedureResponse, int, Dict[str, str]] - """ - return client_wrapper.get_procedure_by_id(graph_id, procedure_id) - - -@handle_api_exception() -def list_procedures(graph_id): # noqa: E501 - """list_procedures - - List all stored procedures on a certain graph # noqa: E501 - - :param graph_id: - :type graph_id: str - - :rtype: Union[List[GetProcedureResponse], Tuple[List[GetProcedureResponse], int], Tuple[List[GetProcedureResponse], int, Dict[str, str]] - """ - return client_wrapper.list_procedures(graph_id) - - -@handle_api_exception() -def update_procedure_by_id(graph_id, procedure_id, update_procedure_request=None): # noqa: E501 - """update_procedure_by_id - - Update a stored procedure by ID # noqa: E501 - - :param graph_id: - :type graph_id: str - :param procedure_id: - :type procedure_id: str - :param update_procedure_request: - :type update_procedure_request: dict | bytes - - :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] - """ - if connexion.request.is_json: - update_procedure_request = UpdateProcedureRequest.from_dict(connexion.request.get_json()) # noqa: E501 - return client_wrapper.update_procedure_by_id(graph_id, procedure_id, update_procedure_request) diff --git a/flex/coordinator/gs_flex_coordinator/controllers/service_controller.py b/flex/coordinator/gs_flex_coordinator/controllers/service_controller.py index fe769898162c..324b4905262c 100644 --- a/flex/coordinator/gs_flex_coordinator/controllers/service_controller.py +++ b/flex/coordinator/gs_flex_coordinator/controllers/service_controller.py @@ -12,16 +12,28 @@ from gs_flex_coordinator.core import handle_api_exception -@handle_api_exception() -def get_service_status(): # noqa: E501 - """get_service_status +def get_service_status_by_id(graph_id): # noqa: E501 + """get_service_status_by_id - Get service status # noqa: E501 + Get service status by graph ID # noqa: E501 + :param graph_id: + :type graph_id: str :rtype: Union[ServiceStatus, Tuple[ServiceStatus, int], Tuple[ServiceStatus, int, Dict[str, str]] """ - return client_wrapper.get_service_status() + return client_wrapper.get_service_status_by_id(graph_id) + + +def list_service_status(): # noqa: E501 + """list_service_status + + List all service status # noqa: E501 + + + :rtype: Union[List[ServiceStatus], Tuple[List[ServiceStatus], int], Tuple[List[ServiceStatus], int, Dict[str, str]] + """ + return client_wrapper.list_service_status() @handle_api_exception() diff --git a/flex/coordinator/gs_flex_coordinator/controllers/stored_procedure_controller.py b/flex/coordinator/gs_flex_coordinator/controllers/stored_procedure_controller.py new file mode 100644 index 000000000000..5ca12e47060f --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/controllers/stored_procedure_controller.py @@ -0,0 +1,98 @@ +import connexion +from typing import Dict +from typing import Tuple +from typing import Union + +from gs_flex_coordinator.models.create_stored_proc_request import CreateStoredProcRequest # noqa: E501 +from gs_flex_coordinator.models.create_stored_proc_response import CreateStoredProcResponse # noqa: E501 +from gs_flex_coordinator.models.error import Error # noqa: E501 +from gs_flex_coordinator.models.get_stored_proc_response import GetStoredProcResponse # noqa: E501 +from gs_flex_coordinator.models.update_stored_proc_request import UpdateStoredProcRequest # noqa: E501 +from gs_flex_coordinator import util + +from gs_flex_coordinator.core import client_wrapper +from gs_flex_coordinator.core import handle_api_exception + + +@handle_api_exception() +def create_stored_procedure(graph_id, create_stored_proc_request): # noqa: E501 + """create_stored_procedure + + Create a new stored procedure on a certain graph # noqa: E501 + + :param graph_id: + :type graph_id: str + :param create_stored_proc_request: + :type create_stored_proc_request: dict | bytes + + :rtype: Union[CreateStoredProcResponse, Tuple[CreateStoredProcResponse, int], Tuple[CreateStoredProcResponse, int, Dict[str, str]] + """ + if connexion.request.is_json: + create_stored_proc_request = CreateStoredProcRequest.from_dict(connexion.request.get_json()) # noqa: E501 + return client_wrapper.create_stored_procedure(graph_id, create_stored_proc_request) + + +@handle_api_exception() +def delete_stored_procedure_by_id(graph_id, stored_procedure_id): # noqa: E501 + """delete_stored_procedure_by_id + + Delete a stored procedure by ID # noqa: E501 + + :param graph_id: + :type graph_id: str + :param stored_procedure_id: + :type stored_procedure_id: str + + :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] + """ + return client_wrapper.delete_stored_procedure_by_id(graph_id, stored_procedure_id) + + +@handle_api_exception() +def get_stored_procedure_by_id(graph_id, stored_procedure_id): # noqa: E501 + """get_stored_procedure_by_id + + Get a stored procedure by ID # noqa: E501 + + :param graph_id: + :type graph_id: str + :param stored_procedure_id: + :type stored_procedure_id: str + + :rtype: Union[GetStoredProcResponse, Tuple[GetStoredProcResponse, int], Tuple[GetStoredProcResponse, int, Dict[str, str]] + """ + return client_wrapper.get_stored_procedure_by_id(graph_id, stored_procedure_id) + + +@handle_api_exception() +def list_stored_procedures(graph_id): # noqa: E501 + """list_stored_procedures + + List all stored procedures on a certain graph # noqa: E501 + + :param graph_id: + :type graph_id: str + + :rtype: Union[List[GetStoredProcResponse], Tuple[List[GetStoredProcResponse], int], Tuple[List[GetStoredProcResponse], int, Dict[str, str]] + """ + return client_wrapper.list_stored_procedures(graph_id) + + +@handle_api_exception() +def update_stored_procedure_by_id(graph_id, stored_procedure_id, update_stored_proc_request=None): # noqa: E501 + """update_stored_procedure_by_id + + Update a stored procedure by ID # noqa: E501 + + :param graph_id: + :type graph_id: str + :param stored_procedure_id: + :type stored_procedure_id: str + :param update_stored_proc_request: + :type update_stored_proc_request: dict | bytes + + :rtype: Union[str, Tuple[str, int], Tuple[str, int, Dict[str, str]] + """ + if connexion.request.is_json: + update_stored_proc_request = UpdateStoredProcRequest.from_dict(connexion.request.get_json()) # noqa: E501 + return client_wrapper.update_stored_procedure_by_id(graph_id, stored_procedure_id, update_stored_proc_request) diff --git a/flex/coordinator/gs_flex_coordinator/core/client_wrapper.py b/flex/coordinator/gs_flex_coordinator/core/client_wrapper.py index a756d6b8adc6..495609f2bcca 100644 --- a/flex/coordinator/gs_flex_coordinator/core/client_wrapper.py +++ b/flex/coordinator/gs_flex_coordinator/core/client_wrapper.py @@ -18,14 +18,20 @@ import itertools import os +import socket import threading from typing import List +import psutil + from gs_flex_coordinator.core.config import CLUSTER_TYPE from gs_flex_coordinator.core.config import CREATION_TIME from gs_flex_coordinator.core.config import DATASET_WORKSPACE +from gs_flex_coordinator.core.config import ENGINE_TYPE +from gs_flex_coordinator.core.config import FRONTEND_TYPE from gs_flex_coordinator.core.config import INSTANCE_NAME from gs_flex_coordinator.core.config import SOLUTION +from gs_flex_coordinator.core.config import STORAGE_TYPE from gs_flex_coordinator.core.datasource import DataSourceManager from gs_flex_coordinator.core.insight import init_groot_client from gs_flex_coordinator.core.interactive import init_hqps_client @@ -34,19 +40,20 @@ from gs_flex_coordinator.models import CreateEdgeType from gs_flex_coordinator.models import CreateGraphRequest from gs_flex_coordinator.models import CreateGraphResponse -from gs_flex_coordinator.models import CreateProcedureRequest -from gs_flex_coordinator.models import CreateProcedureResponse +from gs_flex_coordinator.models import CreateStoredProcRequest +from gs_flex_coordinator.models import CreateStoredProcResponse from gs_flex_coordinator.models import CreateVertexType from gs_flex_coordinator.models import DataloadingJobConfig from gs_flex_coordinator.models import GetGraphResponse from gs_flex_coordinator.models import GetGraphSchemaResponse -from gs_flex_coordinator.models import GetProcedureResponse +from gs_flex_coordinator.models import GetStoredProcResponse from gs_flex_coordinator.models import JobStatus from gs_flex_coordinator.models import RunningDeploymentInfo +from gs_flex_coordinator.models import RunningDeploymentStatus from gs_flex_coordinator.models import SchemaMapping from gs_flex_coordinator.models import ServiceStatus from gs_flex_coordinator.models import StartServiceRequest -from gs_flex_coordinator.models import UpdateProcedureRequest +from gs_flex_coordinator.models import UpdateStoredProcRequest from gs_flex_coordinator.models import UploadFileResponse from gs_flex_coordinator.version import __version__ @@ -166,38 +173,40 @@ def get_graph_by_id(self, graph_id: str) -> GetGraphResponse: p["property_type"]["string"]["long_text"] = "" return GetGraphResponse.from_dict(g) - def create_procedure( - self, graph_id: str, procedure: CreateProcedureRequest - ) -> CreateProcedureResponse: - procedure_dict = procedure.to_dict() - response = self._client.create_procedure(graph_id, procedure_dict) - return CreateProcedureResponse.from_dict(response) + def create_stored_procedure( + self, graph_id: str, stored_procedure: CreateStoredProcRequest + ) -> CreateStoredProcResponse: + stored_procedure_dict = stored_procedure.to_dict() + response = self._client.create_stored_procedure(graph_id, stored_procedure_dict) + return CreateStoredProcResponse.from_dict(response) - def list_procedures(self, graph_id: str) -> List[GetProcedureResponse]: - procedures = self._client.list_procedures(graph_id) + def list_stored_procedures(self, graph_id: str) -> List[GetStoredProcResponse]: + stored_procedures = self._client.list_stored_procedures(graph_id) # transfer - rlt = [GetProcedureResponse.from_dict(p) for p in procedures] + rlt = [GetStoredProcResponse.from_dict(p) for p in stored_procedures] return rlt - def update_procedure_by_id( + def update_stored_procedure_by_id( self, graph_id: str, - procedure_id: str, - procedure: UpdateProcedureRequest, + stored_procedure_id: str, + stored_procedure: UpdateStoredProcRequest, ) -> str: - procedure_dict = procedure.to_dict() - return self._client.update_procedure_by_id( - graph_id, procedure_id, procedure_dict + stored_procedure_dict = stored_procedure.to_dict() + return self._client.update_stored_procedure_by_id( + graph_id, stored_procedure_id, stored_procedure_dict ) - def delete_procedure_by_id(self, graph_id: str, procedure_id: str) -> str: - return self._client.delete_procedure_by_id(graph_id, procedure_id) + def delete_stored_procedure_by_id( + self, graph_id: str, stored_procedure_id: str + ) -> str: + return self._client.delete_stored_procedure_by_id(graph_id, stored_procedure_id) - def get_procedure_by_id( - self, graph_id: str, procedure_id: str - ) -> GetProcedureResponse: - return GetProcedureResponse.from_dict( - self._client.get_procedure_by_id(graph_id, procedure_id) + def get_stored_procedure_by_id( + self, graph_id: str, stored_procedure_id: str + ) -> GetStoredProcResponse: + return GetStoredProcResponse.from_dict( + self._client.get_stored_procedure_by_id(graph_id, stored_procedure_id) ) def get_deployment_info(self) -> RunningDeploymentInfo: @@ -205,24 +214,39 @@ def get_deployment_info(self) -> RunningDeploymentInfo: "instance_name": INSTANCE_NAME, "cluster_type": CLUSTER_TYPE, "version": __version__, - "solution": SOLUTION, + "frontend": FRONTEND_TYPE, + "engine": ENGINE_TYPE, + "storage": STORAGE_TYPE, "creation_time": encode_datetime(CREATION_TIME), } return RunningDeploymentInfo.from_dict(info) - def get_service_status(self) -> ServiceStatus: - status = self._client.get_service_status() - if "graph" in status: - # fix ValueError: Invalid value for `long_text`, must not be `None` - schema = status["graph"]["schema"] - for item in itertools.chain(schema["vertex_types"], schema["edge_types"]): - for p in item["properties"]: - if ( - "string" in p["property_type"] - and "long_text" in p["property_type"]["string"] - ): - p["property_type"]["string"]["long_text"] = "" - return ServiceStatus.from_dict(status) + def get_deployment_status(self) -> RunningDeploymentStatus: + status = {"cluster_type": CLUSTER_TYPE, "nodes": []} + if CLUSTER_TYPE == "HOSTS": + disk_info = psutil.disk_usage("/") + status["nodes"].append( + { + "name": socket.gethostname(), + "cpu_usage": psutil.cpu_percent(), + "memory_usage": psutil.virtual_memory().percent, + "disk_usage": float( + f"{disk_info.used / disk_info.total * 100:.2f}" + ), + } + ) + return RunningDeploymentStatus.from_dict(status) + + def get_service_status_by_id(self, graph_id: str) -> ServiceStatus: + status = self._client.list_service_status() + for s in status: + if graph_id == s["graph_id"]: + return ServiceStatus.from_dict(s) + raise RuntimeError(f"Failed to get service: graph {graph_id} not exists.") + + def list_service_status(self) -> List[ServiceStatus]: + status = self._client.list_service_status() + return [ServiceStatus.from_dict(s) for s in status] def stop_service(self) -> str: return self._client.stop_service() diff --git a/flex/coordinator/gs_flex_coordinator/core/config.py b/flex/coordinator/gs_flex_coordinator/core/config.py index 8f4bd52cabcf..7dd9d92f244d 100644 --- a/flex/coordinator/gs_flex_coordinator/core/config.py +++ b/flex/coordinator/gs_flex_coordinator/core/config.py @@ -55,7 +55,10 @@ def str_to_bool(s): # and business scenarios, e.g. "INTERACTIVE", # "GRAPHSCOPE INSIGHT". SOLUTION = os.environ["SOLUTION"] - +if SOLUTION == "INTERACTIVE": + FRONTEND_TYPE = "Cypher/Gremlin" + STORAGE_TYPE = "MutableCSR" + ENGINE_TYPE = "Hiactor" # cluster type, optional from "K8S", "HOSTS" CLUSTER_TYPE = os.environ.get("CLUSTER_TYPE", "HOSTS") diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps.py b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps.py index 431324526750..29a4a83df172 100644 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps.py +++ b/flex/coordinator/gs_flex_coordinator/core/interactive/hqps.py @@ -176,7 +176,7 @@ def delete_edge_type_by_name( ): raise RuntimeError("Create vertex type is not supported yet!") - def create_procedure(self, graph_id: str, procedure: dict) -> dict: + def create_stored_procedure(self, graph_id: str, stored_procedure: dict) -> dict: with interactive_sdk.openapi.ApiClient( interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: @@ -184,23 +184,27 @@ def create_procedure(self, graph_id: str, procedure: dict) -> dict: api_client ) response = api_instance.create_procedure( - graph_id, CreateProcedureRequest.from_dict(procedure) - ) - return response.to_dict() + graph_id, CreateProcedureRequest.from_dict(stored_procedure) + ).to_dict() + if "procedure_id" in response: + response["stored_procedure_id"] = response.pop("procedure_id") + return response - def list_procedures(self, graph_id: str) -> List[dict]: + def list_stored_procedures(self, graph_id: str) -> List[dict]: with interactive_sdk.openapi.ApiClient( interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: - procedures = [] + stored_procedures = [] api_instance = interactive_sdk.openapi.AdminServiceProcedureManagementApi( api_client ) - procedures = [p.to_dict() for p in api_instance.list_procedures(graph_id)] - return procedures + stored_procedures = [ + p.to_dict() for p in api_instance.list_procedures(graph_id) + ] + return stored_procedures - def update_procedure_by_id( - self, graph_id: str, procedure_id: str, procedure: dict + def update_stored_procedure_by_id( + self, graph_id: str, stored_procedure_id: str, stored_procedure: dict ) -> str: with interactive_sdk.openapi.ApiClient( interactive_sdk.openapi.Configuration(self._hqps_endpoint) @@ -210,29 +214,36 @@ def update_procedure_by_id( ) return api_instance.update_procedure( graph_id, - procedure_id, - UpdateProcedureRequest.from_dict(procedure), + stored_procedure_id, + UpdateProcedureRequest.from_dict(stored_procedure), ) - def delete_procedure_by_id(self, graph_id: str, procedure_id: str) -> str: + def delete_stored_procedure_by_id( + self, graph_id: str, stored_procedure_id: str + ) -> str: with interactive_sdk.openapi.ApiClient( interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: api_instance = interactive_sdk.openapi.AdminServiceProcedureManagementApi( api_client ) - return api_instance.delete_procedure(graph_id, procedure_id) + return api_instance.delete_procedure(graph_id, stored_procedure_id) - def get_procedure_by_id(self, graph_id: str, procedure_id: str) -> dict: + def get_stored_procedure_by_id( + self, graph_id: str, stored_procedure_id: str + ) -> dict: with interactive_sdk.openapi.ApiClient( interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: api_instance = interactive_sdk.openapi.AdminServiceProcedureManagementApi( api_client ) - return api_instance.get_procedure(graph_id, procedure_id).to_dict() + return api_instance.get_procedure(graph_id, stored_procedure_id).to_dict() - def get_service_status(self) -> dict: + def list_service_status(self) -> List[dict]: + # get service status from serving graph + serving_graph_id = None + rlts = [] with interactive_sdk.openapi.ApiClient( interactive_sdk.openapi.Configuration(self._hqps_endpoint) ) as api_client: @@ -240,31 +251,34 @@ def get_service_status(self) -> dict: api_client ) response = api_instance.get_service_status() - # transfer if CLUSTER_TYPE == "HOSTS": host = get_public_ip() if host is None: host = get_internal_ip() + if response.status == "Running" and response.graph is not None: + g = response.graph.to_dict() + serving_graph_id = g["id"] + status = { + "status": response.status, + "sdk_endpoints": { + "cypher": f"neo4j://{host}:{response.bolt_port}", + "hqps": f"http://{host}:{response.hqps_port}", + "gremlin": f"ws://{host}:{response.gremlin_port}/gremlin", + }, + "start_time": "2024-04-20 18:00:00", + "graph_id": g["id"], + } + rlts.append(status) + # only one graph is serving at a certain time + graphs = self.list_graphs() + for g in graphs: + if serving_graph_id is None or serving_graph_id != g["id"]: status = { - "status": response.status, - "sdk_endpoints": { - "cypher": f"neo4j://{host}:{response.bolt_port}", - "hqps": f"http://{host}:{response.hqps_port}", - "gremlin": f"ws://{host}:{response.gremlin_port}/gremlin", - }, + "status": "Stopped", + "graph_id": g["id"], } - if response.graph is not None: - g = response.graph.to_dict() - g["creation_time"] = encode_datetime( - datetime.datetime.fromtimestamp(g["creation_time"] / 1000) - ) - g["data_update_time"] = encode_datetime( - datetime.datetime.fromtimestamp(g["data_update_time"] / 1000) - ) - # `schema_update_time` is same to `creation_time` in Interactive - g["schema_update_time"] = g["creation_time"] - status["graph"] = g - return status + rlts.append(status) + return rlts def stop_service(self) -> str: with interactive_sdk.openapi.ApiClient( diff --git a/flex/coordinator/gs_flex_coordinator/models/__init__.py b/flex/coordinator/gs_flex_coordinator/models/__init__.py index 499023bdac33..3dd32a1f6baf 100644 --- a/flex/coordinator/gs_flex_coordinator/models/__init__.py +++ b/flex/coordinator/gs_flex_coordinator/models/__init__.py @@ -15,9 +15,9 @@ from gs_flex_coordinator.models.create_graph_request import CreateGraphRequest from gs_flex_coordinator.models.create_graph_response import CreateGraphResponse from gs_flex_coordinator.models.create_graph_schema_request import CreateGraphSchemaRequest -from gs_flex_coordinator.models.create_procedure_request import CreateProcedureRequest -from gs_flex_coordinator.models.create_procedure_response import CreateProcedureResponse from gs_flex_coordinator.models.create_property_meta import CreatePropertyMeta +from gs_flex_coordinator.models.create_stored_proc_request import CreateStoredProcRequest +from gs_flex_coordinator.models.create_stored_proc_response import CreateStoredProcResponse from gs_flex_coordinator.models.create_vertex_type import CreateVertexType from gs_flex_coordinator.models.dataloading_job_config import DataloadingJobConfig from gs_flex_coordinator.models.dataloading_job_config_edges_inner import DataloadingJobConfigEdgesInner @@ -34,14 +34,17 @@ from gs_flex_coordinator.models.get_edge_type import GetEdgeType from gs_flex_coordinator.models.get_graph_response import GetGraphResponse from gs_flex_coordinator.models.get_graph_schema_response import GetGraphSchemaResponse -from gs_flex_coordinator.models.get_procedure_response import GetProcedureResponse from gs_flex_coordinator.models.get_property_meta import GetPropertyMeta +from gs_flex_coordinator.models.get_stored_proc_response import GetStoredProcResponse from gs_flex_coordinator.models.get_vertex_type import GetVertexType from gs_flex_coordinator.models.job_status import JobStatus from gs_flex_coordinator.models.long_text import LongText +from gs_flex_coordinator.models.node_status import NodeStatus from gs_flex_coordinator.models.parameter import Parameter from gs_flex_coordinator.models.primitive_type import PrimitiveType from gs_flex_coordinator.models.running_deployment_info import RunningDeploymentInfo +from gs_flex_coordinator.models.running_deployment_status import RunningDeploymentStatus +from gs_flex_coordinator.models.running_deployment_status_nodes_inner import RunningDeploymentStatusNodesInner from gs_flex_coordinator.models.schema_mapping import SchemaMapping from gs_flex_coordinator.models.service_status import ServiceStatus from gs_flex_coordinator.models.service_status_sdk_endpoints import ServiceStatusSdkEndpoints @@ -50,6 +53,6 @@ from gs_flex_coordinator.models.string_type import StringType from gs_flex_coordinator.models.string_type_string import StringTypeString from gs_flex_coordinator.models.update_alert_message_status_request import UpdateAlertMessageStatusRequest -from gs_flex_coordinator.models.update_procedure_request import UpdateProcedureRequest +from gs_flex_coordinator.models.update_stored_proc_request import UpdateStoredProcRequest from gs_flex_coordinator.models.upload_file_response import UploadFileResponse from gs_flex_coordinator.models.vertex_mapping import VertexMapping diff --git a/flex/coordinator/gs_flex_coordinator/models/create_graph_request.py b/flex/coordinator/gs_flex_coordinator/models/create_graph_request.py index 5fcc955dc808..f13c07588b3d 100644 --- a/flex/coordinator/gs_flex_coordinator/models/create_graph_request.py +++ b/flex/coordinator/gs_flex_coordinator/models/create_graph_request.py @@ -4,11 +4,11 @@ from gs_flex_coordinator.models.base_model import Model from gs_flex_coordinator.models.create_graph_schema_request import CreateGraphSchemaRequest -from gs_flex_coordinator.models.create_procedure_request import CreateProcedureRequest +from gs_flex_coordinator.models.create_stored_proc_request import CreateStoredProcRequest from gs_flex_coordinator import util from gs_flex_coordinator.models.create_graph_schema_request import CreateGraphSchemaRequest # noqa: E501 -from gs_flex_coordinator.models.create_procedure_request import CreateProcedureRequest # noqa: E501 +from gs_flex_coordinator.models.create_stored_proc_request import CreateStoredProcRequest # noqa: E501 class CreateGraphRequest(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -24,14 +24,14 @@ def __init__(self, name=None, description=None, stored_procedures=None, _schema= :param description: The description of this CreateGraphRequest. # noqa: E501 :type description: str :param stored_procedures: The stored_procedures of this CreateGraphRequest. # noqa: E501 - :type stored_procedures: List[CreateProcedureRequest] + :type stored_procedures: List[CreateStoredProcRequest] :param _schema: The _schema of this CreateGraphRequest. # noqa: E501 :type _schema: CreateGraphSchemaRequest """ self.openapi_types = { 'name': str, 'description': str, - 'stored_procedures': List[CreateProcedureRequest], + 'stored_procedures': List[CreateStoredProcRequest], '_schema': CreateGraphSchemaRequest } @@ -76,8 +76,6 @@ def name(self, name: str): :param name: The name of this CreateGraphRequest. :type name: str """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name @@ -103,22 +101,22 @@ def description(self, description: str): self._description = description @property - def stored_procedures(self) -> List[CreateProcedureRequest]: + def stored_procedures(self) -> List[CreateStoredProcRequest]: """Gets the stored_procedures of this CreateGraphRequest. :return: The stored_procedures of this CreateGraphRequest. - :rtype: List[CreateProcedureRequest] + :rtype: List[CreateStoredProcRequest] """ return self._stored_procedures @stored_procedures.setter - def stored_procedures(self, stored_procedures: List[CreateProcedureRequest]): + def stored_procedures(self, stored_procedures: List[CreateStoredProcRequest]): """Sets the stored_procedures of this CreateGraphRequest. :param stored_procedures: The stored_procedures of this CreateGraphRequest. - :type stored_procedures: List[CreateProcedureRequest] + :type stored_procedures: List[CreateStoredProcRequest] """ self._stored_procedures = stored_procedures @@ -141,7 +139,5 @@ def _schema(self, _schema: CreateGraphSchemaRequest): :param _schema: The _schema of this CreateGraphRequest. :type _schema: CreateGraphSchemaRequest """ - if _schema is None: - raise ValueError("Invalid value for `_schema`, must not be `None`") # noqa: E501 self.__schema = _schema diff --git a/flex/coordinator/gs_flex_coordinator/models/create_procedure_response.py b/flex/coordinator/gs_flex_coordinator/models/create_procedure_response.py deleted file mode 100644 index c89ad9d859ed..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/create_procedure_response.py +++ /dev/null @@ -1,63 +0,0 @@ -from datetime import date, datetime # noqa: F401 - -from typing import List, Dict # noqa: F401 - -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util - - -class CreateProcedureResponse(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, procedure_id=None): # noqa: E501 - """CreateProcedureResponse - a model defined in OpenAPI - - :param procedure_id: The procedure_id of this CreateProcedureResponse. # noqa: E501 - :type procedure_id: str - """ - self.openapi_types = { - 'procedure_id': str - } - - self.attribute_map = { - 'procedure_id': 'procedure_id' - } - - self._procedure_id = procedure_id - - @classmethod - def from_dict(cls, dikt) -> 'CreateProcedureResponse': - """Returns the dict as a model - - :param dikt: A dict. - :type: dict - :return: The CreateProcedureResponse of this CreateProcedureResponse. # noqa: E501 - :rtype: CreateProcedureResponse - """ - return util.deserialize_model(dikt, cls) - - @property - def procedure_id(self) -> str: - """Gets the procedure_id of this CreateProcedureResponse. - - - :return: The procedure_id of this CreateProcedureResponse. - :rtype: str - """ - return self._procedure_id - - @procedure_id.setter - def procedure_id(self, procedure_id: str): - """Sets the procedure_id of this CreateProcedureResponse. - - - :param procedure_id: The procedure_id of this CreateProcedureResponse. - :type procedure_id: str - """ - if procedure_id is None: - raise ValueError("Invalid value for `procedure_id`, must not be `None`") # noqa: E501 - - self._procedure_id = procedure_id diff --git a/flex/coordinator/gs_flex_coordinator/models/create_procedure_request.py b/flex/coordinator/gs_flex_coordinator/models/create_stored_proc_request.py similarity index 61% rename from flex/coordinator/gs_flex_coordinator/models/create_procedure_request.py rename to flex/coordinator/gs_flex_coordinator/models/create_stored_proc_request.py index ae8d787b59db..1933065951b7 100644 --- a/flex/coordinator/gs_flex_coordinator/models/create_procedure_request.py +++ b/flex/coordinator/gs_flex_coordinator/models/create_stored_proc_request.py @@ -6,22 +6,22 @@ from gs_flex_coordinator import util -class CreateProcedureRequest(Model): +class CreateStoredProcRequest(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. """ def __init__(self, name=None, description=None, type=None, query=None): # noqa: E501 - """CreateProcedureRequest - a model defined in OpenAPI + """CreateStoredProcRequest - a model defined in OpenAPI - :param name: The name of this CreateProcedureRequest. # noqa: E501 + :param name: The name of this CreateStoredProcRequest. # noqa: E501 :type name: str - :param description: The description of this CreateProcedureRequest. # noqa: E501 + :param description: The description of this CreateStoredProcRequest. # noqa: E501 :type description: str - :param type: The type of this CreateProcedureRequest. # noqa: E501 + :param type: The type of this CreateStoredProcRequest. # noqa: E501 :type type: str - :param query: The query of this CreateProcedureRequest. # noqa: E501 + :param query: The query of this CreateStoredProcRequest. # noqa: E501 :type query: str """ self.openapi_types = { @@ -44,32 +44,32 @@ def __init__(self, name=None, description=None, type=None, query=None): # noqa: self._query = query @classmethod - def from_dict(cls, dikt) -> 'CreateProcedureRequest': + def from_dict(cls, dikt) -> 'CreateStoredProcRequest': """Returns the dict as a model :param dikt: A dict. :type: dict - :return: The CreateProcedureRequest of this CreateProcedureRequest. # noqa: E501 - :rtype: CreateProcedureRequest + :return: The CreateStoredProcRequest of this CreateStoredProcRequest. # noqa: E501 + :rtype: CreateStoredProcRequest """ return util.deserialize_model(dikt, cls) @property def name(self) -> str: - """Gets the name of this CreateProcedureRequest. + """Gets the name of this CreateStoredProcRequest. - :return: The name of this CreateProcedureRequest. + :return: The name of this CreateStoredProcRequest. :rtype: str """ return self._name @name.setter def name(self, name: str): - """Sets the name of this CreateProcedureRequest. + """Sets the name of this CreateStoredProcRequest. - :param name: The name of this CreateProcedureRequest. + :param name: The name of this CreateStoredProcRequest. :type name: str """ if name is None: @@ -79,20 +79,20 @@ def name(self, name: str): @property def description(self) -> str: - """Gets the description of this CreateProcedureRequest. + """Gets the description of this CreateStoredProcRequest. - :return: The description of this CreateProcedureRequest. + :return: The description of this CreateStoredProcRequest. :rtype: str """ return self._description @description.setter def description(self, description: str): - """Sets the description of this CreateProcedureRequest. + """Sets the description of this CreateStoredProcRequest. - :param description: The description of this CreateProcedureRequest. + :param description: The description of this CreateStoredProcRequest. :type description: str """ @@ -100,20 +100,20 @@ def description(self, description: str): @property def type(self) -> str: - """Gets the type of this CreateProcedureRequest. + """Gets the type of this CreateStoredProcRequest. - :return: The type of this CreateProcedureRequest. + :return: The type of this CreateStoredProcRequest. :rtype: str """ return self._type @type.setter def type(self, type: str): - """Sets the type of this CreateProcedureRequest. + """Sets the type of this CreateStoredProcRequest. - :param type: The type of this CreateProcedureRequest. + :param type: The type of this CreateStoredProcRequest. :type type: str """ allowed_values = ["cpp", "cypher"] # noqa: E501 @@ -127,20 +127,20 @@ def type(self, type: str): @property def query(self) -> str: - """Gets the query of this CreateProcedureRequest. + """Gets the query of this CreateStoredProcRequest. - :return: The query of this CreateProcedureRequest. + :return: The query of this CreateStoredProcRequest. :rtype: str """ return self._query @query.setter def query(self, query: str): - """Sets the query of this CreateProcedureRequest. + """Sets the query of this CreateStoredProcRequest. - :param query: The query of this CreateProcedureRequest. + :param query: The query of this CreateStoredProcRequest. :type query: str """ if query is None: diff --git a/flex/coordinator/gs_flex_coordinator/models/create_stored_proc_response.py b/flex/coordinator/gs_flex_coordinator/models/create_stored_proc_response.py new file mode 100644 index 000000000000..e7846c71537a --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/create_stored_proc_response.py @@ -0,0 +1,63 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator import util + + +class CreateStoredProcResponse(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, stored_procedure_id=None): # noqa: E501 + """CreateStoredProcResponse - a model defined in OpenAPI + + :param stored_procedure_id: The stored_procedure_id of this CreateStoredProcResponse. # noqa: E501 + :type stored_procedure_id: str + """ + self.openapi_types = { + 'stored_procedure_id': str + } + + self.attribute_map = { + 'stored_procedure_id': 'stored_procedure_id' + } + + self._stored_procedure_id = stored_procedure_id + + @classmethod + def from_dict(cls, dikt) -> 'CreateStoredProcResponse': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The CreateStoredProcResponse of this CreateStoredProcResponse. # noqa: E501 + :rtype: CreateStoredProcResponse + """ + return util.deserialize_model(dikt, cls) + + @property + def stored_procedure_id(self) -> str: + """Gets the stored_procedure_id of this CreateStoredProcResponse. + + + :return: The stored_procedure_id of this CreateStoredProcResponse. + :rtype: str + """ + return self._stored_procedure_id + + @stored_procedure_id.setter + def stored_procedure_id(self, stored_procedure_id: str): + """Sets the stored_procedure_id of this CreateStoredProcResponse. + + + :param stored_procedure_id: The stored_procedure_id of this CreateStoredProcResponse. + :type stored_procedure_id: str + """ + if stored_procedure_id is None: + raise ValueError("Invalid value for `stored_procedure_id`, must not be `None`") # noqa: E501 + + self._stored_procedure_id = stored_procedure_id diff --git a/flex/coordinator/gs_flex_coordinator/models/get_graph_response.py b/flex/coordinator/gs_flex_coordinator/models/get_graph_response.py index 3404a34e391a..179ab3f15213 100644 --- a/flex/coordinator/gs_flex_coordinator/models/get_graph_response.py +++ b/flex/coordinator/gs_flex_coordinator/models/get_graph_response.py @@ -4,11 +4,11 @@ from gs_flex_coordinator.models.base_model import Model from gs_flex_coordinator.models.get_graph_schema_response import GetGraphSchemaResponse -from gs_flex_coordinator.models.get_procedure_response import GetProcedureResponse +from gs_flex_coordinator.models.get_stored_proc_response import GetStoredProcResponse from gs_flex_coordinator import util from gs_flex_coordinator.models.get_graph_schema_response import GetGraphSchemaResponse # noqa: E501 -from gs_flex_coordinator.models.get_procedure_response import GetProcedureResponse # noqa: E501 +from gs_flex_coordinator.models.get_stored_proc_response import GetStoredProcResponse # noqa: E501 class GetGraphResponse(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -34,7 +34,7 @@ def __init__(self, id=None, name=None, description=None, store_type=None, creati :param schema_update_time: The schema_update_time of this GetGraphResponse. # noqa: E501 :type schema_update_time: str :param stored_procedures: The stored_procedures of this GetGraphResponse. # noqa: E501 - :type stored_procedures: List[GetProcedureResponse] + :type stored_procedures: List[GetStoredProcResponse] :param _schema: The _schema of this GetGraphResponse. # noqa: E501 :type _schema: GetGraphSchemaResponse """ @@ -46,7 +46,7 @@ def __init__(self, id=None, name=None, description=None, store_type=None, creati 'creation_time': str, 'data_update_time': str, 'schema_update_time': str, - 'stored_procedures': List[GetProcedureResponse], + 'stored_procedures': List[GetStoredProcResponse], '_schema': GetGraphSchemaResponse } @@ -247,22 +247,22 @@ def schema_update_time(self, schema_update_time: str): self._schema_update_time = schema_update_time @property - def stored_procedures(self) -> List[GetProcedureResponse]: + def stored_procedures(self) -> List[GetStoredProcResponse]: """Gets the stored_procedures of this GetGraphResponse. :return: The stored_procedures of this GetGraphResponse. - :rtype: List[GetProcedureResponse] + :rtype: List[GetStoredProcResponse] """ return self._stored_procedures @stored_procedures.setter - def stored_procedures(self, stored_procedures: List[GetProcedureResponse]): + def stored_procedures(self, stored_procedures: List[GetStoredProcResponse]): """Sets the stored_procedures of this GetGraphResponse. :param stored_procedures: The stored_procedures of this GetGraphResponse. - :type stored_procedures: List[GetProcedureResponse] + :type stored_procedures: List[GetStoredProcResponse] """ self._stored_procedures = stored_procedures diff --git a/flex/coordinator/gs_flex_coordinator/models/get_procedure_response.py b/flex/coordinator/gs_flex_coordinator/models/get_stored_proc_response.py similarity index 62% rename from flex/coordinator/gs_flex_coordinator/models/get_procedure_response.py rename to flex/coordinator/gs_flex_coordinator/models/get_stored_proc_response.py index 9f09abfac996..59a7c6b31cb1 100644 --- a/flex/coordinator/gs_flex_coordinator/models/get_procedure_response.py +++ b/flex/coordinator/gs_flex_coordinator/models/get_stored_proc_response.py @@ -8,34 +8,34 @@ from gs_flex_coordinator.models.parameter import Parameter # noqa: E501 -class GetProcedureResponse(Model): +class GetStoredProcResponse(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. """ def __init__(self, name=None, description=None, type=None, query=None, id=None, library=None, params=None, returns=None, bound_graph=None, runnable=None): # noqa: E501 - """GetProcedureResponse - a model defined in OpenAPI + """GetStoredProcResponse - a model defined in OpenAPI - :param name: The name of this GetProcedureResponse. # noqa: E501 + :param name: The name of this GetStoredProcResponse. # noqa: E501 :type name: str - :param description: The description of this GetProcedureResponse. # noqa: E501 + :param description: The description of this GetStoredProcResponse. # noqa: E501 :type description: str - :param type: The type of this GetProcedureResponse. # noqa: E501 + :param type: The type of this GetStoredProcResponse. # noqa: E501 :type type: str - :param query: The query of this GetProcedureResponse. # noqa: E501 + :param query: The query of this GetStoredProcResponse. # noqa: E501 :type query: str - :param id: The id of this GetProcedureResponse. # noqa: E501 + :param id: The id of this GetStoredProcResponse. # noqa: E501 :type id: str - :param library: The library of this GetProcedureResponse. # noqa: E501 + :param library: The library of this GetStoredProcResponse. # noqa: E501 :type library: str - :param params: The params of this GetProcedureResponse. # noqa: E501 + :param params: The params of this GetStoredProcResponse. # noqa: E501 :type params: List[Parameter] - :param returns: The returns of this GetProcedureResponse. # noqa: E501 + :param returns: The returns of this GetStoredProcResponse. # noqa: E501 :type returns: List[Parameter] - :param bound_graph: The bound_graph of this GetProcedureResponse. # noqa: E501 + :param bound_graph: The bound_graph of this GetStoredProcResponse. # noqa: E501 :type bound_graph: str - :param runnable: The runnable of this GetProcedureResponse. # noqa: E501 + :param runnable: The runnable of this GetStoredProcResponse. # noqa: E501 :type runnable: bool """ self.openapi_types = { @@ -76,32 +76,32 @@ def __init__(self, name=None, description=None, type=None, query=None, id=None, self._runnable = runnable @classmethod - def from_dict(cls, dikt) -> 'GetProcedureResponse': + def from_dict(cls, dikt) -> 'GetStoredProcResponse': """Returns the dict as a model :param dikt: A dict. :type: dict - :return: The GetProcedureResponse of this GetProcedureResponse. # noqa: E501 - :rtype: GetProcedureResponse + :return: The GetStoredProcResponse of this GetStoredProcResponse. # noqa: E501 + :rtype: GetStoredProcResponse """ return util.deserialize_model(dikt, cls) @property def name(self) -> str: - """Gets the name of this GetProcedureResponse. + """Gets the name of this GetStoredProcResponse. - :return: The name of this GetProcedureResponse. + :return: The name of this GetStoredProcResponse. :rtype: str """ return self._name @name.setter def name(self, name: str): - """Sets the name of this GetProcedureResponse. + """Sets the name of this GetStoredProcResponse. - :param name: The name of this GetProcedureResponse. + :param name: The name of this GetStoredProcResponse. :type name: str """ if name is None: @@ -111,20 +111,20 @@ def name(self, name: str): @property def description(self) -> str: - """Gets the description of this GetProcedureResponse. + """Gets the description of this GetStoredProcResponse. - :return: The description of this GetProcedureResponse. + :return: The description of this GetStoredProcResponse. :rtype: str """ return self._description @description.setter def description(self, description: str): - """Sets the description of this GetProcedureResponse. + """Sets the description of this GetStoredProcResponse. - :param description: The description of this GetProcedureResponse. + :param description: The description of this GetStoredProcResponse. :type description: str """ @@ -132,20 +132,20 @@ def description(self, description: str): @property def type(self) -> str: - """Gets the type of this GetProcedureResponse. + """Gets the type of this GetStoredProcResponse. - :return: The type of this GetProcedureResponse. + :return: The type of this GetStoredProcResponse. :rtype: str """ return self._type @type.setter def type(self, type: str): - """Sets the type of this GetProcedureResponse. + """Sets the type of this GetStoredProcResponse. - :param type: The type of this GetProcedureResponse. + :param type: The type of this GetStoredProcResponse. :type type: str """ allowed_values = ["cpp", "cypher"] # noqa: E501 @@ -159,20 +159,20 @@ def type(self, type: str): @property def query(self) -> str: - """Gets the query of this GetProcedureResponse. + """Gets the query of this GetStoredProcResponse. - :return: The query of this GetProcedureResponse. + :return: The query of this GetStoredProcResponse. :rtype: str """ return self._query @query.setter def query(self, query: str): - """Sets the query of this GetProcedureResponse. + """Sets the query of this GetStoredProcResponse. - :param query: The query of this GetProcedureResponse. + :param query: The query of this GetStoredProcResponse. :type query: str """ if query is None: @@ -182,20 +182,20 @@ def query(self, query: str): @property def id(self) -> str: - """Gets the id of this GetProcedureResponse. + """Gets the id of this GetStoredProcResponse. - :return: The id of this GetProcedureResponse. + :return: The id of this GetStoredProcResponse. :rtype: str """ return self._id @id.setter def id(self, id: str): - """Sets the id of this GetProcedureResponse. + """Sets the id of this GetStoredProcResponse. - :param id: The id of this GetProcedureResponse. + :param id: The id of this GetStoredProcResponse. :type id: str """ if id is None: @@ -205,20 +205,20 @@ def id(self, id: str): @property def library(self) -> str: - """Gets the library of this GetProcedureResponse. + """Gets the library of this GetStoredProcResponse. - :return: The library of this GetProcedureResponse. + :return: The library of this GetStoredProcResponse. :rtype: str """ return self._library @library.setter def library(self, library: str): - """Sets the library of this GetProcedureResponse. + """Sets the library of this GetStoredProcResponse. - :param library: The library of this GetProcedureResponse. + :param library: The library of this GetStoredProcResponse. :type library: str """ if library is None: @@ -228,20 +228,20 @@ def library(self, library: str): @property def params(self) -> List[Parameter]: - """Gets the params of this GetProcedureResponse. + """Gets the params of this GetStoredProcResponse. - :return: The params of this GetProcedureResponse. + :return: The params of this GetStoredProcResponse. :rtype: List[Parameter] """ return self._params @params.setter def params(self, params: List[Parameter]): - """Sets the params of this GetProcedureResponse. + """Sets the params of this GetStoredProcResponse. - :param params: The params of this GetProcedureResponse. + :param params: The params of this GetStoredProcResponse. :type params: List[Parameter] """ if params is None: @@ -251,20 +251,20 @@ def params(self, params: List[Parameter]): @property def returns(self) -> List[Parameter]: - """Gets the returns of this GetProcedureResponse. + """Gets the returns of this GetStoredProcResponse. - :return: The returns of this GetProcedureResponse. + :return: The returns of this GetStoredProcResponse. :rtype: List[Parameter] """ return self._returns @returns.setter def returns(self, returns: List[Parameter]): - """Sets the returns of this GetProcedureResponse. + """Sets the returns of this GetStoredProcResponse. - :param returns: The returns of this GetProcedureResponse. + :param returns: The returns of this GetStoredProcResponse. :type returns: List[Parameter] """ if returns is None: @@ -274,20 +274,20 @@ def returns(self, returns: List[Parameter]): @property def bound_graph(self) -> str: - """Gets the bound_graph of this GetProcedureResponse. + """Gets the bound_graph of this GetStoredProcResponse. - :return: The bound_graph of this GetProcedureResponse. + :return: The bound_graph of this GetStoredProcResponse. :rtype: str """ return self._bound_graph @bound_graph.setter def bound_graph(self, bound_graph: str): - """Sets the bound_graph of this GetProcedureResponse. + """Sets the bound_graph of this GetStoredProcResponse. - :param bound_graph: The bound_graph of this GetProcedureResponse. + :param bound_graph: The bound_graph of this GetStoredProcResponse. :type bound_graph: str """ if bound_graph is None: @@ -297,20 +297,20 @@ def bound_graph(self, bound_graph: str): @property def runnable(self) -> bool: - """Gets the runnable of this GetProcedureResponse. + """Gets the runnable of this GetStoredProcResponse. - :return: The runnable of this GetProcedureResponse. + :return: The runnable of this GetStoredProcResponse. :rtype: bool """ return self._runnable @runnable.setter def runnable(self, runnable: bool): - """Sets the runnable of this GetProcedureResponse. + """Sets the runnable of this GetStoredProcResponse. - :param runnable: The runnable of this GetProcedureResponse. + :param runnable: The runnable of this GetStoredProcResponse. :type runnable: bool """ if runnable is None: diff --git a/flex/coordinator/gs_flex_coordinator/models/node_status.py b/flex/coordinator/gs_flex_coordinator/models/node_status.py new file mode 100644 index 000000000000..3143c7b23620 --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/node_status.py @@ -0,0 +1,147 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator import util + + +class NodeStatus(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, name=None, cpu_usage=None, memory_usage=None, disk_usage=None): # noqa: E501 + """NodeStatus - a model defined in OpenAPI + + :param name: The name of this NodeStatus. # noqa: E501 + :type name: str + :param cpu_usage: The cpu_usage of this NodeStatus. # noqa: E501 + :type cpu_usage: float + :param memory_usage: The memory_usage of this NodeStatus. # noqa: E501 + :type memory_usage: float + :param disk_usage: The disk_usage of this NodeStatus. # noqa: E501 + :type disk_usage: float + """ + self.openapi_types = { + 'name': str, + 'cpu_usage': float, + 'memory_usage': float, + 'disk_usage': float + } + + self.attribute_map = { + 'name': 'name', + 'cpu_usage': 'cpu_usage', + 'memory_usage': 'memory_usage', + 'disk_usage': 'disk_usage' + } + + self._name = name + self._cpu_usage = cpu_usage + self._memory_usage = memory_usage + self._disk_usage = disk_usage + + @classmethod + def from_dict(cls, dikt) -> 'NodeStatus': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The NodeStatus of this NodeStatus. # noqa: E501 + :rtype: NodeStatus + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> str: + """Gets the name of this NodeStatus. + + + :return: The name of this NodeStatus. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name: str): + """Sets the name of this NodeStatus. + + + :param name: The name of this NodeStatus. + :type name: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def cpu_usage(self) -> float: + """Gets the cpu_usage of this NodeStatus. + + + :return: The cpu_usage of this NodeStatus. + :rtype: float + """ + return self._cpu_usage + + @cpu_usage.setter + def cpu_usage(self, cpu_usage: float): + """Sets the cpu_usage of this NodeStatus. + + + :param cpu_usage: The cpu_usage of this NodeStatus. + :type cpu_usage: float + """ + if cpu_usage is None: + raise ValueError("Invalid value for `cpu_usage`, must not be `None`") # noqa: E501 + + self._cpu_usage = cpu_usage + + @property + def memory_usage(self) -> float: + """Gets the memory_usage of this NodeStatus. + + + :return: The memory_usage of this NodeStatus. + :rtype: float + """ + return self._memory_usage + + @memory_usage.setter + def memory_usage(self, memory_usage: float): + """Sets the memory_usage of this NodeStatus. + + + :param memory_usage: The memory_usage of this NodeStatus. + :type memory_usage: float + """ + if memory_usage is None: + raise ValueError("Invalid value for `memory_usage`, must not be `None`") # noqa: E501 + + self._memory_usage = memory_usage + + @property + def disk_usage(self) -> float: + """Gets the disk_usage of this NodeStatus. + + + :return: The disk_usage of this NodeStatus. + :rtype: float + """ + return self._disk_usage + + @disk_usage.setter + def disk_usage(self, disk_usage: float): + """Sets the disk_usage of this NodeStatus. + + + :param disk_usage: The disk_usage of this NodeStatus. + :type disk_usage: float + """ + if disk_usage is None: + raise ValueError("Invalid value for `disk_usage`, must not be `None`") # noqa: E501 + + self._disk_usage = disk_usage diff --git a/flex/coordinator/gs_flex_coordinator/models/running_deployment_info.py b/flex/coordinator/gs_flex_coordinator/models/running_deployment_info.py index 97bf3bd22805..d68fde6c111a 100644 --- a/flex/coordinator/gs_flex_coordinator/models/running_deployment_info.py +++ b/flex/coordinator/gs_flex_coordinator/models/running_deployment_info.py @@ -12,7 +12,7 @@ class RunningDeploymentInfo(Model): Do not edit the class manually. """ - def __init__(self, instance_name=None, cluster_type=None, version=None, solution=None, creation_time=None): # noqa: E501 + def __init__(self, instance_name=None, cluster_type=None, version=None, creation_time=None, frontend=None, engine=None, storage=None): # noqa: E501 """RunningDeploymentInfo - a model defined in OpenAPI :param instance_name: The instance_name of this RunningDeploymentInfo. # noqa: E501 @@ -21,32 +21,42 @@ def __init__(self, instance_name=None, cluster_type=None, version=None, solution :type cluster_type: str :param version: The version of this RunningDeploymentInfo. # noqa: E501 :type version: str - :param solution: The solution of this RunningDeploymentInfo. # noqa: E501 - :type solution: str :param creation_time: The creation_time of this RunningDeploymentInfo. # noqa: E501 :type creation_time: str + :param frontend: The frontend of this RunningDeploymentInfo. # noqa: E501 + :type frontend: str + :param engine: The engine of this RunningDeploymentInfo. # noqa: E501 + :type engine: str + :param storage: The storage of this RunningDeploymentInfo. # noqa: E501 + :type storage: str """ self.openapi_types = { 'instance_name': str, 'cluster_type': str, 'version': str, - 'solution': str, - 'creation_time': str + 'creation_time': str, + 'frontend': str, + 'engine': str, + 'storage': str } self.attribute_map = { 'instance_name': 'instance_name', 'cluster_type': 'cluster_type', 'version': 'version', - 'solution': 'solution', - 'creation_time': 'creation_time' + 'creation_time': 'creation_time', + 'frontend': 'frontend', + 'engine': 'engine', + 'storage': 'storage' } self._instance_name = instance_name self._cluster_type = cluster_type self._version = version - self._solution = solution self._creation_time = creation_time + self._frontend = frontend + self._engine = engine + self._storage = storage @classmethod def from_dict(cls, dikt) -> 'RunningDeploymentInfo': @@ -133,51 +143,105 @@ def version(self, version: str): self._version = version @property - def solution(self) -> str: - """Gets the solution of this RunningDeploymentInfo. + def creation_time(self) -> str: + """Gets the creation_time of this RunningDeploymentInfo. - :return: The solution of this RunningDeploymentInfo. + :return: The creation_time of this RunningDeploymentInfo. :rtype: str """ - return self._solution + return self._creation_time - @solution.setter - def solution(self, solution: str): - """Sets the solution of this RunningDeploymentInfo. + @creation_time.setter + def creation_time(self, creation_time: str): + """Sets the creation_time of this RunningDeploymentInfo. - :param solution: The solution of this RunningDeploymentInfo. - :type solution: str + :param creation_time: The creation_time of this RunningDeploymentInfo. + :type creation_time: str """ - allowed_values = ["INTERACTIVE", "GRAPHSCOPE_INSIGHT"] # noqa: E501 - if solution not in allowed_values: + if creation_time is None: + raise ValueError("Invalid value for `creation_time`, must not be `None`") # noqa: E501 + + self._creation_time = creation_time + + @property + def frontend(self) -> str: + """Gets the frontend of this RunningDeploymentInfo. + + + :return: The frontend of this RunningDeploymentInfo. + :rtype: str + """ + return self._frontend + + @frontend.setter + def frontend(self, frontend: str): + """Sets the frontend of this RunningDeploymentInfo. + + + :param frontend: The frontend of this RunningDeploymentInfo. + :type frontend: str + """ + allowed_values = ["Cypher/Gremlin", "AnalyticalApps"] # noqa: E501 + if frontend not in allowed_values: raise ValueError( - "Invalid value for `solution` ({0}), must be one of {1}" - .format(solution, allowed_values) + "Invalid value for `frontend` ({0}), must be one of {1}" + .format(frontend, allowed_values) ) - self._solution = solution + self._frontend = frontend @property - def creation_time(self) -> str: - """Gets the creation_time of this RunningDeploymentInfo. + def engine(self) -> str: + """Gets the engine of this RunningDeploymentInfo. - :return: The creation_time of this RunningDeploymentInfo. + :return: The engine of this RunningDeploymentInfo. :rtype: str """ - return self._creation_time + return self._engine - @creation_time.setter - def creation_time(self, creation_time: str): - """Sets the creation_time of this RunningDeploymentInfo. + @engine.setter + def engine(self, engine: str): + """Sets the engine of this RunningDeploymentInfo. - :param creation_time: The creation_time of this RunningDeploymentInfo. - :type creation_time: str + :param engine: The engine of this RunningDeploymentInfo. + :type engine: str """ - if creation_time is None: - raise ValueError("Invalid value for `creation_time`, must not be `None`") # noqa: E501 + allowed_values = ["Hiactor", "Gaia"] # noqa: E501 + if engine not in allowed_values: + raise ValueError( + "Invalid value for `engine` ({0}), must be one of {1}" + .format(engine, allowed_values) + ) - self._creation_time = creation_time + self._engine = engine + + @property + def storage(self) -> str: + """Gets the storage of this RunningDeploymentInfo. + + + :return: The storage of this RunningDeploymentInfo. + :rtype: str + """ + return self._storage + + @storage.setter + def storage(self, storage: str): + """Sets the storage of this RunningDeploymentInfo. + + + :param storage: The storage of this RunningDeploymentInfo. + :type storage: str + """ + allowed_values = ["MutableCSR"] # noqa: E501 + if storage not in allowed_values: + raise ValueError( + "Invalid value for `storage` ({0}), must be one of {1}" + .format(storage, allowed_values) + ) + + self._storage = storage diff --git a/flex/coordinator/gs_flex_coordinator/models/running_deployment_status.py b/flex/coordinator/gs_flex_coordinator/models/running_deployment_status.py new file mode 100644 index 000000000000..efd8ebac2efe --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/running_deployment_status.py @@ -0,0 +1,97 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator.models.running_deployment_status_nodes_inner import RunningDeploymentStatusNodesInner +from gs_flex_coordinator import util + +from gs_flex_coordinator.models.running_deployment_status_nodes_inner import RunningDeploymentStatusNodesInner # noqa: E501 + +class RunningDeploymentStatus(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, cluster_type=None, nodes=None): # noqa: E501 + """RunningDeploymentStatus - a model defined in OpenAPI + + :param cluster_type: The cluster_type of this RunningDeploymentStatus. # noqa: E501 + :type cluster_type: str + :param nodes: The nodes of this RunningDeploymentStatus. # noqa: E501 + :type nodes: List[RunningDeploymentStatusNodesInner] + """ + self.openapi_types = { + 'cluster_type': str, + 'nodes': List[RunningDeploymentStatusNodesInner] + } + + self.attribute_map = { + 'cluster_type': 'cluster_type', + 'nodes': 'nodes' + } + + self._cluster_type = cluster_type + self._nodes = nodes + + @classmethod + def from_dict(cls, dikt) -> 'RunningDeploymentStatus': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The RunningDeploymentStatus of this RunningDeploymentStatus. # noqa: E501 + :rtype: RunningDeploymentStatus + """ + return util.deserialize_model(dikt, cls) + + @property + def cluster_type(self) -> str: + """Gets the cluster_type of this RunningDeploymentStatus. + + + :return: The cluster_type of this RunningDeploymentStatus. + :rtype: str + """ + return self._cluster_type + + @cluster_type.setter + def cluster_type(self, cluster_type: str): + """Sets the cluster_type of this RunningDeploymentStatus. + + + :param cluster_type: The cluster_type of this RunningDeploymentStatus. + :type cluster_type: str + """ + allowed_values = ["HOSTS", "KUBERNETES"] # noqa: E501 + if cluster_type not in allowed_values: + raise ValueError( + "Invalid value for `cluster_type` ({0}), must be one of {1}" + .format(cluster_type, allowed_values) + ) + + self._cluster_type = cluster_type + + @property + def nodes(self) -> List[RunningDeploymentStatusNodesInner]: + """Gets the nodes of this RunningDeploymentStatus. + + + :return: The nodes of this RunningDeploymentStatus. + :rtype: List[RunningDeploymentStatusNodesInner] + """ + return self._nodes + + @nodes.setter + def nodes(self, nodes: List[RunningDeploymentStatusNodesInner]): + """Sets the nodes of this RunningDeploymentStatus. + + + :param nodes: The nodes of this RunningDeploymentStatus. + :type nodes: List[RunningDeploymentStatusNodesInner] + """ + if nodes is None: + raise ValueError("Invalid value for `nodes`, must not be `None`") # noqa: E501 + + self._nodes = nodes diff --git a/flex/coordinator/gs_flex_coordinator/models/running_deployment_status_nodes_inner.py b/flex/coordinator/gs_flex_coordinator/models/running_deployment_status_nodes_inner.py new file mode 100644 index 000000000000..ef98cef2821b --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/models/running_deployment_status_nodes_inner.py @@ -0,0 +1,149 @@ +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from gs_flex_coordinator.models.base_model import Model +from gs_flex_coordinator.models.node_status import NodeStatus +from gs_flex_coordinator import util + +from gs_flex_coordinator.models.node_status import NodeStatus # noqa: E501 + +class RunningDeploymentStatusNodesInner(Model): + """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + + Do not edit the class manually. + """ + + def __init__(self, name=None, cpu_usage=None, memory_usage=None, disk_usage=None): # noqa: E501 + """RunningDeploymentStatusNodesInner - a model defined in OpenAPI + + :param name: The name of this RunningDeploymentStatusNodesInner. # noqa: E501 + :type name: str + :param cpu_usage: The cpu_usage of this RunningDeploymentStatusNodesInner. # noqa: E501 + :type cpu_usage: float + :param memory_usage: The memory_usage of this RunningDeploymentStatusNodesInner. # noqa: E501 + :type memory_usage: float + :param disk_usage: The disk_usage of this RunningDeploymentStatusNodesInner. # noqa: E501 + :type disk_usage: float + """ + self.openapi_types = { + 'name': str, + 'cpu_usage': float, + 'memory_usage': float, + 'disk_usage': float + } + + self.attribute_map = { + 'name': 'name', + 'cpu_usage': 'cpu_usage', + 'memory_usage': 'memory_usage', + 'disk_usage': 'disk_usage' + } + + self._name = name + self._cpu_usage = cpu_usage + self._memory_usage = memory_usage + self._disk_usage = disk_usage + + @classmethod + def from_dict(cls, dikt) -> 'RunningDeploymentStatusNodesInner': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The RunningDeploymentStatus_nodes_inner of this RunningDeploymentStatusNodesInner. # noqa: E501 + :rtype: RunningDeploymentStatusNodesInner + """ + return util.deserialize_model(dikt, cls) + + @property + def name(self) -> str: + """Gets the name of this RunningDeploymentStatusNodesInner. + + + :return: The name of this RunningDeploymentStatusNodesInner. + :rtype: str + """ + return self._name + + @name.setter + def name(self, name: str): + """Sets the name of this RunningDeploymentStatusNodesInner. + + + :param name: The name of this RunningDeploymentStatusNodesInner. + :type name: str + """ + if name is None: + raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 + + self._name = name + + @property + def cpu_usage(self) -> float: + """Gets the cpu_usage of this RunningDeploymentStatusNodesInner. + + + :return: The cpu_usage of this RunningDeploymentStatusNodesInner. + :rtype: float + """ + return self._cpu_usage + + @cpu_usage.setter + def cpu_usage(self, cpu_usage: float): + """Sets the cpu_usage of this RunningDeploymentStatusNodesInner. + + + :param cpu_usage: The cpu_usage of this RunningDeploymentStatusNodesInner. + :type cpu_usage: float + """ + if cpu_usage is None: + raise ValueError("Invalid value for `cpu_usage`, must not be `None`") # noqa: E501 + + self._cpu_usage = cpu_usage + + @property + def memory_usage(self) -> float: + """Gets the memory_usage of this RunningDeploymentStatusNodesInner. + + + :return: The memory_usage of this RunningDeploymentStatusNodesInner. + :rtype: float + """ + return self._memory_usage + + @memory_usage.setter + def memory_usage(self, memory_usage: float): + """Sets the memory_usage of this RunningDeploymentStatusNodesInner. + + + :param memory_usage: The memory_usage of this RunningDeploymentStatusNodesInner. + :type memory_usage: float + """ + if memory_usage is None: + raise ValueError("Invalid value for `memory_usage`, must not be `None`") # noqa: E501 + + self._memory_usage = memory_usage + + @property + def disk_usage(self) -> float: + """Gets the disk_usage of this RunningDeploymentStatusNodesInner. + + + :return: The disk_usage of this RunningDeploymentStatusNodesInner. + :rtype: float + """ + return self._disk_usage + + @disk_usage.setter + def disk_usage(self, disk_usage: float): + """Sets the disk_usage of this RunningDeploymentStatusNodesInner. + + + :param disk_usage: The disk_usage of this RunningDeploymentStatusNodesInner. + :type disk_usage: float + """ + if disk_usage is None: + raise ValueError("Invalid value for `disk_usage`, must not be `None`") # noqa: E501 + + self._disk_usage = disk_usage diff --git a/flex/coordinator/gs_flex_coordinator/models/service_status.py b/flex/coordinator/gs_flex_coordinator/models/service_status.py index 03eb6ef76e54..31ec49f2dbef 100644 --- a/flex/coordinator/gs_flex_coordinator/models/service_status.py +++ b/flex/coordinator/gs_flex_coordinator/models/service_status.py @@ -3,11 +3,9 @@ from typing import List, Dict # noqa: F401 from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.get_graph_response import GetGraphResponse from gs_flex_coordinator.models.service_status_sdk_endpoints import ServiceStatusSdkEndpoints from gs_flex_coordinator import util -from gs_flex_coordinator.models.get_graph_response import GetGraphResponse # noqa: E501 from gs_flex_coordinator.models.service_status_sdk_endpoints import ServiceStatusSdkEndpoints # noqa: E501 class ServiceStatus(Model): @@ -16,31 +14,36 @@ class ServiceStatus(Model): Do not edit the class manually. """ - def __init__(self, status=None, graph=None, sdk_endpoints=None): # noqa: E501 + def __init__(self, graph_id=None, status=None, sdk_endpoints=None, start_time=None): # noqa: E501 """ServiceStatus - a model defined in OpenAPI + :param graph_id: The graph_id of this ServiceStatus. # noqa: E501 + :type graph_id: str :param status: The status of this ServiceStatus. # noqa: E501 :type status: str - :param graph: The graph of this ServiceStatus. # noqa: E501 - :type graph: GetGraphResponse :param sdk_endpoints: The sdk_endpoints of this ServiceStatus. # noqa: E501 :type sdk_endpoints: ServiceStatusSdkEndpoints + :param start_time: The start_time of this ServiceStatus. # noqa: E501 + :type start_time: str """ self.openapi_types = { + 'graph_id': str, 'status': str, - 'graph': GetGraphResponse, - 'sdk_endpoints': ServiceStatusSdkEndpoints + 'sdk_endpoints': ServiceStatusSdkEndpoints, + 'start_time': str } self.attribute_map = { + 'graph_id': 'graph_id', 'status': 'status', - 'graph': 'graph', - 'sdk_endpoints': 'sdk_endpoints' + 'sdk_endpoints': 'sdk_endpoints', + 'start_time': 'start_time' } + self._graph_id = graph_id self._status = status - self._graph = graph self._sdk_endpoints = sdk_endpoints + self._start_time = start_time @classmethod def from_dict(cls, dikt) -> 'ServiceStatus': @@ -53,6 +56,29 @@ def from_dict(cls, dikt) -> 'ServiceStatus': """ return util.deserialize_model(dikt, cls) + @property + def graph_id(self) -> str: + """Gets the graph_id of this ServiceStatus. + + + :return: The graph_id of this ServiceStatus. + :rtype: str + """ + return self._graph_id + + @graph_id.setter + def graph_id(self, graph_id: str): + """Sets the graph_id of this ServiceStatus. + + + :param graph_id: The graph_id of this ServiceStatus. + :type graph_id: str + """ + if graph_id is None: + raise ValueError("Invalid value for `graph_id`, must not be `None`") # noqa: E501 + + self._graph_id = graph_id + @property def status(self) -> str: """Gets the status of this ServiceStatus. @@ -80,27 +106,6 @@ def status(self, status: str): self._status = status - @property - def graph(self) -> GetGraphResponse: - """Gets the graph of this ServiceStatus. - - - :return: The graph of this ServiceStatus. - :rtype: GetGraphResponse - """ - return self._graph - - @graph.setter - def graph(self, graph: GetGraphResponse): - """Sets the graph of this ServiceStatus. - - - :param graph: The graph of this ServiceStatus. - :type graph: GetGraphResponse - """ - - self._graph = graph - @property def sdk_endpoints(self) -> ServiceStatusSdkEndpoints: """Gets the sdk_endpoints of this ServiceStatus. @@ -121,3 +126,24 @@ def sdk_endpoints(self, sdk_endpoints: ServiceStatusSdkEndpoints): """ self._sdk_endpoints = sdk_endpoints + + @property + def start_time(self) -> str: + """Gets the start_time of this ServiceStatus. + + + :return: The start_time of this ServiceStatus. + :rtype: str + """ + return self._start_time + + @start_time.setter + def start_time(self, start_time: str): + """Sets the start_time of this ServiceStatus. + + + :param start_time: The start_time of this ServiceStatus. + :type start_time: str + """ + + self._start_time = start_time diff --git a/flex/coordinator/gs_flex_coordinator/models/update_procedure_request.py b/flex/coordinator/gs_flex_coordinator/models/update_stored_proc_request.py similarity index 64% rename from flex/coordinator/gs_flex_coordinator/models/update_procedure_request.py rename to flex/coordinator/gs_flex_coordinator/models/update_stored_proc_request.py index 435f9889f279..e7819d069329 100644 --- a/flex/coordinator/gs_flex_coordinator/models/update_procedure_request.py +++ b/flex/coordinator/gs_flex_coordinator/models/update_stored_proc_request.py @@ -6,16 +6,16 @@ from gs_flex_coordinator import util -class UpdateProcedureRequest(Model): +class UpdateStoredProcRequest(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. """ def __init__(self, description=None): # noqa: E501 - """UpdateProcedureRequest - a model defined in OpenAPI + """UpdateStoredProcRequest - a model defined in OpenAPI - :param description: The description of this UpdateProcedureRequest. # noqa: E501 + :param description: The description of this UpdateStoredProcRequest. # noqa: E501 :type description: str """ self.openapi_types = { @@ -29,32 +29,32 @@ def __init__(self, description=None): # noqa: E501 self._description = description @classmethod - def from_dict(cls, dikt) -> 'UpdateProcedureRequest': + def from_dict(cls, dikt) -> 'UpdateStoredProcRequest': """Returns the dict as a model :param dikt: A dict. :type: dict - :return: The UpdateProcedureRequest of this UpdateProcedureRequest. # noqa: E501 - :rtype: UpdateProcedureRequest + :return: The UpdateStoredProcRequest of this UpdateStoredProcRequest. # noqa: E501 + :rtype: UpdateStoredProcRequest """ return util.deserialize_model(dikt, cls) @property def description(self) -> str: - """Gets the description of this UpdateProcedureRequest. + """Gets the description of this UpdateStoredProcRequest. - :return: The description of this UpdateProcedureRequest. + :return: The description of this UpdateStoredProcRequest. :rtype: str """ return self._description @description.setter def description(self, description: str): - """Sets the description of this UpdateProcedureRequest. + """Sets the description of this UpdateStoredProcRequest. - :param description: The description of this UpdateProcedureRequest. + :param description: The description of this UpdateStoredProcRequest. :type description: str """ if description is None: diff --git a/flex/coordinator/gs_flex_coordinator/openapi/openapi.yaml b/flex/coordinator/gs_flex_coordinator/openapi/openapi.yaml index 89a5a08a3e27..ff371deac526 100644 --- a/flex/coordinator/gs_flex_coordinator/openapi/openapi.yaml +++ b/flex/coordinator/gs_flex_coordinator/openapi/openapi.yaml @@ -25,7 +25,7 @@ tags: - name: Graph - name: DataSource - name: Job -- name: Procedure +- name: Stored Procedure - name: Service - name: Alert - name: Utils @@ -405,7 +405,7 @@ paths: tags: - Alert x-openapi-router-controller: gs_flex_coordinator.controllers.alert_controller - /api/v1/deployment/info: + /api/v1/deployment: get: description: Deployment information operationId: get_deployment_info @@ -417,7 +417,9 @@ paths: cluster_type: HOSTS creation_time: 2024-01-01 00:00:00 instance_name: demo - solution: INTERACTIVE + frontend: Cypher/Gremlin + engine: Hiactor + storage: MutableCSR version: 0.27.0 schema: $ref: '#/components/schemas/RunningDeploymentInfo' @@ -431,6 +433,33 @@ paths: tags: - Deployment x-openapi-router-controller: gs_flex_coordinator.controllers.deployment_controller + /api/v1/deployment/status: + get: + description: Deployment status + operationId: get_deployment_status + responses: + "200": + content: + application/json: + example: + cluster_type: HOSTS + nodes: + - name: HOSTNAME-1 + cpu_usage: 83.0 + memory_usage: 37.5 + disk_usage: 97 + schema: + $ref: '#/components/schemas/RunningDeploymentStatus' + description: Successfully returned the deployment status + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error + tags: + - Deployment + x-openapi-router-controller: gs_flex_coordinator.controllers.deployment_controller /api/v1/file/uploading: post: operationId: upload_file @@ -471,8 +500,8 @@ paths: schema_update_time: 2024-01-02 00:00:00 data_update_time: 2024-01-03 00:00:00 stored_procedures: - - id: PROCEDUREID - name: procedure_name + - id: STORED-PROCEDURE-ID + name: stored_procedure_name type: cypher query: MATCH(a) return COUNT(a); library: /path/to/library @@ -641,8 +670,8 @@ paths: schema_update_time: 2024-01-02 00:00:00 data_update_time: 2024-01-03 00:00:00 stored_procedures: - - id: PROCEDUREID - name: procedure_name + - id: STORED-PROCEDURE-ID + name: stored_procedure_name type: cypher query: MATCH(a) return COUNT(a); library: /path/to/library @@ -1016,10 +1045,10 @@ paths: tags: - DataSource x-openapi-router-controller: gs_flex_coordinator.controllers.data_source_controller - /api/v1/graph/{graph_id}/procedure: + /api/v1/graph/{graph_id}/schema: get: - description: List all stored procedures on a certain graph - operationId: list_procedures + description: Get graph schema by ID + operationId: get_schema_by_id parameters: - explode: false in: path @@ -1033,43 +1062,100 @@ paths: content: application/json: example: - - id: PROCEDUREID-1 - name: procedure_name_1 - type: cypher - query: MATCH(a) return COUNT(a); - library: /path/to/library - params: - - name: param1 - type: - string: - long_text: null - returns: - - name: return1 - type: - PrimitiveType: DT_SIGNED_INT64 - bound_graph: demo - runnable: true - - id: PROCEDUREID-2 - name: procedure_name_2 - type: cypher - query: MATCH(a) return COUNT(a); - library: /path/to/library - params: - - name: param1 - type: - string: - long_text: null - returns: - - name: return1 - type: - PrimitiveType: DT_SIGNED_INT64 - bound_graph: demo - runnable: false + vertex_types: + - type_id: 0 + type_name: person + properties: + - property_id: 0 + property_name: id + property_type: + string: + long_text: null + - property_id: 1 + property_name: name + property_type: + string: + long_text: null + primary_keys: + - id + - type_id: 1 + type_name: software + properties: + - property_id: 0 + property_name: id + property_type: + string: + long_text: null + - property_id: 1 + property_name: name + property_type: + string: + long_text: null + primary_keys: + - id + edge_types: + - type_id: 0 + type_name: knows + vertex_type_pair_relations: + - source_vertex: person + destination_vertex: person + relation: MANY_TO_MANY + x_csr_params: + edge_storage_strategy: ONLY_IN + properties: + - property_id: 0 + property_name: weight + property_type: + primitive_type: DT_DOUBLE + - type_id: 1 + type_name: created + vertex_type_pair_relations: + - source_vertex: person + destination_vertex: software + relation: MANY_TO_MANY + x_csr_params: + edge_storage_strategy: ONLY_IN + properties: + - property_id: 0 + property_name: weight + property_type: + primitive_type: DT_DOUBLE schema: - items: - $ref: '#/components/schemas/GetProcedureResponse' - type: array - description: Successful operation + $ref: '#/components/schemas/GetGraphSchemaResponse' + description: Successfully returned the graph schema + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error + tags: + - Graph + x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller + post: + description: Import graph schema + operationId: import_schema_by_id + parameters: + - explode: false + in: path + name: graph_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateGraphSchemaRequest' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/APIResponse' + description: Successful imported the graph schema "400": content: application/json: @@ -1083,11 +1169,12 @@ paths: $ref: '#/components/schemas/Error' description: Server error tags: - - Procedure - x-openapi-router-controller: gs_flex_coordinator.controllers.procedure_controller + - Graph + x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller + /api/v1/graph/{graph_id}/schema/edge: post: - description: Create a new stored procedure on a certain graph - operationId: create_procedure + description: Create a edge type + operationId: create_edge_type parameters: - explode: false in: path @@ -1100,15 +1187,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CreateProcedureRequest' - required: true + $ref: '#/components/schemas/CreateEdgeType' responses: "200": content: application/json: schema: - $ref: '#/components/schemas/CreateProcedureResponse' - description: Successfully created a procedure + $ref: '#/components/schemas/APIResponse' + description: Successful created the edge type "400": content: application/json: @@ -1122,12 +1208,12 @@ paths: $ref: '#/components/schemas/Error' description: Server error tags: - - Procedure - x-openapi-router-controller: gs_flex_coordinator.controllers.procedure_controller - /api/v1/graph/{graph_id}/procedure/{procedure_id}: + - Graph + x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller + /api/v1/graph/{graph_id}/schema/edge/{type_name}: delete: - description: Delete a stored procedure by ID - operationId: delete_procedure_by_id + description: Delete edge type by name + operationId: delete_edge_type_by_name parameters: - explode: false in: path @@ -1138,18 +1224,32 @@ paths: style: simple - explode: false in: path - name: procedure_id + name: type_name required: true schema: type: string style: simple + - explode: true + in: query + name: source_vertex_type + required: true + schema: + type: string + style: form + - explode: true + in: query + name: destination_vertex_type + required: true + schema: + type: string + style: form responses: "200": content: application/json: schema: $ref: '#/components/schemas/APIResponse' - description: Successfully deleted the stored procedure + description: Successful deleted the edge type "500": content: application/json: @@ -1157,11 +1257,12 @@ paths: $ref: '#/components/schemas/Error' description: Server error tags: - - Procedure - x-openapi-router-controller: gs_flex_coordinator.controllers.procedure_controller - get: - description: Get a stored procedure by ID - operationId: get_procedure_by_id + - Graph + x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller + /api/v1/graph/{graph_id}/schema/vertex: + post: + description: Create a vertex type + operationId: create_vertex_type parameters: - explode: false in: path @@ -1170,37 +1271,25 @@ paths: schema: type: string style: simple - - explode: false - in: path - name: procedure_id + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateVertexType' required: true - schema: - type: string - style: simple responses: "200": content: application/json: - example: - id: PROCEDUREID - name: procedure_name - type: cypher - query: MATCH(a) return COUNT(a); - library: /path/to/library - params: - - name: param1 - type: - string: - long_text: null - returns: - - name: return1 - type: - PrimitiveType: DT_SIGNED_INT64 - bound_graph: demo - runnable: true schema: - $ref: '#/components/schemas/GetProcedureResponse' - description: Successfully returned the procedure + $ref: '#/components/schemas/APIResponse' + description: Successful created a vertex type + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Bad request "500": content: application/json: @@ -1208,11 +1297,12 @@ paths: $ref: '#/components/schemas/Error' description: Server error tags: - - Procedure - x-openapi-router-controller: gs_flex_coordinator.controllers.procedure_controller - put: - description: Update a stored procedure by ID - operationId: update_procedure_by_id + - Graph + x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller + /api/v1/graph/{graph_id}/schema/vertex/{type_name}: + delete: + description: Delete vertex type by name + operationId: delete_vertex_type_by_name parameters: - explode: false in: path @@ -1223,23 +1313,18 @@ paths: style: simple - explode: false in: path - name: procedure_id + name: type_name required: true schema: type: string style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateProcedureRequest' responses: "200": content: application/json: schema: $ref: '#/components/schemas/APIResponse' - description: Successfully updated the stored procedure + description: Successful deleted the vertex type "500": content: application/json: @@ -1247,86 +1332,35 @@ paths: $ref: '#/components/schemas/Error' description: Server error tags: - - Procedure - x-openapi-router-controller: gs_flex_coordinator.controllers.procedure_controller - /api/v1/graph/{graph_id}/schema: + - Graph + x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller + /api/v1/graph/{graph_id}/service: get: - description: Get graph schema by ID - operationId: get_schema_by_id + description: Get service status by graph ID + operationId: get_service_status_by_id parameters: - explode: false in: path - name: graph_id - required: true - schema: - type: string - style: simple - responses: - "200": - content: - application/json: - example: - vertex_types: - - type_id: 0 - type_name: person - properties: - - property_id: 0 - property_name: id - property_type: - string: - long_text: null - - property_id: 1 - property_name: name - property_type: - string: - long_text: null - primary_keys: - - id - - type_id: 1 - type_name: software - properties: - - property_id: 0 - property_name: id - property_type: - string: - long_text: null - - property_id: 1 - property_name: name - property_type: - string: - long_text: null - primary_keys: - - id - edge_types: - - type_id: 0 - type_name: knows - vertex_type_pair_relations: - - source_vertex: person - destination_vertex: person - relation: MANY_TO_MANY - x_csr_params: - edge_storage_strategy: ONLY_IN - properties: - - property_id: 0 - property_name: weight - property_type: - primitive_type: DT_DOUBLE - - type_id: 1 - type_name: created - vertex_type_pair_relations: - - source_vertex: person - destination_vertex: software - relation: MANY_TO_MANY - x_csr_params: - edge_storage_strategy: ONLY_IN - properties: - - property_id: 0 - property_name: weight - property_type: - primitive_type: DT_DOUBLE + name: graph_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + example: + graph_id: GRAPHID + status: Running + sdk_endpoints: + cypher: neo4j://mock.api.cypher:7676 + gremin: ws://mock.api.gremlin/gremlin + hqps: http://mock.api.hqps:10000 + start_time: 2024-01-01 00:00:00 schema: - $ref: '#/components/schemas/GetGraphSchemaResponse' - description: Successfully returned the graph schema + $ref: '#/components/schemas/ServiceStatus' + description: Successfully returned the service status "500": content: application/json: @@ -1334,11 +1368,12 @@ paths: $ref: '#/components/schemas/Error' description: Server error tags: - - Graph - x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller - post: - description: Import graph schema - operationId: import_schema_by_id + - Service + x-openapi-router-controller: gs_flex_coordinator.controllers.service_controller + /api/v1/graph/{graph_id}/storedproc: + get: + description: List all stored procedures on a certain graph + operationId: list_stored_procedures parameters: - explode: false in: path @@ -1347,19 +1382,48 @@ paths: schema: type: string style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateGraphSchemaRequest' - required: true responses: "200": content: application/json: + example: + - id: STORED-PROCEDUREID-1 + name: stored_procedure_name_1 + type: cypher + query: MATCH(a) return COUNT(a); + library: /path/to/library + params: + - name: param1 + type: + string: + long_text: null + returns: + - name: return1 + type: + PrimitiveType: DT_SIGNED_INT64 + bound_graph: demo + runnable: true + - id: STORED-PROCEDUREID-2 + name: stored_procedure_name_2 + type: cypher + query: MATCH(a) return COUNT(a); + library: /path/to/library + params: + - name: param1 + type: + string: + long_text: null + returns: + - name: return1 + type: + PrimitiveType: DT_SIGNED_INT64 + bound_graph: demo + runnable: false schema: - $ref: '#/components/schemas/APIResponse' - description: Successful imported the graph schema + items: + $ref: '#/components/schemas/GetStoredProcResponse' + type: array + description: Successful operation "400": content: application/json: @@ -1373,12 +1437,11 @@ paths: $ref: '#/components/schemas/Error' description: Server error tags: - - Graph - x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller - /api/v1/graph/{graph_id}/schema/edge: + - Stored Procedure + x-openapi-router-controller: gs_flex_coordinator.controllers.stored_procedure_controller post: - description: Create a edge type - operationId: create_edge_type + description: Create a new stored procedure on a certain graph + operationId: create_stored_procedure parameters: - explode: false in: path @@ -1391,14 +1454,15 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CreateEdgeType' + $ref: '#/components/schemas/CreateStoredProcRequest' + required: true responses: "200": content: application/json: schema: - $ref: '#/components/schemas/APIResponse' - description: Successful created the edge type + $ref: '#/components/schemas/CreateStoredProcResponse' + description: Successfully created a stored procedure "400": content: application/json: @@ -1412,12 +1476,12 @@ paths: $ref: '#/components/schemas/Error' description: Server error tags: - - Graph - x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller - /api/v1/graph/{graph_id}/schema/edge/{type_name}: + - Stored Procedure + x-openapi-router-controller: gs_flex_coordinator.controllers.stored_procedure_controller + /api/v1/graph/{graph_id}/storedproc/{stored_procedure_id}: delete: - description: Delete edge type by name - operationId: delete_edge_type_by_name + description: Delete a stored procedure by ID + operationId: delete_stored_procedure_by_id parameters: - explode: false in: path @@ -1428,32 +1492,18 @@ paths: style: simple - explode: false in: path - name: type_name + name: stored_procedure_id required: true schema: type: string style: simple - - explode: true - in: query - name: source_vertex_type - required: true - schema: - type: string - style: form - - explode: true - in: query - name: destination_vertex_type - required: true - schema: - type: string - style: form responses: "200": content: application/json: schema: $ref: '#/components/schemas/APIResponse' - description: Successful deleted the edge type + description: Successfully deleted the stored procedure "500": content: application/json: @@ -1461,12 +1511,11 @@ paths: $ref: '#/components/schemas/Error' description: Server error tags: - - Graph - x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller - /api/v1/graph/{graph_id}/schema/vertex: - post: - description: Create a vertex type - operationId: create_vertex_type + - Stored Procedure + x-openapi-router-controller: gs_flex_coordinator.controllers.stored_procedure_controller + get: + description: Get a stored procedure by ID + operationId: get_stored_procedure_by_id parameters: - explode: false in: path @@ -1475,25 +1524,37 @@ paths: schema: type: string style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateVertexType' + - explode: false + in: path + name: stored_procedure_id required: true + schema: + type: string + style: simple responses: "200": content: application/json: + example: + id: STORED-PROCEDURE-ID + name: stored_procedure_name + type: cypher + query: MATCH(a) return COUNT(a); + library: /path/to/library + params: + - name: param1 + type: + string: + long_text: null + returns: + - name: return1 + type: + PrimitiveType: DT_SIGNED_INT64 + bound_graph: demo + runnable: true schema: - $ref: '#/components/schemas/APIResponse' - description: Successful created a vertex type - "400": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Bad request + $ref: '#/components/schemas/GetStoredProcResponse' + description: Successfully returned the stored procedure "500": content: application/json: @@ -1501,12 +1562,11 @@ paths: $ref: '#/components/schemas/Error' description: Server error tags: - - Graph - x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller - /api/v1/graph/{graph_id}/schema/vertex/{type_name}: - delete: - description: Delete vertex type by name - operationId: delete_vertex_type_by_name + - Stored Procedure + x-openapi-router-controller: gs_flex_coordinator.controllers.stored_procedure_controller + put: + description: Update a stored procedure by ID + operationId: update_stored_procedure_by_id parameters: - explode: false in: path @@ -1517,18 +1577,23 @@ paths: style: simple - explode: false in: path - name: type_name + name: stored_procedure_id required: true schema: type: string style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateStoredProcRequest' responses: "200": content: application/json: schema: $ref: '#/components/schemas/APIResponse' - description: Successful deleted the vertex type + description: Successfully updated the stored procedure "500": content: application/json: @@ -1536,8 +1601,8 @@ paths: $ref: '#/components/schemas/Error' description: Server error tags: - - Graph - x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller + - Stored Procedure + x-openapi-router-controller: gs_flex_coordinator.controllers.stored_procedure_controller /api/v1/job: get: description: List all jobs @@ -1650,6 +1715,36 @@ paths: tags: - Job x-openapi-router-controller: gs_flex_coordinator.controllers.job_controller + /api/v1/service: + get: + description: List all service status + operationId: list_service_status + responses: + "200": + content: + application/json: + example: + - graph_id: GRAPHID + status: Running + sdk_endpoints: + cypher: neo4j://mock.api.cypher:7676 + gremin: ws://mock.api.gremlin/gremlin + hqps: http://mock.api.hqps:10000 + start_time: 2024-01-01 00:00:00 + schema: + items: + $ref: '#/components/schemas/ServiceStatus' + type: array + description: Successfully returned all service status + "500": + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + description: Server error + tags: + - Service + x-openapi-router-controller: gs_flex_coordinator.controllers.service_controller /api/v1/service/restart: post: description: Restart current service @@ -1701,115 +1796,6 @@ paths: tags: - Service x-openapi-router-controller: gs_flex_coordinator.controllers.service_controller - /api/v1/service/status: - get: - description: Get service status - operationId: get_service_status - responses: - "200": - content: - application/json: - example: - status: Running - graph: - id: GRAPHID - name: demo - creation_time: 2024-01-01 00:00:00 - schema_update_time: 2024-01-02 00:00:00 - data_update_time: 2024-01-03 00:00:00 - stored_procedures: - - id: PROCEDUREID - name: procedure_name - type: cypher - query: MATCH(a) return COUNT(a); - library: /path/to/library - params: - - name: param1 - type: - string: - long_text: null - returns: - - name: return1 - type: - PrimitiveType: DT_SIGNED_INT64 - bound_graph: demo - runnable: true - schema: - vertex_types: - - type_id: 0 - type_name: person - properties: - - property_id: 0 - property_name: id - property_type: - string: - long_text: null - - property_id: 1 - property_name: name - property_type: null - string: - long_text: null - primary_keys: - - id - - type_id: 1 - type_name: software - properties: - - property_id: 0 - property_name: id - property_type: - string: - long_text: null - - property_id: 1 - property_name: name - property_type: - string: - long_text: null - primary_keys: - - id - edge_types: - - type_id: 0 - type_name: knows - vertex_type_pair_relations: - - source_vertex: person - destination_vertex: person - relation: MANY_TO_MANY - x_csr_params: - edge_storage_strategy: ONLY_IN - properties: - - property_id: 0 - property_name: weight - property_type: - primitive_type: DT_DOUBLE - - type_id: 1 - type_name: created - vertex_type_pair_relations: - - source_vertex: person - destination_vertex: software - relation: MANY_TO_MANY - x_csr_params: - edge_storage_strategy: ONLY_IN - properties: - - property_id: 0 - property_name: weight - property_type: - primitive_type: DT_DOUBLE - sdk_endpoints: - cypher: neo4j://mock.api.cypher:7676 - gremlin: ws://mock.api.gremlin/gremlin - hqps: http://mock.api.hqps:10000 - grpc: http://mock.api.grpc:10000 - schema: - $ref: '#/components/schemas/ServiceStatus' - description: Successfully returned current service status - "500": - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - description: Server error - tags: - - Service - x-openapi-router-controller: gs_flex_coordinator.controllers.service_controller /api/v1/service/stop: post: description: Stop current service @@ -1877,9 +1863,11 @@ components: example: creation_time: creation_time instance_name: instance_name - solution: INTERACTIVE + engine: Hiactor cluster_type: HOSTS + storage: MutableCSR version: version + frontend: Cypher/Gremlin properties: instance_name: title: instance_name @@ -1893,22 +1881,91 @@ components: version: title: version type: string - solution: - enum: - - INTERACTIVE - - GRAPHSCOPE_INSIGHT - title: solution - type: string creation_time: title: creation_time type: string + frontend: + enum: + - Cypher/Gremlin + - AnalyticalApps + title: frontend + type: string + engine: + enum: + - Hiactor + - Gaia + title: engine + type: string + storage: + enum: + - MutableCSR + title: storage + type: string required: - cluster_type - creation_time + - engine + - frontend - instance_name - - solution + - storage - version title: RunningDeploymentInfo + NodeStatus: + example: + name: name + memory_usage: 6.027456183070403 + disk_usage: 1.4658129805029452 + cpu_usage: 0.8008281904610115 + properties: + name: + title: name + type: string + cpu_usage: + format: double + title: cpu_usage + type: number + memory_usage: + format: double + title: memory_usage + type: number + disk_usage: + format: double + title: disk_usage + type: number + required: + - cpu_usage + - disk_usage + - memory_usage + - name + title: NodeStatus + RunningDeploymentStatus: + example: + nodes: + - name: name + memory_usage: 6.027456183070403 + disk_usage: 1.4658129805029452 + cpu_usage: 0.8008281904610115 + - name: name + memory_usage: 6.027456183070403 + disk_usage: 1.4658129805029452 + cpu_usage: 0.8008281904610115 + cluster_type: HOSTS + properties: + cluster_type: + enum: + - HOSTS + - KUBERNETES + title: cluster_type + type: string + nodes: + items: + $ref: '#/components/schemas/RunningDeploymentStatus_nodes_inner' + title: nodes + type: array + required: + - cluster_type + - nodes + title: RunningDeploymentStatus StartServiceRequest: example: graph_id: graph_id @@ -1920,152 +1977,32 @@ components: x-body-name: start_service_request ServiceStatus: example: + start_time: start_time + graph_id: graph_id sdk_endpoints: gremlin: gremlin cypher: cypher hqps: hqps grpc: grpc - graph: - creation_time: creation_time - schema: - vertex_types: - - type_name: type_name - primary_keys: - - primary_keys - - primary_keys - x_csr_params: - max_vertex_num: 0 - type_id: 6 - description: description - properties: - - nullable: true - property_type: - primitive_type: DT_SIGNED_INT32 - description: description - default_value: "" - property_id: 1 - property_name: property_name - - nullable: true - property_type: - primitive_type: DT_SIGNED_INT32 - description: description - default_value: "" - property_id: 1 - property_name: property_name - - type_name: type_name - primary_keys: - - primary_keys - - primary_keys - x_csr_params: - max_vertex_num: 0 - type_id: 6 - description: description - properties: - - nullable: true - property_type: - primitive_type: DT_SIGNED_INT32 - description: description - default_value: "" - property_id: 1 - property_name: property_name - - nullable: true - property_type: - primitive_type: DT_SIGNED_INT32 - description: description - default_value: "" - property_id: 1 - property_name: property_name - edge_types: - - type_name: type_name - directed: true - primary_keys: - - primary_keys - - primary_keys - vertex_type_pair_relations: - - source_vertex: source_vertex - destination_vertex: destination_vertex - x_csr_params: - edge_storage_strategy: ONLY_IN - relation: MANY_TO_MANY - - source_vertex: source_vertex - destination_vertex: destination_vertex - x_csr_params: - edge_storage_strategy: ONLY_IN - relation: MANY_TO_MANY - type_id: 5 - description: description - properties: - - nullable: true - property_type: - primitive_type: DT_SIGNED_INT32 - description: description - default_value: "" - property_id: 1 - property_name: property_name - - nullable: true - property_type: - primitive_type: DT_SIGNED_INT32 - description: description - default_value: "" - property_id: 1 - property_name: property_name - - type_name: type_name - directed: true - primary_keys: - - primary_keys - - primary_keys - vertex_type_pair_relations: - - source_vertex: source_vertex - destination_vertex: destination_vertex - x_csr_params: - edge_storage_strategy: ONLY_IN - relation: MANY_TO_MANY - - source_vertex: source_vertex - destination_vertex: destination_vertex - x_csr_params: - edge_storage_strategy: ONLY_IN - relation: MANY_TO_MANY - type_id: 5 - description: description - properties: - - nullable: true - property_type: - primitive_type: DT_SIGNED_INT32 - description: description - default_value: "" - property_id: 1 - property_name: property_name - - nullable: true - property_type: - primitive_type: DT_SIGNED_INT32 - description: description - default_value: "" - property_id: 1 - property_name: property_name - stored_procedures: - - runnable: true - bound_graph: bound_graph - - runnable: true - bound_graph: bound_graph - name: name - description: description - schema_update_time: schema_update_time - id: id - store_type: mutable_csr - data_update_time: data_update_time status: Running properties: + graph_id: + title: graph_id + type: string status: enum: - Running - Stopped title: status type: string - graph: - $ref: '#/components/schemas/GetGraphResponse' sdk_endpoints: $ref: '#/components/schemas/ServiceStatus_sdk_endpoints' + start_time: + title: start_time + type: string required: + - creation_time + - graph_id - status title: ServiceStatus UploadFileResponse: @@ -2299,7 +2236,7 @@ components: property_name: property_name title: CreateEdgeType x-body-name: create_edge_type - CreateProcedureRequest: + CreateStoredProcRequest: example: query: query name: name @@ -2325,18 +2262,18 @@ components: - name - query - type - title: CreateProcedureRequest - x-body-name: create_procedure_request - CreateProcedureResponse: + title: CreateStoredProcRequest + x-body-name: create_stored_proc_request + CreateStoredProcResponse: example: - procedure_id: procedure_id + stored_procedure_id: stored_procedure_id properties: - procedure_id: - title: procedure_id + stored_procedure_id: + title: stored_procedure_id type: string required: - - procedure_id - title: CreateProcedureResponse + - stored_procedure_id + title: CreateStoredProcResponse CreateGraphSchemaRequest: example: vertex_types: @@ -2582,14 +2519,11 @@ components: type: string stored_procedures: items: - $ref: '#/components/schemas/CreateProcedureRequest' + $ref: '#/components/schemas/CreateStoredProcRequest' title: stored_procedures type: array schema: $ref: '#/components/schemas/CreateGraphSchemaRequest' - required: - - name - - schema title: CreateGraphRequest x-body-name: create_graph_request CreateGraphResponse: @@ -2604,7 +2538,7 @@ components: title: CreateGraphResponse StoredProcedureMeta: allOf: - - $ref: '#/components/schemas/CreateProcedureRequest' + - $ref: '#/components/schemas/CreateStoredProcRequest' - properties: id: type: string @@ -2625,7 +2559,7 @@ components: - returns type: object title: StoredProcedureMeta - GetProcedureResponse: + GetStoredProcResponse: allOf: - $ref: '#/components/schemas/StoredProcedureMeta' - properties: @@ -2640,8 +2574,8 @@ components: example: runnable: true bound_graph: bound_graph - title: GetProcedureResponse - UpdateProcedureRequest: + title: GetStoredProcResponse + UpdateStoredProcRequest: example: description: description properties: @@ -2650,8 +2584,8 @@ components: type: string required: - description - title: UpdateProcedureRequest - x-body-name: update_procedure_request + title: UpdateStoredProcRequest + x-body-name: update_stored_proc_request GetVertexType: allOf: - $ref: '#/components/schemas/BaseVertexType' @@ -3032,7 +2966,7 @@ components: type: string stored_procedures: items: - $ref: '#/components/schemas/GetProcedureResponse' + $ref: '#/components/schemas/GetStoredProcResponse' title: stored_procedures type: array schema: @@ -3597,6 +3531,10 @@ components: format: binary type: string type: object + RunningDeploymentStatus_nodes_inner: + oneOf: + - $ref: '#/components/schemas/NodeStatus' + title: RunningDeploymentStatus_nodes_inner ServiceStatus_sdk_endpoints: example: gremlin: gremlin diff --git a/flex/coordinator/gs_flex_coordinator/test/test_stored_procedure_controller.py b/flex/coordinator/gs_flex_coordinator/test/test_stored_procedure_controller.py new file mode 100644 index 000000000000..e112c134c30f --- /dev/null +++ b/flex/coordinator/gs_flex_coordinator/test/test_stored_procedure_controller.py @@ -0,0 +1,101 @@ +import unittest + +from flask import json + +from gs_flex_coordinator.models.create_stored_proc_request import CreateStoredProcRequest # noqa: E501 +from gs_flex_coordinator.models.create_stored_proc_response import CreateStoredProcResponse # noqa: E501 +from gs_flex_coordinator.models.error import Error # noqa: E501 +from gs_flex_coordinator.models.get_stored_proc_response import GetStoredProcResponse # noqa: E501 +from gs_flex_coordinator.models.update_stored_proc_request import UpdateStoredProcRequest # noqa: E501 +from gs_flex_coordinator.test import BaseTestCase + + +class TestStoredProcedureController(BaseTestCase): + """StoredProcedureController integration test stubs""" + + def test_create_stored_procedure(self): + """Test case for create_stored_procedure + + + """ + create_stored_proc_request = {"query":"query","name":"name","description":"description","type":"cpp"} + headers = { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + } + response = self.client.open( + '/api/v1/graph/{graph_id}/storedproc'.format(graph_id='graph_id_example'), + method='POST', + headers=headers, + data=json.dumps(create_stored_proc_request), + content_type='application/json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_delete_stored_procedure_by_id(self): + """Test case for delete_stored_procedure_by_id + + + """ + headers = { + 'Accept': 'application/json', + } + response = self.client.open( + '/api/v1/graph/{graph_id}/storedproc/{stored_procedure_id}'.format(graph_id='graph_id_example', stored_procedure_id='stored_procedure_id_example'), + method='DELETE', + headers=headers) + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_get_stored_procedure_by_id(self): + """Test case for get_stored_procedure_by_id + + + """ + headers = { + 'Accept': 'application/json', + } + response = self.client.open( + '/api/v1/graph/{graph_id}/storedproc/{stored_procedure_id}'.format(graph_id='graph_id_example', stored_procedure_id='stored_procedure_id_example'), + method='GET', + headers=headers) + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_list_stored_procedures(self): + """Test case for list_stored_procedures + + + """ + headers = { + 'Accept': 'application/json', + } + response = self.client.open( + '/api/v1/graph/{graph_id}/storedproc'.format(graph_id='graph_id_example'), + method='GET', + headers=headers) + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_update_stored_procedure_by_id(self): + """Test case for update_stored_procedure_by_id + + + """ + update_stored_proc_request = {"description":"description"} + headers = { + 'Accept': 'application/json', + 'Content-Type': 'application/json', + } + response = self.client.open( + '/api/v1/graph/{graph_id}/storedproc/{stored_procedure_id}'.format(graph_id='graph_id_example', stored_procedure_id='stored_procedure_id_example'), + method='PUT', + headers=headers, + data=json.dumps(update_stored_proc_request), + content_type='application/json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + +if __name__ == '__main__': + unittest.main() diff --git a/flex/openapi/openapi_coordinator.yaml b/flex/openapi/openapi_coordinator.yaml index bd5dfef6e0a8..131dc08d7b4d 100644 --- a/flex/openapi/openapi_coordinator.yaml +++ b/flex/openapi/openapi_coordinator.yaml @@ -68,8 +68,10 @@ components: - instance_name - cluster_type - version - - solution - creation_time + - frontend + - engine + - storage properties: instance_name: type: string @@ -80,13 +82,57 @@ components: - KUBERNETES version: type: string - solution: + creation_time: + type: string + frontend: type: string enum: - - INTERACTIVE - - GRAPHSCOPE_INSIGHT - creation_time: + - Cypher/Gremlin + - AnalyticalApps + engine: + type: string + enum: + - Hiactor + - Gaia + storage: type: string + enum: + - MutableCSR + + NodeStatus: + required: + - name + - cpu_usage + - memory_usage + - disk_usage + properties: + name: + type: string + cpu_usage: + type: number + format: double + memory_usage: + type: number + format: double + disk_usage: + type: number + format: double + + RunningDeploymentStatus: + required: + - cluster_type + - nodes + properties: + cluster_type: + type: string + enum: + - HOSTS + - KUBERNETES + nodes: + type: array + items: + oneOf: + - $ref: '#/components/schemas/NodeStatus' StartServiceRequest: x-body-name: start_service_request @@ -96,15 +142,17 @@ components: ServiceStatus: required: + - graph_id - status + - creation_time properties: + graph_id: + type: string status: type: string enum: - Running - Stopped - graph: - $ref: '#/components/schemas/GetGraphResponse' sdk_endpoints: properties: cypher: @@ -115,6 +163,8 @@ components: type: string grpc: type: string + start_time: + type: string UploadFileResponse: required: @@ -287,8 +337,8 @@ components: description: type: string - CreateProcedureRequest: - x-body-name: create_procedure_request + CreateStoredProcRequest: + x-body-name: create_stored_proc_request required: - name - type @@ -306,11 +356,11 @@ components: query: type: string - CreateProcedureResponse: + CreateStoredProcResponse: required: - - procedure_id + - stored_procedure_id properties: - procedure_id: + stored_procedure_id: type: string CreateGraphSchemaRequest: @@ -330,9 +380,6 @@ components: CreateGraphRequest: x-body-name: create_graph_request - required: - - name - - schema properties: name: type: string @@ -341,7 +388,7 @@ components: stored_procedures: type: array items: - $ref: '#/components/schemas/CreateProcedureRequest' + $ref: '#/components/schemas/CreateStoredProcRequest' schema: $ref: '#/components/schemas/CreateGraphSchemaRequest' @@ -354,7 +401,7 @@ components: StoredProcedureMeta: allOf: - - $ref: '#/components/schemas/CreateProcedureRequest' + - $ref: '#/components/schemas/CreateStoredProcRequest' - type: object required: - id @@ -375,7 +422,7 @@ components: items: $ref: '#/components/schemas/Parameter' - GetProcedureResponse: + GetStoredProcResponse: allOf: - $ref: '#/components/schemas/StoredProcedureMeta' - type: object @@ -388,8 +435,8 @@ components: runnable: type: boolean - UpdateProcedureRequest: - x-body-name: update_procedure_request + UpdateStoredProcRequest: + x-body-name: update_stored_proc_request required: - description properties: @@ -474,7 +521,7 @@ components: stored_procedures: type: array items: - $ref: '#/components/schemas/GetProcedureResponse' + $ref: '#/components/schemas/GetStoredProcResponse' schema: $ref: '#/components/schemas/GetGraphSchemaResponse' @@ -795,13 +842,13 @@ tags: - name: Graph - name: DataSource - name: Job - - name: Procedure + - name: Stored Procedure - name: Service - name: Alert - name: Utils paths: - /api/v1/deployment/info: + /api/v1/deployment: get: description: Deployment information tags: [Deployment] @@ -817,11 +864,35 @@ paths: cluster_type: HOSTS creation_time: 2024-01-01 00:00:00 instance_name: demo - solution: INTERACTIVE + frontend: Cypher/Gremlin + engine: Hiactor + storage: MutableCSR version: 0.27.0 500: $ref: "#/components/responses/500" + /api/v1/deployment/status: + get: + description: Deployment status + tags: [Deployment] + operationId: getDeploymentStatus + responses: + 200: + description: Successfully returned the deployment status + content: + application/json: + schema: + $ref: '#/components/schemas/RunningDeploymentStatus' + example: + cluster_type: HOSTS + nodes: + - name: HOSTNAME-1 + cpu_usage: 83.0 + memory_usage: 37.5 + disk_usage: 97 + 500: + $ref: "#/components/responses/500" + /api/v1/graph: post: description: Create a new graph @@ -864,8 +935,8 @@ paths: schema_update_time: "2024-01-02 00:00:00" data_update_time: "2024-01-03 00:00:00" stored_procedures: - - id: PROCEDUREID - name: procedure_name + - id: STORED-PROCEDURE-ID + name: stored_procedure_name type: cypher query: "MATCH(a) return COUNT(a);" library: /path/to/library @@ -967,8 +1038,8 @@ paths: schema_update_time: "2024-01-02 00:00:00" data_update_time: "2024-01-03 00:00:00" stored_procedures: - - id: PROCEDUREID - name: procedure_name + - id: STORED-PROCEDURE-ID + name: stored_procedure_name type: cypher query: "MATCH(a) return COUNT(a);" library: /path/to/library @@ -1614,11 +1685,11 @@ paths: 500: $ref: "#/components/responses/500" - /api/v1/graph/{graph_id}/procedure: + /api/v1/graph/{graph_id}/storedproc: post: - tags: [Procedure] + tags: [Stored Procedure] description: Create a new stored procedure on a certain graph - operationId: createProcedure + operationId: createStoredProcedure parameters: - name: graph_id in: path @@ -1629,24 +1700,24 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CreateProcedureRequest' + $ref: '#/components/schemas/CreateStoredProcRequest' required: true responses: 200: - description: Successfully created a procedure + description: Successfully created a stored procedure content: application/json: schema: - $ref: '#/components/schemas/CreateProcedureResponse' + $ref: '#/components/schemas/CreateStoredProcResponse' 400: $ref: "#/components/responses/400" 500: $ref: "#/components/responses/500" get: - tags: [Procedure] + tags: [Stored Procedure] description: List all stored procedures on a certain graph - operationId: listProcedures + operationId: listStoredProcedures parameters: - name: graph_id in: path @@ -1661,10 +1732,10 @@ paths: schema: type: array items: - $ref: '#/components/schemas/GetProcedureResponse' + $ref: '#/components/schemas/GetStoredProcResponse' example: - - id: PROCEDUREID-1 - name: procedure_name_1 + - id: STORED-PROCEDUREID-1 + name: stored_procedure_name_1 type: cypher query: "MATCH(a) return COUNT(a);" library: /path/to/library @@ -1679,8 +1750,8 @@ paths: PrimitiveType: DT_SIGNED_INT64 bound_graph: demo runnable: true - - id: PROCEDUREID-2 - name: procedure_name_2 + - id: STORED-PROCEDUREID-2 + name: stored_procedure_name_2 type: cypher query: "MATCH(a) return COUNT(a);" library: /path/to/library @@ -1700,32 +1771,32 @@ paths: 500: $ref: "#/components/responses/500" - /api/v1/graph/{graph_id}/procedure/{procedure_id}: + /api/v1/graph/{graph_id}/storedproc/{stored_procedure_id}: get: - tags: [Procedure] + tags: [Stored Procedure] description: Get a stored procedure by ID - operationId: getProcedureById + operationId: getStoredProcedureById parameters: - name: graph_id in : path required: true schema: type: string - - name: procedure_id + - name: stored_procedure_id in : path required: true schema: type: string responses: 200: - description: Successfully returned the procedure + description: Successfully returned the stored procedure content: application/json: schema: - $ref: '#/components/schemas/GetProcedureResponse' + $ref: '#/components/schemas/GetStoredProcResponse' example: - id: PROCEDUREID - name: procedure_name + id: STORED-PROCEDURE-ID + name: stored_procedure_name type: cypher query: "MATCH(a) return COUNT(a);" library: /path/to/library @@ -1744,16 +1815,16 @@ paths: $ref: "#/components/responses/500" put: - tags: [Procedure] + tags: [Stored Procedure] description: Update a stored procedure by ID - operationId: updateProcedureById + operationId: updateStoredProcedureById parameters: - name: graph_id in: path required: true schema: type: string - - name: procedure_id + - name: stored_procedure_id in : path required: true schema: @@ -1762,7 +1833,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UpdateProcedureRequest' + $ref: '#/components/schemas/UpdateStoredProcRequest' responses: 200: description: Successfully updated the stored procedure @@ -1774,16 +1845,16 @@ paths: $ref: "#/components/responses/500" delete: - tags: [Procedure] + tags: [Stored Procedure] description: Delete a stored procedure by ID - operationId: deleteProcedureById + operationId: deleteStoredProcedureById parameters: - name: graph_id in: path required: true schema: type: string - - name: procedure_id + - name: stored_procedure_id in : path required: true schema: @@ -1850,107 +1921,57 @@ paths: 500: $ref: "#/components/responses/500" - /api/v1/service/status: + /api/v1/service: get: tags: [Service] - description: Get service status - operationId: getServiceStatus + description: List all service status + operationId: listServiceStatus responses: 200: - description: Successfully returned current service status + description: Successfully returned all service status + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ServiceStatus' + example: + - graph_id: GRAPHID + status: Running + sdk_endpoints: + cypher: neo4j://mock.api.cypher:7676 + gremin: ws://mock.api.gremlin/gremlin + hqps: http://mock.api.hqps:10000 + start_time: "2024-01-01 00:00:00" + 500: + $ref: "#/components/responses/500" + + /api/v1/graph/{graph_id}/service: + get: + tags: [Service] + description: Get service status by graph ID + operationId: getServiceStatusById + parameters: + - name: graph_id + in: path + required: true + schema: + type: string + responses: + 200: + description: Successfully returned the service status content: application/json: schema: $ref: '#/components/schemas/ServiceStatus' example: + graph_id: GRAPHID status: Running - graph: - id: GRAPHID - name: demo - creation_time: "2024-01-01 00:00:00" - schema_update_time: "2024-01-02 00:00:00" - data_update_time: "2024-01-03 00:00:00" - stored_procedures: - - id: PROCEDUREID - name: procedure_name - type: cypher - query: "MATCH(a) return COUNT(a);" - library: /path/to/library - params: - - name: param1 - type: - string: - long_text: null - returns: - - name: return1 - type: - PrimitiveType: DT_SIGNED_INT64 - bound_graph: demo - runnable: true - schema: - vertex_types: - - type_id: 0 - type_name: person - properties: - - property_id: 0 - property_name: id - property_type: - string: - long_text: null - - property_id: 1 - property_name: name - property_type: - string: - long_text: null - primary_keys: - - id - - type_id: 1 - type_name: software - properties: - - property_id: 0 - property_name: id - property_type: - string: - long_text: null - - property_id: 1 - property_name: name - property_type: - string: - long_text: null - primary_keys: - - id - edge_types: - - type_id: 0 - type_name: knows - vertex_type_pair_relations: - - source_vertex: person - destination_vertex: person - relation: MANY_TO_MANY - x_csr_params: - edge_storage_strategy: ONLY_IN - properties: - - property_id: 0 - property_name: weight - property_type: - primitive_type: DT_DOUBLE - - type_id: 1 - type_name: created - vertex_type_pair_relations: - - source_vertex: person - destination_vertex: software - relation: MANY_TO_MANY - x_csr_params: - edge_storage_strategy: ONLY_IN - properties: - - property_id: 0 - property_name: weight - property_type: - primitive_type: DT_DOUBLE sdk_endpoints: cypher: neo4j://mock.api.cypher:7676 - gremlin: ws://mock.api.gremlin/gremlin + gremin: ws://mock.api.gremlin/gremlin hqps: http://mock.api.hqps:10000 - grpc: http://mock.api.grpc:10000 + start_time: "2024-01-01 00:00:00" 500: $ref: "#/components/responses/500" diff --git a/python/graphscope/flex/rest/__init__.py b/python/graphscope/flex/rest/__init__.py index b146c43ab40e..813c91ee1e10 100644 --- a/python/graphscope/flex/rest/__init__.py +++ b/python/graphscope/flex/rest/__init__.py @@ -23,8 +23,8 @@ from graphscope.flex.rest.api.deployment_api import DeploymentApi from graphscope.flex.rest.api.graph_api import GraphApi from graphscope.flex.rest.api.job_api import JobApi -from graphscope.flex.rest.api.procedure_api import ProcedureApi from graphscope.flex.rest.api.service_api import ServiceApi +from graphscope.flex.rest.api.stored_procedure_api import StoredProcedureApi from graphscope.flex.rest.api.utils_api import UtilsApi # import ApiClient @@ -54,9 +54,9 @@ from graphscope.flex.rest.models.create_graph_request import CreateGraphRequest from graphscope.flex.rest.models.create_graph_response import CreateGraphResponse from graphscope.flex.rest.models.create_graph_schema_request import CreateGraphSchemaRequest -from graphscope.flex.rest.models.create_procedure_request import CreateProcedureRequest -from graphscope.flex.rest.models.create_procedure_response import CreateProcedureResponse from graphscope.flex.rest.models.create_property_meta import CreatePropertyMeta +from graphscope.flex.rest.models.create_stored_proc_request import CreateStoredProcRequest +from graphscope.flex.rest.models.create_stored_proc_response import CreateStoredProcResponse from graphscope.flex.rest.models.create_vertex_type import CreateVertexType from graphscope.flex.rest.models.dataloading_job_config import DataloadingJobConfig from graphscope.flex.rest.models.dataloading_job_config_edges_inner import DataloadingJobConfigEdgesInner @@ -73,14 +73,17 @@ from graphscope.flex.rest.models.get_edge_type import GetEdgeType from graphscope.flex.rest.models.get_graph_response import GetGraphResponse from graphscope.flex.rest.models.get_graph_schema_response import GetGraphSchemaResponse -from graphscope.flex.rest.models.get_procedure_response import GetProcedureResponse from graphscope.flex.rest.models.get_property_meta import GetPropertyMeta +from graphscope.flex.rest.models.get_stored_proc_response import GetStoredProcResponse from graphscope.flex.rest.models.get_vertex_type import GetVertexType from graphscope.flex.rest.models.job_status import JobStatus from graphscope.flex.rest.models.long_text import LongText +from graphscope.flex.rest.models.node_status import NodeStatus from graphscope.flex.rest.models.parameter import Parameter from graphscope.flex.rest.models.primitive_type import PrimitiveType from graphscope.flex.rest.models.running_deployment_info import RunningDeploymentInfo +from graphscope.flex.rest.models.running_deployment_status import RunningDeploymentStatus +from graphscope.flex.rest.models.running_deployment_status_nodes_inner import RunningDeploymentStatusNodesInner from graphscope.flex.rest.models.schema_mapping import SchemaMapping from graphscope.flex.rest.models.service_status import ServiceStatus from graphscope.flex.rest.models.service_status_sdk_endpoints import ServiceStatusSdkEndpoints @@ -89,6 +92,6 @@ from graphscope.flex.rest.models.string_type import StringType from graphscope.flex.rest.models.string_type_string import StringTypeString from graphscope.flex.rest.models.update_alert_message_status_request import UpdateAlertMessageStatusRequest -from graphscope.flex.rest.models.update_procedure_request import UpdateProcedureRequest +from graphscope.flex.rest.models.update_stored_proc_request import UpdateStoredProcRequest from graphscope.flex.rest.models.upload_file_response import UploadFileResponse from graphscope.flex.rest.models.vertex_mapping import VertexMapping diff --git a/python/graphscope/flex/rest/api/__init__.py b/python/graphscope/flex/rest/api/__init__.py index acdb2e891912..9d14882d4185 100644 --- a/python/graphscope/flex/rest/api/__init__.py +++ b/python/graphscope/flex/rest/api/__init__.py @@ -6,7 +6,7 @@ from graphscope.flex.rest.api.deployment_api import DeploymentApi from graphscope.flex.rest.api.graph_api import GraphApi from graphscope.flex.rest.api.job_api import JobApi -from graphscope.flex.rest.api.procedure_api import ProcedureApi from graphscope.flex.rest.api.service_api import ServiceApi +from graphscope.flex.rest.api.stored_procedure_api import StoredProcedureApi from graphscope.flex.rest.api.utils_api import UtilsApi diff --git a/python/graphscope/flex/rest/api/deployment_api.py b/python/graphscope/flex/rest/api/deployment_api.py index 334e6fd3ad0b..ff24027e9d4d 100644 --- a/python/graphscope/flex/rest/api/deployment_api.py +++ b/python/graphscope/flex/rest/api/deployment_api.py @@ -18,6 +18,7 @@ from typing_extensions import Annotated from graphscope.flex.rest.models.running_deployment_info import RunningDeploymentInfo +from graphscope.flex.rest.models.running_deployment_status import RunningDeploymentStatus from graphscope.flex.rest.api_client import ApiClient, RequestSerialized from graphscope.flex.rest.api_response import ApiResponse @@ -266,7 +267,252 @@ def _get_deployment_info_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/deployment/info', + resource_path='/api/v1/deployment', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_deployment_status( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RunningDeploymentStatus: + """get_deployment_status + + Deployment status + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_deployment_status_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RunningDeploymentStatus", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_deployment_status_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RunningDeploymentStatus]: + """get_deployment_status + + Deployment status + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_deployment_status_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RunningDeploymentStatus", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_deployment_status_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """get_deployment_status + + Deployment status + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_deployment_status_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "RunningDeploymentStatus", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_deployment_status_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/deployment/status', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/python/graphscope/flex/rest/api/service_api.py b/python/graphscope/flex/rest/api/service_api.py index cb04b5453908..391fd274038b 100644 --- a/python/graphscope/flex/rest/api/service_api.py +++ b/python/graphscope/flex/rest/api/service_api.py @@ -17,6 +17,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated +from pydantic import StrictStr from typing import Optional from graphscope.flex.rest.models.service_status import ServiceStatus from graphscope.flex.rest.models.start_service_request import StartServiceRequest @@ -40,8 +41,9 @@ def __init__(self, api_client=None) -> None: @validate_call - def get_service_status( + def get_service_status_by_id( self, + graph_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -55,10 +57,12 @@ def get_service_status( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ServiceStatus: - """get_service_status + """get_service_status_by_id - Get service status + Get service status by graph ID + :param graph_id: (required) + :type graph_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -81,7 +85,8 @@ def get_service_status( :return: Returns the result object. """ # noqa: E501 - _param = self._get_service_status_serialize( + _param = self._get_service_status_by_id_serialize( + graph_id=graph_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -104,8 +109,9 @@ def get_service_status( @validate_call - def get_service_status_with_http_info( + def get_service_status_by_id_with_http_info( self, + graph_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -119,10 +125,12 @@ def get_service_status_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[ServiceStatus]: - """get_service_status + """get_service_status_by_id - Get service status + Get service status by graph ID + :param graph_id: (required) + :type graph_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -145,7 +153,8 @@ def get_service_status_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_service_status_serialize( + _param = self._get_service_status_by_id_serialize( + graph_id=graph_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -168,8 +177,9 @@ def get_service_status_with_http_info( @validate_call - def get_service_status_without_preload_content( + def get_service_status_by_id_without_preload_content( self, + graph_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -183,10 +193,12 @@ def get_service_status_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_service_status + """get_service_status_by_id - Get service status + Get service status by graph ID + :param graph_id: (required) + :type graph_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -209,7 +221,8 @@ def get_service_status_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_service_status_serialize( + _param = self._get_service_status_by_id_serialize( + graph_id=graph_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -227,8 +240,9 @@ def get_service_status_without_preload_content( return response_data.response - def _get_service_status_serialize( + def _get_service_status_by_id_serialize( self, + graph_id, _request_auth, _content_type, _headers, @@ -248,6 +262,8 @@ def _get_service_status_serialize( _body_params: Optional[bytes] = None # process the path parameters + if graph_id is not None: + _path_params['graph_id'] = graph_id # process the query parameters # process the header parameters # process the form parameters @@ -268,7 +284,252 @@ def _get_service_status_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/service/status', + resource_path='/api/v1/graph/{graph_id}/service', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_service_status( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ServiceStatus]: + """list_service_status + + List all service status + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_service_status_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ServiceStatus]", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_service_status_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ServiceStatus]]: + """list_service_status + + List all service status + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_service_status_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ServiceStatus]", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_service_status_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """list_service_status + + List all service status + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_service_status_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ServiceStatus]", + '500': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_service_status_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, str] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/service', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/python/graphscope/flex/rest/api/procedure_api.py b/python/graphscope/flex/rest/api/stored_procedure_api.py similarity index 86% rename from python/graphscope/flex/rest/api/procedure_api.py rename to python/graphscope/flex/rest/api/stored_procedure_api.py index f7ab039d81ab..3d2decbb1821 100644 --- a/python/graphscope/flex/rest/api/procedure_api.py +++ b/python/graphscope/flex/rest/api/stored_procedure_api.py @@ -19,17 +19,17 @@ from pydantic import StrictStr from typing import Optional -from graphscope.flex.rest.models.create_procedure_request import CreateProcedureRequest -from graphscope.flex.rest.models.create_procedure_response import CreateProcedureResponse -from graphscope.flex.rest.models.get_procedure_response import GetProcedureResponse -from graphscope.flex.rest.models.update_procedure_request import UpdateProcedureRequest +from graphscope.flex.rest.models.create_stored_proc_request import CreateStoredProcRequest +from graphscope.flex.rest.models.create_stored_proc_response import CreateStoredProcResponse +from graphscope.flex.rest.models.get_stored_proc_response import GetStoredProcResponse +from graphscope.flex.rest.models.update_stored_proc_request import UpdateStoredProcRequest from graphscope.flex.rest.api_client import ApiClient, RequestSerialized from graphscope.flex.rest.api_response import ApiResponse from graphscope.flex.rest.rest import RESTResponseType -class ProcedureApi: +class StoredProcedureApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech @@ -43,10 +43,10 @@ def __init__(self, api_client=None) -> None: @validate_call - def create_procedure( + def create_stored_procedure( self, graph_id: StrictStr, - create_procedure_request: CreateProcedureRequest, + create_stored_proc_request: CreateStoredProcRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -59,15 +59,15 @@ def create_procedure( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> CreateProcedureResponse: - """create_procedure + ) -> CreateStoredProcResponse: + """create_stored_procedure Create a new stored procedure on a certain graph :param graph_id: (required) :type graph_id: str - :param create_procedure_request: (required) - :type create_procedure_request: CreateProcedureRequest + :param create_stored_proc_request: (required) + :type create_stored_proc_request: CreateStoredProcRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -90,9 +90,9 @@ def create_procedure( :return: Returns the result object. """ # noqa: E501 - _param = self._create_procedure_serialize( + _param = self._create_stored_procedure_serialize( graph_id=graph_id, - create_procedure_request=create_procedure_request, + create_stored_proc_request=create_stored_proc_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -100,7 +100,7 @@ def create_procedure( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "CreateProcedureResponse", + '200': "CreateStoredProcResponse", '400': "Error", '500': "Error", } @@ -116,10 +116,10 @@ def create_procedure( @validate_call - def create_procedure_with_http_info( + def create_stored_procedure_with_http_info( self, graph_id: StrictStr, - create_procedure_request: CreateProcedureRequest, + create_stored_proc_request: CreateStoredProcRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -132,15 +132,15 @@ def create_procedure_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[CreateProcedureResponse]: - """create_procedure + ) -> ApiResponse[CreateStoredProcResponse]: + """create_stored_procedure Create a new stored procedure on a certain graph :param graph_id: (required) :type graph_id: str - :param create_procedure_request: (required) - :type create_procedure_request: CreateProcedureRequest + :param create_stored_proc_request: (required) + :type create_stored_proc_request: CreateStoredProcRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -163,9 +163,9 @@ def create_procedure_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_procedure_serialize( + _param = self._create_stored_procedure_serialize( graph_id=graph_id, - create_procedure_request=create_procedure_request, + create_stored_proc_request=create_stored_proc_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -173,7 +173,7 @@ def create_procedure_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "CreateProcedureResponse", + '200': "CreateStoredProcResponse", '400': "Error", '500': "Error", } @@ -189,10 +189,10 @@ def create_procedure_with_http_info( @validate_call - def create_procedure_without_preload_content( + def create_stored_procedure_without_preload_content( self, graph_id: StrictStr, - create_procedure_request: CreateProcedureRequest, + create_stored_proc_request: CreateStoredProcRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -206,14 +206,14 @@ def create_procedure_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """create_procedure + """create_stored_procedure Create a new stored procedure on a certain graph :param graph_id: (required) :type graph_id: str - :param create_procedure_request: (required) - :type create_procedure_request: CreateProcedureRequest + :param create_stored_proc_request: (required) + :type create_stored_proc_request: CreateStoredProcRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -236,9 +236,9 @@ def create_procedure_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._create_procedure_serialize( + _param = self._create_stored_procedure_serialize( graph_id=graph_id, - create_procedure_request=create_procedure_request, + create_stored_proc_request=create_stored_proc_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -246,7 +246,7 @@ def create_procedure_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "CreateProcedureResponse", + '200': "CreateStoredProcResponse", '400': "Error", '500': "Error", } @@ -257,10 +257,10 @@ def create_procedure_without_preload_content( return response_data.response - def _create_procedure_serialize( + def _create_stored_procedure_serialize( self, graph_id, - create_procedure_request, + create_stored_proc_request, _request_auth, _content_type, _headers, @@ -286,8 +286,8 @@ def _create_procedure_serialize( # process the header parameters # process the form parameters # process the body parameter - if create_procedure_request is not None: - _body_params = create_procedure_request + if create_stored_proc_request is not None: + _body_params = create_stored_proc_request # set the HTTP header `Accept` @@ -317,7 +317,7 @@ def _create_procedure_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/api/v1/graph/{graph_id}/procedure', + resource_path='/api/v1/graph/{graph_id}/storedproc', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -334,10 +334,10 @@ def _create_procedure_serialize( @validate_call - def delete_procedure_by_id( + def delete_stored_procedure_by_id( self, graph_id: StrictStr, - procedure_id: StrictStr, + stored_procedure_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -351,14 +351,14 @@ def delete_procedure_by_id( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> str: - """delete_procedure_by_id + """delete_stored_procedure_by_id Delete a stored procedure by ID :param graph_id: (required) :type graph_id: str - :param procedure_id: (required) - :type procedure_id: str + :param stored_procedure_id: (required) + :type stored_procedure_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -381,9 +381,9 @@ def delete_procedure_by_id( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_procedure_by_id_serialize( + _param = self._delete_stored_procedure_by_id_serialize( graph_id=graph_id, - procedure_id=procedure_id, + stored_procedure_id=stored_procedure_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -406,10 +406,10 @@ def delete_procedure_by_id( @validate_call - def delete_procedure_by_id_with_http_info( + def delete_stored_procedure_by_id_with_http_info( self, graph_id: StrictStr, - procedure_id: StrictStr, + stored_procedure_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -423,14 +423,14 @@ def delete_procedure_by_id_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[str]: - """delete_procedure_by_id + """delete_stored_procedure_by_id Delete a stored procedure by ID :param graph_id: (required) :type graph_id: str - :param procedure_id: (required) - :type procedure_id: str + :param stored_procedure_id: (required) + :type stored_procedure_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -453,9 +453,9 @@ def delete_procedure_by_id_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_procedure_by_id_serialize( + _param = self._delete_stored_procedure_by_id_serialize( graph_id=graph_id, - procedure_id=procedure_id, + stored_procedure_id=stored_procedure_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -478,10 +478,10 @@ def delete_procedure_by_id_with_http_info( @validate_call - def delete_procedure_by_id_without_preload_content( + def delete_stored_procedure_by_id_without_preload_content( self, graph_id: StrictStr, - procedure_id: StrictStr, + stored_procedure_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -495,14 +495,14 @@ def delete_procedure_by_id_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """delete_procedure_by_id + """delete_stored_procedure_by_id Delete a stored procedure by ID :param graph_id: (required) :type graph_id: str - :param procedure_id: (required) - :type procedure_id: str + :param stored_procedure_id: (required) + :type stored_procedure_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -525,9 +525,9 @@ def delete_procedure_by_id_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_procedure_by_id_serialize( + _param = self._delete_stored_procedure_by_id_serialize( graph_id=graph_id, - procedure_id=procedure_id, + stored_procedure_id=stored_procedure_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -545,10 +545,10 @@ def delete_procedure_by_id_without_preload_content( return response_data.response - def _delete_procedure_by_id_serialize( + def _delete_stored_procedure_by_id_serialize( self, graph_id, - procedure_id, + stored_procedure_id, _request_auth, _content_type, _headers, @@ -570,8 +570,8 @@ def _delete_procedure_by_id_serialize( # process the path parameters if graph_id is not None: _path_params['graph_id'] = graph_id - if procedure_id is not None: - _path_params['procedure_id'] = procedure_id + if stored_procedure_id is not None: + _path_params['stored_procedure_id'] = stored_procedure_id # process the query parameters # process the header parameters # process the form parameters @@ -592,7 +592,7 @@ def _delete_procedure_by_id_serialize( return self.api_client.param_serialize( method='DELETE', - resource_path='/api/v1/graph/{graph_id}/procedure/{procedure_id}', + resource_path='/api/v1/graph/{graph_id}/storedproc/{stored_procedure_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -609,10 +609,10 @@ def _delete_procedure_by_id_serialize( @validate_call - def get_procedure_by_id( + def get_stored_procedure_by_id( self, graph_id: StrictStr, - procedure_id: StrictStr, + stored_procedure_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -625,15 +625,15 @@ def get_procedure_by_id( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetProcedureResponse: - """get_procedure_by_id + ) -> GetStoredProcResponse: + """get_stored_procedure_by_id Get a stored procedure by ID :param graph_id: (required) :type graph_id: str - :param procedure_id: (required) - :type procedure_id: str + :param stored_procedure_id: (required) + :type stored_procedure_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -656,9 +656,9 @@ def get_procedure_by_id( :return: Returns the result object. """ # noqa: E501 - _param = self._get_procedure_by_id_serialize( + _param = self._get_stored_procedure_by_id_serialize( graph_id=graph_id, - procedure_id=procedure_id, + stored_procedure_id=stored_procedure_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -666,7 +666,7 @@ def get_procedure_by_id( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetProcedureResponse", + '200': "GetStoredProcResponse", '500': "Error", } response_data = self.api_client.call_api( @@ -681,10 +681,10 @@ def get_procedure_by_id( @validate_call - def get_procedure_by_id_with_http_info( + def get_stored_procedure_by_id_with_http_info( self, graph_id: StrictStr, - procedure_id: StrictStr, + stored_procedure_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -697,15 +697,15 @@ def get_procedure_by_id_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetProcedureResponse]: - """get_procedure_by_id + ) -> ApiResponse[GetStoredProcResponse]: + """get_stored_procedure_by_id Get a stored procedure by ID :param graph_id: (required) :type graph_id: str - :param procedure_id: (required) - :type procedure_id: str + :param stored_procedure_id: (required) + :type stored_procedure_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -728,9 +728,9 @@ def get_procedure_by_id_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_procedure_by_id_serialize( + _param = self._get_stored_procedure_by_id_serialize( graph_id=graph_id, - procedure_id=procedure_id, + stored_procedure_id=stored_procedure_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -738,7 +738,7 @@ def get_procedure_by_id_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetProcedureResponse", + '200': "GetStoredProcResponse", '500': "Error", } response_data = self.api_client.call_api( @@ -753,10 +753,10 @@ def get_procedure_by_id_with_http_info( @validate_call - def get_procedure_by_id_without_preload_content( + def get_stored_procedure_by_id_without_preload_content( self, graph_id: StrictStr, - procedure_id: StrictStr, + stored_procedure_id: StrictStr, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -770,14 +770,14 @@ def get_procedure_by_id_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """get_procedure_by_id + """get_stored_procedure_by_id Get a stored procedure by ID :param graph_id: (required) :type graph_id: str - :param procedure_id: (required) - :type procedure_id: str + :param stored_procedure_id: (required) + :type stored_procedure_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -800,9 +800,9 @@ def get_procedure_by_id_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_procedure_by_id_serialize( + _param = self._get_stored_procedure_by_id_serialize( graph_id=graph_id, - procedure_id=procedure_id, + stored_procedure_id=stored_procedure_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -810,7 +810,7 @@ def get_procedure_by_id_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetProcedureResponse", + '200': "GetStoredProcResponse", '500': "Error", } response_data = self.api_client.call_api( @@ -820,10 +820,10 @@ def get_procedure_by_id_without_preload_content( return response_data.response - def _get_procedure_by_id_serialize( + def _get_stored_procedure_by_id_serialize( self, graph_id, - procedure_id, + stored_procedure_id, _request_auth, _content_type, _headers, @@ -845,8 +845,8 @@ def _get_procedure_by_id_serialize( # process the path parameters if graph_id is not None: _path_params['graph_id'] = graph_id - if procedure_id is not None: - _path_params['procedure_id'] = procedure_id + if stored_procedure_id is not None: + _path_params['stored_procedure_id'] = stored_procedure_id # process the query parameters # process the header parameters # process the form parameters @@ -867,7 +867,7 @@ def _get_procedure_by_id_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/graph/{graph_id}/procedure/{procedure_id}', + resource_path='/api/v1/graph/{graph_id}/storedproc/{stored_procedure_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -884,7 +884,7 @@ def _get_procedure_by_id_serialize( @validate_call - def list_procedures( + def list_stored_procedures( self, graph_id: StrictStr, _request_timeout: Union[ @@ -899,8 +899,8 @@ def list_procedures( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[GetProcedureResponse]: - """list_procedures + ) -> List[GetStoredProcResponse]: + """list_stored_procedures List all stored procedures on a certain graph @@ -928,7 +928,7 @@ def list_procedures( :return: Returns the result object. """ # noqa: E501 - _param = self._list_procedures_serialize( + _param = self._list_stored_procedures_serialize( graph_id=graph_id, _request_auth=_request_auth, _content_type=_content_type, @@ -937,7 +937,7 @@ def list_procedures( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[GetProcedureResponse]", + '200': "List[GetStoredProcResponse]", '400': "Error", '500': "Error", } @@ -953,7 +953,7 @@ def list_procedures( @validate_call - def list_procedures_with_http_info( + def list_stored_procedures_with_http_info( self, graph_id: StrictStr, _request_timeout: Union[ @@ -968,8 +968,8 @@ def list_procedures_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[GetProcedureResponse]]: - """list_procedures + ) -> ApiResponse[List[GetStoredProcResponse]]: + """list_stored_procedures List all stored procedures on a certain graph @@ -997,7 +997,7 @@ def list_procedures_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_procedures_serialize( + _param = self._list_stored_procedures_serialize( graph_id=graph_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1006,7 +1006,7 @@ def list_procedures_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[GetProcedureResponse]", + '200': "List[GetStoredProcResponse]", '400': "Error", '500': "Error", } @@ -1022,7 +1022,7 @@ def list_procedures_with_http_info( @validate_call - def list_procedures_without_preload_content( + def list_stored_procedures_without_preload_content( self, graph_id: StrictStr, _request_timeout: Union[ @@ -1038,7 +1038,7 @@ def list_procedures_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """list_procedures + """list_stored_procedures List all stored procedures on a certain graph @@ -1066,7 +1066,7 @@ def list_procedures_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_procedures_serialize( + _param = self._list_stored_procedures_serialize( graph_id=graph_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1075,7 +1075,7 @@ def list_procedures_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[GetProcedureResponse]", + '200': "List[GetStoredProcResponse]", '400': "Error", '500': "Error", } @@ -1086,7 +1086,7 @@ def list_procedures_without_preload_content( return response_data.response - def _list_procedures_serialize( + def _list_stored_procedures_serialize( self, graph_id, _request_auth, @@ -1130,7 +1130,7 @@ def _list_procedures_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/api/v1/graph/{graph_id}/procedure', + resource_path='/api/v1/graph/{graph_id}/storedproc', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1147,11 +1147,11 @@ def _list_procedures_serialize( @validate_call - def update_procedure_by_id( + def update_stored_procedure_by_id( self, graph_id: StrictStr, - procedure_id: StrictStr, - update_procedure_request: Optional[UpdateProcedureRequest] = None, + stored_procedure_id: StrictStr, + update_stored_proc_request: Optional[UpdateStoredProcRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1165,16 +1165,16 @@ def update_procedure_by_id( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> str: - """update_procedure_by_id + """update_stored_procedure_by_id Update a stored procedure by ID :param graph_id: (required) :type graph_id: str - :param procedure_id: (required) - :type procedure_id: str - :param update_procedure_request: - :type update_procedure_request: UpdateProcedureRequest + :param stored_procedure_id: (required) + :type stored_procedure_id: str + :param update_stored_proc_request: + :type update_stored_proc_request: UpdateStoredProcRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1197,10 +1197,10 @@ def update_procedure_by_id( :return: Returns the result object. """ # noqa: E501 - _param = self._update_procedure_by_id_serialize( + _param = self._update_stored_procedure_by_id_serialize( graph_id=graph_id, - procedure_id=procedure_id, - update_procedure_request=update_procedure_request, + stored_procedure_id=stored_procedure_id, + update_stored_proc_request=update_stored_proc_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1223,11 +1223,11 @@ def update_procedure_by_id( @validate_call - def update_procedure_by_id_with_http_info( + def update_stored_procedure_by_id_with_http_info( self, graph_id: StrictStr, - procedure_id: StrictStr, - update_procedure_request: Optional[UpdateProcedureRequest] = None, + stored_procedure_id: StrictStr, + update_stored_proc_request: Optional[UpdateStoredProcRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1241,16 +1241,16 @@ def update_procedure_by_id_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[str]: - """update_procedure_by_id + """update_stored_procedure_by_id Update a stored procedure by ID :param graph_id: (required) :type graph_id: str - :param procedure_id: (required) - :type procedure_id: str - :param update_procedure_request: - :type update_procedure_request: UpdateProcedureRequest + :param stored_procedure_id: (required) + :type stored_procedure_id: str + :param update_stored_proc_request: + :type update_stored_proc_request: UpdateStoredProcRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1273,10 +1273,10 @@ def update_procedure_by_id_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_procedure_by_id_serialize( + _param = self._update_stored_procedure_by_id_serialize( graph_id=graph_id, - procedure_id=procedure_id, - update_procedure_request=update_procedure_request, + stored_procedure_id=stored_procedure_id, + update_stored_proc_request=update_stored_proc_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1299,11 +1299,11 @@ def update_procedure_by_id_with_http_info( @validate_call - def update_procedure_by_id_without_preload_content( + def update_stored_procedure_by_id_without_preload_content( self, graph_id: StrictStr, - procedure_id: StrictStr, - update_procedure_request: Optional[UpdateProcedureRequest] = None, + stored_procedure_id: StrictStr, + update_stored_proc_request: Optional[UpdateStoredProcRequest] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1317,16 +1317,16 @@ def update_procedure_by_id_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """update_procedure_by_id + """update_stored_procedure_by_id Update a stored procedure by ID :param graph_id: (required) :type graph_id: str - :param procedure_id: (required) - :type procedure_id: str - :param update_procedure_request: - :type update_procedure_request: UpdateProcedureRequest + :param stored_procedure_id: (required) + :type stored_procedure_id: str + :param update_stored_proc_request: + :type update_stored_proc_request: UpdateStoredProcRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1349,10 +1349,10 @@ def update_procedure_by_id_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._update_procedure_by_id_serialize( + _param = self._update_stored_procedure_by_id_serialize( graph_id=graph_id, - procedure_id=procedure_id, - update_procedure_request=update_procedure_request, + stored_procedure_id=stored_procedure_id, + update_stored_proc_request=update_stored_proc_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1370,11 +1370,11 @@ def update_procedure_by_id_without_preload_content( return response_data.response - def _update_procedure_by_id_serialize( + def _update_stored_procedure_by_id_serialize( self, graph_id, - procedure_id, - update_procedure_request, + stored_procedure_id, + update_stored_proc_request, _request_auth, _content_type, _headers, @@ -1396,14 +1396,14 @@ def _update_procedure_by_id_serialize( # process the path parameters if graph_id is not None: _path_params['graph_id'] = graph_id - if procedure_id is not None: - _path_params['procedure_id'] = procedure_id + if stored_procedure_id is not None: + _path_params['stored_procedure_id'] = stored_procedure_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if update_procedure_request is not None: - _body_params = update_procedure_request + if update_stored_proc_request is not None: + _body_params = update_stored_proc_request # set the HTTP header `Accept` @@ -1433,7 +1433,7 @@ def _update_procedure_by_id_serialize( return self.api_client.param_serialize( method='PUT', - resource_path='/api/v1/graph/{graph_id}/procedure/{procedure_id}', + resource_path='/api/v1/graph/{graph_id}/storedproc/{stored_procedure_id}', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/python/graphscope/flex/rest/models/__init__.py b/python/graphscope/flex/rest/models/__init__.py index 3bdfff150da7..30275356d1b8 100644 --- a/python/graphscope/flex/rest/models/__init__.py +++ b/python/graphscope/flex/rest/models/__init__.py @@ -30,9 +30,9 @@ from graphscope.flex.rest.models.create_graph_request import CreateGraphRequest from graphscope.flex.rest.models.create_graph_response import CreateGraphResponse from graphscope.flex.rest.models.create_graph_schema_request import CreateGraphSchemaRequest -from graphscope.flex.rest.models.create_procedure_request import CreateProcedureRequest -from graphscope.flex.rest.models.create_procedure_response import CreateProcedureResponse from graphscope.flex.rest.models.create_property_meta import CreatePropertyMeta +from graphscope.flex.rest.models.create_stored_proc_request import CreateStoredProcRequest +from graphscope.flex.rest.models.create_stored_proc_response import CreateStoredProcResponse from graphscope.flex.rest.models.create_vertex_type import CreateVertexType from graphscope.flex.rest.models.dataloading_job_config import DataloadingJobConfig from graphscope.flex.rest.models.dataloading_job_config_edges_inner import DataloadingJobConfigEdgesInner @@ -49,14 +49,17 @@ from graphscope.flex.rest.models.get_edge_type import GetEdgeType from graphscope.flex.rest.models.get_graph_response import GetGraphResponse from graphscope.flex.rest.models.get_graph_schema_response import GetGraphSchemaResponse -from graphscope.flex.rest.models.get_procedure_response import GetProcedureResponse from graphscope.flex.rest.models.get_property_meta import GetPropertyMeta +from graphscope.flex.rest.models.get_stored_proc_response import GetStoredProcResponse from graphscope.flex.rest.models.get_vertex_type import GetVertexType from graphscope.flex.rest.models.job_status import JobStatus from graphscope.flex.rest.models.long_text import LongText +from graphscope.flex.rest.models.node_status import NodeStatus from graphscope.flex.rest.models.parameter import Parameter from graphscope.flex.rest.models.primitive_type import PrimitiveType from graphscope.flex.rest.models.running_deployment_info import RunningDeploymentInfo +from graphscope.flex.rest.models.running_deployment_status import RunningDeploymentStatus +from graphscope.flex.rest.models.running_deployment_status_nodes_inner import RunningDeploymentStatusNodesInner from graphscope.flex.rest.models.schema_mapping import SchemaMapping from graphscope.flex.rest.models.service_status import ServiceStatus from graphscope.flex.rest.models.service_status_sdk_endpoints import ServiceStatusSdkEndpoints @@ -65,6 +68,6 @@ from graphscope.flex.rest.models.string_type import StringType from graphscope.flex.rest.models.string_type_string import StringTypeString from graphscope.flex.rest.models.update_alert_message_status_request import UpdateAlertMessageStatusRequest -from graphscope.flex.rest.models.update_procedure_request import UpdateProcedureRequest +from graphscope.flex.rest.models.update_stored_proc_request import UpdateStoredProcRequest from graphscope.flex.rest.models.upload_file_response import UploadFileResponse from graphscope.flex.rest.models.vertex_mapping import VertexMapping diff --git a/python/graphscope/flex/rest/models/create_graph_request.py b/python/graphscope/flex/rest/models/create_graph_request.py index 314e73af6efd..47f080eb34e9 100644 --- a/python/graphscope/flex/rest/models/create_graph_request.py +++ b/python/graphscope/flex/rest/models/create_graph_request.py @@ -21,7 +21,7 @@ from pydantic import BaseModel, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from graphscope.flex.rest.models.create_graph_schema_request import CreateGraphSchemaRequest -from graphscope.flex.rest.models.create_procedure_request import CreateProcedureRequest +from graphscope.flex.rest.models.create_stored_proc_request import CreateStoredProcRequest from typing import Optional, Set from typing_extensions import Self @@ -29,10 +29,10 @@ class CreateGraphRequest(BaseModel): """ CreateGraphRequest """ # noqa: E501 - name: StrictStr + name: Optional[StrictStr] = None description: Optional[StrictStr] = None - stored_procedures: Optional[List[CreateProcedureRequest]] = None - var_schema: CreateGraphSchemaRequest = Field(alias="schema") + stored_procedures: Optional[List[CreateStoredProcRequest]] = None + var_schema: Optional[CreateGraphSchemaRequest] = Field(default=None, alias="schema") __properties: ClassVar[List[str]] = ["name", "description", "stored_procedures", "schema"] model_config = { @@ -98,7 +98,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "name": obj.get("name"), "description": obj.get("description"), - "stored_procedures": [CreateProcedureRequest.from_dict(_item) for _item in obj["stored_procedures"]] if obj.get("stored_procedures") is not None else None, + "stored_procedures": [CreateStoredProcRequest.from_dict(_item) for _item in obj["stored_procedures"]] if obj.get("stored_procedures") is not None else None, "schema": CreateGraphSchemaRequest.from_dict(obj["schema"]) if obj.get("schema") is not None else None }) return _obj diff --git a/python/graphscope/flex/rest/models/create_procedure_request.py b/python/graphscope/flex/rest/models/create_stored_proc_request.py similarity index 93% rename from python/graphscope/flex/rest/models/create_procedure_request.py rename to python/graphscope/flex/rest/models/create_stored_proc_request.py index 2232a27db6b6..aef3fe16492f 100644 --- a/python/graphscope/flex/rest/models/create_procedure_request.py +++ b/python/graphscope/flex/rest/models/create_stored_proc_request.py @@ -23,9 +23,9 @@ from typing import Optional, Set from typing_extensions import Self -class CreateProcedureRequest(BaseModel): +class CreateStoredProcRequest(BaseModel): """ - CreateProcedureRequest + CreateStoredProcRequest """ # noqa: E501 name: StrictStr description: Optional[StrictStr] = None @@ -58,7 +58,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CreateProcedureRequest from a JSON string""" + """Create an instance of CreateStoredProcRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -83,7 +83,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateProcedureRequest from a dict""" + """Create an instance of CreateStoredProcRequest from a dict""" if obj is None: return None diff --git a/python/graphscope/flex/rest/models/create_procedure_response.py b/python/graphscope/flex/rest/models/create_stored_proc_response.py similarity index 86% rename from python/graphscope/flex/rest/models/create_procedure_response.py rename to python/graphscope/flex/rest/models/create_stored_proc_response.py index 5f7d7ee276a0..af05050c1503 100644 --- a/python/graphscope/flex/rest/models/create_procedure_response.py +++ b/python/graphscope/flex/rest/models/create_stored_proc_response.py @@ -23,12 +23,12 @@ from typing import Optional, Set from typing_extensions import Self -class CreateProcedureResponse(BaseModel): +class CreateStoredProcResponse(BaseModel): """ - CreateProcedureResponse + CreateStoredProcResponse """ # noqa: E501 - procedure_id: StrictStr - __properties: ClassVar[List[str]] = ["procedure_id"] + stored_procedure_id: StrictStr + __properties: ClassVar[List[str]] = ["stored_procedure_id"] model_config = { "populate_by_name": True, @@ -48,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CreateProcedureResponse from a JSON string""" + """Create an instance of CreateStoredProcResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CreateProcedureResponse from a dict""" + """Create an instance of CreateStoredProcResponse from a dict""" if obj is None: return None @@ -81,7 +81,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "procedure_id": obj.get("procedure_id") + "stored_procedure_id": obj.get("stored_procedure_id") }) return _obj diff --git a/python/graphscope/flex/rest/models/get_graph_response.py b/python/graphscope/flex/rest/models/get_graph_response.py index fd405d1d9d65..b85a36c906d9 100644 --- a/python/graphscope/flex/rest/models/get_graph_response.py +++ b/python/graphscope/flex/rest/models/get_graph_response.py @@ -21,7 +21,7 @@ from pydantic import BaseModel, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from graphscope.flex.rest.models.get_graph_schema_response import GetGraphSchemaResponse -from graphscope.flex.rest.models.get_procedure_response import GetProcedureResponse +from graphscope.flex.rest.models.get_stored_proc_response import GetStoredProcResponse from typing import Optional, Set from typing_extensions import Self @@ -36,7 +36,7 @@ class GetGraphResponse(BaseModel): creation_time: StrictStr data_update_time: StrictStr schema_update_time: StrictStr - stored_procedures: Optional[List[GetProcedureResponse]] = None + stored_procedures: Optional[List[GetStoredProcResponse]] = None var_schema: GetGraphSchemaResponse = Field(alias="schema") __properties: ClassVar[List[str]] = ["id", "name", "description", "store_type", "creation_time", "data_update_time", "schema_update_time", "stored_procedures", "schema"] @@ -118,7 +118,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "creation_time": obj.get("creation_time"), "data_update_time": obj.get("data_update_time"), "schema_update_time": obj.get("schema_update_time"), - "stored_procedures": [GetProcedureResponse.from_dict(_item) for _item in obj["stored_procedures"]] if obj.get("stored_procedures") is not None else None, + "stored_procedures": [GetStoredProcResponse.from_dict(_item) for _item in obj["stored_procedures"]] if obj.get("stored_procedures") is not None else None, "schema": GetGraphSchemaResponse.from_dict(obj["schema"]) if obj.get("schema") is not None else None }) return _obj diff --git a/python/graphscope/flex/rest/models/get_procedure_response.py b/python/graphscope/flex/rest/models/get_stored_proc_response.py similarity index 95% rename from python/graphscope/flex/rest/models/get_procedure_response.py rename to python/graphscope/flex/rest/models/get_stored_proc_response.py index afa4de1ff084..cf483135b0c6 100644 --- a/python/graphscope/flex/rest/models/get_procedure_response.py +++ b/python/graphscope/flex/rest/models/get_stored_proc_response.py @@ -24,9 +24,9 @@ from typing import Optional, Set from typing_extensions import Self -class GetProcedureResponse(BaseModel): +class GetStoredProcResponse(BaseModel): """ - GetProcedureResponse + GetStoredProcResponse """ # noqa: E501 name: StrictStr description: Optional[StrictStr] = None @@ -65,7 +65,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of GetProcedureResponse from a JSON string""" + """Create an instance of GetStoredProcResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -104,7 +104,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of GetProcedureResponse from a dict""" + """Create an instance of GetStoredProcResponse from a dict""" if obj is None: return None diff --git a/python/graphscope/flex/rest/models/node_status.py b/python/graphscope/flex/rest/models/node_status.py new file mode 100644 index 000000000000..73170b01af4a --- /dev/null +++ b/python/graphscope/flex/rest/models/node_status.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + GraphScope FLEX HTTP SERVICE API + + 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) + + The version of the OpenAPI document: 1.0.0 + Contact: graphscope@alibaba-inc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self + +class NodeStatus(BaseModel): + """ + NodeStatus + """ # noqa: E501 + name: StrictStr + cpu_usage: Union[StrictFloat, StrictInt] + memory_usage: Union[StrictFloat, StrictInt] + disk_usage: Union[StrictFloat, StrictInt] + __properties: ClassVar[List[str]] = ["name", "cpu_usage", "memory_usage", "disk_usage"] + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NodeStatus from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NodeStatus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "cpu_usage": obj.get("cpu_usage"), + "memory_usage": obj.get("memory_usage"), + "disk_usage": obj.get("disk_usage") + }) + return _obj + + diff --git a/python/graphscope/flex/rest/models/running_deployment_info.py b/python/graphscope/flex/rest/models/running_deployment_info.py index 87685e55119e..953c59e968f9 100644 --- a/python/graphscope/flex/rest/models/running_deployment_info.py +++ b/python/graphscope/flex/rest/models/running_deployment_info.py @@ -30,9 +30,11 @@ class RunningDeploymentInfo(BaseModel): instance_name: StrictStr cluster_type: StrictStr version: StrictStr - solution: StrictStr creation_time: StrictStr - __properties: ClassVar[List[str]] = ["instance_name", "cluster_type", "version", "solution", "creation_time"] + frontend: StrictStr + engine: StrictStr + storage: StrictStr + __properties: ClassVar[List[str]] = ["instance_name", "cluster_type", "version", "creation_time", "frontend", "engine", "storage"] @field_validator('cluster_type') def cluster_type_validate_enum(cls, value): @@ -41,11 +43,25 @@ def cluster_type_validate_enum(cls, value): raise ValueError("must be one of enum values ('HOSTS', 'KUBERNETES')") return value - @field_validator('solution') - def solution_validate_enum(cls, value): + @field_validator('frontend') + def frontend_validate_enum(cls, value): """Validates the enum""" - if value not in set(['INTERACTIVE', 'GRAPHSCOPE_INSIGHT']): - raise ValueError("must be one of enum values ('INTERACTIVE', 'GRAPHSCOPE_INSIGHT')") + if value not in set(['Cypher/Gremlin', 'AnalyticalApps']): + raise ValueError("must be one of enum values ('Cypher/Gremlin', 'AnalyticalApps')") + return value + + @field_validator('engine') + def engine_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['Hiactor', 'Gaia']): + raise ValueError("must be one of enum values ('Hiactor', 'Gaia')") + return value + + @field_validator('storage') + def storage_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['MutableCSR']): + raise ValueError("must be one of enum values ('MutableCSR')") return value model_config = { @@ -102,8 +118,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "instance_name": obj.get("instance_name"), "cluster_type": obj.get("cluster_type"), "version": obj.get("version"), - "solution": obj.get("solution"), - "creation_time": obj.get("creation_time") + "creation_time": obj.get("creation_time"), + "frontend": obj.get("frontend"), + "engine": obj.get("engine"), + "storage": obj.get("storage") }) return _obj diff --git a/python/graphscope/flex/rest/models/running_deployment_status.py b/python/graphscope/flex/rest/models/running_deployment_status.py new file mode 100644 index 000000000000..b6cf0ba69bad --- /dev/null +++ b/python/graphscope/flex/rest/models/running_deployment_status.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + GraphScope FLEX HTTP SERVICE API + + 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) + + The version of the OpenAPI document: 1.0.0 + Contact: graphscope@alibaba-inc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from graphscope.flex.rest.models.running_deployment_status_nodes_inner import RunningDeploymentStatusNodesInner +from typing import Optional, Set +from typing_extensions import Self + +class RunningDeploymentStatus(BaseModel): + """ + RunningDeploymentStatus + """ # noqa: E501 + cluster_type: StrictStr + nodes: List[RunningDeploymentStatusNodesInner] + __properties: ClassVar[List[str]] = ["cluster_type", "nodes"] + + @field_validator('cluster_type') + def cluster_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['HOSTS', 'KUBERNETES']): + raise ValueError("must be one of enum values ('HOSTS', 'KUBERNETES')") + return value + + model_config = { + "populate_by_name": True, + "validate_assignment": True, + "protected_namespaces": (), + } + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RunningDeploymentStatus from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in nodes (list) + _items = [] + if self.nodes: + for _item in self.nodes: + if _item: + _items.append(_item.to_dict()) + _dict['nodes'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RunningDeploymentStatus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "cluster_type": obj.get("cluster_type"), + "nodes": [RunningDeploymentStatusNodesInner.from_dict(_item) for _item in obj["nodes"]] if obj.get("nodes") is not None else None + }) + return _obj + + diff --git a/python/graphscope/flex/rest/models/running_deployment_status_nodes_inner.py b/python/graphscope/flex/rest/models/running_deployment_status_nodes_inner.py new file mode 100644 index 000000000000..1d5e90e0b995 --- /dev/null +++ b/python/graphscope/flex/rest/models/running_deployment_status_nodes_inner.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + GraphScope FLEX HTTP SERVICE API + + 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) + + The version of the OpenAPI document: 1.0.0 + Contact: graphscope@alibaba-inc.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from graphscope.flex.rest.models.node_status import NodeStatus +from pydantic import StrictStr, Field +from typing import Union, List, Optional, Dict +from typing_extensions import Literal, Self + +RUNNINGDEPLOYMENTSTATUSNODESINNER_ONE_OF_SCHEMAS = ["NodeStatus"] + +class RunningDeploymentStatusNodesInner(BaseModel): + """ + RunningDeploymentStatusNodesInner + """ + # data type: NodeStatus + oneof_schema_1_validator: Optional[NodeStatus] = None + actual_instance: Optional[Union[NodeStatus]] = None + one_of_schemas: List[str] = Field(default=Literal["NodeStatus"]) + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = RunningDeploymentStatusNodesInner.model_construct() + error_messages = [] + match = 0 + # validate data type: NodeStatus + if not isinstance(v, NodeStatus): + error_messages.append(f"Error! Input type `{type(v)}` is not `NodeStatus`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in RunningDeploymentStatusNodesInner with oneOf schemas: NodeStatus. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in RunningDeploymentStatusNodesInner with oneOf schemas: NodeStatus. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into NodeStatus + try: + instance.actual_instance = NodeStatus.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into RunningDeploymentStatusNodesInner with oneOf schemas: NodeStatus. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into RunningDeploymentStatusNodesInner with oneOf schemas: NodeStatus. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], NodeStatus]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/python/graphscope/flex/rest/models/service_status.py b/python/graphscope/flex/rest/models/service_status.py index e727cebd5c3d..9f0bc273786c 100644 --- a/python/graphscope/flex/rest/models/service_status.py +++ b/python/graphscope/flex/rest/models/service_status.py @@ -20,7 +20,6 @@ from pydantic import BaseModel, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from graphscope.flex.rest.models.get_graph_response import GetGraphResponse from graphscope.flex.rest.models.service_status_sdk_endpoints import ServiceStatusSdkEndpoints from typing import Optional, Set from typing_extensions import Self @@ -29,10 +28,11 @@ class ServiceStatus(BaseModel): """ ServiceStatus """ # noqa: E501 + graph_id: StrictStr status: StrictStr - graph: Optional[GetGraphResponse] = None sdk_endpoints: Optional[ServiceStatusSdkEndpoints] = None - __properties: ClassVar[List[str]] = ["status", "graph", "sdk_endpoints"] + start_time: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["graph_id", "status", "sdk_endpoints", "start_time"] @field_validator('status') def status_validate_enum(cls, value): @@ -80,9 +80,6 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of graph - if self.graph: - _dict['graph'] = self.graph.to_dict() # override the default output from pydantic by calling `to_dict()` of sdk_endpoints if self.sdk_endpoints: _dict['sdk_endpoints'] = self.sdk_endpoints.to_dict() @@ -98,9 +95,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "graph_id": obj.get("graph_id"), "status": obj.get("status"), - "graph": GetGraphResponse.from_dict(obj["graph"]) if obj.get("graph") is not None else None, - "sdk_endpoints": ServiceStatusSdkEndpoints.from_dict(obj["sdk_endpoints"]) if obj.get("sdk_endpoints") is not None else None + "sdk_endpoints": ServiceStatusSdkEndpoints.from_dict(obj["sdk_endpoints"]) if obj.get("sdk_endpoints") is not None else None, + "start_time": obj.get("start_time") }) return _obj diff --git a/python/graphscope/flex/rest/models/update_procedure_request.py b/python/graphscope/flex/rest/models/update_stored_proc_request.py similarity index 92% rename from python/graphscope/flex/rest/models/update_procedure_request.py rename to python/graphscope/flex/rest/models/update_stored_proc_request.py index 0b794b4d92d1..f69de27952f5 100644 --- a/python/graphscope/flex/rest/models/update_procedure_request.py +++ b/python/graphscope/flex/rest/models/update_stored_proc_request.py @@ -23,9 +23,9 @@ from typing import Optional, Set from typing_extensions import Self -class UpdateProcedureRequest(BaseModel): +class UpdateStoredProcRequest(BaseModel): """ - UpdateProcedureRequest + UpdateStoredProcRequest """ # noqa: E501 description: StrictStr __properties: ClassVar[List[str]] = ["description"] @@ -48,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UpdateProcedureRequest from a JSON string""" + """Create an instance of UpdateStoredProcRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UpdateProcedureRequest from a dict""" + """Create an instance of UpdateStoredProcRequest from a dict""" if obj is None: return None diff --git a/python/graphscope/gsctl/commands/__init__.py b/python/graphscope/gsctl/commands/__init__.py index 823cc85e486c..5998bb958dd7 100644 --- a/python/graphscope/gsctl/commands/__init__.py +++ b/python/graphscope/gsctl/commands/__init__.py @@ -34,6 +34,22 @@ from graphscope.gsctl.utils import info +def is_interactive_mode(flex): + return ( + flex["engine"] == "Hiactor" + and flex["storage"] == "MutableCSR" + and flex["frontend"] == "Cypher/Gremlin" + ) + + +def is_insight_mode(flex): + return ( + flex["engine"] == "Gaia" + and flex["storage"] == "MutableCSR" + and flex["frontend"] == "Cypher/Gremlin" + ) + + def get_command_collection(context: Context): # default commands commands = click.CommandCollection(sources=[common, dev]) @@ -57,7 +73,11 @@ def get_command_collection(context: Context): try: # connect to coordinator and reset the timestamp response = connect_coordinator(context.coordinator_endpoint) - solution = response.solution + flex = { + "engine": response.engine, + "storage": response.storage, + "frontend": response.frontend, + } except Exception as e: err( "Failed to connect to coordinator at {0}: {1}".format( @@ -70,15 +90,15 @@ def get_command_collection(context: Context): return commands else: # check consistency - if solution != context.flex: + if flex != context.flex: raise RuntimeError( - f"Instance changed: {context.flex} -> {solution}, please close and reconnect to the coordinator" + f"Instance changed: {context.flex} -> {flex}, please close and reconnect to the coordinator" ) context.reset_timestamp() config = load_gs_config() config.update_and_write(context) - if context.flex == "INTERACTIVE": + if is_interactive_mode(context.flex): if context.context == "global": if len(sys.argv) < 2 or sys.argv[1] != "use": info("Using GLOBAL.", fg="green", bold=True) @@ -91,7 +111,7 @@ def get_command_collection(context: Context): info(f"Using GRAPH {context.context}.", fg="green", bold=True) info("Run `gsctl use GLOBAL` to switch back to GLOBAL context.\n") commands = click.CommandCollection(sources=[common, interactive_graph]) - elif context.flex == "GRAPHSCOPE_INSIGHT": + elif is_insight_mode(context.flex): commands = click.CommandCollection(sources=[common]) # commands = click.CommandCollection(sources=[common, insight_graph]) diff --git a/python/graphscope/gsctl/commands/common.py b/python/graphscope/gsctl/commands/common.py index 7d94a2aad577..37b43d0a7b67 100644 --- a/python/graphscope/gsctl/commands/common.py +++ b/python/graphscope/gsctl/commands/common.py @@ -62,8 +62,11 @@ def connect(coordinator_endpoint): except Exception as e: err(f"Unable to connect to server: {str(e)}") else: + serving_mode = "frontend: {0}, engine: {1}, storage: {2}".format( + resp.frontend, resp.engine, resp.storage + ) succ( - f"Connected to {coordinator_endpoint}, coordinator is serving with {resp.solution} mode.\n" + f"Connected to {coordinator_endpoint}, coordinator is serving with {serving_mode} mode.\n" ) info("Try 'gsctl --help' for help.") diff --git a/python/graphscope/gsctl/commands/interactive/glob.py b/python/graphscope/gsctl/commands/interactive/glob.py index 81f2d334b5af..4167d7277188 100644 --- a/python/graphscope/gsctl/commands/interactive/glob.py +++ b/python/graphscope/gsctl/commands/interactive/glob.py @@ -23,10 +23,10 @@ from graphscope.gsctl.impl import delete_graph_by_id from graphscope.gsctl.impl import get_datasource_by_id from graphscope.gsctl.impl import get_graph_id_by_name -from graphscope.gsctl.impl import get_service_status from graphscope.gsctl.impl import list_graphs from graphscope.gsctl.impl import list_jobs -from graphscope.gsctl.impl import list_procedures +from graphscope.gsctl.impl import list_service_status +from graphscope.gsctl.impl import list_stored_procedures from graphscope.gsctl.impl import restart_service from graphscope.gsctl.impl import start_service from graphscope.gsctl.impl import stop_service @@ -93,8 +93,8 @@ def ls(l): # noqa: F811, E741 datasource_mapping = get_datasource_by_id(g.id) tree.create_datasource_mapping_node(g, datasource_mapping) # stored procedure - procedures = list_procedures(g.id) - tree.create_procedure_node(g, procedures) + stored_procedures = list_stored_procedures(g.id) + tree.create_stored_procedure_node(g, stored_procedures) # job jobs = list_jobs() tree.create_job_node(g, jobs) @@ -191,24 +191,25 @@ def _construct_and_display_data(status): "GREMLIN_ENDPOINT", ] data = [head] - if status.status == "Stopped": - data.append([status.status, "-", "-", "-", "-"]) - else: - data.append( - [ - status.status, - status.graph.id, - status.sdk_endpoints.cypher, - status.sdk_endpoints.hqps, - status.sdk_endpoints.gremlin, - ] - ) + for s in status: + if s.status == "Stopped": + data.append([s.status, s.graph_id, "-", "-", "-"]) + else: + data.append( + [ + s.status, + s.graph_id, + s.sdk_endpoints.cypher, + s.sdk_endpoints.hqps, + s.sdk_endpoints.gremlin, + ] + ) terminal_display(data) try: - status = get_service_status() + status = list_service_status() except Exception as e: - err(f"Failed to get service status: {str(e)}") + err(f"Failed to list service status: {str(e)}") else: _construct_and_display_data(status) diff --git a/python/graphscope/gsctl/commands/interactive/graph.py b/python/graphscope/gsctl/commands/interactive/graph.py index ca87b69f9a8a..942972f3db1e 100644 --- a/python/graphscope/gsctl/commands/interactive/graph.py +++ b/python/graphscope/gsctl/commands/interactive/graph.py @@ -21,15 +21,15 @@ from graphscope.gsctl.config import get_current_context from graphscope.gsctl.impl import bind_datasource_in_batch -from graphscope.gsctl.impl import create_procedure +from graphscope.gsctl.impl import create_stored_procedure from graphscope.gsctl.impl import delete_job_by_id -from graphscope.gsctl.impl import delete_procedure_by_id +from graphscope.gsctl.impl import delete_stored_procedure_by_id from graphscope.gsctl.impl import get_datasource_by_id from graphscope.gsctl.impl import get_graph_id_by_name from graphscope.gsctl.impl import get_job_by_id from graphscope.gsctl.impl import list_graphs from graphscope.gsctl.impl import list_jobs -from graphscope.gsctl.impl import list_procedures +from graphscope.gsctl.impl import list_stored_procedures from graphscope.gsctl.impl import submit_dataloading_job from graphscope.gsctl.impl import switch_context from graphscope.gsctl.impl import unbind_edge_datasource @@ -90,8 +90,8 @@ def ls(): # noqa: F811 datasource_mapping = get_datasource_by_id(using_graph.id) tree.create_datasource_mapping_node(using_graph, datasource_mapping) # stored procedure - procedures = list_procedures(using_graph.id) - tree.create_procedure_node(using_graph, procedures) + stored_procedures = list_stored_procedures(using_graph.id) + tree.create_stored_procedure_node(using_graph, stored_procedures) # job jobs = list_jobs() tree.create_job_node(using_graph, jobs) @@ -108,7 +108,7 @@ def ls(): # noqa: F811 required=True, help="Path of yaml file", ) -def procedure(filename): +def storedproc(filename): """Create a stored procedure from file""" if not is_valid_file_path(filename): err(f"Invalid file: {filename}") @@ -116,22 +116,22 @@ def procedure(filename): current_context = get_current_context() graph_identifier = current_context.context try: - procedure = read_yaml_file(filename) - create_procedure(graph_identifier, procedure) + stored_procedure = read_yaml_file(filename) + create_stored_procedure(graph_identifier, stored_procedure) except Exception as e: err(f"Failed to create stored procedure: {str(e)}") else: - succ(f"Create stored procedure {procedure['name']} successfully.") + succ(f"Create stored procedure {stored_procedure['name']} successfully.") @delete.command() @click.argument("identifier", required=True) -def procedure(identifier): # noqa: F811 +def storedproc(identifier): # noqa: F811 """Delete a stored procedure, see identifier with `ls` command""" current_context = get_current_context() graph_identifier = current_context.context try: - delete_procedure_by_id(graph_identifier, identifier) + delete_stored_procedure_by_id(graph_identifier, identifier) except Exception as e: err(f"Failed to delete stored procedure: {str(e)}") else: @@ -246,26 +246,26 @@ def job(identifier): # noqa: F811 @desc.command() @click.argument("identifier", required=True) -def procedure(identifier): # noqa: F811 +def storedproc(identifier): # noqa: F811 """Show details of stored procedure, see identifier with `ls` command""" current_context = get_current_context() graph_id = current_context.context try: - procedures = list_procedures(graph_id) + stored_procedures = list_stored_procedures(graph_id) except Exception as e: - err(f"Failed to list procedures: {str(e)}") + err(f"Failed to list stored procedures: {str(e)}") else: - if not procedures: + if not stored_procedures: info(f"No stored procedures found on {graph_id}.") return - specific_procedure_exist = False - for procedure in procedures: - if identifier == procedure.id: - info(yaml.dump(procedure.to_dict())) - specific_procedure_exist = True + specific_stored_procedure_exist = False + for stored_procedure in stored_procedures: + if identifier == stored_procedure.id: + info(yaml.dump(stored_procedure.to_dict())) + specific_stored_procedure_exist = True break - if not specific_procedure_exist: - err(f"Procedure {identifier} not found on {graph_id}.") + if not specific_stored_procedure_exist: + err(f"Stored Procedure {identifier} not found on {graph_id}.") @use.command(name="GLOBAL") diff --git a/python/graphscope/gsctl/impl/__init__.py b/python/graphscope/gsctl/impl/__init__.py index 7f84689dfd4b..12677c62629e 100644 --- a/python/graphscope/gsctl/impl/__init__.py +++ b/python/graphscope/gsctl/impl/__init__.py @@ -30,14 +30,14 @@ from graphscope.gsctl.impl.job import get_job_by_id from graphscope.gsctl.impl.job import list_jobs from graphscope.gsctl.impl.job import submit_dataloading_job -from graphscope.gsctl.impl.procedure import create_procedure -from graphscope.gsctl.impl.procedure import delete_procedure_by_id -from graphscope.gsctl.impl.procedure import get_procedure_by_id -from graphscope.gsctl.impl.procedure import list_procedures -from graphscope.gsctl.impl.procedure import update_procedure_by_id -from graphscope.gsctl.impl.service import get_service_status +from graphscope.gsctl.impl.service import list_service_status from graphscope.gsctl.impl.service import restart_service from graphscope.gsctl.impl.service import start_service from graphscope.gsctl.impl.service import stop_service +from graphscope.gsctl.impl.stored_procedure import create_stored_procedure +from graphscope.gsctl.impl.stored_procedure import delete_stored_procedure_by_id +from graphscope.gsctl.impl.stored_procedure import get_stored_procedure_by_id +from graphscope.gsctl.impl.stored_procedure import list_stored_procedures +from graphscope.gsctl.impl.stored_procedure import update_stored_procedure_by_id from graphscope.gsctl.impl.utils import switch_context from graphscope.gsctl.impl.utils import upload_file diff --git a/python/graphscope/gsctl/impl/common.py b/python/graphscope/gsctl/impl/common.py index dd12342e14c1..025ab853844c 100644 --- a/python/graphscope/gsctl/impl/common.py +++ b/python/graphscope/gsctl/impl/common.py @@ -31,8 +31,13 @@ def connect_coordinator(coordinator_endpoint: str) -> RunningDeploymentInfo: api_instance = graphscope.flex.rest.DeploymentApi(api_client) deployment_info = api_instance.get_deployment_info() # coordinator connected, set the context + flex = { + "engine": deployment_info.engine, + "storage": deployment_info.storage, + "frontend": deployment_info.frontend, + } context = Context( - flex=deployment_info.solution, + flex=flex, coordinator_endpoint=coordinator_endpoint, ) config = load_gs_config() diff --git a/python/graphscope/gsctl/impl/service.py b/python/graphscope/gsctl/impl/service.py index 5b3352de533a..54eaacdf9f3b 100644 --- a/python/graphscope/gsctl/impl/service.py +++ b/python/graphscope/gsctl/impl/service.py @@ -16,19 +16,21 @@ # limitations under the License. # +from typing import List + import graphscope.flex.rest from graphscope.flex.rest import ServiceStatus from graphscope.flex.rest import StartServiceRequest from graphscope.gsctl.config import get_current_context -def get_service_status() -> ServiceStatus: +def list_service_status() -> List[ServiceStatus]: context = get_current_context() with graphscope.flex.rest.ApiClient( graphscope.flex.rest.Configuration(context.coordinator_endpoint) ) as api_client: api_instance = graphscope.flex.rest.ServiceApi(api_client) - return api_instance.get_service_status() + return api_instance.list_service_status() def start_service(graph_identifier: str) -> str: diff --git a/python/graphscope/gsctl/impl/procedure.py b/python/graphscope/gsctl/impl/stored_procedure.py similarity index 50% rename from python/graphscope/gsctl/impl/procedure.py rename to python/graphscope/gsctl/impl/stored_procedure.py index cc885a6147a4..d2fd2e76180d 100644 --- a/python/graphscope/gsctl/impl/procedure.py +++ b/python/graphscope/gsctl/impl/stored_procedure.py @@ -19,65 +19,69 @@ from typing import List import graphscope.flex.rest -from graphscope.flex.rest import CreateProcedureRequest -from graphscope.flex.rest import GetProcedureResponse -from graphscope.flex.rest import UpdateProcedureRequest +from graphscope.flex.rest import CreateStoredProcRequest +from graphscope.flex.rest import GetStoredProcResponse +from graphscope.flex.rest import UpdateStoredProcRequest from graphscope.gsctl.config import get_current_context -def create_procedure(graph_identifier: str, procedure: dict) -> str: +def create_stored_procedure(graph_identifier: str, stored_procedure: dict) -> str: context = get_current_context() with graphscope.flex.rest.ApiClient( graphscope.flex.rest.Configuration(context.coordinator_endpoint) ) as api_client: - api_instance = graphscope.flex.rest.ProcedureApi(api_client) - response = api_instance.create_procedure( - graph_identifier, CreateProcedureRequest.from_dict(procedure) + api_instance = graphscope.flex.rest.StoredProcedureApi(api_client) + response = api_instance.create_stored_procedure( + graph_identifier, CreateStoredProcRequest.from_dict(stored_procedure) ) - return response.procedure_id + return response.stored_procedure_id -def list_procedures(graph_identifier: str) -> List[GetProcedureResponse]: +def list_stored_procedures(graph_identifier: str) -> List[GetStoredProcResponse]: context = get_current_context() with graphscope.flex.rest.ApiClient( graphscope.flex.rest.Configuration(context.coordinator_endpoint) ) as api_client: - api_instance = graphscope.flex.rest.ProcedureApi(api_client) - return api_instance.list_procedures(graph_identifier) + api_instance = graphscope.flex.rest.StoredProcedureApi(api_client) + return api_instance.list_stored_procedures(graph_identifier) -def delete_procedure_by_id(graph_identifier: str, procedure_identifier: str) -> str: +def delete_stored_procedure_by_id( + graph_identifier: str, stored_procedure_identifier: str +) -> str: context = get_current_context() with graphscope.flex.rest.ApiClient( graphscope.flex.rest.Configuration(context.coordinator_endpoint) ) as api_client: - api_instance = graphscope.flex.rest.ProcedureApi(api_client) - return api_instance.delete_procedure_by_id( - graph_identifier, procedure_identifier + api_instance = graphscope.flex.rest.StoredProcedureApi(api_client) + return api_instance.delete_stored_procedure_by_id( + graph_identifier, stored_procedure_identifier ) -def get_procedure_by_id( - graph_identifier: str, procedure_identifier: str -) -> GetProcedureResponse: +def get_stored_procedure_by_id( + graph_identifier: str, stored_procedure_identifier: str +) -> GetStoredProcResponse: context = get_current_context() with graphscope.flex.rest.ApiClient( graphscope.flex.rest.Configuration(context.coordinator_endpoint) ) as api_client: - api_instance = graphscope.flex.rest.ProcedureApi(api_client) - return api_instance.get_procedure_by_id(graph_identifier, procedure_identifier) + api_instance = graphscope.flex.rest.StoredProcedureApi(api_client) + return api_instance.get_stored_procedure_by_id( + graph_identifier, stored_procedure_identifier + ) -def update_procedure_by_id( - graph_identifier: str, procedure_identifier: str, procedure: dict +def update_stored_procedure_by_id( + graph_identifier: str, stored_procedure_identifier: str, stored_procedure: dict ) -> str: context = get_current_context() with graphscope.flex.rest.ApiClient( graphscope.flex.rest.Configuration(context.coordinator_endpoint) ) as api_client: - api_instance = graphscope.flex.rest.ProcedureApi(api_client) - return api_instance.update_procedure_by_id( + api_instance = graphscope.flex.rest.StoredProcedureApi(api_client) + return api_instance.update_stored_procedure_by_id( graph_identifier, - procedure_identifier, - UpdateProcedureRequest.from_dict(procedure), + stored_procedure_identifier, + UpdateStoredProcRequest.from_dict(stored_procedure), ) diff --git a/python/graphscope/gsctl/utils.py b/python/graphscope/gsctl/utils.py index 69eaeb70d578..167cbe20839a 100644 --- a/python/graphscope/gsctl/utils.py +++ b/python/graphscope/gsctl/utils.py @@ -250,18 +250,20 @@ def create_schema_node(self, graph): parent=edge_identifier, ) - def create_procedure_node(self, graph, procedures): - procedure_identifier = f"{graph.id}_procedure" + def create_stored_procedure_node(self, graph, stored_procedures): + stored_procedure_identifier = f"{graph.id}_stored_procedure" self.tree.create_node( - tag="stored procedure", identifier=procedure_identifier, parent=graph.id + tag="stored procedure", + identifier=stored_procedure_identifier, + parent=graph.id, ) - for p in procedures: + for p in stored_procedures: self.tree.create_node( - tag="Procedure(identifier: {0}, type: {1}, runnable: {2}, query: {3}, description: {4})".format( + tag="StoredProc(identifier: {0}, type: {1}, runnable: {2}, query: {3}, description: {4})".format( p.id, p.type, p.runnable, p.query, p.description ), - identifier=f"{procedure_identifier}_{p.id}", - parent=procedure_identifier, + identifier=f"{stored_procedure_identifier}_{p.id}", + parent=stored_procedure_identifier, ) def create_job_node(self, graph, jobs): @@ -477,8 +479,10 @@ def show(self, graph_identifier=None, stdout=False, sorting=False): click.secho(schema_tree.show(stdout=False, sorting=False)) datasource_tree = self.tree.subtree(f"{graph_identifier}_datasource") click.secho(datasource_tree.show(stdout=False, sorting=False)) - procedure_tree = self.tree.subtree(f"{graph_identifier}_procedure") - click.secho(procedure_tree.show(stdout=False, sorting=False)) + stored_procedure_tree = self.tree.subtree( + f"{graph_identifier}_stored_procedure" + ) + click.secho(stored_procedure_tree.show(stdout=False, sorting=False)) job_tree = self.tree.subtree(f"{graph_identifier}_job") click.secho(job_tree.show(stdout=False, sorting=False)) else: diff --git a/python/graphscope/tests/flex/test_interactive.py b/python/graphscope/tests/flex/test_interactive.py index 50d2f37325e5..87035dfd14cd 100644 --- a/python/graphscope/tests/flex/test_interactive.py +++ b/python/graphscope/tests/flex/test_interactive.py @@ -29,23 +29,23 @@ from graphscope.gsctl.impl import bind_datasource_in_batch from graphscope.gsctl.impl import connect_coordinator from graphscope.gsctl.impl import create_graph -from graphscope.gsctl.impl import create_procedure +from graphscope.gsctl.impl import create_stored_procedure from graphscope.gsctl.impl import delete_graph_by_id -from graphscope.gsctl.impl import delete_procedure_by_id +from graphscope.gsctl.impl import delete_stored_procedure_by_id from graphscope.gsctl.impl import disconnect_coordinator from graphscope.gsctl.impl import get_datasource_by_id from graphscope.gsctl.impl import get_job_by_id -from graphscope.gsctl.impl import get_procedure_by_id -from graphscope.gsctl.impl import get_service_status +from graphscope.gsctl.impl import get_stored_procedure_by_id from graphscope.gsctl.impl import list_graphs -from graphscope.gsctl.impl import list_procedures +from graphscope.gsctl.impl import list_service_status +from graphscope.gsctl.impl import list_stored_procedures from graphscope.gsctl.impl import restart_service from graphscope.gsctl.impl import start_service from graphscope.gsctl.impl import stop_service from graphscope.gsctl.impl import submit_dataloading_job from graphscope.gsctl.impl import unbind_edge_datasource from graphscope.gsctl.impl import unbind_vertex_datasource -from graphscope.gsctl.impl import update_procedure_by_id +from graphscope.gsctl.impl import update_stored_procedure_by_id from graphscope.gsctl.impl import upload_file COORDINATOR_ENDPOINT = "http://127.0.0.1:8080" @@ -145,7 +145,9 @@ def setup_class(self): def test_deployment_info(self): assert self.deployment_info.instance_name == "demo" assert self.deployment_info.cluster_type == "HOSTS" - assert self.deployment_info.solution == "INTERACTIVE" + assert self.deployment_info.engine == "Hiactor" + assert self.deployment_info.storage == "MutableCSR" + assert self.deployment_info.frontend == "Cypher/Gremlin" assert self.deployment_info.version is not None assert self.deployment_info.creation_time is not None @@ -260,7 +262,7 @@ def test_bulk_loading(self, tmpdir): delete_graph_by_id(graph_id) def test_procedure(self): - procedure_dict = { + stored_procedure_dict = { "name": "procedure_name", "description": "This is a test procedure", "query": "MATCH (n) RETURN COUNT(n);", @@ -268,60 +270,75 @@ def test_procedure(self): } # test create a new procedure graph_id = create_graph(modern_graph) - procedure_id = create_procedure(graph_id, procedure_dict) - assert procedure_id is not None + stored_procedure_id = create_stored_procedure(graph_id, stored_procedure_dict) + assert stored_procedure_id is not None new_procedure_exist = False - procedures = list_procedures(graph_id) + procedures = list_stored_procedures(graph_id) for p in procedures: - if p.id == procedure_id and p.name == "procedure_name": + if p.id == stored_procedure_id and p.name == "procedure_name": new_procedure_exist = True assert new_procedure_exist # test update a procedure description = "This is an updated description" - update_procedure_by_id(graph_id, procedure_id, {"description": description}) - procedure = get_procedure_by_id(graph_id, procedure_id) + update_stored_procedure_by_id( + graph_id, stored_procedure_id, {"description": description} + ) + procedure = get_stored_procedure_by_id(graph_id, stored_procedure_id) assert procedure.description == description # test delete a procedure - delete_procedure_by_id(graph_id, procedure_id) + delete_stored_procedure_by_id(graph_id, stored_procedure_id) new_procedure_exist = False - procedures = list_procedures(graph_id) + procedures = list_stored_procedures(graph_id) for p in procedures: - if p.id == procedure_id and p.name == "procedure_name": + if p.id == stored_procedure_id and p.name == "procedure_name": new_procedure_exist = True assert not new_procedure_exist delete_graph_by_id(graph_id) def test_service(self): - status = get_service_status() - original_graph_id = status.graph.id - assert status.status == "Running" + original_graph_id = None + status = list_service_status() + for s in status: + if s.status == "Running": + original_graph_id = s.graph_id + assert original_graph_id is not None # start service on a new graph new_graph_id = create_graph(modern_graph) start_service(new_graph_id) - status = get_service_status() - assert status.status == "Running" - assert status.graph.id == new_graph_id + status = list_service_status() + for s in status: + if s.graph_id == new_graph_id: + assert s.status == "Running" + else: + assert s.status == "Stopped" # restart the service restart_service() - status = get_service_status() - assert status.status == "Running" - assert status.graph.id == new_graph_id + status = list_service_status() + for s in status: + if s.graph_id == new_graph_id: + assert s.status == "Running" + else: + assert s.status == "Stopped" # stop the service stop_service() - status = get_service_status() - assert status.status == "Stopped" + status = list_service_status() + for s in status: + assert s.status == "Stopped" # delete graph and switch to original graph delete_graph_by_id(new_graph_id) start_service(original_graph_id) - status = get_service_status() - assert status.status == "Running" - assert status.graph.id == original_graph_id + status = list_service_status() + for s in status: + if s.graph_id == original_graph_id: + assert s.status == "Running" + else: + assert s.status == "Stopped" def test_suit_case(self): # case 1: # during deleting a graph, make sure the stored procedures # on that graph are deleted at the same time - procedure_dict = { + stored_procedure_dict = { "name": "procedure_name", "description": "This is a test procedure", "query": "MATCH (n) RETURN COUNT(n);", @@ -330,12 +347,12 @@ def test_suit_case(self): graph_id = create_graph(modern_graph) graph_id_2 = create_graph(modern_graph) # create a procedure on graph 1 - procedure_id = create_procedure(graph_id, procedure_dict) - assert procedure_id == "procedure_name" + stored_procedure_id = create_stored_procedure(graph_id, stored_procedure_dict) + assert stored_procedure_id == "procedure_name" # delete the graph 1, then create a new procedure on graph 2 delete_graph_by_id(graph_id) - procedure_id = create_procedure(graph_id_2, procedure_dict) - assert procedure_id == "procedure_name" + stored_procedure_id = create_stored_procedure(graph_id_2, stored_procedure_dict) + assert stored_procedure_id == "procedure_name" delete_graph_by_id(graph_id_2) def teardown_class(self): From 67519d98452cb19300b8e7bfb20a36f189f04980 Mon Sep 17 00:00:00 2001 From: Dongze Li Date: Tue, 28 May 2024 19:31:15 +0800 Subject: [PATCH 05/15] Integrate two coordinators --- coordinator/gscoordinator/coordinator.py | 12 ++ coordinator/gscoordinator/flex/__init__.py | 17 ++ .../flex/controllers/__init__.py | 17 ++ .../flex}/controllers/alert_controller.py | 16 +- .../controllers/data_source_controller.py | 10 +- .../controllers/deployment_controller.py | 12 +- .../flex}/controllers/graph_controller.py | 24 +-- .../flex}/controllers/job_controller.py | 16 +- .../flex}/controllers/security_controller.py | 0 .../flex}/controllers/service_controller.py | 12 +- .../stored_procedure_controller.py | 18 +- .../flex}/controllers/utils_controller.py | 10 +- .../gscoordinator/flex}/core/__init__.py | 4 +- .../flex}/core/alert/__init__.py | 2 +- .../flex}/core/alert/alert_manager.py | 20 +- .../flex}/core/alert/alert_message.py | 2 +- .../flex}/core/alert/alert_receiver.py | 6 +- .../flex}/core/alert/alert_rule.py | 6 +- .../flex}/core/alert/builtin_rules.py | 10 +- .../flex}/core/alert/message_collector.py | 10 +- .../flex}/core/client_wrapper.py | 64 +++--- .../gscoordinator/flex}/core/config.py | 0 .../gscoordinator/flex}/core/datasource.py | 2 +- .../flex}/core/insight/__init__.py | 2 +- .../gscoordinator/flex}/core/insight/graph.py | 30 +-- .../gscoordinator/flex}/core/insight/groot.py | 0 .../gscoordinator/flex}/core/insight/job.py | 8 +- .../flex}/core/interactive/__init__.py | 2 +- .../flex}/core/interactive/hqps.py | 14 +- .../gscoordinator/flex}/core/scheduler.py | 4 +- .../flex}/core/stoppable_thread.py | 0 .../gscoordinator/flex}/core/utils.py | 0 .../gscoordinator/flex}/encoder.py | 2 +- .../gscoordinator/flex/models/__init__.py | 58 ++++++ .../flex}/models/base_edge_type.py | 8 +- ...e_type_vertex_type_pair_relations_inner.py | 8 +- ..._type_pair_relations_inner_x_csr_params.py | 4 +- .../gscoordinator/flex}/models/base_model.py | 2 +- .../flex}/models/base_property_meta.py | 8 +- .../flex}/models/base_vertex_type.py | 8 +- .../models/base_vertex_type_x_csr_params.py | 4 +- .../flex}/models/column_mapping.py | 8 +- .../flex}/models/column_mapping_column.py | 4 +- .../models/create_alert_receiver_request.py | 4 +- .../flex}/models/create_alert_rule_request.py | 4 +- .../models/create_dataloading_job_response.py | 4 +- .../flex}/models/create_edge_type.py | 12 +- .../flex}/models/create_graph_request.py | 12 +- .../flex}/models/create_graph_response.py | 4 +- .../models/create_graph_schema_request.py | 12 +- .../flex}/models/create_property_meta.py | 8 +- .../models/create_stored_proc_request.py | 4 +- .../models/create_stored_proc_response.py | 4 +- .../flex}/models/create_vertex_type.py | 12 +- .../flex}/models/dataloading_job_config.py | 18 +- .../dataloading_job_config_edges_inner.py | 4 +- .../dataloading_job_config_loading_config.py | 8 +- ...oading_job_config_loading_config_format.py | 4 +- .../dataloading_job_config_vertices_inner.py | 4 +- .../flex}/models/edge_mapping.py | 12 +- .../flex}/models/edge_mapping_type_triplet.py | 4 +- .../gscoordinator/flex}/models/error.py | 4 +- .../models/get_alert_message_response.py | 4 +- .../models/get_alert_receiver_response.py | 4 +- .../flex}/models/get_alert_rule_response.py | 4 +- .../flex}/models/get_edge_type.py | 12 +- .../flex}/models/get_graph_response.py | 12 +- .../flex}/models/get_graph_schema_response.py | 12 +- .../flex}/models/get_property_meta.py | 8 +- .../flex}/models/get_stored_proc_response.py | 8 +- .../flex}/models/get_vertex_type.py | 12 +- .../flex}/models/gs_data_type.py | 18 +- .../gscoordinator/flex}/models/job_status.py | 4 +- .../gscoordinator/flex}/models/long_text.py | 4 +- .../gscoordinator/flex}/models/node_status.py | 4 +- .../gscoordinator/flex}/models/parameter.py | 8 +- .../flex}/models/primitive_type.py | 4 +- .../flex}/models/running_deployment_info.py | 4 +- .../flex}/models/running_deployment_status.py | 8 +- .../running_deployment_status_nodes_inner.py | 8 +- .../flex}/models/schema_mapping.py | 12 +- .../flex}/models/service_status.py | 8 +- .../models/service_status_sdk_endpoints.py | 4 +- .../flex}/models/start_service_request.py | 4 +- .../flex}/models/stored_procedure_meta.py | 8 +- .../gscoordinator/flex}/models/string_type.py | 8 +- .../flex}/models/string_type_string.py | 8 +- .../update_alert_message_status_request.py | 4 +- .../models/update_stored_proc_request.py | 4 +- .../flex}/models/upload_file_response.py | 4 +- .../flex}/models/vertex_mapping.py | 8 +- .../gscoordinator/flex}/openapi/openapi.yaml | 94 ++++----- .../gscoordinator/flex}/typing_utils.py | 0 .../gscoordinator/flex}/util.py | 2 +- coordinator/pyproject.toml | 15 +- coordinator/requirements.txt | 11 + coordinator/setup.cfg | 7 +- coordinator/setup.py | 71 +++++++ flex/coordinator/.dockerignore | 72 ------- flex/coordinator/.gitignore | 66 ------ flex/coordinator/.openapi-generator-ignore | 27 --- flex/coordinator/.openapi-generator/FILES | 73 ------- flex/coordinator/.openapi-generator/VERSION | 1 - flex/coordinator/.travis.yml | 14 -- flex/coordinator/Dockerfile | 16 -- flex/coordinator/README.md | 49 ----- flex/coordinator/git_push.sh | 57 ----- flex/coordinator/gs_flex_coordinator/VERSION | 1 - .../gs_flex_coordinator/__init__.py | 0 .../gs_flex_coordinator/__main__.py | 19 -- .../controllers/__init__.py | 0 .../gs_flex_coordinator/models/__init__.py | 58 ------ .../gs_flex_coordinator/test/__init__.py | 16 -- .../test/test_alert_controller.py | 195 ------------------ .../test/test_data_source_controller.py | 82 -------- .../test/test_deployment_controller.py | 30 --- .../test/test_graph_controller.py | 190 ----------------- .../test/test_job_controller.py | 96 --------- .../test/test_procedure_controller.py | 101 --------- .../test/test_service_controller.py | 80 ------- .../test/test_stored_procedure_controller.py | 101 --------- .../test/test_utils_controller.py | 35 ---- .../gs_flex_coordinator/version.py | 32 --- flex/coordinator/pyproject.toml | 2 - flex/coordinator/requirements.txt | 12 -- flex/coordinator/setup.cfg | 8 - flex/coordinator/setup.py | 138 ------------- flex/coordinator/test-requirements.txt | 4 - flex/coordinator/tox.ini | 11 - flex/openapi/openapi_coordinator.yaml | 10 +- python/graphscope/config.py | 2 + 131 files changed, 614 insertions(+), 1996 deletions(-) create mode 100644 coordinator/gscoordinator/flex/__init__.py create mode 100644 coordinator/gscoordinator/flex/controllers/__init__.py rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/controllers/alert_controller.py (85%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/controllers/data_source_controller.py (87%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/controllers/deployment_controller.py (63%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/controllers/graph_controller.py (83%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/controllers/job_controller.py (80%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/controllers/security_controller.py (100%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/controllers/service_controller.py (81%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/controllers/stored_procedure_controller.py (82%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/controllers/utils_controller.py (58%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/core/__init__.py (83%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/core/alert/__init__.py (90%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/core/alert/alert_manager.py (92%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/core/alert/alert_message.py (97%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/core/alert/alert_receiver.py (95%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/core/alert/alert_rule.py (96%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/core/alert/builtin_rules.py (93%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/core/alert/message_collector.py (95%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/core/client_wrapper.py (86%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/core/config.py (100%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/core/datasource.py (99%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/core/insight/__init__.py (90%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/core/insight/graph.py (93%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/core/insight/groot.py (100%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/core/insight/job.py (97%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/core/interactive/__init__.py (90%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/core/interactive/hqps.py (97%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/core/scheduler.py (98%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/core/stoppable_thread.py (100%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/core/utils.py (100%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/encoder.py (90%) create mode 100644 coordinator/gscoordinator/flex/models/__init__.py rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/base_edge_type.py (92%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/base_edge_type_vertex_type_pair_relations_inner.py (93%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/base_edge_type_vertex_type_pair_relations_inner_x_csr_params.py (96%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/base_model.py (98%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/base_property_meta.py (95%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/base_vertex_type.py (92%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/base_vertex_type_x_csr_params.py (94%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/column_mapping.py (90%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/column_mapping_column.py (95%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/create_alert_receiver_request.py (98%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/create_alert_rule_request.py (98%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/create_dataloading_job_response.py (94%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/create_edge_type.py (92%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/create_graph_request.py (89%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/create_graph_response.py (94%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/create_graph_schema_request.py (87%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/create_property_meta.py (95%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/create_stored_proc_request.py (97%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/create_stored_proc_response.py (95%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/create_vertex_type.py (91%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/dataloading_job_config.py (87%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/dataloading_job_config_edges_inner.py (97%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/dataloading_job_config_loading_config.py (89%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/dataloading_job_config_loading_config_format.py (96%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/dataloading_job_config_vertices_inner.py (94%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/edge_mapping.py (93%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/edge_mapping_type_triplet.py (97%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/error.py (96%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/get_alert_message_response.py (98%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/get_alert_receiver_response.py (98%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/get_alert_rule_response.py (98%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/get_edge_type.py (93%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/get_graph_response.py (95%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/get_graph_schema_response.py (88%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/get_property_meta.py (96%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/get_stored_proc_response.py (97%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/get_vertex_type.py (92%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/gs_data_type.py (83%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/job_status.py (98%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/long_text.py (94%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/node_status.py (97%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/parameter.py (90%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/primitive_type.py (95%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/running_deployment_info.py (98%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/running_deployment_status.py (89%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/running_deployment_status_nodes_inner.py (95%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/schema_mapping.py (88%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/service_status.py (93%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/service_status_sdk_endpoints.py (97%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/start_service_request.py (94%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/stored_procedure_meta.py (96%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/string_type.py (86%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/string_type_string.py (88%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/update_alert_message_status_request.py (96%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/update_stored_proc_request.py (94%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/upload_file_response.py (94%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/models/vertex_mapping.py (93%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/openapi/openapi.yaml (96%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/typing_utils.py (100%) rename {flex/coordinator/gs_flex_coordinator => coordinator/gscoordinator/flex}/util.py (98%) delete mode 100644 flex/coordinator/.dockerignore delete mode 100644 flex/coordinator/.gitignore delete mode 100644 flex/coordinator/.openapi-generator-ignore delete mode 100644 flex/coordinator/.openapi-generator/FILES delete mode 100644 flex/coordinator/.openapi-generator/VERSION delete mode 100644 flex/coordinator/.travis.yml delete mode 100644 flex/coordinator/Dockerfile delete mode 100644 flex/coordinator/README.md delete mode 100644 flex/coordinator/git_push.sh delete mode 120000 flex/coordinator/gs_flex_coordinator/VERSION delete mode 100644 flex/coordinator/gs_flex_coordinator/__init__.py delete mode 100644 flex/coordinator/gs_flex_coordinator/__main__.py delete mode 100644 flex/coordinator/gs_flex_coordinator/controllers/__init__.py delete mode 100644 flex/coordinator/gs_flex_coordinator/models/__init__.py delete mode 100644 flex/coordinator/gs_flex_coordinator/test/__init__.py delete mode 100644 flex/coordinator/gs_flex_coordinator/test/test_alert_controller.py delete mode 100644 flex/coordinator/gs_flex_coordinator/test/test_data_source_controller.py delete mode 100644 flex/coordinator/gs_flex_coordinator/test/test_deployment_controller.py delete mode 100644 flex/coordinator/gs_flex_coordinator/test/test_graph_controller.py delete mode 100644 flex/coordinator/gs_flex_coordinator/test/test_job_controller.py delete mode 100644 flex/coordinator/gs_flex_coordinator/test/test_procedure_controller.py delete mode 100644 flex/coordinator/gs_flex_coordinator/test/test_service_controller.py delete mode 100644 flex/coordinator/gs_flex_coordinator/test/test_stored_procedure_controller.py delete mode 100644 flex/coordinator/gs_flex_coordinator/test/test_utils_controller.py delete mode 100644 flex/coordinator/gs_flex_coordinator/version.py delete mode 100644 flex/coordinator/pyproject.toml delete mode 100644 flex/coordinator/requirements.txt delete mode 100644 flex/coordinator/setup.cfg delete mode 100644 flex/coordinator/setup.py delete mode 100644 flex/coordinator/test-requirements.txt delete mode 100644 flex/coordinator/tox.ini diff --git a/coordinator/gscoordinator/coordinator.py b/coordinator/gscoordinator/coordinator.py index 90e855a11808..e3435617dbff 100644 --- a/coordinator/gscoordinator/coordinator.py +++ b/coordinator/gscoordinator/coordinator.py @@ -26,10 +26,12 @@ import sys from concurrent import futures +import connexion import grpc from graphscope.config import Config from graphscope.proto import coordinator_service_pb2_grpc +from gscoordinator.flex.encoder import JSONEncoder from gscoordinator.monitor import Monitor from gscoordinator.servicer import init_graphscope_one_service_servicer from gscoordinator.utils import GS_GRPC_MAX_MESSAGE_LENGTH @@ -144,6 +146,16 @@ def start_server( server.start() + # OpenApi server + app = connexion.App(__name__, specification_dir="./flex/openapi/") + app.app.json_encoder = JSONEncoder + app.add_api( + "openapi.yaml", + arguments={"title": "GraphScope FLEX HTTP SERVICE API"}, + pythonic_params=True, + ) + app.run(port=config.coordinator.http_port) + if config.coordinator.monitor: try: Monitor.startServer(config.coordinator.monitor_port, "127.0.0.1") diff --git a/coordinator/gscoordinator/flex/__init__.py b/coordinator/gscoordinator/flex/__init__.py new file mode 100644 index 000000000000..9a4b5a1c36b9 --- /dev/null +++ b/coordinator/gscoordinator/flex/__init__.py @@ -0,0 +1,17 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Copyright 2020 Alibaba Group Holding Limited. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/coordinator/gscoordinator/flex/controllers/__init__.py b/coordinator/gscoordinator/flex/controllers/__init__.py new file mode 100644 index 000000000000..9a4b5a1c36b9 --- /dev/null +++ b/coordinator/gscoordinator/flex/controllers/__init__.py @@ -0,0 +1,17 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Copyright 2020 Alibaba Group Holding Limited. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/flex/coordinator/gs_flex_coordinator/controllers/alert_controller.py b/coordinator/gscoordinator/flex/controllers/alert_controller.py similarity index 85% rename from flex/coordinator/gs_flex_coordinator/controllers/alert_controller.py rename to coordinator/gscoordinator/flex/controllers/alert_controller.py index d20c65bb8ea2..33cf91a99565 100644 --- a/flex/coordinator/gs_flex_coordinator/controllers/alert_controller.py +++ b/coordinator/gscoordinator/flex/controllers/alert_controller.py @@ -3,14 +3,14 @@ from typing import Tuple from typing import Union -from gs_flex_coordinator.models.create_alert_receiver_request import CreateAlertReceiverRequest # noqa: E501 -from gs_flex_coordinator.models.create_alert_rule_request import CreateAlertRuleRequest # noqa: E501 -from gs_flex_coordinator.models.error import Error # noqa: E501 -from gs_flex_coordinator.models.get_alert_message_response import GetAlertMessageResponse # noqa: E501 -from gs_flex_coordinator.models.get_alert_receiver_response import GetAlertReceiverResponse # noqa: E501 -from gs_flex_coordinator.models.get_alert_rule_response import GetAlertRuleResponse # noqa: E501 -from gs_flex_coordinator.models.update_alert_message_status_request import UpdateAlertMessageStatusRequest # noqa: E501 -from gs_flex_coordinator import util +from gscoordinator.flex.models.create_alert_receiver_request import CreateAlertReceiverRequest # noqa: E501 +from gscoordinator.flex.models.create_alert_rule_request import CreateAlertRuleRequest # noqa: E501 +from gscoordinator.flex.models.error import Error # noqa: E501 +from gscoordinator.flex.models.get_alert_message_response import GetAlertMessageResponse # noqa: E501 +from gscoordinator.flex.models.get_alert_receiver_response import GetAlertReceiverResponse # noqa: E501 +from gscoordinator.flex.models.get_alert_rule_response import GetAlertRuleResponse # noqa: E501 +from gscoordinator.flex.models.update_alert_message_status_request import UpdateAlertMessageStatusRequest # noqa: E501 +from gscoordinator.flex import util def create_alert_receiver(create_alert_receiver_request): # noqa: E501 diff --git a/flex/coordinator/gs_flex_coordinator/controllers/data_source_controller.py b/coordinator/gscoordinator/flex/controllers/data_source_controller.py similarity index 87% rename from flex/coordinator/gs_flex_coordinator/controllers/data_source_controller.py rename to coordinator/gscoordinator/flex/controllers/data_source_controller.py index 5d485a77455c..792d6e5a11df 100644 --- a/flex/coordinator/gs_flex_coordinator/controllers/data_source_controller.py +++ b/coordinator/gscoordinator/flex/controllers/data_source_controller.py @@ -3,12 +3,12 @@ from typing import Tuple from typing import Union -from gs_flex_coordinator.models.error import Error # noqa: E501 -from gs_flex_coordinator.models.schema_mapping import SchemaMapping # noqa: E501 -from gs_flex_coordinator import util +from gscoordinator.flex.models.error import Error # noqa: E501 +from gscoordinator.flex.models.schema_mapping import SchemaMapping # noqa: E501 +from gscoordinator.flex import util -from gs_flex_coordinator.core import client_wrapper -from gs_flex_coordinator.core import handle_api_exception +from gscoordinator.flex.core import client_wrapper +from gscoordinator.flex.core import handle_api_exception @handle_api_exception() diff --git a/flex/coordinator/gs_flex_coordinator/controllers/deployment_controller.py b/coordinator/gscoordinator/flex/controllers/deployment_controller.py similarity index 63% rename from flex/coordinator/gs_flex_coordinator/controllers/deployment_controller.py rename to coordinator/gscoordinator/flex/controllers/deployment_controller.py index 0a8998018be1..74ffb8108830 100644 --- a/flex/coordinator/gs_flex_coordinator/controllers/deployment_controller.py +++ b/coordinator/gscoordinator/flex/controllers/deployment_controller.py @@ -3,13 +3,13 @@ from typing import Tuple from typing import Union -from gs_flex_coordinator.models.error import Error # noqa: E501 -from gs_flex_coordinator.models.running_deployment_info import RunningDeploymentInfo # noqa: E501 -from gs_flex_coordinator.models.running_deployment_status import RunningDeploymentStatus # noqa: E501 -from gs_flex_coordinator import util +from gscoordinator.flex.models.error import Error # noqa: E501 +from gscoordinator.flex.models.running_deployment_info import RunningDeploymentInfo # noqa: E501 +from gscoordinator.flex.models.running_deployment_status import RunningDeploymentStatus # noqa: E501 +from gscoordinator.flex import util -from gs_flex_coordinator.core import client_wrapper -from gs_flex_coordinator.core import handle_api_exception +from gscoordinator.flex.core import client_wrapper +from gscoordinator.flex.core import handle_api_exception @handle_api_exception() diff --git a/flex/coordinator/gs_flex_coordinator/controllers/graph_controller.py b/coordinator/gscoordinator/flex/controllers/graph_controller.py similarity index 83% rename from flex/coordinator/gs_flex_coordinator/controllers/graph_controller.py rename to coordinator/gscoordinator/flex/controllers/graph_controller.py index 4785c64454cd..717c5754ceb5 100644 --- a/flex/coordinator/gs_flex_coordinator/controllers/graph_controller.py +++ b/coordinator/gscoordinator/flex/controllers/graph_controller.py @@ -3,18 +3,18 @@ from typing import Tuple from typing import Union -from gs_flex_coordinator.models.create_edge_type import CreateEdgeType # noqa: E501 -from gs_flex_coordinator.models.create_graph_request import CreateGraphRequest # noqa: E501 -from gs_flex_coordinator.models.create_graph_response import CreateGraphResponse # noqa: E501 -from gs_flex_coordinator.models.create_graph_schema_request import CreateGraphSchemaRequest # noqa: E501 -from gs_flex_coordinator.models.create_vertex_type import CreateVertexType # noqa: E501 -from gs_flex_coordinator.models.error import Error # noqa: E501 -from gs_flex_coordinator.models.get_graph_response import GetGraphResponse # noqa: E501 -from gs_flex_coordinator.models.get_graph_schema_response import GetGraphSchemaResponse # noqa: E501 -from gs_flex_coordinator import util - -from gs_flex_coordinator.core import client_wrapper -from gs_flex_coordinator.core import handle_api_exception +from gscoordinator.flex.models.create_edge_type import CreateEdgeType # noqa: E501 +from gscoordinator.flex.models.create_graph_request import CreateGraphRequest # noqa: E501 +from gscoordinator.flex.models.create_graph_response import CreateGraphResponse # noqa: E501 +from gscoordinator.flex.models.create_graph_schema_request import CreateGraphSchemaRequest # noqa: E501 +from gscoordinator.flex.models.create_vertex_type import CreateVertexType # noqa: E501 +from gscoordinator.flex.models.error import Error # noqa: E501 +from gscoordinator.flex.models.get_graph_response import GetGraphResponse # noqa: E501 +from gscoordinator.flex.models.get_graph_schema_response import GetGraphSchemaResponse # noqa: E501 +from gscoordinator.flex import util + +from gscoordinator.flex.core import client_wrapper +from gscoordinator.flex.core import handle_api_exception def create_edge_type(graph_id, create_edge_type=None): # noqa: E501 diff --git a/flex/coordinator/gs_flex_coordinator/controllers/job_controller.py b/coordinator/gscoordinator/flex/controllers/job_controller.py similarity index 80% rename from flex/coordinator/gs_flex_coordinator/controllers/job_controller.py rename to coordinator/gscoordinator/flex/controllers/job_controller.py index 0373efcd34c0..d520b118658d 100644 --- a/flex/coordinator/gs_flex_coordinator/controllers/job_controller.py +++ b/coordinator/gscoordinator/flex/controllers/job_controller.py @@ -3,14 +3,14 @@ from typing import Tuple from typing import Union -from gs_flex_coordinator.models.create_dataloading_job_response import CreateDataloadingJobResponse # noqa: E501 -from gs_flex_coordinator.models.dataloading_job_config import DataloadingJobConfig # noqa: E501 -from gs_flex_coordinator.models.error import Error # noqa: E501 -from gs_flex_coordinator.models.job_status import JobStatus # noqa: E501 -from gs_flex_coordinator import util - -from gs_flex_coordinator.core import client_wrapper -from gs_flex_coordinator.core import handle_api_exception +from gscoordinator.flex.models.create_dataloading_job_response import CreateDataloadingJobResponse # noqa: E501 +from gscoordinator.flex.models.dataloading_job_config import DataloadingJobConfig # noqa: E501 +from gscoordinator.flex.models.error import Error # noqa: E501 +from gscoordinator.flex.models.job_status import JobStatus # noqa: E501 +from gscoordinator.flex import util + +from gscoordinator.flex.core import client_wrapper +from gscoordinator.flex.core import handle_api_exception @handle_api_exception() diff --git a/flex/coordinator/gs_flex_coordinator/controllers/security_controller.py b/coordinator/gscoordinator/flex/controllers/security_controller.py similarity index 100% rename from flex/coordinator/gs_flex_coordinator/controllers/security_controller.py rename to coordinator/gscoordinator/flex/controllers/security_controller.py diff --git a/flex/coordinator/gs_flex_coordinator/controllers/service_controller.py b/coordinator/gscoordinator/flex/controllers/service_controller.py similarity index 81% rename from flex/coordinator/gs_flex_coordinator/controllers/service_controller.py rename to coordinator/gscoordinator/flex/controllers/service_controller.py index 324b4905262c..4d38a869eb56 100644 --- a/flex/coordinator/gs_flex_coordinator/controllers/service_controller.py +++ b/coordinator/gscoordinator/flex/controllers/service_controller.py @@ -3,13 +3,13 @@ from typing import Tuple from typing import Union -from gs_flex_coordinator.models.error import Error # noqa: E501 -from gs_flex_coordinator.models.service_status import ServiceStatus # noqa: E501 -from gs_flex_coordinator.models.start_service_request import StartServiceRequest # noqa: E501 -from gs_flex_coordinator import util +from gscoordinator.flex.models.error import Error # noqa: E501 +from gscoordinator.flex.models.service_status import ServiceStatus # noqa: E501 +from gscoordinator.flex.models.start_service_request import StartServiceRequest # noqa: E501 +from gscoordinator.flex import util -from gs_flex_coordinator.core import client_wrapper -from gs_flex_coordinator.core import handle_api_exception +from gscoordinator.flex.core import client_wrapper +from gscoordinator.flex.core import handle_api_exception def get_service_status_by_id(graph_id): # noqa: E501 diff --git a/flex/coordinator/gs_flex_coordinator/controllers/stored_procedure_controller.py b/coordinator/gscoordinator/flex/controllers/stored_procedure_controller.py similarity index 82% rename from flex/coordinator/gs_flex_coordinator/controllers/stored_procedure_controller.py rename to coordinator/gscoordinator/flex/controllers/stored_procedure_controller.py index 5ca12e47060f..9410963119af 100644 --- a/flex/coordinator/gs_flex_coordinator/controllers/stored_procedure_controller.py +++ b/coordinator/gscoordinator/flex/controllers/stored_procedure_controller.py @@ -3,15 +3,15 @@ from typing import Tuple from typing import Union -from gs_flex_coordinator.models.create_stored_proc_request import CreateStoredProcRequest # noqa: E501 -from gs_flex_coordinator.models.create_stored_proc_response import CreateStoredProcResponse # noqa: E501 -from gs_flex_coordinator.models.error import Error # noqa: E501 -from gs_flex_coordinator.models.get_stored_proc_response import GetStoredProcResponse # noqa: E501 -from gs_flex_coordinator.models.update_stored_proc_request import UpdateStoredProcRequest # noqa: E501 -from gs_flex_coordinator import util - -from gs_flex_coordinator.core import client_wrapper -from gs_flex_coordinator.core import handle_api_exception +from gscoordinator.flex.models.create_stored_proc_request import CreateStoredProcRequest # noqa: E501 +from gscoordinator.flex.models.create_stored_proc_response import CreateStoredProcResponse # noqa: E501 +from gscoordinator.flex.models.error import Error # noqa: E501 +from gscoordinator.flex.models.get_stored_proc_response import GetStoredProcResponse # noqa: E501 +from gscoordinator.flex.models.update_stored_proc_request import UpdateStoredProcRequest # noqa: E501 +from gscoordinator.flex import util + +from gscoordinator.flex.core import client_wrapper +from gscoordinator.flex.core import handle_api_exception @handle_api_exception() diff --git a/flex/coordinator/gs_flex_coordinator/controllers/utils_controller.py b/coordinator/gscoordinator/flex/controllers/utils_controller.py similarity index 58% rename from flex/coordinator/gs_flex_coordinator/controllers/utils_controller.py rename to coordinator/gscoordinator/flex/controllers/utils_controller.py index 21ded4824eff..731bdb5f8645 100644 --- a/flex/coordinator/gs_flex_coordinator/controllers/utils_controller.py +++ b/coordinator/gscoordinator/flex/controllers/utils_controller.py @@ -3,12 +3,12 @@ from typing import Tuple from typing import Union -from gs_flex_coordinator.models.error import Error # noqa: E501 -from gs_flex_coordinator.models.upload_file_response import UploadFileResponse # noqa: E501 -from gs_flex_coordinator import util +from gscoordinator.flex.models.error import Error # noqa: E501 +from gscoordinator.flex.models.upload_file_response import UploadFileResponse # noqa: E501 +from gscoordinator.flex import util -from gs_flex_coordinator.core import client_wrapper -from gs_flex_coordinator.core import handle_api_exception +from gscoordinator.flex.core import client_wrapper +from gscoordinator.flex.core import handle_api_exception @handle_api_exception() diff --git a/flex/coordinator/gs_flex_coordinator/core/__init__.py b/coordinator/gscoordinator/flex/core/__init__.py similarity index 83% rename from flex/coordinator/gs_flex_coordinator/core/__init__.py rename to coordinator/gscoordinator/flex/core/__init__.py index b065ec847e9d..571f62592452 100644 --- a/flex/coordinator/gs_flex_coordinator/core/__init__.py +++ b/coordinator/gscoordinator/flex/core/__init__.py @@ -27,5 +27,5 @@ level=logging.INFO, ) -from gs_flex_coordinator.core.client_wrapper import client_wrapper # noqa: F401, E402 -from gs_flex_coordinator.core.utils import handle_api_exception # noqa: F401, E402 +from gscoordinator.flex.core.client_wrapper import client_wrapper # noqa: F401, E402 +from gscoordinator.flex.core.utils import handle_api_exception # noqa: F401, E402 diff --git a/flex/coordinator/gs_flex_coordinator/core/alert/__init__.py b/coordinator/gscoordinator/flex/core/alert/__init__.py similarity index 90% rename from flex/coordinator/gs_flex_coordinator/core/alert/__init__.py rename to coordinator/gscoordinator/flex/core/alert/__init__.py index 47d9375d1932..411f56079e38 100644 --- a/flex/coordinator/gs_flex_coordinator/core/alert/__init__.py +++ b/coordinator/gscoordinator/flex/core/alert/__init__.py @@ -16,4 +16,4 @@ # limitations under the License. # -from gs_flex_coordinator.core.alert.alert_manager import alert_manager +from gscoordinator.flex.core.alert.alert_manager import alert_manager diff --git a/flex/coordinator/gs_flex_coordinator/core/alert/alert_manager.py b/coordinator/gscoordinator/flex/core/alert/alert_manager.py similarity index 92% rename from flex/coordinator/gs_flex_coordinator/core/alert/alert_manager.py rename to coordinator/gscoordinator/flex/core/alert/alert_manager.py index 188813cfcd59..f527d4d104de 100644 --- a/flex/coordinator/gs_flex_coordinator/core/alert/alert_manager.py +++ b/coordinator/gscoordinator/flex/core/alert/alert_manager.py @@ -23,16 +23,16 @@ from typing import List from typing import Union -from gs_flex_coordinator.core.alert.alert_receiver import DingTalkReceiver -from gs_flex_coordinator.core.alert.builtin_rules import init_builtin_alert_rules -from gs_flex_coordinator.core.alert.message_collector import AlertMessageCollector -from gs_flex_coordinator.core.config import ALERT_WORKSPACE -from gs_flex_coordinator.core.scheduler import schedule -from gs_flex_coordinator.core.utils import decode_datetimestr -from gs_flex_coordinator.core.utils import encode_datetime -from gs_flex_coordinator.models import AlertMessage -from gs_flex_coordinator.models import AlertReceiver -from gs_flex_coordinator.models import AlertRule +from gscoordinator.flex.core.alert.alert_receiver import DingTalkReceiver +from gscoordinator.flex.core.alert.builtin_rules import init_builtin_alert_rules +from gscoordinator.flex.core.alert.message_collector import AlertMessageCollector +from gscoordinator.flex.core.config import ALERT_WORKSPACE +from gscoordinator.flex.core.scheduler import schedule +from gscoordinator.flex.core.utils import decode_datetimestr +from gscoordinator.flex.core.utils import encode_datetime +from gscoordinator.flex.models import AlertMessage +from gscoordinator.flex.models import AlertReceiver +from gscoordinator.flex.models import AlertRule class AlertManager(object): diff --git a/flex/coordinator/gs_flex_coordinator/core/alert/alert_message.py b/coordinator/gscoordinator/flex/core/alert/alert_message.py similarity index 97% rename from flex/coordinator/gs_flex_coordinator/core/alert/alert_message.py rename to coordinator/gscoordinator/flex/core/alert/alert_message.py index 95da5e91de35..2022ebd3d31c 100644 --- a/flex/coordinator/gs_flex_coordinator/core/alert/alert_message.py +++ b/coordinator/gscoordinator/flex/core/alert/alert_message.py @@ -18,7 +18,7 @@ import datetime -from gs_flex_coordinator.core.utils import encode_datetime +from gscoordinator.flex.core.utils import encode_datetime class AlertMessage(object): diff --git a/flex/coordinator/gs_flex_coordinator/core/alert/alert_receiver.py b/coordinator/gscoordinator/flex/core/alert/alert_receiver.py similarity index 95% rename from flex/coordinator/gs_flex_coordinator/core/alert/alert_receiver.py rename to coordinator/gscoordinator/flex/core/alert/alert_receiver.py index 1e066495e84f..b4430b8385c3 100644 --- a/flex/coordinator/gs_flex_coordinator/core/alert/alert_receiver.py +++ b/coordinator/gscoordinator/flex/core/alert/alert_receiver.py @@ -21,9 +21,9 @@ import requests -from gs_flex_coordinator.core.alert.alert_message import AlertMessage -from gs_flex_coordinator.core.config import INSTANCE_NAME -from gs_flex_coordinator.core.utils import random_string +from gscoordinator.flex.core.alert.alert_message import AlertMessage +from gscoordinator.flex.core.config import INSTANCE_NAME +from gscoordinator.flex.core.utils import random_string class DingTalkReceiver(object): diff --git a/flex/coordinator/gs_flex_coordinator/core/alert/alert_rule.py b/coordinator/gscoordinator/flex/core/alert/alert_rule.py similarity index 96% rename from flex/coordinator/gs_flex_coordinator/core/alert/alert_rule.py rename to coordinator/gscoordinator/flex/core/alert/alert_rule.py index 6c1597e9c3fe..fcdd0c2ea7fa 100644 --- a/flex/coordinator/gs_flex_coordinator/core/alert/alert_rule.py +++ b/coordinator/gscoordinator/flex/core/alert/alert_rule.py @@ -21,9 +21,9 @@ from abc import ABCMeta from abc import abstractmethod -from gs_flex_coordinator.core.alert.alert_message import AlertMessage -from gs_flex_coordinator.core.scheduler import cancel_job -from gs_flex_coordinator.core.scheduler import schedule +from gscoordinator.flex.core.alert.alert_message import AlertMessage +from gscoordinator.flex.core.scheduler import cancel_job +from gscoordinator.flex.core.scheduler import schedule class AlertRule(metaclass=ABCMeta): diff --git a/flex/coordinator/gs_flex_coordinator/core/alert/builtin_rules.py b/coordinator/gscoordinator/flex/core/alert/builtin_rules.py similarity index 93% rename from flex/coordinator/gs_flex_coordinator/core/alert/builtin_rules.py rename to coordinator/gscoordinator/flex/core/alert/builtin_rules.py index eb3516e3fbdc..b45ada8fc329 100644 --- a/flex/coordinator/gs_flex_coordinator/core/alert/builtin_rules.py +++ b/coordinator/gscoordinator/flex/core/alert/builtin_rules.py @@ -23,11 +23,11 @@ import psutil from gremlin_python.driver.client import Client -from gs_flex_coordinator.core import client_wrapper -from gs_flex_coordinator.core.alert.alert_rule import AlertRule -from gs_flex_coordinator.core.alert.message_collector import AlertMessageCollector -from gs_flex_coordinator.core.config import CLUSTER_TYPE -from gs_flex_coordinator.core.config import SOLUTION +from gscoordinator.flex.core import client_wrapper +from gscoordinator.flex.core.alert.alert_rule import AlertRule +from gscoordinator.flex.core.alert.message_collector import AlertMessageCollector +from gscoordinator.flex.core.config import CLUSTER_TYPE +from gscoordinator.flex.core.config import SOLUTION class HighDiskUtilizationAlert(AlertRule): diff --git a/flex/coordinator/gs_flex_coordinator/core/alert/message_collector.py b/coordinator/gscoordinator/flex/core/alert/message_collector.py similarity index 95% rename from flex/coordinator/gs_flex_coordinator/core/alert/message_collector.py rename to coordinator/gscoordinator/flex/core/alert/message_collector.py index c8246adf1c21..a6a990db4f10 100644 --- a/flex/coordinator/gs_flex_coordinator/core/alert/message_collector.py +++ b/coordinator/gscoordinator/flex/core/alert/message_collector.py @@ -21,11 +21,11 @@ import os import pickle -from gs_flex_coordinator.core.alert.alert_message import AlertMessage -from gs_flex_coordinator.core.config import ALERT_WORKSPACE -from gs_flex_coordinator.core.scheduler import cancel_job -from gs_flex_coordinator.core.scheduler import schedule -from gs_flex_coordinator.core.utils import decode_datetimestr +from gscoordinator.flex.core.alert.alert_message import AlertMessage +from gscoordinator.flex.core.config import ALERT_WORKSPACE +from gscoordinator.flex.core.scheduler import cancel_job +from gscoordinator.flex.core.scheduler import schedule +from gscoordinator.flex.core.utils import decode_datetimestr class OneDayAlertMessageCollector(object): diff --git a/flex/coordinator/gs_flex_coordinator/core/client_wrapper.py b/coordinator/gscoordinator/flex/core/client_wrapper.py similarity index 86% rename from flex/coordinator/gs_flex_coordinator/core/client_wrapper.py rename to coordinator/gscoordinator/flex/core/client_wrapper.py index 495609f2bcca..72dac4a06af5 100644 --- a/flex/coordinator/gs_flex_coordinator/core/client_wrapper.py +++ b/coordinator/gscoordinator/flex/core/client_wrapper.py @@ -24,38 +24,38 @@ import psutil -from gs_flex_coordinator.core.config import CLUSTER_TYPE -from gs_flex_coordinator.core.config import CREATION_TIME -from gs_flex_coordinator.core.config import DATASET_WORKSPACE -from gs_flex_coordinator.core.config import ENGINE_TYPE -from gs_flex_coordinator.core.config import FRONTEND_TYPE -from gs_flex_coordinator.core.config import INSTANCE_NAME -from gs_flex_coordinator.core.config import SOLUTION -from gs_flex_coordinator.core.config import STORAGE_TYPE -from gs_flex_coordinator.core.datasource import DataSourceManager -from gs_flex_coordinator.core.insight import init_groot_client -from gs_flex_coordinator.core.interactive import init_hqps_client -from gs_flex_coordinator.core.utils import encode_datetime -from gs_flex_coordinator.models import CreateDataloadingJobResponse -from gs_flex_coordinator.models import CreateEdgeType -from gs_flex_coordinator.models import CreateGraphRequest -from gs_flex_coordinator.models import CreateGraphResponse -from gs_flex_coordinator.models import CreateStoredProcRequest -from gs_flex_coordinator.models import CreateStoredProcResponse -from gs_flex_coordinator.models import CreateVertexType -from gs_flex_coordinator.models import DataloadingJobConfig -from gs_flex_coordinator.models import GetGraphResponse -from gs_flex_coordinator.models import GetGraphSchemaResponse -from gs_flex_coordinator.models import GetStoredProcResponse -from gs_flex_coordinator.models import JobStatus -from gs_flex_coordinator.models import RunningDeploymentInfo -from gs_flex_coordinator.models import RunningDeploymentStatus -from gs_flex_coordinator.models import SchemaMapping -from gs_flex_coordinator.models import ServiceStatus -from gs_flex_coordinator.models import StartServiceRequest -from gs_flex_coordinator.models import UpdateStoredProcRequest -from gs_flex_coordinator.models import UploadFileResponse -from gs_flex_coordinator.version import __version__ +from gscoordinator.flex.core.config import CLUSTER_TYPE +from gscoordinator.flex.core.config import CREATION_TIME +from gscoordinator.flex.core.config import DATASET_WORKSPACE +from gscoordinator.flex.core.config import ENGINE_TYPE +from gscoordinator.flex.core.config import FRONTEND_TYPE +from gscoordinator.flex.core.config import INSTANCE_NAME +from gscoordinator.flex.core.config import SOLUTION +from gscoordinator.flex.core.config import STORAGE_TYPE +from gscoordinator.flex.core.datasource import DataSourceManager +from gscoordinator.flex.core.insight import init_groot_client +from gscoordinator.flex.core.interactive import init_hqps_client +from gscoordinator.flex.core.utils import encode_datetime +from gscoordinator.flex.models import CreateDataloadingJobResponse +from gscoordinator.flex.models import CreateEdgeType +from gscoordinator.flex.models import CreateGraphRequest +from gscoordinator.flex.models import CreateGraphResponse +from gscoordinator.flex.models import CreateStoredProcRequest +from gscoordinator.flex.models import CreateStoredProcResponse +from gscoordinator.flex.models import CreateVertexType +from gscoordinator.flex.models import DataloadingJobConfig +from gscoordinator.flex.models import GetGraphResponse +from gscoordinator.flex.models import GetGraphSchemaResponse +from gscoordinator.flex.models import GetStoredProcResponse +from gscoordinator.flex.models import JobStatus +from gscoordinator.flex.models import RunningDeploymentInfo +from gscoordinator.flex.models import RunningDeploymentStatus +from gscoordinator.flex.models import SchemaMapping +from gscoordinator.flex.models import ServiceStatus +from gscoordinator.flex.models import StartServiceRequest +from gscoordinator.flex.models import UpdateStoredProcRequest +from gscoordinator.flex.models import UploadFileResponse +from gscoordinator.version import __version__ class ClientWrapper(object): diff --git a/flex/coordinator/gs_flex_coordinator/core/config.py b/coordinator/gscoordinator/flex/core/config.py similarity index 100% rename from flex/coordinator/gs_flex_coordinator/core/config.py rename to coordinator/gscoordinator/flex/core/config.py diff --git a/flex/coordinator/gs_flex_coordinator/core/datasource.py b/coordinator/gscoordinator/flex/core/datasource.py similarity index 99% rename from flex/coordinator/gs_flex_coordinator/core/datasource.py rename to coordinator/gscoordinator/flex/core/datasource.py index 2da5c7e01256..b328720f29cb 100644 --- a/flex/coordinator/gs_flex_coordinator/core/datasource.py +++ b/coordinator/gscoordinator/flex/core/datasource.py @@ -20,7 +20,7 @@ import os import pickle -from gs_flex_coordinator.core.config import WORKSPACE +from gscoordinator.flex.core.config import WORKSPACE class DataSourceManager(object): diff --git a/flex/coordinator/gs_flex_coordinator/core/insight/__init__.py b/coordinator/gscoordinator/flex/core/insight/__init__.py similarity index 90% rename from flex/coordinator/gs_flex_coordinator/core/insight/__init__.py rename to coordinator/gscoordinator/flex/core/insight/__init__.py index 099804e30dcb..96936ce0ef5a 100644 --- a/flex/coordinator/gs_flex_coordinator/core/insight/__init__.py +++ b/coordinator/gscoordinator/flex/core/insight/__init__.py @@ -16,4 +16,4 @@ # limitations under the License. # -from gs_flex_coordinator.core.insight.groot import init_groot_client +from gscoordinator.flex.core.insight.groot import init_groot_client diff --git a/flex/coordinator/gs_flex_coordinator/core/insight/graph.py b/coordinator/gscoordinator/flex/core/insight/graph.py similarity index 93% rename from flex/coordinator/gs_flex_coordinator/core/insight/graph.py rename to coordinator/gscoordinator/flex/core/insight/graph.py index 882e96899026..6d3c1d34a017 100644 --- a/flex/coordinator/gs_flex_coordinator/core/insight/graph.py +++ b/coordinator/gscoordinator/flex/core/insight/graph.py @@ -31,21 +31,21 @@ from kubernetes import client as kube_client from kubernetes import config as kube_config -from gs_flex_coordinator.core.config import CLUSTER_TYPE -from gs_flex_coordinator.core.config import CREATION_TIME -from gs_flex_coordinator.core.config import ENABLE_DNS -from gs_flex_coordinator.core.config import GROOT_GREMLIN_PORT -from gs_flex_coordinator.core.config import GROOT_GRPC_PORT -from gs_flex_coordinator.core.config import GROOT_PASSWORD -from gs_flex_coordinator.core.config import GROOT_USERNAME -from gs_flex_coordinator.core.config import INSTANCE_NAME -from gs_flex_coordinator.core.config import NAMESPACE -from gs_flex_coordinator.core.config import WORKSPACE -from gs_flex_coordinator.core.scheduler import schedule -from gs_flex_coordinator.core.utils import data_type_to_groot -from gs_flex_coordinator.core.utils import encode_datetime -from gs_flex_coordinator.core.utils import get_internal_ip -from gs_flex_coordinator.version import __version__ +from gscoordinator.flex.core.config import CLUSTER_TYPE +from gscoordinator.flex.core.config import CREATION_TIME +from gscoordinator.flex.core.config import ENABLE_DNS +from gscoordinator.flex.core.config import GROOT_GREMLIN_PORT +from gscoordinator.flex.core.config import GROOT_GRPC_PORT +from gscoordinator.flex.core.config import GROOT_PASSWORD +from gscoordinator.flex.core.config import GROOT_USERNAME +from gscoordinator.flex.core.config import INSTANCE_NAME +from gscoordinator.flex.core.config import NAMESPACE +from gscoordinator.flex.core.config import WORKSPACE +from gscoordinator.flex.core.scheduler import schedule +from gscoordinator.flex.core.utils import data_type_to_groot +from gscoordinator.flex.core.utils import encode_datetime +from gscoordinator.flex.core.utils import get_internal_ip +from gscoordinator.version import __version__ class Graph(metaclass=ABCMeta): diff --git a/flex/coordinator/gs_flex_coordinator/core/insight/groot.py b/coordinator/gscoordinator/flex/core/insight/groot.py similarity index 100% rename from flex/coordinator/gs_flex_coordinator/core/insight/groot.py rename to coordinator/gscoordinator/flex/core/insight/groot.py diff --git a/flex/coordinator/gs_flex_coordinator/core/insight/job.py b/coordinator/gscoordinator/flex/core/insight/job.py similarity index 97% rename from flex/coordinator/gs_flex_coordinator/core/insight/job.py rename to coordinator/gscoordinator/flex/core/insight/job.py index a69555fc09fb..ed07dcf0e019 100644 --- a/flex/coordinator/gs_flex_coordinator/core/insight/job.py +++ b/coordinator/gscoordinator/flex/core/insight/job.py @@ -20,10 +20,10 @@ from graphscope.framework.record import EdgeRecordKey from graphscope.framework.record import VertexRecordKey -from gs_flex_coordinator.core.scheduler import Scheduler -from gs_flex_coordinator.core.utils import encode_datetime -from gs_flex_coordinator.core.utils import get_current_time -from gs_flex_coordinator.models import JobStatus +from gscoordinator.flex.core.scheduler import Scheduler +from gscoordinator.flex.core.utils import encode_datetime +from gscoordinator.flex.core.utils import get_current_time +from gscoordinator.flex.models import JobStatus class DataloadingJobScheduler(Scheduler): diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/__init__.py b/coordinator/gscoordinator/flex/core/interactive/__init__.py similarity index 90% rename from flex/coordinator/gs_flex_coordinator/core/interactive/__init__.py rename to coordinator/gscoordinator/flex/core/interactive/__init__.py index 57b689a39c57..3bc4ddde0cb6 100644 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/__init__.py +++ b/coordinator/gscoordinator/flex/core/interactive/__init__.py @@ -19,4 +19,4 @@ import os import sys -from gs_flex_coordinator.core.interactive.hqps import init_hqps_client +from gscoordinator.flex.core.interactive.hqps import init_hqps_client diff --git a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps.py b/coordinator/gscoordinator/flex/core/interactive/hqps.py similarity index 97% rename from flex/coordinator/gs_flex_coordinator/core/interactive/hqps.py rename to coordinator/gscoordinator/flex/core/interactive/hqps.py index 29a4a83df172..52403b99042f 100644 --- a/flex/coordinator/gs_flex_coordinator/core/interactive/hqps.py +++ b/coordinator/gscoordinator/flex/core/interactive/hqps.py @@ -32,13 +32,13 @@ from interactive_sdk.openapi import StartServiceRequest from interactive_sdk.openapi import UpdateProcedureRequest -from gs_flex_coordinator.core.config import CLUSTER_TYPE -from gs_flex_coordinator.core.config import HQPS_ADMIN_SERVICE_PORT -from gs_flex_coordinator.core.config import WORKSPACE -from gs_flex_coordinator.core.datasource import DataSourceManager -from gs_flex_coordinator.core.utils import encode_datetime -from gs_flex_coordinator.core.utils import get_internal_ip -from gs_flex_coordinator.core.utils import get_public_ip +from gscoordinator.flex.core.config import CLUSTER_TYPE +from gscoordinator.flex.core.config import HQPS_ADMIN_SERVICE_PORT +from gscoordinator.flex.core.config import WORKSPACE +from gscoordinator.flex.core.datasource import DataSourceManager +from gscoordinator.flex.core.utils import encode_datetime +from gscoordinator.flex.core.utils import get_internal_ip +from gscoordinator.flex.core.utils import get_public_ip class HQPSClient(object): diff --git a/flex/coordinator/gs_flex_coordinator/core/scheduler.py b/coordinator/gscoordinator/flex/core/scheduler.py similarity index 98% rename from flex/coordinator/gs_flex_coordinator/core/scheduler.py rename to coordinator/gscoordinator/flex/core/scheduler.py index 1e7af5d85910..69dbfea6bc2f 100644 --- a/flex/coordinator/gs_flex_coordinator/core/scheduler.py +++ b/coordinator/gscoordinator/flex/core/scheduler.py @@ -26,8 +26,8 @@ import schedule from schedule import CancelJob -from gs_flex_coordinator.core.stoppable_thread import StoppableThread -from gs_flex_coordinator.core.utils import decode_datetimestr +from gscoordinator.flex.core.stoppable_thread import StoppableThread +from gscoordinator.flex.core.utils import decode_datetimestr class Schedule(object): diff --git a/flex/coordinator/gs_flex_coordinator/core/stoppable_thread.py b/coordinator/gscoordinator/flex/core/stoppable_thread.py similarity index 100% rename from flex/coordinator/gs_flex_coordinator/core/stoppable_thread.py rename to coordinator/gscoordinator/flex/core/stoppable_thread.py diff --git a/flex/coordinator/gs_flex_coordinator/core/utils.py b/coordinator/gscoordinator/flex/core/utils.py similarity index 100% rename from flex/coordinator/gs_flex_coordinator/core/utils.py rename to coordinator/gscoordinator/flex/core/utils.py diff --git a/flex/coordinator/gs_flex_coordinator/encoder.py b/coordinator/gscoordinator/flex/encoder.py similarity index 90% rename from flex/coordinator/gs_flex_coordinator/encoder.py rename to coordinator/gscoordinator/flex/encoder.py index 4cd8c4ad8fc0..e14d32c94bf9 100644 --- a/flex/coordinator/gs_flex_coordinator/encoder.py +++ b/coordinator/gscoordinator/flex/encoder.py @@ -1,6 +1,6 @@ from connexion.apps.flask_app import FlaskJSONEncoder -from gs_flex_coordinator.models.base_model import Model +from gscoordinator.flex.models.base_model import Model class JSONEncoder(FlaskJSONEncoder): diff --git a/coordinator/gscoordinator/flex/models/__init__.py b/coordinator/gscoordinator/flex/models/__init__.py new file mode 100644 index 000000000000..e44e6caadc4d --- /dev/null +++ b/coordinator/gscoordinator/flex/models/__init__.py @@ -0,0 +1,58 @@ +# flake8: noqa +# import models into model package +from gscoordinator.flex.models.base_edge_type import BaseEdgeType +from gscoordinator.flex.models.base_edge_type_vertex_type_pair_relations_inner import BaseEdgeTypeVertexTypePairRelationsInner +from gscoordinator.flex.models.base_edge_type_vertex_type_pair_relations_inner_x_csr_params import BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams +from gscoordinator.flex.models.base_property_meta import BasePropertyMeta +from gscoordinator.flex.models.base_vertex_type import BaseVertexType +from gscoordinator.flex.models.base_vertex_type_x_csr_params import BaseVertexTypeXCsrParams +from gscoordinator.flex.models.column_mapping import ColumnMapping +from gscoordinator.flex.models.column_mapping_column import ColumnMappingColumn +from gscoordinator.flex.models.create_alert_receiver_request import CreateAlertReceiverRequest +from gscoordinator.flex.models.create_alert_rule_request import CreateAlertRuleRequest +from gscoordinator.flex.models.create_dataloading_job_response import CreateDataloadingJobResponse +from gscoordinator.flex.models.create_edge_type import CreateEdgeType +from gscoordinator.flex.models.create_graph_request import CreateGraphRequest +from gscoordinator.flex.models.create_graph_response import CreateGraphResponse +from gscoordinator.flex.models.create_graph_schema_request import CreateGraphSchemaRequest +from gscoordinator.flex.models.create_property_meta import CreatePropertyMeta +from gscoordinator.flex.models.create_stored_proc_request import CreateStoredProcRequest +from gscoordinator.flex.models.create_stored_proc_response import CreateStoredProcResponse +from gscoordinator.flex.models.create_vertex_type import CreateVertexType +from gscoordinator.flex.models.dataloading_job_config import DataloadingJobConfig +from gscoordinator.flex.models.dataloading_job_config_edges_inner import DataloadingJobConfigEdgesInner +from gscoordinator.flex.models.dataloading_job_config_loading_config import DataloadingJobConfigLoadingConfig +from gscoordinator.flex.models.dataloading_job_config_loading_config_format import DataloadingJobConfigLoadingConfigFormat +from gscoordinator.flex.models.dataloading_job_config_vertices_inner import DataloadingJobConfigVerticesInner +from gscoordinator.flex.models.edge_mapping import EdgeMapping +from gscoordinator.flex.models.edge_mapping_type_triplet import EdgeMappingTypeTriplet +from gscoordinator.flex.models.error import Error +from gscoordinator.flex.models.gs_data_type import GSDataType +from gscoordinator.flex.models.get_alert_message_response import GetAlertMessageResponse +from gscoordinator.flex.models.get_alert_receiver_response import GetAlertReceiverResponse +from gscoordinator.flex.models.get_alert_rule_response import GetAlertRuleResponse +from gscoordinator.flex.models.get_edge_type import GetEdgeType +from gscoordinator.flex.models.get_graph_response import GetGraphResponse +from gscoordinator.flex.models.get_graph_schema_response import GetGraphSchemaResponse +from gscoordinator.flex.models.get_property_meta import GetPropertyMeta +from gscoordinator.flex.models.get_stored_proc_response import GetStoredProcResponse +from gscoordinator.flex.models.get_vertex_type import GetVertexType +from gscoordinator.flex.models.job_status import JobStatus +from gscoordinator.flex.models.long_text import LongText +from gscoordinator.flex.models.node_status import NodeStatus +from gscoordinator.flex.models.parameter import Parameter +from gscoordinator.flex.models.primitive_type import PrimitiveType +from gscoordinator.flex.models.running_deployment_info import RunningDeploymentInfo +from gscoordinator.flex.models.running_deployment_status import RunningDeploymentStatus +from gscoordinator.flex.models.running_deployment_status_nodes_inner import RunningDeploymentStatusNodesInner +from gscoordinator.flex.models.schema_mapping import SchemaMapping +from gscoordinator.flex.models.service_status import ServiceStatus +from gscoordinator.flex.models.service_status_sdk_endpoints import ServiceStatusSdkEndpoints +from gscoordinator.flex.models.start_service_request import StartServiceRequest +from gscoordinator.flex.models.stored_procedure_meta import StoredProcedureMeta +from gscoordinator.flex.models.string_type import StringType +from gscoordinator.flex.models.string_type_string import StringTypeString +from gscoordinator.flex.models.update_alert_message_status_request import UpdateAlertMessageStatusRequest +from gscoordinator.flex.models.update_stored_proc_request import UpdateStoredProcRequest +from gscoordinator.flex.models.upload_file_response import UploadFileResponse +from gscoordinator.flex.models.vertex_mapping import VertexMapping diff --git a/flex/coordinator/gs_flex_coordinator/models/base_edge_type.py b/coordinator/gscoordinator/flex/models/base_edge_type.py similarity index 92% rename from flex/coordinator/gs_flex_coordinator/models/base_edge_type.py rename to coordinator/gscoordinator/flex/models/base_edge_type.py index dcf91e83a4fa..60c4eb377885 100644 --- a/flex/coordinator/gs_flex_coordinator/models/base_edge_type.py +++ b/coordinator/gscoordinator/flex/models/base_edge_type.py @@ -2,11 +2,11 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.base_edge_type_vertex_type_pair_relations_inner import BaseEdgeTypeVertexTypePairRelationsInner -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.base_edge_type_vertex_type_pair_relations_inner import BaseEdgeTypeVertexTypePairRelationsInner +from gscoordinator.flex import util -from gs_flex_coordinator.models.base_edge_type_vertex_type_pair_relations_inner import BaseEdgeTypeVertexTypePairRelationsInner # noqa: E501 +from gscoordinator.flex.models.base_edge_type_vertex_type_pair_relations_inner import BaseEdgeTypeVertexTypePairRelationsInner # noqa: E501 class BaseEdgeType(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/models/base_edge_type_vertex_type_pair_relations_inner.py b/coordinator/gscoordinator/flex/models/base_edge_type_vertex_type_pair_relations_inner.py similarity index 93% rename from flex/coordinator/gs_flex_coordinator/models/base_edge_type_vertex_type_pair_relations_inner.py rename to coordinator/gscoordinator/flex/models/base_edge_type_vertex_type_pair_relations_inner.py index 8b8ea903f548..c052479e8f08 100644 --- a/flex/coordinator/gs_flex_coordinator/models/base_edge_type_vertex_type_pair_relations_inner.py +++ b/coordinator/gscoordinator/flex/models/base_edge_type_vertex_type_pair_relations_inner.py @@ -2,11 +2,11 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.base_edge_type_vertex_type_pair_relations_inner_x_csr_params import BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.base_edge_type_vertex_type_pair_relations_inner_x_csr_params import BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams +from gscoordinator.flex import util -from gs_flex_coordinator.models.base_edge_type_vertex_type_pair_relations_inner_x_csr_params import BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams # noqa: E501 +from gscoordinator.flex.models.base_edge_type_vertex_type_pair_relations_inner_x_csr_params import BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams # noqa: E501 class BaseEdgeTypeVertexTypePairRelationsInner(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/models/base_edge_type_vertex_type_pair_relations_inner_x_csr_params.py b/coordinator/gscoordinator/flex/models/base_edge_type_vertex_type_pair_relations_inner_x_csr_params.py similarity index 96% rename from flex/coordinator/gs_flex_coordinator/models/base_edge_type_vertex_type_pair_relations_inner_x_csr_params.py rename to coordinator/gscoordinator/flex/models/base_edge_type_vertex_type_pair_relations_inner_x_csr_params.py index f57d268f862f..365593b4d7dc 100644 --- a/flex/coordinator/gs_flex_coordinator/models/base_edge_type_vertex_type_pair_relations_inner_x_csr_params.py +++ b/coordinator/gscoordinator/flex/models/base_edge_type_vertex_type_pair_relations_inner_x_csr_params.py @@ -2,8 +2,8 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex import util class BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams(Model): diff --git a/flex/coordinator/gs_flex_coordinator/models/base_model.py b/coordinator/gscoordinator/flex/models/base_model.py similarity index 98% rename from flex/coordinator/gs_flex_coordinator/models/base_model.py rename to coordinator/gscoordinator/flex/models/base_model.py index e773084cbd37..746c513ed006 100644 --- a/flex/coordinator/gs_flex_coordinator/models/base_model.py +++ b/coordinator/gscoordinator/flex/models/base_model.py @@ -2,7 +2,7 @@ import typing -from gs_flex_coordinator import util +from gscoordinator.flex import util T = typing.TypeVar('T') diff --git a/flex/coordinator/gs_flex_coordinator/models/base_property_meta.py b/coordinator/gscoordinator/flex/models/base_property_meta.py similarity index 95% rename from flex/coordinator/gs_flex_coordinator/models/base_property_meta.py rename to coordinator/gscoordinator/flex/models/base_property_meta.py index 49206c873b2b..02bbd02ef945 100644 --- a/flex/coordinator/gs_flex_coordinator/models/base_property_meta.py +++ b/coordinator/gscoordinator/flex/models/base_property_meta.py @@ -2,11 +2,11 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.gs_data_type import GSDataType -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.gs_data_type import GSDataType +from gscoordinator.flex import util -from gs_flex_coordinator.models.gs_data_type import GSDataType # noqa: E501 +from gscoordinator.flex.models.gs_data_type import GSDataType # noqa: E501 class BasePropertyMeta(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/models/base_vertex_type.py b/coordinator/gscoordinator/flex/models/base_vertex_type.py similarity index 92% rename from flex/coordinator/gs_flex_coordinator/models/base_vertex_type.py rename to coordinator/gscoordinator/flex/models/base_vertex_type.py index 8e57ff85dced..aded4bc7a77e 100644 --- a/flex/coordinator/gs_flex_coordinator/models/base_vertex_type.py +++ b/coordinator/gscoordinator/flex/models/base_vertex_type.py @@ -2,11 +2,11 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.base_vertex_type_x_csr_params import BaseVertexTypeXCsrParams -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.base_vertex_type_x_csr_params import BaseVertexTypeXCsrParams +from gscoordinator.flex import util -from gs_flex_coordinator.models.base_vertex_type_x_csr_params import BaseVertexTypeXCsrParams # noqa: E501 +from gscoordinator.flex.models.base_vertex_type_x_csr_params import BaseVertexTypeXCsrParams # noqa: E501 class BaseVertexType(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/models/base_vertex_type_x_csr_params.py b/coordinator/gscoordinator/flex/models/base_vertex_type_x_csr_params.py similarity index 94% rename from flex/coordinator/gs_flex_coordinator/models/base_vertex_type_x_csr_params.py rename to coordinator/gscoordinator/flex/models/base_vertex_type_x_csr_params.py index 2972e19b8492..e006583f623d 100644 --- a/flex/coordinator/gs_flex_coordinator/models/base_vertex_type_x_csr_params.py +++ b/coordinator/gscoordinator/flex/models/base_vertex_type_x_csr_params.py @@ -2,8 +2,8 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex import util class BaseVertexTypeXCsrParams(Model): diff --git a/flex/coordinator/gs_flex_coordinator/models/column_mapping.py b/coordinator/gscoordinator/flex/models/column_mapping.py similarity index 90% rename from flex/coordinator/gs_flex_coordinator/models/column_mapping.py rename to coordinator/gscoordinator/flex/models/column_mapping.py index 642465f1bcc3..a3705c7a1f56 100644 --- a/flex/coordinator/gs_flex_coordinator/models/column_mapping.py +++ b/coordinator/gscoordinator/flex/models/column_mapping.py @@ -2,11 +2,11 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.column_mapping_column import ColumnMappingColumn -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.column_mapping_column import ColumnMappingColumn +from gscoordinator.flex import util -from gs_flex_coordinator.models.column_mapping_column import ColumnMappingColumn # noqa: E501 +from gscoordinator.flex.models.column_mapping_column import ColumnMappingColumn # noqa: E501 class ColumnMapping(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/models/column_mapping_column.py b/coordinator/gscoordinator/flex/models/column_mapping_column.py similarity index 95% rename from flex/coordinator/gs_flex_coordinator/models/column_mapping_column.py rename to coordinator/gscoordinator/flex/models/column_mapping_column.py index 2334ce2cee50..b1ac33549f0a 100644 --- a/flex/coordinator/gs_flex_coordinator/models/column_mapping_column.py +++ b/coordinator/gscoordinator/flex/models/column_mapping_column.py @@ -2,8 +2,8 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex import util class ColumnMappingColumn(Model): diff --git a/flex/coordinator/gs_flex_coordinator/models/create_alert_receiver_request.py b/coordinator/gscoordinator/flex/models/create_alert_receiver_request.py similarity index 98% rename from flex/coordinator/gs_flex_coordinator/models/create_alert_receiver_request.py rename to coordinator/gscoordinator/flex/models/create_alert_receiver_request.py index d37fd6f9f5b3..cbac38227afd 100644 --- a/flex/coordinator/gs_flex_coordinator/models/create_alert_receiver_request.py +++ b/coordinator/gscoordinator/flex/models/create_alert_receiver_request.py @@ -2,8 +2,8 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex import util class CreateAlertReceiverRequest(Model): diff --git a/flex/coordinator/gs_flex_coordinator/models/create_alert_rule_request.py b/coordinator/gscoordinator/flex/models/create_alert_rule_request.py similarity index 98% rename from flex/coordinator/gs_flex_coordinator/models/create_alert_rule_request.py rename to coordinator/gscoordinator/flex/models/create_alert_rule_request.py index 65a524c5484b..2533ea550944 100644 --- a/flex/coordinator/gs_flex_coordinator/models/create_alert_rule_request.py +++ b/coordinator/gscoordinator/flex/models/create_alert_rule_request.py @@ -2,8 +2,8 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex import util class CreateAlertRuleRequest(Model): diff --git a/flex/coordinator/gs_flex_coordinator/models/create_dataloading_job_response.py b/coordinator/gscoordinator/flex/models/create_dataloading_job_response.py similarity index 94% rename from flex/coordinator/gs_flex_coordinator/models/create_dataloading_job_response.py rename to coordinator/gscoordinator/flex/models/create_dataloading_job_response.py index 1a315f1d38f0..cd079bc41568 100644 --- a/flex/coordinator/gs_flex_coordinator/models/create_dataloading_job_response.py +++ b/coordinator/gscoordinator/flex/models/create_dataloading_job_response.py @@ -2,8 +2,8 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex import util class CreateDataloadingJobResponse(Model): diff --git a/flex/coordinator/gs_flex_coordinator/models/create_edge_type.py b/coordinator/gscoordinator/flex/models/create_edge_type.py similarity index 92% rename from flex/coordinator/gs_flex_coordinator/models/create_edge_type.py rename to coordinator/gscoordinator/flex/models/create_edge_type.py index abd3ff2cbcae..27b1cadacae8 100644 --- a/flex/coordinator/gs_flex_coordinator/models/create_edge_type.py +++ b/coordinator/gscoordinator/flex/models/create_edge_type.py @@ -2,13 +2,13 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.base_edge_type_vertex_type_pair_relations_inner import BaseEdgeTypeVertexTypePairRelationsInner -from gs_flex_coordinator.models.create_property_meta import CreatePropertyMeta -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.base_edge_type_vertex_type_pair_relations_inner import BaseEdgeTypeVertexTypePairRelationsInner +from gscoordinator.flex.models.create_property_meta import CreatePropertyMeta +from gscoordinator.flex import util -from gs_flex_coordinator.models.base_edge_type_vertex_type_pair_relations_inner import BaseEdgeTypeVertexTypePairRelationsInner # noqa: E501 -from gs_flex_coordinator.models.create_property_meta import CreatePropertyMeta # noqa: E501 +from gscoordinator.flex.models.base_edge_type_vertex_type_pair_relations_inner import BaseEdgeTypeVertexTypePairRelationsInner # noqa: E501 +from gscoordinator.flex.models.create_property_meta import CreatePropertyMeta # noqa: E501 class CreateEdgeType(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/models/create_graph_request.py b/coordinator/gscoordinator/flex/models/create_graph_request.py similarity index 89% rename from flex/coordinator/gs_flex_coordinator/models/create_graph_request.py rename to coordinator/gscoordinator/flex/models/create_graph_request.py index f13c07588b3d..3f91bd35fcc5 100644 --- a/flex/coordinator/gs_flex_coordinator/models/create_graph_request.py +++ b/coordinator/gscoordinator/flex/models/create_graph_request.py @@ -2,13 +2,13 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.create_graph_schema_request import CreateGraphSchemaRequest -from gs_flex_coordinator.models.create_stored_proc_request import CreateStoredProcRequest -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.create_graph_schema_request import CreateGraphSchemaRequest +from gscoordinator.flex.models.create_stored_proc_request import CreateStoredProcRequest +from gscoordinator.flex import util -from gs_flex_coordinator.models.create_graph_schema_request import CreateGraphSchemaRequest # noqa: E501 -from gs_flex_coordinator.models.create_stored_proc_request import CreateStoredProcRequest # noqa: E501 +from gscoordinator.flex.models.create_graph_schema_request import CreateGraphSchemaRequest # noqa: E501 +from gscoordinator.flex.models.create_stored_proc_request import CreateStoredProcRequest # noqa: E501 class CreateGraphRequest(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/models/create_graph_response.py b/coordinator/gscoordinator/flex/models/create_graph_response.py similarity index 94% rename from flex/coordinator/gs_flex_coordinator/models/create_graph_response.py rename to coordinator/gscoordinator/flex/models/create_graph_response.py index 81e8fcf56aa4..16e9c32a6cc0 100644 --- a/flex/coordinator/gs_flex_coordinator/models/create_graph_response.py +++ b/coordinator/gscoordinator/flex/models/create_graph_response.py @@ -2,8 +2,8 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex import util class CreateGraphResponse(Model): diff --git a/flex/coordinator/gs_flex_coordinator/models/create_graph_schema_request.py b/coordinator/gscoordinator/flex/models/create_graph_schema_request.py similarity index 87% rename from flex/coordinator/gs_flex_coordinator/models/create_graph_schema_request.py rename to coordinator/gscoordinator/flex/models/create_graph_schema_request.py index 8aa36619d1d2..0d1fa282c874 100644 --- a/flex/coordinator/gs_flex_coordinator/models/create_graph_schema_request.py +++ b/coordinator/gscoordinator/flex/models/create_graph_schema_request.py @@ -2,13 +2,13 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.create_edge_type import CreateEdgeType -from gs_flex_coordinator.models.create_vertex_type import CreateVertexType -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.create_edge_type import CreateEdgeType +from gscoordinator.flex.models.create_vertex_type import CreateVertexType +from gscoordinator.flex import util -from gs_flex_coordinator.models.create_edge_type import CreateEdgeType # noqa: E501 -from gs_flex_coordinator.models.create_vertex_type import CreateVertexType # noqa: E501 +from gscoordinator.flex.models.create_edge_type import CreateEdgeType # noqa: E501 +from gscoordinator.flex.models.create_vertex_type import CreateVertexType # noqa: E501 class CreateGraphSchemaRequest(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/models/create_property_meta.py b/coordinator/gscoordinator/flex/models/create_property_meta.py similarity index 95% rename from flex/coordinator/gs_flex_coordinator/models/create_property_meta.py rename to coordinator/gscoordinator/flex/models/create_property_meta.py index ac20861afedf..07f40491816e 100644 --- a/flex/coordinator/gs_flex_coordinator/models/create_property_meta.py +++ b/coordinator/gscoordinator/flex/models/create_property_meta.py @@ -2,11 +2,11 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.gs_data_type import GSDataType -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.gs_data_type import GSDataType +from gscoordinator.flex import util -from gs_flex_coordinator.models.gs_data_type import GSDataType # noqa: E501 +from gscoordinator.flex.models.gs_data_type import GSDataType # noqa: E501 class CreatePropertyMeta(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/models/create_stored_proc_request.py b/coordinator/gscoordinator/flex/models/create_stored_proc_request.py similarity index 97% rename from flex/coordinator/gs_flex_coordinator/models/create_stored_proc_request.py rename to coordinator/gscoordinator/flex/models/create_stored_proc_request.py index 1933065951b7..f8b5833e4a2e 100644 --- a/flex/coordinator/gs_flex_coordinator/models/create_stored_proc_request.py +++ b/coordinator/gscoordinator/flex/models/create_stored_proc_request.py @@ -2,8 +2,8 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex import util class CreateStoredProcRequest(Model): diff --git a/flex/coordinator/gs_flex_coordinator/models/create_stored_proc_response.py b/coordinator/gscoordinator/flex/models/create_stored_proc_response.py similarity index 95% rename from flex/coordinator/gs_flex_coordinator/models/create_stored_proc_response.py rename to coordinator/gscoordinator/flex/models/create_stored_proc_response.py index e7846c71537a..d6d196c15e62 100644 --- a/flex/coordinator/gs_flex_coordinator/models/create_stored_proc_response.py +++ b/coordinator/gscoordinator/flex/models/create_stored_proc_response.py @@ -2,8 +2,8 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex import util class CreateStoredProcResponse(Model): diff --git a/flex/coordinator/gs_flex_coordinator/models/create_vertex_type.py b/coordinator/gscoordinator/flex/models/create_vertex_type.py similarity index 91% rename from flex/coordinator/gs_flex_coordinator/models/create_vertex_type.py rename to coordinator/gscoordinator/flex/models/create_vertex_type.py index 56f5fc903030..94ca61cfbe6f 100644 --- a/flex/coordinator/gs_flex_coordinator/models/create_vertex_type.py +++ b/coordinator/gscoordinator/flex/models/create_vertex_type.py @@ -2,13 +2,13 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.base_vertex_type_x_csr_params import BaseVertexTypeXCsrParams -from gs_flex_coordinator.models.create_property_meta import CreatePropertyMeta -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.base_vertex_type_x_csr_params import BaseVertexTypeXCsrParams +from gscoordinator.flex.models.create_property_meta import CreatePropertyMeta +from gscoordinator.flex import util -from gs_flex_coordinator.models.base_vertex_type_x_csr_params import BaseVertexTypeXCsrParams # noqa: E501 -from gs_flex_coordinator.models.create_property_meta import CreatePropertyMeta # noqa: E501 +from gscoordinator.flex.models.base_vertex_type_x_csr_params import BaseVertexTypeXCsrParams # noqa: E501 +from gscoordinator.flex.models.create_property_meta import CreatePropertyMeta # noqa: E501 class CreateVertexType(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/models/dataloading_job_config.py b/coordinator/gscoordinator/flex/models/dataloading_job_config.py similarity index 87% rename from flex/coordinator/gs_flex_coordinator/models/dataloading_job_config.py rename to coordinator/gscoordinator/flex/models/dataloading_job_config.py index e4c5e79050d4..f9d8749b26bc 100644 --- a/flex/coordinator/gs_flex_coordinator/models/dataloading_job_config.py +++ b/coordinator/gscoordinator/flex/models/dataloading_job_config.py @@ -2,15 +2,15 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.dataloading_job_config_edges_inner import DataloadingJobConfigEdgesInner -from gs_flex_coordinator.models.dataloading_job_config_loading_config import DataloadingJobConfigLoadingConfig -from gs_flex_coordinator.models.dataloading_job_config_vertices_inner import DataloadingJobConfigVerticesInner -from gs_flex_coordinator import util - -from gs_flex_coordinator.models.dataloading_job_config_edges_inner import DataloadingJobConfigEdgesInner # noqa: E501 -from gs_flex_coordinator.models.dataloading_job_config_loading_config import DataloadingJobConfigLoadingConfig # noqa: E501 -from gs_flex_coordinator.models.dataloading_job_config_vertices_inner import DataloadingJobConfigVerticesInner # noqa: E501 +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.dataloading_job_config_edges_inner import DataloadingJobConfigEdgesInner +from gscoordinator.flex.models.dataloading_job_config_loading_config import DataloadingJobConfigLoadingConfig +from gscoordinator.flex.models.dataloading_job_config_vertices_inner import DataloadingJobConfigVerticesInner +from gscoordinator.flex import util + +from gscoordinator.flex.models.dataloading_job_config_edges_inner import DataloadingJobConfigEdgesInner # noqa: E501 +from gscoordinator.flex.models.dataloading_job_config_loading_config import DataloadingJobConfigLoadingConfig # noqa: E501 +from gscoordinator.flex.models.dataloading_job_config_vertices_inner import DataloadingJobConfigVerticesInner # noqa: E501 class DataloadingJobConfig(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/models/dataloading_job_config_edges_inner.py b/coordinator/gscoordinator/flex/models/dataloading_job_config_edges_inner.py similarity index 97% rename from flex/coordinator/gs_flex_coordinator/models/dataloading_job_config_edges_inner.py rename to coordinator/gscoordinator/flex/models/dataloading_job_config_edges_inner.py index 6e7de019a03b..1891ecea5ada 100644 --- a/flex/coordinator/gs_flex_coordinator/models/dataloading_job_config_edges_inner.py +++ b/coordinator/gscoordinator/flex/models/dataloading_job_config_edges_inner.py @@ -2,8 +2,8 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex import util class DataloadingJobConfigEdgesInner(Model): diff --git a/flex/coordinator/gs_flex_coordinator/models/dataloading_job_config_loading_config.py b/coordinator/gscoordinator/flex/models/dataloading_job_config_loading_config.py similarity index 89% rename from flex/coordinator/gs_flex_coordinator/models/dataloading_job_config_loading_config.py rename to coordinator/gscoordinator/flex/models/dataloading_job_config_loading_config.py index 8495188a34a0..47bec19f30d9 100644 --- a/flex/coordinator/gs_flex_coordinator/models/dataloading_job_config_loading_config.py +++ b/coordinator/gscoordinator/flex/models/dataloading_job_config_loading_config.py @@ -2,11 +2,11 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.dataloading_job_config_loading_config_format import DataloadingJobConfigLoadingConfigFormat -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.dataloading_job_config_loading_config_format import DataloadingJobConfigLoadingConfigFormat +from gscoordinator.flex import util -from gs_flex_coordinator.models.dataloading_job_config_loading_config_format import DataloadingJobConfigLoadingConfigFormat # noqa: E501 +from gscoordinator.flex.models.dataloading_job_config_loading_config_format import DataloadingJobConfigLoadingConfigFormat # noqa: E501 class DataloadingJobConfigLoadingConfig(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/models/dataloading_job_config_loading_config_format.py b/coordinator/gscoordinator/flex/models/dataloading_job_config_loading_config_format.py similarity index 96% rename from flex/coordinator/gs_flex_coordinator/models/dataloading_job_config_loading_config_format.py rename to coordinator/gscoordinator/flex/models/dataloading_job_config_loading_config_format.py index 5c49c61026fc..450666683e1c 100644 --- a/flex/coordinator/gs_flex_coordinator/models/dataloading_job_config_loading_config_format.py +++ b/coordinator/gscoordinator/flex/models/dataloading_job_config_loading_config_format.py @@ -2,8 +2,8 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex import util class DataloadingJobConfigLoadingConfigFormat(Model): diff --git a/flex/coordinator/gs_flex_coordinator/models/dataloading_job_config_vertices_inner.py b/coordinator/gscoordinator/flex/models/dataloading_job_config_vertices_inner.py similarity index 94% rename from flex/coordinator/gs_flex_coordinator/models/dataloading_job_config_vertices_inner.py rename to coordinator/gscoordinator/flex/models/dataloading_job_config_vertices_inner.py index c9f91d99c79e..c4a2c1c457d2 100644 --- a/flex/coordinator/gs_flex_coordinator/models/dataloading_job_config_vertices_inner.py +++ b/coordinator/gscoordinator/flex/models/dataloading_job_config_vertices_inner.py @@ -2,8 +2,8 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex import util class DataloadingJobConfigVerticesInner(Model): diff --git a/flex/coordinator/gs_flex_coordinator/models/edge_mapping.py b/coordinator/gscoordinator/flex/models/edge_mapping.py similarity index 93% rename from flex/coordinator/gs_flex_coordinator/models/edge_mapping.py rename to coordinator/gscoordinator/flex/models/edge_mapping.py index 0cfe5bcde0fb..b06d180617d9 100644 --- a/flex/coordinator/gs_flex_coordinator/models/edge_mapping.py +++ b/coordinator/gscoordinator/flex/models/edge_mapping.py @@ -2,13 +2,13 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.column_mapping import ColumnMapping -from gs_flex_coordinator.models.edge_mapping_type_triplet import EdgeMappingTypeTriplet -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.column_mapping import ColumnMapping +from gscoordinator.flex.models.edge_mapping_type_triplet import EdgeMappingTypeTriplet +from gscoordinator.flex import util -from gs_flex_coordinator.models.column_mapping import ColumnMapping # noqa: E501 -from gs_flex_coordinator.models.edge_mapping_type_triplet import EdgeMappingTypeTriplet # noqa: E501 +from gscoordinator.flex.models.column_mapping import ColumnMapping # noqa: E501 +from gscoordinator.flex.models.edge_mapping_type_triplet import EdgeMappingTypeTriplet # noqa: E501 class EdgeMapping(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/models/edge_mapping_type_triplet.py b/coordinator/gscoordinator/flex/models/edge_mapping_type_triplet.py similarity index 97% rename from flex/coordinator/gs_flex_coordinator/models/edge_mapping_type_triplet.py rename to coordinator/gscoordinator/flex/models/edge_mapping_type_triplet.py index 9312fd4d25b5..b39e5700f652 100644 --- a/flex/coordinator/gs_flex_coordinator/models/edge_mapping_type_triplet.py +++ b/coordinator/gscoordinator/flex/models/edge_mapping_type_triplet.py @@ -2,8 +2,8 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex import util class EdgeMappingTypeTriplet(Model): diff --git a/flex/coordinator/gs_flex_coordinator/models/error.py b/coordinator/gscoordinator/flex/models/error.py similarity index 96% rename from flex/coordinator/gs_flex_coordinator/models/error.py rename to coordinator/gscoordinator/flex/models/error.py index b177257b5670..d82f09f35ec0 100644 --- a/flex/coordinator/gs_flex_coordinator/models/error.py +++ b/coordinator/gscoordinator/flex/models/error.py @@ -2,8 +2,8 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex import util class Error(Model): diff --git a/flex/coordinator/gs_flex_coordinator/models/get_alert_message_response.py b/coordinator/gscoordinator/flex/models/get_alert_message_response.py similarity index 98% rename from flex/coordinator/gs_flex_coordinator/models/get_alert_message_response.py rename to coordinator/gscoordinator/flex/models/get_alert_message_response.py index 0ac7826077d4..fb270900c1b7 100644 --- a/flex/coordinator/gs_flex_coordinator/models/get_alert_message_response.py +++ b/coordinator/gscoordinator/flex/models/get_alert_message_response.py @@ -2,8 +2,8 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex import util class GetAlertMessageResponse(Model): diff --git a/flex/coordinator/gs_flex_coordinator/models/get_alert_receiver_response.py b/coordinator/gscoordinator/flex/models/get_alert_receiver_response.py similarity index 98% rename from flex/coordinator/gs_flex_coordinator/models/get_alert_receiver_response.py rename to coordinator/gscoordinator/flex/models/get_alert_receiver_response.py index 40e471fbd55d..9a7cdce5a2e5 100644 --- a/flex/coordinator/gs_flex_coordinator/models/get_alert_receiver_response.py +++ b/coordinator/gscoordinator/flex/models/get_alert_receiver_response.py @@ -2,8 +2,8 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex import util class GetAlertReceiverResponse(Model): diff --git a/flex/coordinator/gs_flex_coordinator/models/get_alert_rule_response.py b/coordinator/gscoordinator/flex/models/get_alert_rule_response.py similarity index 98% rename from flex/coordinator/gs_flex_coordinator/models/get_alert_rule_response.py rename to coordinator/gscoordinator/flex/models/get_alert_rule_response.py index 33306adbfd79..c31211c07e60 100644 --- a/flex/coordinator/gs_flex_coordinator/models/get_alert_rule_response.py +++ b/coordinator/gscoordinator/flex/models/get_alert_rule_response.py @@ -2,8 +2,8 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex import util class GetAlertRuleResponse(Model): diff --git a/flex/coordinator/gs_flex_coordinator/models/get_edge_type.py b/coordinator/gscoordinator/flex/models/get_edge_type.py similarity index 93% rename from flex/coordinator/gs_flex_coordinator/models/get_edge_type.py rename to coordinator/gscoordinator/flex/models/get_edge_type.py index 6d7b89845d44..572aaf951e6e 100644 --- a/flex/coordinator/gs_flex_coordinator/models/get_edge_type.py +++ b/coordinator/gscoordinator/flex/models/get_edge_type.py @@ -2,13 +2,13 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.base_edge_type_vertex_type_pair_relations_inner import BaseEdgeTypeVertexTypePairRelationsInner -from gs_flex_coordinator.models.get_property_meta import GetPropertyMeta -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.base_edge_type_vertex_type_pair_relations_inner import BaseEdgeTypeVertexTypePairRelationsInner +from gscoordinator.flex.models.get_property_meta import GetPropertyMeta +from gscoordinator.flex import util -from gs_flex_coordinator.models.base_edge_type_vertex_type_pair_relations_inner import BaseEdgeTypeVertexTypePairRelationsInner # noqa: E501 -from gs_flex_coordinator.models.get_property_meta import GetPropertyMeta # noqa: E501 +from gscoordinator.flex.models.base_edge_type_vertex_type_pair_relations_inner import BaseEdgeTypeVertexTypePairRelationsInner # noqa: E501 +from gscoordinator.flex.models.get_property_meta import GetPropertyMeta # noqa: E501 class GetEdgeType(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/models/get_graph_response.py b/coordinator/gscoordinator/flex/models/get_graph_response.py similarity index 95% rename from flex/coordinator/gs_flex_coordinator/models/get_graph_response.py rename to coordinator/gscoordinator/flex/models/get_graph_response.py index 179ab3f15213..1c5aa73feb78 100644 --- a/flex/coordinator/gs_flex_coordinator/models/get_graph_response.py +++ b/coordinator/gscoordinator/flex/models/get_graph_response.py @@ -2,13 +2,13 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.get_graph_schema_response import GetGraphSchemaResponse -from gs_flex_coordinator.models.get_stored_proc_response import GetStoredProcResponse -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.get_graph_schema_response import GetGraphSchemaResponse +from gscoordinator.flex.models.get_stored_proc_response import GetStoredProcResponse +from gscoordinator.flex import util -from gs_flex_coordinator.models.get_graph_schema_response import GetGraphSchemaResponse # noqa: E501 -from gs_flex_coordinator.models.get_stored_proc_response import GetStoredProcResponse # noqa: E501 +from gscoordinator.flex.models.get_graph_schema_response import GetGraphSchemaResponse # noqa: E501 +from gscoordinator.flex.models.get_stored_proc_response import GetStoredProcResponse # noqa: E501 class GetGraphResponse(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/models/get_graph_schema_response.py b/coordinator/gscoordinator/flex/models/get_graph_schema_response.py similarity index 88% rename from flex/coordinator/gs_flex_coordinator/models/get_graph_schema_response.py rename to coordinator/gscoordinator/flex/models/get_graph_schema_response.py index c34280e51a03..1a1d899d1227 100644 --- a/flex/coordinator/gs_flex_coordinator/models/get_graph_schema_response.py +++ b/coordinator/gscoordinator/flex/models/get_graph_schema_response.py @@ -2,13 +2,13 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.get_edge_type import GetEdgeType -from gs_flex_coordinator.models.get_vertex_type import GetVertexType -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.get_edge_type import GetEdgeType +from gscoordinator.flex.models.get_vertex_type import GetVertexType +from gscoordinator.flex import util -from gs_flex_coordinator.models.get_edge_type import GetEdgeType # noqa: E501 -from gs_flex_coordinator.models.get_vertex_type import GetVertexType # noqa: E501 +from gscoordinator.flex.models.get_edge_type import GetEdgeType # noqa: E501 +from gscoordinator.flex.models.get_vertex_type import GetVertexType # noqa: E501 class GetGraphSchemaResponse(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/models/get_property_meta.py b/coordinator/gscoordinator/flex/models/get_property_meta.py similarity index 96% rename from flex/coordinator/gs_flex_coordinator/models/get_property_meta.py rename to coordinator/gscoordinator/flex/models/get_property_meta.py index 465f5c0bdd68..247f5a070029 100644 --- a/flex/coordinator/gs_flex_coordinator/models/get_property_meta.py +++ b/coordinator/gscoordinator/flex/models/get_property_meta.py @@ -2,11 +2,11 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.gs_data_type import GSDataType -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.gs_data_type import GSDataType +from gscoordinator.flex import util -from gs_flex_coordinator.models.gs_data_type import GSDataType # noqa: E501 +from gscoordinator.flex.models.gs_data_type import GSDataType # noqa: E501 class GetPropertyMeta(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/models/get_stored_proc_response.py b/coordinator/gscoordinator/flex/models/get_stored_proc_response.py similarity index 97% rename from flex/coordinator/gs_flex_coordinator/models/get_stored_proc_response.py rename to coordinator/gscoordinator/flex/models/get_stored_proc_response.py index 59a7c6b31cb1..59e7689cf01d 100644 --- a/flex/coordinator/gs_flex_coordinator/models/get_stored_proc_response.py +++ b/coordinator/gscoordinator/flex/models/get_stored_proc_response.py @@ -2,11 +2,11 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.parameter import Parameter -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.parameter import Parameter +from gscoordinator.flex import util -from gs_flex_coordinator.models.parameter import Parameter # noqa: E501 +from gscoordinator.flex.models.parameter import Parameter # noqa: E501 class GetStoredProcResponse(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/models/get_vertex_type.py b/coordinator/gscoordinator/flex/models/get_vertex_type.py similarity index 92% rename from flex/coordinator/gs_flex_coordinator/models/get_vertex_type.py rename to coordinator/gscoordinator/flex/models/get_vertex_type.py index d6759b8796c5..83e84929c7ee 100644 --- a/flex/coordinator/gs_flex_coordinator/models/get_vertex_type.py +++ b/coordinator/gscoordinator/flex/models/get_vertex_type.py @@ -2,13 +2,13 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.base_vertex_type_x_csr_params import BaseVertexTypeXCsrParams -from gs_flex_coordinator.models.get_property_meta import GetPropertyMeta -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.base_vertex_type_x_csr_params import BaseVertexTypeXCsrParams +from gscoordinator.flex.models.get_property_meta import GetPropertyMeta +from gscoordinator.flex import util -from gs_flex_coordinator.models.base_vertex_type_x_csr_params import BaseVertexTypeXCsrParams # noqa: E501 -from gs_flex_coordinator.models.get_property_meta import GetPropertyMeta # noqa: E501 +from gscoordinator.flex.models.base_vertex_type_x_csr_params import BaseVertexTypeXCsrParams # noqa: E501 +from gscoordinator.flex.models.get_property_meta import GetPropertyMeta # noqa: E501 class GetVertexType(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/models/gs_data_type.py b/coordinator/gscoordinator/flex/models/gs_data_type.py similarity index 83% rename from flex/coordinator/gs_flex_coordinator/models/gs_data_type.py rename to coordinator/gscoordinator/flex/models/gs_data_type.py index 8ba27bee55e8..c7e9058909bc 100644 --- a/flex/coordinator/gs_flex_coordinator/models/gs_data_type.py +++ b/coordinator/gscoordinator/flex/models/gs_data_type.py @@ -2,15 +2,15 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.primitive_type import PrimitiveType -from gs_flex_coordinator.models.string_type import StringType -from gs_flex_coordinator.models.string_type_string import StringTypeString -from gs_flex_coordinator import util - -from gs_flex_coordinator.models.primitive_type import PrimitiveType # noqa: E501 -from gs_flex_coordinator.models.string_type import StringType # noqa: E501 -from gs_flex_coordinator.models.string_type_string import StringTypeString # noqa: E501 +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.primitive_type import PrimitiveType +from gscoordinator.flex.models.string_type import StringType +from gscoordinator.flex.models.string_type_string import StringTypeString +from gscoordinator.flex import util + +from gscoordinator.flex.models.primitive_type import PrimitiveType # noqa: E501 +from gscoordinator.flex.models.string_type import StringType # noqa: E501 +from gscoordinator.flex.models.string_type_string import StringTypeString # noqa: E501 class GSDataType(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/models/job_status.py b/coordinator/gscoordinator/flex/models/job_status.py similarity index 98% rename from flex/coordinator/gs_flex_coordinator/models/job_status.py rename to coordinator/gscoordinator/flex/models/job_status.py index bf17ca00d4ca..1659f74cd5a9 100644 --- a/flex/coordinator/gs_flex_coordinator/models/job_status.py +++ b/coordinator/gscoordinator/flex/models/job_status.py @@ -2,8 +2,8 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex import util class JobStatus(Model): diff --git a/flex/coordinator/gs_flex_coordinator/models/long_text.py b/coordinator/gscoordinator/flex/models/long_text.py similarity index 94% rename from flex/coordinator/gs_flex_coordinator/models/long_text.py rename to coordinator/gscoordinator/flex/models/long_text.py index 443ea6224073..5bb3a45856eb 100644 --- a/flex/coordinator/gs_flex_coordinator/models/long_text.py +++ b/coordinator/gscoordinator/flex/models/long_text.py @@ -2,8 +2,8 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex import util class LongText(Model): diff --git a/flex/coordinator/gs_flex_coordinator/models/node_status.py b/coordinator/gscoordinator/flex/models/node_status.py similarity index 97% rename from flex/coordinator/gs_flex_coordinator/models/node_status.py rename to coordinator/gscoordinator/flex/models/node_status.py index 3143c7b23620..f4596a54fc8c 100644 --- a/flex/coordinator/gs_flex_coordinator/models/node_status.py +++ b/coordinator/gscoordinator/flex/models/node_status.py @@ -2,8 +2,8 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex import util class NodeStatus(Model): diff --git a/flex/coordinator/gs_flex_coordinator/models/parameter.py b/coordinator/gscoordinator/flex/models/parameter.py similarity index 90% rename from flex/coordinator/gs_flex_coordinator/models/parameter.py rename to coordinator/gscoordinator/flex/models/parameter.py index c62fdb7d6615..c500e94e93d6 100644 --- a/flex/coordinator/gs_flex_coordinator/models/parameter.py +++ b/coordinator/gscoordinator/flex/models/parameter.py @@ -2,11 +2,11 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.gs_data_type import GSDataType -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.gs_data_type import GSDataType +from gscoordinator.flex import util -from gs_flex_coordinator.models.gs_data_type import GSDataType # noqa: E501 +from gscoordinator.flex.models.gs_data_type import GSDataType # noqa: E501 class Parameter(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/models/primitive_type.py b/coordinator/gscoordinator/flex/models/primitive_type.py similarity index 95% rename from flex/coordinator/gs_flex_coordinator/models/primitive_type.py rename to coordinator/gscoordinator/flex/models/primitive_type.py index 95ed32da2bc6..68a7344ee816 100644 --- a/flex/coordinator/gs_flex_coordinator/models/primitive_type.py +++ b/coordinator/gscoordinator/flex/models/primitive_type.py @@ -2,8 +2,8 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex import util class PrimitiveType(Model): diff --git a/flex/coordinator/gs_flex_coordinator/models/running_deployment_info.py b/coordinator/gscoordinator/flex/models/running_deployment_info.py similarity index 98% rename from flex/coordinator/gs_flex_coordinator/models/running_deployment_info.py rename to coordinator/gscoordinator/flex/models/running_deployment_info.py index d68fde6c111a..f6770f595414 100644 --- a/flex/coordinator/gs_flex_coordinator/models/running_deployment_info.py +++ b/coordinator/gscoordinator/flex/models/running_deployment_info.py @@ -2,8 +2,8 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex import util class RunningDeploymentInfo(Model): diff --git a/flex/coordinator/gs_flex_coordinator/models/running_deployment_status.py b/coordinator/gscoordinator/flex/models/running_deployment_status.py similarity index 89% rename from flex/coordinator/gs_flex_coordinator/models/running_deployment_status.py rename to coordinator/gscoordinator/flex/models/running_deployment_status.py index efd8ebac2efe..492b8b23c2e1 100644 --- a/flex/coordinator/gs_flex_coordinator/models/running_deployment_status.py +++ b/coordinator/gscoordinator/flex/models/running_deployment_status.py @@ -2,11 +2,11 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.running_deployment_status_nodes_inner import RunningDeploymentStatusNodesInner -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.running_deployment_status_nodes_inner import RunningDeploymentStatusNodesInner +from gscoordinator.flex import util -from gs_flex_coordinator.models.running_deployment_status_nodes_inner import RunningDeploymentStatusNodesInner # noqa: E501 +from gscoordinator.flex.models.running_deployment_status_nodes_inner import RunningDeploymentStatusNodesInner # noqa: E501 class RunningDeploymentStatus(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/models/running_deployment_status_nodes_inner.py b/coordinator/gscoordinator/flex/models/running_deployment_status_nodes_inner.py similarity index 95% rename from flex/coordinator/gs_flex_coordinator/models/running_deployment_status_nodes_inner.py rename to coordinator/gscoordinator/flex/models/running_deployment_status_nodes_inner.py index ef98cef2821b..6e75151e98a6 100644 --- a/flex/coordinator/gs_flex_coordinator/models/running_deployment_status_nodes_inner.py +++ b/coordinator/gscoordinator/flex/models/running_deployment_status_nodes_inner.py @@ -2,11 +2,11 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.node_status import NodeStatus -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.node_status import NodeStatus +from gscoordinator.flex import util -from gs_flex_coordinator.models.node_status import NodeStatus # noqa: E501 +from gscoordinator.flex.models.node_status import NodeStatus # noqa: E501 class RunningDeploymentStatusNodesInner(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/models/schema_mapping.py b/coordinator/gscoordinator/flex/models/schema_mapping.py similarity index 88% rename from flex/coordinator/gs_flex_coordinator/models/schema_mapping.py rename to coordinator/gscoordinator/flex/models/schema_mapping.py index 3a95d953069e..345371b71198 100644 --- a/flex/coordinator/gs_flex_coordinator/models/schema_mapping.py +++ b/coordinator/gscoordinator/flex/models/schema_mapping.py @@ -2,13 +2,13 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.edge_mapping import EdgeMapping -from gs_flex_coordinator.models.vertex_mapping import VertexMapping -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.edge_mapping import EdgeMapping +from gscoordinator.flex.models.vertex_mapping import VertexMapping +from gscoordinator.flex import util -from gs_flex_coordinator.models.edge_mapping import EdgeMapping # noqa: E501 -from gs_flex_coordinator.models.vertex_mapping import VertexMapping # noqa: E501 +from gscoordinator.flex.models.edge_mapping import EdgeMapping # noqa: E501 +from gscoordinator.flex.models.vertex_mapping import VertexMapping # noqa: E501 class SchemaMapping(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/models/service_status.py b/coordinator/gscoordinator/flex/models/service_status.py similarity index 93% rename from flex/coordinator/gs_flex_coordinator/models/service_status.py rename to coordinator/gscoordinator/flex/models/service_status.py index 31ec49f2dbef..399e5eabc0f0 100644 --- a/flex/coordinator/gs_flex_coordinator/models/service_status.py +++ b/coordinator/gscoordinator/flex/models/service_status.py @@ -2,11 +2,11 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.service_status_sdk_endpoints import ServiceStatusSdkEndpoints -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.service_status_sdk_endpoints import ServiceStatusSdkEndpoints +from gscoordinator.flex import util -from gs_flex_coordinator.models.service_status_sdk_endpoints import ServiceStatusSdkEndpoints # noqa: E501 +from gscoordinator.flex.models.service_status_sdk_endpoints import ServiceStatusSdkEndpoints # noqa: E501 class ServiceStatus(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/models/service_status_sdk_endpoints.py b/coordinator/gscoordinator/flex/models/service_status_sdk_endpoints.py similarity index 97% rename from flex/coordinator/gs_flex_coordinator/models/service_status_sdk_endpoints.py rename to coordinator/gscoordinator/flex/models/service_status_sdk_endpoints.py index d9fbc0a37050..040c74cc0dce 100644 --- a/flex/coordinator/gs_flex_coordinator/models/service_status_sdk_endpoints.py +++ b/coordinator/gscoordinator/flex/models/service_status_sdk_endpoints.py @@ -2,8 +2,8 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex import util class ServiceStatusSdkEndpoints(Model): diff --git a/flex/coordinator/gs_flex_coordinator/models/start_service_request.py b/coordinator/gscoordinator/flex/models/start_service_request.py similarity index 94% rename from flex/coordinator/gs_flex_coordinator/models/start_service_request.py rename to coordinator/gscoordinator/flex/models/start_service_request.py index d068a8303b00..fbf368fea336 100644 --- a/flex/coordinator/gs_flex_coordinator/models/start_service_request.py +++ b/coordinator/gscoordinator/flex/models/start_service_request.py @@ -2,8 +2,8 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex import util class StartServiceRequest(Model): diff --git a/flex/coordinator/gs_flex_coordinator/models/stored_procedure_meta.py b/coordinator/gscoordinator/flex/models/stored_procedure_meta.py similarity index 96% rename from flex/coordinator/gs_flex_coordinator/models/stored_procedure_meta.py rename to coordinator/gscoordinator/flex/models/stored_procedure_meta.py index 97f6d0f37140..7528500e0cfa 100644 --- a/flex/coordinator/gs_flex_coordinator/models/stored_procedure_meta.py +++ b/coordinator/gscoordinator/flex/models/stored_procedure_meta.py @@ -2,11 +2,11 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.parameter import Parameter -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.parameter import Parameter +from gscoordinator.flex import util -from gs_flex_coordinator.models.parameter import Parameter # noqa: E501 +from gscoordinator.flex.models.parameter import Parameter # noqa: E501 class StoredProcedureMeta(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/models/string_type.py b/coordinator/gscoordinator/flex/models/string_type.py similarity index 86% rename from flex/coordinator/gs_flex_coordinator/models/string_type.py rename to coordinator/gscoordinator/flex/models/string_type.py index 31edcef9088c..7c8095ee793c 100644 --- a/flex/coordinator/gs_flex_coordinator/models/string_type.py +++ b/coordinator/gscoordinator/flex/models/string_type.py @@ -2,11 +2,11 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.string_type_string import StringTypeString -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.string_type_string import StringTypeString +from gscoordinator.flex import util -from gs_flex_coordinator.models.string_type_string import StringTypeString # noqa: E501 +from gscoordinator.flex.models.string_type_string import StringTypeString # noqa: E501 class StringType(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/models/string_type_string.py b/coordinator/gscoordinator/flex/models/string_type_string.py similarity index 88% rename from flex/coordinator/gs_flex_coordinator/models/string_type_string.py rename to coordinator/gscoordinator/flex/models/string_type_string.py index 2e8c77e28887..2d8bb4bf3714 100644 --- a/flex/coordinator/gs_flex_coordinator/models/string_type_string.py +++ b/coordinator/gscoordinator/flex/models/string_type_string.py @@ -2,11 +2,11 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.long_text import LongText -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.long_text import LongText +from gscoordinator.flex import util -from gs_flex_coordinator.models.long_text import LongText # noqa: E501 +from gscoordinator.flex.models.long_text import LongText # noqa: E501 class StringTypeString(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/models/update_alert_message_status_request.py b/coordinator/gscoordinator/flex/models/update_alert_message_status_request.py similarity index 96% rename from flex/coordinator/gs_flex_coordinator/models/update_alert_message_status_request.py rename to coordinator/gscoordinator/flex/models/update_alert_message_status_request.py index a26f13cdf108..a47942c318e0 100644 --- a/flex/coordinator/gs_flex_coordinator/models/update_alert_message_status_request.py +++ b/coordinator/gscoordinator/flex/models/update_alert_message_status_request.py @@ -2,8 +2,8 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex import util class UpdateAlertMessageStatusRequest(Model): diff --git a/flex/coordinator/gs_flex_coordinator/models/update_stored_proc_request.py b/coordinator/gscoordinator/flex/models/update_stored_proc_request.py similarity index 94% rename from flex/coordinator/gs_flex_coordinator/models/update_stored_proc_request.py rename to coordinator/gscoordinator/flex/models/update_stored_proc_request.py index e7819d069329..4cf2dec4d285 100644 --- a/flex/coordinator/gs_flex_coordinator/models/update_stored_proc_request.py +++ b/coordinator/gscoordinator/flex/models/update_stored_proc_request.py @@ -2,8 +2,8 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex import util class UpdateStoredProcRequest(Model): diff --git a/flex/coordinator/gs_flex_coordinator/models/upload_file_response.py b/coordinator/gscoordinator/flex/models/upload_file_response.py similarity index 94% rename from flex/coordinator/gs_flex_coordinator/models/upload_file_response.py rename to coordinator/gscoordinator/flex/models/upload_file_response.py index 3850c3bd7354..b14ecb242d1b 100644 --- a/flex/coordinator/gs_flex_coordinator/models/upload_file_response.py +++ b/coordinator/gscoordinator/flex/models/upload_file_response.py @@ -2,8 +2,8 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex import util class UploadFileResponse(Model): diff --git a/flex/coordinator/gs_flex_coordinator/models/vertex_mapping.py b/coordinator/gscoordinator/flex/models/vertex_mapping.py similarity index 93% rename from flex/coordinator/gs_flex_coordinator/models/vertex_mapping.py rename to coordinator/gscoordinator/flex/models/vertex_mapping.py index edf0d28db5e2..ad18dbf65bec 100644 --- a/flex/coordinator/gs_flex_coordinator/models/vertex_mapping.py +++ b/coordinator/gscoordinator/flex/models/vertex_mapping.py @@ -2,11 +2,11 @@ from typing import List, Dict # noqa: F401 -from gs_flex_coordinator.models.base_model import Model -from gs_flex_coordinator.models.column_mapping import ColumnMapping -from gs_flex_coordinator import util +from gscoordinator.flex.models.base_model import Model +from gscoordinator.flex.models.column_mapping import ColumnMapping +from gscoordinator.flex import util -from gs_flex_coordinator.models.column_mapping import ColumnMapping # noqa: E501 +from gscoordinator.flex.models.column_mapping import ColumnMapping # noqa: E501 class VertexMapping(Model): """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/flex/coordinator/gs_flex_coordinator/openapi/openapi.yaml b/coordinator/gscoordinator/flex/openapi/openapi.yaml similarity index 96% rename from flex/coordinator/gs_flex_coordinator/openapi/openapi.yaml rename to coordinator/gscoordinator/flex/openapi/openapi.yaml index ff371deac526..623a4a68bafa 100644 --- a/flex/coordinator/gs_flex_coordinator/openapi/openapi.yaml +++ b/coordinator/gscoordinator/flex/openapi/openapi.yaml @@ -132,7 +132,7 @@ paths: description: Server error tags: - Alert - x-openapi-router-controller: gs_flex_coordinator.controllers.alert_controller + x-openapi-router-controller: gscoordinator.flex.controllers.alert_controller /api/v1/alert/message-collection: delete: description: Delete alert message in batch @@ -161,7 +161,7 @@ paths: description: Server error tags: - Alert - x-openapi-router-controller: gs_flex_coordinator.controllers.alert_controller + x-openapi-router-controller: gscoordinator.flex.controllers.alert_controller /api/v1/alert/message-collection/status: put: description: Update the message status in batch @@ -186,7 +186,7 @@ paths: description: Server error tags: - Alert - x-openapi-router-controller: gs_flex_coordinator.controllers.alert_controller + x-openapi-router-controller: gscoordinator.flex.controllers.alert_controller /api/v1/alert/receiver: get: description: List all alert receivers @@ -226,7 +226,7 @@ paths: description: Server error tags: - Alert - x-openapi-router-controller: gs_flex_coordinator.controllers.alert_controller + x-openapi-router-controller: gscoordinator.flex.controllers.alert_controller post: description: Create a new alert receiver operationId: create_alert_receiver @@ -251,7 +251,7 @@ paths: description: Server error tags: - Alert - x-openapi-router-controller: gs_flex_coordinator.controllers.alert_controller + x-openapi-router-controller: gscoordinator.flex.controllers.alert_controller /api/v1/alert/receiver/{receiver_id}: delete: description: Delete the alert receiver by ID @@ -279,7 +279,7 @@ paths: description: Server error tags: - Alert - x-openapi-router-controller: gs_flex_coordinator.controllers.alert_controller + x-openapi-router-controller: gscoordinator.flex.controllers.alert_controller put: description: Update alert receiver by ID operationId: update_alert_receiver_by_id @@ -311,7 +311,7 @@ paths: description: Server error tags: - Alert - x-openapi-router-controller: gs_flex_coordinator.controllers.alert_controller + x-openapi-router-controller: gscoordinator.flex.controllers.alert_controller /api/v1/alert/rule: get: description: List all alert rules @@ -346,7 +346,7 @@ paths: description: Server error tags: - Alert - x-openapi-router-controller: gs_flex_coordinator.controllers.alert_controller + x-openapi-router-controller: gscoordinator.flex.controllers.alert_controller /api/v1/alert/rule/{rule_id}: delete: operationId: delete_alert_rule_by_id @@ -373,7 +373,7 @@ paths: description: Server error tags: - Alert - x-openapi-router-controller: gs_flex_coordinator.controllers.alert_controller + x-openapi-router-controller: gscoordinator.flex.controllers.alert_controller put: operationId: update_alert_rule_by_id parameters: @@ -404,7 +404,7 @@ paths: description: Server error tags: - Alert - x-openapi-router-controller: gs_flex_coordinator.controllers.alert_controller + x-openapi-router-controller: gscoordinator.flex.controllers.alert_controller /api/v1/deployment: get: description: Deployment information @@ -432,7 +432,7 @@ paths: description: Server error tags: - Deployment - x-openapi-router-controller: gs_flex_coordinator.controllers.deployment_controller + x-openapi-router-controller: gscoordinator.flex.controllers.deployment_controller /api/v1/deployment/status: get: description: Deployment status @@ -459,7 +459,7 @@ paths: description: Server error tags: - Deployment - x-openapi-router-controller: gs_flex_coordinator.controllers.deployment_controller + x-openapi-router-controller: gscoordinator.flex.controllers.deployment_controller /api/v1/file/uploading: post: operationId: upload_file @@ -484,7 +484,7 @@ paths: description: Server error tags: - Utils - x-openapi-router-controller: gs_flex_coordinator.controllers.utils_controller + x-openapi-router-controller: gscoordinator.flex.controllers.utils_controller /api/v1/graph: get: description: List all graphs @@ -588,7 +588,7 @@ paths: description: Server error tags: - Graph - x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller + x-openapi-router-controller: gscoordinator.flex.controllers.graph_controller post: description: Create a new graph operationId: create_graph @@ -619,7 +619,7 @@ paths: description: Server error tags: - Graph - x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller + x-openapi-router-controller: gscoordinator.flex.controllers.graph_controller /api/v1/graph/{graph_id}: delete: description: Delete graph by ID @@ -647,7 +647,7 @@ paths: description: Server error tags: - Graph - x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller + x-openapi-router-controller: gscoordinator.flex.controllers.graph_controller get: description: Get graph by ID operationId: get_graph_by_id @@ -756,7 +756,7 @@ paths: description: Server error tags: - Graph - x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller + x-openapi-router-controller: gscoordinator.flex.controllers.graph_controller /api/v1/graph/{graph_id}/dataloading: post: description: Submit a dataloading job @@ -796,7 +796,7 @@ paths: description: Server error tags: - Job - x-openapi-router-controller: gs_flex_coordinator.controllers.job_controller + x-openapi-router-controller: gscoordinator.flex.controllers.job_controller /api/v1/graph/{graph_id}/dataloading/config: get: description: Get the data loading configuration @@ -824,7 +824,7 @@ paths: description: Server error tags: - Job - x-openapi-router-controller: gs_flex_coordinator.controllers.job_controller + x-openapi-router-controller: gscoordinator.flex.controllers.job_controller /api/v1/graph/{graph_id}/datasource: get: description: Get data source by ID @@ -921,7 +921,7 @@ paths: description: Server error tags: - DataSource - x-openapi-router-controller: gs_flex_coordinator.controllers.data_source_controller + x-openapi-router-controller: gscoordinator.flex.controllers.data_source_controller post: description: Bind data sources in batches operationId: bind_datasource_in_batch @@ -960,7 +960,7 @@ paths: description: Server error tags: - DataSource - x-openapi-router-controller: gs_flex_coordinator.controllers.data_source_controller + x-openapi-router-controller: gscoordinator.flex.controllers.data_source_controller /api/v1/graph/{graph_id}/datasource/edge/{type_name}: delete: description: Unbind datas ource on an edge type @@ -1009,7 +1009,7 @@ paths: description: Server error tags: - DataSource - x-openapi-router-controller: gs_flex_coordinator.controllers.data_source_controller + x-openapi-router-controller: gscoordinator.flex.controllers.data_source_controller /api/v1/graph/{graph_id}/datasource/vertex/{type_name}: delete: description: Unbind data source on a vertex type @@ -1044,7 +1044,7 @@ paths: description: Server error tags: - DataSource - x-openapi-router-controller: gs_flex_coordinator.controllers.data_source_controller + x-openapi-router-controller: gscoordinator.flex.controllers.data_source_controller /api/v1/graph/{graph_id}/schema: get: description: Get graph schema by ID @@ -1131,7 +1131,7 @@ paths: description: Server error tags: - Graph - x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller + x-openapi-router-controller: gscoordinator.flex.controllers.graph_controller post: description: Import graph schema operationId: import_schema_by_id @@ -1170,7 +1170,7 @@ paths: description: Server error tags: - Graph - x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller + x-openapi-router-controller: gscoordinator.flex.controllers.graph_controller /api/v1/graph/{graph_id}/schema/edge: post: description: Create a edge type @@ -1209,7 +1209,7 @@ paths: description: Server error tags: - Graph - x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller + x-openapi-router-controller: gscoordinator.flex.controllers.graph_controller /api/v1/graph/{graph_id}/schema/edge/{type_name}: delete: description: Delete edge type by name @@ -1258,7 +1258,7 @@ paths: description: Server error tags: - Graph - x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller + x-openapi-router-controller: gscoordinator.flex.controllers.graph_controller /api/v1/graph/{graph_id}/schema/vertex: post: description: Create a vertex type @@ -1298,7 +1298,7 @@ paths: description: Server error tags: - Graph - x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller + x-openapi-router-controller: gscoordinator.flex.controllers.graph_controller /api/v1/graph/{graph_id}/schema/vertex/{type_name}: delete: description: Delete vertex type by name @@ -1333,7 +1333,7 @@ paths: description: Server error tags: - Graph - x-openapi-router-controller: gs_flex_coordinator.controllers.graph_controller + x-openapi-router-controller: gscoordinator.flex.controllers.graph_controller /api/v1/graph/{graph_id}/service: get: description: Get service status by graph ID @@ -1369,7 +1369,7 @@ paths: description: Server error tags: - Service - x-openapi-router-controller: gs_flex_coordinator.controllers.service_controller + x-openapi-router-controller: gscoordinator.flex.controllers.service_controller /api/v1/graph/{graph_id}/storedproc: get: description: List all stored procedures on a certain graph @@ -1438,7 +1438,7 @@ paths: description: Server error tags: - Stored Procedure - x-openapi-router-controller: gs_flex_coordinator.controllers.stored_procedure_controller + x-openapi-router-controller: gscoordinator.flex.controllers.stored_procedure_controller post: description: Create a new stored procedure on a certain graph operationId: create_stored_procedure @@ -1477,7 +1477,7 @@ paths: description: Server error tags: - Stored Procedure - x-openapi-router-controller: gs_flex_coordinator.controllers.stored_procedure_controller + x-openapi-router-controller: gscoordinator.flex.controllers.stored_procedure_controller /api/v1/graph/{graph_id}/storedproc/{stored_procedure_id}: delete: description: Delete a stored procedure by ID @@ -1512,7 +1512,7 @@ paths: description: Server error tags: - Stored Procedure - x-openapi-router-controller: gs_flex_coordinator.controllers.stored_procedure_controller + x-openapi-router-controller: gscoordinator.flex.controllers.stored_procedure_controller get: description: Get a stored procedure by ID operationId: get_stored_procedure_by_id @@ -1563,7 +1563,7 @@ paths: description: Server error tags: - Stored Procedure - x-openapi-router-controller: gs_flex_coordinator.controllers.stored_procedure_controller + x-openapi-router-controller: gscoordinator.flex.controllers.stored_procedure_controller put: description: Update a stored procedure by ID operationId: update_stored_procedure_by_id @@ -1602,7 +1602,7 @@ paths: description: Server error tags: - Stored Procedure - x-openapi-router-controller: gs_flex_coordinator.controllers.stored_procedure_controller + x-openapi-router-controller: gscoordinator.flex.controllers.stored_procedure_controller /api/v1/job: get: description: List all jobs @@ -1618,21 +1618,21 @@ paths: start_time: 2024-02-24 00:00:00 log: logging... detail: - graph_name: demo + graph_id: GRAPHID - id: JOB-QWERTYUIOPASDFGH-2 type: DATA IMPORT status: CANCELLED start_time: 2024-02-24 00:00:00 log: logging... detail: - graph_name: demo + graph_id: GRAPHID - id: JOB-QWERTYUIOPASDFGH-3 type: DATA IMPORT status: SUCCESS start_time: 2024-02-24 00:00:00 end_time: 2024-02-24 12:00:00 detail: - graph_name: demo + graph_id: GRAPHID - id: JOB-QWERTYUIOPASDFGH-4 type: DATA IMPORT status: FAILED @@ -1640,12 +1640,12 @@ paths: end_time: 2024-02-24 12:00:00 log: logging... detail: - graph_name: demo + graph_id: GRAPHID - id: JOB-QWERTYUIOPASDFGH-5 type: DATA IMPORT status: WAITING detail: - graph_name: demo + graph_id: GRAPHID schema: items: $ref: '#/components/schemas/JobStatus' @@ -1659,7 +1659,7 @@ paths: description: Server error tags: - Job - x-openapi-router-controller: gs_flex_coordinator.controllers.job_controller + x-openapi-router-controller: gscoordinator.flex.controllers.job_controller /api/v1/job/{job_id}: delete: description: Delete job by ID @@ -1687,7 +1687,7 @@ paths: description: Server error tags: - Job - x-openapi-router-controller: gs_flex_coordinator.controllers.job_controller + x-openapi-router-controller: gscoordinator.flex.controllers.job_controller get: description: Get job status by ID operationId: get_job_by_id @@ -1714,7 +1714,7 @@ paths: description: Server error tags: - Job - x-openapi-router-controller: gs_flex_coordinator.controllers.job_controller + x-openapi-router-controller: gscoordinator.flex.controllers.job_controller /api/v1/service: get: description: List all service status @@ -1744,7 +1744,7 @@ paths: description: Server error tags: - Service - x-openapi-router-controller: gs_flex_coordinator.controllers.service_controller + x-openapi-router-controller: gscoordinator.flex.controllers.service_controller /api/v1/service/restart: post: description: Restart current service @@ -1764,7 +1764,7 @@ paths: description: Server error tags: - Service - x-openapi-router-controller: gs_flex_coordinator.controllers.service_controller + x-openapi-router-controller: gscoordinator.flex.controllers.service_controller /api/v1/service/start: post: description: Start service @@ -1795,7 +1795,7 @@ paths: description: Server error tags: - Service - x-openapi-router-controller: gs_flex_coordinator.controllers.service_controller + x-openapi-router-controller: gscoordinator.flex.controllers.service_controller /api/v1/service/stop: post: description: Stop current service @@ -1815,7 +1815,7 @@ paths: description: Server error tags: - Service - x-openapi-router-controller: gs_flex_coordinator.controllers.service_controller + x-openapi-router-controller: gscoordinator.flex.controllers.service_controller components: responses: "400": diff --git a/flex/coordinator/gs_flex_coordinator/typing_utils.py b/coordinator/gscoordinator/flex/typing_utils.py similarity index 100% rename from flex/coordinator/gs_flex_coordinator/typing_utils.py rename to coordinator/gscoordinator/flex/typing_utils.py diff --git a/flex/coordinator/gs_flex_coordinator/util.py b/coordinator/gscoordinator/flex/util.py similarity index 98% rename from flex/coordinator/gs_flex_coordinator/util.py rename to coordinator/gscoordinator/flex/util.py index fa3c9dd7693a..e75b21c86e28 100644 --- a/flex/coordinator/gs_flex_coordinator/util.py +++ b/coordinator/gscoordinator/flex/util.py @@ -1,7 +1,7 @@ import datetime import typing -from gs_flex_coordinator import typing_utils +from gscoordinator.flex import typing_utils def _deserialize(data, klass): diff --git a/coordinator/pyproject.toml b/coordinator/pyproject.toml index 69b163f11ae4..56911a8e3d3f 100644 --- a/coordinator/pyproject.toml +++ b/coordinator/pyproject.toml @@ -4,4 +4,17 @@ build-backend = "setuptools.build_meta" [tool.black] line-length = 88 -exclude = '.*\/(forward|node_modules|\.eggs|build|_pb2\.py)\/.*' +exclude = ''' +( + .*forward.* + | .*node_modules.* + | .*\.eggs.* + | .*build/.* + | ^/dist.* + | .*_pb2\.py + | .*_pb2_grpc\.py + | .*gscoordinator/flex/models/* + | .*gscoordinator/flex/controllers/* + | .*gscoordinator/flex/.*\.py +) +''' diff --git a/coordinator/requirements.txt b/coordinator/requirements.txt index 72e88e88fbe1..d0e6d32c3ca9 100644 --- a/coordinator/requirements.txt +++ b/coordinator/requirements.txt @@ -9,3 +9,14 @@ vineyard-io>=0.16.3;sys_platform!="win32" prometheus-client>=0.14.1 packaging tqdm +connexion == 2.14.2 +werkzeug == 2.3.8; python_version=="3.5" or python_version=="3.4" +swagger-ui-bundle >= 0.0.2 +python_dateutil >= 2.6.0 +Flask == 2.2.5 +urllib3 >= 1.25.3, < 2.1.0 +pydantic >= 2 +typing-extensions >= 4.7.1 +psutil +schedule +interactive-sdk == 0.0.3 diff --git a/coordinator/setup.cfg b/coordinator/setup.cfg index 9d3876c1c224..8f2e613b7c5f 100644 --- a/coordinator/setup.cfg +++ b/coordinator/setup.cfg @@ -16,7 +16,7 @@ upload_dir = docs/_build/html ensure_newline_before_comments = True line_length = 88 force_single_line = True -skip = build/,dist/ +skip = build/,dist/,gscoordinator/flex/models/,gscoordinator/flex/controllers/,gscoordinator/flex/util.py skip_glob = *_pb2.py,*_pb2_grpc.py,*_pb2.pyi,*_pb2_grpc.pyi [flake8] @@ -25,7 +25,7 @@ max-complexity = 18 # for flake8-quotes inline-quotes = double # for flake8-comprehensions -extend-ignore = E203,E402,F401,F401,F403,C4,N802,N806 +extend-ignore = E203,E402,F401,F401,F403,C4,N802,N806,I250,W605 extend-exclude = .eggs/ *_pb2.py @@ -36,6 +36,9 @@ extend-exclude = build/ dist/ tests/** + gscoordinator/flex/models/** + gscoordinator/flex/controllers/** + gscoordinator/flex/*.py [pylint] max-line-length = 88 diff --git a/coordinator/setup.py b/coordinator/setup.py index dced1692db18..b93bc14a9162 100644 --- a/coordinator/setup.py +++ b/coordinator/setup.py @@ -369,6 +369,76 @@ def parse_version(root, **kwargs): return parse(root, **kwargs) +class GenerateFlexServer(Command): + description = "generate flex server from OpenApi specification file" + user_options = [] + + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + # tempdir + tempdir = os.path.join("/", tempfile.gettempprefix(), "gscoordinator") + if os.path.exists(tempdir): + shutil.rmtree(tempdir) + targetdir = os.path.join(repo_root, "gscoordinator", "flex") + # generate + specification = os.path.join( + repo_root, "..", "flex", "openapi", "openapi_coordinator.yaml" + ) + cmd = [ + "openapi-generator-cli", + "generate", + "-g", + "python-flask", + "-i", + str(specification), + "-o", + str(tempdir), + "--package-name", + "gscoordinator.flex", + ] + env = os.environ.copy() + env["OPENAPI_GENERATOR_VERSION"] = "7.3.0" + subprocess.check_call( + cmd, + env=env, + ) + + # remove + if os.path.exists(os.path.join(targetdir, "models")): + shutil.rmtree(os.path.join(targetdir, "models")) + # cp + subprocess.run( + [ + "cp", + "-r", + os.path.join(tempdir, "gscoordinator", "flex", "models"), + os.path.join(targetdir, "models"), + ] + ) + for filename in ["encoder.py", "typing_utils.py", "util.py"]: + subprocess.run( + [ + "cp", + os.path.join(tempdir, "gscoordinator", "flex", filename), + targetdir, + ] + ) + subprocess.run( + [ + "cp", + os.path.join( + tempdir, "gscoordinator", "flex", "openapi", "openapi.yaml" + ), + os.path.join(targetdir, "openapi"), + ] + ) + + setup( name=os.environ.get("package_name", "gs-coordinator"), description="", @@ -412,6 +482,7 @@ def parse_version(root, **kwargs): "sdist": CustomSDist, "develop": CustomDevelop, "lint": FormatAndLint, + "generate_flex_server": GenerateFlexServer, }, install_requires=parsed_reqs(), extras_require=parsed_dev_reqs(), diff --git a/flex/coordinator/.dockerignore b/flex/coordinator/.dockerignore deleted file mode 100644 index f9619601908b..000000000000 --- a/flex/coordinator/.dockerignore +++ /dev/null @@ -1,72 +0,0 @@ -.travis.yaml -.openapi-generator-ignore -README.md -tox.ini -git_push.sh -test-requirements.txt -setup.py - -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*,cover -.hypothesis/ -venv/ -.python-version - -# Translations -*.mo -*.pot - -# Django stuff: -*.log - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -#Ipython Notebook -.ipynb_checkpoints diff --git a/flex/coordinator/.gitignore b/flex/coordinator/.gitignore deleted file mode 100644 index 43995bd42fa2..000000000000 --- a/flex/coordinator/.gitignore +++ /dev/null @@ -1,66 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*,cover -.hypothesis/ -venv/ -.venv/ -.python-version -.pytest_cache - -# Translations -*.mo -*.pot - -# Django stuff: -*.log - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -#Ipython Notebook -.ipynb_checkpoints diff --git a/flex/coordinator/.openapi-generator-ignore b/flex/coordinator/.openapi-generator-ignore deleted file mode 100644 index b215b2c874ac..000000000000 --- a/flex/coordinator/.openapi-generator-ignore +++ /dev/null @@ -1,27 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md - -gs_flex_coordinator/controllers/* -setup.py -requirements.txt diff --git a/flex/coordinator/.openapi-generator/FILES b/flex/coordinator/.openapi-generator/FILES deleted file mode 100644 index 651798f63192..000000000000 --- a/flex/coordinator/.openapi-generator/FILES +++ /dev/null @@ -1,73 +0,0 @@ -.dockerignore -.gitignore -.travis.yml -Dockerfile -README.md -git_push.sh -gs_flex_coordinator/__init__.py -gs_flex_coordinator/__main__.py -gs_flex_coordinator/encoder.py -gs_flex_coordinator/models/__init__.py -gs_flex_coordinator/models/base_edge_type.py -gs_flex_coordinator/models/base_edge_type_vertex_type_pair_relations_inner.py -gs_flex_coordinator/models/base_edge_type_vertex_type_pair_relations_inner_x_csr_params.py -gs_flex_coordinator/models/base_model.py -gs_flex_coordinator/models/base_property_meta.py -gs_flex_coordinator/models/base_vertex_type.py -gs_flex_coordinator/models/base_vertex_type_x_csr_params.py -gs_flex_coordinator/models/column_mapping.py -gs_flex_coordinator/models/column_mapping_column.py -gs_flex_coordinator/models/create_alert_receiver_request.py -gs_flex_coordinator/models/create_alert_rule_request.py -gs_flex_coordinator/models/create_dataloading_job_response.py -gs_flex_coordinator/models/create_edge_type.py -gs_flex_coordinator/models/create_graph_request.py -gs_flex_coordinator/models/create_graph_response.py -gs_flex_coordinator/models/create_graph_schema_request.py -gs_flex_coordinator/models/create_property_meta.py -gs_flex_coordinator/models/create_stored_proc_request.py -gs_flex_coordinator/models/create_stored_proc_response.py -gs_flex_coordinator/models/create_vertex_type.py -gs_flex_coordinator/models/dataloading_job_config.py -gs_flex_coordinator/models/dataloading_job_config_edges_inner.py -gs_flex_coordinator/models/dataloading_job_config_loading_config.py -gs_flex_coordinator/models/dataloading_job_config_loading_config_format.py -gs_flex_coordinator/models/dataloading_job_config_vertices_inner.py -gs_flex_coordinator/models/edge_mapping.py -gs_flex_coordinator/models/edge_mapping_type_triplet.py -gs_flex_coordinator/models/error.py -gs_flex_coordinator/models/get_alert_message_response.py -gs_flex_coordinator/models/get_alert_receiver_response.py -gs_flex_coordinator/models/get_alert_rule_response.py -gs_flex_coordinator/models/get_edge_type.py -gs_flex_coordinator/models/get_graph_response.py -gs_flex_coordinator/models/get_graph_schema_response.py -gs_flex_coordinator/models/get_property_meta.py -gs_flex_coordinator/models/get_stored_proc_response.py -gs_flex_coordinator/models/get_vertex_type.py -gs_flex_coordinator/models/gs_data_type.py -gs_flex_coordinator/models/job_status.py -gs_flex_coordinator/models/long_text.py -gs_flex_coordinator/models/node_status.py -gs_flex_coordinator/models/parameter.py -gs_flex_coordinator/models/primitive_type.py -gs_flex_coordinator/models/running_deployment_info.py -gs_flex_coordinator/models/running_deployment_status.py -gs_flex_coordinator/models/running_deployment_status_nodes_inner.py -gs_flex_coordinator/models/schema_mapping.py -gs_flex_coordinator/models/service_status.py -gs_flex_coordinator/models/service_status_sdk_endpoints.py -gs_flex_coordinator/models/start_service_request.py -gs_flex_coordinator/models/stored_procedure_meta.py -gs_flex_coordinator/models/string_type.py -gs_flex_coordinator/models/string_type_string.py -gs_flex_coordinator/models/update_alert_message_status_request.py -gs_flex_coordinator/models/update_stored_proc_request.py -gs_flex_coordinator/models/upload_file_response.py -gs_flex_coordinator/models/vertex_mapping.py -gs_flex_coordinator/openapi/openapi.yaml -gs_flex_coordinator/test/__init__.py -gs_flex_coordinator/typing_utils.py -gs_flex_coordinator/util.py -test-requirements.txt -tox.ini diff --git a/flex/coordinator/.openapi-generator/VERSION b/flex/coordinator/.openapi-generator/VERSION deleted file mode 100644 index 8b23b8d47ce2..000000000000 --- a/flex/coordinator/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.3.0 \ No newline at end of file diff --git a/flex/coordinator/.travis.yml b/flex/coordinator/.travis.yml deleted file mode 100644 index ad71ee5ca083..000000000000 --- a/flex/coordinator/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -# ref: https://docs.travis-ci.com/user/languages/python -language: python -python: - - "3.2" - - "3.3" - - "3.4" - - "3.5" - - "3.6" - - "3.7" - - "3.8" -# command to install dependencies -install: "pip install -r requirements.txt" -# command to run tests -script: nosetests diff --git a/flex/coordinator/Dockerfile b/flex/coordinator/Dockerfile deleted file mode 100644 index f52cc649c663..000000000000 --- a/flex/coordinator/Dockerfile +++ /dev/null @@ -1,16 +0,0 @@ -FROM python:3-alpine - -RUN mkdir -p /usr/src/app -WORKDIR /usr/src/app - -COPY requirements.txt /usr/src/app/ - -RUN pip3 install --no-cache-dir -r requirements.txt - -COPY . /usr/src/app - -EXPOSE 8080 - -ENTRYPOINT ["python3"] - -CMD ["-m", "gs_flex_coordinator"] \ No newline at end of file diff --git a/flex/coordinator/README.md b/flex/coordinator/README.md deleted file mode 100644 index 57e9714cc9c8..000000000000 --- a/flex/coordinator/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# OpenAPI generated server - -## Overview -This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the -[OpenAPI-Spec](https://openapis.org) from a remote server, you can easily generate a server stub. This -is an example of building a OpenAPI-enabled Flask server. - -This example uses the [Connexion](https://github.com/zalando/connexion) library on top of Flask. - -## Requirements -Python 3.5.2+ - -## Usage -To run the server, please execute the following from the root directory: - -``` -pip3 install -r requirements.txt -python3 -m gs_flex_coordinator -``` - -and open your browser to here: - -``` -http://localhost:8080/ui/ -``` - -Your OpenAPI definition lives here: - -``` -http://localhost:8080/openapi.json -``` - -To launch the integration tests, use tox: -``` -sudo pip install tox -tox -``` - -## Running with Docker - -To run the server on a Docker container, please execute the following from the root directory: - -```bash -# building the image -docker build -t gs_flex_coordinator . - -# starting up a container -docker run -p 8080:8080 gs_flex_coordinator -``` \ No newline at end of file diff --git a/flex/coordinator/git_push.sh b/flex/coordinator/git_push.sh deleted file mode 100644 index f53a75d4fabe..000000000000 --- a/flex/coordinator/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/flex/coordinator/gs_flex_coordinator/VERSION b/flex/coordinator/gs_flex_coordinator/VERSION deleted file mode 120000 index d62dc733efdf..000000000000 --- a/flex/coordinator/gs_flex_coordinator/VERSION +++ /dev/null @@ -1 +0,0 @@ -../../../VERSION \ No newline at end of file diff --git a/flex/coordinator/gs_flex_coordinator/__init__.py b/flex/coordinator/gs_flex_coordinator/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/flex/coordinator/gs_flex_coordinator/__main__.py b/flex/coordinator/gs_flex_coordinator/__main__.py deleted file mode 100644 index faad0ce0d5d6..000000000000 --- a/flex/coordinator/gs_flex_coordinator/__main__.py +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env python3 - -import connexion - -from gs_flex_coordinator import encoder - - -def main(): - app = connexion.App(__name__, specification_dir='./openapi/') - app.app.json_encoder = encoder.JSONEncoder - app.add_api('openapi.yaml', - arguments={'title': 'GraphScope FLEX HTTP SERVICE API'}, - pythonic_params=True) - - app.run(port=8080) - - -if __name__ == '__main__': - main() diff --git a/flex/coordinator/gs_flex_coordinator/controllers/__init__.py b/flex/coordinator/gs_flex_coordinator/controllers/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/flex/coordinator/gs_flex_coordinator/models/__init__.py b/flex/coordinator/gs_flex_coordinator/models/__init__.py deleted file mode 100644 index 3dd32a1f6baf..000000000000 --- a/flex/coordinator/gs_flex_coordinator/models/__init__.py +++ /dev/null @@ -1,58 +0,0 @@ -# flake8: noqa -# import models into model package -from gs_flex_coordinator.models.base_edge_type import BaseEdgeType -from gs_flex_coordinator.models.base_edge_type_vertex_type_pair_relations_inner import BaseEdgeTypeVertexTypePairRelationsInner -from gs_flex_coordinator.models.base_edge_type_vertex_type_pair_relations_inner_x_csr_params import BaseEdgeTypeVertexTypePairRelationsInnerXCsrParams -from gs_flex_coordinator.models.base_property_meta import BasePropertyMeta -from gs_flex_coordinator.models.base_vertex_type import BaseVertexType -from gs_flex_coordinator.models.base_vertex_type_x_csr_params import BaseVertexTypeXCsrParams -from gs_flex_coordinator.models.column_mapping import ColumnMapping -from gs_flex_coordinator.models.column_mapping_column import ColumnMappingColumn -from gs_flex_coordinator.models.create_alert_receiver_request import CreateAlertReceiverRequest -from gs_flex_coordinator.models.create_alert_rule_request import CreateAlertRuleRequest -from gs_flex_coordinator.models.create_dataloading_job_response import CreateDataloadingJobResponse -from gs_flex_coordinator.models.create_edge_type import CreateEdgeType -from gs_flex_coordinator.models.create_graph_request import CreateGraphRequest -from gs_flex_coordinator.models.create_graph_response import CreateGraphResponse -from gs_flex_coordinator.models.create_graph_schema_request import CreateGraphSchemaRequest -from gs_flex_coordinator.models.create_property_meta import CreatePropertyMeta -from gs_flex_coordinator.models.create_stored_proc_request import CreateStoredProcRequest -from gs_flex_coordinator.models.create_stored_proc_response import CreateStoredProcResponse -from gs_flex_coordinator.models.create_vertex_type import CreateVertexType -from gs_flex_coordinator.models.dataloading_job_config import DataloadingJobConfig -from gs_flex_coordinator.models.dataloading_job_config_edges_inner import DataloadingJobConfigEdgesInner -from gs_flex_coordinator.models.dataloading_job_config_loading_config import DataloadingJobConfigLoadingConfig -from gs_flex_coordinator.models.dataloading_job_config_loading_config_format import DataloadingJobConfigLoadingConfigFormat -from gs_flex_coordinator.models.dataloading_job_config_vertices_inner import DataloadingJobConfigVerticesInner -from gs_flex_coordinator.models.edge_mapping import EdgeMapping -from gs_flex_coordinator.models.edge_mapping_type_triplet import EdgeMappingTypeTriplet -from gs_flex_coordinator.models.error import Error -from gs_flex_coordinator.models.gs_data_type import GSDataType -from gs_flex_coordinator.models.get_alert_message_response import GetAlertMessageResponse -from gs_flex_coordinator.models.get_alert_receiver_response import GetAlertReceiverResponse -from gs_flex_coordinator.models.get_alert_rule_response import GetAlertRuleResponse -from gs_flex_coordinator.models.get_edge_type import GetEdgeType -from gs_flex_coordinator.models.get_graph_response import GetGraphResponse -from gs_flex_coordinator.models.get_graph_schema_response import GetGraphSchemaResponse -from gs_flex_coordinator.models.get_property_meta import GetPropertyMeta -from gs_flex_coordinator.models.get_stored_proc_response import GetStoredProcResponse -from gs_flex_coordinator.models.get_vertex_type import GetVertexType -from gs_flex_coordinator.models.job_status import JobStatus -from gs_flex_coordinator.models.long_text import LongText -from gs_flex_coordinator.models.node_status import NodeStatus -from gs_flex_coordinator.models.parameter import Parameter -from gs_flex_coordinator.models.primitive_type import PrimitiveType -from gs_flex_coordinator.models.running_deployment_info import RunningDeploymentInfo -from gs_flex_coordinator.models.running_deployment_status import RunningDeploymentStatus -from gs_flex_coordinator.models.running_deployment_status_nodes_inner import RunningDeploymentStatusNodesInner -from gs_flex_coordinator.models.schema_mapping import SchemaMapping -from gs_flex_coordinator.models.service_status import ServiceStatus -from gs_flex_coordinator.models.service_status_sdk_endpoints import ServiceStatusSdkEndpoints -from gs_flex_coordinator.models.start_service_request import StartServiceRequest -from gs_flex_coordinator.models.stored_procedure_meta import StoredProcedureMeta -from gs_flex_coordinator.models.string_type import StringType -from gs_flex_coordinator.models.string_type_string import StringTypeString -from gs_flex_coordinator.models.update_alert_message_status_request import UpdateAlertMessageStatusRequest -from gs_flex_coordinator.models.update_stored_proc_request import UpdateStoredProcRequest -from gs_flex_coordinator.models.upload_file_response import UploadFileResponse -from gs_flex_coordinator.models.vertex_mapping import VertexMapping diff --git a/flex/coordinator/gs_flex_coordinator/test/__init__.py b/flex/coordinator/gs_flex_coordinator/test/__init__.py deleted file mode 100644 index 1e4bf4ab1e42..000000000000 --- a/flex/coordinator/gs_flex_coordinator/test/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -import logging - -import connexion -from flask_testing import TestCase - -from gs_flex_coordinator.encoder import JSONEncoder - - -class BaseTestCase(TestCase): - - def create_app(self): - logging.getLogger('connexion.operation').setLevel('ERROR') - app = connexion.App(__name__, specification_dir='../openapi/') - app.app.json_encoder = JSONEncoder - app.add_api('openapi.yaml', pythonic_params=True) - return app.app diff --git a/flex/coordinator/gs_flex_coordinator/test/test_alert_controller.py b/flex/coordinator/gs_flex_coordinator/test/test_alert_controller.py deleted file mode 100644 index 2cff1242d052..000000000000 --- a/flex/coordinator/gs_flex_coordinator/test/test_alert_controller.py +++ /dev/null @@ -1,195 +0,0 @@ -import unittest - -from flask import json - -from gs_flex_coordinator.models.create_alert_receiver_request import CreateAlertReceiverRequest # noqa: E501 -from gs_flex_coordinator.models.create_alert_rule_request import CreateAlertRuleRequest # noqa: E501 -from gs_flex_coordinator.models.error import Error # noqa: E501 -from gs_flex_coordinator.models.get_alert_message_response import GetAlertMessageResponse # noqa: E501 -from gs_flex_coordinator.models.get_alert_receiver_response import GetAlertReceiverResponse # noqa: E501 -from gs_flex_coordinator.models.get_alert_rule_response import GetAlertRuleResponse # noqa: E501 -from gs_flex_coordinator.models.update_alert_message_status_request import UpdateAlertMessageStatusRequest # noqa: E501 -from gs_flex_coordinator.test import BaseTestCase - - -class TestAlertController(BaseTestCase): - """AlertController integration test stubs""" - - def test_create_alert_receiver(self): - """Test case for create_alert_receiver - - - """ - create_alert_receiver_request = {"webhook_url":"webhook_url","is_at_all":True,"enable":True,"at_user_ids":["at_user_ids","at_user_ids"],"type":"webhook"} - headers = { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - } - response = self.client.open( - '/api/v1/alert/receiver', - method='POST', - headers=headers, - data=json.dumps(create_alert_receiver_request), - content_type='application/json') - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_delete_alert_message_in_batch(self): - """Test case for delete_alert_message_in_batch - - - """ - query_string = [('message_ids', 'message_ids_example')] - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/alert/message-collection', - method='DELETE', - headers=headers, - query_string=query_string) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_delete_alert_receiver_by_id(self): - """Test case for delete_alert_receiver_by_id - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/alert/receiver/{receiver_id}'.format(receiver_id='receiver_id_example'), - method='DELETE', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_delete_alert_rule_by_id(self): - """Test case for delete_alert_rule_by_id - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/alert/rule/{rule_id}'.format(rule_id='rule_id_example'), - method='DELETE', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_list_alert_messages(self): - """Test case for list_alert_messages - - - """ - query_string = [('alert_type', 'alert_type_example'), - ('status', 'status_example'), - ('severity', 'severity_example'), - ('start_time', 'start_time_example'), - ('end_time', 'end_time_example'), - ('limit', 56)] - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/alert/message', - method='GET', - headers=headers, - query_string=query_string) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_list_alert_receivers(self): - """Test case for list_alert_receivers - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/alert/receiver', - method='GET', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_list_alert_rules(self): - """Test case for list_alert_rules - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/alert/rule', - method='GET', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_update_alert_message_in_batch(self): - """Test case for update_alert_message_in_batch - - - """ - update_alert_message_status_request = {"message_ids":["message_ids","message_ids"],"status":"unsolved"} - headers = { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - } - response = self.client.open( - '/api/v1/alert/message-collection/status', - method='PUT', - headers=headers, - data=json.dumps(update_alert_message_status_request), - content_type='application/json') - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_update_alert_receiver_by_id(self): - """Test case for update_alert_receiver_by_id - - - """ - create_alert_receiver_request = {"webhook_url":"webhook_url","is_at_all":True,"enable":True,"at_user_ids":["at_user_ids","at_user_ids"],"type":"webhook"} - headers = { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - } - response = self.client.open( - '/api/v1/alert/receiver/{receiver_id}'.format(receiver_id='receiver_id_example'), - method='PUT', - headers=headers, - data=json.dumps(create_alert_receiver_request), - content_type='application/json') - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_update_alert_rule_by_id(self): - """Test case for update_alert_rule_by_id - - - """ - create_alert_rule_request = {"severity":"warning","conditions_description":"conditions_description","enable":True,"name":"name","metric_type":"node","frequency":0} - headers = { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - } - response = self.client.open( - '/api/v1/alert/rule/{rule_id}'.format(rule_id='rule_id_example'), - method='PUT', - headers=headers, - data=json.dumps(create_alert_rule_request), - content_type='application/json') - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - -if __name__ == '__main__': - unittest.main() diff --git a/flex/coordinator/gs_flex_coordinator/test/test_data_source_controller.py b/flex/coordinator/gs_flex_coordinator/test/test_data_source_controller.py deleted file mode 100644 index e0f9f936f0d3..000000000000 --- a/flex/coordinator/gs_flex_coordinator/test/test_data_source_controller.py +++ /dev/null @@ -1,82 +0,0 @@ -import unittest - -from flask import json - -from gs_flex_coordinator.models.error import Error # noqa: E501 -from gs_flex_coordinator.models.schema_mapping import SchemaMapping # noqa: E501 -from gs_flex_coordinator.test import BaseTestCase - - -class TestDataSourceController(BaseTestCase): - """DataSourceController integration test stubs""" - - def test_bind_datasource_in_batch(self): - """Test case for bind_datasource_in_batch - - - """ - schema_mapping = {"edge_mappings":[{"inputs":["inputs","inputs"],"source_vertex_mappings":[{"column":{"name":"name","index":0},"property":"property"},{"column":{"name":"name","index":0},"property":"property"}],"destination_vertex_mappings":[{"column":{"name":"name","index":0},"property":"property"},{"column":{"name":"name","index":0},"property":"property"}],"column_mappings":[{"column":{"name":"name","index":0},"property":"property"},{"column":{"name":"name","index":0},"property":"property"}],"type_triplet":{"edge":"edge","source_vertex":"source_vertex","destination_vertex":"destination_vertex"}},{"inputs":["inputs","inputs"],"source_vertex_mappings":[{"column":{"name":"name","index":0},"property":"property"},{"column":{"name":"name","index":0},"property":"property"}],"destination_vertex_mappings":[{"column":{"name":"name","index":0},"property":"property"},{"column":{"name":"name","index":0},"property":"property"}],"column_mappings":[{"column":{"name":"name","index":0},"property":"property"},{"column":{"name":"name","index":0},"property":"property"}],"type_triplet":{"edge":"edge","source_vertex":"source_vertex","destination_vertex":"destination_vertex"}}],"vertex_mappings":[{"type_name":"type_name","inputs":["file:///path/to/file.csv","file:///path/to/file.csv"],"column_mappings":[{"column":{"name":"name","index":0},"property":"property"},{"column":{"name":"name","index":0},"property":"property"}]},{"type_name":"type_name","inputs":["file:///path/to/file.csv","file:///path/to/file.csv"],"column_mappings":[{"column":{"name":"name","index":0},"property":"property"},{"column":{"name":"name","index":0},"property":"property"}]}]} - headers = { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - } - response = self.client.open( - '/api/v1/graph/{graph_id}/datasource'.format(graph_id='graph_id_example'), - method='POST', - headers=headers, - data=json.dumps(schema_mapping), - content_type='application/json') - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_get_datasource_by_id(self): - """Test case for get_datasource_by_id - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/graph/{graph_id}/datasource'.format(graph_id='graph_id_example'), - method='GET', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_unbind_edge_datasource(self): - """Test case for unbind_edge_datasource - - - """ - query_string = [('source_vertex_type', 'source_vertex_type_example'), - ('destination_vertex_type', 'destination_vertex_type_example')] - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/graph/{graph_id}/datasource/edge/{type_name}'.format(graph_id='graph_id_example', type_name='type_name_example'), - method='DELETE', - headers=headers, - query_string=query_string) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_unbind_vertex_datasource(self): - """Test case for unbind_vertex_datasource - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/graph/{graph_id}/datasource/vertex/{type_name}'.format(graph_id='graph_id_example', type_name='type_name_example'), - method='DELETE', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - -if __name__ == '__main__': - unittest.main() diff --git a/flex/coordinator/gs_flex_coordinator/test/test_deployment_controller.py b/flex/coordinator/gs_flex_coordinator/test/test_deployment_controller.py deleted file mode 100644 index 2e9b769c8441..000000000000 --- a/flex/coordinator/gs_flex_coordinator/test/test_deployment_controller.py +++ /dev/null @@ -1,30 +0,0 @@ -import unittest - -from flask import json - -from gs_flex_coordinator.models.error import Error # noqa: E501 -from gs_flex_coordinator.models.running_deployment_info import RunningDeploymentInfo # noqa: E501 -from gs_flex_coordinator.test import BaseTestCase - - -class TestDeploymentController(BaseTestCase): - """DeploymentController integration test stubs""" - - def test_get_deployment_info(self): - """Test case for get_deployment_info - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/deployment/info', - method='GET', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - -if __name__ == '__main__': - unittest.main() diff --git a/flex/coordinator/gs_flex_coordinator/test/test_graph_controller.py b/flex/coordinator/gs_flex_coordinator/test/test_graph_controller.py deleted file mode 100644 index 72e904cde095..000000000000 --- a/flex/coordinator/gs_flex_coordinator/test/test_graph_controller.py +++ /dev/null @@ -1,190 +0,0 @@ -import unittest - -from flask import json - -from gs_flex_coordinator.models.create_edge_type import CreateEdgeType # noqa: E501 -from gs_flex_coordinator.models.create_graph_request import CreateGraphRequest # noqa: E501 -from gs_flex_coordinator.models.create_graph_response import CreateGraphResponse # noqa: E501 -from gs_flex_coordinator.models.create_graph_schema_request import CreateGraphSchemaRequest # noqa: E501 -from gs_flex_coordinator.models.create_vertex_type import CreateVertexType # noqa: E501 -from gs_flex_coordinator.models.error import Error # noqa: E501 -from gs_flex_coordinator.models.get_graph_response import GetGraphResponse # noqa: E501 -from gs_flex_coordinator.models.get_graph_schema_response import GetGraphSchemaResponse # noqa: E501 -from gs_flex_coordinator.test import BaseTestCase - - -class TestGraphController(BaseTestCase): - """GraphController integration test stubs""" - - def test_create_edge_type(self): - """Test case for create_edge_type - - - """ - create_edge_type = {"type_name":"type_name","directed":True,"primary_keys":["primary_keys","primary_keys"],"vertex_type_pair_relations":[{"source_vertex":"source_vertex","destination_vertex":"destination_vertex","x_csr_params":{"edge_storage_strategy":"ONLY_IN"},"relation":"MANY_TO_MANY"},{"source_vertex":"source_vertex","destination_vertex":"destination_vertex","x_csr_params":{"edge_storage_strategy":"ONLY_IN"},"relation":"MANY_TO_MANY"}],"description":"description","properties":[{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"},{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"}]} - headers = { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - } - response = self.client.open( - '/api/v1/graph/{graph_id}/schema/edge'.format(graph_id='graph_id_example'), - method='POST', - headers=headers, - data=json.dumps(create_edge_type), - content_type='application/json') - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_create_graph(self): - """Test case for create_graph - - - """ - create_graph_request = {"schema":{"vertex_types":[{"type_name":"type_name","primary_keys":["primary_keys","primary_keys"],"x_csr_params":{"max_vertex_num":0},"description":"description","properties":[{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"},{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"}]},{"type_name":"type_name","primary_keys":["primary_keys","primary_keys"],"x_csr_params":{"max_vertex_num":0},"description":"description","properties":[{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"},{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"}]}],"edge_types":[{"type_name":"type_name","directed":True,"primary_keys":["primary_keys","primary_keys"],"vertex_type_pair_relations":[{"source_vertex":"source_vertex","destination_vertex":"destination_vertex","x_csr_params":{"edge_storage_strategy":"ONLY_IN"},"relation":"MANY_TO_MANY"},{"source_vertex":"source_vertex","destination_vertex":"destination_vertex","x_csr_params":{"edge_storage_strategy":"ONLY_IN"},"relation":"MANY_TO_MANY"}],"description":"description","properties":[{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"},{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"}]},{"type_name":"type_name","directed":True,"primary_keys":["primary_keys","primary_keys"],"vertex_type_pair_relations":[{"source_vertex":"source_vertex","destination_vertex":"destination_vertex","x_csr_params":{"edge_storage_strategy":"ONLY_IN"},"relation":"MANY_TO_MANY"},{"source_vertex":"source_vertex","destination_vertex":"destination_vertex","x_csr_params":{"edge_storage_strategy":"ONLY_IN"},"relation":"MANY_TO_MANY"}],"description":"description","properties":[{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"},{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"}]}]},"stored_procedures":[{"query":"query","name":"name","description":"description","type":"cpp"},{"query":"query","name":"name","description":"description","type":"cpp"}],"name":"name","description":"description"} - headers = { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - } - response = self.client.open( - '/api/v1/graph', - method='POST', - headers=headers, - data=json.dumps(create_graph_request), - content_type='application/json') - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_create_vertex_type(self): - """Test case for create_vertex_type - - - """ - create_vertex_type = {"type_name":"type_name","primary_keys":["primary_keys","primary_keys"],"x_csr_params":{"max_vertex_num":0},"description":"description","properties":[{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"},{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"}]} - headers = { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - } - response = self.client.open( - '/api/v1/graph/{graph_id}/schema/vertex'.format(graph_id='graph_id_example'), - method='POST', - headers=headers, - data=json.dumps(create_vertex_type), - content_type='application/json') - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_delete_edge_type_by_name(self): - """Test case for delete_edge_type_by_name - - - """ - query_string = [('source_vertex_type', 'source_vertex_type_example'), - ('destination_vertex_type', 'destination_vertex_type_example')] - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/graph/{graph_id}/schema/edge/{type_name}'.format(graph_id='graph_id_example', type_name='type_name_example'), - method='DELETE', - headers=headers, - query_string=query_string) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_delete_graph_by_id(self): - """Test case for delete_graph_by_id - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/graph/{graph_id}'.format(graph_id='graph_id_example'), - method='DELETE', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_delete_vertex_type_by_name(self): - """Test case for delete_vertex_type_by_name - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/graph/{graph_id}/schema/vertex/{type_name}'.format(graph_id='graph_id_example', type_name='type_name_example'), - method='DELETE', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_get_graph_by_id(self): - """Test case for get_graph_by_id - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/graph/{graph_id}'.format(graph_id='graph_id_example'), - method='GET', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_get_schema_by_id(self): - """Test case for get_schema_by_id - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/graph/{graph_id}/schema'.format(graph_id='graph_id_example'), - method='GET', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_import_schema_by_id(self): - """Test case for import_schema_by_id - - - """ - create_graph_schema_request = {"vertex_types":[{"type_name":"type_name","primary_keys":["primary_keys","primary_keys"],"x_csr_params":{"max_vertex_num":0},"description":"description","properties":[{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"},{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"}]},{"type_name":"type_name","primary_keys":["primary_keys","primary_keys"],"x_csr_params":{"max_vertex_num":0},"description":"description","properties":[{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"},{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"}]}],"edge_types":[{"type_name":"type_name","directed":True,"primary_keys":["primary_keys","primary_keys"],"vertex_type_pair_relations":[{"source_vertex":"source_vertex","destination_vertex":"destination_vertex","x_csr_params":{"edge_storage_strategy":"ONLY_IN"},"relation":"MANY_TO_MANY"},{"source_vertex":"source_vertex","destination_vertex":"destination_vertex","x_csr_params":{"edge_storage_strategy":"ONLY_IN"},"relation":"MANY_TO_MANY"}],"description":"description","properties":[{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"},{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"}]},{"type_name":"type_name","directed":True,"primary_keys":["primary_keys","primary_keys"],"vertex_type_pair_relations":[{"source_vertex":"source_vertex","destination_vertex":"destination_vertex","x_csr_params":{"edge_storage_strategy":"ONLY_IN"},"relation":"MANY_TO_MANY"},{"source_vertex":"source_vertex","destination_vertex":"destination_vertex","x_csr_params":{"edge_storage_strategy":"ONLY_IN"},"relation":"MANY_TO_MANY"}],"description":"description","properties":[{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"},{"nullable":True,"property_type":{"primitive_type":"DT_SIGNED_INT32"},"description":"description","default_value":"","property_name":"property_name"}]}]} - headers = { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - } - response = self.client.open( - '/api/v1/graph/{graph_id}/schema'.format(graph_id='graph_id_example'), - method='POST', - headers=headers, - data=json.dumps(create_graph_schema_request), - content_type='application/json') - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_list_graphs(self): - """Test case for list_graphs - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/graph', - method='GET', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - -if __name__ == '__main__': - unittest.main() diff --git a/flex/coordinator/gs_flex_coordinator/test/test_job_controller.py b/flex/coordinator/gs_flex_coordinator/test/test_job_controller.py deleted file mode 100644 index 23e7be21e1ac..000000000000 --- a/flex/coordinator/gs_flex_coordinator/test/test_job_controller.py +++ /dev/null @@ -1,96 +0,0 @@ -import unittest - -from flask import json - -from gs_flex_coordinator.models.create_dataloading_job_response import CreateDataloadingJobResponse # noqa: E501 -from gs_flex_coordinator.models.dataloading_job_config import DataloadingJobConfig # noqa: E501 -from gs_flex_coordinator.models.error import Error # noqa: E501 -from gs_flex_coordinator.models.job_status import JobStatus # noqa: E501 -from gs_flex_coordinator.test import BaseTestCase - - -class TestJobController(BaseTestCase): - """JobController integration test stubs""" - - def test_delete_job_by_id(self): - """Test case for delete_job_by_id - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/ap1/v1/job/{job_id}'.format(job_id='job_id_example'), - method='DELETE', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_get_dataloading_job_config(self): - """Test case for get_dataloading_job_config - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/graph/{graph_id}/dataloading/config'.format(graph_id='graph_id_example'), - method='GET', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_get_job_by_id(self): - """Test case for get_job_by_id - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/ap1/v1/job/{job_id}'.format(job_id='job_id_example'), - method='GET', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_list_jobs(self): - """Test case for list_jobs - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/job', - method='GET', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_submit_dataloading_job(self): - """Test case for submit_dataloading_job - - - """ - dataloading_job_config = {"schedule":"schedule","loading_config":{"format":{"metadata":{"key":""},"type":"type"},"import_option":"overwrite"},"vertices":[{"type_name":"type_name"},{"type_name":"type_name"}],"repeat":"once","edges":[{"type_name":"type_name","source_vertex":"source_vertex","destination_vertex":"destination_vertex"},{"type_name":"type_name","source_vertex":"source_vertex","destination_vertex":"destination_vertex"}]} - headers = { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - } - response = self.client.open( - '/api/v1/graph/{graph_id}/dataloading'.format(graph_id='graph_id_example'), - method='POST', - headers=headers, - data=json.dumps(dataloading_job_config), - content_type='application/json') - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - -if __name__ == '__main__': - unittest.main() diff --git a/flex/coordinator/gs_flex_coordinator/test/test_procedure_controller.py b/flex/coordinator/gs_flex_coordinator/test/test_procedure_controller.py deleted file mode 100644 index 4121510f4801..000000000000 --- a/flex/coordinator/gs_flex_coordinator/test/test_procedure_controller.py +++ /dev/null @@ -1,101 +0,0 @@ -import unittest - -from flask import json - -from gs_flex_coordinator.models.create_procedure_request import CreateProcedureRequest # noqa: E501 -from gs_flex_coordinator.models.create_procedure_response import CreateProcedureResponse # noqa: E501 -from gs_flex_coordinator.models.error import Error # noqa: E501 -from gs_flex_coordinator.models.get_procedure_response import GetProcedureResponse # noqa: E501 -from gs_flex_coordinator.models.update_procedure_request import UpdateProcedureRequest # noqa: E501 -from gs_flex_coordinator.test import BaseTestCase - - -class TestProcedureController(BaseTestCase): - """ProcedureController integration test stubs""" - - def test_create_procedure(self): - """Test case for create_procedure - - - """ - create_procedure_request = {"query":"query","name":"name","description":"description","type":"cpp"} - headers = { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - } - response = self.client.open( - '/v1/graph/{graph_id}/procedure'.format(graph_id='graph_id_example'), - method='POST', - headers=headers, - data=json.dumps(create_procedure_request), - content_type='application/json') - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_delete_procedure_by_id(self): - """Test case for delete_procedure_by_id - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/v1/graph/{graph_id}/procedure/{procedure_id}'.format(graph_id='graph_id_example', procedure_id='procedure_id_example'), - method='DELETE', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_get_procedure_by_id(self): - """Test case for get_procedure_by_id - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/v1/graph/{graph_id}/procedure/{procedure_id}'.format(graph_id='graph_id_example', procedure_id='procedure_id_example'), - method='GET', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_list_procedures(self): - """Test case for list_procedures - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/v1/graph/{graph_id}/procedure'.format(graph_id='graph_id_example'), - method='GET', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_update_procedure_by_id(self): - """Test case for update_procedure_by_id - - - """ - update_procedure_request = {"description":"description"} - headers = { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - } - response = self.client.open( - '/v1/graph/{graph_id}/procedure/{procedure_id}'.format(graph_id='graph_id_example', procedure_id='procedure_id_example'), - method='PUT', - headers=headers, - data=json.dumps(update_procedure_request), - content_type='application/json') - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - -if __name__ == '__main__': - unittest.main() diff --git a/flex/coordinator/gs_flex_coordinator/test/test_service_controller.py b/flex/coordinator/gs_flex_coordinator/test/test_service_controller.py deleted file mode 100644 index c92cda14693e..000000000000 --- a/flex/coordinator/gs_flex_coordinator/test/test_service_controller.py +++ /dev/null @@ -1,80 +0,0 @@ -import unittest - -from flask import json - -from gs_flex_coordinator.models.error import Error # noqa: E501 -from gs_flex_coordinator.models.service_status import ServiceStatus # noqa: E501 -from gs_flex_coordinator.models.start_service_request import StartServiceRequest # noqa: E501 -from gs_flex_coordinator.test import BaseTestCase - - -class TestServiceController(BaseTestCase): - """ServiceController integration test stubs""" - - def test_get_service_status(self): - """Test case for get_service_status - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/service/status', - method='GET', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_restart_service(self): - """Test case for restart_service - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/service/restart', - method='POST', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_start_service(self): - """Test case for start_service - - - """ - start_service_request = {"graph_id":"graph_id"} - headers = { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - } - response = self.client.open( - '/api/v1/service/start', - method='POST', - headers=headers, - data=json.dumps(start_service_request), - content_type='application/json') - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_stop_service(self): - """Test case for stop_service - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/service/stop', - method='POST', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - -if __name__ == '__main__': - unittest.main() diff --git a/flex/coordinator/gs_flex_coordinator/test/test_stored_procedure_controller.py b/flex/coordinator/gs_flex_coordinator/test/test_stored_procedure_controller.py deleted file mode 100644 index e112c134c30f..000000000000 --- a/flex/coordinator/gs_flex_coordinator/test/test_stored_procedure_controller.py +++ /dev/null @@ -1,101 +0,0 @@ -import unittest - -from flask import json - -from gs_flex_coordinator.models.create_stored_proc_request import CreateStoredProcRequest # noqa: E501 -from gs_flex_coordinator.models.create_stored_proc_response import CreateStoredProcResponse # noqa: E501 -from gs_flex_coordinator.models.error import Error # noqa: E501 -from gs_flex_coordinator.models.get_stored_proc_response import GetStoredProcResponse # noqa: E501 -from gs_flex_coordinator.models.update_stored_proc_request import UpdateStoredProcRequest # noqa: E501 -from gs_flex_coordinator.test import BaseTestCase - - -class TestStoredProcedureController(BaseTestCase): - """StoredProcedureController integration test stubs""" - - def test_create_stored_procedure(self): - """Test case for create_stored_procedure - - - """ - create_stored_proc_request = {"query":"query","name":"name","description":"description","type":"cpp"} - headers = { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - } - response = self.client.open( - '/api/v1/graph/{graph_id}/storedproc'.format(graph_id='graph_id_example'), - method='POST', - headers=headers, - data=json.dumps(create_stored_proc_request), - content_type='application/json') - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_delete_stored_procedure_by_id(self): - """Test case for delete_stored_procedure_by_id - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/graph/{graph_id}/storedproc/{stored_procedure_id}'.format(graph_id='graph_id_example', stored_procedure_id='stored_procedure_id_example'), - method='DELETE', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_get_stored_procedure_by_id(self): - """Test case for get_stored_procedure_by_id - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/graph/{graph_id}/storedproc/{stored_procedure_id}'.format(graph_id='graph_id_example', stored_procedure_id='stored_procedure_id_example'), - method='GET', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_list_stored_procedures(self): - """Test case for list_stored_procedures - - - """ - headers = { - 'Accept': 'application/json', - } - response = self.client.open( - '/api/v1/graph/{graph_id}/storedproc'.format(graph_id='graph_id_example'), - method='GET', - headers=headers) - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - def test_update_stored_procedure_by_id(self): - """Test case for update_stored_procedure_by_id - - - """ - update_stored_proc_request = {"description":"description"} - headers = { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - } - response = self.client.open( - '/api/v1/graph/{graph_id}/storedproc/{stored_procedure_id}'.format(graph_id='graph_id_example', stored_procedure_id='stored_procedure_id_example'), - method='PUT', - headers=headers, - data=json.dumps(update_stored_proc_request), - content_type='application/json') - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - -if __name__ == '__main__': - unittest.main() diff --git a/flex/coordinator/gs_flex_coordinator/test/test_utils_controller.py b/flex/coordinator/gs_flex_coordinator/test/test_utils_controller.py deleted file mode 100644 index f48c9bff8701..000000000000 --- a/flex/coordinator/gs_flex_coordinator/test/test_utils_controller.py +++ /dev/null @@ -1,35 +0,0 @@ -import unittest - -from flask import json - -from gs_flex_coordinator.models.error import Error # noqa: E501 -from gs_flex_coordinator.models.upload_file_response import UploadFileResponse # noqa: E501 -from gs_flex_coordinator.test import BaseTestCase - - -class TestUtilsController(BaseTestCase): - """UtilsController integration test stubs""" - - @unittest.skip("multipart/form-data not supported by Connexion") - def test_upload_file(self): - """Test case for upload_file - - - """ - headers = { - 'Accept': 'application/json', - 'Content-Type': 'multipart/form-data', - } - data = dict(filestorage='/path/to/file') - response = self.client.open( - '/api/v1/file/uploading', - method='POST', - headers=headers, - data=data, - content_type='multipart/form-data') - self.assert200(response, - 'Response body is : ' + response.data.decode('utf-8')) - - -if __name__ == '__main__': - unittest.main() diff --git a/flex/coordinator/gs_flex_coordinator/version.py b/flex/coordinator/gs_flex_coordinator/version.py deleted file mode 100644 index b54d11f153b5..000000000000 --- a/flex/coordinator/gs_flex_coordinator/version.py +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# -# Copyright 2024 Alibaba Group Holding Limited. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import os - -from packaging import version - -version_file_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "VERSION") - -with open(version_file_path, "r", encoding="utf-8") as fp: - sv = version.parse(fp.read().strip()) - __is_prerelease__ = sv.is_prerelease - __version__ = str(sv) - -__version_tuple__ = (v for v in __version__.split(".")) - -del version_file_path diff --git a/flex/coordinator/pyproject.toml b/flex/coordinator/pyproject.toml deleted file mode 100644 index 8bb6ee5f516f..000000000000 --- a/flex/coordinator/pyproject.toml +++ /dev/null @@ -1,2 +0,0 @@ -[tool.black] -line-length = 88 diff --git a/flex/coordinator/requirements.txt b/flex/coordinator/requirements.txt deleted file mode 100644 index f3d3b4171b85..000000000000 --- a/flex/coordinator/requirements.txt +++ /dev/null @@ -1,12 +0,0 @@ -connexion == 2.14.2 -werkzeug == 2.3.8; python_version=="3.5" or python_version=="3.4" -swagger-ui-bundle >= 0.0.2 -python_dateutil >= 2.6.0 -setuptools >= 21.0.0 -Flask == 2.2.5 -urllib3 >= 1.25.3, < 2.1.0 -pydantic >= 2 -typing-extensions >= 4.7.1 -psutil -schedule -interactive-sdk == 0.0.3 diff --git a/flex/coordinator/setup.cfg b/flex/coordinator/setup.cfg deleted file mode 100644 index 194d641fbbc2..000000000000 --- a/flex/coordinator/setup.cfg +++ /dev/null @@ -1,8 +0,0 @@ -[isort] -ensure_newline_before_comments = True -line_length = 88 -force_single_line = True - -[flake8] -max-line-length = 88 -extend-ignore = E203,F401,F401,F403,C4,I250,E402,W605 diff --git a/flex/coordinator/setup.py b/flex/coordinator/setup.py deleted file mode 100644 index 78abe0932790..000000000000 --- a/flex/coordinator/setup.py +++ /dev/null @@ -1,138 +0,0 @@ -#! /usr/bin/env python3 -# -*- coding: utf-8 -*- -# -# Copyright 2024 Alibaba Group Holding Limited. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -import os -import shutil -import subprocess -import sys -import tempfile -from distutils.cmd import Command - -from setuptools import find_packages, setup - -NAME = "gs_flex_coordinator" -VERSION = "1.0.0" - -pkg_root = os.path.dirname(os.path.abspath(__file__)) - - -def parsed_reqs(): - with open(os.path.join(pkg_root, "requirements.txt"), "r", encoding="utf-8") as fp: - return fp.read().splitlines() - - -class GenerateFlexServer(Command): - description = "generate flex server from openapi specification file" - user_options = [] - - def initialize_options(self): - pass - - def finalize_options(self): - pass - - def run(self): - # generate server code, note that controllers are not included here, - # see from .openapi-generator-ignore - specification = os.path.join( - pkg_root, "..", "openapi", "openapi_coordinator.yaml" - ) - cmd = [ - "openapi-generator-cli", - "generate", - "-g", - "python-flask", - "-i", - str(specification), - "-o", - str(pkg_root), - "--package-name", - "gs_flex_coordinator", - ] - print(" ".join(cmd)) - env = os.environ.copy() - env["OPENAPI_GENERATOR_VERSION"] = "7.3.0" - subprocess.check_call( - cmd, - env=env, - ) - - -class FormatAndLint(Command): - description = "format and lint code" - user_options = [] - - user_options = [("inplace=", "i", "Run code formatter and linter inplace")] - - def initialize_options(self): - self.inplace = False - - def finalize_options(self): - if self.inplace or self.inplace == "True" or self.inplace == "true": - self.inplace = True - else: - self.inplace = False - - def run(self): - codedir = os.path.join(pkg_root, "gs_flex_coordinator", "core") - if self.inplace: - subprocess.check_call( - [sys.executable, "-m", "isort", codedir], cwd=pkg_root - ) - subprocess.check_call( - [sys.executable, "-m", "black", codedir], cwd=pkg_root - ) - subprocess.check_call( - [sys.executable, "-m", "flake8", codedir], cwd=pkg_root - ) - else: - subprocess.check_call( - [sys.executable, "-m", "isort", "--check", "--diff", codedir], - cwd=pkg_root, - ) - subprocess.check_call( - [sys.executable, "-m", "black", "--check", "--diff", codedir], - cwd=pkg_root, - ) - subprocess.check_call( - [sys.executable, "-m", "flake8", codedir], cwd=pkg_root - ) - - -setup( - name=NAME, - version=VERSION, - description="GraphScope FLEX HTTP SERVICE API", - author_email="graphscope@alibaba-inc.com", - url="", - keywords=["OpenAPI", "GraphScope FLEX HTTP SERVICE API"], - install_requires=parsed_reqs(), - packages=find_packages(), - package_data={"": ["openapi/openapi.yaml", "VERSION"]}, - cmdclass={ - "generate_flex_server": GenerateFlexServer, - "lint": FormatAndLint, - }, - include_package_data=True, - entry_points={ - "console_scripts": ["gs_flex_coordinator=gs_flex_coordinator.__main__:main"] - }, - long_description="""\ - 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) - """, -) diff --git a/flex/coordinator/test-requirements.txt b/flex/coordinator/test-requirements.txt deleted file mode 100644 index 58f51d6a0027..000000000000 --- a/flex/coordinator/test-requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -pytest~=7.1.0 -pytest-cov>=2.8.1 -pytest-randomly>=1.2.3 -Flask-Testing==0.8.1 diff --git a/flex/coordinator/tox.ini b/flex/coordinator/tox.ini deleted file mode 100644 index 495f7daf4145..000000000000 --- a/flex/coordinator/tox.ini +++ /dev/null @@ -1,11 +0,0 @@ -[tox] -envlist = py3 -skipsdist=True - -[testenv] -deps=-r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt - {toxinidir} - -commands= - pytest --cov=gs_flex_coordinator diff --git a/flex/openapi/openapi_coordinator.yaml b/flex/openapi/openapi_coordinator.yaml index 131dc08d7b4d..1fca503472c9 100644 --- a/flex/openapi/openapi_coordinator.yaml +++ b/flex/openapi/openapi_coordinator.yaml @@ -1563,21 +1563,21 @@ paths: start_time: 2024-02-24 00:00:00 log: logging... detail: - graph_name: demo + graph_id: GRAPHID - id: JOB-QWERTYUIOPASDFGH-2 type: DATA IMPORT status: CANCELLED start_time: 2024-02-24 00:00:00 log: logging... detail: - graph_name: demo + graph_id: GRAPHID - id: JOB-QWERTYUIOPASDFGH-3 type: DATA IMPORT status: SUCCESS start_time: 2024-02-24 00:00:00 end_time: 2024-02-24 12:00:00 detail: - graph_name: demo + graph_id: GRAPHID - id: JOB-QWERTYUIOPASDFGH-4 type: DATA IMPORT status: FAILED @@ -1585,12 +1585,12 @@ paths: end_time: 2024-02-24 12:00:00 log: logging... detail: - graph_name: demo + graph_id: GRAPHID - id: JOB-QWERTYUIOPASDFGH-5 type: DATA IMPORT status: WAITING detail: - graph_name: demo + graph_id: GRAPHID 500: $ref: "#/components/responses/500" diff --git a/python/graphscope/config.py b/python/graphscope/config.py index 8aabe53d14b6..909cb872f360 100644 --- a/python/graphscope/config.py +++ b/python/graphscope/config.py @@ -235,6 +235,8 @@ class CoordinatorConfig: """ service_port: int = 63800 # Coordinator service port that will be listening on. + http_port: int = 8080 # Coordinator HTTP service port + monitor: bool = False # Enable or disable prometheus exporter. monitor_port: int = 9090 # Coordinator prometheus exporter service port. From 196cb3668e0bae5131560262e79b7aa6aac323ae Mon Sep 17 00:00:00 2001 From: Dongze Li Date: Wed, 29 May 2024 15:55:30 +0800 Subject: [PATCH 06/15] Support pip3 install gsctl --- coordinator/requirements.txt | 1 + python/requirements.txt | 1 - python/setup.py | 11 ++---- python/setup_gsctl.py | 71 ++++++++++++++++++++++++++++++++++++ 4 files changed, 75 insertions(+), 9 deletions(-) create mode 100644 python/setup_gsctl.py diff --git a/coordinator/requirements.txt b/coordinator/requirements.txt index d0e6d32c3ca9..cfc50ad0c6af 100644 --- a/coordinator/requirements.txt +++ b/coordinator/requirements.txt @@ -17,6 +17,7 @@ Flask == 2.2.5 urllib3 >= 1.25.3, < 2.1.0 pydantic >= 2 typing-extensions >= 4.7.1 +click psutil schedule interactive-sdk == 0.0.3 diff --git a/python/requirements.txt b/python/requirements.txt index c898a22c2a79..4ebf3a40cc3e 100644 --- a/python/requirements.txt +++ b/python/requirements.txt @@ -22,7 +22,6 @@ ujson;python_version>="3.11" PyYAML rich tqdm -click vineyard>=0.16.3;sys_platform!="win32" simple-parsing graphscope-flex>=0.27.0 diff --git a/python/setup.py b/python/setup.py index 390ec519ea7e..e656e0027fd7 100644 --- a/python/setup.py +++ b/python/setup.py @@ -285,7 +285,9 @@ def find_graphscope_packages(): packages = [] # add graphscope - for pkg in find_packages(".", exclude=["graphscope.flex.*"]): + for pkg in find_packages( + ".", exclude=["graphscope.flex.*", "graphscope.gsctl", "graphscope.gsctl.*"] + ): packages.append(pkg) return packages @@ -303,8 +305,6 @@ def parsed_package_data(): "graphscope": [ "VERSION", "proto/*.pyi", - "gsctl/scripts/*.sh", - "gsctl/scripts/lib/*.sh", ], } @@ -473,11 +473,6 @@ def parse_version(root, **kwargs): "Source": "https://github.com/alibaba/GraphScope", "Tracker": "https://github.com/alibaba/GraphScope/issues", }, - entry_points={ - "console_scripts": [ - "gsctl = graphscope.gsctl.gsctl:cli", - ], - }, ) if os.name == "nt": diff --git a/python/setup_gsctl.py b/python/setup_gsctl.py new file mode 100644 index 000000000000..a6b71abb36ce --- /dev/null +++ b/python/setup_gsctl.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Copyright 2020 Alibaba Group Holding Limited. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +import os + +from setuptools import find_packages # noqa: H301 +from setuptools import setup + +pkg_root = os.path.dirname(os.path.abspath(__file__)) + + +def parse_version(root, **kwargs): + """ + Parse function for setuptools_scm that first tries to read '../VERSION' file + to get a version number. + """ + from setuptools_scm.git import parse + from setuptools_scm.version import meta + + version_file = os.path.join(pkg_root, "..", "VERSION") + if os.path.isfile(version_file): + with open(version_file, "r", encoding="utf-8") as fp: + return meta(fp.read().strip()) + return parse(root, **kwargs) + + +NAME = "gsctl" +PYTHON_REQUIRES = ">=3.7" +REQUIRES = ["click", "graphscope-flex >= 0.27.0"] + +setup( + name=NAME, + description="Command line tool for GraphScope", + author="GraphScope", + author_email="graphscope@alibaba-inc.com", + url="", + keywords=["GraphScope", "Command-line tool"], + use_scm_version={ + "root": pkg_root, + "parse": parse_version, + }, + install_requires=REQUIRES, + packages=find_packages(include=["graphscope.gsctl"]), + include_package_data=True, + license="Apache 2.0", + long_description_content_type="text/markdown", + long_description="""\ + gsctl is a command-line utility for GraphScope. It provides a set of functionalities to make it easy to use GraphScope. These functionalities include building and testing binaries, managing sessions and resources, and more. + """, # noqa: E501 + package_data={"graphscope": ["gsctl/scripts/*.sh", "gsctl/scripts/lib/*.sh"]}, + entry_points={ + "console_scripts": [ + "gsctl = graphscope.gsctl.gsctl:cli", + ], + }, +) From 9867580e271de57b2d86cd60a69be37b6d58b0e1 Mon Sep 17 00:00:00 2001 From: Dongze Li Date: Thu, 30 May 2024 17:40:30 +0800 Subject: [PATCH 07/15] Add CI test --- .github/workflows/flex.yml | 214 ------------------ .github/workflows/hqps-db-ci.yml | 189 ++++++++++++++++ .../{flex-dummy.yml => interactive-dummy.yml} | 8 +- .github/workflows/interactive.yml | 58 +++++ Makefile | 12 +- coordinator/gscoordinator/coordinator.py | 23 +- .../flex/controllers/service_controller.py | 1 + .../gscoordinator/flex/core/client_wrapper.py | 43 ++-- coordinator/gscoordinator/flex/core/config.py | 9 +- .../flex/core/interactive/hqps.py | 43 +++- .../flex/models/get_edge_type.py | 2 - .../gscoordinator/flex/openapi/openapi.yaml | 1 - coordinator/requirements.txt | 2 +- flex/interactive/docker/entrypoint.sh | 66 ++++-- .../docker/interactive-runtime.Dockerfile | 3 +- flex/openapi/openapi_coordinator.yaml | 1 - flex/scripts/install_dependencies.sh | 2 +- .../flex/rest/models/get_edge_type.py | 2 +- python/graphscope/gsctl/gsctl.py | 19 +- .../{tests/flex => gsctl/tests}/__init__.py | 0 .../flex => gsctl/tests}/test_interactive.py | 0 .../graphscope/tests/unittest/test_graph.py | 56 +++-- python/setup.cfg | 2 +- python/setup_gsctl.py | 2 +- 24 files changed, 430 insertions(+), 328 deletions(-) delete mode 100644 .github/workflows/flex.yml rename .github/workflows/{flex-dummy.yml => interactive-dummy.yml} (73%) create mode 100644 .github/workflows/interactive.yml rename python/graphscope/{tests/flex => gsctl/tests}/__init__.py (100%) rename python/graphscope/{tests/flex => gsctl/tests}/test_interactive.py (100%) diff --git a/.github/workflows/flex.yml b/.github/workflows/flex.yml deleted file mode 100644 index 4690c2ad654e..000000000000 --- a/.github/workflows/flex.yml +++ /dev/null @@ -1,214 +0,0 @@ -name: GraphScope Flex CI - -on: - # Trigger the workflow on push or pull request, - # but only for the main branch - workflow_dispatch: - push: - branches: - - main - paths: - - 'flex/**' - - '.github/workflows/flex.yml' - pull_request: - branches: - - main - paths: - - 'flex/**' - - '.github/workflows/flex.yml' - -concurrency: - group: ${{ github.repository }}-${{ github.event.number || github.head_ref || github.sha }}-${{ github.workflow }} - cancel-in-progress: true - -jobs: - test-build-flex: - runs-on: ubuntu-22.04 - - strategy: - matrix: - os: [ubuntu-22.04] - platform: [x86_64] - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Install dependencies - run: | - cd ${GITHUB_WORKSPACE}/flex - bash ./scripts/install_dependencies.sh 4 - - - name: Setup tmate session - if: false - uses: mxschmitt/action-tmate@v2 - - - name: Build - run: | - cd ${GITHUB_WORKSPACE}/flex - git submodule update --init - mkdir build && cd build # only test default build - cmake .. -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_DOC=OFF && sudo make -j 4 - - # test the different combination of cmake options: -DBUILD_HQPS=ON/OFF -DBUILD_TEST=ON/OFF, -DBUILD_ODPS_FRAGMENT_LOADER=ON/OFF - test-cmake-options: - runs-on: ubuntu-20.04 - container: - image: registry.cn-hongkong.aliyuncs.com/graphscope/hqps-server-base:v0.0.10 - strategy: - matrix: - BUILD_HQPS: [ON, OFF] - BUILD_TEST: [ON, OFF] - BUILD_ODPS_FRAGMENT_LOADER: [ON, OFF] - steps: - - uses: actions/checkout@v3 - - - name: Build - run: | - cd ${GITHUB_WORKSPACE}/flex - git submodule update --init - mkdir build && cd build - cmake .. -DBUILD_HQPS=${{ matrix.BUILD_HQPS }} -DBUILD_TEST=${{ matrix.BUILD_TEST }} \ - -DBUILD_ODPS_FRAGMENT_LOADER=${{ matrix.BUILD_ODPS_FRAGMENT_LOADER }} - sudo make -j4 - - test-AOCC-compilation: - runs-on: ubuntu-20.04 - container: - image: registry.cn-hongkong.aliyuncs.com/graphscope/hqps-server-base:v0.0.10 - steps: - - uses: actions/checkout@v3 - - - name: Download aocc compiler - run: | - cd ${GITHUB_WORKSPACE}/flex - wget https://download.amd.com/developer/eula/aocc/aocc-4-1/aocc-compiler-4.1.0_1_amd64.deb - sudo apt-get update && sudo apt-get install libncurses-dev libncurses5-dev - sudo dpkg -i aocc-compiler-4.1.0_1_amd64.deb - - - name: Test AOCC compiler - env: - CC: clang - CXX: clang++ - OMPI_CC: clang - OMPI_CXX: clang++ - run: | - . /opt/AMD/aocc-compiler-4.1.0/setenv_AOCC.sh - cd ${GITHUB_WORKSPACE}/flex - git submodule update --init - mkdir build && cd build - cmake .. -DBUILD_DOC=OFF -DCMAKE_BUILD_TYPE=DEBUG - sudo make -j4 - - test-flex: - runs-on: ubuntu-20.04 - if: ${{ github.repository == 'alibaba/GraphScope' }} - container: - image: registry.cn-hongkong.aliyuncs.com/graphscope/hqps-server-base:v0.0.10 - steps: - - uses: actions/checkout@v3 - - - name: Install latest libgrape-lite - if: false - run: | - git clone --single-branch https://github.com/alibaba/libgrape-lite.git /tmp/libgrape-lite - cd /tmp/libgrape-lite - mkdir -p build && cd build - cmake .. - make -j$(nproc) - make install - - - name: Build - env: - HOME: /home/graphscope/ - run: | - cd ${GITHUB_WORKSPACE}/flex - git submodule update --init - mkdir build && cd build - cmake .. && sudo make -j$(nproc) - - - name: Test GRIN on mutable csr - run: | - git submodule update --init - cd flex/engines/graph_db/grin - mkdir build && cd build - cmake .. && sudo make -j$(nproc) - export FLEX_DATA_DIR=../../../../interactive/examples/modern_graph/ - ${GITHUB_WORKSPACE}/flex/build/bin/bulk_loader -g ../../../../interactive/examples/modern_graph/graph.yaml -l ../../../../interactive/examples/modern_graph/bulk_load.yaml -d ./data/ - rm -r ./data/wal - rm -r ./data/runtime/* - ./run_grin_test 'flex://schema_file=../../../../interactive/examples/modern_graph/graph.yaml&data_dir=./data/' - - - name: Prepare test dataset - env: - GS_TEST_DIR: ${{ github.workspace }}/gstest/ - run: | - git clone -b master --single-branch --depth=1 https://github.com/GraphScope/gstest.git ${GS_TEST_DIR} - - - name: Test String edge property on modern graph - env: - FLEX_DATA_DIR: ${{ github.workspace }}/flex/interactive/examples/modern_graph/ - run: | - rm -rf /tmp/csr-data-dir/ - cd ${GITHUB_WORKSPACE}/flex/build/ - SCHEMA_FILE=../tests/rt_mutable_graph/modern_graph_string_edge.yaml - BULK_LOAD_FILE=../interactive/examples/modern_graph/bulk_load.yaml - GLOG_v=10 ./bin/bulk_loader -g ${SCHEMA_FILE} -l ${BULK_LOAD_FILE} -d /tmp/csr-data-dir/ - GLOG_v=10 ./tests/rt_mutable_graph/string_edge_property_test ${SCHEMA_FILE} /tmp/csr-data-dir/ - - - name: Test schema parsing and loading on modern graph - env: - FLEX_DATA_DIR: ${{ github.workspace }}/flex/interactive/examples/modern_graph/ - run: | - rm -rf /tmp/csr-data-dir/ - cd ${GITHUB_WORKSPACE}/flex/build/ - SCHEMA_FILE=../tests/rt_mutable_graph/modern_graph_unified_schema.yaml - BULK_LOAD_FILE=../interactive/examples/modern_graph/bulk_load.yaml - GLOG_v=10 ./bin/bulk_loader -g ${SCHEMA_FILE} -l ${BULK_LOAD_FILE} -d /tmp/csr-data-dir/ - - - name: Test build empty graph - run: | - rm -rf /tmp/csr-data-dir/ - cd ${GITHUB_WORKSPACE}/flex/build/ - GLOG_v=10 ./tests/rt_mutable_graph/test_empty_graph /tmp/csr-data-dir/ - - name: Test ACID - run: | - rm -rf /tmp/csr-data-dir/ - cd ${GITHUB_WORKSPACE}/flex/build/ - GLOG_v=10 ./tests/rt_mutable_graph/test_acid 8 /tmp/csr-data-dir/ - - - name: Test Graph Loading on modern graph - env: - FLEX_DATA_DIR: ${{ github.workspace }}/flex/interactive/examples/modern_graph/ - run: | - rm -rf /tmp/csr-data-dir/ - cd ${GITHUB_WORKSPACE}/flex/build/ - SCHEMA_FILE=../interactive/examples/modern_graph/graph.yaml - BULK_LOAD_FILE=../interactive/examples/modern_graph/bulk_load.yaml - GLOG_v=10 ./bin/bulk_loader -g ${SCHEMA_FILE} -l ${BULK_LOAD_FILE} -d /tmp/csr-data-dir/ - - - name: Test Graph Loading on type_test graph - env: - GS_TEST_DIR: ${{ github.workspace }}/gstest/ - FLEX_DATA_DIR: ${{ github.workspace }}/gstest/flex/type_test/ - run: | - # remove modern graph indices - rm -rf /tmp/csr-data-dir/ - - cd ${GITHUB_WORKSPACE}/flex/build/ - SCHEMA_FILE=${GS_TEST_DIR}/flex/type_test/graph.yaml - BULK_LOAD_FILE=${GS_TEST_DIR}/flex/type_test/import.yaml - GLOG_v=10 ./bin/bulk_loader -g ${SCHEMA_FILE} -l ${BULK_LOAD_FILE} -d /tmp/csr-data-dir/ -p 2 - - - name: Test Graph Loading on LDBC SNB sf0.1 - env: - GS_TEST_DIR: ${{ github.workspace }}/gstest/ - FLEX_DATA_DIR: ${{ github.workspace }}/gstest/flex/ldbc-sf01-long-date/ - run: | - # remove previous graph indices - rm -rf /tmp/csr-data-dir/ - - cd ${GITHUB_WORKSPACE}/flex/build/ - SCHEMA_FILE=${FLEX_DATA_DIR}/audit_graph_schema.yaml - BULK_LOAD_FILE=${FLEX_DATA_DIR}/audit_bulk_load.yaml - GLOG_v=10 ./bin/bulk_loader -g ${SCHEMA_FILE} -l ${BULK_LOAD_FILE} -d /tmp/csr-data-dir/ -p 2 diff --git a/.github/workflows/hqps-db-ci.yml b/.github/workflows/hqps-db-ci.yml index 76101786e21f..3ebcba777388 100644 --- a/.github/workflows/hqps-db-ci.yml +++ b/.github/workflows/hqps-db-ci.yml @@ -320,4 +320,193 @@ jobs: bash hqps_adhoc_test.sh ${INTERACTIVE_WORKSPACE} modern_graph \ ${GITHUB_WORKSPACE}/flex/tests/hqps/engine_config_test.yaml gremlin + test-build-flex: + runs-on: ubuntu-22.04 + strategy: + matrix: + os: [ubuntu-22.04] + platform: [x86_64] + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Install dependencies + run: | + cd ${GITHUB_WORKSPACE}/flex + bash ./scripts/install_dependencies.sh 4 + + - name: Setup tmate session + if: false + uses: mxschmitt/action-tmate@v2 + + - name: Build + run: | + cd ${GITHUB_WORKSPACE}/flex + git submodule update --init + mkdir build && cd build # only test default build + cmake .. -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_DOC=OFF && sudo make -j 4 + + # test the different combination of cmake options: -DBUILD_HQPS=ON/OFF -DBUILD_TEST=ON/OFF, -DBUILD_ODPS_FRAGMENT_LOADER=ON/OFF + test-cmake-options: + runs-on: ubuntu-20.04 + container: + image: registry.cn-hongkong.aliyuncs.com/graphscope/hqps-server-base:v0.0.10 + strategy: + matrix: + BUILD_HQPS: [ON, OFF] + BUILD_TEST: [ON, OFF] + BUILD_ODPS_FRAGMENT_LOADER: [ON, OFF] + steps: + - uses: actions/checkout@v3 + + - name: Build + run: | + cd ${GITHUB_WORKSPACE}/flex + git submodule update --init + mkdir build && cd build + cmake .. -DBUILD_HQPS=${{ matrix.BUILD_HQPS }} -DBUILD_TEST=${{ matrix.BUILD_TEST }} \ + -DBUILD_ODPS_FRAGMENT_LOADER=${{ matrix.BUILD_ODPS_FRAGMENT_LOADER }} + sudo make -j4 + + test-AOCC-compilation: + runs-on: ubuntu-20.04 + container: + image: registry.cn-hongkong.aliyuncs.com/graphscope/hqps-server-base:v0.0.10 + steps: + - uses: actions/checkout@v3 + + - name: Download aocc compiler + run: | + cd ${GITHUB_WORKSPACE}/flex + wget https://download.amd.com/developer/eula/aocc/aocc-4-1/aocc-compiler-4.1.0_1_amd64.deb + sudo apt-get update && sudo apt-get install libncurses-dev libncurses5-dev + sudo dpkg -i aocc-compiler-4.1.0_1_amd64.deb + + - name: Test AOCC compiler + env: + CC: clang + CXX: clang++ + OMPI_CC: clang + OMPI_CXX: clang++ + run: | + . /opt/AMD/aocc-compiler-4.1.0/setenv_AOCC.sh + cd ${GITHUB_WORKSPACE}/flex + git submodule update --init + mkdir build && cd build + cmake .. -DBUILD_DOC=OFF -DCMAKE_BUILD_TYPE=DEBUG + sudo make -j4 + + test-flex: + runs-on: ubuntu-20.04 + if: ${{ github.repository == 'alibaba/GraphScope' }} + container: + image: registry.cn-hongkong.aliyuncs.com/graphscope/hqps-server-base:v0.0.10 + steps: + - uses: actions/checkout@v3 + + - name: Install latest libgrape-lite + if: false + run: | + git clone --single-branch https://github.com/alibaba/libgrape-lite.git /tmp/libgrape-lite + cd /tmp/libgrape-lite + mkdir -p build && cd build + cmake .. + make -j$(nproc) + make install + + - name: Build + env: + HOME: /home/graphscope/ + run: | + cd ${GITHUB_WORKSPACE}/flex + git submodule update --init + mkdir build && cd build + cmake .. && sudo make -j$(nproc) + + - name: Test GRIN on mutable csr + run: | + git submodule update --init + cd flex/engines/graph_db/grin + mkdir build && cd build + cmake .. && sudo make -j$(nproc) + export FLEX_DATA_DIR=../../../../interactive/examples/modern_graph/ + ${GITHUB_WORKSPACE}/flex/build/bin/bulk_loader -g ../../../../interactive/examples/modern_graph/graph.yaml -l ../../../../interactive/examples/modern_graph/bulk_load.yaml -d ./data/ + rm -r ./data/wal + rm -r ./data/runtime/* + ./run_grin_test 'flex://schema_file=../../../../interactive/examples/modern_graph/graph.yaml&data_dir=./data/' + + - name: Prepare test dataset + env: + GS_TEST_DIR: ${{ github.workspace }}/gstest/ + run: | + git clone -b master --single-branch --depth=1 https://github.com/GraphScope/gstest.git ${GS_TEST_DIR} + + - name: Test String edge property on modern graph + env: + FLEX_DATA_DIR: ${{ github.workspace }}/flex/interactive/examples/modern_graph/ + run: | + rm -rf /tmp/csr-data-dir/ + cd ${GITHUB_WORKSPACE}/flex/build/ + SCHEMA_FILE=../tests/rt_mutable_graph/modern_graph_string_edge.yaml + BULK_LOAD_FILE=../interactive/examples/modern_graph/bulk_load.yaml + GLOG_v=10 ./bin/bulk_loader -g ${SCHEMA_FILE} -l ${BULK_LOAD_FILE} -d /tmp/csr-data-dir/ + GLOG_v=10 ./tests/rt_mutable_graph/string_edge_property_test ${SCHEMA_FILE} /tmp/csr-data-dir/ + + - name: Test schema parsing and loading on modern graph + env: + FLEX_DATA_DIR: ${{ github.workspace }}/flex/interactive/examples/modern_graph/ + run: | + rm -rf /tmp/csr-data-dir/ + cd ${GITHUB_WORKSPACE}/flex/build/ + SCHEMA_FILE=../tests/rt_mutable_graph/modern_graph_unified_schema.yaml + BULK_LOAD_FILE=../interactive/examples/modern_graph/bulk_load.yaml + GLOG_v=10 ./bin/bulk_loader -g ${SCHEMA_FILE} -l ${BULK_LOAD_FILE} -d /tmp/csr-data-dir/ + + - name: Test build empty graph + run: | + rm -rf /tmp/csr-data-dir/ + cd ${GITHUB_WORKSPACE}/flex/build/ + GLOG_v=10 ./tests/rt_mutable_graph/test_empty_graph /tmp/csr-data-dir/ + - name: Test ACID + run: | + rm -rf /tmp/csr-data-dir/ + cd ${GITHUB_WORKSPACE}/flex/build/ + GLOG_v=10 ./tests/rt_mutable_graph/test_acid 8 /tmp/csr-data-dir/ + + - name: Test Graph Loading on modern graph + env: + FLEX_DATA_DIR: ${{ github.workspace }}/flex/interactive/examples/modern_graph/ + run: | + rm -rf /tmp/csr-data-dir/ + cd ${GITHUB_WORKSPACE}/flex/build/ + SCHEMA_FILE=../interactive/examples/modern_graph/graph.yaml + BULK_LOAD_FILE=../interactive/examples/modern_graph/bulk_load.yaml + GLOG_v=10 ./bin/bulk_loader -g ${SCHEMA_FILE} -l ${BULK_LOAD_FILE} -d /tmp/csr-data-dir/ + + - name: Test Graph Loading on type_test graph + env: + GS_TEST_DIR: ${{ github.workspace }}/gstest/ + FLEX_DATA_DIR: ${{ github.workspace }}/gstest/flex/type_test/ + run: | + # remove modern graph indices + rm -rf /tmp/csr-data-dir/ + + cd ${GITHUB_WORKSPACE}/flex/build/ + SCHEMA_FILE=${GS_TEST_DIR}/flex/type_test/graph.yaml + BULK_LOAD_FILE=${GS_TEST_DIR}/flex/type_test/import.yaml + GLOG_v=10 ./bin/bulk_loader -g ${SCHEMA_FILE} -l ${BULK_LOAD_FILE} -d /tmp/csr-data-dir/ -p 2 + + - name: Test Graph Loading on LDBC SNB sf0.1 + env: + GS_TEST_DIR: ${{ github.workspace }}/gstest/ + FLEX_DATA_DIR: ${{ github.workspace }}/gstest/flex/ldbc-sf01-long-date/ + run: | + # remove previous graph indices + rm -rf /tmp/csr-data-dir/ + + cd ${GITHUB_WORKSPACE}/flex/build/ + SCHEMA_FILE=${FLEX_DATA_DIR}/audit_graph_schema.yaml + BULK_LOAD_FILE=${FLEX_DATA_DIR}/audit_bulk_load.yaml + GLOG_v=10 ./bin/bulk_loader -g ${SCHEMA_FILE} -l ${BULK_LOAD_FILE} -d /tmp/csr-data-dir/ -p 2 diff --git a/.github/workflows/flex-dummy.yml b/.github/workflows/interactive-dummy.yml similarity index 73% rename from .github/workflows/flex-dummy.yml rename to .github/workflows/interactive-dummy.yml index 00cc8316101d..ce81d9240810 100644 --- a/.github/workflows/flex-dummy.yml +++ b/.github/workflows/interactive-dummy.yml @@ -1,4 +1,4 @@ -name: GraphScope Flex CI (Dummy) +name: Flex Interactive CI (Dummy) on: pull_request: @@ -7,15 +7,15 @@ on: paths: - '**' - '!flex/**' - - '!.github/workflows/flex.yml' + - '!.github/workflows/interactive.yml' concurrency: group: ${{ github.repository }}-${{ github.event.number || github.head_ref || github.sha }}-${{ github.workflow }} cancel-in-progress: true jobs: - build-gae: + build: runs-on: ubuntu-20.04 if: ${{ github.repository == 'alibaba/GraphScope' }} steps: - - run: 'echo "No action required" ' \ No newline at end of file + - run: 'echo "No action required" ' diff --git a/.github/workflows/interactive.yml b/.github/workflows/interactive.yml new file mode 100644 index 000000000000..aa0ce375ed66 --- /dev/null +++ b/.github/workflows/interactive.yml @@ -0,0 +1,58 @@ +name: Flex Interactive CI + +on: + # Trigger the workflow on push or pull request, + # but only for the main branch + workflow_dispatch: + push: + branches: + - main + paths: + - 'flex/**' + - '.github/workflows/interactive.yml' + pull_request: + branches: + - main + paths: + - 'flex/**' + - '.github/workflows/interactive.yml' + +concurrency: + group: ${{ github.repository }}-${{ github.event.number || github.head_ref || github.sha }}-${{ github.workflow }} + cancel-in-progress: true + +jobs: + api-test: + runs-on: ubuntu-22.04 + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Add envs to GITHUB_ENV + run: | + short_sha=$(git rev-parse --short HEAD) + echo "SHORT_SHA=${short_sha}" >> $GITHUB_ENV + + - name: Build Image + run: | + cd ${GITHUB_WORKSPACE} + python3 -m pip install --upgrade pip && python3 -m pip install -r python/requirements.txt + python3 ./gsctl.py flexbuild interactive --app docker + + - name: Build gsctl Wheel Package + run: | + cd ${GITHUB_WORKSPACE}/python + python3 setup_gsctl.py bdist_wheel + + - name: Test + run: | + # install gsctl + python3 -m pip install ${GITHUB_WORKSPACE}/python/dist/*.whl + # launch service: 8080 for coordinator http port; 7687 for cypher port; + docker run -p 8080:8080 -p 7688:7687 registry.cn-hongkong.aliyuncs.com/graphscope/interactive:${SHORT_SHA}-x86_64 --enable-coordinator & + # test + python3 -m pip install --no-cache-dir pytest pytest-xdist + python3 -m pytest -d --tx popen//python=python3 \ + -s -v \ + $(dirname $(python3 -c "import graphscope.gsctl as gsctl; print(gsctl.__file__)"))/tests/test_interactive.py diff --git a/Makefile b/Makefile index 7c3ded9b5226..1c48747da292 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,7 @@ PIP_ARGS = --timeout=1000 --no-cache-dir .PHONY: all graphscope install clean # coordinator relies on client, which relies on learning -all: coordinator analytical interactive +all: coordinator analytical interactive gsctl graphscope: all install: analytical-install interactive-install learning-install coordinator @@ -73,9 +73,17 @@ clean: cd $(COORDINATOR_DIR) && python3 setup.py clean --all ## Modules -.PHONY: client coordinator analytical interactive learning +.PHONY: client coordinator analytical interactive learning gsctl .PHONY: analytical-java + +gsctl: + cd $(CLIENT_DIR) && \ + python3 setup_gsctl.py bdist_wheel && \ + python3 -m pip install dist/gsctl*.whl --force-reinstall && \ + rm -fr build + + client: learning cd $(CLIENT_DIR) && \ python3 -m pip install ${PIP_ARGS} "torch<=2.2.1" "networkx<=3.0" --index-url https://download.pytorch.org/whl/cpu --user && \ diff --git a/coordinator/gscoordinator/coordinator.py b/coordinator/gscoordinator/coordinator.py index e3435617dbff..f4955102d8bf 100644 --- a/coordinator/gscoordinator/coordinator.py +++ b/coordinator/gscoordinator/coordinator.py @@ -24,6 +24,7 @@ import os import signal import sys +import threading from concurrent import futures import connexion @@ -123,6 +124,17 @@ def get_servicer(config: Config): return initializer(config) +def start_http_service(config): + app = connexion.App(__name__, specification_dir="./flex/openapi/") + app.app.json_encoder = JSONEncoder + app.add_api( + "openapi.yaml", + arguments={"title": "GraphScope FLEX HTTP SERVICE API"}, + pythonic_params=True, + ) + app.run(port=config.coordinator.http_port) + + def start_server( coordinator_service_servicer: coordinator_service_pb2_grpc.CoordinatorServiceServicer, config: Config, @@ -147,14 +159,9 @@ def start_server( server.start() # OpenApi server - app = connexion.App(__name__, specification_dir="./flex/openapi/") - app.app.json_encoder = JSONEncoder - app.add_api( - "openapi.yaml", - arguments={"title": "GraphScope FLEX HTTP SERVICE API"}, - pythonic_params=True, - ) - app.run(port=config.coordinator.http_port) + httpservice_t = threading.Thread(target=start_http_service, args=(config,)) + httpservice_t.daemon = True + httpservice_t.start() if config.coordinator.monitor: try: diff --git a/coordinator/gscoordinator/flex/controllers/service_controller.py b/coordinator/gscoordinator/flex/controllers/service_controller.py index 4d38a869eb56..d37fae8bb9c7 100644 --- a/coordinator/gscoordinator/flex/controllers/service_controller.py +++ b/coordinator/gscoordinator/flex/controllers/service_controller.py @@ -25,6 +25,7 @@ def get_service_status_by_id(graph_id): # noqa: E501 return client_wrapper.get_service_status_by_id(graph_id) +@handle_api_exception() def list_service_status(): # noqa: E501 """list_service_status diff --git a/coordinator/gscoordinator/flex/core/client_wrapper.py b/coordinator/gscoordinator/flex/core/client_wrapper.py index 72dac4a06af5..424af453cfde 100644 --- a/coordinator/gscoordinator/flex/core/client_wrapper.py +++ b/coordinator/gscoordinator/flex/core/client_wrapper.py @@ -17,6 +17,7 @@ # import itertools +import logging import os import socket import threading @@ -76,7 +77,8 @@ def _initialize_client(self): } initializer = service_initializer.get(SOLUTION) if initializer is None: - raise RuntimeError(f"Client initializer of {SOLUTION} not found.") + logging.warn(f"Client initializer of {SOLUTION} not found.") + return None return initializer() def list_graphs(self) -> List[GetGraphResponse]: @@ -86,12 +88,13 @@ def list_graphs(self) -> List[GetGraphResponse]: for item in itertools.chain( g["schema"]["vertex_types"], g["schema"]["edge_types"] ): - for p in item["properties"]: - if ( - "string" in p["property_type"] - and "long_text" in p["property_type"]["string"] - ): - p["property_type"]["string"]["long_text"] = "" + if "properties" in item: + for p in item["properties"]: + if ( + "string" in p["property_type"] + and "long_text" in p["property_type"]["string"] + ): + p["property_type"]["string"]["long_text"] = "" # transfer rlts = [GetGraphResponse.from_dict(g) for g in graphs] return rlts @@ -100,12 +103,13 @@ def get_schema_by_id(self, graph_id: str) -> GetGraphSchemaResponse: schema = self._client.get_schema_by_id(graph_id) # fix ValueError: Invalid value for `long_text`, must not be `None` for item in itertools.chain(schema["vertex_types"], schema["edge_types"]): - for p in item["properties"]: - if ( - "string" in p["property_type"] - and "long_text" in p["property_type"]["string"] - ): - p["property_type"]["string"]["long_text"] = "" + if "properties" in item: + for p in item["properties"]: + if ( + "string" in p["property_type"] + and "long_text" in p["property_type"]["string"] + ): + p["property_type"]["string"]["long_text"] = "" return GetGraphSchemaResponse.from_dict(schema) def create_graph(self, graph: CreateGraphRequest) -> CreateGraphResponse: @@ -165,12 +169,13 @@ def get_graph_by_id(self, graph_id: str) -> GetGraphResponse: for item in itertools.chain( g["schema"]["vertex_types"], g["schema"]["edge_types"] ): - for p in item["properties"]: - if ( - "string" in p["property_type"] - and "long_text" in p["property_type"]["string"] - ): - p["property_type"]["string"]["long_text"] = "" + if "properties" in item: + for p in item["properties"]: + if ( + "string" in p["property_type"] + and "long_text" in p["property_type"]["string"] + ): + p["property_type"]["string"]["long_text"] = "" return GetGraphResponse.from_dict(g) def create_stored_procedure( diff --git a/coordinator/gscoordinator/flex/core/config.py b/coordinator/gscoordinator/flex/core/config.py index 7dd9d92f244d..d7d48e031087 100644 --- a/coordinator/gscoordinator/flex/core/config.py +++ b/coordinator/gscoordinator/flex/core/config.py @@ -54,11 +54,10 @@ def str_to_bool(s): # and use cases of the product across different industries # and business scenarios, e.g. "INTERACTIVE", # "GRAPHSCOPE INSIGHT". -SOLUTION = os.environ["SOLUTION"] -if SOLUTION == "INTERACTIVE": - FRONTEND_TYPE = "Cypher/Gremlin" - STORAGE_TYPE = "MutableCSR" - ENGINE_TYPE = "Hiactor" +SOLUTION = os.environ.get("SOLUTION", "GRAPHSCOPE_ONE") +FRONTEND_TYPE = "Cypher/Gremlin" +STORAGE_TYPE = "MutableCSR" +ENGINE_TYPE = "Hiactor" # cluster type, optional from "K8S", "HOSTS" CLUSTER_TYPE = os.environ.get("CLUSTER_TYPE", "HOSTS") diff --git a/coordinator/gscoordinator/flex/core/interactive/hqps.py b/coordinator/gscoordinator/flex/core/interactive/hqps.py index 52403b99042f..bdecb16953c6 100644 --- a/coordinator/gscoordinator/flex/core/interactive/hqps.py +++ b/coordinator/gscoordinator/flex/core/interactive/hqps.py @@ -78,11 +78,11 @@ def _get_hqps_service_endpoints(self): logging.info("Connecting to HQPS service ...") while True: try: - requests.get(f"http://192.168.0.9:{HQPS_ADMIN_SERVICE_PORT}") + requests.get(f"http://127.0.0.1:{HQPS_ADMIN_SERVICE_PORT}") except requests.ConnectionError: time.sleep(3) else: - return f"http://192.168.0.9:{HQPS_ADMIN_SERVICE_PORT}" + return f"http://127.0.0.1:{HQPS_ADMIN_SERVICE_PORT}" def list_graphs(self) -> List[dict]: with interactive_sdk.openapi.ApiClient( @@ -96,11 +96,18 @@ def list_graphs(self) -> List[dict]: g["creation_time"] = encode_datetime( datetime.datetime.fromtimestamp(g["creation_time"] / 1000) ) - g["data_update_time"] = encode_datetime( - datetime.datetime.fromtimestamp(g["data_update_time"] / 1000) - ) + if g["data_update_time"] == 0: + g["data_update_time"] = "null" + else: + g["data_update_time"] = encode_datetime( + datetime.datetime.fromtimestamp(g["data_update_time"] / 1000) + ) # `schema_update_time` is same to `creation_time` in Interactive g["schema_update_time"] = g["creation_time"] + if "edge_types" not in g["schema"]: + g["schema"]["edge_types"] = [] + if "vertex_types" not in g["schema"]: + g["schema"]["vertex_types"] = [] # we do not have edge's primary key in Interactive for edge in g["schema"]["edge_types"]: if "primary_keys" not in edge: @@ -114,7 +121,12 @@ def get_schema_by_id(self, graph_id: str) -> dict: api_instance = interactive_sdk.openapi.AdminServiceGraphManagementApi( api_client ) - return api_instance.get_schema(graph_id).to_dict() + schema = api_instance.get_schema(graph_id).to_dict() + if "vertex_types" not in schema: + schema["vertex_types"] = [] + if "edge_types" not in schema: + schema["edge_types"] = [] + return schema def create_graph(self, graph: dict) -> dict: with interactive_sdk.openapi.ApiClient( @@ -147,11 +159,18 @@ def get_graph_by_id(self, graph_id: str) -> dict: g["creation_time"] = encode_datetime( datetime.datetime.fromtimestamp(g["creation_time"] / 1000) ) - g["data_update_time"] = encode_datetime( - datetime.datetime.fromtimestamp(g["data_update_time"] / 1000) - ) + if g["data_update_time"] == 0: + g["data_update_time"] = "null" + else: + g["data_update_time"] = encode_datetime( + datetime.datetime.fromtimestamp(g["data_update_time"] / 1000) + ) # `schema_update_time` is same to `creation_time` in Interactive g["schema_update_time"] = g["creation_time"] + if "edge_types" not in g["schema"]: + g["schema"]["edge_types"] = [] + if "vertex_types" not in g["schema"]: + g["schema"]["vertex_types"] = [] # we do not have edge's primary key in Interactive for edge in g["schema"]["edge_types"]: if "primary_keys" not in edge: @@ -258,6 +277,9 @@ def list_service_status(self) -> List[dict]: if response.status == "Running" and response.graph is not None: g = response.graph.to_dict() serving_graph_id = g["id"] + service_start_time = encode_datetime( + datetime.datetime.fromtimestamp(response.start_time / 1000) + ) status = { "status": response.status, "sdk_endpoints": { @@ -265,7 +287,7 @@ def list_service_status(self) -> List[dict]: "hqps": f"http://{host}:{response.hqps_port}", "gremlin": f"ws://{host}:{response.gremlin_port}/gremlin", }, - "start_time": "2024-04-20 18:00:00", + "start_time": service_start_time, "graph_id": g["id"], } rlts.append(status) @@ -276,6 +298,7 @@ def list_service_status(self) -> List[dict]: status = { "status": "Stopped", "graph_id": g["id"], + "start_time": "null", } rlts.append(status) return rlts diff --git a/coordinator/gscoordinator/flex/models/get_edge_type.py b/coordinator/gscoordinator/flex/models/get_edge_type.py index 572aaf951e6e..08bb8b560eb2 100644 --- a/coordinator/gscoordinator/flex/models/get_edge_type.py +++ b/coordinator/gscoordinator/flex/models/get_edge_type.py @@ -202,8 +202,6 @@ def properties(self, properties: List[GetPropertyMeta]): :param properties: The properties of this GetEdgeType. :type properties: List[GetPropertyMeta] """ - if properties is None: - raise ValueError("Invalid value for `properties`, must not be `None`") # noqa: E501 self._properties = properties diff --git a/coordinator/gscoordinator/flex/openapi/openapi.yaml b/coordinator/gscoordinator/flex/openapi/openapi.yaml index 623a4a68bafa..9e93c04bdaa1 100644 --- a/coordinator/gscoordinator/flex/openapi/openapi.yaml +++ b/coordinator/gscoordinator/flex/openapi/openapi.yaml @@ -2642,7 +2642,6 @@ components: description: type: string required: - - properties - type_id type: object example: diff --git a/coordinator/requirements.txt b/coordinator/requirements.txt index cfc50ad0c6af..99b5f631f6b9 100644 --- a/coordinator/requirements.txt +++ b/coordinator/requirements.txt @@ -17,7 +17,7 @@ Flask == 2.2.5 urllib3 >= 1.25.3, < 2.1.0 pydantic >= 2 typing-extensions >= 4.7.1 -click +click >= 8.1.7 psutil schedule interactive-sdk == 0.0.3 diff --git a/flex/interactive/docker/entrypoint.sh b/flex/interactive/docker/entrypoint.sh index e3c3c28a7bc4..6616f8ce15d1 100644 --- a/flex/interactive/docker/entrypoint.sh +++ b/flex/interactive/docker/entrypoint.sh @@ -29,6 +29,9 @@ function usage() { inside container. If you want to use a workspace outside the container, you should mount it to the container. Default is /tmp/interactive_workspace + -c, --enable-coordinator: Launch the Interactive service along + with Coordinator. Must enable this option if you want to use + `gsctl` command-line tool. EOF } @@ -82,33 +85,60 @@ function launch_service() { start_cmd="${start_cmd} --enable-admin-service true" start_cmd="${start_cmd} --start-compiler true" echo "Starting the service with command: $start_cmd" + if $ENABLE_COORDINATOR; then start_cmd="${start_cmd} &"; fi eval $start_cmd } +function launch_coordinator() { + if $ENABLE_COORDINATOR; + then + coordinator_config_file="/tmp/coordinator-config.yaml" + cat > $coordinator_config_file << EOF +coordinator: + http_port: 8080 + +launcher_type: hosts + +session: + instance_id: demo +EOF + python3 -m gscoordinator --config-file $coordinator_config_file + fi +} + #################### Entry #################### +ENABLE_COORDINATOR=false WORKSPACE=/tmp/interactive_workspace while [[ $# -gt 0 ]]; do - key="$1" - - case $key in - -h | --help) - usage - exit - ;; - -w | --workspace) - shift - WORKSPACE="$1" - exit 0 - ;; - *) # unknown option - echo "unknown option $1" - usage - exit 1 - ;; + case $1 in + -w | --workspace) + shift + if [[ $# -eq 0 || $1 == -* ]]; then + echo "Option -w requires an argument." >&2 + exit 1 + fi + WORKSPACE=$1 + shift + ;; + -c | --enable-coordinator) + ENABLE_COORDINATOR=true + shift + ;; + -h | --help) + usage + exit 0 + ;; + *) + echo "Invalid option: $1" >&2 + usage + exit 1 + ;; esac done + prepare_workspace $WORKSPACE -launch_service $WORKSPACE \ No newline at end of file +launch_service $WORKSPACE +launch_coordinator diff --git a/flex/interactive/docker/interactive-runtime.Dockerfile b/flex/interactive/docker/interactive-runtime.Dockerfile index c79325a0e6c2..7d05406c832a 100644 --- a/flex/interactive/docker/interactive-runtime.Dockerfile +++ b/flex/interactive/docker/interactive-runtime.Dockerfile @@ -41,7 +41,7 @@ RUN . ${HOME}/.cargo/env && cd ${HOME}/GraphScope/flex && \ # build coordinator RUN if [ "${ENABLE_COORDINATOR}" = "true" ]; then \ - cd ${HOME}/GraphScope/flex/coordinator && \ + cd ${HOME}/GraphScope/coordinator && \ python3 setup.py bdist_wheel && \ mkdir -p /opt/flex/wheel && cp dist/*.whl /opt/flex/wheel/; \ fi @@ -134,6 +134,7 @@ RUN sudo ln -sf /opt/flex/bin/* /usr/local/bin/ \ RUN chmod +x /opt/flex/bin/* RUN if [ "${ENABLE_COORDINATOR}" = "true" ]; then \ + pip3 install --upgrade pip && \ pip3 install /opt/flex/wheel/*.whl; \ fi diff --git a/flex/openapi/openapi_coordinator.yaml b/flex/openapi/openapi_coordinator.yaml index 1fca503472c9..9201723ce6a4 100644 --- a/flex/openapi/openapi_coordinator.yaml +++ b/flex/openapi/openapi_coordinator.yaml @@ -467,7 +467,6 @@ components: - type: object required: - type_id - - properties properties: type_id: type: integer diff --git a/flex/scripts/install_dependencies.sh b/flex/scripts/install_dependencies.sh index 73740ce327f0..8cb00881744d 100755 --- a/flex/scripts/install_dependencies.sh +++ b/flex/scripts/install_dependencies.sh @@ -62,4 +62,4 @@ make -j ${parallelism} && sudo make install popd && rm -rf /tmp/hiactor sudo sh -c 'echo "fs.aio-max-nr = 1048576" >> /etc/sysctl.conf' -sudo sysctl -p /etc/sysctl.conf \ No newline at end of file +sudo sysctl -p /etc/sysctl.conf diff --git a/python/graphscope/flex/rest/models/get_edge_type.py b/python/graphscope/flex/rest/models/get_edge_type.py index 024c96c9b512..f7ec28a51a02 100644 --- a/python/graphscope/flex/rest/models/get_edge_type.py +++ b/python/graphscope/flex/rest/models/get_edge_type.py @@ -34,7 +34,7 @@ class GetEdgeType(BaseModel): directed: Optional[StrictBool] = None primary_keys: Optional[List[StrictStr]] = None type_id: StrictInt - properties: List[GetPropertyMeta] + properties: Optional[List[GetPropertyMeta]] = None description: Optional[StrictStr] = None __properties: ClassVar[List[str]] = ["type_name", "vertex_type_pair_relations", "directed", "primary_keys", "type_id", "properties", "description"] diff --git a/python/graphscope/gsctl/gsctl.py b/python/graphscope/gsctl/gsctl.py index 027c648ce72f..2ce2292ff2f9 100644 --- a/python/graphscope/gsctl/gsctl.py +++ b/python/graphscope/gsctl/gsctl.py @@ -21,22 +21,15 @@ import click -try: - import graphscope -except ModuleNotFoundError: - # if graphscope is not installed, only basic functions or utilities - # can be used, e.g. install dependencies - graphscope = None +if "site-packages" not in os.path.dirname(os.path.realpath(__file__)): + sys.path.insert( + 0, os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..") + ) +import graphscope -def cli(): - if graphscope is None: - sys.path.insert( - 0, os.path.join(os.path.dirname(os.path.realpath(__file__)), "commands") - ) - from dev import cli as dev_cli - dev_cli() +def cli(): from graphscope.gsctl.commands import get_command_collection from graphscope.gsctl.config import get_current_context diff --git a/python/graphscope/tests/flex/__init__.py b/python/graphscope/gsctl/tests/__init__.py similarity index 100% rename from python/graphscope/tests/flex/__init__.py rename to python/graphscope/gsctl/tests/__init__.py diff --git a/python/graphscope/tests/flex/test_interactive.py b/python/graphscope/gsctl/tests/test_interactive.py similarity index 100% rename from python/graphscope/tests/flex/test_interactive.py rename to python/graphscope/gsctl/tests/test_interactive.py diff --git a/python/graphscope/tests/unittest/test_graph.py b/python/graphscope/tests/unittest/test_graph.py index 227faec10196..7101bb72bebe 100644 --- a/python/graphscope/tests/unittest/test_graph.py +++ b/python/graphscope/tests/unittest/test_graph.py @@ -47,54 +47,60 @@ def test_graph_schema(arrow_property_graph): def test_graph_schema_todict(p2p_property_graph): rlt = { - "vertices": [ + "vertex_types": [ { - "label": "person", + "type_name": "person", "properties": [ { - "name": "weight", - "id": 0, - "type": "LONG", + "property_name": "weight", + "property_id": 0, + "property_type": {"primitive_type": "DT_SIGNED_INT64"}, "is_primary_key": False, - "comment": "", + "description": "", }, { - "name": "id", - "id": 1, - "type": "LONG", + "property_name": "id", + "property_id": 1, + "property_type": {"primitive_type": "DT_SIGNED_INT64"}, "is_primary_key": False, - "comment": "", + "description": "", }, ], + "primary_keys": [], + "description": "", } ], - "edges": [ + "edge_types": [ { - "label": "knows", + "type_name": "knows", "properties": [ { - "name": "src_label_id", - "id": 0, - "type": "LONG", + "property_name": "src_label_id", + "property_id": 0, + "property_type": {"primitive_type": "DT_SIGNED_INT64"}, "is_primary_key": False, - "comment": "", + "description": "", }, { - "name": "dst_label_id", - "id": 1, - "type": "LONG", + "property_name": "dst_label_id", + "property_id": 1, + "property_type": {"primitive_type": "DT_SIGNED_INT64"}, "is_primary_key": False, - "comment": "", + "description": "", }, { - "name": "dist", - "id": 2, - "type": "LONG", + "property_name": "dist", + "property_id": 2, + "property_type": {"primitive_type": "DT_SIGNED_INT64"}, "is_primary_key": False, - "comment": "", + "description": "", }, ], - "relations": [{"src_label": "person", "dst_label": "person"}], + "primary_keys": [], + "description": "", + "vertex_type_pair_relations": [ + {"source_vertex": "person", "destination_vertex": "person"} + ], } ], } diff --git a/python/setup.cfg b/python/setup.cfg index 1fb307179120..df5bcf58104a 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -25,7 +25,7 @@ max-complexity = 18 # for flake8-quotes inline-quotes = double # for flake8-comprehensions -extend-ignore = E203,F401,F401,F403,C4,I250 +extend-ignore = E203,F401,F401,F403,C4,I250,E402 extend-exclude = *_pb2.py *_pb2_grpc.py diff --git a/python/setup_gsctl.py b/python/setup_gsctl.py index a6b71abb36ce..bce9a24bde13 100644 --- a/python/setup_gsctl.py +++ b/python/setup_gsctl.py @@ -41,7 +41,7 @@ def parse_version(root, **kwargs): NAME = "gsctl" PYTHON_REQUIRES = ">=3.7" -REQUIRES = ["click", "graphscope-flex >= 0.27.0"] +REQUIRES = ["click >= 8.1.6", "graphscope-flex >= 0.27.0"] setup( name=NAME, From b0a80ed5c731194901bdbb07676f322d9ce43147 Mon Sep 17 00:00:00 2001 From: Dongze Li Date: Wed, 5 Jun 2024 15:47:28 +0800 Subject: [PATCH 08/15] Change CI workflow filename --- ...e-dummy.yml => flex-interactive-dummy.yml} | 2 +- .github/workflows/flex_interactive.yml | 58 ++ .github/workflows/hqps-db-ci.yml | 512 ------------------ .github/workflows/interactive.yml | 502 ++++++++++++++++- 4 files changed, 537 insertions(+), 537 deletions(-) rename .github/workflows/{interactive-dummy.yml => flex-interactive-dummy.yml} (89%) create mode 100644 .github/workflows/flex_interactive.yml delete mode 100644 .github/workflows/hqps-db-ci.yml diff --git a/.github/workflows/interactive-dummy.yml b/.github/workflows/flex-interactive-dummy.yml similarity index 89% rename from .github/workflows/interactive-dummy.yml rename to .github/workflows/flex-interactive-dummy.yml index ce81d9240810..986db904ef17 100644 --- a/.github/workflows/interactive-dummy.yml +++ b/.github/workflows/flex-interactive-dummy.yml @@ -7,7 +7,7 @@ on: paths: - '**' - '!flex/**' - - '!.github/workflows/interactive.yml' + - '!.github/workflows/flex-interactive.yml' concurrency: group: ${{ github.repository }}-${{ github.event.number || github.head_ref || github.sha }}-${{ github.workflow }} diff --git a/.github/workflows/flex_interactive.yml b/.github/workflows/flex_interactive.yml new file mode 100644 index 000000000000..856954341f5f --- /dev/null +++ b/.github/workflows/flex_interactive.yml @@ -0,0 +1,58 @@ +name: Flex Interactive CI + +on: + # Trigger the workflow on push or pull request, + # but only for the main branch + workflow_dispatch: + push: + branches: + - main + paths: + - 'flex/**' + - '.github/workflows/flex-interactive.yml' + pull_request: + branches: + - main + paths: + - 'flex/**' + - '.github/workflows/flex-interactive.yml' + +concurrency: + group: ${{ github.repository }}-${{ github.event.number || github.head_ref || github.sha }}-${{ github.workflow }} + cancel-in-progress: true + +jobs: + api-test: + runs-on: ubuntu-22.04 + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Add envs to GITHUB_ENV + run: | + short_sha=$(git rev-parse --short HEAD) + echo "SHORT_SHA=${short_sha}" >> $GITHUB_ENV + + - name: Build Image + run: | + cd ${GITHUB_WORKSPACE} + python3 -m pip install --upgrade pip && python3 -m pip install -r python/requirements.txt + python3 ./gsctl.py flexbuild interactive --app docker + + - name: Build gsctl Wheel Package + run: | + cd ${GITHUB_WORKSPACE}/python + python3 setup_gsctl.py bdist_wheel + + - name: Test + run: | + # install gsctl + python3 -m pip install ${GITHUB_WORKSPACE}/python/dist/*.whl + # launch service: 8080 for coordinator http port; 7687 for cypher port; + docker run -p 8080:8080 -p 7688:7687 registry.cn-hongkong.aliyuncs.com/graphscope/interactive:${SHORT_SHA}-x86_64 --enable-coordinator & + # test + python3 -m pip install --no-cache-dir pytest pytest-xdist + python3 -m pytest -d --tx popen//python=python3 \ + -s -v \ + $(dirname $(python3 -c "import graphscope.gsctl as gsctl; print(gsctl.__file__)"))/tests/test_interactive.py diff --git a/.github/workflows/hqps-db-ci.yml b/.github/workflows/hqps-db-ci.yml deleted file mode 100644 index 3ebcba777388..000000000000 --- a/.github/workflows/hqps-db-ci.yml +++ /dev/null @@ -1,512 +0,0 @@ -name: GraphScope GIE HighQPS DB CI - -on: - # Trigger the workflow on push or pull request, - # but only for the main branch - workflow_dispatch: - push: - branches: - - main - paths: - - 'flex/**' - - 'interactive_engine/**' - - '.github/workflows/hqps-db-ci.yml' - pull_request: - branches: - - main - paths: - - 'flex/**' - - 'interactive_engine/**' - - '.github/workflows/hqps-db-ci.yml' - -concurrency: - group: ${{ github.repository }}-${{ github.event.number || github.head_ref || github.sha }}-${{ github.workflow }} - cancel-in-progress: true - -jobs: - test-hqps-engine: - runs-on: ubuntu-20.04 - if: ${{ github.repository == 'alibaba/GraphScope' }} - container: - image: registry.cn-hongkong.aliyuncs.com/graphscope/hqps-server-base:v0.0.10 - steps: - - uses: actions/checkout@v3 - - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ runner.os }}-maven- - - - uses: actions/cache@v3 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - ~/.cache/sccache - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - - name: Install latest libgrape-lite - if: false - run: | - git clone --single-branch https://github.com/alibaba/libgrape-lite.git /tmp/libgrape-lite - cd /tmp/libgrape-lite - mkdir -p build && cd build - cmake .. - make -j$(nproc) - make install - - - name: Setup tmate session - if: false - uses: mxschmitt/action-tmate@v3 - - - name: Build - env: - GIE_HOME: ${{ github.workspace }}/interactive_engine/ - HOME: /home/graphscope/ - run: | - cd ${GITHUB_WORKSPACE}/ - git submodule update --init - cd ${GITHUB_WORKSPACE}/flex - mkdir build && cd build - cmake .. && sudo make -j$(nproc) - sudo make install - - # cargo - . /home/graphscope/.cargo/env - which cargo - - # build compiler - cd ${GIE_HOME}/ - mvn clean install -Pexperimental -DskipTests - - - name: Prepare dataset and workspace - env: - GS_TEST_DIR: ${{ github.workspace }}/gstest - INTERACTIVE_WORKSPACE: /tmp/interactive_workspace - run: | - # download dataset - git clone -b master --single-branch --depth=1 https://github.com/GraphScope/gstest.git ${GS_TEST_DIR} - mkdir -p ${INTERACTIVE_WORKSPACE}/data/ldbc - GRAPH_SCHEMA_YAML=${GS_TEST_DIR}/flex/ldbc-sf01-long-date/audit_graph_schema.yaml - BUILD_LOAD_FILE=${GS_TEST_DIR}/flex/ldbc-sf01-long-date/audit_bulk_load.yaml - cp ${GRAPH_SCHEMA_YAML} ${INTERACTIVE_WORKSPACE}/data/ldbc/graph.yaml - cp ${BUILD_LOAD_FILE} ${INTERACTIVE_WORKSPACE}/data/ldbc/import.yaml - mkdir -p ${INTERACTIVE_WORKSPACE}/data/movies - cp ${GS_TEST_DIR}/flex/movies/movies_schema.yaml ${INTERACTIVE_WORKSPACE}/data/movies/graph.yaml - cp ${GS_TEST_DIR}/flex/movies/movies_import.yaml ${INTERACTIVE_WORKSPACE}/data/movies/import.yaml - mkdir -p ${INTERACTIVE_WORKSPACE}/data/graph_algo - cp ${GITHUB_WORKSPACE}/flex/tests/interactive/graph_algo_test.yaml ${INTERACTIVE_WORKSPACE}/data/graph_algo/graph.yaml - cp ${GITHUB_WORKSPACE}/flex/interactive/examples/graph_algo/import.yaml ${INTERACTIVE_WORKSPACE}/data/graph_algo/import.yaml - mkdir -p ${INTERACTIVE_WORKSPACE}/data/modern_graph - cp ${GITHUB_WORKSPACE}/flex/interactive/examples/modern_graph/graph.yaml ${INTERACTIVE_WORKSPACE}/data/modern_graph/graph.yaml - - # load graph - cd ${GITHUB_WORKSPACE}/flex/build - export FLEX_DATA_DIR=${GS_TEST_DIR}/flex/ldbc-sf01-long-date - GLOG_v=10 ./bin/bulk_loader -g ${INTERACTIVE_WORKSPACE}/data/ldbc/graph.yaml -l ${INTERACTIVE_WORKSPACE}/data/ldbc/import.yaml -d ${INTERACTIVE_WORKSPACE}/data/ldbc/indices/ - export FLEX_DATA_DIR=../interactive/examples/movies - GLOG_v=10 ./bin/bulk_loader -g ${INTERACTIVE_WORKSPACE}/data/movies/graph.yaml -l ${INTERACTIVE_WORKSPACE}/data/movies/import.yaml -d ${INTERACTIVE_WORKSPACE}/data/movies/indices/ - export FLEX_DATA_DIR=../interactive/examples/graph_algo - GLOG_v=10 ./bin/bulk_loader -g ${INTERACTIVE_WORKSPACE}/data/graph_algo/graph.yaml -l ${INTERACTIVE_WORKSPACE}/data/graph_algo/import.yaml -d ${INTERACTIVE_WORKSPACE}/data/graph_algo/indices/ - export FLEX_DATA_DIR=../interactive/examples/modern_graph - GLOG_v=10 ./bin/bulk_loader -g ${INTERACTIVE_WORKSPACE}/data/modern_graph/graph.yaml -l ../interactive/examples/modern_graph/bulk_load.yaml -d ${INTERACTIVE_WORKSPACE}/data/modern_graph/indices/ - - - name: Test HQPS admin http service - env: - GS_TEST_DIR: ${{ github.workspace }}/gstest - FLEX_DATA_DIR: ${{ github.workspace }}/flex/interactive/examples/modern_graph - TMP_INTERACTIVE_WORKSPACE: /tmp/temp_workspace - LD_LIBRARY_PATH: /usr/local/lib - run: | - rm -rf ${TMP_INTERACTIVE_WORKSPACE} - cd ${GITHUB_WORKSPACE}/flex/build/ - SCHEMA_FILE=${GITHUB_WORKSPACE}/flex/interactive/examples/modern_graph/graph.yaml - BULK_LOAD_FILE=${GITHUB_WORKSPACE}/flex/interactive/examples/modern_graph/bulk_load.yaml - mkdir -p ${TMP_INTERACTIVE_WORKSPACE}/data/modern_graph/ - cp ${SCHEMA_FILE} ${TMP_INTERACTIVE_WORKSPACE}/data/modern_graph/graph.yaml - GLOG_v=10 ./bin/bulk_loader -g ${SCHEMA_FILE} -l ${BULK_LOAD_FILE} -d ${TMP_INTERACTIVE_WORKSPACE}/data/modern_graph/indices/ - cd ${GITHUB_WORKSPACE}/flex/tests/hqps - sed -i 's/default_graph: ldbc/default_graph: modern_graph/g' ./engine_config_test.yaml - bash hqps_admin_test.sh ${TMP_INTERACTIVE_WORKSPACE} ./engine_config_test.yaml ${GS_TEST_DIR} - sed -i 's/default_graph: modern_graph/default_graph: ldbc/g' ./engine_config_test.yaml - - - name: Build and test Interactive Java/Python SDK - env: - FLEX_DATA_DIR: ${{ github.workspace }}/flex/interactive/examples/modern_graph - TMP_INTERACTIVE_WORKSPACE: /tmp/temp_workspace - LD_LIBRARY_PATH: /usr/local/lib - run: | - cd ${GITHUB_WORKSPACE}/flex/interactive/sdk/ - - bash generate_sdk.sh -g java - bash generate_sdk.sh -g python - cd java - mvn clean install -DskipTests - cd ../python - pip3 install -r requirements.txt - pip3 install -r test-requirements.txt - export PATH=${HOME}/.local/bin:$PATH - python3 setup.py build_proto - - rm -rf ${TMP_INTERACTIVE_WORKSPACE} - cd ${GITHUB_WORKSPACE}/flex/build/ - SCHEMA_FILE=${GITHUB_WORKSPACE}/flex/interactive/examples/modern_graph/graph.yaml - BULK_LOAD_FILE=${GITHUB_WORKSPACE}/flex/interactive/examples/modern_graph/bulk_load.yaml - mkdir -p ${TMP_INTERACTIVE_WORKSPACE}/data/modern_graph/ - cp ${SCHEMA_FILE} ${TMP_INTERACTIVE_WORKSPACE}/data/modern_graph/graph.yaml - GLOG_v=10 ./bin/bulk_loader -g ${SCHEMA_FILE} -l ${BULK_LOAD_FILE} -d ${TMP_INTERACTIVE_WORKSPACE}/data/modern_graph/indices/ - cd ${GITHUB_WORKSPACE}/flex/tests/hqps - sed -i 's/default_graph: ldbc/default_graph: modern_graph/g' ./engine_config_test.yaml - sed -i 's/interactive_workspace/temp_workspace/g' ./engine_config_test.yaml - bash hqps_sdk_test.sh ${TMP_INTERACTIVE_WORKSPACE} ./engine_config_test.yaml java - bash hqps_sdk_test.sh ${TMP_INTERACTIVE_WORKSPACE} ./engine_config_test.yaml python - sed -i 's/default_graph: modern_graph/default_graph: ldbc/g' ./engine_config_test.yaml - sed -i 's/temp_workspace/interactive_workspace/g' ./engine_config_test.yaml - - - name: Sample Query test - env: - GS_TEST_DIR: ${{ github.workspace }}/gstest - run: | - cd ${GITHUB_WORKSPACE}/flex/build - export FLEX_DATA_DIR=${GS_TEST_DIR}/flex/ldbc-sf01-long-date - ./bin/bulk_loader -g ${GS_TEST_DIR}/flex/ldbc-sf01-long-date/audit_graph_schema.yaml \ - -l ${GS_TEST_DIR}/flex/ldbc-sf01-long-date/audit_bulk_load.yaml -d /tmp/csr-data-dir/ - rm -r /tmp/csr-data-dir/runtime/* - rm -r /tmp/csr-data-dir/wal - ./tests/hqps/query_test ${GS_TEST_DIR}/flex/ldbc-sf01-long-date/audit_graph_schema.yaml \ - /tmp/csr-data-dir/ - - - name: Run codegen test. - env: - GS_TEST_DIR: ${{ github.workspace }}/gstest - HOME : /home/graphscope/ - INTERACTIVE_WORKSPACE: /tmp/interactive_workspace - run: | - cd ${GITHUB_WORKSPACE}/flex/bin - - for i in 1 2 3 4 5 6 7 8 9 10 11 12; - do - cmd="./load_plan_and_gen.sh -e=hqps -i=../resources/queries/ic/adhoc/ic${i}_adhoc.cypher -w=/tmp/codegen/" - cmd=${cmd}" -o=/tmp/plugin --ir_conf=../tests/hqps/engine_config_test.yaml " - cmd=${cmd}" --graph_schema_path=${INTERACTIVE_WORKSPACE}/data/ldbc/graph.yaml" - echo $cmd - eval ${cmd} || exit 1 - done - - for i in 1 2 3 4 5 6 7 8 9 11 12; # 10 is not supported now - do - cmd="./load_plan_and_gen.sh -e=hqps -i=../resources/queries/ic/adhoc/simple_match_${i}.cypher -w=/tmp/codegen/" - cmd=${cmd}" -o=/tmp/plugin --ir_conf=../tests/hqps/engine_config_test.yaml " - cmd=${cmd}" --graph_schema_path=${INTERACTIVE_WORKSPACE}/data/ldbc/graph.yaml" - echo $cmd - eval ${cmd} || exit 1 - done - - # test movie graph, 8,9,10 are not supported now - # change the default_graph config in ../tests/hqps/engine_config_test.yaml to movies - sed -i 's/default_graph: ldbc/default_graph: movies/g' ../tests/hqps/engine_config_test.yaml - for i in 1 2 3 4 5 6 7 11 12 13 14 15; - do - cmd="./load_plan_and_gen.sh -e=hqps -i=../tests/hqps/queries/movie/query${i}.cypher -w=/tmp/codegen/" - cmd=${cmd}" -o=/tmp/plugin --ir_conf=../tests/hqps/engine_config_test.yaml " - cmd=${cmd}" --graph_schema_path=${INTERACTIVE_WORKSPACE}/data/movies/graph.yaml" - echo $cmd - eval ${cmd} || exit 1 - done - - - name: Test cypher&cpp procedure generation and loading - env: - TMP_INTERACTIVE_WORKSPACE: /tmp/temp_workspace - PLUGIN_DIR: /tmp/temp_workspace/data/modern_graph/plugins - FLEX_DATA_DIR: ${{ github.workspace }}/flex/interactive/examples/modern_graph - LD_LIBRARY_PATH: /usr/local/lib - run: | - rm -rf ${TMP_INTERACTIVE_WORKSPACE} - cd ${GITHUB_WORKSPACE}/flex/build/ - SCHEMA_FILE=${GITHUB_WORKSPACE}/flex/interactive/examples/modern_graph/graph.yaml - BULK_LOAD_FILE=${GITHUB_WORKSPACE}/flex/interactive/examples/modern_graph/bulk_load.yaml - mkdir -p ${TMP_INTERACTIVE_WORKSPACE}/data/modern_graph/ - cp ${SCHEMA_FILE} ${TMP_INTERACTIVE_WORKSPACE}/data/modern_graph/graph.yaml - GLOG_v=10 ./bin/bulk_loader -g ${SCHEMA_FILE} -l ${BULK_LOAD_FILE} -d ${TMP_INTERACTIVE_WORKSPACE}/data/modern_graph/indices/ - - mkdir -p ${PLUGIN_DIR} - pip3 install argparse - - cd ${GITHUB_WORKSPACE}/flex/bin - ./load_plan_and_gen.sh -e=hqps -i=../tests/interactive/plus_one.cc -w=/tmp/codegen \ - --ir_conf=${GITHUB_WORKSPACE}/flex/tests/hqps/engine_config_test.yaml -o=${PLUGIN_DIR} \ - --procedure_name=plus_one \ - --graph_schema_path=../interactive/examples/modern_graph/graph.yaml - - ./load_plan_and_gen.sh -e=hqps -i=../interactive/sdk/java/src/test/resources/sample_app.cc -w=/tmp/codegen \ - --ir_conf=${GITHUB_WORKSPACE}/flex/tests/hqps/engine_config_test.yaml -o=${PLUGIN_DIR} \ - --procedure_name=sample_app \ - --graph_schema_path=../interactive/examples/modern_graph/graph.yaml - - ./load_plan_and_gen.sh -e=hqps -i=../interactive/examples/modern_graph/count_vertex_num.cypher -w=/tmp/codegen \ - --ir_conf=${GITHUB_WORKSPACE}/flex/tests/hqps/engine_config_test.yaml -o=${PLUGIN_DIR} \ - --procedure_name=count_vertex_num \ - --graph_schema_path=../interactive/examples/modern_graph/graph.yaml - - # Among the above procedures, the correct input format for each is: - # count_vertex_num: () -> (num: int64), CypherProcedure. - # plus_one: (num: int64) -> (num: int64), CppEncoder - # sample_app: (num: int64) -> (num: int64), kCypherJson - - sed -i 's/default_graph: movies/default_graph: modern_graph/g' ${GITHUB_WORKSPACE}/flex/tests/hqps/engine_config_test.yaml - sed -i 's/interactive_workspace/temp_workspace/g' ${GITHUB_WORKSPACE}/flex/tests/hqps/engine_config_test.yaml - cd ${GITHUB_WORKSPACE}/flex/tests/interactive/ - bash test_plugin_loading.sh ${TMP_INTERACTIVE_WORKSPACE} modern_graph \ - ${GITHUB_WORKSPACE}/flex/tests/hqps/engine_config_test.yaml \ - ./modern_graph_schema_v0_0.yaml ./modern_graph_schema_v0_1.yaml - sed -i 's/temp_workspace/interactive_workspace/g' ${GITHUB_WORKSPACE}/flex/tests/hqps/engine_config_test.yaml - sed -i 's/default_graph: modern_graph/default_graph: movies/g' ${GITHUB_WORKSPACE}/flex/tests/hqps/engine_config_test.yaml - - - name: Run End-to-End cypher adhoc ldbc query test - env: - GS_TEST_DIR: ${{ github.workspace }}/gstest - HOME : /home/graphscope/ - INTERACTIVE_WORKSPACE: /tmp/interactive_workspace - LD_LIBRARY_PATH: /usr/local/lib - run: | - cd ${GITHUB_WORKSPACE}/flex/tests/hqps/ - export ENGINE_TYPE=hiactor - # change the default_graph config in ./engine_config_test.yaml to ldbc - sed -i 's/default_graph: movies/default_graph: ldbc/g' ./engine_config_test.yaml - bash hqps_adhoc_test.sh ${INTERACTIVE_WORKSPACE} ldbc \ - ${GITHUB_WORKSPACE}/flex/tests/hqps/engine_config_test.yaml - - - name: Run End-to-End cypher adhoc movie query test - env: - GS_TEST_DIR: ${{ github.workspace }}/gstest - HOME : /home/graphscope/ - INTERACTIVE_WORKSPACE: /tmp/interactive_workspace - LD_LIBRARY_PATH: /usr/local/lib - run: | - cd ${GITHUB_WORKSPACE}/flex/tests/hqps/ - export ENGINE_TYPE=hiactor - # change the default_graph config in ./engine_config_test.yaml to movies - sed -i 's/default_graph: ldbc/default_graph: movies/g' ./engine_config_test.yaml - bash hqps_adhoc_test.sh ${INTERACTIVE_WORKSPACE} movies \ - ${GITHUB_WORKSPACE}/flex/tests/hqps/engine_config_test.yaml - - - name: Run End-to-End cypher adhoc graph_algo query test - env: - GS_TEST_DIR: ${{ github.workspace }}/gstest - HOME : /home/graphscope/ - INTERACTIVE_WORKSPACE: /tmp/interactive_workspace - LD_LIBRARY_PATH: /usr/local/lib - run: | - cd ${GITHUB_WORKSPACE}/flex/tests/hqps/ - export ENGINE_TYPE=hiactor - # change the default_graph config in ${GS_TEST_DIR}/flex/ldbc-sf01-long-date/engine_config.yaml to graph_algo - sed -i 's/default_graph: movies/default_graph: graph_algo/g' ./engine_config_test.yaml - bash hqps_adhoc_test.sh ${INTERACTIVE_WORKSPACE} graph_algo \ - ${GITHUB_WORKSPACE}/flex/tests/hqps/engine_config_test.yaml - - - name: Run Gremlin test on modern graph - env: - GS_TEST_DIR: ${{ github.workspace }}/gstest - INTERACTIVE_WORKSPACE: /tmp/interactive_workspace - LD_LIBRARY_PATH: /usr/local/lib - run: | - cd ${GITHUB_WORKSPACE}/flex/tests/hqps/ - export ENGINE_TYPE=hiactor - sed -i 's/default_graph: graph_algo/default_graph: modern_graph/g' ./engine_config_test.yaml - bash hqps_adhoc_test.sh ${INTERACTIVE_WORKSPACE} modern_graph \ - ${GITHUB_WORKSPACE}/flex/tests/hqps/engine_config_test.yaml gremlin - - test-build-flex: - runs-on: ubuntu-22.04 - - strategy: - matrix: - os: [ubuntu-22.04] - platform: [x86_64] - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Install dependencies - run: | - cd ${GITHUB_WORKSPACE}/flex - bash ./scripts/install_dependencies.sh 4 - - - name: Setup tmate session - if: false - uses: mxschmitt/action-tmate@v2 - - - name: Build - run: | - cd ${GITHUB_WORKSPACE}/flex - git submodule update --init - mkdir build && cd build # only test default build - cmake .. -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_DOC=OFF && sudo make -j 4 - - # test the different combination of cmake options: -DBUILD_HQPS=ON/OFF -DBUILD_TEST=ON/OFF, -DBUILD_ODPS_FRAGMENT_LOADER=ON/OFF - test-cmake-options: - runs-on: ubuntu-20.04 - container: - image: registry.cn-hongkong.aliyuncs.com/graphscope/hqps-server-base:v0.0.10 - strategy: - matrix: - BUILD_HQPS: [ON, OFF] - BUILD_TEST: [ON, OFF] - BUILD_ODPS_FRAGMENT_LOADER: [ON, OFF] - steps: - - uses: actions/checkout@v3 - - - name: Build - run: | - cd ${GITHUB_WORKSPACE}/flex - git submodule update --init - mkdir build && cd build - cmake .. -DBUILD_HQPS=${{ matrix.BUILD_HQPS }} -DBUILD_TEST=${{ matrix.BUILD_TEST }} \ - -DBUILD_ODPS_FRAGMENT_LOADER=${{ matrix.BUILD_ODPS_FRAGMENT_LOADER }} - sudo make -j4 - - test-AOCC-compilation: - runs-on: ubuntu-20.04 - container: - image: registry.cn-hongkong.aliyuncs.com/graphscope/hqps-server-base:v0.0.10 - steps: - - uses: actions/checkout@v3 - - - name: Download aocc compiler - run: | - cd ${GITHUB_WORKSPACE}/flex - wget https://download.amd.com/developer/eula/aocc/aocc-4-1/aocc-compiler-4.1.0_1_amd64.deb - sudo apt-get update && sudo apt-get install libncurses-dev libncurses5-dev - sudo dpkg -i aocc-compiler-4.1.0_1_amd64.deb - - - name: Test AOCC compiler - env: - CC: clang - CXX: clang++ - OMPI_CC: clang - OMPI_CXX: clang++ - run: | - . /opt/AMD/aocc-compiler-4.1.0/setenv_AOCC.sh - cd ${GITHUB_WORKSPACE}/flex - git submodule update --init - mkdir build && cd build - cmake .. -DBUILD_DOC=OFF -DCMAKE_BUILD_TYPE=DEBUG - sudo make -j4 - - test-flex: - runs-on: ubuntu-20.04 - if: ${{ github.repository == 'alibaba/GraphScope' }} - container: - image: registry.cn-hongkong.aliyuncs.com/graphscope/hqps-server-base:v0.0.10 - steps: - - uses: actions/checkout@v3 - - - name: Install latest libgrape-lite - if: false - run: | - git clone --single-branch https://github.com/alibaba/libgrape-lite.git /tmp/libgrape-lite - cd /tmp/libgrape-lite - mkdir -p build && cd build - cmake .. - make -j$(nproc) - make install - - - name: Build - env: - HOME: /home/graphscope/ - run: | - cd ${GITHUB_WORKSPACE}/flex - git submodule update --init - mkdir build && cd build - cmake .. && sudo make -j$(nproc) - - - name: Test GRIN on mutable csr - run: | - git submodule update --init - cd flex/engines/graph_db/grin - mkdir build && cd build - cmake .. && sudo make -j$(nproc) - export FLEX_DATA_DIR=../../../../interactive/examples/modern_graph/ - ${GITHUB_WORKSPACE}/flex/build/bin/bulk_loader -g ../../../../interactive/examples/modern_graph/graph.yaml -l ../../../../interactive/examples/modern_graph/bulk_load.yaml -d ./data/ - rm -r ./data/wal - rm -r ./data/runtime/* - ./run_grin_test 'flex://schema_file=../../../../interactive/examples/modern_graph/graph.yaml&data_dir=./data/' - - - name: Prepare test dataset - env: - GS_TEST_DIR: ${{ github.workspace }}/gstest/ - run: | - git clone -b master --single-branch --depth=1 https://github.com/GraphScope/gstest.git ${GS_TEST_DIR} - - - name: Test String edge property on modern graph - env: - FLEX_DATA_DIR: ${{ github.workspace }}/flex/interactive/examples/modern_graph/ - run: | - rm -rf /tmp/csr-data-dir/ - cd ${GITHUB_WORKSPACE}/flex/build/ - SCHEMA_FILE=../tests/rt_mutable_graph/modern_graph_string_edge.yaml - BULK_LOAD_FILE=../interactive/examples/modern_graph/bulk_load.yaml - GLOG_v=10 ./bin/bulk_loader -g ${SCHEMA_FILE} -l ${BULK_LOAD_FILE} -d /tmp/csr-data-dir/ - GLOG_v=10 ./tests/rt_mutable_graph/string_edge_property_test ${SCHEMA_FILE} /tmp/csr-data-dir/ - - - name: Test schema parsing and loading on modern graph - env: - FLEX_DATA_DIR: ${{ github.workspace }}/flex/interactive/examples/modern_graph/ - run: | - rm -rf /tmp/csr-data-dir/ - cd ${GITHUB_WORKSPACE}/flex/build/ - SCHEMA_FILE=../tests/rt_mutable_graph/modern_graph_unified_schema.yaml - BULK_LOAD_FILE=../interactive/examples/modern_graph/bulk_load.yaml - GLOG_v=10 ./bin/bulk_loader -g ${SCHEMA_FILE} -l ${BULK_LOAD_FILE} -d /tmp/csr-data-dir/ - - - name: Test build empty graph - run: | - rm -rf /tmp/csr-data-dir/ - cd ${GITHUB_WORKSPACE}/flex/build/ - GLOG_v=10 ./tests/rt_mutable_graph/test_empty_graph /tmp/csr-data-dir/ - - name: Test ACID - run: | - rm -rf /tmp/csr-data-dir/ - cd ${GITHUB_WORKSPACE}/flex/build/ - GLOG_v=10 ./tests/rt_mutable_graph/test_acid 8 /tmp/csr-data-dir/ - - - name: Test Graph Loading on modern graph - env: - FLEX_DATA_DIR: ${{ github.workspace }}/flex/interactive/examples/modern_graph/ - run: | - rm -rf /tmp/csr-data-dir/ - cd ${GITHUB_WORKSPACE}/flex/build/ - SCHEMA_FILE=../interactive/examples/modern_graph/graph.yaml - BULK_LOAD_FILE=../interactive/examples/modern_graph/bulk_load.yaml - GLOG_v=10 ./bin/bulk_loader -g ${SCHEMA_FILE} -l ${BULK_LOAD_FILE} -d /tmp/csr-data-dir/ - - - name: Test Graph Loading on type_test graph - env: - GS_TEST_DIR: ${{ github.workspace }}/gstest/ - FLEX_DATA_DIR: ${{ github.workspace }}/gstest/flex/type_test/ - run: | - # remove modern graph indices - rm -rf /tmp/csr-data-dir/ - - cd ${GITHUB_WORKSPACE}/flex/build/ - SCHEMA_FILE=${GS_TEST_DIR}/flex/type_test/graph.yaml - BULK_LOAD_FILE=${GS_TEST_DIR}/flex/type_test/import.yaml - GLOG_v=10 ./bin/bulk_loader -g ${SCHEMA_FILE} -l ${BULK_LOAD_FILE} -d /tmp/csr-data-dir/ -p 2 - - - name: Test Graph Loading on LDBC SNB sf0.1 - env: - GS_TEST_DIR: ${{ github.workspace }}/gstest/ - FLEX_DATA_DIR: ${{ github.workspace }}/gstest/flex/ldbc-sf01-long-date/ - run: | - # remove previous graph indices - rm -rf /tmp/csr-data-dir/ - - cd ${GITHUB_WORKSPACE}/flex/build/ - SCHEMA_FILE=${FLEX_DATA_DIR}/audit_graph_schema.yaml - BULK_LOAD_FILE=${FLEX_DATA_DIR}/audit_bulk_load.yaml - GLOG_v=10 ./bin/bulk_loader -g ${SCHEMA_FILE} -l ${BULK_LOAD_FILE} -d /tmp/csr-data-dir/ -p 2 diff --git a/.github/workflows/interactive.yml b/.github/workflows/interactive.yml index aa0ce375ed66..3ebcba777388 100644 --- a/.github/workflows/interactive.yml +++ b/.github/workflows/interactive.yml @@ -1,4 +1,4 @@ -name: Flex Interactive CI +name: GraphScope GIE HighQPS DB CI on: # Trigger the workflow on push or pull request, @@ -9,50 +9,504 @@ on: - main paths: - 'flex/**' - - '.github/workflows/interactive.yml' + - 'interactive_engine/**' + - '.github/workflows/hqps-db-ci.yml' pull_request: branches: - main paths: - 'flex/**' - - '.github/workflows/interactive.yml' + - 'interactive_engine/**' + - '.github/workflows/hqps-db-ci.yml' concurrency: group: ${{ github.repository }}-${{ github.event.number || github.head_ref || github.sha }}-${{ github.workflow }} cancel-in-progress: true jobs: - api-test: + test-hqps-engine: + runs-on: ubuntu-20.04 + if: ${{ github.repository == 'alibaba/GraphScope' }} + container: + image: registry.cn-hongkong.aliyuncs.com/graphscope/hqps-server-base:v0.0.10 + steps: + - uses: actions/checkout@v3 + + - uses: actions/cache@v3 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + ~/.cache/sccache + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + + - name: Install latest libgrape-lite + if: false + run: | + git clone --single-branch https://github.com/alibaba/libgrape-lite.git /tmp/libgrape-lite + cd /tmp/libgrape-lite + mkdir -p build && cd build + cmake .. + make -j$(nproc) + make install + + - name: Setup tmate session + if: false + uses: mxschmitt/action-tmate@v3 + + - name: Build + env: + GIE_HOME: ${{ github.workspace }}/interactive_engine/ + HOME: /home/graphscope/ + run: | + cd ${GITHUB_WORKSPACE}/ + git submodule update --init + cd ${GITHUB_WORKSPACE}/flex + mkdir build && cd build + cmake .. && sudo make -j$(nproc) + sudo make install + + # cargo + . /home/graphscope/.cargo/env + which cargo + + # build compiler + cd ${GIE_HOME}/ + mvn clean install -Pexperimental -DskipTests + + - name: Prepare dataset and workspace + env: + GS_TEST_DIR: ${{ github.workspace }}/gstest + INTERACTIVE_WORKSPACE: /tmp/interactive_workspace + run: | + # download dataset + git clone -b master --single-branch --depth=1 https://github.com/GraphScope/gstest.git ${GS_TEST_DIR} + mkdir -p ${INTERACTIVE_WORKSPACE}/data/ldbc + GRAPH_SCHEMA_YAML=${GS_TEST_DIR}/flex/ldbc-sf01-long-date/audit_graph_schema.yaml + BUILD_LOAD_FILE=${GS_TEST_DIR}/flex/ldbc-sf01-long-date/audit_bulk_load.yaml + cp ${GRAPH_SCHEMA_YAML} ${INTERACTIVE_WORKSPACE}/data/ldbc/graph.yaml + cp ${BUILD_LOAD_FILE} ${INTERACTIVE_WORKSPACE}/data/ldbc/import.yaml + mkdir -p ${INTERACTIVE_WORKSPACE}/data/movies + cp ${GS_TEST_DIR}/flex/movies/movies_schema.yaml ${INTERACTIVE_WORKSPACE}/data/movies/graph.yaml + cp ${GS_TEST_DIR}/flex/movies/movies_import.yaml ${INTERACTIVE_WORKSPACE}/data/movies/import.yaml + mkdir -p ${INTERACTIVE_WORKSPACE}/data/graph_algo + cp ${GITHUB_WORKSPACE}/flex/tests/interactive/graph_algo_test.yaml ${INTERACTIVE_WORKSPACE}/data/graph_algo/graph.yaml + cp ${GITHUB_WORKSPACE}/flex/interactive/examples/graph_algo/import.yaml ${INTERACTIVE_WORKSPACE}/data/graph_algo/import.yaml + mkdir -p ${INTERACTIVE_WORKSPACE}/data/modern_graph + cp ${GITHUB_WORKSPACE}/flex/interactive/examples/modern_graph/graph.yaml ${INTERACTIVE_WORKSPACE}/data/modern_graph/graph.yaml + + # load graph + cd ${GITHUB_WORKSPACE}/flex/build + export FLEX_DATA_DIR=${GS_TEST_DIR}/flex/ldbc-sf01-long-date + GLOG_v=10 ./bin/bulk_loader -g ${INTERACTIVE_WORKSPACE}/data/ldbc/graph.yaml -l ${INTERACTIVE_WORKSPACE}/data/ldbc/import.yaml -d ${INTERACTIVE_WORKSPACE}/data/ldbc/indices/ + export FLEX_DATA_DIR=../interactive/examples/movies + GLOG_v=10 ./bin/bulk_loader -g ${INTERACTIVE_WORKSPACE}/data/movies/graph.yaml -l ${INTERACTIVE_WORKSPACE}/data/movies/import.yaml -d ${INTERACTIVE_WORKSPACE}/data/movies/indices/ + export FLEX_DATA_DIR=../interactive/examples/graph_algo + GLOG_v=10 ./bin/bulk_loader -g ${INTERACTIVE_WORKSPACE}/data/graph_algo/graph.yaml -l ${INTERACTIVE_WORKSPACE}/data/graph_algo/import.yaml -d ${INTERACTIVE_WORKSPACE}/data/graph_algo/indices/ + export FLEX_DATA_DIR=../interactive/examples/modern_graph + GLOG_v=10 ./bin/bulk_loader -g ${INTERACTIVE_WORKSPACE}/data/modern_graph/graph.yaml -l ../interactive/examples/modern_graph/bulk_load.yaml -d ${INTERACTIVE_WORKSPACE}/data/modern_graph/indices/ + + - name: Test HQPS admin http service + env: + GS_TEST_DIR: ${{ github.workspace }}/gstest + FLEX_DATA_DIR: ${{ github.workspace }}/flex/interactive/examples/modern_graph + TMP_INTERACTIVE_WORKSPACE: /tmp/temp_workspace + LD_LIBRARY_PATH: /usr/local/lib + run: | + rm -rf ${TMP_INTERACTIVE_WORKSPACE} + cd ${GITHUB_WORKSPACE}/flex/build/ + SCHEMA_FILE=${GITHUB_WORKSPACE}/flex/interactive/examples/modern_graph/graph.yaml + BULK_LOAD_FILE=${GITHUB_WORKSPACE}/flex/interactive/examples/modern_graph/bulk_load.yaml + mkdir -p ${TMP_INTERACTIVE_WORKSPACE}/data/modern_graph/ + cp ${SCHEMA_FILE} ${TMP_INTERACTIVE_WORKSPACE}/data/modern_graph/graph.yaml + GLOG_v=10 ./bin/bulk_loader -g ${SCHEMA_FILE} -l ${BULK_LOAD_FILE} -d ${TMP_INTERACTIVE_WORKSPACE}/data/modern_graph/indices/ + cd ${GITHUB_WORKSPACE}/flex/tests/hqps + sed -i 's/default_graph: ldbc/default_graph: modern_graph/g' ./engine_config_test.yaml + bash hqps_admin_test.sh ${TMP_INTERACTIVE_WORKSPACE} ./engine_config_test.yaml ${GS_TEST_DIR} + sed -i 's/default_graph: modern_graph/default_graph: ldbc/g' ./engine_config_test.yaml + + - name: Build and test Interactive Java/Python SDK + env: + FLEX_DATA_DIR: ${{ github.workspace }}/flex/interactive/examples/modern_graph + TMP_INTERACTIVE_WORKSPACE: /tmp/temp_workspace + LD_LIBRARY_PATH: /usr/local/lib + run: | + cd ${GITHUB_WORKSPACE}/flex/interactive/sdk/ + + bash generate_sdk.sh -g java + bash generate_sdk.sh -g python + cd java + mvn clean install -DskipTests + cd ../python + pip3 install -r requirements.txt + pip3 install -r test-requirements.txt + export PATH=${HOME}/.local/bin:$PATH + python3 setup.py build_proto + + rm -rf ${TMP_INTERACTIVE_WORKSPACE} + cd ${GITHUB_WORKSPACE}/flex/build/ + SCHEMA_FILE=${GITHUB_WORKSPACE}/flex/interactive/examples/modern_graph/graph.yaml + BULK_LOAD_FILE=${GITHUB_WORKSPACE}/flex/interactive/examples/modern_graph/bulk_load.yaml + mkdir -p ${TMP_INTERACTIVE_WORKSPACE}/data/modern_graph/ + cp ${SCHEMA_FILE} ${TMP_INTERACTIVE_WORKSPACE}/data/modern_graph/graph.yaml + GLOG_v=10 ./bin/bulk_loader -g ${SCHEMA_FILE} -l ${BULK_LOAD_FILE} -d ${TMP_INTERACTIVE_WORKSPACE}/data/modern_graph/indices/ + cd ${GITHUB_WORKSPACE}/flex/tests/hqps + sed -i 's/default_graph: ldbc/default_graph: modern_graph/g' ./engine_config_test.yaml + sed -i 's/interactive_workspace/temp_workspace/g' ./engine_config_test.yaml + bash hqps_sdk_test.sh ${TMP_INTERACTIVE_WORKSPACE} ./engine_config_test.yaml java + bash hqps_sdk_test.sh ${TMP_INTERACTIVE_WORKSPACE} ./engine_config_test.yaml python + sed -i 's/default_graph: modern_graph/default_graph: ldbc/g' ./engine_config_test.yaml + sed -i 's/temp_workspace/interactive_workspace/g' ./engine_config_test.yaml + + - name: Sample Query test + env: + GS_TEST_DIR: ${{ github.workspace }}/gstest + run: | + cd ${GITHUB_WORKSPACE}/flex/build + export FLEX_DATA_DIR=${GS_TEST_DIR}/flex/ldbc-sf01-long-date + ./bin/bulk_loader -g ${GS_TEST_DIR}/flex/ldbc-sf01-long-date/audit_graph_schema.yaml \ + -l ${GS_TEST_DIR}/flex/ldbc-sf01-long-date/audit_bulk_load.yaml -d /tmp/csr-data-dir/ + rm -r /tmp/csr-data-dir/runtime/* + rm -r /tmp/csr-data-dir/wal + ./tests/hqps/query_test ${GS_TEST_DIR}/flex/ldbc-sf01-long-date/audit_graph_schema.yaml \ + /tmp/csr-data-dir/ + + - name: Run codegen test. + env: + GS_TEST_DIR: ${{ github.workspace }}/gstest + HOME : /home/graphscope/ + INTERACTIVE_WORKSPACE: /tmp/interactive_workspace + run: | + cd ${GITHUB_WORKSPACE}/flex/bin + + for i in 1 2 3 4 5 6 7 8 9 10 11 12; + do + cmd="./load_plan_and_gen.sh -e=hqps -i=../resources/queries/ic/adhoc/ic${i}_adhoc.cypher -w=/tmp/codegen/" + cmd=${cmd}" -o=/tmp/plugin --ir_conf=../tests/hqps/engine_config_test.yaml " + cmd=${cmd}" --graph_schema_path=${INTERACTIVE_WORKSPACE}/data/ldbc/graph.yaml" + echo $cmd + eval ${cmd} || exit 1 + done + + for i in 1 2 3 4 5 6 7 8 9 11 12; # 10 is not supported now + do + cmd="./load_plan_and_gen.sh -e=hqps -i=../resources/queries/ic/adhoc/simple_match_${i}.cypher -w=/tmp/codegen/" + cmd=${cmd}" -o=/tmp/plugin --ir_conf=../tests/hqps/engine_config_test.yaml " + cmd=${cmd}" --graph_schema_path=${INTERACTIVE_WORKSPACE}/data/ldbc/graph.yaml" + echo $cmd + eval ${cmd} || exit 1 + done + + # test movie graph, 8,9,10 are not supported now + # change the default_graph config in ../tests/hqps/engine_config_test.yaml to movies + sed -i 's/default_graph: ldbc/default_graph: movies/g' ../tests/hqps/engine_config_test.yaml + for i in 1 2 3 4 5 6 7 11 12 13 14 15; + do + cmd="./load_plan_and_gen.sh -e=hqps -i=../tests/hqps/queries/movie/query${i}.cypher -w=/tmp/codegen/" + cmd=${cmd}" -o=/tmp/plugin --ir_conf=../tests/hqps/engine_config_test.yaml " + cmd=${cmd}" --graph_schema_path=${INTERACTIVE_WORKSPACE}/data/movies/graph.yaml" + echo $cmd + eval ${cmd} || exit 1 + done + + - name: Test cypher&cpp procedure generation and loading + env: + TMP_INTERACTIVE_WORKSPACE: /tmp/temp_workspace + PLUGIN_DIR: /tmp/temp_workspace/data/modern_graph/plugins + FLEX_DATA_DIR: ${{ github.workspace }}/flex/interactive/examples/modern_graph + LD_LIBRARY_PATH: /usr/local/lib + run: | + rm -rf ${TMP_INTERACTIVE_WORKSPACE} + cd ${GITHUB_WORKSPACE}/flex/build/ + SCHEMA_FILE=${GITHUB_WORKSPACE}/flex/interactive/examples/modern_graph/graph.yaml + BULK_LOAD_FILE=${GITHUB_WORKSPACE}/flex/interactive/examples/modern_graph/bulk_load.yaml + mkdir -p ${TMP_INTERACTIVE_WORKSPACE}/data/modern_graph/ + cp ${SCHEMA_FILE} ${TMP_INTERACTIVE_WORKSPACE}/data/modern_graph/graph.yaml + GLOG_v=10 ./bin/bulk_loader -g ${SCHEMA_FILE} -l ${BULK_LOAD_FILE} -d ${TMP_INTERACTIVE_WORKSPACE}/data/modern_graph/indices/ + + mkdir -p ${PLUGIN_DIR} + pip3 install argparse + + cd ${GITHUB_WORKSPACE}/flex/bin + ./load_plan_and_gen.sh -e=hqps -i=../tests/interactive/plus_one.cc -w=/tmp/codegen \ + --ir_conf=${GITHUB_WORKSPACE}/flex/tests/hqps/engine_config_test.yaml -o=${PLUGIN_DIR} \ + --procedure_name=plus_one \ + --graph_schema_path=../interactive/examples/modern_graph/graph.yaml + + ./load_plan_and_gen.sh -e=hqps -i=../interactive/sdk/java/src/test/resources/sample_app.cc -w=/tmp/codegen \ + --ir_conf=${GITHUB_WORKSPACE}/flex/tests/hqps/engine_config_test.yaml -o=${PLUGIN_DIR} \ + --procedure_name=sample_app \ + --graph_schema_path=../interactive/examples/modern_graph/graph.yaml + + ./load_plan_and_gen.sh -e=hqps -i=../interactive/examples/modern_graph/count_vertex_num.cypher -w=/tmp/codegen \ + --ir_conf=${GITHUB_WORKSPACE}/flex/tests/hqps/engine_config_test.yaml -o=${PLUGIN_DIR} \ + --procedure_name=count_vertex_num \ + --graph_schema_path=../interactive/examples/modern_graph/graph.yaml + + # Among the above procedures, the correct input format for each is: + # count_vertex_num: () -> (num: int64), CypherProcedure. + # plus_one: (num: int64) -> (num: int64), CppEncoder + # sample_app: (num: int64) -> (num: int64), kCypherJson + + sed -i 's/default_graph: movies/default_graph: modern_graph/g' ${GITHUB_WORKSPACE}/flex/tests/hqps/engine_config_test.yaml + sed -i 's/interactive_workspace/temp_workspace/g' ${GITHUB_WORKSPACE}/flex/tests/hqps/engine_config_test.yaml + cd ${GITHUB_WORKSPACE}/flex/tests/interactive/ + bash test_plugin_loading.sh ${TMP_INTERACTIVE_WORKSPACE} modern_graph \ + ${GITHUB_WORKSPACE}/flex/tests/hqps/engine_config_test.yaml \ + ./modern_graph_schema_v0_0.yaml ./modern_graph_schema_v0_1.yaml + sed -i 's/temp_workspace/interactive_workspace/g' ${GITHUB_WORKSPACE}/flex/tests/hqps/engine_config_test.yaml + sed -i 's/default_graph: modern_graph/default_graph: movies/g' ${GITHUB_WORKSPACE}/flex/tests/hqps/engine_config_test.yaml + + - name: Run End-to-End cypher adhoc ldbc query test + env: + GS_TEST_DIR: ${{ github.workspace }}/gstest + HOME : /home/graphscope/ + INTERACTIVE_WORKSPACE: /tmp/interactive_workspace + LD_LIBRARY_PATH: /usr/local/lib + run: | + cd ${GITHUB_WORKSPACE}/flex/tests/hqps/ + export ENGINE_TYPE=hiactor + # change the default_graph config in ./engine_config_test.yaml to ldbc + sed -i 's/default_graph: movies/default_graph: ldbc/g' ./engine_config_test.yaml + bash hqps_adhoc_test.sh ${INTERACTIVE_WORKSPACE} ldbc \ + ${GITHUB_WORKSPACE}/flex/tests/hqps/engine_config_test.yaml + + - name: Run End-to-End cypher adhoc movie query test + env: + GS_TEST_DIR: ${{ github.workspace }}/gstest + HOME : /home/graphscope/ + INTERACTIVE_WORKSPACE: /tmp/interactive_workspace + LD_LIBRARY_PATH: /usr/local/lib + run: | + cd ${GITHUB_WORKSPACE}/flex/tests/hqps/ + export ENGINE_TYPE=hiactor + # change the default_graph config in ./engine_config_test.yaml to movies + sed -i 's/default_graph: ldbc/default_graph: movies/g' ./engine_config_test.yaml + bash hqps_adhoc_test.sh ${INTERACTIVE_WORKSPACE} movies \ + ${GITHUB_WORKSPACE}/flex/tests/hqps/engine_config_test.yaml + + - name: Run End-to-End cypher adhoc graph_algo query test + env: + GS_TEST_DIR: ${{ github.workspace }}/gstest + HOME : /home/graphscope/ + INTERACTIVE_WORKSPACE: /tmp/interactive_workspace + LD_LIBRARY_PATH: /usr/local/lib + run: | + cd ${GITHUB_WORKSPACE}/flex/tests/hqps/ + export ENGINE_TYPE=hiactor + # change the default_graph config in ${GS_TEST_DIR}/flex/ldbc-sf01-long-date/engine_config.yaml to graph_algo + sed -i 's/default_graph: movies/default_graph: graph_algo/g' ./engine_config_test.yaml + bash hqps_adhoc_test.sh ${INTERACTIVE_WORKSPACE} graph_algo \ + ${GITHUB_WORKSPACE}/flex/tests/hqps/engine_config_test.yaml + + - name: Run Gremlin test on modern graph + env: + GS_TEST_DIR: ${{ github.workspace }}/gstest + INTERACTIVE_WORKSPACE: /tmp/interactive_workspace + LD_LIBRARY_PATH: /usr/local/lib + run: | + cd ${GITHUB_WORKSPACE}/flex/tests/hqps/ + export ENGINE_TYPE=hiactor + sed -i 's/default_graph: graph_algo/default_graph: modern_graph/g' ./engine_config_test.yaml + bash hqps_adhoc_test.sh ${INTERACTIVE_WORKSPACE} modern_graph \ + ${GITHUB_WORKSPACE}/flex/tests/hqps/engine_config_test.yaml gremlin + + test-build-flex: runs-on: ubuntu-22.04 + strategy: + matrix: + os: [ubuntu-22.04] + platform: [x86_64] + steps: - name: Checkout code uses: actions/checkout@v3 + + - name: Install dependencies + run: | + cd ${GITHUB_WORKSPACE}/flex + bash ./scripts/install_dependencies.sh 4 + + - name: Setup tmate session + if: false + uses: mxschmitt/action-tmate@v2 + + - name: Build + run: | + cd ${GITHUB_WORKSPACE}/flex + git submodule update --init + mkdir build && cd build # only test default build + cmake .. -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_DOC=OFF && sudo make -j 4 - - name: Add envs to GITHUB_ENV + # test the different combination of cmake options: -DBUILD_HQPS=ON/OFF -DBUILD_TEST=ON/OFF, -DBUILD_ODPS_FRAGMENT_LOADER=ON/OFF + test-cmake-options: + runs-on: ubuntu-20.04 + container: + image: registry.cn-hongkong.aliyuncs.com/graphscope/hqps-server-base:v0.0.10 + strategy: + matrix: + BUILD_HQPS: [ON, OFF] + BUILD_TEST: [ON, OFF] + BUILD_ODPS_FRAGMENT_LOADER: [ON, OFF] + steps: + - uses: actions/checkout@v3 + + - name: Build run: | - short_sha=$(git rev-parse --short HEAD) - echo "SHORT_SHA=${short_sha}" >> $GITHUB_ENV + cd ${GITHUB_WORKSPACE}/flex + git submodule update --init + mkdir build && cd build + cmake .. -DBUILD_HQPS=${{ matrix.BUILD_HQPS }} -DBUILD_TEST=${{ matrix.BUILD_TEST }} \ + -DBUILD_ODPS_FRAGMENT_LOADER=${{ matrix.BUILD_ODPS_FRAGMENT_LOADER }} + sudo make -j4 + + test-AOCC-compilation: + runs-on: ubuntu-20.04 + container: + image: registry.cn-hongkong.aliyuncs.com/graphscope/hqps-server-base:v0.0.10 + steps: + - uses: actions/checkout@v3 + + - name: Download aocc compiler + run: | + cd ${GITHUB_WORKSPACE}/flex + wget https://download.amd.com/developer/eula/aocc/aocc-4-1/aocc-compiler-4.1.0_1_amd64.deb + sudo apt-get update && sudo apt-get install libncurses-dev libncurses5-dev + sudo dpkg -i aocc-compiler-4.1.0_1_amd64.deb + + - name: Test AOCC compiler + env: + CC: clang + CXX: clang++ + OMPI_CC: clang + OMPI_CXX: clang++ + run: | + . /opt/AMD/aocc-compiler-4.1.0/setenv_AOCC.sh + cd ${GITHUB_WORKSPACE}/flex + git submodule update --init + mkdir build && cd build + cmake .. -DBUILD_DOC=OFF -DCMAKE_BUILD_TYPE=DEBUG + sudo make -j4 + + test-flex: + runs-on: ubuntu-20.04 + if: ${{ github.repository == 'alibaba/GraphScope' }} + container: + image: registry.cn-hongkong.aliyuncs.com/graphscope/hqps-server-base:v0.0.10 + steps: + - uses: actions/checkout@v3 - - name: Build Image + - name: Install latest libgrape-lite + if: false run: | - cd ${GITHUB_WORKSPACE} - python3 -m pip install --upgrade pip && python3 -m pip install -r python/requirements.txt - python3 ./gsctl.py flexbuild interactive --app docker + git clone --single-branch https://github.com/alibaba/libgrape-lite.git /tmp/libgrape-lite + cd /tmp/libgrape-lite + mkdir -p build && cd build + cmake .. + make -j$(nproc) + make install - - name: Build gsctl Wheel Package + - name: Build + env: + HOME: /home/graphscope/ run: | - cd ${GITHUB_WORKSPACE}/python - python3 setup_gsctl.py bdist_wheel + cd ${GITHUB_WORKSPACE}/flex + git submodule update --init + mkdir build && cd build + cmake .. && sudo make -j$(nproc) - - name: Test + - name: Test GRIN on mutable csr run: | - # install gsctl - python3 -m pip install ${GITHUB_WORKSPACE}/python/dist/*.whl - # launch service: 8080 for coordinator http port; 7687 for cypher port; - docker run -p 8080:8080 -p 7688:7687 registry.cn-hongkong.aliyuncs.com/graphscope/interactive:${SHORT_SHA}-x86_64 --enable-coordinator & - # test - python3 -m pip install --no-cache-dir pytest pytest-xdist - python3 -m pytest -d --tx popen//python=python3 \ - -s -v \ - $(dirname $(python3 -c "import graphscope.gsctl as gsctl; print(gsctl.__file__)"))/tests/test_interactive.py + git submodule update --init + cd flex/engines/graph_db/grin + mkdir build && cd build + cmake .. && sudo make -j$(nproc) + export FLEX_DATA_DIR=../../../../interactive/examples/modern_graph/ + ${GITHUB_WORKSPACE}/flex/build/bin/bulk_loader -g ../../../../interactive/examples/modern_graph/graph.yaml -l ../../../../interactive/examples/modern_graph/bulk_load.yaml -d ./data/ + rm -r ./data/wal + rm -r ./data/runtime/* + ./run_grin_test 'flex://schema_file=../../../../interactive/examples/modern_graph/graph.yaml&data_dir=./data/' + + - name: Prepare test dataset + env: + GS_TEST_DIR: ${{ github.workspace }}/gstest/ + run: | + git clone -b master --single-branch --depth=1 https://github.com/GraphScope/gstest.git ${GS_TEST_DIR} + + - name: Test String edge property on modern graph + env: + FLEX_DATA_DIR: ${{ github.workspace }}/flex/interactive/examples/modern_graph/ + run: | + rm -rf /tmp/csr-data-dir/ + cd ${GITHUB_WORKSPACE}/flex/build/ + SCHEMA_FILE=../tests/rt_mutable_graph/modern_graph_string_edge.yaml + BULK_LOAD_FILE=../interactive/examples/modern_graph/bulk_load.yaml + GLOG_v=10 ./bin/bulk_loader -g ${SCHEMA_FILE} -l ${BULK_LOAD_FILE} -d /tmp/csr-data-dir/ + GLOG_v=10 ./tests/rt_mutable_graph/string_edge_property_test ${SCHEMA_FILE} /tmp/csr-data-dir/ + + - name: Test schema parsing and loading on modern graph + env: + FLEX_DATA_DIR: ${{ github.workspace }}/flex/interactive/examples/modern_graph/ + run: | + rm -rf /tmp/csr-data-dir/ + cd ${GITHUB_WORKSPACE}/flex/build/ + SCHEMA_FILE=../tests/rt_mutable_graph/modern_graph_unified_schema.yaml + BULK_LOAD_FILE=../interactive/examples/modern_graph/bulk_load.yaml + GLOG_v=10 ./bin/bulk_loader -g ${SCHEMA_FILE} -l ${BULK_LOAD_FILE} -d /tmp/csr-data-dir/ + + - name: Test build empty graph + run: | + rm -rf /tmp/csr-data-dir/ + cd ${GITHUB_WORKSPACE}/flex/build/ + GLOG_v=10 ./tests/rt_mutable_graph/test_empty_graph /tmp/csr-data-dir/ + - name: Test ACID + run: | + rm -rf /tmp/csr-data-dir/ + cd ${GITHUB_WORKSPACE}/flex/build/ + GLOG_v=10 ./tests/rt_mutable_graph/test_acid 8 /tmp/csr-data-dir/ + + - name: Test Graph Loading on modern graph + env: + FLEX_DATA_DIR: ${{ github.workspace }}/flex/interactive/examples/modern_graph/ + run: | + rm -rf /tmp/csr-data-dir/ + cd ${GITHUB_WORKSPACE}/flex/build/ + SCHEMA_FILE=../interactive/examples/modern_graph/graph.yaml + BULK_LOAD_FILE=../interactive/examples/modern_graph/bulk_load.yaml + GLOG_v=10 ./bin/bulk_loader -g ${SCHEMA_FILE} -l ${BULK_LOAD_FILE} -d /tmp/csr-data-dir/ + + - name: Test Graph Loading on type_test graph + env: + GS_TEST_DIR: ${{ github.workspace }}/gstest/ + FLEX_DATA_DIR: ${{ github.workspace }}/gstest/flex/type_test/ + run: | + # remove modern graph indices + rm -rf /tmp/csr-data-dir/ + + cd ${GITHUB_WORKSPACE}/flex/build/ + SCHEMA_FILE=${GS_TEST_DIR}/flex/type_test/graph.yaml + BULK_LOAD_FILE=${GS_TEST_DIR}/flex/type_test/import.yaml + GLOG_v=10 ./bin/bulk_loader -g ${SCHEMA_FILE} -l ${BULK_LOAD_FILE} -d /tmp/csr-data-dir/ -p 2 + + - name: Test Graph Loading on LDBC SNB sf0.1 + env: + GS_TEST_DIR: ${{ github.workspace }}/gstest/ + FLEX_DATA_DIR: ${{ github.workspace }}/gstest/flex/ldbc-sf01-long-date/ + run: | + # remove previous graph indices + rm -rf /tmp/csr-data-dir/ + + cd ${GITHUB_WORKSPACE}/flex/build/ + SCHEMA_FILE=${FLEX_DATA_DIR}/audit_graph_schema.yaml + BULK_LOAD_FILE=${FLEX_DATA_DIR}/audit_bulk_load.yaml + GLOG_v=10 ./bin/bulk_loader -g ${SCHEMA_FILE} -l ${BULK_LOAD_FILE} -d /tmp/csr-data-dir/ -p 2 From 0ad26c188c02ccddb619ed6355589f1a98fa8db1 Mon Sep 17 00:00:00 2001 From: Dongze Li Date: Wed, 5 Jun 2024 16:39:42 +0800 Subject: [PATCH 09/15] update --- .../{flex_interactive.yml => flex-interactive.yml} | 3 ++- python/graphscope/gsctl/gsctl.py | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) rename .github/workflows/{flex_interactive.yml => flex-interactive.yml} (94%) diff --git a/.github/workflows/flex_interactive.yml b/.github/workflows/flex-interactive.yml similarity index 94% rename from .github/workflows/flex_interactive.yml rename to .github/workflows/flex-interactive.yml index 856954341f5f..6c406f74e38a 100644 --- a/.github/workflows/flex_interactive.yml +++ b/.github/workflows/flex-interactive.yml @@ -36,8 +36,9 @@ jobs: - name: Build Image run: | + cd ${GITHUB_WORKSPACE}/python + python3 -m pip install --upgrade pip && python3 -m pip install -r requirements.txt && python3 setup.py build_proto cd ${GITHUB_WORKSPACE} - python3 -m pip install --upgrade pip && python3 -m pip install -r python/requirements.txt python3 ./gsctl.py flexbuild interactive --app docker - name: Build gsctl Wheel Package diff --git a/python/graphscope/gsctl/gsctl.py b/python/graphscope/gsctl/gsctl.py index 2ce2292ff2f9..dec78db1ff60 100644 --- a/python/graphscope/gsctl/gsctl.py +++ b/python/graphscope/gsctl/gsctl.py @@ -26,13 +26,11 @@ 0, os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..") ) -import graphscope +from graphscope.gsctl.commands import get_command_collection +from graphscope.gsctl.config import get_current_context def cli(): - from graphscope.gsctl.commands import get_command_collection - from graphscope.gsctl.config import get_current_context - context = get_current_context() # get the specified commands under the FLEX architecture commands = get_command_collection(context) From 4a3c15aa6629934322fba5c2a439266f2dffef54 Mon Sep 17 00:00:00 2001 From: Dongze Li Date: Wed, 5 Jun 2024 18:35:08 +0800 Subject: [PATCH 10/15] update --- flex/interactive/docker/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flex/interactive/docker/Makefile b/flex/interactive/docker/Makefile index 3d84ee082c8f..e3cd84d76c74 100644 --- a/flex/interactive/docker/Makefile +++ b/flex/interactive/docker/Makefile @@ -31,7 +31,7 @@ interactive-runtime: --target final_image \ --build-arg ARCH=$(ARCH) \ --build-arg ENABLE_COORDINATOR=${ENABLE_COORDINATOR} \ - -t registry.cn-hongkong.aliyuncs.com/graphscope/interactive:${SHORT_SHA}-${ARCH} --push . + -t registry.cn-hongkong.aliyuncs.com/graphscope/interactive:${SHORT_SHA}-${ARCH} . hqps-server-base: docker build \ -f $(WORKING_DIR)/Dockerfile \ From fada835cc75ae71801edb59bb309106231dae5f6 Mon Sep 17 00:00:00 2001 From: Dongze Li Date: Thu, 6 Jun 2024 10:43:45 +0800 Subject: [PATCH 11/15] update --- .github/workflows/flex-interactive.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/flex-interactive.yml b/.github/workflows/flex-interactive.yml index 6c406f74e38a..09a3e742e097 100644 --- a/.github/workflows/flex-interactive.yml +++ b/.github/workflows/flex-interactive.yml @@ -52,6 +52,7 @@ jobs: python3 -m pip install ${GITHUB_WORKSPACE}/python/dist/*.whl # launch service: 8080 for coordinator http port; 7687 for cypher port; docker run -p 8080:8080 -p 7688:7687 registry.cn-hongkong.aliyuncs.com/graphscope/interactive:${SHORT_SHA}-x86_64 --enable-coordinator & + sleep 20 # test python3 -m pip install --no-cache-dir pytest pytest-xdist python3 -m pytest -d --tx popen//python=python3 \ From 5f262cd1d4091dcde2744c6ef48e85cfabbd551d Mon Sep 17 00:00:00 2001 From: Dongze Li Date: Thu, 6 Jun 2024 11:44:50 +0800 Subject: [PATCH 12/15] debug --- .github/workflows/flex-interactive.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/flex-interactive.yml b/.github/workflows/flex-interactive.yml index 09a3e742e097..34e439a1f74d 100644 --- a/.github/workflows/flex-interactive.yml +++ b/.github/workflows/flex-interactive.yml @@ -46,6 +46,10 @@ jobs: cd ${GITHUB_WORKSPACE}/python python3 setup_gsctl.py bdist_wheel + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + if: true + - name: Test run: | # install gsctl From c514fcbaea74984027043af3b8d75956903fc895 Mon Sep 17 00:00:00 2001 From: Dongze Li Date: Thu, 6 Jun 2024 12:54:45 +0800 Subject: [PATCH 13/15] update --- .github/workflows/flex-interactive.yml | 2 +- python/setup_gsctl.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/flex-interactive.yml b/.github/workflows/flex-interactive.yml index 34e439a1f74d..d8663d240c4d 100644 --- a/.github/workflows/flex-interactive.yml +++ b/.github/workflows/flex-interactive.yml @@ -48,7 +48,7 @@ jobs: - name: Setup tmate session uses: mxschmitt/action-tmate@v3 - if: true + if: false - name: Test run: | diff --git a/python/setup_gsctl.py b/python/setup_gsctl.py index bce9a24bde13..58d2f145e7f5 100644 --- a/python/setup_gsctl.py +++ b/python/setup_gsctl.py @@ -55,14 +55,14 @@ def parse_version(root, **kwargs): "parse": parse_version, }, install_requires=REQUIRES, - packages=find_packages(include=["graphscope.gsctl"]), + packages=find_packages(include=["graphscope.gsctl", "graphscope.gsctl.*"]), include_package_data=True, license="Apache 2.0", long_description_content_type="text/markdown", long_description="""\ gsctl is a command-line utility for GraphScope. It provides a set of functionalities to make it easy to use GraphScope. These functionalities include building and testing binaries, managing sessions and resources, and more. """, # noqa: E501 - package_data={"graphscope": ["gsctl/scripts/*.sh", "gsctl/scripts/lib/*.sh"]}, + package_data={"graphscope.gsctl": ["scripts/*.sh", "scripts/lib/*.sh"]}, entry_points={ "console_scripts": [ "gsctl = graphscope.gsctl.gsctl:cli", From 8bacd204375d56b60623a2244d9ffe25e1c8b6ac Mon Sep 17 00:00:00 2001 From: Dongze Li Date: Thu, 6 Jun 2024 14:11:37 +0800 Subject: [PATCH 14/15] debug --- .github/workflows/flex-interactive.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flex-interactive.yml b/.github/workflows/flex-interactive.yml index d8663d240c4d..34e439a1f74d 100644 --- a/.github/workflows/flex-interactive.yml +++ b/.github/workflows/flex-interactive.yml @@ -48,7 +48,7 @@ jobs: - name: Setup tmate session uses: mxschmitt/action-tmate@v3 - if: false + if: true - name: Test run: | From c7b33d2979df83c3671590d3558ec869c622d838 Mon Sep 17 00:00:00 2001 From: Dongze Li Date: Thu, 6 Jun 2024 15:41:40 +0800 Subject: [PATCH 15/15] update --- .github/workflows/flex-interactive.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/flex-interactive.yml b/.github/workflows/flex-interactive.yml index 34e439a1f74d..d8663d240c4d 100644 --- a/.github/workflows/flex-interactive.yml +++ b/.github/workflows/flex-interactive.yml @@ -48,7 +48,7 @@ jobs: - name: Setup tmate session uses: mxschmitt/action-tmate@v3 - if: true + if: false - name: Test run: |