Skip to content

Commit 4b9cc61

Browse files
authored
feat: test monitor API information routes client (#57)
1 parent df9be9a commit 4b9cc61

File tree

8 files changed

+138
-0
lines changed

8 files changed

+138
-0
lines changed

docs/api_reference.rst

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ API Reference
99

1010
api_reference/core
1111
api_reference/tag
12+
api_reference/testmonitor
1213
api_reference/dataframe
1314
api_reference/spec
1415

docs/api_reference/testmonitor.rst

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.. _api_tag_page:
2+
3+
nisystemlink.clients.testmonitor
4+
======================
5+
6+
.. autoclass:: nisystemlink.clients.testmonitor.TestMonitorClient
7+
:exclude-members: __init__
8+
9+
.. automethod:: __init__
10+
11+
.. automodule:: nisystemlink.clients.testmonitor.models
12+
:members:
13+
:imported-members:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from ._test_monitor_client import TestMonitorClient
2+
3+
# flake8: noqa
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"""Implementation of TestMonitor Client"""
2+
3+
from typing import Optional
4+
5+
from nisystemlink.clients import core
6+
from nisystemlink.clients.core._uplink._base_client import BaseClient
7+
from nisystemlink.clients.core._uplink._methods import get
8+
9+
from . import models
10+
11+
12+
class TestMonitorClient(BaseClient):
13+
def __init__(self, configuration: Optional[core.HttpConfiguration]):
14+
if configuration is None:
15+
configuration = core.JupyterHttpConfiguration()
16+
super().__init__(configuration, base_path="/nitestmonitor/v2/")
17+
18+
@get("")
19+
def api_info(self) -> models.ApiInfo:
20+
"""Get information about the available API operations.
21+
22+
Returns:
23+
Information about available API operations.
24+
25+
Raises:
26+
ApiException: if unable to communicate with the `nitestmonitor` service.
27+
"""
28+
...
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from ._api_info import Operation, V2Operations, ApiInfo
2+
3+
# flake8: noqa
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
from nisystemlink.clients.core._api_info import Operation
2+
from nisystemlink.clients.core._uplink._json_model import JsonModel
3+
4+
5+
class V2Operations(JsonModel):
6+
"""The operations available in the routes provided by the v2 HTTP API."""
7+
8+
get_products: Operation
9+
"""The ability to get a list of products."""
10+
11+
query_products: Operation
12+
"""The ability to query products based on their properties."""
13+
14+
create_products: Operation
15+
"""The ability to create one or more products."""
16+
17+
update_products: Operation
18+
"""The ability to update the properties of one or more products."""
19+
20+
delete_products: Operation
21+
"""The ability to delete a single products."""
22+
23+
delete_many_products: Operation
24+
"""The ability to delete a list of products."""
25+
26+
get_results: Operation
27+
"""The ability to get a list of results."""
28+
29+
get_results_property_keys: Operation
30+
"""The ability to get custom property keys."""
31+
32+
query_results: Operation
33+
""""The ability to to query results based on their properties."""
34+
35+
create_results: Operation
36+
"""The ability to create results."""
37+
38+
update_results: Operation
39+
"""The ability to update results."""
40+
41+
delete_result: Operation
42+
"""The ability to delete a single results."""
43+
44+
delete_many_results: Operation
45+
"""The ability to delete multiple results."""
46+
47+
get_steps: Operation
48+
"""The ability to get a list of steps."""
49+
50+
query_steps: Operation
51+
"""The ability to query steps based on their properties."""
52+
53+
create_steps: Operation
54+
"""The ability to create steps."""
55+
56+
update_steps: Operation
57+
"""The ability to update steps."""
58+
59+
delete_step: Operation
60+
"""The ability to delete a single step."""
61+
62+
delete_many_steps: Operation
63+
"""The ability to delete multiple steps."""
64+
65+
query_paths: Operation
66+
"""The ability to query step paths."""
67+
68+
69+
class ApiInfo(JsonModel):
70+
"""Information about the available API operations."""
71+
72+
operations: V2Operations
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# flake8: noqa
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import pytest
2+
from nisystemlink.clients.core._http_configuration import HttpConfiguration
3+
from nisystemlink.clients.testmonitor import TestMonitorClient
4+
5+
6+
@pytest.fixture(scope="class")
7+
def client(enterprise_config: HttpConfiguration) -> TestMonitorClient:
8+
"""Fixture to create a TestMonitorClient instance."""
9+
return TestMonitorClient(enterprise_config)
10+
11+
12+
@pytest.mark.integration
13+
@pytest.mark.enterprise
14+
class TestTestMonitor:
15+
def test__api_info__returns(self, client: TestMonitorClient):
16+
response = client.api_info()
17+
assert len(response.dict()) != 0

0 commit comments

Comments
 (0)