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

Data source apstra_datacenter_blueprint_system_nodes #59

Merged
merged 8 commits into from
May 4, 2023

Conversation

chrismarget-j
Copy link
Collaborator

@chrismarget-j chrismarget-j commented May 3, 2023

This PR introduces data.apstra_datacenter_blueprint_system_nodes.

Config schema:

data "apstra_datacenter_blueprint_system_nodes" "example" {
  blueprint_id = <string>    // required
  filters = {                // optional
    hostname    = <string>   // optional
    label       = <string>   // optional
    role        = <string>   // optional
    system_type = <string>   // optional
    system_id   = <string>   // optional
    tag_ids     = [<string>] // optional
  }
}

Any combination of filter elements can be supplied, except for an empty filter block (omit the block altogether).

The following outputs are available:

  "ids"          = toset([<string>])
  "query_string" = <string>

ids is the set of graph db node IDs of type = 'system' nodes which matched the filters.

query_string is the graph query generated based on the filters which can be used in the graph explorer for debugging.

This PR introduces data.apstra_datacenter_blueprint_system_node.

Config schema:

data "apstra_datacenter_blueprint_system_node" "spine" {
  blueprint_id = <string> // required
  id           = <string> // required
}

The following outputs are available:

  "attributes" = {
    "hostname"    = <string>
    "id"          = <string>
    "label"       = <string>
    "role"        = <string>
    "system_id"   = <string>
    "system_type" = <string>
    "tag_ids"     = toset([<string>])
  }

This PR required the breaking changes in apstra_go_sdk #20. Many of the changes to old code reorganize the query operations around those changes.

I wrote tests for the apstra_datacenter_blueprint_system_nodes data source, but they won't run because the test framework insists that the schema have an id field. I'm not sure what to do about that right now.

Tests for the apstra_datacenter_blueprint_system_node data source pass on 4.1.0, 4.1.1 and 4.1.2.

@chrismarget-j chrismarget-j requested a review from rajagopalans May 3, 2023 01:46
@chrismarget-j chrismarget-j merged commit be21191 into main May 4, 2023
@chrismarget-j chrismarget-j deleted the data-source-node branch May 4, 2023 15:28
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.

2 participants