PageRenderTime 48ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/public/plugin/ckfinder/core/connector/php/vendor/microsoft/windowsazure/WindowsAzure/ServiceManagement/Models/Deployment.php

https://gitlab.com/vietdhtn/myweb
PHP | 560 lines | 230 code | 49 blank | 281 comment | 0 complexity | 9d7c2fff45582213de29eb44dd4b9c36 MD5 | raw file
  1. <?php
  2. /**
  3. * LICENSE: Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. * http://www.apache.org/licenses/LICENSE-2.0
  7. *
  8. * Unless required by applicable law or agreed to in writing, software
  9. * distributed under the License is distributed on an "AS IS" BASIS,
  10. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. * See the License for the specific language governing permissions and
  12. * limitations under the License.
  13. *
  14. * PHP version 5
  15. *
  16. * @category Microsoft
  17. * @package WindowsAzure\ServiceManagement\Models
  18. * @author Azure PHP SDK <azurephpsdk@microsoft.com>
  19. * @copyright 2012 Microsoft Corporation
  20. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
  21. * @link https://github.com/windowsazure/azure-sdk-for-php
  22. */
  23. namespace WindowsAzure\ServiceManagement\Models;
  24. use WindowsAzure\Common\Internal\Resources;
  25. use WindowsAzure\Common\Internal\Utilities;
  26. /**
  27. * Represents a Windows Azure deployment.
  28. *
  29. * @category Microsoft
  30. * @package WindowsAzure\ServiceManagement\Models
  31. * @author Azure PHP SDK <azurephpsdk@microsoft.com>
  32. * @copyright 2012 Microsoft Corporation
  33. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
  34. * @version Release: 0.4.0_2014-01
  35. * @link https://github.com/windowsazure/azure-sdk-for-php
  36. */
  37. class Deployment
  38. {
  39. /**
  40. * @var string
  41. */
  42. private $_name;
  43. /**
  44. * @var string
  45. */
  46. private $_slot;
  47. /**
  48. * @var string
  49. */
  50. private $_privateId;
  51. /**
  52. * @var string
  53. */
  54. private $_status;
  55. /**
  56. * @var string
  57. */
  58. private $_label;
  59. /**
  60. * @var string
  61. */
  62. private $_configuration;
  63. /**
  64. * @var array
  65. */
  66. private $_roleInstanceList;
  67. /**
  68. * @var integer
  69. */
  70. private $_upgradeDomainCount;
  71. /**
  72. * @var array
  73. */
  74. private $_roleList;
  75. /**
  76. * @var string
  77. */
  78. private $_sdkVersion;
  79. /**
  80. * @var array
  81. */
  82. private $_inputEndpointList;
  83. /**
  84. * @var boolean
  85. */
  86. private $_locked;
  87. /**
  88. * @var boolean
  89. */
  90. private $_rollbackAllowed;
  91. /**
  92. * @var UpgradeStatus
  93. */
  94. private $_upgradeStatus;
  95. /**
  96. * Creates a new Deployment from parsed response body.
  97. *
  98. * @param array $parsed The parsed response body in array representation.
  99. *
  100. * @return Deployment
  101. */
  102. public static function create($parsed)
  103. {
  104. $result = new Deployment();
  105. $name = Utilities::tryGetValue($parsed, Resources::XTAG_NAME);
  106. $label = Utilities::tryGetValue($parsed, Resources::XTAG_LABEL);
  107. $url = Utilities::tryGetValue($parsed, Resources::XTAG_URL);
  108. $locked = Utilities::tryGetValue(
  109. $parsed,
  110. Resources::XTAG_LOCKED
  111. );
  112. $rollbackAllowed = Utilities::tryGetValue(
  113. $parsed,
  114. Resources::XTAG_ROLLBACK_ALLOWED
  115. );
  116. $sdkVersion = Utilities::tryGetValue(
  117. $parsed,
  118. Resources::XTAG_SDK_VERSION
  119. );
  120. $inputEndpointList = Utilities::tryGetKeysChainValue(
  121. $parsed,
  122. Resources::XTAG_INPUT_ENDPOINT_LIST,
  123. Resources::XTAG_INPUT_ENDPOINT
  124. );
  125. $roleList = Utilities::tryGetKeysChainValue(
  126. $parsed,
  127. Resources::XTAG_ROLE_LIST,
  128. Resources::XTAG_ROLE
  129. );
  130. $roleInstanceList = Utilities::tryGetKeysChainValue(
  131. $parsed,
  132. Resources::XTAG_ROLE_INSTANCE_LIST,
  133. Resources::XTAG_ROLE_INSTANCE
  134. );
  135. $status = Utilities::tryGetValue(
  136. $parsed,
  137. Resources::XTAG_STATUS
  138. );
  139. $slot = Utilities::tryGetValue(
  140. $parsed,
  141. Resources::XTAG_DEPLOYMENT_SLOT
  142. );
  143. $privateId = Utilities::tryGetValue(
  144. $parsed,
  145. Resources::XTAG_PRIVATE_ID
  146. );
  147. $configuration = Utilities::tryGetValue(
  148. $parsed,
  149. Resources::XTAG_CONFIGURATION
  150. );
  151. $upgradeDomainCount = Utilities::tryGetValue(
  152. $parsed,
  153. Resources::XTAG_UPGRADE_DOMAIN_COUNT
  154. );
  155. $upgradeStatus = Utilities::tryGetValue(
  156. $parsed,
  157. Resources::XTAG_UPGRADE_STATUS
  158. );
  159. $result->setConfiguration($configuration);
  160. $result->setLabel($label);
  161. $result->setLocked(Utilities::toBoolean($locked));
  162. $result->setName($name);
  163. $result->setPrivateId($privateId);
  164. $result->setRollbackAllowed(Utilities::toBoolean($rollbackAllowed));
  165. $result->setSdkVersion($sdkVersion);
  166. $result->setSlot($slot);
  167. $result->setStatus($status);
  168. $result->setUpgradeDomainCount(intval($upgradeDomainCount));
  169. $result->setUpgradeStatus(UpgradeStatus::create($upgradeStatus));
  170. $result->setUrl($url);
  171. $result->setRoleInstanceList(
  172. Utilities::createInstanceList(
  173. Utilities::getArray($roleInstanceList),
  174. 'WindowsAzure\ServiceManagement\Models\RoleInstance'
  175. )
  176. );
  177. $result->setRoleList(
  178. Utilities::createInstanceList(
  179. Utilities::getArray($roleList),
  180. 'WindowsAzure\ServiceManagement\Models\Role'
  181. )
  182. );
  183. $result->setInputEndpointList(
  184. Utilities::createInstanceList(
  185. Utilities::getArray($inputEndpointList),
  186. 'WindowsAzure\ServiceManagement\Models\InputEndpoint'
  187. )
  188. );
  189. return $result;
  190. }
  191. /**
  192. * Gets the deployment name.
  193. *
  194. * The user-supplied name for this deployment.
  195. *
  196. * @return string
  197. */
  198. public function getName()
  199. {
  200. return $this->_name;
  201. }
  202. /**
  203. * Sets the deployment name.
  204. *
  205. * @param string $name The deployment name.
  206. *
  207. * @return none
  208. */
  209. public function setName($name)
  210. {
  211. $this->_name = $name;
  212. }
  213. /**
  214. * Gets the deployment slot.
  215. *
  216. * The environment to which the hosted service is deployed, either staging or
  217. * production.
  218. *
  219. * @return string
  220. */
  221. public function getSlot()
  222. {
  223. return $this->_slot;
  224. }
  225. /**
  226. * Sets the deployment slot.
  227. *
  228. * @param string $slot The deployment slot.
  229. *
  230. * @return none
  231. */
  232. public function setSlot($slot)
  233. {
  234. $this->_slot = $slot;
  235. }
  236. /**
  237. * Gets the deployment label.
  238. *
  239. * The user-supplied name of the deployment returned as a base-64 encoded string.
  240. * This name can be used identify the deployment for your tracking purposes.
  241. *
  242. * @return string
  243. */
  244. public function getLabel()
  245. {
  246. return $this->_label;
  247. }
  248. /**
  249. * Sets the deployment label.
  250. *
  251. * @param string $label The deployment label.
  252. *
  253. * @return none
  254. */
  255. public function setLabel($label)
  256. {
  257. $this->_label = $label;
  258. }
  259. /**
  260. * Gets the deployment private Id.
  261. *
  262. * A unique identifier generated internally by Windows Azure for this deployment.
  263. *
  264. * @return string
  265. */
  266. public function getPrivateId()
  267. {
  268. return $this->_privateId;
  269. }
  270. /**
  271. * Sets the deployment private Id.
  272. *
  273. * @param string $privateId The deployment privateId.
  274. *
  275. * @return none
  276. */
  277. public function setPrivateId($privateId)
  278. {
  279. $this->_privateId = $privateId;
  280. }
  281. /**
  282. * Gets the deployment status.
  283. *
  284. * The status of the deployment. Possible values are: Running, Suspended,
  285. * RunningTransitioning, SuspendedTransitioning, Starting, Suspending, Deploying,
  286. * Deploying.
  287. *
  288. * @return string
  289. */
  290. public function getStatus()
  291. {
  292. return $this->_status;
  293. }
  294. /**
  295. * Sets the deployment status.
  296. *
  297. * @param string $status The deployment status.
  298. *
  299. * @return none
  300. */
  301. public function setStatus($status)
  302. {
  303. $this->_status = $status;
  304. }
  305. /**
  306. * Gets the deployment url.
  307. *
  308. * The URL used to access the hosted service.
  309. *
  310. * @return string
  311. */
  312. public function getUrl()
  313. {
  314. return $this->_url;
  315. }
  316. /**
  317. * Sets the deployment url.
  318. *
  319. * @param string $url The deployment url.
  320. *
  321. * @return none
  322. */
  323. public function setUrl($url)
  324. {
  325. $this->_url = $url;
  326. }
  327. /**
  328. * Gets the deployment configuration.
  329. *
  330. * The base-64 encoded configuration file of the deployment.
  331. *
  332. * @return string
  333. */
  334. public function getConfiguration()
  335. {
  336. return $this->_configuration;
  337. }
  338. /**
  339. * Sets the configuration.
  340. *
  341. * @param string $configuration The deployment configuration.
  342. *
  343. * @return none
  344. */
  345. public function setConfiguration($configuration)
  346. {
  347. $this->_configuration = $configuration;
  348. }
  349. /**
  350. * Gets the deployment role instance list.
  351. *
  352. * @return array
  353. */
  354. public function getRoleInstanceList()
  355. {
  356. return $this->_roleInstanceList;
  357. }
  358. /**
  359. * Sets the deployment role instance list.
  360. *
  361. * @param array $roleInstanceList The deployment role instance list.
  362. *
  363. * @return none
  364. */
  365. public function setRoleInstanceList($roleInstanceList)
  366. {
  367. $this->_roleInstanceList = $roleInstanceList;
  368. }
  369. /**
  370. * Gets the deployment upgrade domain count.
  371. *
  372. * @return integer
  373. */
  374. public function getUpgradeDomainCount()
  375. {
  376. return $this->_upgradeDomainCount;
  377. }
  378. /**
  379. * Sets the deployment upgradeDomainCount.
  380. *
  381. * @param integer $upgradeDomainCount The deployment upgrade domain count.
  382. *
  383. * @return none
  384. */
  385. public function setUpgradeDomainCount($upgradeDomainCount)
  386. {
  387. $this->_upgradeDomainCount = $upgradeDomainCount;
  388. }
  389. /**
  390. * Gets the deployment role list.
  391. *
  392. * Contains the provisioning details for the new virtual machine deployment.
  393. *
  394. * @return array
  395. */
  396. public function getRoleList()
  397. {
  398. return $this->_roleList;
  399. }
  400. /**
  401. * Sets the deployment role list.
  402. *
  403. * @param array $roleList The deployment role list.
  404. *
  405. * @return none
  406. */
  407. public function setRoleList($roleList)
  408. {
  409. $this->_roleList = $roleList;
  410. }
  411. /**
  412. * Gets the deployment SDK version.
  413. *
  414. * @return string
  415. */
  416. public function getSdkVersion()
  417. {
  418. return $this->_sdkVersion;
  419. }
  420. /**
  421. * Sets the deployment SDK version.
  422. *
  423. * @param string $sdkVersion The deployment SDK version.
  424. *
  425. * @return none
  426. */
  427. public function setSdkVersion($sdkVersion)
  428. {
  429. $this->_sdkVersion = $sdkVersion;
  430. }
  431. /**
  432. * Gets the deployment input endpoint list.
  433. *
  434. * @return array
  435. */
  436. public function getInputEndpointList()
  437. {
  438. return $this->_inputEndpointList;
  439. }
  440. /**
  441. * Sets the deployment input endpoint list.
  442. *
  443. * @param array $inputEndpointList The deployment input endpoint list.
  444. *
  445. * @return none
  446. */
  447. public function setInputEndpointList($inputEndpointList)
  448. {
  449. $this->_inputEndpointList = $inputEndpointList;
  450. }
  451. /**
  452. * Gets the deployment locked flag.
  453. *
  454. * @return boolean
  455. */
  456. public function getLocked()
  457. {
  458. return $this->_locked;
  459. }
  460. /**
  461. * Sets the deployment locked flag.
  462. *
  463. * @param boolean $locked The deployment locked flag.
  464. *
  465. * @return none
  466. */
  467. public function setLocked($locked)
  468. {
  469. $this->_locked = $locked;
  470. }
  471. /**
  472. * Gets the deployment rollback allowed flag.
  473. *
  474. * @return boolean
  475. */
  476. public function getRollbackAllowed()
  477. {
  478. return $this->_rollbackAllowed;
  479. }
  480. /**
  481. * Sets the deployment rollbackAllowed.
  482. *
  483. * @param boolean $rollbackAllowed The deployment rollback allowed flag.
  484. *
  485. * @return none
  486. */
  487. public function setRollbackAllowed($rollbackAllowed)
  488. {
  489. $this->_rollbackAllowed = $rollbackAllowed;
  490. }
  491. /**
  492. * Gets the deployment upgrade status.
  493. *
  494. * @return UpgradeStatus
  495. */
  496. public function getUpgradeStatus()
  497. {
  498. return $this->_upgradeStatus;
  499. }
  500. /**
  501. * Sets the deployment upgrade status.
  502. *
  503. * @param UpgradeStatus $upgradeStatus The deployment upgrade status.
  504. *
  505. * @return none
  506. */
  507. public function setUpgradeStatus($upgradeStatus)
  508. {
  509. $this->_upgradeStatus = $upgradeStatus;
  510. }
  511. }