mirror of
https://github.com/openziti/zrok.git
synced 2025-08-18 19:58:28 +02:00
clean up; /agent/ping (#967)
This commit is contained in:
@@ -6,8 +6,6 @@ docs/AccountApi.md
|
||||
docs/AddOrganizationMemberRequest.md
|
||||
docs/AdminApi.md
|
||||
docs/AgentApi.md
|
||||
docs/AgentStatus200Response.md
|
||||
docs/AgentStatusRequest.md
|
||||
docs/AuthUser.md
|
||||
docs/ChangePasswordRequest.md
|
||||
docs/ClientVersionCheckRequest.md
|
||||
@@ -40,6 +38,8 @@ docs/MetadataApi.md
|
||||
docs/Metrics.md
|
||||
docs/MetricsSample.md
|
||||
docs/Overview.md
|
||||
docs/Ping200Response.md
|
||||
docs/PingRequest.md
|
||||
docs/Principal.md
|
||||
docs/RegenerateAccountToken200Response.md
|
||||
docs/RegenerateAccountTokenRequest.md
|
||||
@@ -68,8 +68,6 @@ test/test_account_api.py
|
||||
test/test_add_organization_member_request.py
|
||||
test/test_admin_api.py
|
||||
test/test_agent_api.py
|
||||
test/test_agent_status200_response.py
|
||||
test/test_agent_status_request.py
|
||||
test/test_auth_user.py
|
||||
test/test_change_password_request.py
|
||||
test/test_client_version_check_request.py
|
||||
@@ -102,6 +100,8 @@ test/test_metadata_api.py
|
||||
test/test_metrics.py
|
||||
test/test_metrics_sample.py
|
||||
test/test_overview.py
|
||||
test/test_ping200_response.py
|
||||
test/test_ping_request.py
|
||||
test/test_principal.py
|
||||
test/test_regenerate_account_token200_response.py
|
||||
test/test_regenerate_account_token_request.py
|
||||
@@ -137,8 +137,6 @@ zrok_api/models/__init__.py
|
||||
zrok_api/models/access201_response.py
|
||||
zrok_api/models/access_request.py
|
||||
zrok_api/models/add_organization_member_request.py
|
||||
zrok_api/models/agent_status200_response.py
|
||||
zrok_api/models/agent_status_request.py
|
||||
zrok_api/models/auth_user.py
|
||||
zrok_api/models/change_password_request.py
|
||||
zrok_api/models/client_version_check_request.py
|
||||
@@ -169,6 +167,8 @@ zrok_api/models/login_request.py
|
||||
zrok_api/models/metrics.py
|
||||
zrok_api/models/metrics_sample.py
|
||||
zrok_api/models/overview.py
|
||||
zrok_api/models/ping200_response.py
|
||||
zrok_api/models/ping_request.py
|
||||
zrok_api/models/principal.py
|
||||
zrok_api/models/regenerate_account_token200_response.py
|
||||
zrok_api/models/regenerate_account_token_request.py
|
||||
|
@@ -114,7 +114,7 @@ Class | Method | HTTP request | Description
|
||||
*AdminApi* | [**list_organizations**](docs/AdminApi.md#list_organizations) | **GET** /organizations |
|
||||
*AdminApi* | [**remove_organization_member**](docs/AdminApi.md#remove_organization_member) | **POST** /organization/remove |
|
||||
*AdminApi* | [**update_frontend**](docs/AdminApi.md#update_frontend) | **PATCH** /frontend |
|
||||
*AgentApi* | [**agent_status**](docs/AgentApi.md#agent_status) | **POST** /agent/status |
|
||||
*AgentApi* | [**ping**](docs/AgentApi.md#ping) | **POST** /agent/ping |
|
||||
*EnvironmentApi* | [**disable**](docs/EnvironmentApi.md#disable) | **POST** /disable |
|
||||
*EnvironmentApi* | [**enable**](docs/EnvironmentApi.md#enable) | **POST** /enable |
|
||||
*MetadataApi* | [**client_version_check**](docs/MetadataApi.md#client_version_check) | **POST** /clientVersionCheck |
|
||||
@@ -146,8 +146,6 @@ Class | Method | HTTP request | Description
|
||||
- [Access201Response](docs/Access201Response.md)
|
||||
- [AccessRequest](docs/AccessRequest.md)
|
||||
- [AddOrganizationMemberRequest](docs/AddOrganizationMemberRequest.md)
|
||||
- [AgentStatus200Response](docs/AgentStatus200Response.md)
|
||||
- [AgentStatusRequest](docs/AgentStatusRequest.md)
|
||||
- [AuthUser](docs/AuthUser.md)
|
||||
- [ChangePasswordRequest](docs/ChangePasswordRequest.md)
|
||||
- [ClientVersionCheckRequest](docs/ClientVersionCheckRequest.md)
|
||||
@@ -178,6 +176,8 @@ Class | Method | HTTP request | Description
|
||||
- [Metrics](docs/Metrics.md)
|
||||
- [MetricsSample](docs/MetricsSample.md)
|
||||
- [Overview](docs/Overview.md)
|
||||
- [Ping200Response](docs/Ping200Response.md)
|
||||
- [PingRequest](docs/PingRequest.md)
|
||||
- [Principal](docs/Principal.md)
|
||||
- [RegenerateAccountToken200Response](docs/RegenerateAccountToken200Response.md)
|
||||
- [RegenerateAccountTokenRequest](docs/RegenerateAccountTokenRequest.md)
|
||||
|
@@ -4,11 +4,11 @@ All URIs are relative to */api/v1*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**agent_status**](AgentApi.md#agent_status) | **POST** /agent/status |
|
||||
[**ping**](AgentApi.md#ping) | **POST** /agent/ping |
|
||||
|
||||
|
||||
# **agent_status**
|
||||
> AgentStatus200Response agent_status(body=body)
|
||||
# **ping**
|
||||
> Ping200Response ping(body=body)
|
||||
|
||||
### Example
|
||||
|
||||
@@ -16,8 +16,8 @@ Method | HTTP request | Description
|
||||
|
||||
```python
|
||||
import zrok_api
|
||||
from zrok_api.models.agent_status200_response import AgentStatus200Response
|
||||
from zrok_api.models.agent_status_request import AgentStatusRequest
|
||||
from zrok_api.models.ping200_response import Ping200Response
|
||||
from zrok_api.models.ping_request import PingRequest
|
||||
from zrok_api.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
@@ -42,14 +42,14 @@ configuration.api_key['key'] = os.environ["API_KEY"]
|
||||
with zrok_api.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = zrok_api.AgentApi(api_client)
|
||||
body = zrok_api.AgentStatusRequest() # AgentStatusRequest | (optional)
|
||||
body = zrok_api.PingRequest() # PingRequest | (optional)
|
||||
|
||||
try:
|
||||
api_response = api_instance.agent_status(body=body)
|
||||
print("The response of AgentApi->agent_status:\n")
|
||||
api_response = api_instance.ping(body=body)
|
||||
print("The response of AgentApi->ping:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling AgentApi->agent_status: %s\n" % e)
|
||||
print("Exception when calling AgentApi->ping: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
@@ -59,11 +59,11 @@ with zrok_api.ApiClient(configuration) as api_client:
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**AgentStatusRequest**](AgentStatusRequest.md)| | [optional]
|
||||
**body** | [**PingRequest**](PingRequest.md)| | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**AgentStatus200Response**](AgentStatus200Response.md)
|
||||
[**Ping200Response**](Ping200Response.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
@@ -81,6 +81,7 @@ Name | Type | Description | Notes
|
||||
**200** | ok | - |
|
||||
**401** | unauthorized | - |
|
||||
**500** | internal server error | - |
|
||||
**502** | bad gateway; agent not reachable | - |
|
||||
|
||||
[[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)
|
||||
|
||||
|
@@ -1,30 +0,0 @@
|
||||
# AgentStatus200Response
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**version** | **str** | | [optional]
|
||||
**shares** | [**List[Share]**](Share.md) | | [optional]
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from zrok_api.models.agent_status200_response import AgentStatus200Response
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of AgentStatus200Response from a JSON string
|
||||
agent_status200_response_instance = AgentStatus200Response.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(AgentStatus200Response.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
agent_status200_response_dict = agent_status200_response_instance.to_dict()
|
||||
# create an instance of AgentStatus200Response from a dict
|
||||
agent_status200_response_from_dict = AgentStatus200Response.from_dict(agent_status200_response_dict)
|
||||
```
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
29
sdk/python/src/docs/Ping200Response.md
Normal file
29
sdk/python/src/docs/Ping200Response.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# Ping200Response
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**version** | **str** | | [optional]
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from zrok_api.models.ping200_response import Ping200Response
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of Ping200Response from a JSON string
|
||||
ping200_response_instance = Ping200Response.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(Ping200Response.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
ping200_response_dict = ping200_response_instance.to_dict()
|
||||
# create an instance of Ping200Response from a dict
|
||||
ping200_response_from_dict = Ping200Response.from_dict(ping200_response_dict)
|
||||
```
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
# AgentStatusRequest
|
||||
# PingRequest
|
||||
|
||||
|
||||
## Properties
|
||||
@@ -10,19 +10,19 @@ Name | Type | Description | Notes
|
||||
## Example
|
||||
|
||||
```python
|
||||
from zrok_api.models.agent_status_request import AgentStatusRequest
|
||||
from zrok_api.models.ping_request import PingRequest
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of AgentStatusRequest from a JSON string
|
||||
agent_status_request_instance = AgentStatusRequest.from_json(json)
|
||||
# create an instance of PingRequest from a JSON string
|
||||
ping_request_instance = PingRequest.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print(AgentStatusRequest.to_json())
|
||||
print(PingRequest.to_json())
|
||||
|
||||
# convert the object into a dict
|
||||
agent_status_request_dict = agent_status_request_instance.to_dict()
|
||||
# create an instance of AgentStatusRequest from a dict
|
||||
agent_status_request_from_dict = AgentStatusRequest.from_dict(agent_status_request_dict)
|
||||
ping_request_dict = ping_request_instance.to_dict()
|
||||
# create an instance of PingRequest from a dict
|
||||
ping_request_from_dict = PingRequest.from_dict(ping_request_dict)
|
||||
```
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
@@ -26,8 +26,8 @@ class TestAgentApi(unittest.TestCase):
|
||||
def tearDown(self) -> None:
|
||||
pass
|
||||
|
||||
def test_agent_status(self) -> None:
|
||||
"""Test case for agent_status
|
||||
def test_ping(self) -> None:
|
||||
"""Test case for ping
|
||||
|
||||
"""
|
||||
pass
|
||||
|
@@ -1,70 +0,0 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
zrok
|
||||
|
||||
zrok client access
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
import unittest
|
||||
|
||||
from zrok_api.models.agent_status200_response import AgentStatus200Response
|
||||
|
||||
class TestAgentStatus200Response(unittest.TestCase):
|
||||
"""AgentStatus200Response unit test stubs"""
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
def make_instance(self, include_optional) -> AgentStatus200Response:
|
||||
"""Test AgentStatus200Response
|
||||
include_optional is a boolean, when False only required
|
||||
params are included, when True both required and
|
||||
optional params are included """
|
||||
# uncomment below to create an instance of `AgentStatus200Response`
|
||||
"""
|
||||
model = AgentStatus200Response()
|
||||
if include_optional:
|
||||
return AgentStatus200Response(
|
||||
version = '',
|
||||
shares = [
|
||||
zrok_api.models.share.share(
|
||||
share_token = '',
|
||||
z_id = '',
|
||||
share_mode = '',
|
||||
backend_mode = '',
|
||||
frontend_selection = '',
|
||||
frontend_endpoint = '',
|
||||
backend_proxy_endpoint = '',
|
||||
reserved = True,
|
||||
activity = [
|
||||
zrok_api.models.spark_data_sample.sparkDataSample(
|
||||
rx = 1.337,
|
||||
tx = 1.337, )
|
||||
],
|
||||
limited = True,
|
||||
created_at = 56,
|
||||
updated_at = 56, )
|
||||
]
|
||||
)
|
||||
else:
|
||||
return AgentStatus200Response(
|
||||
)
|
||||
"""
|
||||
|
||||
def testAgentStatus200Response(self):
|
||||
"""Test AgentStatus200Response"""
|
||||
# inst_req_only = self.make_instance(include_optional=False)
|
||||
# inst_req_and_optional = self.make_instance(include_optional=True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
51
sdk/python/src/test/test_ping200_response.py
Normal file
51
sdk/python/src/test/test_ping200_response.py
Normal file
@@ -0,0 +1,51 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
zrok
|
||||
|
||||
zrok client access
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
import unittest
|
||||
|
||||
from zrok_api.models.ping200_response import Ping200Response
|
||||
|
||||
class TestPing200Response(unittest.TestCase):
|
||||
"""Ping200Response unit test stubs"""
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
def make_instance(self, include_optional) -> Ping200Response:
|
||||
"""Test Ping200Response
|
||||
include_optional is a boolean, when False only required
|
||||
params are included, when True both required and
|
||||
optional params are included """
|
||||
# uncomment below to create an instance of `Ping200Response`
|
||||
"""
|
||||
model = Ping200Response()
|
||||
if include_optional:
|
||||
return Ping200Response(
|
||||
version = ''
|
||||
)
|
||||
else:
|
||||
return Ping200Response(
|
||||
)
|
||||
"""
|
||||
|
||||
def testPing200Response(self):
|
||||
"""Test Ping200Response"""
|
||||
# inst_req_only = self.make_instance(include_optional=False)
|
||||
# inst_req_and_optional = self.make_instance(include_optional=True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
@@ -14,10 +14,10 @@
|
||||
|
||||
import unittest
|
||||
|
||||
from zrok_api.models.agent_status_request import AgentStatusRequest
|
||||
from zrok_api.models.ping_request import PingRequest
|
||||
|
||||
class TestAgentStatusRequest(unittest.TestCase):
|
||||
"""AgentStatusRequest unit test stubs"""
|
||||
class TestPingRequest(unittest.TestCase):
|
||||
"""PingRequest unit test stubs"""
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
@@ -25,25 +25,25 @@ class TestAgentStatusRequest(unittest.TestCase):
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
def make_instance(self, include_optional) -> AgentStatusRequest:
|
||||
"""Test AgentStatusRequest
|
||||
def make_instance(self, include_optional) -> PingRequest:
|
||||
"""Test PingRequest
|
||||
include_optional is a boolean, when False only required
|
||||
params are included, when True both required and
|
||||
optional params are included """
|
||||
# uncomment below to create an instance of `AgentStatusRequest`
|
||||
# uncomment below to create an instance of `PingRequest`
|
||||
"""
|
||||
model = AgentStatusRequest()
|
||||
model = PingRequest()
|
||||
if include_optional:
|
||||
return AgentStatusRequest(
|
||||
return PingRequest(
|
||||
env_zid = ''
|
||||
)
|
||||
else:
|
||||
return AgentStatusRequest(
|
||||
return PingRequest(
|
||||
)
|
||||
"""
|
||||
|
||||
def testAgentStatusRequest(self):
|
||||
"""Test AgentStatusRequest"""
|
||||
def testPingRequest(self):
|
||||
"""Test PingRequest"""
|
||||
# inst_req_only = self.make_instance(include_optional=False)
|
||||
# inst_req_and_optional = self.make_instance(include_optional=True)
|
||||
|
@@ -39,8 +39,6 @@ from zrok_api.exceptions import ApiException
|
||||
from zrok_api.models.access201_response import Access201Response
|
||||
from zrok_api.models.access_request import AccessRequest
|
||||
from zrok_api.models.add_organization_member_request import AddOrganizationMemberRequest
|
||||
from zrok_api.models.agent_status200_response import AgentStatus200Response
|
||||
from zrok_api.models.agent_status_request import AgentStatusRequest
|
||||
from zrok_api.models.auth_user import AuthUser
|
||||
from zrok_api.models.change_password_request import ChangePasswordRequest
|
||||
from zrok_api.models.client_version_check_request import ClientVersionCheckRequest
|
||||
@@ -71,6 +69,8 @@ from zrok_api.models.login_request import LoginRequest
|
||||
from zrok_api.models.metrics import Metrics
|
||||
from zrok_api.models.metrics_sample import MetricsSample
|
||||
from zrok_api.models.overview import Overview
|
||||
from zrok_api.models.ping200_response import Ping200Response
|
||||
from zrok_api.models.ping_request import PingRequest
|
||||
from zrok_api.models.principal import Principal
|
||||
from zrok_api.models.regenerate_account_token200_response import RegenerateAccountToken200Response
|
||||
from zrok_api.models.regenerate_account_token_request import RegenerateAccountTokenRequest
|
||||
|
@@ -17,8 +17,8 @@ from typing import Any, Dict, List, Optional, Tuple, Union
|
||||
from typing_extensions import Annotated
|
||||
|
||||
from typing import Optional
|
||||
from zrok_api.models.agent_status200_response import AgentStatus200Response
|
||||
from zrok_api.models.agent_status_request import AgentStatusRequest
|
||||
from zrok_api.models.ping200_response import Ping200Response
|
||||
from zrok_api.models.ping_request import PingRequest
|
||||
|
||||
from zrok_api.api_client import ApiClient, RequestSerialized
|
||||
from zrok_api.api_response import ApiResponse
|
||||
@@ -39,9 +39,9 @@ class AgentApi:
|
||||
|
||||
|
||||
@validate_call
|
||||
def agent_status(
|
||||
def ping(
|
||||
self,
|
||||
body: Optional[AgentStatusRequest] = None,
|
||||
body: Optional[PingRequest] = None,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
@@ -54,12 +54,12 @@ class AgentApi:
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> AgentStatus200Response:
|
||||
"""agent_status
|
||||
) -> Ping200Response:
|
||||
"""ping
|
||||
|
||||
|
||||
:param body:
|
||||
:type body: AgentStatusRequest
|
||||
:type body: PingRequest
|
||||
: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
|
||||
@@ -82,7 +82,7 @@ class AgentApi:
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._agent_status_serialize(
|
||||
_param = self._ping_serialize(
|
||||
body=body,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
@@ -91,9 +91,10 @@ class AgentApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "AgentStatus200Response",
|
||||
'200': "Ping200Response",
|
||||
'401': None,
|
||||
'500': None,
|
||||
'502': None,
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -107,9 +108,9 @@ class AgentApi:
|
||||
|
||||
|
||||
@validate_call
|
||||
def agent_status_with_http_info(
|
||||
def ping_with_http_info(
|
||||
self,
|
||||
body: Optional[AgentStatusRequest] = None,
|
||||
body: Optional[PingRequest] = None,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
@@ -122,12 +123,12 @@ class AgentApi:
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> ApiResponse[AgentStatus200Response]:
|
||||
"""agent_status
|
||||
) -> ApiResponse[Ping200Response]:
|
||||
"""ping
|
||||
|
||||
|
||||
:param body:
|
||||
:type body: AgentStatusRequest
|
||||
:type body: PingRequest
|
||||
: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
|
||||
@@ -150,7 +151,7 @@ class AgentApi:
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._agent_status_serialize(
|
||||
_param = self._ping_serialize(
|
||||
body=body,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
@@ -159,9 +160,10 @@ class AgentApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "AgentStatus200Response",
|
||||
'200': "Ping200Response",
|
||||
'401': None,
|
||||
'500': None,
|
||||
'502': None,
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -175,9 +177,9 @@ class AgentApi:
|
||||
|
||||
|
||||
@validate_call
|
||||
def agent_status_without_preload_content(
|
||||
def ping_without_preload_content(
|
||||
self,
|
||||
body: Optional[AgentStatusRequest] = None,
|
||||
body: Optional[PingRequest] = None,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
@@ -191,11 +193,11 @@ class AgentApi:
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> RESTResponseType:
|
||||
"""agent_status
|
||||
"""ping
|
||||
|
||||
|
||||
:param body:
|
||||
:type body: AgentStatusRequest
|
||||
:type body: PingRequest
|
||||
: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
|
||||
@@ -218,7 +220,7 @@ class AgentApi:
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._agent_status_serialize(
|
||||
_param = self._ping_serialize(
|
||||
body=body,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
@@ -227,9 +229,10 @@ class AgentApi:
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "AgentStatus200Response",
|
||||
'200': "Ping200Response",
|
||||
'401': None,
|
||||
'500': None,
|
||||
'502': None,
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
@@ -238,7 +241,7 @@ class AgentApi:
|
||||
return response_data.response
|
||||
|
||||
|
||||
def _agent_status_serialize(
|
||||
def _ping_serialize(
|
||||
self,
|
||||
body,
|
||||
_request_auth,
|
||||
@@ -299,7 +302,7 @@ class AgentApi:
|
||||
|
||||
return self.api_client.param_serialize(
|
||||
method='POST',
|
||||
resource_path='/agent/status',
|
||||
resource_path='/agent/ping',
|
||||
path_params=_path_params,
|
||||
query_params=_query_params,
|
||||
header_params=_header_params,
|
||||
|
@@ -17,8 +17,6 @@
|
||||
from zrok_api.models.access201_response import Access201Response
|
||||
from zrok_api.models.access_request import AccessRequest
|
||||
from zrok_api.models.add_organization_member_request import AddOrganizationMemberRequest
|
||||
from zrok_api.models.agent_status200_response import AgentStatus200Response
|
||||
from zrok_api.models.agent_status_request import AgentStatusRequest
|
||||
from zrok_api.models.auth_user import AuthUser
|
||||
from zrok_api.models.change_password_request import ChangePasswordRequest
|
||||
from zrok_api.models.client_version_check_request import ClientVersionCheckRequest
|
||||
@@ -49,6 +47,8 @@ from zrok_api.models.login_request import LoginRequest
|
||||
from zrok_api.models.metrics import Metrics
|
||||
from zrok_api.models.metrics_sample import MetricsSample
|
||||
from zrok_api.models.overview import Overview
|
||||
from zrok_api.models.ping200_response import Ping200Response
|
||||
from zrok_api.models.ping_request import PingRequest
|
||||
from zrok_api.models.principal import Principal
|
||||
from zrok_api.models.regenerate_account_token200_response import RegenerateAccountToken200Response
|
||||
from zrok_api.models.regenerate_account_token_request import RegenerateAccountTokenRequest
|
||||
|
@@ -19,17 +19,15 @@ import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from zrok_api.models.share import Share
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class AgentStatus200Response(BaseModel):
|
||||
class Ping200Response(BaseModel):
|
||||
"""
|
||||
AgentStatus200Response
|
||||
Ping200Response
|
||||
""" # noqa: E501
|
||||
version: Optional[StrictStr] = None
|
||||
shares: Optional[List[Share]] = None
|
||||
__properties: ClassVar[List[str]] = ["version", "shares"]
|
||||
__properties: ClassVar[List[str]] = ["version"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
@@ -49,7 +47,7 @@ class AgentStatus200Response(BaseModel):
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of AgentStatus200Response from a JSON string"""
|
||||
"""Create an instance of Ping200Response from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
@@ -70,18 +68,11 @@ class AgentStatus200Response(BaseModel):
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in shares (list)
|
||||
_items = []
|
||||
if self.shares:
|
||||
for _item_shares in self.shares:
|
||||
if _item_shares:
|
||||
_items.append(_item_shares.to_dict())
|
||||
_dict['shares'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of AgentStatus200Response from a dict"""
|
||||
"""Create an instance of Ping200Response from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
@@ -89,8 +80,7 @@ class AgentStatus200Response(BaseModel):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"version": obj.get("version"),
|
||||
"shares": [Share.from_dict(_item) for _item in obj["shares"]] if obj.get("shares") is not None else None
|
||||
"version": obj.get("version")
|
||||
})
|
||||
return _obj
|
||||
|
@@ -22,9 +22,9 @@ from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class AgentStatusRequest(BaseModel):
|
||||
class PingRequest(BaseModel):
|
||||
"""
|
||||
AgentStatusRequest
|
||||
PingRequest
|
||||
""" # noqa: E501
|
||||
env_zid: Optional[StrictStr] = Field(default=None, alias="envZId")
|
||||
__properties: ClassVar[List[str]] = ["envZId"]
|
||||
@@ -47,7 +47,7 @@ class AgentStatusRequest(BaseModel):
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of AgentStatusRequest from a JSON string"""
|
||||
"""Create an instance of PingRequest from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
@@ -72,7 +72,7 @@ class AgentStatusRequest(BaseModel):
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of AgentStatusRequest from a dict"""
|
||||
"""Create an instance of PingRequest from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
Reference in New Issue
Block a user