Ir al contenido

Add a domain

POST/api/v1/deploy/services/{id}/domains

Necesita una clave de API en la cabecera Authorization.

En esta página

Parámetros

CampoEnTipoDescripción
idobligatoriorutastring
A service id, or project/service, or project/environment/service
formatconsultastring
text answers in plain text instead of JSON
  • uno de: json, text

Cuerpo

CampoTipoDescripción
hostnamestring
  • patrón: ^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9-]{2,63}$
targetPortinteger
  • mín.: 1
  • máx.: 65535
certificatestring
  • uno de: le, internal, none
Esquema JSON
{
  "type": "object",
  "properties": {
    "hostname": {
      "type": "string",
      "pattern": "^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9-]{2,63}$"
    },
    "targetPort": {
      "type": "integer",
      "minimum": 1,
      "maximum": 65535
    },
    "certificate": {
      "type": "string",
      "enum": [
        "le",
        "internal",
        "none"
      ]
    }
  }
}

Petición de ejemplo

curl -X POST "https://polaris.example.com/api/v1/deploy/services/{id}/domains" \
  -H "Authorization: Bearer $POLARIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "hostname": "string",
  "targetPort": 1,
  "certificate": "le"
}'

Respuestas

EstadoQué es
201Created

También puede dar los errores comunes 400, 401, 403, 404, 429. Ver errores comunes