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

Introduce apstra_datacenter_routing_zone_loopback_addresses resource #1037

Merged
merged 5 commits into from
Feb 14, 2025

Conversation

chrismarget-j
Copy link
Collaborator

@chrismarget-j chrismarget-j commented Feb 13, 2025

This PR introduces the apstra_datacenter_routing_zone_loopback_addresses resource.

It's a vaguely imperative resource in the sense that it doesn't create anything, it merely assigns (or clears) address values from fields which already exist and may already contain values.

This resource relies heavily on a private data struct which records system IDs where values were previously written by the Create() and Update() methods. The record looks like this:

{
  "GX652VT5ZkH5JOg1Jw": {
    "has_ipv4": false,
    "has_ipv6": true
  },
  "UXAnfRFHDnkybwHAbw": {
    "has_ipv4": true,
    "has_ipv6": false
  }
}

The various methods make use of these values when determining which interfaces and addresses are relevant to their work:

  • Read() discards values not previously assigned by this resource
  • Update() clears values previously assigned but not part of the current plan
  • Delete() clears all previously assigned values

The Request() function in this resource is different from most for a couple of reasons:

  • It takes a client object as input to make an API call which maps system IDs (what we collect from the user) to interface IDs (what we send to the API)
  • It returns the private struct above based on the API payload it has prepared.

Closes #981

@chrismarget-j chrismarget-j merged commit d4dd621 into main Feb 14, 2025
1 check passed
@chrismarget-j chrismarget-j deleted the sz-loopback-resource branch February 14, 2025 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for modifying the loopback addresses assigned for each each leaf and each VRF
2 participants