1 /**
2 * Copyright 2016-2024 IBM Corp.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5 * the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6 *
7 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
8 * on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9 * See the License for the specific language governing permissions and limitations under the License.
10 */
11 12 // AUTOMATICALLY GENERATED CODE - DO NOT MODIFY
13 14 package services
15 16 import (
17 "fmt"
18 "strings"
19 20 "github.com/softlayer/softlayer-go/datatypes"
21 "github.com/softlayer/softlayer-go/session"
22 "github.com/softlayer/softlayer-go/sl"
23 )
24 25 // DEPRECATED. The SoftLayer_Monitoring_Robot data type contains general information relating to a monitoring robot.
26 // Deprecated: This function has been marked as deprecated.
27 type Monitoring_Robot struct {
28 Session session.SLSession
29 Options sl.Options
30 }
31 32 // GetMonitoringRobotService returns an instance of the Monitoring_Robot SoftLayer service
33 func GetMonitoringRobotService(sess session.SLSession) Monitoring_Robot {
34 return Monitoring_Robot{Session: sess}
35 }
36 37 func (r Monitoring_Robot) Id(id int) Monitoring_Robot {
38 r.Options.Id = &id
39 return r
40 }
41 42 func (r Monitoring_Robot) Mask(mask string) Monitoring_Robot {
43 if !strings.HasPrefix(mask, "mask[") && (strings.Contains(mask, "[") || strings.Contains(mask, ",")) {
44 mask = fmt.Sprintf("mask[%s]", mask)
45 }
46 47 r.Options.Mask = mask
48 return r
49 }
50 51 func (r Monitoring_Robot) Filter(filter string) Monitoring_Robot {
52 r.Options.Filter = filter
53 return r
54 }
55 56 func (r Monitoring_Robot) Limit(limit int) Monitoring_Robot {
57 r.Options.Limit = &limit
58 return r
59 }
60 61 func (r Monitoring_Robot) Offset(offset int) Monitoring_Robot {
62 r.Options.Offset = &offset
63 return r
64 }
65 66 // DEPRECATED. Checks if a monitoring robot can communicate with SoftLayer monitoring management system via the private network.
67 //
68 // TCP port 48000 - 48002 must be open on your server or your virtual server in order for this test to succeed.
69 // Deprecated: This function has been marked as deprecated.
70 func (r Monitoring_Robot) CheckConnection() (resp bool, err error) {
71 err = r.Session.DoRequest("SoftLayer_Monitoring_Robot", "checkConnection", nil, &r.Options, &resp)
72 return
73 }
74 75 // no documentation yet
76 func (r Monitoring_Robot) GetObject() (resp datatypes.Monitoring_Robot, err error) {
77 err = r.Session.DoRequest("SoftLayer_Monitoring_Robot", "getObject", nil, &r.Options, &resp)
78 return
79 }
80