Skip to content

Conversation

pmajali
Copy link
Contributor

@pmajali pmajali commented Aug 20, 2025

📝 Description

  1. Adding Monitor in the regions endpoint. This specifies the monitor services enabled in a particular region.
  2. Adding group_by and filters field to the dashboard widget

✔️ How to Test

  1. Testing the regions endpoint
import os
import logging
from linode_api4 import LinodeClient

client = LinodeClient(os.environ.get("MY_PERSONAL_ACCESS_TOKEN"))
client.base_url = "https://api.linode.com/v4beta"

regions=client.regions()
for reg in regions:
    print(f"Region: {reg.id}")
    print(f"  Monitors - Alerts: {reg.monitors.alerts}")
    print(f"  Monitors - Metrics: {reg.monitors.metrics}")
    print("---")
  1. Test group_by and filter in dashboard widget
dashboard = client.monitor.dashboards(service_type="linode")
for d in dashboard:
    print("ID:", d.id)
    print("Service Type:", d.service_type)
    for widget in d.widgets:
        print("Label:", widget.label)
        print("Metric:", widget.metric)
        print("Unit:", widget.unit)
        print("group_by:", widget.group_by)
        if widget.filters:
            for f in widget.filters:
                print("label:", f.dimension_label)
                print("operator:", f.operator)
                print("values:", f.value)

How do I run the relevant unit/integration tests?

unit-test: make test-unit TEST_SUITE=monitor
integration tests: make testint TEST_SUITE=monitor

@pmajali pmajali requested a review from a team as a code owner August 20, 2025 09:30
@pmajali pmajali requested review from yec-akamai and ezilber-akamai and removed request for a team August 20, 2025 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant