VpnTunnel.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781
  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 VpnTunnel extends \Google\Collection
  19. {
  20. /**
  21. * Cloud VPN is in the process of allocating all required resources
  22. * (specifically, a borg task).
  23. */
  24. public const STATUS_ALLOCATING_RESOURCES = 'ALLOCATING_RESOURCES';
  25. /**
  26. * Auth error (e.g. bad shared secret).
  27. */
  28. public const STATUS_AUTHORIZATION_ERROR = 'AUTHORIZATION_ERROR';
  29. /**
  30. * Resources is being deallocated for the VPN tunnel.
  31. */
  32. public const STATUS_DEPROVISIONING = 'DEPROVISIONING';
  33. /**
  34. * Secure session is successfully established with peer VPN.
  35. */
  36. public const STATUS_ESTABLISHED = 'ESTABLISHED';
  37. /**
  38. * Tunnel creation has failed and the tunnel is not ready to be used.
  39. */
  40. public const STATUS_FAILED = 'FAILED';
  41. /**
  42. * Successful first handshake with peer VPN.
  43. */
  44. public const STATUS_FIRST_HANDSHAKE = 'FIRST_HANDSHAKE';
  45. /**
  46. * Handshake failed.
  47. */
  48. public const STATUS_NEGOTIATION_FAILURE = 'NEGOTIATION_FAILURE';
  49. /**
  50. * Deprecated, replaced by NO_INCOMING_PACKETS
  51. */
  52. public const STATUS_NETWORK_ERROR = 'NETWORK_ERROR';
  53. /**
  54. * No incoming packets from peer
  55. */
  56. public const STATUS_NO_INCOMING_PACKETS = 'NO_INCOMING_PACKETS';
  57. /**
  58. * Resource is being allocated for the VPN tunnel.
  59. */
  60. public const STATUS_PROVISIONING = 'PROVISIONING';
  61. /**
  62. * Tunnel configuration was rejected, can be result of being denylisted.
  63. */
  64. public const STATUS_REJECTED = 'REJECTED';
  65. /**
  66. * Tunnel is stopped due to its Forwarding Rules being deleted.
  67. */
  68. public const STATUS_STOPPED = 'STOPPED';
  69. /**
  70. * Waiting to receive all VPN-related configs from user. Network,
  71. * TargetVpnGateway, VpnTunnel, ForwardingRule and Route resources are needed
  72. * to setup VPN tunnel.
  73. */
  74. public const STATUS_WAITING_FOR_FULL_CONFIG = 'WAITING_FOR_FULL_CONFIG';
  75. protected $collection_key = 'remoteTrafficSelector';
  76. protected $cipherSuiteType = VpnTunnelCipherSuite::class;
  77. protected $cipherSuiteDataType = '';
  78. /**
  79. * Output only. [Output Only] Creation timestamp inRFC3339 text format.
  80. *
  81. * @var string
  82. */
  83. public $creationTimestamp;
  84. /**
  85. * An optional description of this resource. Provide this property when you
  86. * create the resource.
  87. *
  88. * @var string
  89. */
  90. public $description;
  91. /**
  92. * [Output Only] Detailed status message for the VPN tunnel.
  93. *
  94. * @var string
  95. */
  96. public $detailedStatus;
  97. /**
  98. * [Output Only] The unique identifier for the resource. This identifier is
  99. * defined by the server.
  100. *
  101. * @var string
  102. */
  103. public $id;
  104. /**
  105. * IKE protocol version to use when establishing the VPN tunnel with the peer
  106. * VPN gateway. Acceptable IKE versions are 1 or 2. The default version is 2.
  107. *
  108. * @var int
  109. */
  110. public $ikeVersion;
  111. /**
  112. * Output only. [Output Only] Type of resource. Always compute#vpnTunnel for
  113. * VPN tunnels.
  114. *
  115. * @var string
  116. */
  117. public $kind;
  118. /**
  119. * A fingerprint for the labels being applied to this VpnTunnel, which is
  120. * essentially a hash of the labels set used for optimistic locking. The
  121. * fingerprint is initially generated by Compute Engine and changes after
  122. * every request to modify or update labels. You must always provide an up-to-
  123. * date fingerprint hash in order to update or change labels, otherwise the
  124. * request will fail with error412 conditionNotMet.
  125. *
  126. * To see the latest fingerprint, make a get() request to retrieve a
  127. * VpnTunnel.
  128. *
  129. * @var string
  130. */
  131. public $labelFingerprint;
  132. /**
  133. * Labels for this resource. These can only be added or modified by
  134. * thesetLabels method. Each label key/value pair must comply withRFC1035.
  135. * Label values may be empty.
  136. *
  137. * @var string[]
  138. */
  139. public $labels;
  140. /**
  141. * Local traffic selector to use when establishing the VPN tunnel with the
  142. * peer VPN gateway. The value should be a CIDR formatted string, for example:
  143. * 192.168.0.0/16. The ranges must be disjoint. Only IPv4 is supported for
  144. * Classic VPN tunnels. This field is output only for HA VPN tunnels.
  145. *
  146. * @var string[]
  147. */
  148. public $localTrafficSelector;
  149. /**
  150. * Name of the resource. Provided by the client when the resource is created.
  151. * The name must be 1-63 characters long, and comply withRFC1035.
  152. * Specifically, the name must be 1-63 characters long and match the regular
  153. * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character
  154. * must be a lowercase letter, and all following characters must be a dash,
  155. * lowercase letter, or digit, except the last character, which cannot be a
  156. * dash.
  157. *
  158. * @var string
  159. */
  160. public $name;
  161. protected $paramsType = VpnTunnelParams::class;
  162. protected $paramsDataType = '';
  163. /**
  164. * URL of the peer side external VPN gateway to which this VPN tunnel is
  165. * connected. Provided by the client when the VPN tunnel is created. This
  166. * field is exclusive with the field peerGcpGateway.
  167. *
  168. * @var string
  169. */
  170. public $peerExternalGateway;
  171. /**
  172. * The interface ID of the external VPN gateway to which this VPN tunnel is
  173. * connected. Provided by the client when the VPN tunnel is created. Possible
  174. * values are: `0`, `1`, `2`, `3`. The number of IDs in use depends on the
  175. * external VPN gateway redundancy type.
  176. *
  177. * @var int
  178. */
  179. public $peerExternalGatewayInterface;
  180. /**
  181. * URL of the peer side HA VPN gateway to which this VPN tunnel is connected.
  182. * Provided by the client when the VPN tunnel is created. This field can be
  183. * used when creating highly available VPN from VPC network to VPC network,
  184. * the field is exclusive with the field peerExternalGateway. If provided, the
  185. * VPN tunnel will automatically use the same vpnGatewayInterface ID in the
  186. * peer Google Cloud VPN gateway.
  187. *
  188. * @var string
  189. */
  190. public $peerGcpGateway;
  191. /**
  192. * IP address of the peer VPN gateway. Only IPv4 is supported. This field can
  193. * be set only for Classic VPN tunnels.
  194. *
  195. * @var string
  196. */
  197. public $peerIp;
  198. /**
  199. * [Output Only] URL of the region where the VPN tunnel resides. You must
  200. * specify this field as part of the HTTP request URL. It is not settable as a
  201. * field in the request body.
  202. *
  203. * @var string
  204. */
  205. public $region;
  206. /**
  207. * Remote traffic selectors to use when establishing the VPN tunnel with the
  208. * peer VPN gateway. The value should be a CIDR formatted string, for example:
  209. * 192.168.0.0/16. The ranges should be disjoint. Only IPv4 is supported for
  210. * Classic VPN tunnels. This field is output only for HA VPN tunnels.
  211. *
  212. * @var string[]
  213. */
  214. public $remoteTrafficSelector;
  215. /**
  216. * URL of the router resource to be used for dynamic routing.
  217. *
  218. * @var string
  219. */
  220. public $router;
  221. /**
  222. * [Output Only] Server-defined URL for the resource.
  223. *
  224. * @var string
  225. */
  226. public $selfLink;
  227. /**
  228. * Shared secret used to set the secure session between the Cloud VPN gateway
  229. * and the peer VPN gateway.
  230. *
  231. * @var string
  232. */
  233. public $sharedSecret;
  234. /**
  235. * Hash of the shared secret.
  236. *
  237. * @var string
  238. */
  239. public $sharedSecretHash;
  240. /**
  241. * [Output Only] The status of the VPN tunnel, which can be one of the
  242. * following: - PROVISIONING: Resource is being allocated for the VPN
  243. * tunnel. - WAITING_FOR_FULL_CONFIG: Waiting to receive all VPN-related
  244. * configs from the user. Network, TargetVpnGateway, VpnTunnel,
  245. * ForwardingRule, and Route resources are needed to setup the VPN
  246. * tunnel. - FIRST_HANDSHAKE: Successful first handshake with the peer VPN.
  247. * - ESTABLISHED: Secure session is successfully established with the peer
  248. * VPN. - NETWORK_ERROR: Deprecated, replaced by NO_INCOMING_PACKETS
  249. * - AUTHORIZATION_ERROR: Auth error (for example, bad shared secret).
  250. * - NEGOTIATION_FAILURE: Handshake failed. - DEPROVISIONING: Resources are
  251. * being deallocated for the VPN tunnel. - FAILED: Tunnel creation has
  252. * failed and the tunnel is not ready to be used. -
  253. * NO_INCOMING_PACKETS: No incoming packets from peer. - REJECTED:
  254. * Tunnel configuration was rejected, can be result of being denied access.
  255. * - ALLOCATING_RESOURCES: Cloud VPN is in the process of allocating all
  256. * required resources. - STOPPED: Tunnel is stopped due to its Forwarding
  257. * Rules being deleted for Classic VPN tunnels or the project is in frozen
  258. * state. - PEER_IDENTITY_MISMATCH: Peer identity does not match peer IP,
  259. * probably behind NAT. - TS_NARROWING_NOT_ALLOWED: Traffic selector
  260. * narrowing not allowed for an HA-VPN tunnel.
  261. *
  262. * @var string
  263. */
  264. public $status;
  265. /**
  266. * URL of the Target VPN gateway with which this VPN tunnel is associated.
  267. * Provided by the client when the VPN tunnel is created. This field can be
  268. * set only for Classic VPN tunnels.
  269. *
  270. * @var string
  271. */
  272. public $targetVpnGateway;
  273. /**
  274. * URL of the VPN gateway with which this VPN tunnel is associated. Provided
  275. * by the client when the VPN tunnel is created. This must be used (instead of
  276. * target_vpn_gateway) if a High Availability VPN gateway resource is created.
  277. *
  278. * @var string
  279. */
  280. public $vpnGateway;
  281. /**
  282. * The interface ID of the VPN gateway with which this VPN tunnel is
  283. * associated. Possible values are: `0`, `1`.
  284. *
  285. * @var int
  286. */
  287. public $vpnGatewayInterface;
  288. /**
  289. * User specified list of ciphers to use for the phase 1 and phase 2 of the
  290. * IKE protocol.
  291. *
  292. * @param VpnTunnelCipherSuite $cipherSuite
  293. */
  294. public function setCipherSuite(VpnTunnelCipherSuite $cipherSuite)
  295. {
  296. $this->cipherSuite = $cipherSuite;
  297. }
  298. /**
  299. * @return VpnTunnelCipherSuite
  300. */
  301. public function getCipherSuite()
  302. {
  303. return $this->cipherSuite;
  304. }
  305. /**
  306. * Output only. [Output Only] Creation timestamp inRFC3339 text format.
  307. *
  308. * @param string $creationTimestamp
  309. */
  310. public function setCreationTimestamp($creationTimestamp)
  311. {
  312. $this->creationTimestamp = $creationTimestamp;
  313. }
  314. /**
  315. * @return string
  316. */
  317. public function getCreationTimestamp()
  318. {
  319. return $this->creationTimestamp;
  320. }
  321. /**
  322. * An optional description of this resource. Provide this property when you
  323. * create the resource.
  324. *
  325. * @param string $description
  326. */
  327. public function setDescription($description)
  328. {
  329. $this->description = $description;
  330. }
  331. /**
  332. * @return string
  333. */
  334. public function getDescription()
  335. {
  336. return $this->description;
  337. }
  338. /**
  339. * [Output Only] Detailed status message for the VPN tunnel.
  340. *
  341. * @param string $detailedStatus
  342. */
  343. public function setDetailedStatus($detailedStatus)
  344. {
  345. $this->detailedStatus = $detailedStatus;
  346. }
  347. /**
  348. * @return string
  349. */
  350. public function getDetailedStatus()
  351. {
  352. return $this->detailedStatus;
  353. }
  354. /**
  355. * [Output Only] The unique identifier for the resource. This identifier is
  356. * defined by the server.
  357. *
  358. * @param string $id
  359. */
  360. public function setId($id)
  361. {
  362. $this->id = $id;
  363. }
  364. /**
  365. * @return string
  366. */
  367. public function getId()
  368. {
  369. return $this->id;
  370. }
  371. /**
  372. * IKE protocol version to use when establishing the VPN tunnel with the peer
  373. * VPN gateway. Acceptable IKE versions are 1 or 2. The default version is 2.
  374. *
  375. * @param int $ikeVersion
  376. */
  377. public function setIkeVersion($ikeVersion)
  378. {
  379. $this->ikeVersion = $ikeVersion;
  380. }
  381. /**
  382. * @return int
  383. */
  384. public function getIkeVersion()
  385. {
  386. return $this->ikeVersion;
  387. }
  388. /**
  389. * Output only. [Output Only] Type of resource. Always compute#vpnTunnel for
  390. * VPN tunnels.
  391. *
  392. * @param string $kind
  393. */
  394. public function setKind($kind)
  395. {
  396. $this->kind = $kind;
  397. }
  398. /**
  399. * @return string
  400. */
  401. public function getKind()
  402. {
  403. return $this->kind;
  404. }
  405. /**
  406. * A fingerprint for the labels being applied to this VpnTunnel, which is
  407. * essentially a hash of the labels set used for optimistic locking. The
  408. * fingerprint is initially generated by Compute Engine and changes after
  409. * every request to modify or update labels. You must always provide an up-to-
  410. * date fingerprint hash in order to update or change labels, otherwise the
  411. * request will fail with error412 conditionNotMet.
  412. *
  413. * To see the latest fingerprint, make a get() request to retrieve a
  414. * VpnTunnel.
  415. *
  416. * @param string $labelFingerprint
  417. */
  418. public function setLabelFingerprint($labelFingerprint)
  419. {
  420. $this->labelFingerprint = $labelFingerprint;
  421. }
  422. /**
  423. * @return string
  424. */
  425. public function getLabelFingerprint()
  426. {
  427. return $this->labelFingerprint;
  428. }
  429. /**
  430. * Labels for this resource. These can only be added or modified by
  431. * thesetLabels method. Each label key/value pair must comply withRFC1035.
  432. * Label values may be empty.
  433. *
  434. * @param string[] $labels
  435. */
  436. public function setLabels($labels)
  437. {
  438. $this->labels = $labels;
  439. }
  440. /**
  441. * @return string[]
  442. */
  443. public function getLabels()
  444. {
  445. return $this->labels;
  446. }
  447. /**
  448. * Local traffic selector to use when establishing the VPN tunnel with the
  449. * peer VPN gateway. The value should be a CIDR formatted string, for example:
  450. * 192.168.0.0/16. The ranges must be disjoint. Only IPv4 is supported for
  451. * Classic VPN tunnels. This field is output only for HA VPN tunnels.
  452. *
  453. * @param string[] $localTrafficSelector
  454. */
  455. public function setLocalTrafficSelector($localTrafficSelector)
  456. {
  457. $this->localTrafficSelector = $localTrafficSelector;
  458. }
  459. /**
  460. * @return string[]
  461. */
  462. public function getLocalTrafficSelector()
  463. {
  464. return $this->localTrafficSelector;
  465. }
  466. /**
  467. * Name of the resource. Provided by the client when the resource is created.
  468. * The name must be 1-63 characters long, and comply withRFC1035.
  469. * Specifically, the name must be 1-63 characters long and match the regular
  470. * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character
  471. * must be a lowercase letter, and all following characters must be a dash,
  472. * lowercase letter, or digit, except the last character, which cannot be a
  473. * dash.
  474. *
  475. * @param string $name
  476. */
  477. public function setName($name)
  478. {
  479. $this->name = $name;
  480. }
  481. /**
  482. * @return string
  483. */
  484. public function getName()
  485. {
  486. return $this->name;
  487. }
  488. /**
  489. * Input only. [Input Only] Additional params passed with the request, but not
  490. * persisted as part of resource payload.
  491. *
  492. * @param VpnTunnelParams $params
  493. */
  494. public function setParams(VpnTunnelParams $params)
  495. {
  496. $this->params = $params;
  497. }
  498. /**
  499. * @return VpnTunnelParams
  500. */
  501. public function getParams()
  502. {
  503. return $this->params;
  504. }
  505. /**
  506. * URL of the peer side external VPN gateway to which this VPN tunnel is
  507. * connected. Provided by the client when the VPN tunnel is created. This
  508. * field is exclusive with the field peerGcpGateway.
  509. *
  510. * @param string $peerExternalGateway
  511. */
  512. public function setPeerExternalGateway($peerExternalGateway)
  513. {
  514. $this->peerExternalGateway = $peerExternalGateway;
  515. }
  516. /**
  517. * @return string
  518. */
  519. public function getPeerExternalGateway()
  520. {
  521. return $this->peerExternalGateway;
  522. }
  523. /**
  524. * The interface ID of the external VPN gateway to which this VPN tunnel is
  525. * connected. Provided by the client when the VPN tunnel is created. Possible
  526. * values are: `0`, `1`, `2`, `3`. The number of IDs in use depends on the
  527. * external VPN gateway redundancy type.
  528. *
  529. * @param int $peerExternalGatewayInterface
  530. */
  531. public function setPeerExternalGatewayInterface($peerExternalGatewayInterface)
  532. {
  533. $this->peerExternalGatewayInterface = $peerExternalGatewayInterface;
  534. }
  535. /**
  536. * @return int
  537. */
  538. public function getPeerExternalGatewayInterface()
  539. {
  540. return $this->peerExternalGatewayInterface;
  541. }
  542. /**
  543. * URL of the peer side HA VPN gateway to which this VPN tunnel is connected.
  544. * Provided by the client when the VPN tunnel is created. This field can be
  545. * used when creating highly available VPN from VPC network to VPC network,
  546. * the field is exclusive with the field peerExternalGateway. If provided, the
  547. * VPN tunnel will automatically use the same vpnGatewayInterface ID in the
  548. * peer Google Cloud VPN gateway.
  549. *
  550. * @param string $peerGcpGateway
  551. */
  552. public function setPeerGcpGateway($peerGcpGateway)
  553. {
  554. $this->peerGcpGateway = $peerGcpGateway;
  555. }
  556. /**
  557. * @return string
  558. */
  559. public function getPeerGcpGateway()
  560. {
  561. return $this->peerGcpGateway;
  562. }
  563. /**
  564. * IP address of the peer VPN gateway. Only IPv4 is supported. This field can
  565. * be set only for Classic VPN tunnels.
  566. *
  567. * @param string $peerIp
  568. */
  569. public function setPeerIp($peerIp)
  570. {
  571. $this->peerIp = $peerIp;
  572. }
  573. /**
  574. * @return string
  575. */
  576. public function getPeerIp()
  577. {
  578. return $this->peerIp;
  579. }
  580. /**
  581. * [Output Only] URL of the region where the VPN tunnel resides. You must
  582. * specify this field as part of the HTTP request URL. It is not settable as a
  583. * field in the request body.
  584. *
  585. * @param string $region
  586. */
  587. public function setRegion($region)
  588. {
  589. $this->region = $region;
  590. }
  591. /**
  592. * @return string
  593. */
  594. public function getRegion()
  595. {
  596. return $this->region;
  597. }
  598. /**
  599. * Remote traffic selectors to use when establishing the VPN tunnel with the
  600. * peer VPN gateway. The value should be a CIDR formatted string, for example:
  601. * 192.168.0.0/16. The ranges should be disjoint. Only IPv4 is supported for
  602. * Classic VPN tunnels. This field is output only for HA VPN tunnels.
  603. *
  604. * @param string[] $remoteTrafficSelector
  605. */
  606. public function setRemoteTrafficSelector($remoteTrafficSelector)
  607. {
  608. $this->remoteTrafficSelector = $remoteTrafficSelector;
  609. }
  610. /**
  611. * @return string[]
  612. */
  613. public function getRemoteTrafficSelector()
  614. {
  615. return $this->remoteTrafficSelector;
  616. }
  617. /**
  618. * URL of the router resource to be used for dynamic routing.
  619. *
  620. * @param string $router
  621. */
  622. public function setRouter($router)
  623. {
  624. $this->router = $router;
  625. }
  626. /**
  627. * @return string
  628. */
  629. public function getRouter()
  630. {
  631. return $this->router;
  632. }
  633. /**
  634. * [Output Only] Server-defined URL for the resource.
  635. *
  636. * @param string $selfLink
  637. */
  638. public function setSelfLink($selfLink)
  639. {
  640. $this->selfLink = $selfLink;
  641. }
  642. /**
  643. * @return string
  644. */
  645. public function getSelfLink()
  646. {
  647. return $this->selfLink;
  648. }
  649. /**
  650. * Shared secret used to set the secure session between the Cloud VPN gateway
  651. * and the peer VPN gateway.
  652. *
  653. * @param string $sharedSecret
  654. */
  655. public function setSharedSecret($sharedSecret)
  656. {
  657. $this->sharedSecret = $sharedSecret;
  658. }
  659. /**
  660. * @return string
  661. */
  662. public function getSharedSecret()
  663. {
  664. return $this->sharedSecret;
  665. }
  666. /**
  667. * Hash of the shared secret.
  668. *
  669. * @param string $sharedSecretHash
  670. */
  671. public function setSharedSecretHash($sharedSecretHash)
  672. {
  673. $this->sharedSecretHash = $sharedSecretHash;
  674. }
  675. /**
  676. * @return string
  677. */
  678. public function getSharedSecretHash()
  679. {
  680. return $this->sharedSecretHash;
  681. }
  682. /**
  683. * [Output Only] The status of the VPN tunnel, which can be one of the
  684. * following: - PROVISIONING: Resource is being allocated for the VPN
  685. * tunnel. - WAITING_FOR_FULL_CONFIG: Waiting to receive all VPN-related
  686. * configs from the user. Network, TargetVpnGateway, VpnTunnel,
  687. * ForwardingRule, and Route resources are needed to setup the VPN
  688. * tunnel. - FIRST_HANDSHAKE: Successful first handshake with the peer VPN.
  689. * - ESTABLISHED: Secure session is successfully established with the peer
  690. * VPN. - NETWORK_ERROR: Deprecated, replaced by NO_INCOMING_PACKETS
  691. * - AUTHORIZATION_ERROR: Auth error (for example, bad shared secret).
  692. * - NEGOTIATION_FAILURE: Handshake failed. - DEPROVISIONING: Resources are
  693. * being deallocated for the VPN tunnel. - FAILED: Tunnel creation has
  694. * failed and the tunnel is not ready to be used. -
  695. * NO_INCOMING_PACKETS: No incoming packets from peer. - REJECTED:
  696. * Tunnel configuration was rejected, can be result of being denied access.
  697. * - ALLOCATING_RESOURCES: Cloud VPN is in the process of allocating all
  698. * required resources. - STOPPED: Tunnel is stopped due to its Forwarding
  699. * Rules being deleted for Classic VPN tunnels or the project is in frozen
  700. * state. - PEER_IDENTITY_MISMATCH: Peer identity does not match peer IP,
  701. * probably behind NAT. - TS_NARROWING_NOT_ALLOWED: Traffic selector
  702. * narrowing not allowed for an HA-VPN tunnel.
  703. *
  704. * Accepted values: ALLOCATING_RESOURCES, AUTHORIZATION_ERROR, DEPROVISIONING,
  705. * ESTABLISHED, FAILED, FIRST_HANDSHAKE, NEGOTIATION_FAILURE, NETWORK_ERROR,
  706. * NO_INCOMING_PACKETS, PROVISIONING, REJECTED, STOPPED,
  707. * WAITING_FOR_FULL_CONFIG
  708. *
  709. * @param self::STATUS_* $status
  710. */
  711. public function setStatus($status)
  712. {
  713. $this->status = $status;
  714. }
  715. /**
  716. * @return self::STATUS_*
  717. */
  718. public function getStatus()
  719. {
  720. return $this->status;
  721. }
  722. /**
  723. * URL of the Target VPN gateway with which this VPN tunnel is associated.
  724. * Provided by the client when the VPN tunnel is created. This field can be
  725. * set only for Classic VPN tunnels.
  726. *
  727. * @param string $targetVpnGateway
  728. */
  729. public function setTargetVpnGateway($targetVpnGateway)
  730. {
  731. $this->targetVpnGateway = $targetVpnGateway;
  732. }
  733. /**
  734. * @return string
  735. */
  736. public function getTargetVpnGateway()
  737. {
  738. return $this->targetVpnGateway;
  739. }
  740. /**
  741. * URL of the VPN gateway with which this VPN tunnel is associated. Provided
  742. * by the client when the VPN tunnel is created. This must be used (instead of
  743. * target_vpn_gateway) if a High Availability VPN gateway resource is created.
  744. *
  745. * @param string $vpnGateway
  746. */
  747. public function setVpnGateway($vpnGateway)
  748. {
  749. $this->vpnGateway = $vpnGateway;
  750. }
  751. /**
  752. * @return string
  753. */
  754. public function getVpnGateway()
  755. {
  756. return $this->vpnGateway;
  757. }
  758. /**
  759. * The interface ID of the VPN gateway with which this VPN tunnel is
  760. * associated. Possible values are: `0`, `1`.
  761. *
  762. * @param int $vpnGatewayInterface
  763. */
  764. public function setVpnGatewayInterface($vpnGatewayInterface)
  765. {
  766. $this->vpnGatewayInterface = $vpnGatewayInterface;
  767. }
  768. /**
  769. * @return int
  770. */
  771. public function getVpnGatewayInterface()
  772. {
  773. return $this->vpnGatewayInterface;
  774. }
  775. }
  776. // Adding a class alias for backwards compatibility with the previous class name.
  777. class_alias(VpnTunnel::class, 'Google_Service_Compute_VpnTunnel');