Infratographer IP Address Management implements a GraphQL API that provides a way to manage IP Addresses
erDiagram
NODE ||--o| IPBlockType : "has"
IPBlockType {
string Name
id OwnerID
}
IPBlockType ||--o{ IPBlock : "has"
IPBlock {
string Prefix
id BlockTypeID
id LocationID
id ParentBlockID
boolean AllowAutoSubnet
boolean AllowAutoAllocate
}
IPBlock ||--o{ IPAddress : "has"
IPAddress {
string IP
id BlockID
id NodeID
id NodeOwnerID
boolean Reserved
}
To begin start by opening the devcontainer as outlined in the Development Guide
To initialize the database:
go build
./ipam-api migrate up
To run the api
make go-run
To subscribe to the NATS stream:
# if not created already
nats --server=nats:4222 --creds=/nsc/nkeys/creds/LOCAL/IPAM/USER.creds stream add $NAME --subjects='com.example.>'
nats --server=nats:4222 --creds=/nsc/nkeys/creds/LOCAL/IPAM/USER.creds sub --stream=$NAME
Interacting with the GraphQL queries:
Go to localhost:XXXX/playground
Input:
mutation{
createIPBlockType(
input: {
name:"super-sweet-ip-block-type",
ownerID:"tenants-df234a22-f849-11ed-b67e-0242ac120002"
}
)
{
ipBlockType{
name,
id
}
}
}
Output:
{
"data": {
"createIPBlockType": {
"ipBlockType": {
"name": "super-sweet-ip-block-type",
"id": "ipamibt-9xaBQDAFmLOdceu9zO6Rj"
}
}
}
}
Input:
query{
ipBlockType(id:"ipamibt-9xaBQDAFmLOdceu9zO6Rj"){
name,
id
}
}
Output:
{
"data": {
"ipBlockType": {
"name": "super-sweet-ip-block-type",
"id": "ipamibt-9xaBQDAFmLOdceu9zO6Rj"
}
}
}
Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
To contact the maintainers, please open a GithHub Issue