Skip to content

Commit

Permalink
Convert from Ruby to Go
Browse files Browse the repository at this point in the history
use default function
update example and used default field testcheckResourceAttr
add beta version tag
Add bgp best path slection support to network
  • Loading branch information
c2thorn committed Sep 27, 2024
1 parent c0fae5c commit 3a4a356
Show file tree
Hide file tree
Showing 6 changed files with 352 additions and 0 deletions.
54 changes: 54 additions & 0 deletions mmv1/products/compute/Network.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,27 @@ examples:
network_name: 'vpc-network'
test_env_vars:
project: 'PROJECT_NAME'
- name: 'network_bgp_best_path_selection_mode'
primary_resource_id: 'vpc_network'
min_version: 'beta'
vars:
network_name: 'vpc-network'
test_env_vars:
project: 'PROJECT_NAME'
- name: 'network_bgp_best_path_selection_mode_standard'
primary_resource_id: 'vpc_network'
min_version: 'beta'
vars:
network_name: 'vpc-network'
test_env_vars:
project: 'PROJECT_NAME'
- name: 'network_bgp_best_path_selection_mode_standard_custom_fields'
primary_resource_id: 'vpc_network'
min_version: 'beta'
vars:
network_name: 'vpc-network'
test_env_vars:
project: 'PROJECT_NAME'
virtual_fields:
- name: 'delete_default_routes_on_create'
description: |
Expand Down Expand Up @@ -144,6 +165,39 @@ properties:
enum_values:
- 'REGIONAL'
- 'GLOBAL'
- name: 'bgpBestPathSelectionMode'
type: Enum
description: |
The BGP best selection algorithm to be employed. MODE can be LEGACY or STANDARD.
min_version: 'beta'
default_from_api: true
update_url: 'projects/{{project}}/global/networks/{{name}}'
update_verb: 'PATCH'
enum_values:
- 'LEGACY'
- 'STANDARD'
- name: 'bgpAlwaysCompareMed'
type: Boolean
description: |
Enables/disables the comparison of MED across routes with different Neighbor ASNs.
This value can only be set if the --bgp-best-path-selection-mode is STANDARD
min_version: 'beta'
required: false
default_from_api: true
update_url: 'projects/{{project}}/global/networks/{{name}}'
update_verb: 'PATCH'
- name: 'bgpInterRegionCost'
type: Enum
description: |
Choice of the behavior of inter-regional cost and MED in the BPS algorithm.
min_version: 'beta'
required: false
default_from_api: true
update_url: 'projects/{{project}}/global/networks/{{name}}'
update_verb: 'PATCH'
enum_values:
- 'DEFAULT'
- 'ADD_COST_TO_MED'
- name: 'mtu'
type: Integer
description: |
Expand Down
18 changes: 18 additions & 0 deletions mmv1/products/compute/Route.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,24 @@ properties:
description: |
URL to a Network that should handle matching packets.
output: true
- name: 'nextHopOrigin'
type: String
description: |
Indicates the origin of the route. Can be IGP (Interior Gateway Protocol), EGP (Exterior Gateway Protocol), or INCOMPLETE.
min_version: 'beta'
output: true
- name: 'nextHopMed'
type: String
description: |
Multi-Exit Discriminator, a BGP route metric that indicates the desirability of a particular route in a network.
min_version: 'beta'
output: true
- name: 'nextHopInterRegionCost'
type: String
description: |
Internal fixed region-to-region cost that Google Cloud calculates based on factors such as network performance, distance, and available bandwidth between regions.
min_version: 'beta'
output: true
- name: 'nextHopIlb'
type: String
description: |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resource "google_compute_network" "{{$.PrimaryResourceId}}" {
project = "{{index $.TestEnvVars "project"}}"
name = "{{index $.Vars "network_name"}}"
routing_mode = "GLOBAL"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "google_compute_network" "{{$.PrimaryResourceId}}" {
project = "{{index $.TestEnvVars "project"}}"
name = "{{index $.Vars "network_name"}}"
routing_mode = "GLOBAL"
bgp_best_path_selection_mode = "STANDARD"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
resource "google_compute_network" "{{$.PrimaryResourceId}}" {
project = "{{index $.TestEnvVars "project"}}"
name = "{{index $.Vars "network_name"}}"
routing_mode = "GLOBAL"
bgp_best_path_selection_mode = "STANDARD"
bgp_always_compare_med = true
bgp_inter_region_cost = ADD_COST_TO_MED
}
Loading

0 comments on commit 3a4a356

Please sign in to comment.