Create ingress
client.ingresses.create(IngressCreateParams { name, rules } body, RequestOptionsoptions?): Ingress { id, created_at, name, rules }
/ingresses
Create ingress
Parameters
Returns
Create ingress
import Hypeman from '@onkernel/hypeman';
const client = new Hypeman({
apiKey: 'My API Key',
});
const ingress = await client.ingresses.create({
name: 'my-api-ingress',
rules: [{ match: { hostname: '{instance}.example.com' }, target: { instance: '{instance}', port: 8080 } }],
});
console.log(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
}
]
}