Ir al contenido

Set a variable on a service

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

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
keyobligatoriostring
  • patrón: ^[A-Za-z_][A-Za-z0-9_]*$
  • long. máx.: 256
valueobligatoriostring
  • long. máx.: 65536
secretboolean
  • defecto: true
redeployboolean
Redeploy the services this reaches so they pick it up now. Needs the right to deploy.
  • defecto: false
Esquema JSON
{
  "type": "object",
  "properties": {
    "key": {
      "type": "string",
      "pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
      "maxLength": 256
    },
    "value": {
      "type": "string",
      "maxLength": 65536
    },
    "secret": {
      "type": "boolean",
      "default": true
    },
    "redeploy": {
      "type": "boolean",
      "default": false,
      "description": "Redeploy the services this reaches so they pick it up now. Needs the right to deploy."
    }
  },
  "required": [
    "key",
    "value"
  ]
}

Petición de ejemplo

curl -X POST "https://polaris.example.com/api/v1/deploy/services/{id}/variables" \
  -H "Authorization: Bearer $POLARIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "key": "string",
  "value": "string",
  "secret": true,
  "redeploy": false
}'

Respuestas

EstadoQué es
200OK

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