1717 */
1818class Check extends AbstractResource
1919{
20+ /**
21+ * @var string
22+ */
2023 private $ id ;
21- private $ type ;
22- private $ details ;
23- private $ disabled ;
24- private $ label ;
25- protected $ metadata ;
26- private $ period ;
27- private $ timeout ;
28- private $ monitoring_zones_poll ;
29- private $ target_alias ;
30- private $ target_hostname ;
31- private $ target_resolver ;
24+
25+ /**
26+ * @var string|CheckType The type of check.
27+ */
28+ private $ type ;
29+
30+ /**
31+ * @var array Details specific to the check type.
32+ */
33+ private $ details ;
34+
35+ /**
36+ * @var bool Disables the check.
37+ */
38+ private $ disabled ;
39+
40+ /**
41+ * @var string A friendly label for a check.
42+ */
43+ private $ label ;
44+
45+ /**
46+ * @var int The period in seconds for a check. The value must be greater than the minimum period set on your account.
47+ */
48+ private $ period ;
49+
50+ /**
51+ * @var int The timeout in seconds for a check. This has to be less than the period.
52+ */
53+ private $ timeout ;
54+
55+ /**
56+ * For remote checks only. List of monitoring zones to poll from. Note: This argument is only required for remote
57+ * (non-agent) checks.
58+ *
59+ * @var array
60+ */
61+ private $ monitoring_zones_poll ;
62+
63+ /**
64+ * For remote checks only. A key in the entity's 'ip_addresses' hash used to resolve this check to an IP address.
65+ * This parameter is mutually exclusive with target_hostname.
66+ *
67+ * @var string
68+ */
69+ private $ target_alias ;
70+
71+ /**
72+ * For remote checks only. The hostname this check should target. This parameter is mutually exclusive with target_alias.
73+ *
74+ * @var string
75+ */
76+ private $ target_hostname ;
77+
78+ /**
79+ * For remote checks only. Determines how to resolve the check target.
80+ * @var string
81+ */
82+ private $ target_resolver ;
3283
3384 protected static $ json_name = false ;
3485 protected static $ json_collection_name = 'values ' ;
@@ -39,7 +90,6 @@ class Check extends AbstractResource
3990 'details ' ,
4091 'disabled ' ,
4192 'label ' ,
42- //'metadata',
4393 'period ' ,
4494 'timeout ' ,
4595 'monitoring_zones_poll ' ,
@@ -48,13 +98,9 @@ class Check extends AbstractResource
4898 'target_resolver '
4999 );
50100
51- protected static $ requiredKeys = array (
52- 'type '
53- );
101+ protected static $ requiredKeys = array ('type ' );
54102
55- protected $ associatedResources = array (
56- 'CheckType ' => 'CheckType '
57- );
103+ protected $ associatedResources = array ('CheckType ' => 'CheckType ' );
58104
59105 protected $ dataPointParams = array (
60106 'from ' ,
@@ -83,6 +129,14 @@ public function getMetrics()
83129 return $ this ->getService ()->resourceList ('Metric ' , null , $ this );
84130 }
85131
132+ /**
133+ * Fetch particular data points.
134+ *
135+ * @param string $metricName
136+ * @param array $options
137+ * @return mixed
138+ * @throws \OpenCloud\CloudMonitoring\Exception\MetricException
139+ */
86140 public function fetchDataPoints ($ metricName , array $ options = array ())
87141 {
88142 $ metric = $ this ->getService ()->resource ('Metric ' , null , $ this );
0 commit comments