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

Add location attribute to managed device resource and data sources #976

Conversation

chrismarget-j
Copy link
Collaborator

@chrismarget-j chrismarget-j commented Dec 2, 2024

This PR adds the location attribute to the following:

  • apstra_managed_device resource
  • apstra_agent data source
  • apstra_agents data source

Reading the location data from the API requires making an extra API call because the "managed device" concept is split into two Apstra objects: agent and system. "system" is the one with the "location" field. It is created as a side-effect of creating the agent, so it must be managed under a single declarative resource.

The Acknowledge() applies a "user config" struct to the agent; this has the side effect of "acknowledging" the device. But now we're also sending the location field (part of the user config), so Acknowledge() has been renamed to SetUserConfig() to better reflect it's behavior.

Other errata:

  • added a missing return on error

@chrismarget-j chrismarget-j merged commit e86e4eb into main Dec 8, 2024
1 check passed
@chrismarget-j chrismarget-j deleted the 970-add-support-for-location-attribute-to-apstra_managed_device-resource branch December 8, 2024 02:01
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.

Add support for location attribute to apstra_managed_device resource
2 participants