RouterBgpPeer.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654
  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 RouterBgpPeer extends \Google\Collection
  19. {
  20. public const ADVERTISE_MODE_CUSTOM = 'CUSTOM';
  21. public const ADVERTISE_MODE_DEFAULT = 'DEFAULT';
  22. public const ENABLE_FALSE = 'FALSE';
  23. public const ENABLE_TRUE = 'TRUE';
  24. /**
  25. * The BGP peer is automatically created for PARTNER type
  26. * InterconnectAttachment; Google will automatically create/delete this BGP
  27. * peer when the PARTNER InterconnectAttachment is created/deleted, and Google
  28. * will update the ipAddress and peerIpAddress when the PARTNER
  29. * InterconnectAttachment is provisioned. This type of BGP peer cannot be
  30. * created or deleted, but can be modified for all fields except for name,
  31. * ipAddress and peerIpAddress.
  32. */
  33. public const MANAGEMENT_TYPE_MANAGED_BY_ATTACHMENT = 'MANAGED_BY_ATTACHMENT';
  34. /**
  35. * Default value, the BGP peer is manually created and managed by user.
  36. */
  37. public const MANAGEMENT_TYPE_MANAGED_BY_USER = 'MANAGED_BY_USER';
  38. protected $collection_key = 'importPolicies';
  39. /**
  40. * User-specified flag to indicate which mode to use for advertisement.
  41. *
  42. * @var string
  43. */
  44. public $advertiseMode;
  45. /**
  46. * User-specified list of prefix groups to advertise in custom mode, which
  47. * currently supports the following option: - ALL_SUBNETS: Advertises
  48. * all of the router's own VPC subnets. This excludes any routes learned
  49. * for subnets that use VPC Network Peering.
  50. *
  51. * Note that this field can only be populated if advertise_mode is CUSTOM and
  52. * overrides the list defined for the router (in the "bgp" message). These
  53. * groups are advertised in addition to any specified prefixes. Leave this
  54. * field blank to advertise no custom groups.
  55. *
  56. * @var string[]
  57. */
  58. public $advertisedGroups;
  59. protected $advertisedIpRangesType = RouterAdvertisedIpRange::class;
  60. protected $advertisedIpRangesDataType = 'array';
  61. /**
  62. * The priority of routes advertised to this BGP peer. Where there is more
  63. * than one matching route of maximum length, the routes with the lowest
  64. * priority value win.
  65. *
  66. * @var string
  67. */
  68. public $advertisedRoutePriority;
  69. protected $bfdType = RouterBgpPeerBfd::class;
  70. protected $bfdDataType = '';
  71. protected $customLearnedIpRangesType = RouterBgpPeerCustomLearnedIpRange::class;
  72. protected $customLearnedIpRangesDataType = 'array';
  73. /**
  74. * The user-defined custom learned route priority for a BGP session. This
  75. * value is applied to all custom learned route ranges for the session. You
  76. * can choose a value from `0` to `65335`. If you don't provide a value,
  77. * Google Cloud assigns a priority of `100` to the ranges.
  78. *
  79. * @var int
  80. */
  81. public $customLearnedRoutePriority;
  82. /**
  83. * The status of the BGP peer connection.
  84. *
  85. * If set to FALSE, any active session with the peer is terminated and all
  86. * associated routing information is removed. If set to TRUE, the peer
  87. * connection can be established with routing information. The default is
  88. * TRUE.
  89. *
  90. * @var string
  91. */
  92. public $enable;
  93. /**
  94. * Enable IPv4 traffic over BGP Peer. It is enabled by default if the
  95. * peerIpAddress is version 4.
  96. *
  97. * @var bool
  98. */
  99. public $enableIpv4;
  100. /**
  101. * Enable IPv6 traffic over BGP Peer. It is enabled by default if the
  102. * peerIpAddress is version 6.
  103. *
  104. * @var bool
  105. */
  106. public $enableIpv6;
  107. /**
  108. * List of export policies applied to this peer, in the order they must be
  109. * evaluated. The name must correspond to an existing policy that has
  110. * ROUTE_POLICY_TYPE_EXPORT type.
  111. *
  112. * @var string[]
  113. */
  114. public $exportPolicies;
  115. /**
  116. * List of import policies applied to this peer, in the order they must be
  117. * evaluated. The name must correspond to an existing policy that has
  118. * ROUTE_POLICY_TYPE_IMPORT type.
  119. *
  120. * @var string[]
  121. */
  122. public $importPolicies;
  123. /**
  124. * Name of the interface the BGP peer is associated with.
  125. *
  126. * @var string
  127. */
  128. public $interfaceName;
  129. /**
  130. * IP address of the interface inside Google Cloud Platform.
  131. *
  132. * @var string
  133. */
  134. public $ipAddress;
  135. /**
  136. * IPv4 address of the interface inside Google Cloud Platform.
  137. *
  138. * @var string
  139. */
  140. public $ipv4NexthopAddress;
  141. /**
  142. * IPv6 address of the interface inside Google Cloud Platform.
  143. *
  144. * @var string
  145. */
  146. public $ipv6NexthopAddress;
  147. /**
  148. * Output only. [Output Only] The resource that configures and manages this
  149. * BGP peer. - MANAGED_BY_USER is the default value and can be managed
  150. * by you or other users - MANAGED_BY_ATTACHMENT is a BGP peer that is
  151. * configured and managed by Cloud Interconnect, specifically by an
  152. * InterconnectAttachment of type PARTNER. Google automatically creates,
  153. * updates, and deletes this type of BGP peer when the PARTNER
  154. * InterconnectAttachment is created, updated, or deleted.
  155. *
  156. * @var string
  157. */
  158. public $managementType;
  159. /**
  160. * Present if MD5 authentication is enabled for the peering. Must be the name
  161. * of one of the entries in the Router.md5_authentication_keys. The field must
  162. * comply with RFC1035.
  163. *
  164. * @var string
  165. */
  166. public $md5AuthenticationKeyName;
  167. /**
  168. * Name of this BGP peer. The name must be 1-63 characters long, and comply
  169. * withRFC1035. Specifically, the name must be 1-63 characters long and match
  170. * the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first
  171. * character must be a lowercase letter, and all following characters must be
  172. * a dash, lowercase letter, or digit, except the last character, which cannot
  173. * be a dash.
  174. *
  175. * @var string
  176. */
  177. public $name;
  178. /**
  179. * Peer BGP Autonomous System Number (ASN). Each BGP interface may use a
  180. * different value.
  181. *
  182. * @var string
  183. */
  184. public $peerAsn;
  185. /**
  186. * IP address of the BGP interface outside Google Cloud Platform.
  187. *
  188. * @var string
  189. */
  190. public $peerIpAddress;
  191. /**
  192. * IPv4 address of the BGP interface outside Google Cloud Platform.
  193. *
  194. * @var string
  195. */
  196. public $peerIpv4NexthopAddress;
  197. /**
  198. * IPv6 address of the BGP interface outside Google Cloud Platform.
  199. *
  200. * @var string
  201. */
  202. public $peerIpv6NexthopAddress;
  203. /**
  204. * URI of the VM instance that is used as third-party router appliances such
  205. * as Next Gen Firewalls, Virtual Routers, or Router Appliances. The VM
  206. * instance must be located in zones contained in the same region as this
  207. * Cloud Router. The VM instance is the peer side of the BGP session.
  208. *
  209. * @var string
  210. */
  211. public $routerApplianceInstance;
  212. /**
  213. * User-specified flag to indicate which mode to use for advertisement.
  214. *
  215. * Accepted values: CUSTOM, DEFAULT
  216. *
  217. * @param self::ADVERTISE_MODE_* $advertiseMode
  218. */
  219. public function setAdvertiseMode($advertiseMode)
  220. {
  221. $this->advertiseMode = $advertiseMode;
  222. }
  223. /**
  224. * @return self::ADVERTISE_MODE_*
  225. */
  226. public function getAdvertiseMode()
  227. {
  228. return $this->advertiseMode;
  229. }
  230. /**
  231. * User-specified list of prefix groups to advertise in custom mode, which
  232. * currently supports the following option: - ALL_SUBNETS: Advertises
  233. * all of the router's own VPC subnets. This excludes any routes learned
  234. * for subnets that use VPC Network Peering.
  235. *
  236. * Note that this field can only be populated if advertise_mode is CUSTOM and
  237. * overrides the list defined for the router (in the "bgp" message). These
  238. * groups are advertised in addition to any specified prefixes. Leave this
  239. * field blank to advertise no custom groups.
  240. *
  241. * @param string[] $advertisedGroups
  242. */
  243. public function setAdvertisedGroups($advertisedGroups)
  244. {
  245. $this->advertisedGroups = $advertisedGroups;
  246. }
  247. /**
  248. * @return string[]
  249. */
  250. public function getAdvertisedGroups()
  251. {
  252. return $this->advertisedGroups;
  253. }
  254. /**
  255. * User-specified list of individual IP ranges to advertise in custom mode.
  256. * This field can only be populated if advertise_mode is CUSTOM and overrides
  257. * the list defined for the router (in the "bgp" message). These IP ranges are
  258. * advertised in addition to any specified groups. Leave this field blank to
  259. * advertise no custom IP ranges.
  260. *
  261. * @param RouterAdvertisedIpRange[] $advertisedIpRanges
  262. */
  263. public function setAdvertisedIpRanges($advertisedIpRanges)
  264. {
  265. $this->advertisedIpRanges = $advertisedIpRanges;
  266. }
  267. /**
  268. * @return RouterAdvertisedIpRange[]
  269. */
  270. public function getAdvertisedIpRanges()
  271. {
  272. return $this->advertisedIpRanges;
  273. }
  274. /**
  275. * The priority of routes advertised to this BGP peer. Where there is more
  276. * than one matching route of maximum length, the routes with the lowest
  277. * priority value win.
  278. *
  279. * @param string $advertisedRoutePriority
  280. */
  281. public function setAdvertisedRoutePriority($advertisedRoutePriority)
  282. {
  283. $this->advertisedRoutePriority = $advertisedRoutePriority;
  284. }
  285. /**
  286. * @return string
  287. */
  288. public function getAdvertisedRoutePriority()
  289. {
  290. return $this->advertisedRoutePriority;
  291. }
  292. /**
  293. * BFD configuration for the BGP peering.
  294. *
  295. * @param RouterBgpPeerBfd $bfd
  296. */
  297. public function setBfd(RouterBgpPeerBfd $bfd)
  298. {
  299. $this->bfd = $bfd;
  300. }
  301. /**
  302. * @return RouterBgpPeerBfd
  303. */
  304. public function getBfd()
  305. {
  306. return $this->bfd;
  307. }
  308. /**
  309. * A list of user-defined custom learned route IP address ranges for a BGP
  310. * session.
  311. *
  312. * @param RouterBgpPeerCustomLearnedIpRange[] $customLearnedIpRanges
  313. */
  314. public function setCustomLearnedIpRanges($customLearnedIpRanges)
  315. {
  316. $this->customLearnedIpRanges = $customLearnedIpRanges;
  317. }
  318. /**
  319. * @return RouterBgpPeerCustomLearnedIpRange[]
  320. */
  321. public function getCustomLearnedIpRanges()
  322. {
  323. return $this->customLearnedIpRanges;
  324. }
  325. /**
  326. * The user-defined custom learned route priority for a BGP session. This
  327. * value is applied to all custom learned route ranges for the session. You
  328. * can choose a value from `0` to `65335`. If you don't provide a value,
  329. * Google Cloud assigns a priority of `100` to the ranges.
  330. *
  331. * @param int $customLearnedRoutePriority
  332. */
  333. public function setCustomLearnedRoutePriority($customLearnedRoutePriority)
  334. {
  335. $this->customLearnedRoutePriority = $customLearnedRoutePriority;
  336. }
  337. /**
  338. * @return int
  339. */
  340. public function getCustomLearnedRoutePriority()
  341. {
  342. return $this->customLearnedRoutePriority;
  343. }
  344. /**
  345. * The status of the BGP peer connection.
  346. *
  347. * If set to FALSE, any active session with the peer is terminated and all
  348. * associated routing information is removed. If set to TRUE, the peer
  349. * connection can be established with routing information. The default is
  350. * TRUE.
  351. *
  352. * Accepted values: FALSE, TRUE
  353. *
  354. * @param self::ENABLE_* $enable
  355. */
  356. public function setEnable($enable)
  357. {
  358. $this->enable = $enable;
  359. }
  360. /**
  361. * @return self::ENABLE_*
  362. */
  363. public function getEnable()
  364. {
  365. return $this->enable;
  366. }
  367. /**
  368. * Enable IPv4 traffic over BGP Peer. It is enabled by default if the
  369. * peerIpAddress is version 4.
  370. *
  371. * @param bool $enableIpv4
  372. */
  373. public function setEnableIpv4($enableIpv4)
  374. {
  375. $this->enableIpv4 = $enableIpv4;
  376. }
  377. /**
  378. * @return bool
  379. */
  380. public function getEnableIpv4()
  381. {
  382. return $this->enableIpv4;
  383. }
  384. /**
  385. * Enable IPv6 traffic over BGP Peer. It is enabled by default if the
  386. * peerIpAddress is version 6.
  387. *
  388. * @param bool $enableIpv6
  389. */
  390. public function setEnableIpv6($enableIpv6)
  391. {
  392. $this->enableIpv6 = $enableIpv6;
  393. }
  394. /**
  395. * @return bool
  396. */
  397. public function getEnableIpv6()
  398. {
  399. return $this->enableIpv6;
  400. }
  401. /**
  402. * List of export policies applied to this peer, in the order they must be
  403. * evaluated. The name must correspond to an existing policy that has
  404. * ROUTE_POLICY_TYPE_EXPORT type.
  405. *
  406. * @param string[] $exportPolicies
  407. */
  408. public function setExportPolicies($exportPolicies)
  409. {
  410. $this->exportPolicies = $exportPolicies;
  411. }
  412. /**
  413. * @return string[]
  414. */
  415. public function getExportPolicies()
  416. {
  417. return $this->exportPolicies;
  418. }
  419. /**
  420. * List of import policies applied to this peer, in the order they must be
  421. * evaluated. The name must correspond to an existing policy that has
  422. * ROUTE_POLICY_TYPE_IMPORT type.
  423. *
  424. * @param string[] $importPolicies
  425. */
  426. public function setImportPolicies($importPolicies)
  427. {
  428. $this->importPolicies = $importPolicies;
  429. }
  430. /**
  431. * @return string[]
  432. */
  433. public function getImportPolicies()
  434. {
  435. return $this->importPolicies;
  436. }
  437. /**
  438. * Name of the interface the BGP peer is associated with.
  439. *
  440. * @param string $interfaceName
  441. */
  442. public function setInterfaceName($interfaceName)
  443. {
  444. $this->interfaceName = $interfaceName;
  445. }
  446. /**
  447. * @return string
  448. */
  449. public function getInterfaceName()
  450. {
  451. return $this->interfaceName;
  452. }
  453. /**
  454. * IP address of the interface inside Google Cloud Platform.
  455. *
  456. * @param string $ipAddress
  457. */
  458. public function setIpAddress($ipAddress)
  459. {
  460. $this->ipAddress = $ipAddress;
  461. }
  462. /**
  463. * @return string
  464. */
  465. public function getIpAddress()
  466. {
  467. return $this->ipAddress;
  468. }
  469. /**
  470. * IPv4 address of the interface inside Google Cloud Platform.
  471. *
  472. * @param string $ipv4NexthopAddress
  473. */
  474. public function setIpv4NexthopAddress($ipv4NexthopAddress)
  475. {
  476. $this->ipv4NexthopAddress = $ipv4NexthopAddress;
  477. }
  478. /**
  479. * @return string
  480. */
  481. public function getIpv4NexthopAddress()
  482. {
  483. return $this->ipv4NexthopAddress;
  484. }
  485. /**
  486. * IPv6 address of the interface inside Google Cloud Platform.
  487. *
  488. * @param string $ipv6NexthopAddress
  489. */
  490. public function setIpv6NexthopAddress($ipv6NexthopAddress)
  491. {
  492. $this->ipv6NexthopAddress = $ipv6NexthopAddress;
  493. }
  494. /**
  495. * @return string
  496. */
  497. public function getIpv6NexthopAddress()
  498. {
  499. return $this->ipv6NexthopAddress;
  500. }
  501. /**
  502. * Output only. [Output Only] The resource that configures and manages this
  503. * BGP peer. - MANAGED_BY_USER is the default value and can be managed
  504. * by you or other users - MANAGED_BY_ATTACHMENT is a BGP peer that is
  505. * configured and managed by Cloud Interconnect, specifically by an
  506. * InterconnectAttachment of type PARTNER. Google automatically creates,
  507. * updates, and deletes this type of BGP peer when the PARTNER
  508. * InterconnectAttachment is created, updated, or deleted.
  509. *
  510. * Accepted values: MANAGED_BY_ATTACHMENT, MANAGED_BY_USER
  511. *
  512. * @param self::MANAGEMENT_TYPE_* $managementType
  513. */
  514. public function setManagementType($managementType)
  515. {
  516. $this->managementType = $managementType;
  517. }
  518. /**
  519. * @return self::MANAGEMENT_TYPE_*
  520. */
  521. public function getManagementType()
  522. {
  523. return $this->managementType;
  524. }
  525. /**
  526. * Present if MD5 authentication is enabled for the peering. Must be the name
  527. * of one of the entries in the Router.md5_authentication_keys. The field must
  528. * comply with RFC1035.
  529. *
  530. * @param string $md5AuthenticationKeyName
  531. */
  532. public function setMd5AuthenticationKeyName($md5AuthenticationKeyName)
  533. {
  534. $this->md5AuthenticationKeyName = $md5AuthenticationKeyName;
  535. }
  536. /**
  537. * @return string
  538. */
  539. public function getMd5AuthenticationKeyName()
  540. {
  541. return $this->md5AuthenticationKeyName;
  542. }
  543. /**
  544. * Name of this BGP peer. The name must be 1-63 characters long, and comply
  545. * withRFC1035. Specifically, the name must be 1-63 characters long and match
  546. * the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first
  547. * character must be a lowercase letter, and all following characters must be
  548. * a dash, lowercase letter, or digit, except the last character, which cannot
  549. * be a dash.
  550. *
  551. * @param string $name
  552. */
  553. public function setName($name)
  554. {
  555. $this->name = $name;
  556. }
  557. /**
  558. * @return string
  559. */
  560. public function getName()
  561. {
  562. return $this->name;
  563. }
  564. /**
  565. * Peer BGP Autonomous System Number (ASN). Each BGP interface may use a
  566. * different value.
  567. *
  568. * @param string $peerAsn
  569. */
  570. public function setPeerAsn($peerAsn)
  571. {
  572. $this->peerAsn = $peerAsn;
  573. }
  574. /**
  575. * @return string
  576. */
  577. public function getPeerAsn()
  578. {
  579. return $this->peerAsn;
  580. }
  581. /**
  582. * IP address of the BGP interface outside Google Cloud Platform.
  583. *
  584. * @param string $peerIpAddress
  585. */
  586. public function setPeerIpAddress($peerIpAddress)
  587. {
  588. $this->peerIpAddress = $peerIpAddress;
  589. }
  590. /**
  591. * @return string
  592. */
  593. public function getPeerIpAddress()
  594. {
  595. return $this->peerIpAddress;
  596. }
  597. /**
  598. * IPv4 address of the BGP interface outside Google Cloud Platform.
  599. *
  600. * @param string $peerIpv4NexthopAddress
  601. */
  602. public function setPeerIpv4NexthopAddress($peerIpv4NexthopAddress)
  603. {
  604. $this->peerIpv4NexthopAddress = $peerIpv4NexthopAddress;
  605. }
  606. /**
  607. * @return string
  608. */
  609. public function getPeerIpv4NexthopAddress()
  610. {
  611. return $this->peerIpv4NexthopAddress;
  612. }
  613. /**
  614. * IPv6 address of the BGP interface outside Google Cloud Platform.
  615. *
  616. * @param string $peerIpv6NexthopAddress
  617. */
  618. public function setPeerIpv6NexthopAddress($peerIpv6NexthopAddress)
  619. {
  620. $this->peerIpv6NexthopAddress = $peerIpv6NexthopAddress;
  621. }
  622. /**
  623. * @return string
  624. */
  625. public function getPeerIpv6NexthopAddress()
  626. {
  627. return $this->peerIpv6NexthopAddress;
  628. }
  629. /**
  630. * URI of the VM instance that is used as third-party router appliances such
  631. * as Next Gen Firewalls, Virtual Routers, or Router Appliances. The VM
  632. * instance must be located in zones contained in the same region as this
  633. * Cloud Router. The VM instance is the peer side of the BGP session.
  634. *
  635. * @param string $routerApplianceInstance
  636. */
  637. public function setRouterApplianceInstance($routerApplianceInstance)
  638. {
  639. $this->routerApplianceInstance = $routerApplianceInstance;
  640. }
  641. /**
  642. * @return string
  643. */
  644. public function getRouterApplianceInstance()
  645. {
  646. return $this->routerApplianceInstance;
  647. }
  648. }
  649. // Adding a class alias for backwards compatibility with the previous class name.
  650. class_alias(RouterBgpPeer::class, 'Google_Service_Compute_RouterBgpPeer');