Create ingress
Parameters
Returns
Create ingress
package main
import (
"context"
"fmt"
"github.com/onkernel/hypeman-go"
"github.com/onkernel/hypeman-go/option"
)
func main() {
client := hypeman.NewClient(
option.WithAPIKey("My API Key"),
)
ingress, err := client.Ingresses.New(context.TODO(), hypeman.IngressNewParams{
Name: "my-api-ingress",
Rules: []hypeman.IngressRuleParam{hypeman.IngressRuleParam{
Match: hypeman.IngressMatchParam{
Hostname: "{instance}.example.com",
},
Target: hypeman.IngressTargetParam{
Instance: "{instance}",
Port: 8080,
},
}},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", ingress.ID)
}
{
"id": "2OgJqXsP7j1qLVVYvGJDNiYVlPO",
"created_at": "2025-01-15T10:00:00Z",
"name": "my-api-ingress",
"rules": [
{
"match": {
"hostname": "{instance}.example.com",
"port": 8080
},
"target": {
"instance": "{instance}",
"port": 8080
},
"redirect_http": true,
"tls": true
}
]
}
Returns Examples
{
"id": "2OgJqXsP7j1qLVVYvGJDNiYVlPO",
"created_at": "2025-01-15T10:00:00Z",
"name": "my-api-ingress",
"rules": [
{
"match": {
"hostname": "{instance}.example.com",
"port": 8080
},
"target": {
"instance": "{instance}",
"port": 8080
},
"redirect_http": true,
"tls": true
}
]
}