NAV Navbar
shell
  • Introduction
  • Details
  • Certificates
  • Alarms
  • Integrations
  • VPC
  • Authentication
  • Formats
  • Status Codes
  • Introduction

    Documentation for CloudKarafka API.

    Details

    Get instance connection details

    curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \
      https://api.cloudkarafka.com/api/details
    

    The above command returns JSON structured like this:

    {
      "name": "test-speedcar",
      "hostname": "test-speedcar.srvs.cloudkafka.com",
      "subnet": "10.128.0.0/24",
      "kafka_version": "1.1.0",
      "connections": {
        "plaintext": {
          "port": 9092
        },
        "ssl": {
          "port": 9093
        },
        "sasl_scram": {
          "port": 9094,
          "username": "aiqasdasda",
          "password": "MFOmvlRPyFKR8asdasdasdasasdas6K"
        }
      },
      "servers": [
        {
          "name": "test-speedcar-01",
          "hostname": "test-speedcar-01.srvs.cloudkafka.com",
          "private_ip": "10.128.0.15",
          "region": "amazon-web-services::us-east-1"
        }
      ]
    }
    

    The connection sasl_scram might now be available to you if you are running a Kafka cluster with Kafka version older than 0.11.0.2.

    HTTP Request

    GET https://api.cloudkarafka.com/api/details

    Certificates

    Get CA certificate

      curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \
      https://api.cloudkarafka.com/api/ca/ca_cert.pem > ca_cert.pem
    

    The above command returns the ca certificate as plaintext which can be written to file

    HTTP Request

    GET https://api.cloudkarafka.com/api/ca/ca_cert.pem

    Sign the certificate

      curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \
      -H "Content-type: application/json" \
      -d '{
        "csr": "the certificate request"
      }' \
      https://api.cloudkarafka.com/api/ca/sign > signed_cert.pem
    

    The above command returns the signed certificate as plaintext which can be written to file

    HTTP Request

    POST https://api.cloudkarafka.com/api/ca/sign

    Request Parameters

    Parameter Description
    csr The content of the certificate signing request

    Alarms

    List active alarms

    curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \
      https://api.cloudkarafka.com/api/alarms
    

    The above command returns JSON structured like this:

    [
      {
        "id": 7395, 
        "type": "cpu", 
        "value_threshold": 90, 
        "time_threshold": 600
      }
    ]
    

    HTTP Request

    GET https://api.cloudkarafka.com/api/alarms

    Configure alarm

    Available alarms:

    HTTP Request

    POST https://api.cloudkarafka.com/api/alarms

    Request Parameters (CPU alarm)

    curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \
      -d "type=cpu&value_threshold=90&time_threshold=600"
      https://api.cloudkarafka.com/api/alarms
    

    This sets the alarm to trigger if the CPU usage is above 90% for 10 minutes or more.

    Parameter Description
    type The type of alarm to set
    value_threshold What value to trigger the alarm for
    time_threshold For how long (in seconds) the value_threshold should be active before trigger alarm

    Request Parameters (Memory alarm)

    curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \
      -d "type=memory&value_threshold=90&time_threshold=600"
      https://api.cloudkarafka.com/api/alarms
    

    This sets the alarm to trigger if the memory usage is above 90% for 10 minutes or more.

    Parameter Description
    type The type of alarm to set
    value_threshold What value to trigger the alarm for
    time_threshold For how long (in seconds) the value_threshold should be active before trigger alarm

    Request Parameters (Disk usage alarm)

    curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \
      -d "type=disk&value_threshold=5&time_threshold=600"
      https://api.cloudkarafka.com/api/alarms
    

    This sets the alarm to trigger if available disk space is below 5Gb for 10 minutes or more.

    Parameter Description
    type The type of alarm to set
    value_threshold What value to trigger the alarm for
    time_threshold For how long (in seconds) the value_threshold should be active before trigger alarm

    Delete alarm

    curl -XDELETE -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \
      -d "type=cpu"
      https://api.cloudkarafka.com/api/alarms
    
    curl -XDELETE -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \
      -d "alarm_id=1234"
      https://api.cloudkarafka.com/api/alarms
    

    HTTP Request

    DELETE https://api.cloudkarafka.com/api/alarms

    URL Parameters

    Parameter Description
    alarm_id Use alarm_id when you want to delete a specific alarm
    type Use type when you want to delete all alarms of one type

    Integrations

    List log integrations

    curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \
      https://api.cloudkarafka.com/api/integrations/logs
    

    The above command returns JSON structured like this:

    [
      {
        "id":10,
        "type":"papertrail",
        "config": {
          "url":"logs.papertrail.com:2123"
        },
        "error": "",
        "account_id": "99ed6d99-fjsd-7d7d-8ujd-2f53asf34weaws"
      }
    ]
    

    HTTP Request

    GET https://api.cloudkarafka.com/api/integrations/logs

    Add log integration

    Available log integrations are:

    HTTP Request

    POST https://api.cloudkarafka.com/api/integrations/logs/<SYSTEM>

    URL Parameters

    Parameter Description
    SYSTEM The logs system to integrate to, any of these: papertrail, loggly, logentries or splunk

    Request Parameters (papertrail)

    curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \
      -d "url=logs.papertrail.com:2123" \
      https://api.cloudkarafka.com/api/integrations/logs/papertrail
    
    Parameter Description
    url The URL to push the logs to

    Request Parameters (loggly)

    curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \
      -d "token=XXXXXXXXX" \
      https://api.cloudkarafka.com/api/integrations/logs/loggly
    
    Parameter Description
    token The token used for authentication

    Request Parameters (logentries)

    curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \
      -d "token=XXXXXXXXXXXXX" \
      https://api.cloudkarafka.com/api/integrations/logs/logentries
    
    Parameter Description
    token A TCP token for authentication

    Request Parameters (splunk)

    curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \
      -d "token=XXXXX&host_port=innput-prd-p-rdq96mdbptj4.cloud.splunk.com:8080" \
      https://api.cloudkarafka.com/api/integrations/logs/splunk
    
    Parameter Description
    token The token used for authentication
    host_port Destination to send the logs

    Delete log integration

    curl -XDELETE -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \
      https://api.cloudkarafka.com/api/integrations/logs/636
    

    HTTP Request

    DELETE https://api.cloudkarafka.com/api/integrations/logs/<INT_ID>

    URL Parameters

    Parameter Description
    INT_ID The ID of the integration to delete

    List metrics integrations

    curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \
      https://api.cloudkarafka.com/api/integrations/metrics
    

    The above command returns JSON structured like this:

    [
      {
        "id":10,
        "type":"datadog",
        "config": {
          "api_key":"THE_API_KEY"
        },
        "error": "",
        "account_id": "99ed6d99-fjsd-7d7d-8ujd-2f53asf34weaws"
      }
    ]
    

    HTTP Request

    GET https://api.cloudkarafka.com/api/integrations/metrics

    Add metrics integration

    Available metrics integrations are:

    HTTP Request

    POST https://api.cloudkarafka.com/api/integrations/metrics/<SYSTEM>

    URL Parameters

    Parameter Description
    SYSTEM The logs system to integrate to

    Request Parameters (CloudWatch)

    curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \
      -d "region=us-west-1&access_key_id=87656789&secret_access_key=09876tyui9876yui98" \
      https://api.cloudkarafka.com/api/integrations/metrics/cloudwatch
    
    Parameter Description
    region The AWS region to use
    access_key_id The access key id to use (Needs to have the PutMetricData permission)
    secret_access_key The secret that goes with the key id

    Request Parameters (Librato)

    curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \
      -d "email=my@email.com&api_key=9876thjio90876tyu" \
      https://api.cloudkarafka.com/api/integrations/metrics/librato
    
    Parameter Description
    email The email registered at librato
    api_key The API key

    Request Parameters (DataDog)

    curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \
      -d "api_key=XXXXXXXXXXXXX" \
      https://api.cloudkarafka.com/api/integrations/metrics/datadog
    
    Parameter Description
    api_key The API key

    Request Parameters (NewRelic)

    curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \
      -d "license_key=XXXXXXXXXXXXXXXXX" \
      https://api.cloudkarafka.com/api/integrations/metrics/newrelic
    
    Parameter Description
    license_key The license key for NewRelic

    Delete metric integration

    curl -XDELETE -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \
      https://api.cloudkarafka.com/api/integrations/metrics/636
    

    HTTP Request

    DELETE https://api.cloudkarafka.com/api/integrations/metrics/<INT_ID>

    URL Parameters

    Parameter Description
    INT_ID The ID of the integration to delete

    VPC

    List peering requests

    curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \
      https://api.cloudkarafka.com/api/vpc-peering
    

    The above command returns JSON structured like this:

    {
      "rows": [
        {
          "tag_set": [],
          "vpc_peering_connection_id": "pcx-98yi98u",
          "requester_vpc_info": {
            "owner_id": "76567890987",
            "vpc_id": "vpc-876thui8",
            "cidr_block": "10.128.0.0/24"
          },
          "accepter_vpc_info": {
            "owner_id": "987687678",
            "vpc_id": "vpc-i876thuio",
            "cidr_block": "10.0.0.0/16"
          },
          "status": {
            "code": "active",
            "message": "Active"
          },
          "routes": [
            {
              "destination": "10.0.0.0/16",
              "state": "active"
            }
          ]
        }
      ],
      "vpc": {
        "id": "vpc-876thui8",
        "name": "test-speedcar",
        "subnet": "10.128.0.0/24"
      }
    }
    

    HTTP Request

    GET https://api.cloudkarafka.com/api/vpc-peering

    Create peering request

    curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \
      -d "peer_account_id=1234567890123456&peer_vpc_id=vpc-0123456789123&peer_subnet=10.20.30.0%2F24" 
      https://api.cloudkarafka.com/api/vpc-peering
    

    This endpoint creates a peering request from the VPC hosting your cluster to the VPC you specify in the request.

    HTTP Request

    POST https://api.cloudkarafka.com/api/vpc-peering

    Request Parameters (AWS)

    Parameter Description
    peer_account_id Your account ID at the cloud provider
    peer_vpc_id Your VPC ID
    peer_subnet Peer subnet, whole or part of your VPC subnet

    Request Parameters (GCP)

    Parameter Description
    peer_network_uri Your GCE network uri
    peer_subnet Your VPC subnet

    Delete peering request

    curl -XDELETE -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \
      https://api.cloudkarafka.com/api/vpc-peering/78
    

    HTTP Request

    DELETE https://api.cloudkarafka.com/api/vpc-peering/<PCX_ID>

    URL Parameters

    Parameter Description
    PCX_ID The ID of the peering connection

    Authentication

    Authentication is done by sending your API key in the user field for Basic Auth

    curl -u :xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx \
      https://api.cloudkarafka.com/api/api/details
    

    You can find your API here on the details page for your instance.

    Formats

    All API end points support form FormData and JSON in the request. You need to format the request accordingly and if you send the request as JSON be sure to add the content type header Content-type: application/json otherwise the server won't be able to parse your request.

    Status Codes

    Error Code Meaning
    400 Bad Request -- Your request is invalid.
    401 Unauthorized -- Your API key is wrong.
    403 Forbidden -- The kitten requested is hidden for administrators only.
    404 Not Found -- The specified kitten could not be found.
    405 Method Not Allowed -- You tried to access a kitten with an invalid method.
    500 Internal Server Error -- We had a problem with our server. Try again later.