Saltar al contenido principal
Soporte
0
Contacta con nosotros
English
Nederlands
Deutsch
Servidores dedicadosFlexible VPSTecnología de nubeUbicación compartidaDesafíos en TISectoresCareers
Cloud Compute

Con Cloud Compute, tendrás acceso a un portal desde el que podrás configurar todo tu entorno informático en cualquier momento y desde cualquier lugar del mundo.

Almacenamiento en la nube

Acceso fiable a tus archivos, infraestructura y aplicaciones en todo momento, sin interrupciones ni retrasos. En Worldstream, ofrecemos una gran variedad de soluciones de almacenamiento.

Flexible cloud icon
Nube flexible
Private cloud icon
Nube privada
Bare metal icon
Bare Metal Compute
Hollow cube icon
Almacenamiento de objetos
Hollow cube icon
Almacenamiento de archivos
Block storage icon
Almacenamiento en bloque
Backup storage icon
Almacenamiento de copias de seguridad
¿Necesitas soporte?

Con ingenieros experimentados y un tiempo medio de respuesta de 7 minutos, puedes esperar una solución de soporte técnico sólida muy rápida.

Soporte
Todos los servidores

Elige tu servidor dedicado ahora. Configuración personalizada o entrega inmediata. Servidores potentes diseñados para tu caso de uso.

Casos de uso

Sea cual sea tu caso de uso, te ayudamos a encontrar la solución adecuada.

Deal servers icon
Ofertas
AMD servers icon
Servidores AMD
AI servers icon
Servidores Intel
Hollow cube icon
Virtualización, Contenerización y Orquestación
Hollow cube icon
Sitios web y aplicaciones
Hollow cube icon
Infraestructura para gaming y streaming

Soporte 24/7/365 con un tiempo medio de respuesta de solo 7 minutos. Gracias a nuestros propios centros de datos, nuestros ingenieros pueden acceder directamente a tu servidor para ofrecer soporte rápido y directo. Contáctanos por correo o teléfono en cualquier momento.

Soporte
Externalización inteligente

Algunos aspectos de la TI crean valor añadido, mientras que otros sirven de apoyo. Aprovéchalo como punto de partida para la externalización.

Rentabilidad

Los paquetes informáticos completos pueden parecer la opción segura, pero al considerar los costes, otras opciones suelen tener más sentido.

Flexibilidad y control informáticos

Externalizar no implica perder el control; en realidad proporciona más flexibilidad y control.

Repatriación desde la nube

La nube no es el destino final: debes evaluar y ajustar tu entorno de nube continuamente a medida que cambian las necesidades.

Servicios financieros
Logística y transporte
Venta minorista y comercio electrónico
Medios de comunicación y entretenimiento
Tecnología y desarrollo de software
Seguridad
Proveedores de servicios gestionados
¿Necesitas soporte?

Con ingenieros experimentados y un tiempo medio de respuesta de 7 minutos, puedes esperar una solución de soporte técnico sólida muy rápida.

Habla con nosotrosContacta con nosotros
Acerca de WorldstreamAcerca de la tecnologíaCasosBase de conocimientos
Quiénes somosConoce al equipoTrabaja con nosotrosHazte distribuidorcertificacionesNuestros centros de datosNuestra redProtección DDoSServidores AMD EPYCPartners tecnológicosAcerca de los servidores dedicadosTodos los casosEasyTerraDutch Drone CompanyPerfGridArtículosPreguntas frecuentesNoticias y blogsProductos y servicios
Contacta con nosotros

Llama al +31 (0) 174 – 712 117 Industriestraat 53, Naaldwijk

Contacta con nosotros
Worldstream Portal
English
Nederlands
Deutsch
0
Servidores dedicadosFlexible VPSTecnología de nubeUbicación compartidaDesafíos en TISectoresCareersAcerca de WorldstreamAcerca de la tecnologíaCasosBase de conocimientosMy Worldstream
Contact
Soporte
EnglishNederlandsDeutsch
  1. InicioInicio
  2. Base de conocimientos
  3. API & Automation
  4. Common API automation recipes

Common API automation recipes

Se aplica a All productsAudiencia Developers, operatorsÚltima revisión September 2026

Respuesta rápida

Four patterns cover most day-to-day API automation: polling status on a schedule, rotating an API key before it expires, sending a Slack alert through a webhook, and forwarding webhook events into your own systems. All of them authenticate the same way, with an X-API-Key header, and all of them need to respect the API's rate limit of 200 requests per minute per IP address.

En esta página
  • 1. Check server status on a schedule
  • 2. Rotate an API key before it expires
  • 3. Send a Slack alert when an event fires
  • 4. Forward webhook events into your own monitoring or ticketing system

The API returns HTTP 429 with a Retry-After header once you go over 200 requests per minute per IP. Any script that polls on a schedule, like the one below, should check for a 429 and back off for the duration in that header rather than retrying immediately.

1. Check server status on a schedule

A cron job that polls an endpoint and reacts to the result is the simplest form of automation, and often the first thing teams set up. This example checks a server's status every five minutes and writes a line to a log file if it isn't running.

# crontab -e
*/5 * * * * /usr/local/bin/check-server-status.sh >> /var/log/server-status.log 2>&1
#!/usr/bin/env bash
# check-server-status.sh
# Illustrative pattern only, take the exact endpoint path from Portal's API reference.
set -euo pipefail

API_KEY="<your-api-key>"
SERVER_ID="<server-id>"
STATUS_URL="https://api.worldstream.com/<family>/v1/<command>/$SERVER_ID"

status=$(curl -s -H "X-API-Key: $API_KEY" \
  "$STATUS_URL" | jq -r '.status')

echo "$(date -u +%FT%TZ) server=$SERVER_ID status=$status"

if [ "$status" != "running" ]; then
  echo "WARNING: $SERVER_ID is not running (status: $status)"
fi

Keep the API key out of the script itself. Read it from an environment variable or a secrets manager, and give the key only the permissions it needs, read-only status access rather than a full-access key, if your key permissions support that level of granularity.

2. Rotate an API key before it expires

Keys are created under Developers → API → Keys in Portal with a Key Name, an Expires In value (30 days, 90 days, 180 days, or 1 year), and a Permissions level (Full access, Read only, or Custom). Once that expiry date passes, the key stops working. Rather than waiting for a script to fail in production, generate the replacement key ahead of time and swap it over in your secrets store.

If your account has the API IP allowlist set to Enforce, make sure the host creating the new key is on the allowlist first, otherwise the request that creates it will be denied. Check Recent API key denials on the Keys tab if a rotation script starts failing with a 403.

#!/usr/bin/env bash
# rotate-api-key.sh
# Illustrative pattern only, check the current endpoint in Portal's API reference.
set -euo pipefail

OLD_KEY="<current-api-key>"

new_key_response=$(curl -s -X POST \
  -H "X-API-Key: $OLD_KEY" \
  -H "Content-Type: application/json" \
  -d '<request body, see the API reference in Portal>' \
  "https://api.worldstream.com/<family>/v1/<command>")

new_key=$(echo "$new_key_response" | jq -r '.secret')

# Store the new key in your secrets manager here, then update
# whatever reads it (CI variables, a systemd EnvironmentFile, etc.)
echo "New key created, store it now: $new_key"

# Only revoke the old key once every consumer has been switched over.

Treat key rotation as a two-step process: create and roll out the new key first, confirm everything that depends on it still works, then revoke the old one. Revoking the old key before the new one is in place everywhere will break anything still using it.

3. Send a Slack alert when an event fires

This one doesn't use the API directly, it uses Webhooks, a separate feature under Developers → Webhooks in Portal. Add a webhook there with a Slack-compatible destination URL and set its format to Slack, then narrow it down with the optional, comma-separated Topics field (leave it empty to receive every event type). Take the topic names from the Webhooks page in Portal. Worldstream posts to the URL when the event happens, you don't need to poll for it.

1

Create the webhook

In Portal, go to Developers → Webhooks and select Add webhook. Give it a name, paste in your Slack incoming webhook URL (it must be HTTPS), and set the format to Slack so the payload matches what Slack expects.

2

Send a test event

Use the Test action on the webhook's row to confirm it reaches Slack before relying on it.

3

Keep the signing secret

The signing secret is shown once when the webhook is created. Store it if your receiving side needs to verify that a payload genuinely came from Worldstream, rather than relying on the destination URL being HTTPS alone.

Only enable topics you actually want to act on. A webhook that fires on every event type tends to get muted or ignored, which defeats the point of using one.

4. Forward webhook events into your own monitoring or ticketing system

If Slack isn't where your team tracks things, set the webhook's format to Generic JSON instead and point it at an endpoint you control, such as a small receiver that forwards events into your monitoring stack, ticketing system, or internal chat tool.

# Illustrative receiver, adapt the framework and payload
# handling to whatever your monitoring/ticketing system expects.
# The event_type value below ("resource.event") is a placeholder.
# Use the real topic and event names shown on the Webhooks page in Portal.
from flask import Flask, request

app = Flask(__name__)

@app.route("/webhooks/worldstream", methods=["POST"])
def worldstream_webhook():
    payload = request.get_json()
    event_type = payload.get("event")

    if event_type == "resource.event":
        # forward into your own system here
        pass

    return "", 204

Verify incoming requests against the signing secret before acting on them, so a request that merely knows your endpoint URL can't trigger anything on its own. Take the exact verification method (which header carries the signature, and how it is computed) from the Webhooks documentation in Portal.

Related articles

  • Using the Worldstream API
  • Object Storage: CLI and SDK reference
  • API & Automation overview
¿Te ha resultado útil este artículo?

Informática sólida. Sin sorpresas

Tu socio para la madurez informática
Eliminamos barreras para que puedas correr
Costes previsibles y transparentes

Contacto

  • Industriestraat 53, Naaldwijk
Contacta con nosotros
Worldstream Portal (opens in a new tab)
  • Métodos de pago
  • Abuso
  • Recursos para desarrolladores
  • Centro de operaciones de red
  • Quiénes somos
  • Conoce al equipo
  • Trabaja con nosotros
  • Hazte distribuidor
  • certificaciones
  • Nuestros centros de datos
  • Nuestra red
  • Protección DDoS
  • Servidores AMD EPYC
  • Partners tecnológicos
  • Sistemas operativos
  • Vista general
  • Preguntas frecuentes
  • Casos
  • Noticias y blogs
  • Use Cases
English
Nederlands
Deutsch
English
Nederlands
Deutsch
  • Legal
  • Notificación de vulnerabilidades