File: monitor_services.go

package info (click to toggle)
golang-github-linode-linodego 1.55.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,112 kB
  • sloc: makefile: 96; sh: 52; python: 24
file content (22 lines) | stat: -rw-r--r-- 782 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package linodego

import (
	"context"
)

// MonitorService represents a MonitorService object
type MonitorService struct {
	Label       string `json:"label"`
	ServiceType string `json:"service_type"`
}

// ListMonitorServices lists all the registered ACLP MonitorServices
func (c *Client) ListMonitorServices(ctx context.Context, opts *ListOptions) ([]MonitorService, error) {
	return getPaginatedResults[MonitorService](ctx, c, "monitor/services", opts)
}

// ListMonitorServiceByType lists monitor services by a given service_type
func (c *Client) ListMonitorServiceByType(ctx context.Context, serviceType string, opts *ListOptions) ([]MonitorService, error) {
	e := formatAPIPath("monitor/services/%s", serviceType)
	return getPaginatedResults[MonitorService](ctx, c, e, opts)
}