MachineImage.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542
  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 MachineImage extends \Google\Collection
  19. {
  20. public const STATUS_CREATING = 'CREATING';
  21. public const STATUS_DELETING = 'DELETING';
  22. public const STATUS_INVALID = 'INVALID';
  23. public const STATUS_READY = 'READY';
  24. public const STATUS_UPLOADING = 'UPLOADING';
  25. protected $collection_key = 'storageLocations';
  26. /**
  27. * Output only. [Output Only] The creation timestamp for this machine image
  28. * inRFC3339 text format.
  29. *
  30. * @var string
  31. */
  32. public $creationTimestamp;
  33. /**
  34. * An optional description of this resource. Provide this property when you
  35. * create the resource.
  36. *
  37. * @var string
  38. */
  39. public $description;
  40. /**
  41. * [Input Only] Whether to attempt an application consistent machine image by
  42. * informing the OS to prepare for the snapshot process.
  43. *
  44. * @var bool
  45. */
  46. public $guestFlush;
  47. /**
  48. * Output only. [Output Only] A unique identifier for this machine image. The
  49. * server defines this identifier.
  50. *
  51. * @var string
  52. */
  53. public $id;
  54. protected $instancePropertiesType = InstanceProperties::class;
  55. protected $instancePropertiesDataType = '';
  56. /**
  57. * Output only. [Output Only] The resource type, which is
  58. * alwayscompute#machineImage for machine image.
  59. *
  60. * @var string
  61. */
  62. public $kind;
  63. /**
  64. * A fingerprint for the labels being applied to this machine image, which is
  65. * essentially a hash of the labels set used for optimistic locking. The
  66. * fingerprint is initially generated by Compute Engine and changes after
  67. * every request to modify or update labels. You must always provide an up-to-
  68. * date fingerprint hash in order to update or change labels.
  69. *
  70. * To see the latest fingerprint, make get() request to the machine image.
  71. *
  72. * @var string
  73. */
  74. public $labelFingerprint;
  75. /**
  76. * Labels to apply to this machine image. These can be later modified by the
  77. * setLabels method.
  78. *
  79. * @var string[]
  80. */
  81. public $labels;
  82. protected $machineImageEncryptionKeyType = CustomerEncryptionKey::class;
  83. protected $machineImageEncryptionKeyDataType = '';
  84. /**
  85. * Name of the resource; provided by the client when the resource is created.
  86. * The name must be 1-63 characters long, and comply withRFC1035.
  87. * Specifically, the name must be 1-63 characters long and match the regular
  88. * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character
  89. * must be a lowercase letter, and all following characters must be a dash,
  90. * lowercase letter, or digit, except the last character, which cannot be a
  91. * dash.
  92. *
  93. * @var string
  94. */
  95. public $name;
  96. protected $paramsType = MachineImageParams::class;
  97. protected $paramsDataType = '';
  98. /**
  99. * Output only. Reserved for future use.
  100. *
  101. * @var bool
  102. */
  103. public $satisfiesPzi;
  104. /**
  105. * Output only. [Output Only] Reserved for future use.
  106. *
  107. * @var bool
  108. */
  109. public $satisfiesPzs;
  110. protected $savedDisksType = SavedDisk::class;
  111. protected $savedDisksDataType = 'array';
  112. /**
  113. * Output only. [Output Only] The URL for this machine image. The server
  114. * defines this URL.
  115. *
  116. * @var string
  117. */
  118. public $selfLink;
  119. protected $sourceDiskEncryptionKeysType = SourceDiskEncryptionKey::class;
  120. protected $sourceDiskEncryptionKeysDataType = 'array';
  121. /**
  122. * The source instance used to create the machine image. You can provide this
  123. * as a partial or full URL to the resource. For example, the following are
  124. * valid values: - https://www.googleapis.com/compute/v1/project
  125. * s/project/zones/zone/instances/instance -
  126. * projects/project/zones/zone/instances/instance
  127. *
  128. * @var string
  129. */
  130. public $sourceInstance;
  131. protected $sourceInstancePropertiesType = SourceInstanceProperties::class;
  132. protected $sourceInstancePropertiesDataType = '';
  133. /**
  134. * Output only. [Output Only] The status of the machine image. One of the
  135. * following values:INVALID, CREATING, READY,DELETING, and UPLOADING.
  136. *
  137. * @var string
  138. */
  139. public $status;
  140. /**
  141. * The regional or multi-regional Cloud Storage bucket location where
  142. * themachine image is stored.
  143. *
  144. * @var string[]
  145. */
  146. public $storageLocations;
  147. /**
  148. * Output only. [Output Only] Total size of the storage used by the machine
  149. * image.
  150. *
  151. * @var string
  152. */
  153. public $totalStorageBytes;
  154. /**
  155. * Output only. [Output Only] The creation timestamp for this machine image
  156. * inRFC3339 text format.
  157. *
  158. * @param string $creationTimestamp
  159. */
  160. public function setCreationTimestamp($creationTimestamp)
  161. {
  162. $this->creationTimestamp = $creationTimestamp;
  163. }
  164. /**
  165. * @return string
  166. */
  167. public function getCreationTimestamp()
  168. {
  169. return $this->creationTimestamp;
  170. }
  171. /**
  172. * An optional description of this resource. Provide this property when you
  173. * create the resource.
  174. *
  175. * @param string $description
  176. */
  177. public function setDescription($description)
  178. {
  179. $this->description = $description;
  180. }
  181. /**
  182. * @return string
  183. */
  184. public function getDescription()
  185. {
  186. return $this->description;
  187. }
  188. /**
  189. * [Input Only] Whether to attempt an application consistent machine image by
  190. * informing the OS to prepare for the snapshot process.
  191. *
  192. * @param bool $guestFlush
  193. */
  194. public function setGuestFlush($guestFlush)
  195. {
  196. $this->guestFlush = $guestFlush;
  197. }
  198. /**
  199. * @return bool
  200. */
  201. public function getGuestFlush()
  202. {
  203. return $this->guestFlush;
  204. }
  205. /**
  206. * Output only. [Output Only] A unique identifier for this machine image. The
  207. * server defines this identifier.
  208. *
  209. * @param string $id
  210. */
  211. public function setId($id)
  212. {
  213. $this->id = $id;
  214. }
  215. /**
  216. * @return string
  217. */
  218. public function getId()
  219. {
  220. return $this->id;
  221. }
  222. /**
  223. * [Output Only] Properties of source instance
  224. *
  225. * @param InstanceProperties $instanceProperties
  226. */
  227. public function setInstanceProperties(InstanceProperties $instanceProperties)
  228. {
  229. $this->instanceProperties = $instanceProperties;
  230. }
  231. /**
  232. * @return InstanceProperties
  233. */
  234. public function getInstanceProperties()
  235. {
  236. return $this->instanceProperties;
  237. }
  238. /**
  239. * Output only. [Output Only] The resource type, which is
  240. * alwayscompute#machineImage for machine image.
  241. *
  242. * @param string $kind
  243. */
  244. public function setKind($kind)
  245. {
  246. $this->kind = $kind;
  247. }
  248. /**
  249. * @return string
  250. */
  251. public function getKind()
  252. {
  253. return $this->kind;
  254. }
  255. /**
  256. * A fingerprint for the labels being applied to this machine image, which is
  257. * essentially a hash of the labels set used for optimistic locking. The
  258. * fingerprint is initially generated by Compute Engine and changes after
  259. * every request to modify or update labels. You must always provide an up-to-
  260. * date fingerprint hash in order to update or change labels.
  261. *
  262. * To see the latest fingerprint, make get() request to the machine image.
  263. *
  264. * @param string $labelFingerprint
  265. */
  266. public function setLabelFingerprint($labelFingerprint)
  267. {
  268. $this->labelFingerprint = $labelFingerprint;
  269. }
  270. /**
  271. * @return string
  272. */
  273. public function getLabelFingerprint()
  274. {
  275. return $this->labelFingerprint;
  276. }
  277. /**
  278. * Labels to apply to this machine image. These can be later modified by the
  279. * setLabels method.
  280. *
  281. * @param string[] $labels
  282. */
  283. public function setLabels($labels)
  284. {
  285. $this->labels = $labels;
  286. }
  287. /**
  288. * @return string[]
  289. */
  290. public function getLabels()
  291. {
  292. return $this->labels;
  293. }
  294. /**
  295. * Encrypts the machine image using acustomer-supplied encryption key.
  296. *
  297. * After you encrypt a machine image using a customer-supplied key, you must
  298. * provide the same key if you use the machine image later. For example, you
  299. * must provide the encryption key when you create an instance from the
  300. * encrypted machine image in a future request.
  301. *
  302. * Customer-supplied encryption keys do not protect access to metadata of the
  303. * machine image.
  304. *
  305. * If you do not provide an encryption key when creating the machine image,
  306. * then the machine image will be encrypted using an automatically generated
  307. * key and you do not need to provide a key to use the machine image later.
  308. *
  309. * @param CustomerEncryptionKey $machineImageEncryptionKey
  310. */
  311. public function setMachineImageEncryptionKey(CustomerEncryptionKey $machineImageEncryptionKey)
  312. {
  313. $this->machineImageEncryptionKey = $machineImageEncryptionKey;
  314. }
  315. /**
  316. * @return CustomerEncryptionKey
  317. */
  318. public function getMachineImageEncryptionKey()
  319. {
  320. return $this->machineImageEncryptionKey;
  321. }
  322. /**
  323. * Name of the resource; provided by the client when the resource is created.
  324. * The name must be 1-63 characters long, and comply withRFC1035.
  325. * Specifically, the name must be 1-63 characters long and match the regular
  326. * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character
  327. * must be a lowercase letter, and all following characters must be a dash,
  328. * lowercase letter, or digit, except the last character, which cannot be a
  329. * dash.
  330. *
  331. * @param string $name
  332. */
  333. public function setName($name)
  334. {
  335. $this->name = $name;
  336. }
  337. /**
  338. * @return string
  339. */
  340. public function getName()
  341. {
  342. return $this->name;
  343. }
  344. /**
  345. * Input only. [Input Only] Additional parameters that are passed in the
  346. * request, but are not persisted in the resource.
  347. *
  348. * @param MachineImageParams $params
  349. */
  350. public function setParams(MachineImageParams $params)
  351. {
  352. $this->params = $params;
  353. }
  354. /**
  355. * @return MachineImageParams
  356. */
  357. public function getParams()
  358. {
  359. return $this->params;
  360. }
  361. /**
  362. * Output only. Reserved for future use.
  363. *
  364. * @param bool $satisfiesPzi
  365. */
  366. public function setSatisfiesPzi($satisfiesPzi)
  367. {
  368. $this->satisfiesPzi = $satisfiesPzi;
  369. }
  370. /**
  371. * @return bool
  372. */
  373. public function getSatisfiesPzi()
  374. {
  375. return $this->satisfiesPzi;
  376. }
  377. /**
  378. * Output only. [Output Only] Reserved for future use.
  379. *
  380. * @param bool $satisfiesPzs
  381. */
  382. public function setSatisfiesPzs($satisfiesPzs)
  383. {
  384. $this->satisfiesPzs = $satisfiesPzs;
  385. }
  386. /**
  387. * @return bool
  388. */
  389. public function getSatisfiesPzs()
  390. {
  391. return $this->satisfiesPzs;
  392. }
  393. /**
  394. * Output only. An array of Machine Image specific properties for disks
  395. * attached to the source instance
  396. *
  397. * @param SavedDisk[] $savedDisks
  398. */
  399. public function setSavedDisks($savedDisks)
  400. {
  401. $this->savedDisks = $savedDisks;
  402. }
  403. /**
  404. * @return SavedDisk[]
  405. */
  406. public function getSavedDisks()
  407. {
  408. return $this->savedDisks;
  409. }
  410. /**
  411. * Output only. [Output Only] The URL for this machine image. The server
  412. * defines this URL.
  413. *
  414. * @param string $selfLink
  415. */
  416. public function setSelfLink($selfLink)
  417. {
  418. $this->selfLink = $selfLink;
  419. }
  420. /**
  421. * @return string
  422. */
  423. public function getSelfLink()
  424. {
  425. return $this->selfLink;
  426. }
  427. /**
  428. * [Input Only] Thecustomer-supplied encryption key of the disks attached to
  429. * the source instance. Required if the source disk is protected by a
  430. * customer-supplied encryption key.
  431. *
  432. * @param SourceDiskEncryptionKey[] $sourceDiskEncryptionKeys
  433. */
  434. public function setSourceDiskEncryptionKeys($sourceDiskEncryptionKeys)
  435. {
  436. $this->sourceDiskEncryptionKeys = $sourceDiskEncryptionKeys;
  437. }
  438. /**
  439. * @return SourceDiskEncryptionKey[]
  440. */
  441. public function getSourceDiskEncryptionKeys()
  442. {
  443. return $this->sourceDiskEncryptionKeys;
  444. }
  445. /**
  446. * The source instance used to create the machine image. You can provide this
  447. * as a partial or full URL to the resource. For example, the following are
  448. * valid values: - https://www.googleapis.com/compute/v1/project
  449. * s/project/zones/zone/instances/instance -
  450. * projects/project/zones/zone/instances/instance
  451. *
  452. * @param string $sourceInstance
  453. */
  454. public function setSourceInstance($sourceInstance)
  455. {
  456. $this->sourceInstance = $sourceInstance;
  457. }
  458. /**
  459. * @return string
  460. */
  461. public function getSourceInstance()
  462. {
  463. return $this->sourceInstance;
  464. }
  465. /**
  466. * Output only. [Output Only] DEPRECATED: Please use instance_properties
  467. * instead for source instance related properties. New properties will not be
  468. * added to this field.
  469. *
  470. * @param SourceInstanceProperties $sourceInstanceProperties
  471. */
  472. public function setSourceInstanceProperties(SourceInstanceProperties $sourceInstanceProperties)
  473. {
  474. $this->sourceInstanceProperties = $sourceInstanceProperties;
  475. }
  476. /**
  477. * @return SourceInstanceProperties
  478. */
  479. public function getSourceInstanceProperties()
  480. {
  481. return $this->sourceInstanceProperties;
  482. }
  483. /**
  484. * Output only. [Output Only] The status of the machine image. One of the
  485. * following values:INVALID, CREATING, READY,DELETING, and UPLOADING.
  486. *
  487. * Accepted values: CREATING, DELETING, INVALID, READY, UPLOADING
  488. *
  489. * @param self::STATUS_* $status
  490. */
  491. public function setStatus($status)
  492. {
  493. $this->status = $status;
  494. }
  495. /**
  496. * @return self::STATUS_*
  497. */
  498. public function getStatus()
  499. {
  500. return $this->status;
  501. }
  502. /**
  503. * The regional or multi-regional Cloud Storage bucket location where
  504. * themachine image is stored.
  505. *
  506. * @param string[] $storageLocations
  507. */
  508. public function setStorageLocations($storageLocations)
  509. {
  510. $this->storageLocations = $storageLocations;
  511. }
  512. /**
  513. * @return string[]
  514. */
  515. public function getStorageLocations()
  516. {
  517. return $this->storageLocations;
  518. }
  519. /**
  520. * Output only. [Output Only] Total size of the storage used by the machine
  521. * image.
  522. *
  523. * @param string $totalStorageBytes
  524. */
  525. public function setTotalStorageBytes($totalStorageBytes)
  526. {
  527. $this->totalStorageBytes = $totalStorageBytes;
  528. }
  529. /**
  530. * @return string
  531. */
  532. public function getTotalStorageBytes()
  533. {
  534. return $this->totalStorageBytes;
  535. }
  536. }
  537. // Adding a class alias for backwards compatibility with the previous class name.
  538. class_alias(MachineImage::class, 'Google_Service_Compute_MachineImage');