1: <?php
2:
3: namespace OpenCloud\CloudMonitoring\Resource;
4:
5: 6: 7: 8: 9:
10: class Check extends AbstractResource implements ResourceInterface
11: {
12: public $id;
13: public $type;
14: public $details;
15: public $disabled;
16: public $label;
17: public $metadata;
18: public $period;
19: public $timeout;
20: public $monitoring_zones_poll;
21: public $target_alias;
22: public $target_hostname;
23: public $target_resolver;
24:
25: protected static $json_name = false;
26: protected static $json_collection_name = 'values';
27: protected static $url_resource = 'checks';
28:
29: protected static $emptyObject = array(
30: 'type',
31: 'details',
32: 'disabled',
33: 'label',
34: 'metadata',
35: 'period',
36: 'timeout',
37: 'monitoring_zones_poll',
38: 'target_alias',
39: 'target_hostname',
40: 'target_resolver'
41: );
42:
43: protected static $requiredKeys = array(
44: 'type'
45: );
46:
47: protected $associatedResources = array(
48: 'CheckType' => 'CheckType'
49: );
50:
51: public function baseUrl($subresource = '')
52: {
53: return $this->getParent()->Url() . '/' . $this->getParent()->id . '/'. $this->resourceName();
54: }
55:
56: public function createUrl()
57: {
58: return $this->url();
59: }
60:
61: public function testUrl($debug = false)
62: {
63: $url = $this->getParent()->Url() . '/' . $this->getParent()->id . '/test-check';
64: return ($debug !== true) ? $url : $url . '?debug=true';
65: }
66:
67: }