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

bug: prefix and address attribute filters are not available in the SDK for nodes inheriting from BuiltinIPPrefix or BuiltinIPAddress #10

Closed
wvandeun opened this issue Sep 5, 2024 · 0 comments
Assignees
Labels
type/bug Something isn't working as expected

Comments

@wvandeun
Copy link
Contributor

wvandeun commented Sep 5, 2024

Component

Python SDK

Infrahub version

0.12.4

Current Behavior

In the SDK it is not possible to use the attribute filters for the prefix attribute of a node that inherits from BuiltinIPPrefix.
Similarly you can't use the attribute filters for the address attribute of a node that inherits from BuiltinIPAddress.

The attribute filters are available and working when using a GraphQL query.

Expected Behavior

We can use the prefix/address attribute filters in the SDK.

Steps to Reproduce

  • start an Infrahub instance
  • load this schema
---
version: "1.0"
nodes:
  - name: IPPrefix
    namespace: Ipam
    include_in_menu: false
    inherit_from:
      - "BuiltinIPPrefix"
    description: "IPv4 or IPv6 network"
    label: "IP Prefix"
  - name: IPAddress
    namespace: Ipam
    include_in_menu: false
    inherit_from:
      - "BuiltinIPAddress"
    description: "IP Address"
    label: "IP Address"
  • Create an IP Prefix '10.0.0.0/16' and and IP Address '10.0.0.1/32' using the frontend
  • Spin up a Python interpreter
  • Execute the following statements
from infrahub_sdk import InfrahubClientSync
client = InfrahubClientSync()
client.get("IpamIPPrefix", prefix__value="10.0.0.0/16")
client.get("IpamIPAddress", prefix__value="10.0.0.1/32")
  • When you check the available filters in the schema using the SDK, they don't seem to be available
for filter in client.schema.get("IpamIPPrefix").filters:
    print(filter.name)

Additional Information

No response

@wvandeun wvandeun added the type/bug Something isn't working as expected label Sep 5, 2024
@exalate-issue-sync exalate-issue-sync bot added the state/planned This issue is planned to be worked on in an upcoming release. label Sep 9, 2024
@dgarros dgarros transferred this issue from opsmill/infrahub Sep 21, 2024
@dgarros dgarros self-assigned this Sep 21, 2024
@dgarros dgarros closed this as completed Sep 24, 2024
@exalate-issue-sync exalate-issue-sync bot removed the state/planned This issue is planned to be worked on in an upcoming release. label Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

2 participants