1: <?php
2:
3: namespace Saklient\Cloud\Models;
4:
5: require_once __DIR__ . "/../../../Saklient/Cloud/Client.php";
6: use \Saklient\Cloud\Client;
7: require_once __DIR__ . "/../../../Saklient/Cloud/Models/Model.php";
8: use \Saklient\Cloud\Models\Model;
9: require_once __DIR__ . "/../../../Saklient/Cloud/Resources/Resource.php";
10: use \Saklient\Cloud\Resources\Resource;
11: require_once __DIR__ . "/../../../Saklient/Cloud/Resources/Appliance.php";
12: use \Saklient\Cloud\Resources\Appliance;
13: require_once __DIR__ . "/../../../Saklient/Cloud/Resources/LoadBalancer.php";
14: use \Saklient\Cloud\Resources\LoadBalancer;
15: require_once __DIR__ . "/../../../Saklient/Cloud/Resources/VpcRouter.php";
16: use \Saklient\Cloud\Resources\VpcRouter;
17: require_once __DIR__ . "/../../../Saklient/Cloud/Resources/Swytch.php";
18: use \Saklient\Cloud\Resources\Swytch;
19: require_once __DIR__ . "/../../../Saklient/Util.php";
20: use \Saklient\Util;
21: require_once __DIR__ . "/../../../Saklient/Errors/SaklientException.php";
22: use \Saklient\Errors\SaklientException;
23:
24:
25: class Model_Appliance extends Model {
26:
27: 28: 29: 30: 31: 32:
33: protected function _apiPath()
34: {
35: return "/appliance";
36: }
37:
38: 39: 40: 41: 42: 43:
44: protected function _rootKey()
45: {
46: return "Appliance";
47: }
48:
49: 50: 51: 52: 53: 54:
55: protected function _rootKeyM()
56: {
57: return "Appliances";
58: }
59:
60: 61: 62: 63: 64: 65:
66: protected function _className()
67: {
68: return "Appliance";
69: }
70:
71: 72: 73: 74: 75: 76: 77: 78:
79: protected function _createResourceImpl($obj, $wrapped=false)
80: {
81: Util::validateArgCount(func_num_args(), 1);
82: Util::validateType($wrapped, "boolean");
83: $ret = new Appliance($this->_client, $obj, $wrapped);
84: $clazz = $ret->clazz;
85: if ($clazz == "loadbalancer") {
86: return new LoadBalancer($this->_client, $obj, $wrapped);
87: }
88: if ($clazz == "vpcrouter") {
89: return new VpcRouter($this->_client, $obj, $wrapped);
90: }
91: return $ret;
92: }
93:
94: 95: 96: 97: 98: 99: 100:
101: public function offset($offset)
102: {
103: Util::validateArgCount(func_num_args(), 1);
104: Util::validateType($offset, "int");
105: return $this->_offset($offset);
106: }
107:
108: 109: 110: 111: 112: 113: 114:
115: public function limit($count)
116: {
117: Util::validateArgCount(func_num_args(), 1);
118: Util::validateType($count, "int");
119: return $this->_limit($count);
120: }
121:
122: 123: 124: 125: 126: 127: 128: 129: 130:
131: public function filterBy($key, $value, $multiple=false)
132: {
133: Util::validateArgCount(func_num_args(), 2);
134: Util::validateType($key, "string");
135: Util::validateType($multiple, "boolean");
136: return $this->_filterBy($key, $value, $multiple);
137: }
138:
139: 140: 141: 142: 143: 144:
145: public function reset()
146: {
147: return $this->_reset();
148: }
149:
150: 151: 152: 153: 154: 155: 156: 157:
158: public function createLoadBalancer(\Saklient\Cloud\Resources\Swytch $swytch, $vrid, $realIps, $isHighSpec=false)
159: {
160: Util::validateArgCount(func_num_args(), 3);
161: Util::validateType($swytch, "\\Saklient\\Cloud\\Resources\\Swytch");
162: Util::validateType($vrid, "int");
163: Util::validateType($realIps, "\\ArrayObject");
164: Util::validateType($isHighSpec, "boolean");
165: $ret = new LoadBalancer($this->_client, null);
166: return $ret->setInitialParams($swytch, $vrid, $realIps, $isHighSpec);
167: }
168:
169: 170: 171: 172:
173: public function createVpcRouter()
174: {
175: $ret = new VpcRouter($this->_client, null);
176: return $ret;
177: }
178:
179: 180: 181: 182: 183: 184: 185:
186: public function getById($id)
187: {
188: Util::validateArgCount(func_num_args(), 1);
189: Util::validateType($id, "string");
190: return $this->_getById($id);
191: }
192:
193: 194: 195: 196: 197: 198:
199: public function find()
200: {
201: return $this->_find();
202: }
203:
204: 205: 206: 207: 208: 209: 210: 211: 212: 213: 214:
215: public function withNameLike($name)
216: {
217: Util::validateArgCount(func_num_args(), 1);
218: Util::validateType($name, "string");
219: return $this->_withNameLike($name);
220: }
221:
222: 223: 224: 225: 226: 227: 228: 229: 230: 231:
232: public function withTag($tag)
233: {
234: Util::validateArgCount(func_num_args(), 1);
235: Util::validateType($tag, "string");
236: return $this->_withTag($tag);
237: }
238:
239: 240: 241: 242: 243: 244: 245: 246:
247: public function withTags($tags)
248: {
249: Util::validateArgCount(func_num_args(), 1);
250: Util::validateType($tags, "\\ArrayObject");
251: return $this->_withTags($tags);
252: }
253:
254: 255: 256: 257: 258: 259: 260: 261:
262: public function withTagDnf($dnf)
263: {
264: Util::validateArgCount(func_num_args(), 1);
265: Util::validateType($dnf, "\\ArrayObject");
266: return $this->_withTagDnf($dnf);
267: }
268:
269: 270: 271: 272: 273: 274: 275: 276:
277: public function sortByName($reverse=false)
278: {
279: Util::validateType($reverse, "boolean");
280: return $this->_sortByName($reverse);
281: }
282:
283: 284: 285: 286: 287:
288: public function __construct(\Saklient\Cloud\Client $client)
289: {
290: parent::__construct($client);
291: Util::validateArgCount(func_num_args(), 1);
292: Util::validateType($client, "\\Saklient\\Cloud\\Client");
293: }
294:
295:
296:
297: }
298:
299: