Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meraki_networks_switch_stacks_routing_interfaces - additional values in the API request #97

Closed
mcparaf opened this issue Jul 8, 2024 · 2 comments

Comments

@mcparaf
Copy link

mcparaf commented Jul 8, 2024

Prerequisites

  • [ v ] Have you tested the operation in the API directly?
  • [ v ] Do you have the latest Terraform provider version?
  • [ x ] Review the compatibility matrix before opening an issue. - the page does not exist

Describe the bug
When trying to edit a switch stack routing interface the provider supplies additional argument to the API request and then API says that the additionally provided argument was wrong. From my research it seems that the additional argument value is downloaded directly from the API and has nothing to do with the data I provided myself. In particular, I made sure not to include the argument in my resource:

resource "meraki_networks_switch_stacks_routing_interfaces" "net_switch_stacks_routing_interfaces" {
  for_each        = { for data in local.networks_switch_stacks_routing_interfaces : data.interface_key => data }
  switch_stack_id = each.value.switch_stack_id
  network_id      = each.value.network_id
  # default_gateway = try(each.value.data.default_gateway, null)
  # interface_id      = try(each.value.data.interface_id, null)
  interface_ip      = try(each.value.data.interface_ip, null)
  ipv6              = try(each.value.data.ipv6, null)
  multicast_routing = try(each.value.data.multicast_routing, null)
  name              = try(each.value.data.name, null)
  ospf_settings     = try(each.value.data.ospf_settings, null)
  # ospf_v3           = try(each.value.data.ospf_v3, null)
  subnet  = try(each.value.data.subnet, null)
  vlan_id = try(each.value.data.vlan_id, null)
}

It still adds the default gateway though:

2024-07-08T10:43:08.781+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: ==============================================================================
2024-07-08T10:43:08.781+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: ~~~ REQUEST ~~~
2024-07-08T10:43:08.781+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: PUT  /api/v1/networks/L_709316941310853998/switch/stacks/709316941310853242/routing/interfaces/709316941310853275  HTTP/1.1
2024-07-08T10:43:08.781+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: HOST   : api.meraki.com
2024-07-08T10:43:08.781+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: HEADERS:
2024-07-08T10:43:08.781+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: 	Accept: application/json
2024-07-08T10:43:08.781+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: 	Authorization: Bearer ****b91c9
2024-07-08T10:43:08.781+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: 	Content-Type: application/json
2024-07-08T10:43:08.782+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: 	User-Agent: go-meraki/1.44.1 MerakiTerraform/1.47.0 Cisco
2024-07-08T10:43:08.782+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: BODY   :
2024-07-08T10:43:08.782+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: {
2024-07-08T10:43:08.782+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha:    "defaultGateway": "10.11.12.99",
2024-07-08T10:43:08.782+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha:    "interfaceIp": "10.11.12.2",
2024-07-08T10:43:08.782+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha:    "ipv6": {
2024-07-08T10:43:08.782+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha:       "address": "2:20:3:4::1",
2024-07-08T10:43:08.782+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha:       "assignmentMode": "static",
2024-07-08T10:43:08.784+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha:       "prefix": "2:20:3:4::/64"
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha:    },
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha:    "multicastRouting": "disabled",
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha:    "name": "test",
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha:    "ospfSettings": {
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha:       "area": "ospfDisabled"
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha:    },
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha:    "subnet": "10.11.12.0/24",
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha:    "vlanId": 100
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: }
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: ------------------------------------------------------------------------------
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: ~~~ RESPONSE ~~~
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: STATUS       : 400 Bad Request
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: PROTO        : HTTP/2.0
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: RECEIVED AT  : 2024-07-08T10:43:08.780205+02:00
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: TIME DURATION: 114.232958ms
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: HEADERS      :
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: 	Cache-Control: no-cache, no-store, max-age=0, must-revalidate
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: 	Content-Type: application/json; charset=utf-8
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: 	Date: Mon, 08 Jul 2024 08:43:08 GMT
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: 	Expires: Fri, 01 Jan 1990 00:00:00 GMT
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: 	Pragma: no-cache
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: 	Strict-Transport-Security: max-age=31536000; includeSubDomains
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: 	X-Content-Type-Options: nosniff
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: 	X-Frame-Options: sameorigin
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: 	X-Request-Id: 7b333ce5d2d34c6e5db4ce1aebd5814e
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: 	X-Robots-Tag: none
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: 	X-Runtime: 0.065100
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: 	X-Xss-Protection: 1; mode=block
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: BODY         :
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: {
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha:    "errors": [
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha:       "Parameter 'defaultGateway' to be set once and is already configured with a different layer 3 interface."
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha:    ]
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: }
2024-07-08T10:43:08.785+0200 [DEBUG] provider.terraform-provider-meraki_v0.2.5-alpha: ==============================================================================

Expected behavior
Do not include the "default gateway" argument in the request.

Environment (please complete the following information):

  • Meraki Dashboard version: current version at https://n260.meraki.com
  • Terraform version: 1.9.1
  • Meraki provider version: 0.2.5-alpha
  • OS Version: macOS Sonoma 14.5
fmunozmiranda added a commit that referenced this issue Jul 10, 2024
…s in the API request #97

- networks_switch_dhcp_server_policy_arp_inspection_trusted_servers - inconsistency #96
fmunozmiranda added a commit that referenced this issue Jul 15, 2024
BUGFIXES:
* Issue #88 fixed.
* Issue #89 fixed.
* Issue #92 fixed.
* Issue #93 fixed.
* Issue #94 fixed.
* Issue #96 fixed.
* Issue #97 fixed.
* Issue #98 fixed.
* Issue #99 fixed.
* Issue #100 fixed.
* Issue #101 fixed.
* Issue #107 fixed.
* Issue #108 fixed.
* Issue #109 fixed.
@fmunozmiranda fmunozmiranda mentioned this issue Jul 15, 2024
1 task
@fmunozmiranda
Copy link
Collaborator

@mcparaf please try it again with new version and update us.

@fmunozmiranda
Copy link
Collaborator

If we do not receive a response it will be closed in the next 24 hours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants