Fixed eventmessage formatting problem #62

Merged
Luis merged 4 commits from Qubasa-main into main 2024-01-24 15:52:16 +00:00
7 changed files with 21 additions and 203 deletions
Showing only changes of commit 03f6318651 - Show all commits

View File

@@ -32,7 +32,7 @@ And then run the docker file by executing:
```bash ```bash
docker run -p 127.0.0.1:2979:2979 clan-docker:latest docker run -p 127.0.0.1:2979:2979 clan-docker:latest
``` ```
# Uploading a Docker Image
Login to the tu docker image server Login to the tu docker image server
```bash ```bash

View File

@@ -9,18 +9,8 @@ cors_ports = ["*", 3000, 2979]
# host for the server, frontend, backend and emulators # host for the server, frontend, backend and emulators
host = "127.0.0.1" host = "127.0.0.1"
# used for emmulation and population for testing
port_dlg = 7000
port_ap = 7500
_port_client_base = 8000
c1_port = _port_client_base + 1
c2_port = _port_client_base + 2
dlg_url = f"http://{host}:{port_dlg}/docs"
ap_url = f"http://{host}:{port_ap}/docs"
c1_url = f"http://{host}:{c1_port}/docs"
c2_url = f"http://{host}:{c2_port}/docs"
# Used for eventmessage number to name mapping
group_type_to_label = { group_type_to_label = {
1: { 1: {
"name": "Attachement", "name": "Attachement",
@@ -80,3 +70,15 @@ group_type_to_label = {
4: "Response Received", 4: "Response Received",
}, },
} }
# Used for emulation and population for testing
port_dlg = 7000
port_ap = 7500
_port_client_base = 8000
c1_port = _port_client_base + 1
c2_port = _port_client_base + 2
dlg_url = f"http://{host}:{port_dlg}/docs"
ap_url = f"http://{host}:{port_ap}/docs"
c1_url = f"http://{host}:{c1_port}/docs"
c2_url = f"http://{host}:{c2_port}/docs"

View File

@@ -185,8 +185,8 @@ class Eventmessage(EventmessageCreate):
id: int = Field(...) id: int = Field(...)
des_name: Optional[str] = Field(default=None, example="C2") des_name: Optional[str] = Field(default=None, example="C2")
src_name: Optional[str] = Field(default=None, example="C1") src_name: Optional[str] = Field(default=None, example="C1")
msg_type_name: str = Field(..., example="Request Send") msg_type_name: Optional[str] = Field(default=None, example="Request Send")
group_name: str = Field(..., example="Presentation") group_name: Optional[str] = Field(default=None, example="Presentation")
class Config: class Config:
orm_mode = True orm_mode = True

View File

@@ -42,134 +42,6 @@ class DefaultApi:
api_client = ApiClient.get_default() api_client = ApiClient.get_default()
self.api_client = api_client self.api_client = api_client
@validate_arguments
def get(self, **kwargs) -> None: # noqa: E501
"""Get # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get(async_req=True)
>>> result = thread.get()
:param async_req: Whether to execute the request asynchronously.
:type async_req: bool, optional
: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.
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
:rtype: None
"""
kwargs['_return_http_data_only'] = True
if '_preload_content' in kwargs:
message = "Error! Please call the get_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
raise ValueError(message)
return self.get_with_http_info(**kwargs) # noqa: E501
@validate_arguments
def get_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501
"""Get # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req: Whether to execute the request asynchronously.
:type async_req: bool, optional
:param _preload_content: if False, the ApiResponse.data will
be set to none and raw_data will store the
HTTP response body without reading/decoding.
Default is True.
:type _preload_content: bool, optional
:param _return_http_data_only: response data instead of ApiResponse
object with status code, headers, etc
:type _return_http_data_only: bool, optional
: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.
: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
:type _content_type: string, optional: force content-type for the request
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
:rtype: None
"""
_params = locals()
_all_params = [
]
_all_params.extend(
[
'async_req',
'_return_http_data_only',
'_preload_content',
'_request_timeout',
'_request_auth',
'_content_type',
'_headers'
]
)
# validate the arguments
for _key, _val in _params['kwargs'].items():
if _key not in _all_params:
raise ApiTypeError(
"Got an unexpected keyword argument '%s'"
" to method get" % _key
)
_params[_key] = _val
del _params['kwargs']
_collection_formats = {}
# process the path parameters
_path_params = {}
# process the query parameters
_query_params = []
# process the header parameters
_header_params = dict(_params.get('_headers', {}))
# process the form parameters
_form_params = []
_files = {}
# process the body parameter
_body_params = None
# set the HTTP header `Accept`
_header_params['Accept'] = self.api_client.select_header_accept(
['application/json']) # noqa: E501
# authentication setting
_auth_settings = [] # noqa: E501
_response_types_map = {}
return self.api_client.call_api(
'/ws2_example', 'GET',
_path_params,
_query_params,
_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
response_types_map=_response_types_map,
auth_settings=_auth_settings,
async_req=_params.get('async_req'),
_return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
_preload_content=_params.get('_preload_content', True),
_request_timeout=_params.get('_request_timeout'),
collection_formats=_collection_formats,
_request_auth=_params.get('_request_auth'))
@validate_arguments @validate_arguments
def get_emulated_enpoints(self, **kwargs) -> str: # noqa: E501 def get_emulated_enpoints(self, **kwargs) -> str: # noqa: E501
"""Get Emulated Enpoints # noqa: E501 """Get Emulated Enpoints # noqa: E501

View File

@@ -4,70 +4,11 @@ All URIs are relative to *http://localhost*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
[**get**](DefaultApi.md#get) | **GET** /ws2_example | Get
[**get_emulated_enpoints**](DefaultApi.md#get_emulated_enpoints) | **GET** /emulate | Get Emulated Enpoints [**get_emulated_enpoints**](DefaultApi.md#get_emulated_enpoints) | **GET** /emulate | Get Emulated Enpoints
[**health**](DefaultApi.md#health) | **GET** /health | Health [**health**](DefaultApi.md#health) | **GET** /health | Health
[**root**](DefaultApi.md#root) | **GET** /{path_name} | Root [**root**](DefaultApi.md#root) | **GET** /{path_name} | Root
# **get**
> get()
Get
### Example
```python
import time
import os
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration(
host = "http://localhost"
)
# Enter a context with an instance of the API client
with openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = openapi_client.DefaultApi(api_client)
try:
# Get
api_instance.get()
except Exception as e:
print("Exception when calling DefaultApi->get: %s\n" % e)
```
### Parameters
This endpoint does not need any parameter.
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful Response | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **get_emulated_enpoints** # **get_emulated_enpoints**
> str get_emulated_enpoints() > str get_emulated_enpoints()

View File

@@ -15,6 +15,7 @@ Name | Type | Description | Notes
**des_name** | **str** | | [optional] **des_name** | **str** | | [optional]
**src_name** | **str** | | [optional] **src_name** | **str** | | [optional]
**msg_type_name** | **str** | | [optional] **msg_type_name** | **str** | | [optional]
**group_name** | **str** | | [optional]
## Example ## Example

View File

@@ -36,7 +36,8 @@ class Eventmessage(BaseModel):
des_name: Optional[StrictStr] = None des_name: Optional[StrictStr] = None
src_name: Optional[StrictStr] = None src_name: Optional[StrictStr] = None
msg_type_name: Optional[StrictStr] = None msg_type_name: Optional[StrictStr] = None
__properties = ["timestamp", "group", "group_id", "msg_type", "src_did", "des_did", "msg", "id", "des_name", "src_name", "msg_type_name"] group_name: Optional[StrictStr] = None
__properties = ["timestamp", "group", "group_id", "msg_type", "src_did", "des_did", "msg", "id", "des_name", "src_name", "msg_type_name", "group_name"]
class Config: class Config:
"""Pydantic configuration""" """Pydantic configuration"""
@@ -84,7 +85,8 @@ class Eventmessage(BaseModel):
"id": obj.get("id"), "id": obj.get("id"),
"des_name": obj.get("des_name"), "des_name": obj.get("des_name"),
"src_name": obj.get("src_name"), "src_name": obj.get("src_name"),
"msg_type_name": obj.get("msg_type_name") "msg_type_name": obj.get("msg_type_name"),
"group_name": obj.get("group_name")
}) })
return _obj return _obj