PageRenderTime 56ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 1ms

/google-api/contrib/Google_ComputeService.php

https://github.com/lordcoste/analytics-s2s
PHP | 2669 lines | 2110 code | 73 blank | 486 comment | 78 complexity | eb167ee047a309dde0c4e7338eb78e5c MD5 | raw file
Possible License(s): MIT, Apache-2.0

Large files files are truncated, but you can click here to view the full file

  1. <?php
  2. /*
  3. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  4. * use this file except in compliance with the License. You may obtain a copy of
  5. * the License at
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. *
  9. * Unless required by applicable law or agreed to in writing, software
  10. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  11. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  12. * License for the specific language governing permissions and limitations under
  13. * the License.
  14. */
  15. /**
  16. * The "operations" collection of methods.
  17. * Typical usage is:
  18. * <code>
  19. * $computeService = new Google_ComputeService(...);
  20. * $operations = $computeService->operations;
  21. * </code>
  22. */
  23. class Google_OperationsServiceResource extends Google_ServiceResource {
  24. /**
  25. * Retrieves the specified operation resource. (operations.get)
  26. *
  27. * @param string $project Name of the project scoping this request.
  28. * @param string $operation Name of the operation resource to return.
  29. * @param array $optParams Optional parameters.
  30. * @return Google_Operation
  31. */
  32. public function get($project, $operation, $optParams = array()) {
  33. $params = array('project' => $project, 'operation' => $operation);
  34. $params = array_merge($params, $optParams);
  35. $data = $this->__call('get', array($params));
  36. if ($this->useObjects()) {
  37. return new Google_Operation($data);
  38. } else {
  39. return $data;
  40. }
  41. }
  42. /**
  43. * Retrieves the list of operation resources contained within the specified project.
  44. * (operations.list)
  45. *
  46. * @param string $project Name of the project scoping this request.
  47. * @param array $optParams Optional parameters.
  48. *
  49. * @opt_param string filter Optional. Filter expression for filtering listed resources.
  50. * @opt_param string pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.
  51. * @opt_param string maxResults Optional. Maximum count of results to be returned. Maximum and default value is 100.
  52. * @return Google_OperationList
  53. */
  54. public function listOperations($project, $optParams = array()) {
  55. $params = array('project' => $project);
  56. $params = array_merge($params, $optParams);
  57. $data = $this->__call('list', array($params));
  58. if ($this->useObjects()) {
  59. return new Google_OperationList($data);
  60. } else {
  61. return $data;
  62. }
  63. }
  64. /**
  65. * Deletes the specified operation resource. (operations.delete)
  66. *
  67. * @param string $project Name of the project scoping this request.
  68. * @param string $operation Name of the operation resource to delete.
  69. * @param array $optParams Optional parameters.
  70. */
  71. public function delete($project, $operation, $optParams = array()) {
  72. $params = array('project' => $project, 'operation' => $operation);
  73. $params = array_merge($params, $optParams);
  74. $data = $this->__call('delete', array($params));
  75. return $data;
  76. }
  77. }
  78. /**
  79. * The "kernels" collection of methods.
  80. * Typical usage is:
  81. * <code>
  82. * $computeService = new Google_ComputeService(...);
  83. * $kernels = $computeService->kernels;
  84. * </code>
  85. */
  86. class Google_KernelsServiceResource extends Google_ServiceResource {
  87. /**
  88. * Retrieves the list of kernel resources available to the specified project. (kernels.list)
  89. *
  90. * @param string $project Name of the project scoping this request.
  91. * @param array $optParams Optional parameters.
  92. *
  93. * @opt_param string filter Optional. Filter expression for filtering listed resources.
  94. * @opt_param string pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.
  95. * @opt_param string maxResults Optional. Maximum count of results to be returned. Maximum and default value is 100.
  96. * @return Google_KernelList
  97. */
  98. public function listKernels($project, $optParams = array()) {
  99. $params = array('project' => $project);
  100. $params = array_merge($params, $optParams);
  101. $data = $this->__call('list', array($params));
  102. if ($this->useObjects()) {
  103. return new Google_KernelList($data);
  104. } else {
  105. return $data;
  106. }
  107. }
  108. /**
  109. * Returns the specified kernel resource. (kernels.get)
  110. *
  111. * @param string $project Name of the project scoping this request.
  112. * @param string $kernel Name of the kernel resource to return.
  113. * @param array $optParams Optional parameters.
  114. * @return Google_Kernel
  115. */
  116. public function get($project, $kernel, $optParams = array()) {
  117. $params = array('project' => $project, 'kernel' => $kernel);
  118. $params = array_merge($params, $optParams);
  119. $data = $this->__call('get', array($params));
  120. if ($this->useObjects()) {
  121. return new Google_Kernel($data);
  122. } else {
  123. return $data;
  124. }
  125. }
  126. }
  127. /**
  128. * The "disks" collection of methods.
  129. * Typical usage is:
  130. * <code>
  131. * $computeService = new Google_ComputeService(...);
  132. * $disks = $computeService->disks;
  133. * </code>
  134. */
  135. class Google_DisksServiceResource extends Google_ServiceResource {
  136. /**
  137. * Creates a persistent disk resource in the specified project using the data included in the
  138. * request. (disks.insert)
  139. *
  140. * @param string $project Name of the project scoping this request.
  141. * @param Google_Disk $postBody
  142. * @param array $optParams Optional parameters.
  143. * @return Google_Operation
  144. */
  145. public function insert($project, Google_Disk $postBody, $optParams = array()) {
  146. $params = array('project' => $project, 'postBody' => $postBody);
  147. $params = array_merge($params, $optParams);
  148. $data = $this->__call('insert', array($params));
  149. if ($this->useObjects()) {
  150. return new Google_Operation($data);
  151. } else {
  152. return $data;
  153. }
  154. }
  155. /**
  156. * Returns the specified persistent disk resource. (disks.get)
  157. *
  158. * @param string $project Name of the project scoping this request.
  159. * @param string $disk Name of the persistent disk resource to return.
  160. * @param array $optParams Optional parameters.
  161. * @return Google_Disk
  162. */
  163. public function get($project, $disk, $optParams = array()) {
  164. $params = array('project' => $project, 'disk' => $disk);
  165. $params = array_merge($params, $optParams);
  166. $data = $this->__call('get', array($params));
  167. if ($this->useObjects()) {
  168. return new Google_Disk($data);
  169. } else {
  170. return $data;
  171. }
  172. }
  173. /**
  174. * Retrieves the list of persistent disk resources contained within the specified project.
  175. * (disks.list)
  176. *
  177. * @param string $project Name of the project scoping this request.
  178. * @param array $optParams Optional parameters.
  179. *
  180. * @opt_param string filter Optional. Filter expression for filtering listed resources.
  181. * @opt_param string pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.
  182. * @opt_param string maxResults Optional. Maximum count of results to be returned. Maximum and default value is 100.
  183. * @return Google_DiskList
  184. */
  185. public function listDisks($project, $optParams = array()) {
  186. $params = array('project' => $project);
  187. $params = array_merge($params, $optParams);
  188. $data = $this->__call('list', array($params));
  189. if ($this->useObjects()) {
  190. return new Google_DiskList($data);
  191. } else {
  192. return $data;
  193. }
  194. }
  195. /**
  196. * Deletes the specified persistent disk resource. (disks.delete)
  197. *
  198. * @param string $project Name of the project scoping this request.
  199. * @param string $disk Name of the persistent disk resource to delete.
  200. * @param array $optParams Optional parameters.
  201. * @return Google_Operation
  202. */
  203. public function delete($project, $disk, $optParams = array()) {
  204. $params = array('project' => $project, 'disk' => $disk);
  205. $params = array_merge($params, $optParams);
  206. $data = $this->__call('delete', array($params));
  207. if ($this->useObjects()) {
  208. return new Google_Operation($data);
  209. } else {
  210. return $data;
  211. }
  212. }
  213. }
  214. /**
  215. * The "snapshots" collection of methods.
  216. * Typical usage is:
  217. * <code>
  218. * $computeService = new Google_ComputeService(...);
  219. * $snapshots = $computeService->snapshots;
  220. * </code>
  221. */
  222. class Google_SnapshotsServiceResource extends Google_ServiceResource {
  223. /**
  224. * Creates a persistent disk snapshot resource in the specified project using the data included in
  225. * the request. (snapshots.insert)
  226. *
  227. * @param string $project Name of the project scoping this request.
  228. * @param Google_Snapshot $postBody
  229. * @param array $optParams Optional parameters.
  230. * @return Google_Operation
  231. */
  232. public function insert($project, Google_Snapshot $postBody, $optParams = array()) {
  233. $params = array('project' => $project, 'postBody' => $postBody);
  234. $params = array_merge($params, $optParams);
  235. $data = $this->__call('insert', array($params));
  236. if ($this->useObjects()) {
  237. return new Google_Operation($data);
  238. } else {
  239. return $data;
  240. }
  241. }
  242. /**
  243. * Returns the specified persistent disk snapshot resource. (snapshots.get)
  244. *
  245. * @param string $project Name of the project scoping this request.
  246. * @param string $snapshot Name of the persistent disk snapshot resource to return.
  247. * @param array $optParams Optional parameters.
  248. * @return Google_Snapshot
  249. */
  250. public function get($project, $snapshot, $optParams = array()) {
  251. $params = array('project' => $project, 'snapshot' => $snapshot);
  252. $params = array_merge($params, $optParams);
  253. $data = $this->__call('get', array($params));
  254. if ($this->useObjects()) {
  255. return new Google_Snapshot($data);
  256. } else {
  257. return $data;
  258. }
  259. }
  260. /**
  261. * Retrieves the list of persistent disk snapshot resources contained within the specified project.
  262. * (snapshots.list)
  263. *
  264. * @param string $project Name of the project scoping this request.
  265. * @param array $optParams Optional parameters.
  266. *
  267. * @opt_param string filter Optional. Filter expression for filtering listed resources.
  268. * @opt_param string pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.
  269. * @opt_param string maxResults Optional. Maximum count of results to be returned. Maximum and default value is 100.
  270. * @return Google_SnapshotList
  271. */
  272. public function listSnapshots($project, $optParams = array()) {
  273. $params = array('project' => $project);
  274. $params = array_merge($params, $optParams);
  275. $data = $this->__call('list', array($params));
  276. if ($this->useObjects()) {
  277. return new Google_SnapshotList($data);
  278. } else {
  279. return $data;
  280. }
  281. }
  282. /**
  283. * Deletes the specified persistent disk snapshot resource. (snapshots.delete)
  284. *
  285. * @param string $project Name of the project scoping this request.
  286. * @param string $snapshot Name of the persistent disk snapshot resource to delete.
  287. * @param array $optParams Optional parameters.
  288. * @return Google_Operation
  289. */
  290. public function delete($project, $snapshot, $optParams = array()) {
  291. $params = array('project' => $project, 'snapshot' => $snapshot);
  292. $params = array_merge($params, $optParams);
  293. $data = $this->__call('delete', array($params));
  294. if ($this->useObjects()) {
  295. return new Google_Operation($data);
  296. } else {
  297. return $data;
  298. }
  299. }
  300. }
  301. /**
  302. * The "zones" collection of methods.
  303. * Typical usage is:
  304. * <code>
  305. * $computeService = new Google_ComputeService(...);
  306. * $zones = $computeService->zones;
  307. * </code>
  308. */
  309. class Google_ZonesServiceResource extends Google_ServiceResource {
  310. /**
  311. * Retrieves the list of zone resources available to the specified project. (zones.list)
  312. *
  313. * @param string $project Name of the project scoping this request.
  314. * @param array $optParams Optional parameters.
  315. *
  316. * @opt_param string filter Optional. Filter expression for filtering listed resources.
  317. * @opt_param string pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.
  318. * @opt_param string maxResults Optional. Maximum count of results to be returned. Maximum and default value is 100.
  319. * @return Google_ZoneList
  320. */
  321. public function listZones($project, $optParams = array()) {
  322. $params = array('project' => $project);
  323. $params = array_merge($params, $optParams);
  324. $data = $this->__call('list', array($params));
  325. if ($this->useObjects()) {
  326. return new Google_ZoneList($data);
  327. } else {
  328. return $data;
  329. }
  330. }
  331. /**
  332. * Returns the specified zone resource. (zones.get)
  333. *
  334. * @param string $project Name of the project scoping this request.
  335. * @param string $zone Name of the zone resource to return.
  336. * @param array $optParams Optional parameters.
  337. * @return Google_Zone
  338. */
  339. public function get($project, $zone, $optParams = array()) {
  340. $params = array('project' => $project, 'zone' => $zone);
  341. $params = array_merge($params, $optParams);
  342. $data = $this->__call('get', array($params));
  343. if ($this->useObjects()) {
  344. return new Google_Zone($data);
  345. } else {
  346. return $data;
  347. }
  348. }
  349. }
  350. /**
  351. * The "instances" collection of methods.
  352. * Typical usage is:
  353. * <code>
  354. * $computeService = new Google_ComputeService(...);
  355. * $instances = $computeService->instances;
  356. * </code>
  357. */
  358. class Google_InstancesServiceResource extends Google_ServiceResource {
  359. /**
  360. * Returns the specified instance's serial port output. (instances.getSerialPortOutput)
  361. *
  362. * @param string $project Name of the project scoping this request.
  363. * @param string $instance Name of the instance scoping this request.
  364. * @param array $optParams Optional parameters.
  365. * @return Google_SerialPortOutput
  366. */
  367. public function getSerialPortOutput($project, $instance, $optParams = array()) {
  368. $params = array('project' => $project, 'instance' => $instance);
  369. $params = array_merge($params, $optParams);
  370. $data = $this->__call('getSerialPortOutput', array($params));
  371. if ($this->useObjects()) {
  372. return new Google_SerialPortOutput($data);
  373. } else {
  374. return $data;
  375. }
  376. }
  377. /**
  378. * Deletes an access config from an instance's network interface. (instances.deleteAccessConfig)
  379. *
  380. * @param string $project Project name.
  381. * @param string $instance Instance name.
  382. * @param string $access_config Access config name.
  383. * @param string $network_interface Network interface name.
  384. * @param array $optParams Optional parameters.
  385. * @return Google_Operation
  386. */
  387. public function deleteAccessConfig($project, $instance, $access_config, $network_interface, $optParams = array()) {
  388. $params = array('project' => $project, 'instance' => $instance, 'access_config' => $access_config, 'network_interface' => $network_interface);
  389. $params = array_merge($params, $optParams);
  390. $data = $this->__call('deleteAccessConfig', array($params));
  391. if ($this->useObjects()) {
  392. return new Google_Operation($data);
  393. } else {
  394. return $data;
  395. }
  396. }
  397. /**
  398. * Returns the specified instance resource. (instances.get)
  399. *
  400. * @param string $project Name of the project scoping this request.
  401. * @param string $instance Name of the instance resource to return.
  402. * @param array $optParams Optional parameters.
  403. * @return Google_Instance
  404. */
  405. public function get($project, $instance, $optParams = array()) {
  406. $params = array('project' => $project, 'instance' => $instance);
  407. $params = array_merge($params, $optParams);
  408. $data = $this->__call('get', array($params));
  409. if ($this->useObjects()) {
  410. return new Google_Instance($data);
  411. } else {
  412. return $data;
  413. }
  414. }
  415. /**
  416. * Retrieves the list of instance resources contained within the specified project. (instances.list)
  417. *
  418. * @param string $project Name of the project scoping this request.
  419. * @param array $optParams Optional parameters.
  420. *
  421. * @opt_param string filter Optional. Filter expression for filtering listed resources.
  422. * @opt_param string pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.
  423. * @opt_param string maxResults Optional. Maximum count of results to be returned. Maximum and default value is 100.
  424. * @return Google_InstanceList
  425. */
  426. public function listInstances($project, $optParams = array()) {
  427. $params = array('project' => $project);
  428. $params = array_merge($params, $optParams);
  429. $data = $this->__call('list', array($params));
  430. if ($this->useObjects()) {
  431. return new Google_InstanceList($data);
  432. } else {
  433. return $data;
  434. }
  435. }
  436. /**
  437. * Adds an access config to an instance's network interface. (instances.addAccessConfig)
  438. *
  439. * @param string $project Project name.
  440. * @param string $instance Instance name.
  441. * @param string $network_interface Network interface name.
  442. * @param Google_AccessConfig $postBody
  443. * @param array $optParams Optional parameters.
  444. * @return Google_Operation
  445. */
  446. public function addAccessConfig($project, $instance, $network_interface, Google_AccessConfig $postBody, $optParams = array()) {
  447. $params = array('project' => $project, 'instance' => $instance, 'network_interface' => $network_interface, 'postBody' => $postBody);
  448. $params = array_merge($params, $optParams);
  449. $data = $this->__call('addAccessConfig', array($params));
  450. if ($this->useObjects()) {
  451. return new Google_Operation($data);
  452. } else {
  453. return $data;
  454. }
  455. }
  456. /**
  457. * Creates an instance resource in the specified project using the data included in the request.
  458. * (instances.insert)
  459. *
  460. * @param string $project Name of the project scoping this request.
  461. * @param Google_Instance $postBody
  462. * @param array $optParams Optional parameters.
  463. * @return Google_Operation
  464. */
  465. public function insert($project, Google_Instance $postBody, $optParams = array()) {
  466. $params = array('project' => $project, 'postBody' => $postBody);
  467. $params = array_merge($params, $optParams);
  468. $data = $this->__call('insert', array($params));
  469. if ($this->useObjects()) {
  470. return new Google_Operation($data);
  471. } else {
  472. return $data;
  473. }
  474. }
  475. /**
  476. * Deletes the specified instance resource. (instances.delete)
  477. *
  478. * @param string $project Name of the project scoping this request.
  479. * @param string $instance Name of the instance resource to delete.
  480. * @param array $optParams Optional parameters.
  481. * @return Google_Operation
  482. */
  483. public function delete($project, $instance, $optParams = array()) {
  484. $params = array('project' => $project, 'instance' => $instance);
  485. $params = array_merge($params, $optParams);
  486. $data = $this->__call('delete', array($params));
  487. if ($this->useObjects()) {
  488. return new Google_Operation($data);
  489. } else {
  490. return $data;
  491. }
  492. }
  493. }
  494. /**
  495. * The "machineTypes" collection of methods.
  496. * Typical usage is:
  497. * <code>
  498. * $computeService = new Google_ComputeService(...);
  499. * $machineTypes = $computeService->machineTypes;
  500. * </code>
  501. */
  502. class Google_MachineTypesServiceResource extends Google_ServiceResource {
  503. /**
  504. * Retrieves the list of machine type resources available to the specified project.
  505. * (machineTypes.list)
  506. *
  507. * @param string $project Name of the project scoping this request.
  508. * @param array $optParams Optional parameters.
  509. *
  510. * @opt_param string filter Optional. Filter expression for filtering listed resources.
  511. * @opt_param string pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.
  512. * @opt_param string maxResults Optional. Maximum count of results to be returned. Maximum and default value is 100.
  513. * @return Google_MachineTypeList
  514. */
  515. public function listMachineTypes($project, $optParams = array()) {
  516. $params = array('project' => $project);
  517. $params = array_merge($params, $optParams);
  518. $data = $this->__call('list', array($params));
  519. if ($this->useObjects()) {
  520. return new Google_MachineTypeList($data);
  521. } else {
  522. return $data;
  523. }
  524. }
  525. /**
  526. * Returns the specified machine type resource. (machineTypes.get)
  527. *
  528. * @param string $project Name of the project scoping this request.
  529. * @param string $machineType Name of the machine type resource to return.
  530. * @param array $optParams Optional parameters.
  531. * @return Google_MachineType
  532. */
  533. public function get($project, $machineType, $optParams = array()) {
  534. $params = array('project' => $project, 'machineType' => $machineType);
  535. $params = array_merge($params, $optParams);
  536. $data = $this->__call('get', array($params));
  537. if ($this->useObjects()) {
  538. return new Google_MachineType($data);
  539. } else {
  540. return $data;
  541. }
  542. }
  543. }
  544. /**
  545. * The "images" collection of methods.
  546. * Typical usage is:
  547. * <code>
  548. * $computeService = new Google_ComputeService(...);
  549. * $images = $computeService->images;
  550. * </code>
  551. */
  552. class Google_ImagesServiceResource extends Google_ServiceResource {
  553. /**
  554. * Creates an image resource in the specified project using the data included in the request.
  555. * (images.insert)
  556. *
  557. * @param string $project Name of the project scoping this request.
  558. * @param Google_Image $postBody
  559. * @param array $optParams Optional parameters.
  560. * @return Google_Operation
  561. */
  562. public function insert($project, Google_Image $postBody, $optParams = array()) {
  563. $params = array('project' => $project, 'postBody' => $postBody);
  564. $params = array_merge($params, $optParams);
  565. $data = $this->__call('insert', array($params));
  566. if ($this->useObjects()) {
  567. return new Google_Operation($data);
  568. } else {
  569. return $data;
  570. }
  571. }
  572. /**
  573. * Returns the specified image resource. (images.get)
  574. *
  575. * @param string $project Name of the project scoping this request.
  576. * @param string $image Name of the image resource to return.
  577. * @param array $optParams Optional parameters.
  578. * @return Google_Image
  579. */
  580. public function get($project, $image, $optParams = array()) {
  581. $params = array('project' => $project, 'image' => $image);
  582. $params = array_merge($params, $optParams);
  583. $data = $this->__call('get', array($params));
  584. if ($this->useObjects()) {
  585. return new Google_Image($data);
  586. } else {
  587. return $data;
  588. }
  589. }
  590. /**
  591. * Retrieves the list of image resources available to the specified project. (images.list)
  592. *
  593. * @param string $project Name of the project scoping this request.
  594. * @param array $optParams Optional parameters.
  595. *
  596. * @opt_param string filter Optional. Filter expression for filtering listed resources.
  597. * @opt_param string pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.
  598. * @opt_param string maxResults Optional. Maximum count of results to be returned. Maximum and default value is 100.
  599. * @return Google_ImageList
  600. */
  601. public function listImages($project, $optParams = array()) {
  602. $params = array('project' => $project);
  603. $params = array_merge($params, $optParams);
  604. $data = $this->__call('list', array($params));
  605. if ($this->useObjects()) {
  606. return new Google_ImageList($data);
  607. } else {
  608. return $data;
  609. }
  610. }
  611. /**
  612. * Deletes the specified image resource. (images.delete)
  613. *
  614. * @param string $project Name of the project scoping this request.
  615. * @param string $image Name of the image resource to delete.
  616. * @param array $optParams Optional parameters.
  617. * @return Google_Operation
  618. */
  619. public function delete($project, $image, $optParams = array()) {
  620. $params = array('project' => $project, 'image' => $image);
  621. $params = array_merge($params, $optParams);
  622. $data = $this->__call('delete', array($params));
  623. if ($this->useObjects()) {
  624. return new Google_Operation($data);
  625. } else {
  626. return $data;
  627. }
  628. }
  629. }
  630. /**
  631. * The "firewalls" collection of methods.
  632. * Typical usage is:
  633. * <code>
  634. * $computeService = new Google_ComputeService(...);
  635. * $firewalls = $computeService->firewalls;
  636. * </code>
  637. */
  638. class Google_FirewallsServiceResource extends Google_ServiceResource {
  639. /**
  640. * Creates a firewall resource in the specified project using the data included in the request.
  641. * (firewalls.insert)
  642. *
  643. * @param string $project Name of the project scoping this request.
  644. * @param Google_Firewall $postBody
  645. * @param array $optParams Optional parameters.
  646. * @return Google_Operation
  647. */
  648. public function insert($project, Google_Firewall $postBody, $optParams = array()) {
  649. $params = array('project' => $project, 'postBody' => $postBody);
  650. $params = array_merge($params, $optParams);
  651. $data = $this->__call('insert', array($params));
  652. if ($this->useObjects()) {
  653. return new Google_Operation($data);
  654. } else {
  655. return $data;
  656. }
  657. }
  658. /**
  659. * Returns the specified firewall resource. (firewalls.get)
  660. *
  661. * @param string $project Name of the project scoping this request.
  662. * @param string $firewall Name of the firewall resource to return.
  663. * @param array $optParams Optional parameters.
  664. * @return Google_Firewall
  665. */
  666. public function get($project, $firewall, $optParams = array()) {
  667. $params = array('project' => $project, 'firewall' => $firewall);
  668. $params = array_merge($params, $optParams);
  669. $data = $this->__call('get', array($params));
  670. if ($this->useObjects()) {
  671. return new Google_Firewall($data);
  672. } else {
  673. return $data;
  674. }
  675. }
  676. /**
  677. * Retrieves the list of firewall resources available to the specified project. (firewalls.list)
  678. *
  679. * @param string $project Name of the project scoping this request.
  680. * @param array $optParams Optional parameters.
  681. *
  682. * @opt_param string filter Optional. Filter expression for filtering listed resources.
  683. * @opt_param string pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.
  684. * @opt_param string maxResults Optional. Maximum count of results to be returned. Maximum and default value is 100.
  685. * @return Google_FirewallList
  686. */
  687. public function listFirewalls($project, $optParams = array()) {
  688. $params = array('project' => $project);
  689. $params = array_merge($params, $optParams);
  690. $data = $this->__call('list', array($params));
  691. if ($this->useObjects()) {
  692. return new Google_FirewallList($data);
  693. } else {
  694. return $data;
  695. }
  696. }
  697. /**
  698. * Updates the specified firewall resource with the data included in the request. (firewalls.update)
  699. *
  700. * @param string $project Name of the project scoping this request.
  701. * @param string $firewall Name of the firewall resource to update.
  702. * @param Google_Firewall $postBody
  703. * @param array $optParams Optional parameters.
  704. * @return Google_Operation
  705. */
  706. public function update($project, $firewall, Google_Firewall $postBody, $optParams = array()) {
  707. $params = array('project' => $project, 'firewall' => $firewall, 'postBody' => $postBody);
  708. $params = array_merge($params, $optParams);
  709. $data = $this->__call('update', array($params));
  710. if ($this->useObjects()) {
  711. return new Google_Operation($data);
  712. } else {
  713. return $data;
  714. }
  715. }
  716. /**
  717. * Updates the specified firewall resource with the data included in the request. This method
  718. * supports patch semantics. (firewalls.patch)
  719. *
  720. * @param string $project Name of the project scoping this request.
  721. * @param string $firewall Name of the firewall resource to update.
  722. * @param Google_Firewall $postBody
  723. * @param array $optParams Optional parameters.
  724. * @return Google_Operation
  725. */
  726. public function patch($project, $firewall, Google_Firewall $postBody, $optParams = array()) {
  727. $params = array('project' => $project, 'firewall' => $firewall, 'postBody' => $postBody);
  728. $params = array_merge($params, $optParams);
  729. $data = $this->__call('patch', array($params));
  730. if ($this->useObjects()) {
  731. return new Google_Operation($data);
  732. } else {
  733. return $data;
  734. }
  735. }
  736. /**
  737. * Deletes the specified firewall resource. (firewalls.delete)
  738. *
  739. * @param string $project Name of the project scoping this request.
  740. * @param string $firewall Name of the firewall resource to delete.
  741. * @param array $optParams Optional parameters.
  742. * @return Google_Operation
  743. */
  744. public function delete($project, $firewall, $optParams = array()) {
  745. $params = array('project' => $project, 'firewall' => $firewall);
  746. $params = array_merge($params, $optParams);
  747. $data = $this->__call('delete', array($params));
  748. if ($this->useObjects()) {
  749. return new Google_Operation($data);
  750. } else {
  751. return $data;
  752. }
  753. }
  754. }
  755. /**
  756. * The "networks" collection of methods.
  757. * Typical usage is:
  758. * <code>
  759. * $computeService = new Google_ComputeService(...);
  760. * $networks = $computeService->networks;
  761. * </code>
  762. */
  763. class Google_NetworksServiceResource extends Google_ServiceResource {
  764. /**
  765. * Creates a network resource in the specified project using the data included in the request.
  766. * (networks.insert)
  767. *
  768. * @param string $project Name of the project scoping this request.
  769. * @param Google_Network $postBody
  770. * @param array $optParams Optional parameters.
  771. * @return Google_Operation
  772. */
  773. public function insert($project, Google_Network $postBody, $optParams = array()) {
  774. $params = array('project' => $project, 'postBody' => $postBody);
  775. $params = array_merge($params, $optParams);
  776. $data = $this->__call('insert', array($params));
  777. if ($this->useObjects()) {
  778. return new Google_Operation($data);
  779. } else {
  780. return $data;
  781. }
  782. }
  783. /**
  784. * Returns the specified network resource. (networks.get)
  785. *
  786. * @param string $project Name of the project scoping this request.
  787. * @param string $network Name of the network resource to return.
  788. * @param array $optParams Optional parameters.
  789. * @return Google_Network
  790. */
  791. public function get($project, $network, $optParams = array()) {
  792. $params = array('project' => $project, 'network' => $network);
  793. $params = array_merge($params, $optParams);
  794. $data = $this->__call('get', array($params));
  795. if ($this->useObjects()) {
  796. return new Google_Network($data);
  797. } else {
  798. return $data;
  799. }
  800. }
  801. /**
  802. * Retrieves the list of network resources available to the specified project. (networks.list)
  803. *
  804. * @param string $project Name of the project scoping this request.
  805. * @param array $optParams Optional parameters.
  806. *
  807. * @opt_param string filter Optional. Filter expression for filtering listed resources.
  808. * @opt_param string pageToken Optional. Tag returned by a previous list request truncated by maxResults. Used to continue a previous list request.
  809. * @opt_param string maxResults Optional. Maximum count of results to be returned. Maximum and default value is 100.
  810. * @return Google_NetworkList
  811. */
  812. public function listNetworks($project, $optParams = array()) {
  813. $params = array('project' => $project);
  814. $params = array_merge($params, $optParams);
  815. $data = $this->__call('list', array($params));
  816. if ($this->useObjects()) {
  817. return new Google_NetworkList($data);
  818. } else {
  819. return $data;
  820. }
  821. }
  822. /**
  823. * Deletes the specified network resource. (networks.delete)
  824. *
  825. * @param string $project Name of the project scoping this request.
  826. * @param string $network Name of the network resource to delete.
  827. * @param array $optParams Optional parameters.
  828. * @return Google_Operation
  829. */
  830. public function delete($project, $network, $optParams = array()) {
  831. $params = array('project' => $project, 'network' => $network);
  832. $params = array_merge($params, $optParams);
  833. $data = $this->__call('delete', array($params));
  834. if ($this->useObjects()) {
  835. return new Google_Operation($data);
  836. } else {
  837. return $data;
  838. }
  839. }
  840. }
  841. /**
  842. * The "projects" collection of methods.
  843. * Typical usage is:
  844. * <code>
  845. * $computeService = new Google_ComputeService(...);
  846. * $projects = $computeService->projects;
  847. * </code>
  848. */
  849. class Google_ProjectsServiceResource extends Google_ServiceResource {
  850. /**
  851. * Sets metadata common to all instances within the specified project using the data included in the
  852. * request. (projects.setCommonInstanceMetadata)
  853. *
  854. * @param string $project Name of the project scoping this request.
  855. * @param Google_Metadata $postBody
  856. * @param array $optParams Optional parameters.
  857. * @return Google_Operation
  858. */
  859. public function setCommonInstanceMetadata($project, Google_Metadata $postBody, $optParams = array()) {
  860. $params = array('project' => $project, 'postBody' => $postBody);
  861. $params = array_merge($params, $optParams);
  862. $data = $this->__call('setCommonInstanceMetadata', array($params));
  863. if ($this->useObjects()) {
  864. return new Google_Operation($data);
  865. } else {
  866. return $data;
  867. }
  868. }
  869. /**
  870. * Returns the specified project resource. (projects.get)
  871. *
  872. * @param string $project Name of the project resource to retrieve.
  873. * @param array $optParams Optional parameters.
  874. * @return Google_Project
  875. */
  876. public function get($project, $optParams = array()) {
  877. $params = array('project' => $project);
  878. $params = array_merge($params, $optParams);
  879. $data = $this->__call('get', array($params));
  880. if ($this->useObjects()) {
  881. return new Google_Project($data);
  882. } else {
  883. return $data;
  884. }
  885. }
  886. }
  887. /**
  888. * Service definition for Google_Compute (v1beta13).
  889. *
  890. * <p>
  891. * API for the Google Compute Engine service.
  892. * </p>
  893. *
  894. * <p>
  895. * For more information about this service, see the
  896. * <a href="https://developers.google.com/compute/docs/reference/v1beta13" target="_blank">API Documentation</a>
  897. * </p>
  898. *
  899. * @author Google, Inc.
  900. */
  901. class Google_ComputeService extends Google_Service {
  902. public $operations;
  903. public $kernels;
  904. public $disks;
  905. public $snapshots;
  906. public $zones;
  907. public $instances;
  908. public $machineTypes;
  909. public $images;
  910. public $firewalls;
  911. public $networks;
  912. public $projects;
  913. /**
  914. * Constructs the internal representation of the Compute service.
  915. *
  916. * @param Google_Client $client
  917. */
  918. public function __construct(Google_Client $client) {
  919. $this->servicePath = 'compute/v1beta13/projects/';
  920. $this->version = 'v1beta13';
  921. $this->serviceName = 'compute';
  922. $client->addService($this->serviceName, $this->version);
  923. $this->operations = new Google_OperationsServiceResource($this, $this->serviceName, 'operations', json_decode('{"methods": {"get": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "operation": {"required": true, "type": "string", "location": "path"}}, "id": "compute.operations.get", "httpMethod": "GET", "path": "{project}/operations/{operation}", "response": {"$ref": "Operation"}}, "list": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"filter": {"type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "project": {"required": true, "type": "string", "location": "path"}, "maxResults": {"format": "uint32", "default": "100", "maximum": "100", "minimum": "0", "location": "query", "type": "integer"}}, "id": "compute.operations.list", "httpMethod": "GET", "path": "{project}/operations", "response": {"$ref": "OperationList"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/compute"], "path": "{project}/operations/{operation}", "id": "compute.operations.delete", "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "operation": {"required": true, "type": "string", "location": "path"}}, "httpMethod": "DELETE"}}}', true));
  924. $this->kernels = new Google_KernelsServiceResource($this, $this->serviceName, 'kernels', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"filter": {"type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "project": {"required": true, "type": "string", "location": "path"}, "maxResults": {"format": "uint32", "default": "100", "maximum": "100", "minimum": "0", "location": "query", "type": "integer"}}, "id": "compute.kernels.list", "httpMethod": "GET", "path": "{project}/kernels", "response": {"$ref": "KernelList"}}, "get": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "kernel": {"required": true, "type": "string", "location": "path"}}, "id": "compute.kernels.get", "httpMethod": "GET", "path": "{project}/kernels/{kernel}", "response": {"$ref": "Kernel"}}}}', true));
  925. $this->disks = new Google_DisksServiceResource($this, $this->serviceName, 'disks', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/compute"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Disk"}, "response": {"$ref": "Operation"}, "httpMethod": "POST", "path": "{project}/disks", "id": "compute.disks.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "disk": {"required": true, "type": "string", "location": "path"}}, "id": "compute.disks.get", "httpMethod": "GET", "path": "{project}/disks/{disk}", "response": {"$ref": "Disk"}}, "list": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"filter": {"type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "project": {"required": true, "type": "string", "location": "path"}, "maxResults": {"format": "uint32", "default": "100", "maximum": "100", "minimum": "0", "location": "query", "type": "integer"}}, "id": "compute.disks.list", "httpMethod": "GET", "path": "{project}/disks", "response": {"$ref": "DiskList"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/compute"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "disk": {"required": true, "type": "string", "location": "path"}}, "id": "compute.disks.delete", "httpMethod": "DELETE", "path": "{project}/disks/{disk}", "response": {"$ref": "Operation"}}}}', true));
  926. $this->snapshots = new Google_SnapshotsServiceResource($this, $this->serviceName, 'snapshots', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/compute"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Snapshot"}, "response": {"$ref": "Operation"}, "httpMethod": "POST", "path": "{project}/snapshots", "id": "compute.snapshots.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "snapshot": {"required": true, "type": "string", "location": "path"}}, "id": "compute.snapshots.get", "httpMethod": "GET", "path": "{project}/snapshots/{snapshot}", "response": {"$ref": "Snapshot"}}, "list": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"filter": {"type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "project": {"required": true, "type": "string", "location": "path"}, "maxResults": {"format": "uint32", "default": "100", "maximum": "100", "minimum": "0", "location": "query", "type": "integer"}}, "id": "compute.snapshots.list", "httpMethod": "GET", "path": "{project}/snapshots", "response": {"$ref": "SnapshotList"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/compute"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "snapshot": {"required": true, "type": "string", "location": "path"}}, "id": "compute.snapshots.delete", "httpMethod": "DELETE", "path": "{project}/snapshots/{snapshot}", "response": {"$ref": "Operation"}}}}', true));
  927. $this->zones = new Google_ZonesServiceResource($this, $this->serviceName, 'zones', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"filter": {"type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "project": {"required": true, "type": "string", "location": "path"}, "maxResults": {"format": "uint32", "default": "100", "maximum": "100", "minimum": "0", "location": "query", "type": "integer"}}, "id": "compute.zones.list", "httpMethod": "GET", "path": "{project}/zones", "response": {"$ref": "ZoneList"}}, "get": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "zone": {"required": true, "type": "string", "location": "path"}}, "id": "compute.zones.get", "httpMethod": "GET", "path": "{project}/zones/{zone}", "response": {"$ref": "Zone"}}}}', true));
  928. $this->instances = new Google_InstancesServiceResource($this, $this->serviceName, 'instances', json_decode('{"methods": {"getSerialPortOutput": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "instance": {"required": true, "type": "string", "location": "path"}}, "id": "compute.instances.getSerialPortOutput", "httpMethod": "GET", "path": "{project}/instances/{instance}/serialPort", "response": {"$ref": "SerialPortOutput"}}, "deleteAccessConfig": {"scopes": ["https://www.googleapis.com/auth/compute"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "instance": {"required": true, "type": "string", "location": "path"}, "access_config": {"required": true, "type": "string", "location": "query"}, "network_interface": {"required": true, "type": "string", "location": "query"}}, "id": "compute.instances.deleteAccessConfig", "httpMethod": "POST", "path": "{project}/instances/{instance}/deleteAccessConfig", "response": {"$ref": "Operation"}}, "get": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "instance": {"required": true, "type": "string", "location": "path"}}, "id": "compute.instances.get", "httpMethod": "GET", "path": "{project}/instances/{instance}", "response": {"$ref": "Instance"}}, "list": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"filter": {"type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "project": {"required": true, "type": "string", "location": "path"}, "maxResults": {"format": "uint32", "default": "100", "maximum": "100", "minimum": "0", "location": "query", "type": "integer"}}, "id": "compute.instances.list", "httpMethod": "GET", "path": "{project}/instances", "response": {"$ref": "InstanceList"}}, "addAccessConfig": {"scopes": ["https://www.googleapis.com/auth/compute"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "instance": {"required": true, "type": "string", "location": "path"}, "network_interface": {"required": true, "type": "string", "location": "query"}}, "request": {"$ref": "AccessConfig"}, "response": {"$ref": "Operation"}, "httpMethod": "POST", "path": "{project}/instances/{instance}/addAccessConfig", "id": "compute.instances.addAccessConfig"}, "insert": {"scopes": ["https://www.googleapis.com/auth/compute"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Instance"}, "response": {"$ref": "Operation"}, "httpMethod": "POST", "path": "{project}/instances", "id": "compute.instances.insert"}, "delete": {"scopes": ["https://www.googleapis.com/auth/compute"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "instance": {"required": true, "type": "string", "location": "path"}}, "id": "compute.instances.delete", "httpMethod": "DELETE", "path": "{project}/instances/{instance}", "response": {"$ref": "Operation"}}}}', true));
  929. $this->machineTypes = new Google_MachineTypesServiceResource($this, $this->serviceName, 'machineTypes', json_decode('{"methods": {"list": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"filter": {"type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "project": {"required": true, "type": "string", "location": "path"}, "maxResults": {"format": "uint32", "default": "100", "maximum": "100", "minimum": "0", "location": "query", "type": "integer"}}, "id": "compute.machineTypes.list", "httpMethod": "GET", "path": "{project}/machineTypes", "response": {"$ref": "MachineTypeList"}}, "get": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "machineType": {"required": true, "type": "string", "location": "path"}}, "id": "compute.machineTypes.get", "httpMethod": "GET", "path": "{project}/machineTypes/{machineType}", "response": {"$ref": "MachineType"}}}}', true));
  930. $this->images = new Google_ImagesServiceResource($this, $this->serviceName, 'images', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/compute", "https://www.googleapis.com/auth/devstorage.read_only"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Image"}, "response": {"$ref": "Operation"}, "httpMethod": "POST", "path": "{project}/images", "id": "compute.images.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "image": {"required": true, "type": "string", "location": "path"}}, "id": "compute.images.get", "httpMethod": "GET", "path": "{project}/images/{image}", "response": {"$ref": "Image"}}, "list": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"filter": {"type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "project": {"required": true, "type": "string", "location": "path"}, "maxResults": {"format": "uint32", "default": "100", "maximum": "100", "minimum": "0", "location": "query", "type": "integer"}}, "id": "compute.images.list", "httpMethod": "GET", "path": "{project}/images", "response": {"$ref": "ImageList"}}, "delete": {"scopes": ["https://www.googleapis.com/auth/compute"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}, "image": {"required": true, "type": "string", "location": "path"}}, "id": "compute.images.delete", "httpMethod": "DELETE", "path": "{project}/images/{image}", "response": {"$ref": "Operation"}}}}', true));
  931. $this->firewalls = new Google_FirewallsServiceResource($this, $this->serviceName, 'firewalls', json_decode('{"methods": {"insert": {"scopes": ["https://www.googleapis.com/auth/compute"], "parameters": {"project": {"required": true, "type": "string", "location": "path"}}, "request": {"$ref": "Firewall"}, "response": {"$ref": "Operation"}, "httpMethod": "POST", "path": "{project}/firewalls", "id": "compute.firewalls.insert"}, "get": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"firewall": {"required": true, "type": "string", "location": "path"}, "project": {"required": true, "type": "string", "location": "path"}}, "id": "compute.firewalls.get", "httpMethod": "GET", "path": "{project}/firewalls/{firewall}", "response": {"$ref": "Firewall"}}, "list": {"scopes": ["https://www.googleapis.com/auth/compute.readonly"], "parameters": {"filter": {"type": "string", "location": "query"}, "pageToken": {"type": "string", "location": "query"}, "project": {"required": true, "type": "string", "location": "path"}, "maxResults": {"format": "uint32", "default": "100", "maximum": "100", "minimum": "0", "location": "query", "type": "integer"}}, "id": "compute.firewalls.list", "httpMethod": "GET", "p…

Large files files are truncated, but you can click here to view the full file