Skip to content

Commit ed066d7

Browse files
committed
updating func names
1 parent e2d401f commit ed066d7

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

linode_api4/groups/monitor_service.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class MonitorGroup(Group):
1515
This group contains all features beneath the `/monitor` group in the API v4.
1616
"""
1717

18-
def list_monitor_dashboards(self, *filters) -> list[MonitorDashboard]:
18+
def dashboards(self, *filters) -> list[MonitorDashboard]:
1919
"""
2020
Returns a list of dashboards.
2121
@@ -36,7 +36,7 @@ def list_monitor_dashboards(self, *filters) -> list[MonitorDashboard]:
3636

3737
return self.client._get_and_filter(MonitorDashboard, *filters)
3838

39-
def list_dashboards_by_service(
39+
def dashboards_by_service(
4040
self, service_type: str, *filters
4141
) -> list[MonitorDashboard]:
4242
"""
@@ -64,7 +64,7 @@ def list_dashboards_by_service(
6464
endpoint=f"/monitor/services/{service_type}/dashboards",
6565
)
6666

67-
def list_supported_services(self, *filters) -> list[MonitorService]:
67+
def services(self, *filters) -> list[MonitorService]:
6868
"""
6969
Returns a list of services supported by ACLP.
7070
@@ -84,7 +84,7 @@ def list_supported_services(self, *filters) -> list[MonitorService]:
8484

8585
return self.client._get_and_filter(MonitorService, *filters)
8686

87-
def list_service_by_type(
87+
def service_by_type(
8888
self, service_type: str, *filters
8989
) -> list[MonitorService]:
9090
"""
@@ -111,7 +111,7 @@ def list_service_by_type(
111111
endpoint=f"/monitor/services/{service_type}",
112112
)
113113

114-
def list_metric_definitions(
114+
def metric_definitions(
115115
self, service_type: str, *filters
116116
) -> list[MonitorMetricsDefinition]:
117117
"""

test/integration/models/monitor/test_monitor.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# List all dashboards
1919
def test_get_all_dashboards(test_linode_client):
2020
client = test_linode_client
21-
dashboards = client.monitor_service.list_monitor_dashboards()
21+
dashboards = client.monitor_service.dashboards()
2222
assert isinstance(dashboards[0], MonitorDashboard)
2323

2424
dashboard_get = dashboards[0]
@@ -30,7 +30,7 @@ def test_get_all_dashboards(test_linode_client):
3030
assert dashboard_by_id.id == 1
3131

3232
# #Fetch Dashboard by service_type
33-
dashboards_by_svc = client.monitor_service.list_dashboards_by_service(
33+
dashboards_by_svc = client.monitor_service.dashboards_by_service(
3434
service_type=get_service_type
3535
)
3636
assert isinstance(dashboards_by_svc[0], MonitorDashboard)
@@ -40,20 +40,20 @@ def test_get_all_dashboards(test_linode_client):
4040
# List supported services
4141
def test_get_supported_services(test_linode_client):
4242
client = test_linode_client
43-
supported_services = client.monitor_service.list_supported_services()
43+
supported_services = client.monitor_service.services()
4444
assert isinstance(supported_services[0], MonitorService)
4545

4646
get_supported_service = supported_services[0].service_type
4747

4848
# Get details for a particular service
49-
service_details = client.monitor_service.list_service_by_type(
49+
service_details = client.monitor_service.service_by_type(
5050
service_type=get_supported_service
5151
)
5252
assert isinstance(service_details[0], MonitorService)
5353
assert service_details[0].service_type == get_supported_service
5454

5555
# Get Metric definition details for that particular service
56-
metric_definitions = client.monitor_service.list_metric_definitions(
56+
metric_definitions = client.monitor_service.metric_definitions(
5757
service_type=get_supported_service
5858
)
5959
assert isinstance(metric_definitions[0], MonitorMetricsDefinition)

test/unit/objects/monitor_service_test.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def test_supported_services(self):
1313
"""
1414
Test the services supported by monitor
1515
"""
16-
service = self.client.monitor_service.list_supported_services()
16+
service = self.client.monitor_service.services()
1717
self.assertEqual(len(service), 1)
1818
self.assertEqual(service[0].label, "Databases")
1919
self.assertEqual(service[0].service_type, "dbaas")
@@ -43,7 +43,7 @@ def test_dashboard_by_ID(self):
4343
self.assertEqual(dashboard.widgets[0].y_label, "cpu_usage")
4444

4545
def test_dashboard_by_service_type(self):
46-
dashboards = self.client.monitor_service.list_dashboards_by_service(
46+
dashboards = self.client.monitor_service.dashboards_by_service(
4747
service_type="dbaas"
4848
)
4949
self.assertEqual(dashboards[0].type, "standard")
@@ -66,7 +66,7 @@ def test_dashboard_by_service_type(self):
6666
self.assertEqual(dashboards[0].widgets[0].y_label, "cpu_usage")
6767

6868
def test_get_all_dashboards(self):
69-
dashboards = self.client.monitor_service.list_monitor_dashboards()
69+
dashboards = self.client.monitor_service.dashboards()
7070
self.assertEqual(dashboards[0].type, "standard")
7171
self.assertEqual(
7272
dashboards[0].created, datetime.datetime(2024, 10, 10, 5, 1, 58)
@@ -87,15 +87,15 @@ def test_get_all_dashboards(self):
8787
self.assertEqual(dashboards[0].widgets[0].y_label, "cpu_usage")
8888

8989
def test_specific_service_details(self):
90-
data = self.client.monitor_service.list_service_by_type(
90+
data = self.client.monitor_service.service_by_type(
9191
service_type="dbaas"
9292
)
9393
self.assertEqual(data[0].label, "Databases")
9494
self.assertEqual(data[0].service_type, "dbaas")
9595

9696
def test_metric_definitions(self):
9797

98-
metrics = self.client.monitor_service.list_metric_definitions(
98+
metrics = self.client.monitor_service.metric_definitions(
9999
service_type="dbaas"
100100
)
101101
self.assertEqual(

0 commit comments

Comments
 (0)