Fixed up test_db_api

This commit is contained in:
2024-01-13 19:02:55 +01:00
parent e7ec0a593c
commit a51e94fef3
21 changed files with 309 additions and 377 deletions

View File

@@ -2,17 +2,18 @@
All URIs are relative to _http://localhost_
| Method | HTTP request | Description |
| ----------------------------------------------------------------- | --------------------------------- | --------------------- |
| [**attach_entity**](EntitiesApi.md#attach_entity) | **POST** /api/v1/attach | Attach Entity |
| [**create_entity**](EntitiesApi.md#create_entity) | **POST** /api/v1/entity | Create Entity |
| [**delete_entity**](EntitiesApi.md#delete_entity) | **DELETE** /api/v1/entity | Delete Entity |
| [**detach_entity**](EntitiesApi.md#detach_entity) | **POST** /api/v1/detach | Detach Entity |
| [**get_all_entities**](EntitiesApi.md#get_all_entities) | **GET** /api/v1/entities | Get All Entities |
| [**get_attached_entities**](EntitiesApi.md#get_attached_entities) | **GET** /api/v1/attached_entities | Get Attached Entities |
| [**get_entity_by_did**](EntitiesApi.md#get_entity_by_did) | **GET** /api/v1/entity | Get Entity By Did |
| [**get_entity_by_name**](EntitiesApi.md#get_entity_by_name) | **GET** /api/v1/entity_by_name | Get Entity By Name |
| [**is_attached**](EntitiesApi.md#is_attached) | **GET** /api/v1/is_attached | Is Attached |
| Method | HTTP request | Description |
| ------------------------------------------------------------------------- | ------------------------------------- | ------------------------- |
| [**attach_entity**](EntitiesApi.md#attach_entity) | **PUT** /api/v1/attach | Attach Entity |
| [**create_entity**](EntitiesApi.md#create_entity) | **POST** /api/v1/entity | Create Entity |
| [**delete_entity**](EntitiesApi.md#delete_entity) | **DELETE** /api/v1/entity | Delete Entity |
| [**detach_entity**](EntitiesApi.md#detach_entity) | **PUT** /api/v1/detach | Detach Entity |
| [**get_all_entities**](EntitiesApi.md#get_all_entities) | **GET** /api/v1/entities | Get All Entities |
| [**get_attached_entities**](EntitiesApi.md#get_attached_entities) | **GET** /api/v1/attached_entities | Get Attached Entities |
| [**get_entity_by_did**](EntitiesApi.md#get_entity_by_did) | **GET** /api/v1/entity | Get Entity By Did |
| [**get_entity_by_name_or_did**](EntitiesApi.md#get_entity_by_name_or_did) | **GET** /api/v1/entity_by_name_or_did | Get Entity By Name Or Did |
| [**get_entity_by_roles**](EntitiesApi.md#get_entity_by_roles) | **GET** /api/v1/entity_by_roles | Get Entity By Roles |
| [**is_attached**](EntitiesApi.md#is_attached) | **GET** /api/v1/is_attached | Is Attached |
# **attach_entity**
@@ -486,11 +487,11 @@ No authorization required
[[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_entity_by_name**
# **get_entity_by_name_or_did**
> Entity get_entity_by_name(entity_name)
> Entity get_entity_by_name_or_did(entity_name_or_did=entity_name_or_did)
Get Entity By Name
Get Entity By Name Or Did
### Example
@@ -513,22 +514,22 @@ configuration = openapi_client.Configuration(
with openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = openapi_client.EntitiesApi(api_client)
entity_name = 'entity_name_example' # str |
entity_name_or_did = 'C1' # str | (optional) (default to 'C1')
try:
# Get Entity By Name
api_response = api_instance.get_entity_by_name(entity_name)
print("The response of EntitiesApi->get_entity_by_name:\n")
# Get Entity By Name Or Did
api_response = api_instance.get_entity_by_name_or_did(entity_name_or_did=entity_name_or_did)
print("The response of EntitiesApi->get_entity_by_name_or_did:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling EntitiesApi->get_entity_by_name: %s\n" % e)
print("Exception when calling EntitiesApi->get_entity_by_name_or_did: %s\n" % e)
```
### Parameters
| Name | Type | Description | Notes |
| --------------- | ------- | ----------- | ----- |
| **entity_name** | **str** | |
| Name | Type | Description | Notes |
| ---------------------- | ------- | ----------- | ------------------------------------ |
| **entity_name_or_did** | **str** | | [optional] [default to 'C1'] |
### Return type
@@ -552,6 +553,73 @@ No authorization required
[[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_entity_by_roles**
> List[Entity] get_entity_by_roles(roles)
Get Entity By Roles
### Example
```python
import time
import os
import openapi_client
from openapi_client.models.entity import Entity
from openapi_client.models.role import Role
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.EntitiesApi(api_client)
roles = [openapi_client.Role()] # List[Role] |
try:
# Get Entity By Roles
api_response = api_instance.get_entity_by_roles(roles)
print("The response of EntitiesApi->get_entity_by_roles:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling EntitiesApi->get_entity_by_roles: %s\n" % e)
```
### Parameters
| Name | Type | Description | Notes |
| --------- | ------------------------- | ----------- | ----- |
| **roles** | [**List[Role]**](Role.md) | |
### Return type
[**List[Entity]**](Entity.md)
### 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 | - |
| **422** | Validation Error | - |
[[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)
# **is_attached**
> Dict[str, str] is_attached(entity_did=entity_did)

View File

@@ -2,17 +2,17 @@
## Properties
| Name | Type | Description | Notes |
| -------------------- | --------------------- | ----------- | ----- |
| **did** | **str** | |
| **name** | **str** | |
| **ip** | **str** | |
| **network** | **str** | |
| **role** | [**Roles**](Roles.md) | |
| **visible** | **bool** | |
| **other** | **object** | |
| **attached** | **bool** | |
| **stop_health_task** | **bool** | |
| Name | Type | Description | Notes |
| -------------------- | ------------------------- | ----------- | ----- |
| **did** | **str** | |
| **name** | **str** | |
| **ip** | **str** | |
| **network** | **str** | |
| **visible** | **bool** | |
| **other** | **object** | |
| **attached** | **bool** | |
| **stop_health_task** | **bool** | |
| **roles** | [**List[Role]**](Role.md) | |
## Example

View File

@@ -2,15 +2,15 @@
## Properties
| Name | Type | Description | Notes |
| ----------- | --------------------- | ----------- | ----- |
| **did** | **str** | |
| **name** | **str** | |
| **ip** | **str** | |
| **network** | **str** | |
| **role** | [**Roles**](Roles.md) | |
| **visible** | **bool** | |
| **other** | **object** | |
| Name | Type | Description | Notes |
| ----------- | ------------------------- | ----------- | ----- |
| **did** | **str** | |
| **name** | **str** | |
| **ip** | **str** | |
| **network** | **str** | |
| **visible** | **bool** | |
| **other** | **object** | |
| **roles** | [**List[Role]**](Role.md) | |
## Example

View File

@@ -4,7 +4,6 @@
| Name | Type | Description | Notes |
| ------------- | ---------- | ----------- | ----- |
| **id** | **int** | |
| **timestamp** | **int** | |
| **group** | **int** | |
| **group_id** | **int** | |
@@ -12,6 +11,7 @@
| **src_did** | **str** | |
| **des_did** | **str** | |
| **msg** | **object** | |
| **id** | **int** | |
## Example

View File

@@ -4,7 +4,6 @@
| Name | Type | Description | Notes |
| ------------- | ---------- | ----------- | ----- |
| **id** | **int** | |
| **timestamp** | **int** | |
| **group** | **int** | |
| **group_id** | **int** | |

View File

@@ -4,7 +4,7 @@ All URIs are relative to _http://localhost_
| Method | HTTP request | Description |
| ---------------------------------------------------------------------- | ------------------------------ | --------------------- |
| [**create_eventmessage**](EventmessagesApi.md#create_eventmessage) | **POST** /api/v1/send_msg | Create Eventmessage |
| [**create_eventmessage**](EventmessagesApi.md#create_eventmessage) | **POST** /api/v1/event_message | Create Eventmessage |
| [**get_all_eventmessages**](EventmessagesApi.md#get_all_eventmessages) | **GET** /api/v1/event_messages | Get All Eventmessages |
# **create_eventmessage**

View File

@@ -1,75 +0,0 @@
# openapi_client.RepositoriesApi
All URIs are relative to _http://localhost_
| Method | HTTP request | Description |
| ------------------------------------------------------------------- | ---------------------------- | -------------------- |
| [**get_all_repositories**](RepositoriesApi.md#get_all_repositories) | **GET** /api/v1/repositories | Get All Repositories |
# **get_all_repositories**
> List[Service] get_all_repositories(skip=skip, limit=limit)
Get All Repositories
### Example
```python
import time
import os
import openapi_client
from openapi_client.models.service import Service
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.RepositoriesApi(api_client)
skip = 0 # int | (optional) (default to 0)
limit = 100 # int | (optional) (default to 100)
try:
# Get All Repositories
api_response = api_instance.get_all_repositories(skip=skip, limit=limit)
print("The response of RepositoriesApi->get_all_repositories:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling RepositoriesApi->get_all_repositories: %s\n" % e)
```
### Parameters
| Name | Type | Description | Notes |
| --------- | ------- | ----------- | --------------------------- |
| **skip** | **int** | | [optional] [default to 0] |
| **limit** | **int** | | [optional] [default to 100] |
### Return type
[**List[Service]**](Service.md)
### 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 | - |
| **422** | Validation Error | - |
[[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)