github.com/newrelic/newrelic-client-go@v1.1.0/pkg/synthetics/monitor_locations.go (about) 1 package synthetics 2 3 import "context" 4 5 // Deprecated: MonitorLocation is now a considered an Entity and adheres to the SyntheticMonitorEntityOutline interface. 6 // MonitorLocation represents a valid location for a New Relic Synthetics monitor. 7 type MonitorLocation struct { 8 HighSecurityMode bool `json:"highSecurityMode"` 9 Private bool `json:"private"` 10 Name string `json:"name"` 11 Label string `json:"label"` 12 Description string `json:"description"` 13 } 14 15 // Deprecated: Use entities.GetEntitySearch instead. 16 // GetMonitorLocations is used to retrieve all valid locations for Synthetics monitors. 17 func (s *Synthetics) GetMonitorLocations() ([]*MonitorLocation, error) { 18 return s.GetMonitorLocationsWithContext(context.Background()) 19 } 20 21 // Deprecated: Use entities.GetEntitySearchWithContext instead. 22 // GetMonitorLocationsWithContext is used to retrieve all valid locations for Synthetics monitors. 23 func (s *Synthetics) GetMonitorLocationsWithContext(ctx context.Context) ([]*MonitorLocation, error) { 24 url := "/v1/locations" 25 26 resp := []*MonitorLocation{} 27 28 _, err := s.client.GetWithContext(ctx, s.config.Region().SyntheticsURL(url), nil, &resp) 29 if err != nil { 30 return resp, err 31 } 32 33 return resp, nil 34 }