Configuring the webhook service for usage data

The Skytap Cloud webhook service provides Skytap Cloud account usage data in real time to a URL that you choose. Because the data is streamed continuously, you don’t need to query Skytap Cloud for updated information.

The usage webhook service provides account-wide usage data—exactly the same data available from the administrator Reporting page—in a real-time, continuous data stream.

Use the webhook service to create custom applications and reports. For example, if your organization uses scripts or other automation to add and remove VMs to a DNS server or Active Directory Domain server, the usage webhook can provide environment data that the scripts can consume to automate these tasks.

To configure the usage webhook
  1. Click Manage > Settings to navigate to the Settings page.

    Manage > Settings

  2. Under Usage Webhook, click Enable webhook. The Usage Webhook section expands.

    usage webhook

  3. Type the Webhook URL where the data will be sent. All usage events for the account will be sent to the destination URL.

    The Webhook URL must use HTTPS over port 443.

  4. If the destination site is configured to use TLS encryption (optional, but strongly recommended), type or paste the public Certificate.

    You can use OpenSSL to retrieve the TLS public key with the following command:

    openssl s_client -showcerts -connect {webhookserver}:{port} </dev/null 2>/dev/null\|openssl x509 -outform PEM

  5. Click Save webhook.

If the destination URL is not available or stops responding, the webhook service will attempt to reconnect once per minute for up to six hours or 200 attempts. If it can’t reconnect, the webhook service will be disabled until you reconfigure it.

Skytap webhook data format

The webhook generates a JSON representation of all of the data available from the administrator usage report. For a complete list of usage activities, see Viewing usage data

Example Skytap webhook data payload

{
  "message_id": "1ML590kAilW8XLJpHZtfLq8FsSj",
  "timestamp": "2019-06-07T23:41:44Z",
  "category": "usage",
  "version": 1,
  "payload": [
    {
      "id": 64827451,
      "type": "svms",
      "value": 1,
      "region": "us-west",
      "start_time": "2019/06/07 23:39:36 +0000",
      "end_time": null,
      "entities": [
        {
          "type": "User",
          "id": 100096
        }
      ],
      "resource_details": {
        "id": "7491636",
        "type": "Vm",
        "name": "Windows Server 2003 Standard SP1 licensed on G7 CPU Mask: LockedWestmere",
        "status": "busy",
        "ram": null,
        "cores": 1,
        "paid_rate": {
          "id": null,
          "description": null,
          "vm_instance": {
            "id": null,
            "name": null
          }
        },
        "metering_type": null,
        "vendor": null,
        "new_owner": null,
        "history_id": 144798863
      },
      "configuration_details": {
        "id": "16777800",
        "type": "Environment",
        "name": "Copy of Windows Server 2003 Standard SP1 - Copy",
        "status": "busy",
        "ram": null,
        "cores": null,
        "paid_rate": {
          "id": null,
          "vm_instance": {
            "id": null,
            "name": null
          }
        },
        "metering_type": null,
        "vendor": null,
        "new_owner": null,
        "history_id": 144798863
      },
      "hardware": {
        "architecture": "x86",
        "guestOS": "winnetenterprise"
      },
      "labels": [
        {
          "id": 42766,
          "value": "foo",
          "category": {
            "id": 16200,
            "name": "Category",
            "type": "multi value"
          }
        }
      ]
    }
  ]
}