Skip to content

Test and enhance FWO API for importing owners and their networks #2004

@tpurschke

Description

@tpurschke
  • use case 1: initially auto-create many owners for performance testing

insert mutation:

mutation addOwners($owners:[owner_insert_input!]!) {
  insert_owner(
    objects: $owners
  ) {
    returning {
      id
    }
  }
}

Variables:

{
  "owners": [
      {
        "name": "5",
        "recert_interval": 365,
        "dn":"x",
        "group_dn":"x",
        "app_id_external": "app-5",
        "owner_networks": {"data": [{"ip": "10.5.0.0/16"},{"ip": "10.9.0.0/16"}]}
      },
      {
        "name": "6",
        "recert_interval": 30,
        "dn":"x",
        "group_dn":"x",
        "app_id_external": "app-6",
        "owner_networks": {"data": [{"ip": "10.6.0.0/16"}]}
      },
      {
        "name": "7",
        "recert_interval": 90,
        "dn":"x",
        "group_dn":"x",
        "app_id_external": "app-7",
        "owner_networks": {"data": [{"ip": "10.7.0.0/16"}]}
      }
  ]
}
mutation addSingleOwner {
  insert_owner(
    objects: [
      {
        name: "sechs"
        recert_interval: 222
        dn: "a"
        group_dn: "b"
        app_id_external: "app-sechs"
        owner_networks: {
          data: [{ ip: "10.69.0.0/16" }, { ip: "10.9.0.0/16" }]
          on_conflict: {
            constraint: owner_network_ip_unique
            update_columns: [ip]
          }
        }
      }
    ]
    on_conflict: {
      constraint: owner_name_key
      update_columns: [recert_interval, dn, group_dn]
    }
  ) {
    returning {
      id
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    testTest new / existing feature

    Type

    No type

    Projects

    Status

    📋 Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions