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

nxos_vpc_domain (Resource) is missing an attribute #221

Open
Danmaarjustin opened this issue Apr 11, 2024 · 3 comments
Open

nxos_vpc_domain (Resource) is missing an attribute #221

Danmaarjustin opened this issue Apr 11, 2024 · 3 comments

Comments

@Danmaarjustin
Copy link

Maybe im wrong, but i think that the attribute:

"ip arp synchronise" is missing.
Will this be released in a future release?

@jgomezve
Copy link
Collaborator

jgomezve commented Apr 11, 2024

Hi @JustinSchoenaker

The cli command ip arp synchronize is not created by modifying the DME object vpcDom. It is created by modifying the DME object arpVpcDom

Here the output of the Sandbox NXAPI after converting CLI commands to native DME configuration

vpc domain 100
  ip arp synchronize
{
  "topSystem": {
    "children": [
      {
        "arpEntity": {
          "children": [
            {
              "arpInst": {
                "children": [
                  {
                    "arpVpc": {
                      "children": [
                        {
                          "arpVpcDom": {
                            "attributes": {
                              "arpSync": "enabled",
                              "domainId": "100"
                            }
                          }
                        }
                      ]
                    }
                  }
                ]
              }
            }
          ]
        }
      },
      {
        "vpcEntity": {
          "children": [
            {
              "vpcInst": {
                "children": [
                  {
                    "vpcDom": {
                      "attributes": {
                        "id": "100"
                      }
                    }
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  }
}

As you can see, you must create the DME objects arpEntity, arpInst, arpVpc and arpVpcDom. Those object do not have dedicated resource in the current version of the NXOS provider. Nonetheless, you can use the generic resource nxos_rest for this purpose as shown below:

resource "nxos_vpc_domain" "example" {
  admin_state                    = "enabled"
  domain_id                      = 100
}


resource "nxos_rest" "arpEntity" {
  dn         = "sys/arp"
  class_name = "arpEntity"
  content = {
    adminSt = "enabled"
  }

  depends_on = [  nxos_vpc_domain.example]
}

resource "nxos_rest" "arpInst" {
  dn         = "${nxos_rest.arpEntity.id}/inst"
  class_name = "arpInst"
  content = {
    adminSt = "enabled"
  }
}

resource "nxos_rest" "arpVpc" {
  dn         = "${nxos_rest.arpInst.id}/vpc"
  class_name = "arpVpc"
}


resource "nxos_rest" "arpVpcDom" {
  dn         = "${nxos_rest.arpVpc.id}/dom-[100]"
  class_name = "arpVpcDom"
  content = {
    arpSync = "enabled"
    domainId = "100"
  }
}

Let us know if this approach works for you, or if you would like to see dedicated resources for those DME objects in a future release

@Danmaarjustin
Copy link
Author

Hi @JustinSchoenaker

The cli command ip arp synchronize is not created by modifying the DME object vpcDom. It is created by modifying the DME object arpVpcDom

Here the output of the Sandbox NXAPI after converting CLI commands to native DME configuration

vpc domain 100
  ip arp synchronize
{
  "topSystem": {
    "children": [
      {
        "arpEntity": {
          "children": [
            {
              "arpInst": {
                "children": [
                  {
                    "arpVpc": {
                      "children": [
                        {
                          "arpVpcDom": {
                            "attributes": {
                              "arpSync": "enabled",
                              "domainId": "100"
                            }
                          }
                        }
                      ]
                    }
                  }
                ]
              }
            }
          ]
        }
      },
      {
        "vpcEntity": {
          "children": [
            {
              "vpcInst": {
                "children": [
                  {
                    "vpcDom": {
                      "attributes": {
                        "id": "100"
                      }
                    }
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  }
}

As you can see, you must create the DME objects arpEntity, arpInst, arpVpc and arpVpcDom. Those object do not have dedicated resource in the current version of the NXOS provider. Nonetheless, you can use the generic resource nxos_rest for this purpose as shown below:

resource "nxos_vpc_domain" "example" {
  admin_state                    = "enabled"
  domain_id                      = 100
}


resource "nxos_rest" "arpEntity" {
  dn         = "sys/arp"
  class_name = "arpEntity"
  content = {
    adminSt = "enabled"
  }

  depends_on = [  nxos_vpc_domain.example]
}

resource "nxos_rest" "arpInst" {
  dn         = "${nxos_rest.arpEntity.id}/inst"
  class_name = "arpInst"
  content = {
    adminSt = "enabled"
  }
}

resource "nxos_rest" "arpVpc" {
  dn         = "${nxos_rest.arpInst.id}/vpc"
  class_name = "arpVpc"
}


resource "nxos_rest" "arpVpcDom" {
  dn         = "${nxos_rest.arpVpc.id}/dom-[100]"
  class_name = "arpVpcDom"
  content = {
    arpSync = "enabled"
    domainId = "100"
  }
}

Let us know if this approach works for you, or if you would like to see dedicated resources for those DME objects in a future release

Awesome reply! This works like a charm, good approach for every other issue im facing regarding absence of some parameters within some resources. Thanks a lot!

@jgomezve
Copy link
Collaborator

@JustinSchoenaker glad to hear it works

Please feel free to open additional issues for missing resource so we can we track which resources the community want and prioritize them

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

No branches or pull requests

2 participants