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

Update lbapi client to query ipam ip addresses for node #41

Merged
merged 6 commits into from
Jun 30, 2023

Conversation

rizzza
Copy link
Contributor

@rizzza rizzza commented Jun 28, 2023

Summary

  • Update the loadbalancer-api client to query the supergraph for the ipam service ip addresses belonging to loadbalancer

Playing with the ipam graph, the behavior here appears to be what we need to get loadbalancer ip addresses once we start hitting the supergraph router.

Example IPAddressable query to supergraph

query Loadbalancer {
  loadBalancer(id: "loadbal-dne") {
    id
    name
    owner {
      id
    }
    ... on IPAddressable {
      IPAddresses {
        id
        ip
        reserved  
      }
    }
    ports {
      edges {
        node {
          name
          id
          pools {
            id
            name
            protocol
            origins {
              edges {
                node {
                  id
                  name
                  target
                  portNumber
                }
              }
            }
          }
        }
      }
    }
  }
}

Example query to ipam

query GetAddressByNode {
  _entities(representations:{__typename: "IPAddressable", id: "loadbal-gidxrandovalue"}) {
    ... on IPAddressable {
      id
      IPAddresses {
        id
        ip
        reserved  
      }
    }
  }
}

ipam query result

{
  "data": {
    "_entities": [
      {
        "id": "loadbal-gidxrandovalue",
        "IPAddresses": [
          {
            "id": "ipamipa-8IPzP37YJ1iTxJdMrCods",
            "ip": "192.168.1.42",
            "reserved": false
          },
          {
            "id": "ipamipa-rPBY83fPw6Ll5sueCMpDr",
            "ip": "192.168.1.1",
            "reserved": true
          }
        ]
      }
    ]
  }
}

@rizzza rizzza requested a review from a team as a code owner June 28, 2023 22:33
@rizzza rizzza force-pushed the lbapi-client-ip-address branch from b1d2d83 to dd35093 Compare June 29, 2023 04:33
Signed-off-by: Matt Siwiec <[email protected]>
@rizzza rizzza force-pushed the lbapi-client-ip-address branch from 669606c to 5904f41 Compare June 29, 2023 22:23
@tylerauerbeck tylerauerbeck merged commit 23ed325 into infratographer:main Jun 30, 2023
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.

4 participants