예제 #1
0
 def send_loadcase_targets_request(self, entity_id, max_number=10):
     url = f"{self.__host}/rest/loadcase/{entity_id}/targetValue/list"
     terminal.show_post_request(url)
     response = self.__http_session.post(url,
                                         json={
                                             "filters": {},
                                             "sort": [],
                                             "pageable": {
                                                 "size": max_number,
                                                 "page": 1
                                             }
                                         })
     return response
예제 #2
0
 def send_clone_simulation_request(self,
                                   entity_id,
                                   add_to_clipboard=False,
                                   dmu_id=None):
     url = f"{self.__host}/rest/simulation/{entity_id}/clone"
     terminal.show_post_request(url)
     response = self.__http_session.post(url,
                                         json={
                                             "addToClipboard":
                                             add_to_clipboard,
                                             "dmuID": dmu_id
                                         })
     return response
예제 #3
0
 def send_upload_submodel_request(self,
                                  file,
                                  stype_tree_id,
                                  add_to_clipboard="off"):
     url = f"{self.__host}/rest/submodel"
     terminal.show_post_request(url)
     with open(file, mode="rb") as f:
         response = self.__http_session.post(url,
                                             data={
                                                 "pid":
                                                 stype_tree_id,
                                                 "addToClipboard":
                                                 add_to_clipboard
                                             },
                                             files={"file": f})
     return response
예제 #4
0
 def send_simulation_values_request(self, entity_id, max_number=10):
     url = f"{self.__host}/rest/simulation/{entity_id}/keyResult/list"
     terminal.show_post_request(url)
     response = self.__http_session.post(url,
                                         json={
                                             "filters": {
                                                 "list": [{
                                                     "name": "type",
                                                     "value": "value"
                                                 }]
                                             },
                                             "sort": [],
                                             "pageable": {
                                                 "size": max_number,
                                                 "page": 1
                                             }
                                         })
     return response
예제 #5
0
 def send_simulation_tasks_request(self, entity_id, max_number=10):
     url = f"{self.__host}/rest/simulation/{entity_id}/tasks/list"
     terminal.show_post_request(url)
     response = self.__http_session.post(url,
                                         json={
                                             "filters": {},
                                             "sort": [{
                                                 "direction":
                                                 "DESC",
                                                 "field":
                                                 "modificationDate"
                                             }],
                                             "pageable": {
                                                 "size": max_number,
                                                 "page": 1
                                             }
                                         })
     return response
예제 #6
0
 def send_stype_submodels_request(self, entity_path, max_number=1000):
     url = f"{self.__host}/rest/submodel/list"
     terminal.show_post_request(url)
     response = self.__http_session.post(url,
                                         json={
                                             "filters": {
                                                 "list": [{
                                                     "name":
                                                     "path",
                                                     "value":
                                                     entity_path
                                                 }]
                                             },
                                             "sort": [],
                                             "pageable": {
                                                 "size": max_number,
                                                 "page": 1
                                             }
                                         })
     return response
예제 #7
0
 def send_add_loadcase_target_request(self, entity_id, payload):
     url = f"{self.__host}/rest/loadcase/{entity_id}/targetValue"
     terminal.show_post_request(url)
     response = self.__http_session.post(url, json=payload)
     return response
예제 #8
0
 def send_run_request(self, parameters):
     url = f"{self.__host}/rest/task/"
     terminal.show_post_request(url)
     response = self.__http_session.post(url, json=parameters)
     return response
예제 #9
0
 def send_simulation_submodels_update_request(self, entity_id, sumbodels):
     url = f"{self.__host}/rest/simulation/{entity_id}/submodel"
     terminal.show_post_request(url)
     response = self.__http_session.post(url, json=[*sumbodels])
     return response