Overview

Namespaces

  • PHP
  • Saklient
    • Cloud
      • Enums
      • Errors
      • Models
      • Resources
    • Errors

Classes

  • Activity
  • Appliance
  • Archive
  • Bridge
  • Disk
  • DiskActivity
  • DiskConfig
  • DiskPlan
  • FtpInfo
  • Icon
  • Iface
  • IfaceActivity
  • Ipv4Net
  • Ipv4Range
  • Ipv6Net
  • IsoImage
  • LbServer
  • LbVirtualIp
  • License
  • LicenseInfo
  • LoadBalancer
  • Region
  • Router
  • RouterActivity
  • RouterPlan
  • Script
  • Server
  • ServerActivity
  • ServerInstance
  • ServerPlan
  • Swytch
  • VpcRouter
  • Overview
  • Namespace
  • Class
  • Tree
  1: <?php
  2: 
  3: namespace Saklient\Cloud\Resources;
  4: 
  5: require_once __DIR__ . "/../../../Saklient/Cloud/Client.php";
  6: use \Saklient\Cloud\Client;
  7: require_once __DIR__ . "/../../../Saklient/Cloud/Resources/Resource.php";
  8: use \Saklient\Cloud\Resources\Resource;
  9: require_once __DIR__ . "/../../../Saklient/Cloud/Resources/Swytch.php";
 10: use \Saklient\Cloud\Resources\Swytch;
 11: require_once __DIR__ . "/../../../Saklient/Cloud/Resources/Ipv4Range.php";
 12: use \Saklient\Cloud\Resources\Ipv4Range;
 13: require_once __DIR__ . "/../../../Saklient/Util.php";
 14: use \Saklient\Util;
 15: require_once __DIR__ . "/../../../Saklient/Errors/SaklientException.php";
 16: use \Saklient\Errors\SaklientException;
 17: 
 18: /**
 19:  * IPv4ネットワークの実体1つに対応し、属性の取得や操作を行うためのクラス。
 20:  * 
 21:  * @property-read \Saklient\Cloud\Resources\Ipv4Range $range 利用可能なIPアドレス範囲 
 22:  * @property-read string $id ID 
 23:  * @property-read string $address ネットワークアドレス 
 24:  * @property-read int $maskLen マスク長 
 25:  * @property-read string $defaultRoute デフォルトルート 
 26:  * @property-read string $nextHop ネクストホップ 
 27:  */
 28: class Ipv4Net extends Resource {
 29:     
 30:     /**
 31:      * ID
 32:      * 
 33:      * @access protected
 34:      * @ignore
 35:      * @var string
 36:      */
 37:     protected $m_id;
 38:     
 39:     /**
 40:      * ネットワークアドレス
 41:      * 
 42:      * @access protected
 43:      * @ignore
 44:      * @var string
 45:      */
 46:     protected $m_address;
 47:     
 48:     /**
 49:      * マスク長
 50:      * 
 51:      * @access protected
 52:      * @ignore
 53:      * @var int
 54:      */
 55:     protected $m_maskLen;
 56:     
 57:     /**
 58:      * デフォルトルート
 59:      * 
 60:      * @access protected
 61:      * @ignore
 62:      * @var string
 63:      */
 64:     protected $m_defaultRoute;
 65:     
 66:     /**
 67:      * ネクストホップ
 68:      * 
 69:      * @access protected
 70:      * @ignore
 71:      * @var string
 72:      */
 73:     protected $m_nextHop;
 74:     
 75:     /**
 76:      * @private
 77:      * @access protected
 78:      * @ignore
 79:      * @var Ipv4Range
 80:      */
 81:     protected $_range;
 82:     
 83:     /**
 84:      * @access public
 85:      * @ignore
 86:      * @return \Saklient\Cloud\Resources\Ipv4Range
 87:      */
 88:     public function get_range()
 89:     {
 90:         return $this->_range;
 91:     }
 92:     
 93:     
 94:     
 95:     /**
 96:      * @private
 97:      * @access protected
 98:      * @ignore
 99:      * @return string
100:      */
101:     protected function _apiPath()
102:     {
103:         return "/subnet";
104:     }
105:     
106:     /**
107:      * @private
108:      * @access protected
109:      * @ignore
110:      * @return string
111:      */
112:     protected function _rootKey()
113:     {
114:         return "Subnet";
115:     }
116:     
117:     /**
118:      * @private
119:      * @access protected
120:      * @ignore
121:      * @return string
122:      */
123:     protected function _rootKeyM()
124:     {
125:         return "Subnets";
126:     }
127:     
128:     /**
129:      * @private
130:      * @access public
131:      * @ignore
132:      * @return string
133:      */
134:     public function _className()
135:     {
136:         return "Ipv4Net";
137:     }
138:     
139:     /**
140:      * @private
141:      * @access public
142:      * @ignore
143:      * @return string
144:      */
145:     public function _id()
146:     {
147:         return $this->get_id();
148:     }
149:     
150:     /**
151:      * 最新のリソース情報を再取得します。
152:      * 
153:      * @access public
154:      * @return \Saklient\Cloud\Resources\Swytch this
155:      */
156:     public function reload()
157:     {
158:         return $this->_reload();
159:     }
160:     
161:     /**
162:      * @ignore
163:      * @access public
164:      * @param \Saklient\Cloud\Client $client
165:      * @param mixed $obj
166:      * @param boolean $wrapped=false
167:      */
168:     public function __construct(\Saklient\Cloud\Client $client, $obj, $wrapped=false)
169:     {
170:         parent::__construct($client);
171:         Util::validateArgCount(func_num_args(), 2);
172:         Util::validateType($client, "\\Saklient\\Cloud\\Client");
173:         Util::validateType($wrapped, "boolean");
174:         $this->apiDeserialize($obj, $wrapped);
175:     }
176:     
177:     /**
178:      * @private
179:      * @access protected
180:      * @ignore
181:      * @param mixed $r
182:      * @param mixed $root
183:      * @return void
184:      */
185:     protected function _onAfterApiDeserialize($r, $root)
186:     {
187:         Util::validateArgCount(func_num_args(), 2);
188:         $this->_range = null;
189:         $addresses = $r->{"IPAddresses"};
190:         if ($addresses != null) {
191:             $this->_range = new Ipv4Range($addresses);
192:         }
193:     }
194:     
195:     /**
196:      * @access private
197:      * @ignore
198:      * @var boolean
199:      */
200:     private $n_id = false;
201:     
202:     /**
203:      * (This method is generated in Translator_default#buildImpl)
204:      * 
205:      * @access private
206:      * @ignore
207:      * @return string
208:      */
209:     private function get_id()
210:     {
211:         return $this->m_id;
212:     }
213:     
214:     
215:     
216:     /**
217:      * @access private
218:      * @ignore
219:      * @var boolean
220:      */
221:     private $n_address = false;
222:     
223:     /**
224:      * (This method is generated in Translator_default#buildImpl)
225:      * 
226:      * @access private
227:      * @ignore
228:      * @return string
229:      */
230:     private function get_address()
231:     {
232:         return $this->m_address;
233:     }
234:     
235:     
236:     
237:     /**
238:      * @access private
239:      * @ignore
240:      * @var boolean
241:      */
242:     private $n_maskLen = false;
243:     
244:     /**
245:      * (This method is generated in Translator_default#buildImpl)
246:      * 
247:      * @access private
248:      * @ignore
249:      * @return int
250:      */
251:     private function get_maskLen()
252:     {
253:         return $this->m_maskLen;
254:     }
255:     
256:     
257:     
258:     /**
259:      * @access private
260:      * @ignore
261:      * @var boolean
262:      */
263:     private $n_defaultRoute = false;
264:     
265:     /**
266:      * (This method is generated in Translator_default#buildImpl)
267:      * 
268:      * @access private
269:      * @ignore
270:      * @return string
271:      */
272:     private function get_defaultRoute()
273:     {
274:         return $this->m_defaultRoute;
275:     }
276:     
277:     
278:     
279:     /**
280:      * @access private
281:      * @ignore
282:      * @var boolean
283:      */
284:     private $n_nextHop = false;
285:     
286:     /**
287:      * (This method is generated in Translator_default#buildImpl)
288:      * 
289:      * @access private
290:      * @ignore
291:      * @return string
292:      */
293:     private function get_nextHop()
294:     {
295:         return $this->m_nextHop;
296:     }
297:     
298:     
299:     
300:     /**
301:      * (This method is generated in Translator_default#buildImpl)
302:      * 
303:      * @access protected
304:      * @ignore
305:      * @param mixed $r
306:      */
307:     protected function apiDeserializeImpl($r)
308:     {
309:         Util::validateArgCount(func_num_args(), 1);
310:         $this->isNew = $r == null;
311:         if ($this->isNew) {
312:             $r = (object)[];
313:         }
314:         $this->isIncomplete = false;
315:         if (Util::existsPath($r, "ID")) {
316:             $this->m_id = Util::getByPath($r, "ID") == null ? null : "" . Util::getByPath($r, "ID");
317:         }
318:         else {
319:             $this->m_id = null;
320:             $this->isIncomplete = true;
321:         }
322:         $this->n_id = false;
323:         if (Util::existsPath($r, "NetworkAddress")) {
324:             $this->m_address = Util::getByPath($r, "NetworkAddress") == null ? null : "" . Util::getByPath($r, "NetworkAddress");
325:         }
326:         else {
327:             $this->m_address = null;
328:             $this->isIncomplete = true;
329:         }
330:         $this->n_address = false;
331:         if (Util::existsPath($r, "NetworkMaskLen")) {
332:             $this->m_maskLen = Util::getByPath($r, "NetworkMaskLen") == null ? null : intval("" . Util::getByPath($r, "NetworkMaskLen"));
333:         }
334:         else {
335:             $this->m_maskLen = null;
336:             $this->isIncomplete = true;
337:         }
338:         $this->n_maskLen = false;
339:         if (Util::existsPath($r, "DefaultRoute")) {
340:             $this->m_defaultRoute = Util::getByPath($r, "DefaultRoute") == null ? null : "" . Util::getByPath($r, "DefaultRoute");
341:         }
342:         else {
343:             $this->m_defaultRoute = null;
344:             $this->isIncomplete = true;
345:         }
346:         $this->n_defaultRoute = false;
347:         if (Util::existsPath($r, "NextHop")) {
348:             $this->m_nextHop = Util::getByPath($r, "NextHop") == null ? null : "" . Util::getByPath($r, "NextHop");
349:         }
350:         else {
351:             $this->m_nextHop = null;
352:             $this->isIncomplete = true;
353:         }
354:         $this->n_nextHop = false;
355:     }
356:     
357:     /**
358:      * @ignore
359:      * @access protected
360:      * @param boolean $withClean=false
361:      * @return mixed
362:      */
363:     protected function apiSerializeImpl($withClean=false)
364:     {
365:         Util::validateType($withClean, "boolean");
366:         $ret = (object)[];
367:         if ($withClean || $this->n_id) {
368:             Util::setByPath($ret, "ID", $this->m_id);
369:         }
370:         if ($withClean || $this->n_address) {
371:             Util::setByPath($ret, "NetworkAddress", $this->m_address);
372:         }
373:         if ($withClean || $this->n_maskLen) {
374:             Util::setByPath($ret, "NetworkMaskLen", $this->m_maskLen);
375:         }
376:         if ($withClean || $this->n_defaultRoute) {
377:             Util::setByPath($ret, "DefaultRoute", $this->m_defaultRoute);
378:         }
379:         if ($withClean || $this->n_nextHop) {
380:             Util::setByPath($ret, "NextHop", $this->m_nextHop);
381:         }
382:         return $ret;
383:     }
384:     
385:     /**
386:      * @ignore
387:      */
388:     public function __get($key) {
389:         switch ($key) {
390:             case "range": return $this->get_range();
391:             case "id": return $this->get_id();
392:             case "address": return $this->get_address();
393:             case "maskLen": return $this->get_maskLen();
394:             case "defaultRoute": return $this->get_defaultRoute();
395:             case "nextHop": return $this->get_nextHop();
396:             default: return parent::__get($key);
397:         }
398:     }
399: 
400: }
401: 
402: 
API documentation generated by ApiGen 2.8.0