SourceInstanceProperties.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  1. <?php
  2. /*
  3. * Copyright 2014 Google Inc.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  6. * use this file except in compliance with the License. You may obtain a copy of
  7. * the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  13. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  14. * License for the specific language governing permissions and limitations under
  15. * the License.
  16. */
  17. namespace Google\Service\Compute;
  18. class SourceInstanceProperties extends \Google\Collection
  19. {
  20. /**
  21. * Default value. This value is unused.
  22. */
  23. public const KEY_REVOCATION_ACTION_TYPE_KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED = 'KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED';
  24. /**
  25. * Indicates user chose no operation.
  26. */
  27. public const KEY_REVOCATION_ACTION_TYPE_NONE = 'NONE';
  28. /**
  29. * Indicates user chose to opt for VM shutdown on key revocation.
  30. */
  31. public const KEY_REVOCATION_ACTION_TYPE_STOP = 'STOP';
  32. /**
  33. * Indicates user chose no operation.
  34. */
  35. public const POST_KEY_REVOCATION_ACTION_TYPE_NOOP = 'NOOP';
  36. /**
  37. * Default value. This value is unused.
  38. */
  39. public const POST_KEY_REVOCATION_ACTION_TYPE_POST_KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED = 'POST_KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED';
  40. /**
  41. * Indicates user chose to opt for VM shutdown on key revocation.
  42. */
  43. public const POST_KEY_REVOCATION_ACTION_TYPE_SHUTDOWN = 'SHUTDOWN';
  44. protected $collection_key = 'serviceAccounts';
  45. /**
  46. * Enables instances created based on this machine image to send packets with
  47. * source IP addresses other than their own and receive packets with
  48. * destination IP addresses other than their own. If these instances will be
  49. * used as an IP gateway or it will be set as the next-hop in a Route
  50. * resource, specify true. If unsure, leave this set tofalse. See theEnable IP
  51. * forwarding documentation for more information.
  52. *
  53. * @var bool
  54. */
  55. public $canIpForward;
  56. /**
  57. * Whether the instance created from this machine image should be protected
  58. * against deletion.
  59. *
  60. * @var bool
  61. */
  62. public $deletionProtection;
  63. /**
  64. * An optional text description for the instances that are created from this
  65. * machine image.
  66. *
  67. * @var string
  68. */
  69. public $description;
  70. protected $disksType = SavedAttachedDisk::class;
  71. protected $disksDataType = 'array';
  72. protected $guestAcceleratorsType = AcceleratorConfig::class;
  73. protected $guestAcceleratorsDataType = 'array';
  74. /**
  75. * KeyRevocationActionType of the instance. Supported options are "STOP" and
  76. * "NONE". The default value is "NONE" if it is not specified.
  77. *
  78. * @var string
  79. */
  80. public $keyRevocationActionType;
  81. /**
  82. * Labels to apply to instances that are created from this machine image.
  83. *
  84. * @var string[]
  85. */
  86. public $labels;
  87. /**
  88. * The machine type to use for instances that are created from this machine
  89. * image.
  90. *
  91. * @var string
  92. */
  93. public $machineType;
  94. protected $metadataType = Metadata::class;
  95. protected $metadataDataType = '';
  96. /**
  97. * Minimum cpu/platform to be used by instances created from this machine
  98. * image. The instance may be scheduled on the specified or newer
  99. * cpu/platform. Applicable values are the friendly names of CPU platforms,
  100. * such as minCpuPlatform: "Intel Haswell" orminCpuPlatform: "Intel Sandy
  101. * Bridge". For more information, read Specifying a Minimum CPU Platform.
  102. *
  103. * @var string
  104. */
  105. public $minCpuPlatform;
  106. protected $networkInterfacesType = NetworkInterface::class;
  107. protected $networkInterfacesDataType = 'array';
  108. /**
  109. * PostKeyRevocationActionType of the instance.
  110. *
  111. * @var string
  112. */
  113. public $postKeyRevocationActionType;
  114. protected $schedulingType = Scheduling::class;
  115. protected $schedulingDataType = '';
  116. protected $serviceAccountsType = ServiceAccount::class;
  117. protected $serviceAccountsDataType = 'array';
  118. protected $tagsType = Tags::class;
  119. protected $tagsDataType = '';
  120. /**
  121. * Enables instances created based on this machine image to send packets with
  122. * source IP addresses other than their own and receive packets with
  123. * destination IP addresses other than their own. If these instances will be
  124. * used as an IP gateway or it will be set as the next-hop in a Route
  125. * resource, specify true. If unsure, leave this set tofalse. See theEnable IP
  126. * forwarding documentation for more information.
  127. *
  128. * @param bool $canIpForward
  129. */
  130. public function setCanIpForward($canIpForward)
  131. {
  132. $this->canIpForward = $canIpForward;
  133. }
  134. /**
  135. * @return bool
  136. */
  137. public function getCanIpForward()
  138. {
  139. return $this->canIpForward;
  140. }
  141. /**
  142. * Whether the instance created from this machine image should be protected
  143. * against deletion.
  144. *
  145. * @param bool $deletionProtection
  146. */
  147. public function setDeletionProtection($deletionProtection)
  148. {
  149. $this->deletionProtection = $deletionProtection;
  150. }
  151. /**
  152. * @return bool
  153. */
  154. public function getDeletionProtection()
  155. {
  156. return $this->deletionProtection;
  157. }
  158. /**
  159. * An optional text description for the instances that are created from this
  160. * machine image.
  161. *
  162. * @param string $description
  163. */
  164. public function setDescription($description)
  165. {
  166. $this->description = $description;
  167. }
  168. /**
  169. * @return string
  170. */
  171. public function getDescription()
  172. {
  173. return $this->description;
  174. }
  175. /**
  176. * An array of disks that are associated with the instances that are created
  177. * from this machine image.
  178. *
  179. * @param SavedAttachedDisk[] $disks
  180. */
  181. public function setDisks($disks)
  182. {
  183. $this->disks = $disks;
  184. }
  185. /**
  186. * @return SavedAttachedDisk[]
  187. */
  188. public function getDisks()
  189. {
  190. return $this->disks;
  191. }
  192. /**
  193. * A list of guest accelerator cards' type and count to use for instances
  194. * created from this machine image.
  195. *
  196. * @param AcceleratorConfig[] $guestAccelerators
  197. */
  198. public function setGuestAccelerators($guestAccelerators)
  199. {
  200. $this->guestAccelerators = $guestAccelerators;
  201. }
  202. /**
  203. * @return AcceleratorConfig[]
  204. */
  205. public function getGuestAccelerators()
  206. {
  207. return $this->guestAccelerators;
  208. }
  209. /**
  210. * KeyRevocationActionType of the instance. Supported options are "STOP" and
  211. * "NONE". The default value is "NONE" if it is not specified.
  212. *
  213. * Accepted values: KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED, NONE, STOP
  214. *
  215. * @param self::KEY_REVOCATION_ACTION_TYPE_* $keyRevocationActionType
  216. */
  217. public function setKeyRevocationActionType($keyRevocationActionType)
  218. {
  219. $this->keyRevocationActionType = $keyRevocationActionType;
  220. }
  221. /**
  222. * @return self::KEY_REVOCATION_ACTION_TYPE_*
  223. */
  224. public function getKeyRevocationActionType()
  225. {
  226. return $this->keyRevocationActionType;
  227. }
  228. /**
  229. * Labels to apply to instances that are created from this machine image.
  230. *
  231. * @param string[] $labels
  232. */
  233. public function setLabels($labels)
  234. {
  235. $this->labels = $labels;
  236. }
  237. /**
  238. * @return string[]
  239. */
  240. public function getLabels()
  241. {
  242. return $this->labels;
  243. }
  244. /**
  245. * The machine type to use for instances that are created from this machine
  246. * image.
  247. *
  248. * @param string $machineType
  249. */
  250. public function setMachineType($machineType)
  251. {
  252. $this->machineType = $machineType;
  253. }
  254. /**
  255. * @return string
  256. */
  257. public function getMachineType()
  258. {
  259. return $this->machineType;
  260. }
  261. /**
  262. * The metadata key/value pairs to assign to instances that are created from
  263. * this machine image. These pairs can consist of custom metadata or
  264. * predefined keys. SeeProject and instance metadata for more information.
  265. *
  266. * @param Metadata $metadata
  267. */
  268. public function setMetadata(Metadata $metadata)
  269. {
  270. $this->metadata = $metadata;
  271. }
  272. /**
  273. * @return Metadata
  274. */
  275. public function getMetadata()
  276. {
  277. return $this->metadata;
  278. }
  279. /**
  280. * Minimum cpu/platform to be used by instances created from this machine
  281. * image. The instance may be scheduled on the specified or newer
  282. * cpu/platform. Applicable values are the friendly names of CPU platforms,
  283. * such as minCpuPlatform: "Intel Haswell" orminCpuPlatform: "Intel Sandy
  284. * Bridge". For more information, read Specifying a Minimum CPU Platform.
  285. *
  286. * @param string $minCpuPlatform
  287. */
  288. public function setMinCpuPlatform($minCpuPlatform)
  289. {
  290. $this->minCpuPlatform = $minCpuPlatform;
  291. }
  292. /**
  293. * @return string
  294. */
  295. public function getMinCpuPlatform()
  296. {
  297. return $this->minCpuPlatform;
  298. }
  299. /**
  300. * An array of network access configurations for this interface.
  301. *
  302. * @param NetworkInterface[] $networkInterfaces
  303. */
  304. public function setNetworkInterfaces($networkInterfaces)
  305. {
  306. $this->networkInterfaces = $networkInterfaces;
  307. }
  308. /**
  309. * @return NetworkInterface[]
  310. */
  311. public function getNetworkInterfaces()
  312. {
  313. return $this->networkInterfaces;
  314. }
  315. /**
  316. * PostKeyRevocationActionType of the instance.
  317. *
  318. * Accepted values: NOOP, POST_KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED,
  319. * SHUTDOWN
  320. *
  321. * @param self::POST_KEY_REVOCATION_ACTION_TYPE_* $postKeyRevocationActionType
  322. */
  323. public function setPostKeyRevocationActionType($postKeyRevocationActionType)
  324. {
  325. $this->postKeyRevocationActionType = $postKeyRevocationActionType;
  326. }
  327. /**
  328. * @return self::POST_KEY_REVOCATION_ACTION_TYPE_*
  329. */
  330. public function getPostKeyRevocationActionType()
  331. {
  332. return $this->postKeyRevocationActionType;
  333. }
  334. /**
  335. * Specifies the scheduling options for the instances that are created from
  336. * this machine image.
  337. *
  338. * @param Scheduling $scheduling
  339. */
  340. public function setScheduling(Scheduling $scheduling)
  341. {
  342. $this->scheduling = $scheduling;
  343. }
  344. /**
  345. * @return Scheduling
  346. */
  347. public function getScheduling()
  348. {
  349. return $this->scheduling;
  350. }
  351. /**
  352. * A list of service accounts with specified scopes. Access tokens for these
  353. * service accounts are available to the instances that are created from this
  354. * machine image. Use metadata queries to obtain the access tokens for these
  355. * instances.
  356. *
  357. * @param ServiceAccount[] $serviceAccounts
  358. */
  359. public function setServiceAccounts($serviceAccounts)
  360. {
  361. $this->serviceAccounts = $serviceAccounts;
  362. }
  363. /**
  364. * @return ServiceAccount[]
  365. */
  366. public function getServiceAccounts()
  367. {
  368. return $this->serviceAccounts;
  369. }
  370. /**
  371. * A list of tags to apply to the instances that are created from this machine
  372. * image. The tags identify valid sources or targets for network firewalls.
  373. * The setTags method can modify this list of tags. Each tag within the list
  374. * must comply withRFC1035.
  375. *
  376. * @param Tags $tags
  377. */
  378. public function setTags(Tags $tags)
  379. {
  380. $this->tags = $tags;
  381. }
  382. /**
  383. * @return Tags
  384. */
  385. public function getTags()
  386. {
  387. return $this->tags;
  388. }
  389. }
  390. // Adding a class alias for backwards compatibility with the previous class name.
  391. class_alias(SourceInstanceProperties::class, 'Google_Service_Compute_SourceInstanceProperties');