Back to top

Lenses API (v4.3)

Authentication

In order to use the functionality provided by Lenses, the user has to first login. All the available actions, a user can do, are driven by merging all the groups permissions. A user belongs to a least one group. In case of a Service Accounts, there is no login step since the security token has been pre-registered.

Login

Login
POST/api/login

On successful login, it returns the security token each further HTTP request has to provide as an HTTP Header X-Kafka-Lenses-Token: myToken in subsequent requests.

Also bear in mind that Service Account tokens need the account name as well e.g. X-Kafka-Lenses-Token: jenkins-user:jenkins-token

Example URI

POST /api/login
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "user": "admin",
  "password": "admin"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "user": {
      "type": "string",
      "description": "User to login access"
    },
    "password": {
      "type": "string",
      "description": "Password for the user"
    }
  },
  "required": [
    "user",
    "password"
  ]
}
Response  200
HideShow

Contains the full Lenses security token

Headers
Content-Type: text/plain
Body
a1f44cb8-0f37-4b96-828c-57bbd8000000
Response  401
HideShow
Headers
Content-Type: application/json
Body
UNAUTHORIZED

User Details

User Details
GET/api/auth

Returns current user permission

Example URI

GET /api/auth
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "user": "johnsmith",
  "schemaRegistryDelete": false,
  "permissions": [
    "Hello, world!",
    "ViewConnectors",
    "ManageConnectors",
    "ViewKubernetes",
    "ManageKubernetes",
    "ViewDataPolicies",
    "ManageDataPolicies",
    "ViewTopology",
    "ManageTopology",
    "ViewSQLProcessors",
    "ManageSQLProcessors",
    "ViewKafkaSettings",
    "ManageKafkaSettings",
    "ViewAlertRules",
    "ManageAlertRules",
    "ViewSchemaRegistry",
    "ManageSchemaRegistry",
    "ViewUsers",
    "ManageUsers",
    "ViewKafkaConsumers",
    "ManageKafkaConsumers",
    "ViewLogs",
    "ViewAuditLogs",
    "ManageConnections"
  ],
  "security": {
    "ldap": false,
    "kerberos": false,
    "http": false
  },
  "runtime": {
    "adminDefaultPassword": true
  },
  "token": "xxxx"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "user": {
      "type": "string",
      "description": "Username"
    },
    "schemaRegistryDelete": {
      "type": "boolean",
      "description": "Allowed to delete schemas"
    },
    "permissions": {
      "type": "array",
      "description": "All the admin and application permissions linked to this user"
    },
    "security": {
      "type": "object",
      "properties": {
        "ldap": {
          "type": "boolean",
          "description": "If true LDAP is enabled, false otherwise"
        },
        "kerberos": {
          "type": "boolean",
          "description": "If true Kerberos is enabled, false otherwise"
        },
        "http": {
          "type": "boolean",
          "description": "If true Custom HTTP is enabled, false otherwise"
        }
      },
      "required": [
        "ldap",
        "kerberos",
        "http"
      ],
      "description": "Provides details on the authentication modes"
    },
    "runtime": {
      "type": "object",
      "properties": {
        "adminDefaultPassword": {
          "type": "boolean",
          "description": "If true the full admin user has the default password; false otherwise"
        }
      },
      "required": [
        "adminDefaultPassword"
      ],
      "description": "Provides details on runtime"
    },
    "token": {
      "type": "string",
      "description": "Login token"
    }
  },
  "required": [
    "user",
    "schemaRegistryDelete",
    "permissions",
    "security",
    "runtime",
    "token"
  ]
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Logout

Logout
GET/api/logout

Closes the user session and the security token associated with it is dropped.

Example URI

GET /api/logout
Request
HideShow
Headers
Content-Type: application/json
Response  200
HideShow
Headers
Content-Type: application/json
Body
When the operation is successful.
Response  401
HideShow
Headers
Content-Type: application/json
Body
UNAUTHORIZED

List admin permission

List admin permission
GET/api/v1/permission/admin

Returns all the available admin permissions, with a type that should be included in group requested, a name that is a human readable version, and two boolean flags which indicate if the permission can be set to viewable and / or manageable.

Example URI

GET /api/v1/permission/admin
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "name": "Data Policies",
    "viewable": "ViewDataPolicies",
    "manageable": "ManageDataPolicies"
  },
  {
    "name": "Audit Logs",
    "viewable": "ViewAuditLogs",
    "manageable": null
  },
  {
    "name": "User Management",
    "viewable": "ViewUsers",
    "manageable": "ManageUsers"
  },
  {
    "name": "Alert Rules",
    "viewable": "ViewAlertRules",
    "manageable": "ManageAlertRules"
  },
  {
    "name": "Kafka Settings",
    "viewable": "ViewKafkaSettings",
    "manageable": "ManageKafkaSettings"
  }
]
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "view" permission.

List supported security types

List supported security types
GET/api/v1/security/type/user

Returns all supported user types.

Example URI

GET /api/v1/security/type/user
Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  "BASIC",
  "KERBEROS"
]
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "view" permission.

SSO

These are the APIs offered for Single Sign On functionality. Currently, SAML 2.0 is supported, where the user’s browser is involved in performing redirections between Lenses and the Identity Provider.

As such, most of these calls are expected to be called via a browser, usually, through Lenses’ Front End.

SAML Login

SAML Login
POST/api/v2/login/saml

Initiates the SAML SSO protocol with the configured external Identity Provider (IdP). This is a browser-based API.

Example URI

POST /api/v2/login/saml
Response  302
HideShow
Headers
Location: https://my.saml.sso.provider
Set-Cookie: ll.pac4j=xxxx

SAML Callback

SAML Callback
POST/api/v2/auth/saml/callback{?client_name}

The endpoint for the external SAML SSO Identity Provider (IdP) to call returning the authenticated-user data. This is a browser-based API.

Example URI

POST /api/v2/auth/saml/callback?client_name=SAML2Client
URI Parameters
HideShow
client_name
string (required) Example: SAML2Client

Specify for Lenses to treat it as a SAML protocol

Response  302
HideShow
Headers
Location: https://my.lenses.io?fromSSO=true

SAML Metadata

SAML Metadata
GET/api/v2/auth/saml/sp-metadata

The Lenses SAML XML metadata as a Service Provider (SP).

Example URI

GET /api/v2/auth/saml/sp-metadata
Response  200
HideShow
Headers
Content-Type: application/xml
Body
<?xml version="1.0" encoding="UTF-8"?>
    <md:EntityDescriptor ID="_8fee9967daba4dd2a13e82c0feeb6f6b1b907ec" entityID="https://my.lenses.io" validUntil="2040-03-27T17:26:53.899Z" xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata">
        <md:Extensions xmlns:alg="urn:oasis:names:tc:SAML:metadata:algsupport">
            <alg:SigningMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
            <alg:SigningMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha384"/>
            <alg:SigningMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"/>
            <alg:SigningMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
            <alg:SigningMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256"/>
            <alg:SigningMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384"/>
            <alg:SigningMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512"/>
            <alg:SigningMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1"/>
            <alg:SigningMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1"/>
            <alg:SigningMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#hmac-sha256"/>
            <alg:SigningMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#hmac-sha384"/>
            <alg:SigningMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#hmac-sha512"/>
            <alg:SigningMethod Algorithm="http://www.w3.org/2000/09/xmldsig#hmac-sha1"/>
            <alg:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
            <alg:DigestMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#sha384"/>
            <alg:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
        </md:Extensions>
        <md:SPSSODescriptor AuthnRequestsSigned="false" WantAssertionsSigned="false" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol urn:oasis:names:tc:SAML:1.0:protocol urn:oasis:names:tc:SAML:1.1:protocol">
            <md:Extensions xmlns:init="urn:oasis:names:tc:SAML:profiles:SSO:request-init">
                <init:RequestInitiator Binding="urn:oasis:names:tc:SAML:profiles:SSO:request-init" Location="https://my.lenses.io/api/v2/auth/saml/callback?client_name=SAML2Client"/>
            </md:Extensions>
            <md:KeyDescriptor use="signing">
                <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
                    <ds:X509Data>
                        <ds:X509Certificate>xxxx</ds:X509Certificate>
                    </ds:X509Data>
                </ds:KeyInfo>
            </md:KeyDescriptor>
            <md:KeyDescriptor use="encryption">
                <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
                    <ds:X509Data>
                        <ds:X509Certificate>xxxx</ds:X509Certificate>
                    </ds:X509Data>
                </ds:KeyInfo>
            </md:KeyDescriptor>
            <md:SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://my.lenses.io/api/v2/auth/saml/callback?client_name=SAML2Client&amp;logoutendpoint=true"/>
            <md:SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST-SimpleSign" Location="https://my.lenses.io/api/v2/auth/saml/callback?client_name=SAML2Client&amp;logoutendpoint=true"/>
            <md:SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="https://my.lenses.io/api/v2/auth/saml/callback?client_name=SAML2Client&amp;logoutendpoint=true"/>
            <md:SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP" Location="https://my.lenses.io/api/v2/auth/saml/callback?client_name=SAML2Client&amp;logoutendpoint=true"/>
            <md:NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:transient</md:NameIDFormat>
            <md:NameIDFormat>urn:oasis:names:tc:SAML:2.0:nameid-format:persistent</md:NameIDFormat>
            <md:NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress</md:NameIDFormat>
            <md:NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified</md:NameIDFormat>
            <md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://my.lenses.io/api/v2/auth/saml/callback?client_name=SAML2Client" index="0"/>
        </md:SPSSODescriptor>
    </md:EntityDescriptor>

Admin Kafka

Lenses APIs for managing Kafka.

Your user or Service Account will require the permission Kafka Settings to utilize the bellow APIs.

ACL

APIs for managing Kafka Access Control Lists

List Kafka ACL
GET/api/acl

Example URI

GET /api/acl
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Body
{
  "resourceType": "Topic",
  "resourceName": "trades",
  "principal": "User:Alice",
  "permissionType": "Allow",
  "patternType": "LITTERAL",
  "host": "Hello, world!",
  "operation": "Read"
}
Schema
{
  "type": "object",
  "properties": {
    "resourceType": {
      "enum": [
        "Topic",
        "Group",
        "Cluster",
        "TxnId",
        "DelegationToken"
      ],
      "description": "The Kafka resource type to apply the ACL to"
    },
    "resourceName": {
      "type": "string",
      "description": "The name of the resource to apply the ACL to"
    },
    "principal": {
      "type": "string",
      "description": "The principal to appy the ACL to"
    },
    "permissionType": {
      "enum": [
        "Allow",
        "Deny"
      ],
      "description": "The permission type"
    },
    "patternType": {
      "enum": [
        "LITTERAL",
        "PREFIXED"
      ],
      "description": "The pattern type"
    },
    "host": {
      "type": "string",
      "description": "The hosts to apply the ACL to"
    },
    "operation": {
      "enum": [
        "Read",
        "Write",
        "Describe",
        "Delete",
        "DescribeConfigs",
        "AlterConfigs",
        "IdempotentWrite",
        "ClusterAction"
      ],
      "description": "The operation type"
    }
  },
  "required": [
    "resourceType",
    "resourceName",
    "principal",
    "permissionType",
    "host",
    "operation"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "acls": [
    {
      "resourceType": "Topic",
      "resourceName": "trades",
      "principal": "User:Alice",
      "permissionType": "Allow",
      "patternType": "LITTERAL",
      "host": "Hello, world!",
      "operation": "Read"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "acls": {
      "type": "array"
    }
  }
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Create or update an ACL
PUT/api/acl

The following operations are valid (depending on the Kafka version)

  • Topic : “Read” | “Write” | “Describe” | “Delete” | “DescribeConfigs” | “AlterConfigs” | “All”

  • Group : “Read” | “Describe” | “Delete” | “All”

  • Cluster : “Create” | “ClusterAction” | “DescribeConfigs” | “AlterConfigs” | “IdempotentWrite” | “Alter” | “Describe” | “All”

  • TransactionalId : “Describe” | “Write” | “All”

  • DelegationToken : “Describe” | “All”

Example URI

PUT /api/acl
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Body
{
  "resourceType": "Topic",
  "resourceName": "trades",
  "principal": "User:Alice",
  "permissionType": "Allow",
  "patternType": "LITTERAL",
  "host": "Hello, world!",
  "operation": "Read"
}
Schema
{
  "type": "object",
  "properties": {
    "resourceType": {
      "enum": [
        "Topic",
        "Group",
        "Cluster",
        "TxnId",
        "DelegationToken"
      ],
      "description": "The Kafka resource type to apply the ACL to"
    },
    "resourceName": {
      "type": "string",
      "description": "The name of the resource to apply the ACL to"
    },
    "principal": {
      "type": "string",
      "description": "The principal to appy the ACL to"
    },
    "permissionType": {
      "enum": [
        "Allow",
        "Deny"
      ],
      "description": "The permission type"
    },
    "patternType": {
      "enum": [
        "LITTERAL",
        "PREFIXED"
      ],
      "description": "The pattern type"
    },
    "host": {
      "type": "string",
      "description": "The hosts to apply the ACL to"
    },
    "operation": {
      "enum": [
        "Read",
        "Write",
        "Describe",
        "Delete",
        "DescribeConfigs",
        "AlterConfigs",
        "IdempotentWrite",
        "ClusterAction"
      ],
      "description": "The operation type"
    }
  },
  "required": [
    "resourceType",
    "resourceName",
    "principal",
    "permissionType",
    "host",
    "operation"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Delete ACLs
DELETE/api/acl

Example URI

DELETE /api/acl
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Body
{
  "resourceType": "Topic",
  "resourceName": "trades",
  "principal": "User:Alice",
  "permissionType": "Allow",
  "patternType": "LITTERAL",
  "host": "Hello, world!",
  "operation": "Read"
}
Schema
{
  "type": "object",
  "properties": {
    "resourceType": {
      "enum": [
        "Topic",
        "Group",
        "Cluster",
        "TxnId",
        "DelegationToken"
      ],
      "description": "The Kafka resource type to apply the ACL to"
    },
    "resourceName": {
      "type": "string",
      "description": "The name of the resource to apply the ACL to"
    },
    "principal": {
      "type": "string",
      "description": "The principal to appy the ACL to"
    },
    "permissionType": {
      "enum": [
        "Allow",
        "Deny"
      ],
      "description": "The permission type"
    },
    "patternType": {
      "enum": [
        "LITTERAL",
        "PREFIXED"
      ],
      "description": "The pattern type"
    },
    "host": {
      "type": "string",
      "description": "The hosts to apply the ACL to"
    },
    "operation": {
      "enum": [
        "Read",
        "Write",
        "Describe",
        "Delete",
        "DescribeConfigs",
        "AlterConfigs",
        "IdempotentWrite",
        "ClusterAction"
      ],
      "description": "The operation type"
    }
  },
  "required": [
    "resourceType",
    "resourceName",
    "principal",
    "permissionType",
    "host",
    "operation"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Quotas

APIs for managing Kafka Quotas.

Quotas create entries in zookeeper. The paths in zookeeper dictate the following order of precedence:

  1. /config/users//clients/

  2. /config/users//clients/

  3. /config/users/

  4. /config/users//clients/

  5. /config/users//clients/

  6. /config/users/

  7. /config/clients/

  8. /config/clients/

List Kafka Quotas
GET/api/quotas

Returns all the quotas setup in your cluster.

Example URI

GET /api/quotas
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "entityType": "CLIENT",
    "entityName": "CLIENT",
    "child": "id",
    "properties": {
      "producer_byte_rate": "100000",
      "consumer_byte_rate": "200000",
      "request_percentage": "75"
    },
    "url": "/api/quotas/clients"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Create for all users
PUT/api/quotas/users

Create a quota for all users and all clients

Example URI

PUT /api/quotas/users
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Create a quota for a user
PUT/api/quotas/users/{user}

Create a quota for a specific user

Example URI

PUT /api/quotas/users/admin
URI Parameters
HideShow
user
string (required) Example: admin

The user to create the quota for

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Create for all clients of a user
PUT/api/quotas/users/{user}/clients

Create a quota for a specific user for all him client apps

Example URI

PUT /api/quotas/users/admin/clients
URI Parameters
HideShow
user
string (required) Example: admin

The user to create the quota for

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Create for a user and a client
PUT/api/quotas/users/{user}/clients/{client}

Create a quota for a specific client of a specific user

Example URI

PUT /api/quotas/users/admin/clients/client1
URI Parameters
HideShow
user
string (required) Example: admin

The user to create the quota for

client
string (required) Example: client1

The client id to create the quota for

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Delete for all users
DELETE/api/quotas

Delete a quota for all users and all clients. Deletes properties sent in the payload.

Example URI

DELETE /api/quotas
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Delete a user quota
DELETE/api/quotas/users/{user}

Deletes a quota for a specific user. Deletes properties sent in the payload.

Example URI

DELETE /api/quotas/users/admin
URI Parameters
HideShow
user
string (required) Example: admin

The user to create the quota for

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Body
[
  "producer_byte_rate",
  "consumer_byte_rate",
  "request_percentage"
]
Response  200
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Delete for all users
DELETE/api/quotas/users

Deletes the default quota of all users. Deletes properties sent in the payload.

Example URI

DELETE /api/quotas/users
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Delete for a user and all client
DELETE/api/quotas/users/{user}/clients

Delete a quota for a specific user for all clients. Deletes properties sent in the payload.

Example URI

DELETE /api/quotas/users/admin/clients
URI Parameters
HideShow
user
string (required) Example: admin

The user to create the quota for

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Body
[
  "producer_byte_rate",
  "consumer_byte_rate",
  "request_percentage"
]
Response  200
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Delete for a user and a client
DELETE/api/quotas/users/{user}/clients/{client}

Delete a quota for a specific user and specific client. Deletes properties sent in the payload.

Example URI

DELETE /api/quotas/users/admin/clients/client1
URI Parameters
HideShow
user
string (required) Example: admin

The user to create the quota for

client
string (required) Example: client1

The client id to create the quota for

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Body
[
  "producer_byte_rate",
  "consumer_byte_rate",
  "request_percentage"
]
Response  200
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Create for all clients
PUT/api/quotas/clients

Create a quota for all clients

Example URI

PUT /api/quotas/clients
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Create a quota for a client
PUT/api/quotas/clients/{client}

Create a quota for a specific client

Example URI

PUT /api/quotas/clients/client1
URI Parameters
HideShow
client
string (required) Example: client1

The client id to create the quota for

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Delete for all clients
DELETE/api/quotas/clients

Delete a quota for all clients. Deletes properties sent in the payload.

Example URI

DELETE /api/quotas/clients
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Body
[
  "producer_byte_rate",
  "consumer_byte_rate",
  "request_percentage"
]
Response  200
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Delete a client quota
DELETE/api/quotas/clients/{client}

Delete a quota for a specific clients. Deletes properties sent in the payload.

Example URI

DELETE /api/quotas/clients/client1
URI Parameters
HideShow
client
string (required) Example: client1

The client id to create the quota for

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Body
[
  "producer_byte_rate",
  "consumer_byte_rate",
  "request_percentage"
]
Response  200
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Connectors

Lenses APIs to manage Kafka Connect connectors. Note that these endpoints send the requests to the underlying Kafka Connect cluster, and the response sent to the client is simply the response from the cluster. Accordingly, to get details of the response for a given endpoint, please consult the Kafka Connect REST API documentation for your version of Kafka.

Connectors

List active connectors
GET/api/proxy-connect/{clusterAlias}/connectors

Example URI

GET /api/proxy-connect/clusterAlias/connectors
URI Parameters
HideShow
clusterAlias
string (required) 

The connect cluster alias name

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
+ Attributes (Kafka Connect API Response)
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Create new connector
POST/api/proxy-connect/{clusterAlias}/connectors

Example URI

POST /api/proxy-connect/clusterAlias/connectors
URI Parameters
HideShow
clusterAlias
string (required) 

The connect cluster alias name

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
+ Attributes (Kafka Connect API Response)
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Running Connectors

Get information about a specific connector
GET/api/proxy-connect/{clusterAlias}/connectors/{connectorName}

Example URI

GET /api/proxy-connect/clusterAlias/connectors/connectorName
URI Parameters
HideShow
clusterAlias
string (required) 

The connect cluster alias name

connectorName
string (required) 

The connector name to get information for

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
+ Attributes (Kafka Connect API Response)
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Remove a running connector
DELETE/api/proxy-connect/{clusterAlias}/connectors/{connectorName}

Example URI

DELETE /api/proxy-connect/clusterAlias/connectors/connectorName
URI Parameters
HideShow
clusterAlias
string (required) 

The connect cluster alias name

connectorName
string (required) 

The unique connector name

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
+ Attributes (Kafka Connect API Response)
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Get connector config
GET/api/proxy-connect/{clusterAlias}/connectors/{connectorName}/config

Example URI

GET /api/proxy-connect/clusterAlias/connectors/connectorName/config
URI Parameters
HideShow
clusterAlias
string (required) 

The connect cluster alias name

connectorName
string (required) 

The connector name to get information for

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
+ Attributes (Kafka Connect API Response)
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Set connector config
PUT/api/proxy-connect/{clusterAlias}/connectors/{connectorName}/config

Example URI

PUT /api/proxy-connect/clusterAlias/connectors/connectorName/config
URI Parameters
HideShow
clusterAlias
string (required) 

The connect cluster alias name

connectorName
string (required) 

The connector name to set information to

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
+ Attributes (Kafka Connect API Response)
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Get connector status
GET/api/proxy-connect/{clusterAlias}/connectors/{connectorName}/status

Example URI

GET /api/proxy-connect/clusterAlias/connectors/connectorName/status
URI Parameters
HideShow
clusterAlias
string (required) 

The connect cluster alias name

connectorName
string (required) 

The connector name to get status for

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
+ Attributes (Kafka Connect API Response)
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Pause a connector
PUT/api/proxy-connect/{clusterAlias}/connectors/{connectorName}/pause

Example URI

PUT /api/proxy-connect/clusterAlias/connectors/connectorName/pause
URI Parameters
HideShow
clusterAlias
string (required) 

The connect cluster alias name

connectorName
string (required) 

The connector name to pause

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
+ Attributes (Kafka Connect API Response)
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Resume a paused connector
PUT/api/proxy-connect/{clusterAlias}/connectors/{connectorName}/resume

Example URI

PUT /api/proxy-connect/clusterAlias/connectors/connectorName/resume
URI Parameters
HideShow
clusterAlias
string (required) 

The connect cluster alias name

connectorName
string (required) 

The connector name to resume

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
+ Attributes (Kafka Connect API Response)
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Restart a connector
POST/api/proxy-connect/{clusterAlias}/connectors/{connectorName}/restart

Example URI

POST /api/proxy-connect/clusterAlias/connectors/connectorName/restart
URI Parameters
HideShow
clusterAlias
string (required) 

The connect cluster alias name

connectorName
string (required) 

The connector name to restart

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
+ Attributes (Kafka Connect API Response)
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

List connector tasks
GET/api/proxy-connect/{clusterAlias}/connectors/{connectorName}/tasks

Example URI

GET /api/proxy-connect/clusterAlias/connectors/connectorName/tasks
URI Parameters
HideShow
clusterAlias
string (required) 

The connect cluster alias name

connectorName
string (required) 

The connector name to get info for

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
+ Attributes (Kafka Connect API Response)
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Get connector task status
GET/api/proxy-connect/{clusterAlias}/connectors/{connectorName}/tasks/{task_id}/status

Example URI

GET /api/proxy-connect/clusterAlias/connectors/connectorName/tasks/task_id/status
URI Parameters
HideShow
clusterAlias
string (required) 

The connect cluster alias name

connectorName
string (required) 

The unique connector name

task_id
string (required) 

The task id to get status

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
+ Attributes (Kafka Connect API Response)
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Restart a connector task
POST/api/proxy-connect/{clusterAlias}/connectors/{connectorName})/tasks/{task_id}/restart

Example URI

POST /api/proxy-connect/clusterAlias/connectors/connectorName)/tasks/task_id/restart
URI Parameters
HideShow
clusterAlias
string (required) 

The connect cluster alias name

connectorName
string (required) 

The unique connector name

task_id
string (required) 

The task id to restart

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
+ Attributes (Kafka Connect API Response)
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

List available connector plugins
GET/api/proxy-connect/{clusterAlias}/connector-plugins

Example URI

GET /api/proxy-connect/clusterAlias/connector-plugins
URI Parameters
HideShow
clusterAlias
string (required) 

The connect cluster alias name

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
+ Attributes (Kafka Connect API Response)
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Data Access

Lenses APIs for SQL.

Query data via SQL

Query data via SQL
GET/api/ws/v2/sql/execute

The client should be configured to handle Websockets. Once the connection has been opened it is expected the client sends one message containing the SQL and the token to the server. If this first message does not arrive the server will cut the connection.

{
  "token": "LENSES SECURITY TOKEN",
  "stats": 2,
  "sql": "YOUR SQL",
  "live": false
}

The client should wait for incoming messages and stop when EOF is received.

Each message starts with data: followed by a number; the number indicates the type of the data received (see below). Based on the message type number, you should handle each message differently. Here are the possible values for the message type:

  • 0 - Heartbeat to keep the connection open, you must SKIP this (add continue), i.e data:0

  • 1 - JSON payload record which contains topic metadata and the value string field which is the data coming from the topic, i.e data:1{timestamp:…, partition:…, value:"{…}"}

  • 2 - Stop JSON message. When received you can exit the loop. It also contains statistics, i.e data:2{isTimeRemaining:true/false, size:…, offsets:…}

  • 3 - Error JSON message (if any) i.e data:3{fromLine:…,toLine:…,fromColumn:…,toColumn:…,error:…}

Example Response for a record (message type 1)

data:1{"timestamp":1532460006300,"partition":2,"key":"{key:\"value\"}","offset":560207858,"topic":"","value":"{the fetched data}"}

Example Response for stop (message type 2)

data:2{"size":2062,"isTimeRemaining":true,"offsets":[{"partition":2,"min":560207858,"max":568636162},{"partition":1,"min":338050641,"max":347448266},{"partition":0,"min":355312551,"max":364217747}],"isStopped":false,"totalRecords":3,"isTopicEnd":false,"skippedRecords":0,"recordsLimit":3,"totalSizeRead":2062}

Example Response for an error (message type 3)

data:3{"fromLine":4,"toLine":4,"fromColumn":1,"toColumn":1,"error":"Invalid syntax.Encountered \"LIIT\" at line 4, column 1.\nWas expecting one of:\n    <EOF> ... "}

Example URI

GET /api/ws/v2/sql/execute
URI Parameters
HideShow
sql
string (required) Example: SELECT+*+FROM+%60topicA%60%0ALIMIT+1000

Encoded URL Lenses SQL query

stats
number (required) Example: 4000

Stats are enabled and pushed out every x(stats=4000 means every 4 seconds)

offsets
boolean (required) Example: false

The end record will pull the offsets for the topic and will be attached to the end record, Optional

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    "data":1,
    {
        "timestamp":1532460006300,
        "partition":2,
        "key":"{\"key\":\"value\"}",
        "offset":560207858,
        "topic":"",
        "value":"{the fetched data}"
    }
}

Delete from Kafka

Delete from Kafka
DELETE/api/topics/{topicName}/{partition}/{offset}

Delete Records from Topic/Partition up to a specified Offset

This works only for kafka versions 0.11+

Example URI

DELETE /api/topics/trades/1/1000
URI Parameters
HideShow
topicName
string (required) Example: trades

The topic name to delete from

partition
number (required) Example: 1

The partition to delete from

offset
number (required) Example: 1000

The offset to delete upto

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
Records deleted
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied
Response  404
HideShow
Headers
Content-Type: text/plain
Body
Not found

Data Entities

APIs for managing data entities in:

  • Apache Kafka

  • ElasticSearch

Apache Kafka Topics

APIs for managing Apache Kafka topics

Create topic
POST/api/topics/

Create a new Kafka topic

Example URI

POST /api/topics/
Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Body
{
  "topicName": "newTopicName",
  "replication": 1,
  "partitions": 1,
  "configs": {
    "key": "cleanup.policy",
    "value": "compact"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "topicName": {
      "type": "string",
      "description": "The topic name to create"
    },
    "replication": {
      "type": "number",
      "description": "Replication factor",
      "default": 1
    },
    "partitions": {
      "type": "number",
      "description": "Number of partitions",
      "default": 1
    },
    "configs": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "The new topic key"
        },
        "value": {
          "type": "string",
          "description": "The new value for the topic config key"
        }
      },
      "required": [
        "key",
        "value"
      ],
      "description": "key value topic configurations"
    }
  },
  "required": [
    "topicName"
  ]
}
Response  400
HideShow
Headers
Content-Type: text/plain
Body
Error Message
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Get extended info for all topics
GET/api/topics

Returns description of all topics.

Example URI

GET /api/topics
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "topicName": "trades",
    "partitions": 3,
    "replication": 1,
    "isControlTopic": false,
    "isCompacted": false,
    "keyType": "STRING",
    "valueType": "JSON",
    "totalMessages": 10000,
    "configs": [
      {
        "name": "retention.bytes",
        "value": "10 GB",
        "defaultValue": "Hello, world!",
        "documentation": "Hello, world!"
      }
    ],
    "consumers": [
      {
        "id": "cg",
        "coordinator": [
          {
            "id": 1,
            "host": "Hello, world!",
            "port": 1,
            "rack": "Hello, world!"
          }
        ],
        "active": false,
        "state": "Rebalancing",
        "consumers": [
          "c1",
          "c2"
        ],
        "consumersCount": 2,
        "topicPartitionsCount": 4
      }
    ],
    "messagesPerPartition": [
      {
        "partition": 3,
        "messages": 1549,
        "begin": 1000,
        "end": 1718
      }
    ],
    "messagesPerSecond": 10,
    "isMarkedForDeletion": false,
    "timestamp": 1573212526,
    "keySchema": "Hello, world!",
    "valueSchema": "Hello, world!",
    "permissions": [
      "QueryTopic",
      "ShowTopic"
    ],
    "description": "STRING",
    "tags": [
      {
        "name": "location"
      }
    ]
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}
Response  400
HideShow
Headers
Content-Type: text/plain
Body
Error Message
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Get topic info
GET/api/topics/{topicName}

Returns description of the specified topic

Example URI

GET /api/topics/topicName
URI Parameters
HideShow
topicName
string (required) 

The topic to retrieve

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "topicName": "trades",
  "partitions": 3,
  "replication": 1,
  "isControlTopic": false,
  "isCompacted": false,
  "keyType": "STRING",
  "valueType": "JSON",
  "totalMessages": 10000,
  "configs": [
    {
      "name": "retention.bytes",
      "value": "10 GB",
      "defaultValue": "Hello, world!",
      "documentation": "Hello, world!"
    }
  ],
  "consumers": [
    {
      "id": "cg",
      "coordinator": [
        {
          "id": 1,
          "host": "Hello, world!",
          "port": 1,
          "rack": "Hello, world!"
        }
      ],
      "active": false,
      "state": "Rebalancing",
      "consumers": [
        "c1",
        "c2"
      ],
      "consumersCount": 2,
      "topicPartitionsCount": 4
    }
  ],
  "messagesPerPartition": [
    {
      "partition": 3,
      "messages": 1549,
      "begin": 1000,
      "end": 1718
    }
  ],
  "messagesPerSecond": 10,
  "isMarkedForDeletion": false,
  "timestamp": 1573212526,
  "keySchema": "Hello, world!",
  "valueSchema": "Hello, world!",
  "permissions": [
    "QueryTopic",
    "ShowTopic"
  ],
  "description": "STRING",
  "tags": [
    {
      "name": "location"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "topicName": {
      "type": "string",
      "description": "Name of the topic"
    },
    "partitions": {
      "type": "number",
      "description": "The number of partitions in the topic"
    },
    "replication": {
      "type": "number",
      "description": "The topic replication factor"
    },
    "isControlTopic": {
      "type": "boolean",
      "description": "Flag indicating that the topic is a Lenses control topic"
    },
    "isCompacted": {
      "type": "boolean",
      "description": "Flag indicating that the topic is log compacted"
    },
    "keyType": {
      "type": "string",
      "description": "The data type for the key currently set in Lenses"
    },
    "valueType": {
      "type": "string",
      "description": "The data type for the value currently set in Lenses"
    },
    "totalMessages": {
      "type": "number",
      "description": "Total number of messages currently measured"
    },
    "configs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The name of the property"
          },
          "value": {
            "type": "string",
            "description": "The value of this property for the current topic"
          },
          "defaultValue": {
            "type": "string",
            "description": "The default value of the property"
          },
          "documentation": {
            "type": "string",
            "description": "Description of the property"
          }
        },
        "required": [
          "name",
          "value"
        ]
      },
      "description": "The configuration values for the topic"
    },
    "consumers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "645 (required, string) - Id for the group"
          },
          "coordinator": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "number",
                  "description": "Id of coordinator"
                },
                "host": {
                  "type": "string",
                  "description": "Host of coordinator"
                },
                "port": {
                  "type": "number",
                  "description": "Port number of coordinator"
                },
                "rack": {
                  "type": "string",
                  "description": "Rack of coordinator"
                }
              },
              "required": [
                "id",
                "host",
                "port",
                "rack"
              ]
            }
          },
          "active": {
            "type": "boolean",
            "description": "Flag indicating if the consumer group is active"
          },
          "state": {
            "type": "string",
            "description": "State of the group"
          },
          "consumers": {
            "type": "array",
            "description": "ids of the consumers"
          },
          "consumersCount": {
            "type": "number",
            "description": "The number of consumers"
          },
          "topicPartitionsCount": {
            "type": "number",
            "description": "The number of partitions"
          }
        },
        "required": [
          "active",
          "state",
          "consumers",
          "consumersCount",
          "topicPartitionsCount"
        ]
      },
      "description": "The number of consumers consuming this topic"
    },
    "messagesPerPartition": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "partition": {
            "type": "number",
            "description": "The number of partitions in the topic"
          },
          "messages": {
            "type": "number",
            "description": "The total number of messages on the partition"
          },
          "begin": {
            "type": "number",
            "description": "The offset of the first message on the topic"
          },
          "end": {
            "type": "number",
            "description": "The offset of the latest on the topic"
          }
        },
        "required": [
          "partition",
          "messages",
          "begin",
          "end"
        ]
      },
      "description": "The number of messages per second currently measured"
    },
    "messagesPerSecond": {
      "type": "number",
      "description": "The number of messages per second currently measured"
    },
    "isMarkedForDeletion": {
      "type": "boolean",
      "description": "Flag indicating is the topic is marked for deletion"
    },
    "timestamp": {
      "type": "number",
      "description": "Last time this information has been updated"
    },
    "keySchema": {
      "type": "string",
      "description": "json schema for the key"
    },
    "valueSchema": {
      "type": "string",
      "description": "json schema for the value"
    },
    "permissions": {
      "type": "array",
      "description": "Permissions that user has to access this topic"
    },
    "description": {
      "type": "string",
      "description": "Topic description metadata"
    },
    "tags": {
      "type": "array",
      "description": "Topic tags"
    }
  },
  "required": [
    "topicName",
    "partitions",
    "replication",
    "isControlTopic",
    "isCompacted",
    "keyType",
    "valueType",
    "totalMessages",
    "messagesPerSecond",
    "isMarkedForDeletion",
    "timestamp",
    "permissions"
  ]
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied
Response  404
HideShow
Headers
Content-Type: text/plain
Body
Topic summary requested for topic {topicName} but no such summary exists

Get topic list - v1
GET/api/v1/kafka/topics

Returns a list of topics accessible by the user

Example URI

GET /api/v1/kafka/topics
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "topicName": "trades",
    "partitions": 3,
    "replication": 1,
    "isControlTopic": false,
    "keyType": "STRING",
    "valueType": "JSON",
    "totalMessages": 10000,
    "configs": 25,
    "consumers": 1,
    "messagesPerSecond": 10,
    "isMarkedForDeletion": false,
    "isCompacted": false,
    "permissions": [
      "QueryTopic",
      "ShowTopic"
    ]
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}
Response  400
HideShow
Headers
Content-Type: text/plain
Body
Error Message
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Get topic list - v2
GET/api/v2/kafka/topics?pageSize={pageSize}&page={page}&name={name}&sortBy={sortBy}&sortingOrder={sortingOrder}&includeSystemTopics={includeSystemTopics}

Returns description of topics accessible by the user divided into pages. Allows to specify page number and page size.

Example URI

GET /api/v2/kafka/topics?pageSize=25&page=1&name=name&sortBy=partitions&sortingOrder=asc&includeSystemTopics=false
URI Parameters
HideShow
pageSize
number (required) Example: 25

The items per single page, must be greater than zero.

page
number (optional) Example: 1

The page number to be returned, must be greater than zero. Defaults to 1.

name
string (optional) 

Filter topics by name. Only topics with any part of the name matching the parameter value will be included into result.

sortBy
string (optional) Example: partitions

Used for sorting the paged results. Accepts topic field names (e.g. topicName, partitions)

sortingOrder
string (optional) Example: asc

Allows to specify sorting order. Accepted values: asc (ascending, default value), desc (descending)

includeSystemTopics
boolean (optional) Example: false

Allows to include system topics. Default value is false

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "pageCount": 1,
  "topicCount": 100,
  "topics": [
    {
      "topicName": "trades",
      "partitions": 3,
      "replication": 1,
      "isControlTopic": false,
      "keyType": "STRING",
      "valueType": "JSON",
      "totalMessages": 10000,
      "configs": 25,
      "consumers": 1,
      "messagesPerSecond": 10,
      "isMarkedForDeletion": false,
      "isCompacted": false,
      "permissions": [
        "QueryTopic",
        "ShowTopic"
      ]
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "pageCount": {
      "type": "number",
      "description": "The number of pages reflecting the filters given by the user"
    },
    "topicCount": {
      "type": "number",
      "description": "The number of topics accessible by the user filtered by the includeSystemTopics property"
    },
    "topics": {
      "type": "array",
      "description": "The list of the topics"
    }
  }
}
Response  400
HideShow
Headers
Content-Type: text/plain
Body
Error Message
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Update topic
PUT/api/configs/topics/{topicName}

Update topic configuration

Example URI

PUT /api/configs/topics/topicName
URI Parameters
HideShow
topicName
string (required) 

The topic to update/configure

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Body
{
  "configs": [
    {
      "key": "cleanup.policy",
      "value": "compact"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "configs": {
      "type": "array",
      "description": "Example"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: text/plain
Body
"OK"
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Update topic partitions
PUT/api/v1/kafka/topics/{topicName}/partitions

Increase partition count for Kafka Topics

Example URI

PUT /api/v1/kafka/topics/topicName/partitions
URI Parameters
HideShow
topicName
string (required) 

The topic to increase the partitions

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Body
{
  "partitions": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "partitions": {
      "type": "number",
      "description": "6"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: text/plain
Body
"OK"
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Delete topic
DELETE/api/topics/{topicName}

Example URI

DELETE /api/topics/topicName
URI Parameters
HideShow
topicName
string (required) 

The topic to delete

Response  200
HideShow
Headers
Content-Type: text/plain
Body
"OK"
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Topic Meta Data

Metastore operations to set override the key and value types for Apache Kafka topics.

List all tables/topics metadata
GET/api/metadata/topics

Retrieve all data catalog metadata.

Example URI

GET /api/metadata/topics
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "keyType": "AVRO",
    "valueType": "AVRO",
    "topicName": "name",
    "keySchema": "Hello, world!",
    "valueSchema": "Hello, world!"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Get topic metadata
GET/api/metadata/topics/{topicName}

Example URI

GET /api/metadata/topics/topicName
URI Parameters
HideShow
topicName
string (required) 

The topic to get metadata

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: text/plain
Body
{
  "keyType": "AVRO",
  "valueType": "AVRO",
  "topicName": "name",
  "keySchema": "Hello, world!",
  "valueSchema": "Hello, world!"
}
Schema
{
  "type": "object",
  "properties": {
    "keyType": {
      "type": "string",
      "description": "The serde used on the Key"
    },
    "valueType": {
      "type": "string",
      "description": "The serde used on the Value"
    },
    "topicName": {
      "type": "string",
      "description": "The topic name"
    },
    "keySchema": {
      "type": "string",
      "description": "json schema for the key"
    },
    "valueSchema": {
      "type": "string",
      "description": "json schema for the value"
    }
  },
  "required": [
    "keyType",
    "valueType",
    "topicName"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Set topic metadata
POST/api/metadata/topics/{topicName}?keyType={keyType}&valueType={valueType}

Example URI

POST /api/metadata/topics/test?keyType=STRING&valueType=STRING
URI Parameters
HideShow
topicName
string (required) Example: test

The topic to set metadata

keyType
string (required) Example: STRING

The type for the key

valueType
string (required) Example: STRING

The type for the value

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: text/plain
Body
"OK"
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Delete topic metadata
DELETE/api/system/topics/metadata/{topicName}

Example URI

DELETE /api/system/topics/metadata/topicName
URI Parameters
HideShow
topicName
string (required) 

The topic to delete metadata

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: text/plain
Body
"OK"
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

ElasticSearch Indexes

APIs for managing ElasticSearch Indexes

Get ES Indixes list
GET/api/elastic/indexes?{connectionName}&{includeSystemIndexes}

The result will be an array of objects.

This array will by default contain all the indexes of all ES connections. The user will be able to see the Indexes of a single connection through connection name paremeter.

Example URI

GET /api/elastic/indexes?esConnection&includeSystemIndexes
URI Parameters
HideShow
connectionName
string (optional) Example: esConnection

The name of the connection to get indexes from.

includeSystemIndexes
boolean (optional) 

Whether to include the system indexes or not

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "shardsCount": 1,
    "replicas": 0,
    "status": "green",
    "permissions": [
      "ShowTopic",
      "QueryTopic",
      "ViewSchema"
    ],
    "indexName": "position_reports",
    "connectionName esConnection1": "Hello, world!",
    "totalMessages": 872753304,
    "size": 572743304000,
    "keySchema": "STRING",
    "keyType": "STRING",
    "valueSchema": {
      "type": "record",
      "name": "aisClassAPositionReport",
      "namespace": "com.landoop.ais",
      "doc": "Schema for AIS class A Position Reports",
      "fields": [
        {
          "name": "Type",
          "type": "int",
          "doc": "Documentation"
        }
      ]
    },
    "valueType": "JSON"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied
Response  404
HideShow
Headers
Content-Type: text/plain
Body
Not found
Response  500
HideShow
Headers
Content-Type: text/plain
Body
Failed to retrieve ES Indexes. Error [error message]

Details of an ES Index
GET/api/elastic/indexes/{connectionName}/{indexName}

The result will be an object.

Example URI

GET /api/elastic/indexes/esConnection/IndexName
URI Parameters
HideShow
connectionName
string (required) Example: esConnection

The name of the connection to get indexes from

indexName
string (required) Example: IndexName

The name of the index to get records from

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "shards": [
    {
      "shard": "1",
      "records": 4,
      "replicas": 2,
      "availableReplicas": 2
    }
  ],
  "replicas": 0,
  "status": "green",
  "permissions": [
    "ShowTopic",
    "QueryTopic",
    "ViewSchema"
  ],
  "indexName": "position_reports",
  "connectionName": "esConnection1",
  "totalMessages": 872753304,
  "size": 572743304000,
  "keySchema": "STRING",
  "keyType": "STRING",
  "valueSchema": {
    "type": "record",
    "name": "aisClassAPositionReport",
    "namespace": "com.landoop.ais",
    "doc": "Schema for AIS class A Position Reports",
    "fields": [
      {
        "name": "Type",
        "type": "int",
        "doc": "Documentation"
      }
    ]
  },
  "valueType": "JSON",
  "description": "STRING",
  "tags": [
    {
      "name": "location"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "shards": {
      "type": "array",
      "description": "array of the shards of the current index"
    },
    "replicas": {
      "type": "number",
      "description": "the amount of replicas"
    },
    "status": {
      "type": "string",
      "enum": [
        "green",
        "yellow",
        "red"
      ],
      "description": "The status of the index"
    },
    "permissions": {
      "type": "array",
      "description": "List of permissions (using the same permissions with topics)"
    },
    "indexName": {
      "type": "string",
      "description": "The name of the index"
    },
    "connectionName": {
      "type": "string",
      "description": "The name of the ES connection"
    },
    "totalMessages": {
      "type": "number",
      "description": "Total messages"
    },
    "size": {
      "type": "number",
      "description": "total size in bytes"
    },
    "keySchema": {
      "type": "string",
      "description": "the key schema of this index"
    },
    "keyType": {
      "type": "string",
      "description": "Should always be string for ES"
    },
    "valueSchema": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "the type"
        },
        "name": {
          "type": "string",
          "description": "the name"
        },
        "namespace": {
          "type": "string",
          "description": "the namespace"
        },
        "doc": {
          "type": "string",
          "description": "the documentation"
        },
        "fields": {
          "type": "array",
          "description": "array of fields"
        }
      },
      "description": "The value schema of this index"
    },
    "valueType": {
      "type": "string",
      "description": "Should always be JSON for ES"
    },
    "description": {
      "type": "string",
      "description": "Index description metadata"
    },
    "tags": {
      "type": "array",
      "description": "Index tags"
    }
  }
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied
Response  404
HideShow
Headers
Content-Type: text/plain
Body
Not found
Response  500
HideShow
Headers
Content-Type: text/plain
Body
Failed to retrieve ES Indexes. Error [error message]

Datasets

A unified view on Kafka topics and Elasticsearch indexes, allowing to filter by name, field, connection, and other structural properties.

Search datasets
GET/api/v1/datasets?pageSize={pageSize}&page={page}&query={query}&connections={connections}&sortBy={sortBy}&sortingOrder={sortingOrder}&includeSystemEntities={includeSystemEntities}&includeMetadata={includeMetadata}

Example URI

GET /api/v1/datasets?pageSize=25&page=1&query=orders&connections=kafka&sortBy=partitions&sortingOrder=asc&includeSystemEntities=false&includeMetadata=false
URI Parameters
HideShow
pageSize
number (required) Example: 25

The items per single page, must be greater than zero.

page
number (optional) Example: 1

The page number to be returned, must be greater than zero. Defaults to 1.

query
number (optional) Example: orders

A search keyword to match against the dataset name, fields and field descriptions.

connections
array[string] (optional) Example: kafka

A list of connection name to filter the datasets by (an empty value results in no filtering).

sortBy
string (optional) Example: partitions

Used for sorting the paged results. Accepts dataset field names (e.g. name, records, sizeBytes, connectionName, sourceType, etc.)

sortingOrder
string (optional) Example: asc

Allows to specify sorting order. Accepted values: asc (ascending, default value), desc (descending)

includeSystemEntities
boolean (optional) Example: false

Allows to include system topics (e.g. Kafka’s __consumer_offsets). Default value is false.

includeMetadata
boolean (optional) Example: false

Whether to search only by table name, or also to include field names/documentation (defaults to true).

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "datasets": {
    "values": [
      {
        "name": "telecom_italia",
        "highlights": [],
        "records": 80000000,
        "recordsPerSecond": 1813,
        "keyType": "AVRO",
        "valueType": "AVRO",
        "connectionName": "Kafka",
        "replication": 1,
        "consumers": 0,
        "partitions": 6,
"retentionMs": 604800000,
"retentionBytes": -1,
        "fields": {
          "key": [],
          "value": [
            {
              "name": "name",
              "type": "STRING",
              "ancestors": [],
              "highlights": [
                {
                  "fieldName": "name",
                  "startIndex": 1,
                  "endIndex": 5,
                  "arrayIndex": 0
                }
              ]
            }
          ]
        },
        "isSystemEntity": false,
        "isMarkedForDeletion": false,
        "isCompacted": false,
        "sizeBytes": 25,
        "policies": [],
        "permissions": [
          "ShowTopic"
        ],
"tags": [{"name": "example"}]
"description": "a sample Kafka dataset",
        "sourceType": "Kafka"
      },
      {
        "name": "bank",
        "highlights": [],
        "sizeBytes": 487000,
        "records": 1000,
        "connectionName": "es6b",
        "replicas": 5,
        "shard": 5,
        "fields": {
          "key": [],
          "value": [
            {
              "name": "firstname",
              "type": "STRING",
              "description": "The customer first name",
              "ancestors": [],
              "highlights": [
                {
                  "fieldName": "name",
                  "startIndex": 5,
                  "endIndex": 9,
                  "arrayIndex": 0
                },
                {
                  "fieldName": "description",
                  "startIndex": 18,
                  "endIndex": 22,
                  "arrayIndex": 0
                }
              ]
            },
            {
              "name": "lastname",
              "type": "STRING",
              "ancestors": [],
              "highlights": [
                {
                  "fieldName": "name",
                  "startIndex": 4,
                  "endIndex": 8,
                  "arrayIndex": 0
                }
              ]
            }
          ]
        },
        "isSystemEntity": false,
        "policies": [],
        "permissions": [
          "ShowIndex"
        ],
"tags": [{"name": "example"}]
"description": "a sample Elasticsearch dataset",
        "sourceType": "Elastic"
      }
    ],
    "pagesAmount": 1,
    "totalCount": 2
  },
  "sourceTypes": [
    "Kafka",
    "Elastic"
  ]
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Periodically produced messages
GET/api/v1/datasets/{connectionName}/{entityName}/messages/metrics

Returns list of numbers of produced messages for a given period (last 30 days) on the dataset.

Example URI

GET /api/v1/datasets/kafka/topicA/messages/metrics
URI Parameters
HideShow
connectionName
string (required) Example: kafka

Name of the connection where entity exists

entityName
string (required) Example: topicA

Name of the entity

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
      {
        "date": "2020-05-26T00:00:00Z",
        "messagesCount": 100,
      },
      ...
      {
        "date": "2020-06-24T00:00:00Z",
        "messagesCount": 200
      }
    ]
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied
Response  404
HideShow
Headers
Content-Type: text/plain
Body
The requested resource could not be found.

Live dataset metrics
GET/api/ws/v1/datasets/{connectionName}/{entityName}/metrics

Returns stream of events with live metrics for given dataset.

The client should be configured to handle Websockets. Once the connection has been opened it is expected the client sends one message containing the token to the server. If this first message does not arrive the server will cut the connection.

{
  "token": "LENSES SECURITY TOKEN",
}

The client should wait for incoming messages.

Each message should contain a “type” key that indicates the content of the message.

  • HEARTBEAT - Heartbeat to keep the connection open, you must SKIP this (add continue)

  • DATA - JSON payload for the apps listing records

  • ERROR - Error message. json {type: "ERROR": message: "Error from server"}

Lifecycle:

  1. First send a DATA type message including the initial data
  2. Then send HEARTBEAT types of messages until we have an update of metrics
  3. Send a DATA type message including the updated metrics - usually should take around 10 seconds between data messages

Example Response for data (message type DATA)

{
   "type":"DATA",
   "data":{
      "Kafka":{
         "dailyMessages":{
            "currentTimestamp":"2020-06-25T12:25:52.044Z",
            "messagesProducedToday":892068
         },
         "topicJmx":{
            "partitions":5,
            "topicData":168768062,
            "messagesInPerSec":20,
            "bytesInPerSec":3556,
            "bytesOutPerSec":0
         },
         "totalMessages":1966297
      }
   }
}

Example Response for error (message type ERROR)

{
    "type": "ERROR"
    "data": {
        "error": "error message"
    }
}

Example Response for keeping the connection alive (message type HEARTBEAT)

{
    "type": "HEARTBEAT"
}

Example URI

GET /api/ws/v1/datasets/kafka/topicA/metrics
URI Parameters
HideShow
connectionName
string (required) Example: kafka

Name of the connection where entity exists

entityName
string (required) Example: topicA

Name of the entity

Update dataset description
PUT/api/v1/datasets/{connectionName}/{entityName}/description

Updates the description metadata of a dataset of a given dataset.

Example URI

PUT /api/v1/datasets/kafka/topicA/description
URI Parameters
HideShow
connectionName
string (required) Example: kafka

Name of the connection where entity exists

entityName
string (required) Example: topicA

Name of the entity

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Body
{
  "description": "Hello, world!"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "description": {
      "type": "string",
      "description": "The new description for the dataset. Blank values like ` ` are not allowed."
    }
  }
}
Response  200
HideShow
Headers
Content-Type: text/plain
Body
"OK"
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "fields": [
    {
      "field": "description",
      "error": "description cannot be over 512 characters"
    }
  ],
  "error": "description is malformed"
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Update dataset tags
PUT/api/v1/datasets/{connectionName}/{entityName}/tags

Updates the tags of a dataset of a given dataset.

The names of the tags should be shorter than 255 chars and cannot contain any whitespace characters.

Example request body

{
    "tags": [
        {"name": "lorem"},
        {"name": "ipsum"}
    ]
}

Example URI

PUT /api/v1/datasets/kafka/topicA/tags
URI Parameters
HideShow
connectionName
string (required) Example: kafka

Name of the connection where entity exists

entityName
string (required) Example: topicA

Name of the entity

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Body
{
  "tags": [
    {
      "name": "location"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "tags": {
      "type": "array",
      "description": "The new tags for the dataset."
    }
  },
  "required": [
    "tags"
  ]
}
Response  200
HideShow
Headers
Content-Type: text/plain
Body
"OK"
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Get Dataset Tags
GET/api/v1/datasets/tags{?query}

Filters the list of matching Tags, based on the user input. The response, will return all the mathcing tags, for the provided query, along with a count for each tag, indicating in how many Datasets, this tag has been assigned.

Example URI

GET /api/v1/datasets/tags?query="Query"
URI Parameters
HideShow
query
string (optional) Example: "Query"

The query to match the tags against.

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Body
{
  "tags": [
    {
      "name": "location"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "tags": {
      "type": "array",
      "description": "The new tags for the dataset."
    }
  },
  "required": [
    "tags"
  ]
}
Response  200
HideShow
Headers
Content-Type: text/plain
Body
{
  "tags": [
    {
      "name": "tag1",
      "count": 1
    }
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "fields": [
    {
      "field": "tags",
      "error": "tag name cannot be over 512 characters"
    }
  ],
  "error": "Tags are malformed"
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Requests

Lenses APIs for requesting/approving/rejecting the creation of Kafka topics.

Requests

Create a Request
POST/api/v1/approvals

Creates a request.

Example URI

POST /api/v1/approvals
Request
HideShow
Headers
X-KafkaTopic-Lenses-Token: XXXXX
Body
{
  "entityName": "topicName",
  "entityType": "KafkaTopic",
  "metadata": {
    "reason": "a random reason"
  },
  "settings": {
    "replication": 2,
    "partitions": 1,
    "topicConfig": {
      "retention.ms": "30000",
      "retention.bytes": "54300",
      "cleanup.policy": "delete"
    },
    "capacity": {
      "recordsSize": 12000,
      "dataProducedPerDay": "200",
      "consumers": "3"
    }
  },
  "type": "CreateEventEntity"
}
Schema
{
  "type": "object",
  "properties": {
    "entityName": {
      "type": "string",
      "description": "the name of the topic"
    },
    "entityType": {
      "type": "string",
      "description": "the type of the requested entity"
    },
    "metadata": {
      "type": "object",
      "properties": {
        "reason": {
          "type": "string",
          "description": "the reason this topic has been requested for creation"
        }
      },
      "description": "the metadata of this topic"
    },
    "settings": {
      "type": "object",
      "properties": {
        "replication": {
          "type": "number",
          "description": "the number of replication"
        },
        "partitions": {
          "type": "number",
          "description": "the number of partitions"
        },
        "topicConfig": {
          "type": "object",
          "properties": {
            "retention.ms": {
              "type": "string",
              "description": "how long to retain the data"
            },
            "retention.bytes": {
              "type": "string",
              "description": "how much data to store in bytes"
            },
            "cleanup.policy": {
              "enum": [
                "delete",
                "compact"
              ],
              "description": "cleanup policy of this topic"
            }
          },
          "description": "the configuration of this topic"
        },
        "capacity": {
          "type": "object",
          "properties": {
            "recordsSize": {
              "type": "number",
              "description": "the max volume size allowed for this record"
            },
            "dataProducedPerDay": {
              "type": "string",
              "description": "expected data produced per day"
            },
            "consumers": {
              "type": "string",
              "description": "the number of consumers"
            }
          },
          "description": "the capacity settings of this topic"
        }
      },
      "description": "the settings of this topic"
    },
    "type": {
      "enum": [
        "CreateEventEntity"
      ],
      "description": "the type of this request"
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{id: "92384-234-23"}
Response  400
HideShow
Headers
Content-Type: text/plain
Body
Bad Request
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

List of Requests
GET/api/v1/approvals?pageSize={pageSize}&page={page}

Returns all Requests.

Example URI

GET /api/v1/approvals?pageSize=10&page=1
URI Parameters
HideShow
page
number (optional) Example: 1

The page number to be returned, must be greater than zero. Defaults to 1.

pageSize
number (required) Example: 10

The elements amount on a single page, must be greater than zero.

approvalStatus
string (optional) Example: Pending

Filter for request status.

entityName
string (optional) Example: topic

Filter for entity names beginning with this.

sortField
string (optional) Example: field

Sort by specific field.

sortOrder
'asc' | 'desc' (optional) Example: field

Sort order.

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "approvalStatus": "Pending",
    "createdAt": "2020",
    "createdBy": "user1",
    "defaultTopicConfig": {
      "retention.ms": "30000",
      "retention.bytes": "54300",
      "cleanup.policy": "delete"
    },
    "entityName": "topicName",
    "entityType": "KafkaTopic",
    "failureReason": "random failure reason",
    "id": "12311",
    "metadata": {
      "reason": "a random reason"
    },
    "rejectionReason": "random rejection reason",
    "reviewedAt": "2020",
    "reviewedBy": "admin",
    "settings": {
      "replication": 2,
      "partitions": 1,
      "topicConfig": {
        "retention.ms": "30000",
        "retention.bytes": "54300",
        "cleanup.policy": "delete"
      },
      "capacity": {
        "recordsSize": 12000,
        "dataProducedPerDay": "200",
        "consumers": "3"
      }
    },
    "type": "Create"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}

Details of a Request
GET/api/v1/approvals/{id}

Returns the details of the request with the specific id.

Example URI

GET /api/v1/approvals/473872
URI Parameters
HideShow
id
string (required) Example: 473872

The id of the request that we want the details of.

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "approvalStatus": "Pending",
  "createdAt": "2020",
  "createdBy": "user1",
  "defaultTopicConfig": {
    "retention.ms": "30000",
    "retention.bytes": "54300",
    "cleanup.policy": "delete"
  },
  "entityName": "topicName",
  "entityType": "KafkaTopic",
  "failureReason": "random failure reason",
  "id": "12311",
  "metadata": {
    "reason": "a random reason"
  },
  "rejectionReason": "random rejection reason",
  "reviewedAt": "2020",
  "reviewedBy": "admin",
  "settings": {
    "replication": 2,
    "partitions": 1,
    "topicConfig": {
      "retention.ms": "30000",
      "retention.bytes": "54300",
      "cleanup.policy": "delete"
    },
    "capacity": {
      "recordsSize": 12000,
      "dataProducedPerDay": "200",
      "consumers": "3"
    }
  },
  "type": "Create"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "approvalStatus": {
      "type": "string",
      "enum": [
        "Pending",
        "Approved",
        "Rejected",
        "Failed"
      ],
      "description": "the status of the request"
    },
    "createdAt": {
      "type": "string",
      "description": "04-06T09:28:22.992Z (string) - the date and time the request got created"
    },
    "createdBy": {
      "type": "string",
      "description": "the user that made the request"
    },
    "defaultTopicConfig": {
      "type": "object",
      "properties": {
        "retention.ms": {
          "type": "string",
          "description": "how long to retain the data"
        },
        "retention.bytes": {
          "type": "string",
          "description": "how much data to store in bytes"
        },
        "cleanup.policy": {
          "type": "string",
          "enum": [
            "delete",
            "compact"
          ],
          "description": "cleanup policy of this topic"
        }
      },
      "description": "The default configs of this topic, applied if the user did not specify configs"
    },
    "entityName": {
      "type": "string",
      "description": "The name of the requested topic"
    },
    "entityType": {
      "type": "string",
      "description": "the type of the requested entity"
    },
    "failureReason": {
      "type": "string",
      "description": "The reason the topic request failed to be approved"
    },
    "id": {
      "type": "string",
      "description": "32-d-213 (string) - The id of the request"
    },
    "metadata": {
      "type": "object",
      "properties": {
        "reason": {
          "type": "string",
          "description": "the reason this topic has been requested for creation"
        }
      },
      "description": "the metadata of this topic"
    },
    "rejectionReason": {
      "type": "string",
      "description": "The reason the topic request got rejected"
    },
    "reviewedAt": {
      "type": "string",
      "description": "04-06T09:28:22.992Z (string) - the date and time the request got reviewed"
    },
    "reviewedBy": {
      "type": "string",
      "description": "the user that reviewed the request"
    },
    "settings": {
      "type": "object",
      "properties": {
        "replication": {
          "type": "number",
          "description": "the number of replication"
        },
        "partitions": {
          "type": "number",
          "description": "the number of partitions"
        },
        "topicConfig": {
          "type": "object",
          "properties": {
            "retention.ms": {
              "type": "string",
              "description": "how long to retain the data"
            },
            "retention.bytes": {
              "type": "string",
              "description": "how much data to store in bytes"
            },
            "cleanup.policy": {
              "type": "string",
              "enum": [
                "delete",
                "compact"
              ],
              "description": "cleanup policy of this topic"
            }
          },
          "description": "the configuration of this topic"
        },
        "capacity": {
          "type": "object",
          "properties": {
            "recordsSize": {
              "type": "number",
              "description": "the max volume size allowed for this record"
            },
            "dataProducedPerDay": {
              "type": "string",
              "description": "expected data produced per day"
            },
            "consumers": {
              "type": "string",
              "description": "the number of consumers"
            }
          },
          "description": "the capacity settings of this topic"
        }
      },
      "description": "the settings of this request"
    },
    "type": {
      "type": "string",
      "enum": [
        "Create"
      ],
      "description": "the type of this request"
    }
  }
}

Approve a Request
PUT/api/v1/approvals/{id}/approve

Approves the request and proceeds to the requested action

Example URI

PUT /api/v1/approvals/473872/approve
URI Parameters
HideShow
id
string (required) Example: 473872

The id of the request that we want to approve.

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  204
HideShow
Headers
Content-Type: No Content
Response  400
HideShow
Headers
Content-Type: text/plain
Body
Bad Request
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Reject a Request
PUT/api/v1/approvals/{id}/reject

Rejects the request.

Example URI

PUT /api/v1/approvals/473872/reject
URI Parameters
HideShow
id
string (required) Example: 473872

The id of the request that we want to approve.

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Body
{
  "rejectionReason": "a random rejection reason"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "rejectionReason": {
      "type": "string",
      "description": "The reason that this request got rejected"
    }
  }
}
Response  204
HideShow
Headers
Content-Type: No Content
Response  400
HideShow
Headers
Content-Type: text/plain
Body
Bad Request
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Data Governance

Lenses APIs for data governance.

Your user or Service Account will require the permission Data Policies to utilize the bellow APIs.

Data Policies

List obfuscation functions
GET/api/protection/static/obfuscation

Returns all available data protection functions as a list of strings. Learn more at https://docs.lenses.io/using-lenses/data-policies/index.html#data-obfuscation

Example URI

GET /api/protection/static/obfuscation
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  "None",
  "All",
  "Email",
  "Initials",
  "First-1",
  "First-2",
  "First-3",
  "First-4",
  "Last-1",
  "Last-2",
  "Last-3",
  "Last-4",
  "Number-to-negative-one",
  "Number-to-zero",
  "Number-to-null"
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied
Response  500
HideShow
Headers
Content-Type: text/plain
Body
Failed to retrieve obfuscation types. Error [error message]

List data categories
GET/api/protection/static/category

Returns the existing categories of sensitive data as a list of strings. Allows Data Officer to monitor sensitive data by category.

Example URI

GET /api/protection/static/category
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  "PII",
  "Financial",
  "Classified"
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

List impact types
GET/api/protection/static/impact

A data policy impact on the data can be assessed by the person setting it.

Example URI

GET /api/protection/static/impact
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  "Low",
  "Medium",
  "High"
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

List all data policies
GET/api/protection/policy

Get all current Data Protection policies - with relevant stats

Example URI

GET /api/protection/policy
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "id": "0",
    "name": "name",
    "category": "category",
    "impactType": "HIGH",
    "obfuscation": "Email",
    "fields": [
      "fields"
    ],
    "datasets": [
      "datasets"
    ],
    "lastUpdated": "2018-12-01 16:00:01",
    "lastUpdatedUser": "admin",
    "impact": [
      null
    ]
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied
Response  500
HideShow
Headers
Content-Type: text/plain
Body
Failed to retrieve policies. Error [error message]

Create new policy
POST/api/protection/policy

Create a new Data Protection Policy that gets activated immediately.

Example URI

POST /api/protection/policy
Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Body
{
  "id": "id",
  "name": "name",
  "category": "category",
  "impactType": "HIGH",
  "obfuscation": "Email",
  "fields": [
    "fields"
  ],
  "datasets": [
    "datasets"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Policy version. All versions share this. Needs to be provided by the client but it will be ignored."
    },
    "name": {
      "type": "string",
      "description": "The name for the entry"
    },
    "category": {
      "type": "string",
      "description": "A grouping offered for the policy entries"
    },
    "impactType": {
      "type": "string",
      "enum": [
        "HIGH",
        "MEDIUM",
        "LOW"
      ],
      "description": "What's the implication of this policy"
    },
    "obfuscation": {
      "type": "string",
      "enum": [
        "Email",
        "Initials",
        "First-1",
        "First-2",
        "First-3",
        "First-4",
        "Last-1",
        "Last-2",
        "Last-3",
        "Last-4",
        "None"
      ],
      "description": "The method used to protect the data"
    },
    "fields": {
      "type": "array",
      "description": "The fields to protect. Periods (`.`) may be used to separate nested fields, and wildcards may be used, e.g. `user.details.*`"
    },
    "datasets": {
      "type": "array",
      "description": "An optional list of the datasets that this policy will affect. If not specified, then the policy will apply to any datasets matching the fields specified in the `fields` parameter. Wildcards may be used, e.g. [\"customer*\", \"*users\"]. Note that `null` rather than an empty array (`[]`) to avoid specifying datasets."
    }
  },
  "required": [
    "name",
    "category",
    "impactType",
    "obfuscation"
  ]
}
Response  201
HideShow
Headers
Content-Type: application/json
Body
Policy created
Response  400
HideShow
Headers
Content-Type: application/json
Body
Failed to create policy. Error [error message]
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied
Response  500
HideShow
Headers
Content-Type: text/plain
Body
Failed to create policy. Error [error message]

Update a policy
PUT/api/protection/policy/{policy_id}

Update a Data Policy by ID

Example URI

PUT /api/protection/policy/0
URI Parameters
HideShow
policy_id
string (required) Example: 0

The unique identifier for the policy

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Body
{
  "id": "id",
  "name": "name",
  "category": "category",
  "impactType": "HIGH",
  "obfuscation": [
    "Email",
    "Initials",
    "First"
  ],
  "fields": [
    "fields"
  ],
  "datasets": [
    "datasets"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Policy version. All versions share this. Needs to be provided by the client but it will be ignored."
    },
    "name": {
      "type": "string",
      "description": "The name for the entry"
    },
    "category": {
      "type": "string",
      "description": "A grouping offered for the policy entries"
    },
    "impactType": {
      "type": "string",
      "enum": [
        "HIGH",
        "MEDIUM",
        "LOW"
      ],
      "description": "What's the implication of this policy"
    },
    "obfuscation": {
      "type": "array",
      "description": "1, First-2, First-3, First-4, Last-1, Last-2, Last-3, Last-4, None (required, enum) - The method used to protect the data"
    },
    "fields": {
      "type": "array",
      "description": "The fields to protect. Periods (`.`) may be used to separate nested fields, and wildcards may be used, e.g. `user.details.*`"
    },
    "datasets": {
      "type": "array",
      "description": "An optional list of the datasets that this policy will affect. If not specified, then the policy will apply to any datasets matching the fields specified in the `fields` parameter. Wildcards may be used, e.g. [\"customer*\", \"*users\"]. Note that `null` rather than an empty array (`[]`) to avoid specifying datasets."
    }
  },
  "required": [
    "name",
    "category",
    "impactType"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
Policy updated
Response  400
HideShow
Headers
Content-Type: application/json
Body
Failed to update policy. Error [error message]
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied
Response  404
HideShow
Headers
Content-Type: application/json
Body
Not found
Response  500
HideShow
Headers
Content-Type: text/plain
Body
Failed to update policy. Error [error message]

List data policy versions
GET/api/protection/policy/{policy_id}/versions

Example URI

GET /api/protection/policy/0/versions
URI Parameters
HideShow
policy_id
string (required) Example: 0

The unique identifier for the policy

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "array": {
    "id": "0",
    "name": "name",
    "category": "category",
    "impactType": "HIGH",
    "obfuscation": "Email",
    "fields": [
      "fields"
    ],
    "datasets": [
      "datasets"
    ],
    "lastUpdated": "2018-12-01 16:00:01",
    "lastUpdatedUser": "admin"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "array": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Policy version. All versions share this"
        },
        "name": {
          "type": "string",
          "description": "The name for the entry"
        },
        "category": {
          "type": "string",
          "description": "A grouping offered for the policy entries"
        },
        "impactType": {
          "type": "string",
          "enum": [
            "HIGH",
            "MEDIUM",
            "LOW"
          ],
          "description": "What's the implication of this policy"
        },
        "obfuscation": {
          "type": "string",
          "enum": [
            "Email",
            "Initials",
            "First-1",
            "First-2",
            "First-3",
            "First-4",
            "Last-1",
            "Last-2",
            "Last-3",
            "Last-4",
            "None"
          ],
          "description": "The method used to protect the data"
        },
        "fields": {
          "type": "array",
          "description": "The fields to protect. Periods (`.`) may be used to separate nested fields, and wildcards may be used, e.g. `user.details.*`"
        },
        "datasets": {
          "type": "array",
          "description": "An optional list of the datasets that this policy will affect. If not specified, then the policy will apply to any datasets matching the fields specified in the `fields` parameter. Wildcards may be used, e.g. [\"customer*\", \"*users\"]. Note that `null` rather than an empty array (`[]`) to avoid specifying datasets."
        },
        "lastUpdated": {
          "type": "string",
          "description": "ISO8601 date timestamp the policy is effective from"
        },
        "lastUpdatedUser": {
          "type": "string",
          "description": "The user who created/changed the entry"
        }
      },
      "description": "Policy versions"
    }
  }
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied
Response  404
HideShow
Headers
Content-Type: application/json
Body
Not found
Response  500
HideShow
Headers
Content-Type: text/plain
Body
Failed to retrieve policy. Error [error message]

Delete policy
DELETE/api/protection/policy/{policy_id}

Delete a Data Policy by ID

Example URI

DELETE /api/protection/policy/0
URI Parameters
HideShow
policy_id
number (required) Example: 0

The unique identifier for the policy

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
Policy [policy_id] deleted
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied
Response  404
HideShow
Headers
Content-Type: application/json
Body
Not found
Response  500
HideShow
Headers
Content-Type: text/plain
Body
Failed to delete policy. Error [error message]

Monitoring

Lenses Monitoring APIs

Alerts

Endpoints to manage Lenses alerts including:

  • alert channels - to dispatch alert events to 3rd party integrations

  • alert settings - to configure the conditions by which alert events are raised, and route those alerts to alert channels

  • alert events - query previously raised alert events

List alert channel templates
GET/api/v1/alert/channel-templates

List alert channel templates with their applicable connections

Example URI

GET /api/v1/alert/channel-templates
Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "id": 439,
    "name": "Slack",
    "templateVersion": 1,
    "version": "1",
    "enabled": true,
    "builtIn": true,
    "metadata": {
      "author": "Lenses",
      "description": "Slack channel template"
    },
    "configuration": [
      {
        "id": 26,
        "key": "username",
        "displayName": "Username",
        "placeholder": "health-bot",
        "description": "The user name to appear in slack as the sender.",
        "type": {
          "name": "STRING",
          "displayName": "String",
          "enumValues": null
        },
        "required": true,
        "provided": false
      },
      {
        "id": 27,
        "key": "channel",
        "displayName": "Channel",
        "placeholder": "#kafka-health",
        "description": "The Slack channel send alerts to.",
        "type": {
          "name": "STRING",
          "displayName": "String",
          "enumValues": null
        },
        "required": true,
        "provided": false
      },
      {
        "id": 28,
        "key": "icon-url",
        "displayName": "Icon URL",
        "placeholder": "http://example.com/slack/mybot/icon.png",
        "description": "The full path to an image to set for the slack message.",
        "type": {
          "name": "STRING",
          "displayName": "String",
          "enumValues": null
        },
        "required": false,
        "provided": false
      }
    ],
    "suitableConnections": [
      {
        "templateName": "Slack",
        "name": "slack-connection"
      }
    ]
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "name": {
      "type": "string"
    },
    "templateVersion": {
      "type": "number"
    },
    "version": {
      "type": "string"
    },
    "enabled": {
      "type": "boolean"
    },
    "builtIn": {
      "type": "boolean"
    },
    "metadata": {
      "type": "object",
      "properties": {
        "author": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "iconUrl": {
          "type": "string"
        }
      },
      "required": [
        "author"
      ]
    },
    "configuration": {
      "type": "array"
    },
    "suitableConnections": {
      "type": "array"
    }
  },
  "required": [
    "id",
    "name",
    "templateVersion",
    "version",
    "enabled",
    "builtIn",
    "metadata",
    "configuration",
    "suitableConnections"
  ]
}

List alert channels
GET/api/v1/alert/channels{?page,pageSize,templateName,channelName,sortField,sortOrder}

Lists alert channels ordered by their creation time (most recent first)

Example URI

GET /api/v1/alert/channels?page=1&pageSize=25&templateName=Slack&channelName=kafka-prd&sortField=updatedAt&sortOrder=desc
URI Parameters
HideShow
page
string (optional) Example: 1

The page number to be fetched, must be greater than zero. Defaults to 1.

pageSize
string (required) Example: 25

The amount of items to return in a single page, must be greater than zero.

templateName
string (optional) Example: Slack

Filter channels by template name.

channelName
string (optional) Example: kafka-prd

Filter channels whith a name matching the supplied string (e.g. kafka-prd would match kafka-prd-pagerduty and kafka-prd-slack).

sortField
string (optional) Example: updatedAt

The field to sort channel results by. Defults to createdAt.

Choices: name templateName createdAt updatedAt

sortOrder
string (optional) Example: desc

Choices: asc desc

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "values": [
    {
      "id": "2c1fc20d-59b4-4f67-8982-6e0377e8fdbd",
      "name": "kafka-prd-health",
      "templateName": "Slack",
      "templateVersion": 1,
      "connectionName": "slack-connection",
      "properties": [
        {
          "key": "username",
          "value": "Lenses"
        },
        {
          "key": "channel",
          "value": "my-kafka-health-prd"
        },
        {
          "key": "icon-url",
          "value": "https://lenses.io/favicon-32x32.png"
        }
      ],
      "createdAt": "2020-03-05T11:47:22.970Z",
      "createdBy": "joe.bloggs",
      "updatedAt": "2020-03-05T11:47:22.970Z",
      "updatedBy": "joe.bloggs",
      "enabled": true
    }
  ],
  "pagesAmount": 1,
  "totalCount": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "values": {
      "type": "array"
    },
    "pagesAmount": {
      "type": "number"
    },
    "totalCount": {
      "type": "number"
    }
  },
  "required": [
    "values",
    "pagesAmount",
    "totalCount"
  ]
}

Create an alert channel
POST/api/v1/alert/channels

The JSON object representing the properties to set this channel with

Example URI

POST /api/v1/alert/channels
Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Body
{
  "name": "kafka-prd-health",
  "templateName": "Slack",
  "connectionName": "slack-connection",
  "properties": [
    {
      "key": "username",
      "value": "Lenses"
    },
    {
      "key": "channel",
      "value": "my-kafka-health-prd"
    },
    {
      "key": "icon-url",
      "value": "https://lenses.io/favicon-32x32.png"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "templateName": {
      "type": "string"
    },
    "connectionName": {
      "type": "string"
    },
    "properties": {
      "type": "array"
    }
  },
  "required": [
    "name",
    "templateName",
    "connectionName",
    "properties"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    "id": "db2391fe-8a71-4bfe-8c42-046201c1cf23",
}
Response  409
HideShow

Responds with Conflict when the supplied channel name is already used

Body
{
  "fields": [
    {
      "field": "Hello, world!",
      "error": "Hello, world!"
    }
  ],
  "error": "Hello, world!",
  "nonFieldErrors": []
}
Schema
{
  "type": "object",
  "properties": {
    "fields": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "field",
          "error"
        ]
      }
    },
    "error": {
      "type": "string"
    },
    "nonFieldErrors": {
      "type": "array",
      "description": "+"
    }
  },
  "required": [
    "fields",
    "error",
    "nonFieldErrors"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  400
HideShow

An object wrapping field validation errors and other error messages

Headers
Content-Type: application/json
Body
{
  "fields": [
    {
      "field": "Hello, world!",
      "error": "Hello, world!"
    }
  ],
  "error": "Hello, world!",
  "nonFieldErrors": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "fields": {
      "type": "array"
    },
    "error": {
      "type": "string"
    },
    "nonFieldErrors": {
      "description": "+"
    }
  },
  "required": [
    "fields",
    "error",
    "nonFieldErrors"
  ]
}

Update an alert channel
PUT/api/v1/alert/channels/{id}

The JSON object representing the properties to set this channel with

Example URI

PUT /api/v1/alert/channels/1812c74a
URI Parameters
HideShow
id
string (required) Example: 1812c74a

5731-4921-9da4-9dd586160ef0 (required) - The alert channel id

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Body
{
  "name": "kafka-prd-health",
  "connectionName": "slack-connection",
  "enabled": true,
  "properties": [
    {
      "key": "username",
      "value": "Lenses"
    },
    {
      "key": "channel",
      "value": "my-kafka-health-prd"
    },
    {
      "key": "icon-url",
      "value": "https://lenses.io/favicon-32x32.png"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "connectionName": {
      "type": "string"
    },
    "enabled": {
      "type": "string"
    },
    "properties": {
      "type": "array"
    }
  },
  "required": [
    "name",
    "connectionName",
    "properties"
  ]
}
Response  204
Response  404
HideShow

Responds with NotFound when the supplied channel id doesn’t match any known channel

Body
{
  "fields": [
    {
      "field": "Hello, world!",
      "error": "Hello, world!"
    }
  ],
  "error": "Hello, world!",
  "nonFieldErrors": []
}
Schema
{
  "type": "object",
  "properties": {
    "fields": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "field",
          "error"
        ]
      }
    },
    "error": {
      "type": "string"
    },
    "nonFieldErrors": {
      "type": "array",
      "description": "+"
    }
  },
  "required": [
    "fields",
    "error",
    "nonFieldErrors"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  409
HideShow

Responds with Conflict when the supplied channel name is already used

Body
{
  "fields": [
    {
      "field": "Hello, world!",
      "error": "Hello, world!"
    }
  ],
  "error": "Hello, world!",
  "nonFieldErrors": []
}
Schema
{
  "type": "object",
  "properties": {
    "fields": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "field",
          "error"
        ]
      }
    },
    "error": {
      "type": "string"
    },
    "nonFieldErrors": {
      "type": "array",
      "description": "+"
    }
  },
  "required": [
    "fields",
    "error",
    "nonFieldErrors"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  400
HideShow

An object wrapping field validation errors and other error messages

Headers
Content-Type: application/json
Body
{
  "fields": [
    {
      "field": "Hello, world!",
      "error": "Hello, world!"
    }
  ],
  "error": "Hello, world!",
  "nonFieldErrors": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "fields": {
      "type": "array"
    },
    "error": {
      "type": "string"
    },
    "nonFieldErrors": {
      "description": "+"
    }
  },
  "required": [
    "fields",
    "error",
    "nonFieldErrors"
  ]
}

Patch an alert channel
PATCH/api/v1/alert/channels/{id}

The JSON object representing the properties to set this channel with

Example URI

PATCH /api/v1/alert/channels/1812c74a
URI Parameters
HideShow
id
string (required) Example: 1812c74a

5731-4921-9da4-9dd586160ef0 (required) - The alert channel id

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Body
{
  "name": "kafka-prd-health",
  "connectionName": "slack-connection",
  "enabled": false,
  "properties": [
    {
      "key": "username",
      "value": "Lenses"
    },
    {
      "key": "channel",
      "value": "my-kafka-health-prd"
    },
    {
      "key": "icon-url",
      "value": "https://lenses.io/favicon-32x32.png"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "connectionName": {
      "type": "string"
    },
    "enabled": {
      "type": "string"
    },
    "properties": {
      "type": "array"
    }
  }
}
Response  204
Response  404
HideShow

Responds with NotFound when the supplied channel id doesn’t match any known channel

Body
{
  "fields": [
    {
      "field": "Hello, world!",
      "error": "Hello, world!"
    }
  ],
  "error": "Hello, world!",
  "nonFieldErrors": []
}
Schema
{
  "type": "object",
  "properties": {
    "fields": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "field",
          "error"
        ]
      }
    },
    "error": {
      "type": "string"
    },
    "nonFieldErrors": {
      "type": "array",
      "description": "+"
    }
  },
  "required": [
    "fields",
    "error",
    "nonFieldErrors"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  409
HideShow

Responds with Conflict when the supplied channel name is already used

Body
{
  "fields": [
    {
      "field": "Hello, world!",
      "error": "Hello, world!"
    }
  ],
  "error": "Hello, world!",
  "nonFieldErrors": []
}
Schema
{
  "type": "object",
  "properties": {
    "fields": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "field",
          "error"
        ]
      }
    },
    "error": {
      "type": "string"
    },
    "nonFieldErrors": {
      "type": "array",
      "description": "+"
    }
  },
  "required": [
    "fields",
    "error",
    "nonFieldErrors"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  400
HideShow

An object wrapping field validation errors and other error messages

Headers
Content-Type: application/json
Body
{
  "fields": [
    {
      "field": "Hello, world!",
      "error": "Hello, world!"
    }
  ],
  "error": "Hello, world!",
  "nonFieldErrors": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "fields": {
      "type": "array"
    },
    "error": {
      "type": "string"
    },
    "nonFieldErrors": {
      "description": "+"
    }
  },
  "required": [
    "fields",
    "error",
    "nonFieldErrors"
  ]
}

Delete an alert channel
DELETE/api/v1/alert/channels/{id}

Permanently delete an alert channel

Example URI

DELETE /api/v1/alert/channels/90cb0419
URI Parameters
HideShow
id
string (required) Example: 90cb0419

5d15-4960-9ea6-2ccb4d26ebb4 (required) - The alert channel id

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  204
Response  404
HideShow

Responds with NotFound when the supplied channel id doesn’t match any known channel

Body
{
  "fields": [
    {
      "field": "Hello, world!",
      "error": "Hello, world!"
    }
  ],
  "error": "Hello, world!",
  "nonFieldErrors": []
}
Schema
{
  "type": "object",
  "properties": {
    "fields": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "field",
          "error"
        ]
      }
    },
    "error": {
      "type": "string"
    },
    "nonFieldErrors": {
      "type": "array",
      "description": "+"
    }
  },
  "required": [
    "fields",
    "error",
    "nonFieldErrors"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}

List alert settings
GET/api/v1/alert/settings

Example URI

GET /api/v1/alert/settings
Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "categories": {
    "Data Produced": [
      {
        "id": 5000,
        "description": "Data Produced",
        "category": "Data Produced",
        "enabled": true,
        "conditionTemplate": null,
        "conditionRegex": null,
        "docs": "Raises an alert when the data produced on a topic doesn't match expected threshold",
        "conditions": null,
        "channels": [],
        "conditionDetails": {
          "bc721865-d0f9-4383-b726-f77a17169888": {
            "createdAt": "2020-06-23T11:13:56.690Z",
            "createdBy": "admin",
            "modifiedAt": "2020-06-23T11:28:09.651Z",
            "modifiedBy": "admin",
            "channels": [
              {
                "id": "04b3fcd6-eece-469f-9d74-5014d96f6909",
                "name": "pagerduty",
                "templateName": "PagerDuty"
              }
            ],
            "conditionDsl": {
              "connectionName": "kafka",
              "datasetName": "nyc_yellow_taxi_trip_data",
              "threshold": {
                "type": "more_than",
                "messages": 10000
              },
              "duration": "PT1M"
            }
          }
        },
        "isAvailable": true
      }
    ],
    "Infrastructure": [
      {
        "id": 1000,
        "description": "Kafka Broker is down",
        "category": "Infrastructure",
        "enabled": true,
        "channels": [
          {
            "id": "3d0bb810-5f45-4945-8086-0f7d4d9a7034",
            "name": "PagerDuty-incidents-prd",
            "templateName": "Pagerduty"
          }
        ],
        "conditionDetails": {},
        "isAvailable": true
      }
    ],
    "Apps": [
      {
        "id": 6000,
        "description": "Connector Failed",
        "category": "Apps",
        "enabled": true,
        "channels": [],
        "conditionDetails": {},
        "isAvailable": true
      }
    ],
    "Consumers": [
      {
        "id": 2000,
        "description": "Consumer Lag exceeded",
        "category": "Consumers",
        "enabled": true,
        "conditionTemplate": "lag >= $Threshold-Number on group $Consumer-Group and topic $Topic-Name",
        "conditionRegex": "lag >= ([1-9][0-9]*) on group (\\b\\S+\\b) and topic (\\b\\S+\\b)",
        "docs": "Raises an alert when the consumer lag exceeds the threshold on any partition.",
        "conditions": {
          "f1074135-133c-46a9-9ca5-fb67682cca40": "lag >= 4000 on group group and topic positions"
        },
        "channels": [],
        "conditionDetails": {
          "f1074135-133c-46a9-9ca5-fb67682cca40": {
            "createdAt": "2020-03-05T11:47:23.416Z",
            "createdBy": "john-doe",
            "modifiedAt": "2020-03-05T11:47:23.416Z",
            "modifiedBy": "joe-bloggs",
            "channels": [
              {
                "id": "29fa0981-e383-401f-b610-f5e1e8d26ce2",
                "name": "slow-consumers-alerts",
                "templateName": "Webhook"
              }
            ],
            "conditionDsl": {
              "group": "group",
              "topic": "positions",
              "threshold": 4000
            }
          }
        },
        "isAvailable": true
      }
    ]
  }
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Update a fixed alert setting
PUT/api/v1/alert/settings/{alert_setting_id}

Update a fixed alert setting.

Example URI

PUT /api/v1/alert/settings/1000
URI Parameters
HideShow
alert_setting_id
string (required) Example: 1000

The Alert ID to enable

Request
HideShow

A request payload specifying whether to enable/disable the alert and supplying a distinct list of channel ids to route this alert to.

Headers
Content-Type: application/json
Body
{
  "enable": true,
  "channels": [
    "56fa0d2c-1f7c-4597-a61b-b52e1b43d81b",
    "dfd6273a-c1b5-4ff5-9b1e-6f3a044d3886"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Ok"
}
Response  404
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Create an alert setting condition
POST/api/v1/alert/settings/{alert_setting_id}/conditions

For conditional rules, create a new custom alert condition.

Example URI

POST /api/v1/alert/settings/2000/conditions
URI Parameters
HideShow
alert_setting_id
string (required) Example: 2000

The Alert ID to enable. ConsumerLag (2000) and DataProduced (5000) support conditions.

Request
HideShow

The custom alert condition and a list of channel ids to route alerts to

Headers
Content-Type: application/json
Body
{
  "condition": {
    "group": "consumer-group1",
    "topic": "__topology",
    "threshold": 4000
  },
  "channels": [
    "5aab1753-7306-489b-8def-da9044a4f171",
    "ae9c809f-0c4b-4380-a8c8-1e1e1394b978"
  ]
}
Response  201
HideShow

The newly created alert condition unique id

Headers
Content-Type: application/json
Body
{
  "id": "1e385be7-8ca0-4c6d-935f-67c7d3761499"
}

Update an alert setting condition
PUT/api/v1/alert/settings/{alert_setting_id}/conditions/{condition_uuid}

For conditional rules, update an existing custom alert condition.

Example URI

PUT /api/v1/alert/settings/2000/conditions/50716b0c
URI Parameters
HideShow
alert_setting_id
string (required) Example: 2000

The Alert ID to enable. ConsumerLag (2000) and DataProduced (5000) support conditions.

condition_uuid
string (required) Example: 50716b0c

a171-48f7-a99f-dff915894f72 (required) - The condition unique identifier

Request
HideShow

The custom alert condition and a list of channel ids to route alerts to

Headers
Content-Type: application/json
Body
{
  "condition": {
    "group": "consumer-group1",
    "topic": "__topology",
    "threshold": 3000
  },
  "channels": [
    "56fa0d2c-1f7c-4597-a61b-b52e1b43d81b",
    "dfd6273a-c1b5-4ff5-9b1e-6f3a044d3886"
  ]
}
Response  200
HideShow
Body
"OK"
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied
Response  404
HideShow
Headers
Content-Type: text/plain
Body
The condition cannot be found

Delete an alert setting condition
DELETE/api/v1/alert/settings/{alert_setting_id}/conditions/{condition_uuid})

Example URI

DELETE /api/v1/alert/settings/2000/conditions/50716b0c)
URI Parameters
HideShow
alert_setting_id
string (required) Example: 2000

The Alert ID to enable. ConsumerLag (2000) and DataProduced (5000) support conditions.

condition_uuid
string (required) Example: 50716b0c

a171-48f7-a99f-dff915894f72 (required) - The condition unique identifier

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: text/plain
Body
"OK"
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied
Response  404
HideShow
Headers
Content-Type: text/plain
Body
The condition cannot be found

List alerts events
GET/api/v1/alert/events{?page,pageSize,summary,category,level,alertId}

Returns alerts events divided into pages. Allows to specify page number and page size.

Example URI

GET /api/v1/alert/events?page=1&pageSize=25&summary=active controllers&category=Infrastructure&level=INFO&alertId=1000
URI Parameters
HideShow
page
number (optional) Example: 1

The page number to be returned, must be greater than zero. Defaults to 1.

pageSize
number (required) Example: 25

The elements amount on a single page, must be greater than zero.

summary
string (optional) Example: active controllers

Allows to filter results by partial summary text

category
enum[string] - Allows to filter results by category (optional) Example: Infrastructure

Allows to filter results by category

Choices: Infrastructure Consumers Kafka Connect Topics

level
string (optional) Example: INFO

Allows to filter results by level

Choices: INFO LOW MEDIUM HIGH CRITICAL

alertId
number (optional) Example: 1000

Allows to filter by alert setting ID

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "pagesAmount": 100,
  "values": [
    {
      "level": "HIGH",
      "category": "Infrastructure",
      "tags": [],
      "instance": "Dev1",
      "summary": "summary",
      "docs": "documentation",
      "timestamp": 1562922234102,
      "alertId": 123,
      "map": [
        {}
      ]
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "pagesAmount": {
      "type": "number",
      "description": "Total amount of pages"
    },
    "values": {
      "type": "array",
      "description": "Alerts"
    }
  },
  "required": [
    "pagesAmount"
  ]
}
Response  400
HideShow
Headers
Content-Type: text/plain
Body
Error Message
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Delete alert events
DELETE/api/v1/alert/events{?timestamp}

Deletes alerts events with timestamps before the specified value

Example URI

DELETE /api/v1/alert/events?timestamp=1562922585000
URI Parameters
HideShow
timestamp
number (required) Example: 1562922585000

Timestamp (milliseconds since the epoch), for which any alerts older than it should be deleted

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Response  400
HideShow
Headers
Content-Type: text/plain
Body
Error Message
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Alert SSE API
GET/api/sse/alerts

The client should be configured to expect Server Side Events

"Accept": "application/json, text/event-stream"

The client should wait(infinite loop/forever) for incoming messages and stop when EOF.

Each message received starts with “data:” and ends with “\n”. If the message has not that prefix, skip it.

Example URI

GET /api/sse/alerts
Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "data": {
    "level": "HIGH",
    "category": "Infrastructure",
    "tags": [],
    "instance": "Dev1",
    "summary": "summary",
    "docs": "documentation",
    "timestamp": 1562922234102,
    "alertId": 123,
    "map": [
      {}
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "level": {
          "type": "string",
          "description": "The type of alert.   INFO, LOW, MEDIUM, HIGH, CRITICAL"
        },
        "category": {
          "type": "string",
          "description": "There are a few categories provided from Infrastructure to Consumers, Topics, Kafka Connect"
        },
        "tags": {
          "type": "array",
          "description": "A sequence of tags for the alert"
        },
        "instance": {
          "type": "string",
          "description": "The Lenses instance. It can be Dev, QA or Prod"
        },
        "summary": {
          "type": "string",
          "description": "Contains the alert information"
        },
        "docs": {
          "type": "string",
          "description": "Contains the documentation link describing how the problem can be solved"
        },
        "timestamp": {
          "type": "number",
          "description": "Unix timestamp of the audit entry"
        },
        "alertId": {
          "type": "number",
          "description": "A unique identified for the alert type."
        },
        "map": {
          "type": "array",
          "description": "A set of key-values entries to allow easier routing of alerts"
        }
      },
      "description": "Alert object"
    }
  }
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Prometheus

Lenses exposes a Prometheus API as it integrates and enriches it. All you need to do is add Lenses as an additional target on your Prometheus collector so it can consume usable metrics via the /metrics API

Prometheus endpoint
GET/metrics

Returns Prometheus formatted information for consumer lags and other kpis

  • Headers

    X-Kafka-Lenses-Token: XXXXX

Example URI

GET /metrics
Response  200
HideShow
Headers
Content-Type: text/plain
Body
# HELP lenses_topic_consumer_lag The lag of Stable consumer groups
# TYPE lenses_topic_consumer_lag gauge
lenses_partition_consumer_lag{topic="iot_data",partition="3",consumerGroup="consumer2"} 537
lenses_topic_consumer_lag{topic="topic1",consumerGroup="consumer1"} 0
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Audit

List audit channel templates
GET/api/v1/audit/channel-templates

List audit channel templates with their applicable connections

Example URI

GET /api/v1/audit/channel-templates
Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "id": 31,
    "name": "Splunk",
    "templateVersion": 1,
    "version": "1",
    "enabled": true,
    "builtIn": true,
    "metadata": {
      "author": "Lenses.io",
      "description": "Splunk Audit Channel"
    },
    "configuration": [
      {
        "id": 164,
        "key": "source",
        "displayName": "Source",
        "placeholder": "lenses-audits",
        "description": "Source to associate with generated Splunk events",
        "type": {
          "name": "STRING",
          "displayName": "String",
          "enumValues": null
        },
        "required": true,
        "provided": false
      }
    ],
    "suitableConnections": [
      {
        "templateName": "Splunk",
        "name": "test-splunk"
      }
    ]
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number"
    },
    "name": {
      "type": "string"
    },
    "templateVersion": {
      "type": "number"
    },
    "version": {
      "type": "string"
    },
    "enabled": {
      "type": "boolean"
    },
    "builtIn": {
      "type": "boolean"
    },
    "metadata": {
      "type": "object",
      "properties": {
        "author": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "iconUrl": {
          "type": "string"
        }
      },
      "required": [
        "author"
      ]
    },
    "configuration": {
      "type": "array"
    },
    "suitableConnections": {
      "type": "array"
    }
  },
  "required": [
    "id",
    "name",
    "templateVersion",
    "version",
    "enabled",
    "builtIn",
    "metadata",
    "configuration",
    "suitableConnections"
  ]
}

List audit channels
GET/api/v1/audit/channels{?page,pageSize,templateName,channelName,sortField,sortOrder}

Lists audit channels ordered by their creation time (most recent first)

Example URI

GET /api/v1/audit/channels?page=1&pageSize=25&templateName=Slack&channelName=kafka&sortField=updatedAt&sortOrder=desc
URI Parameters
HideShow
page
string (optional) Example: 1

The page number to be fetched, must be greater than zero. Defaults to 1.

pageSize
string (required) Example: 25

The amount of items to return in a single page, must be greater than zero.

templateName
string (optional) Example: Slack

Filter channels by template name.

channelName
string (required) Example: kafka

prd (optional) - Filter channels whith a name matching the supplied string (e.g. kafka-prd would match kafka-prd-pagerduty and kafka-prd-slack).

sortField
string (optional) Example: updatedAt

The field to sort channel results by. Defults to createdAt.

Choices: name templateName createdAt updatedAt

sortOrder
string (optional) Example: desc

Choices: asc desc

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "values": [
    {
      "id": "9a123d5d-7e94-4e1b-b16a-4926a0f11496",
      "name": "vag",
      "templateVersion": 1,
      "templateName": "Splunk",
      "connectionName": "test-splunk",
      "properties": [
        {
          "key": "source",
          "value": "splunk-source"
        }
      ],
      "createdAt": "2020-03-21T09:44:47.983Z",
      "createdBy": "admin",
      "updatedAt": "2020-03-21T09:44:47.983Z",
      "updatedBy": "admin",
      "enabled": true
    }
  ],
  "pagesAmount": 1,
  "totalCount": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "values": {
      "type": "array"
    },
    "pagesAmount": {
      "type": "number"
    },
    "totalCount": {
      "type": "number"
    }
  },
  "required": [
    "values",
    "pagesAmount",
    "totalCount"
  ]
}

Create an audit channel
POST/api/v1/audit/channels

The JSON object representing the properties to set this channel with

Example URI

POST /api/v1/audit/channels
Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Body
{
  "name": "splunk-audit-channel",
  "templateName": "Splunk",
  "connectionName": "splunk-connection",
  "properties": [
    {
      "key": "source",
      "value": "splunk-source"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "templateName": {
      "type": "string"
    },
    "connectionName": {
      "type": "string"
    },
    "properties": {
      "type": "array"
    }
  },
  "required": [
    "name",
    "templateName",
    "connectionName",
    "properties"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    "id": "db2391fe-8a71-4bfe-8c42-046201c1cf23",
}
Response  409
HideShow

Responds with Conflict when the supplied channel name is already used

Body
{
  "fields": [
    {
      "field": "Hello, world!",
      "error": "Hello, world!"
    }
  ],
  "error": "Hello, world!",
  "nonFieldErrors": []
}
Schema
{
  "type": "object",
  "properties": {
    "fields": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "field",
          "error"
        ]
      }
    },
    "error": {
      "type": "string"
    },
    "nonFieldErrors": {
      "type": "array",
      "description": "+"
    }
  },
  "required": [
    "fields",
    "error",
    "nonFieldErrors"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  400
HideShow

An object wrapping field validation errors and other error messages

Headers
Content-Type: application/json
Body
{
  "fields": [
    {
      "field": "Hello, world!",
      "error": "Hello, world!"
    }
  ],
  "error": "Hello, world!",
  "nonFieldErrors": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "fields": {
      "type": "array"
    },
    "error": {
      "type": "string"
    },
    "nonFieldErrors": {
      "description": "+"
    }
  },
  "required": [
    "fields",
    "error",
    "nonFieldErrors"
  ]
}

Update an audit channel
PUT/api/v1/audit/channels/{id}

The JSON object representing the properties to set this channel with

Example URI

PUT /api/v1/audit/channels/1812c74a
URI Parameters
HideShow
id
string (required) Example: 1812c74a

5731-4921-9da4-9dd586160ef0 (required) - The audit channel id

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Body
{
  "name": "splunk-audit-channel",
  "templateName": "Splunk",
  "enabled": true,
  "connectionName": "splunk-connection",
  "properties": [
    {
      "key": "source",
      "value": "splunk-source"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "connectionName": {
      "type": "string"
    },
    "enabled": {
      "type": "string"
    },
    "properties": {
      "type": "array"
    }
  },
  "required": [
    "name",
    "connectionName",
    "properties"
  ]
}
Response  204
Response  404
HideShow

Responds with NotFound when the supplied channel id doesn’t match any known channel

Body
{
  "fields": [
    {
      "field": "Hello, world!",
      "error": "Hello, world!"
    }
  ],
  "error": "Hello, world!",
  "nonFieldErrors": []
}
Schema
{
  "type": "object",
  "properties": {
    "fields": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "field",
          "error"
        ]
      }
    },
    "error": {
      "type": "string"
    },
    "nonFieldErrors": {
      "type": "array",
      "description": "+"
    }
  },
  "required": [
    "fields",
    "error",
    "nonFieldErrors"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  409
HideShow

Responds with Conflict when the supplied channel name is already used

Body
{
  "fields": [
    {
      "field": "Hello, world!",
      "error": "Hello, world!"
    }
  ],
  "error": "Hello, world!",
  "nonFieldErrors": []
}
Schema
{
  "type": "object",
  "properties": {
    "fields": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "field",
          "error"
        ]
      }
    },
    "error": {
      "type": "string"
    },
    "nonFieldErrors": {
      "type": "array",
      "description": "+"
    }
  },
  "required": [
    "fields",
    "error",
    "nonFieldErrors"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  400
HideShow

An object wrapping field validation errors and other error messages

Headers
Content-Type: application/json
Body
{
  "fields": [
    {
      "field": "Hello, world!",
      "error": "Hello, world!"
    }
  ],
  "error": "Hello, world!",
  "nonFieldErrors": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "fields": {
      "type": "array"
    },
    "error": {
      "type": "string"
    },
    "nonFieldErrors": {
      "description": "+"
    }
  },
  "required": [
    "fields",
    "error",
    "nonFieldErrors"
  ]
}

Patch an audit channel
PATCH/api/v1/audit/channels/{id}

The JSON object representing the properties to set this channel with

Example URI

PATCH /api/v1/audit/channels/1812c74a
URI Parameters
HideShow
id
string (required) Example: 1812c74a

5731-4921-9da4-9dd586160ef0 (required) - The audit channel id

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Body
{
  "name": "splunk-audit-channel",
  "templateName": "Splunk",
  "connectionName": "splunk-connection",
  "enabled": false,
  "properties": [
    {
      "key": "source",
      "value": "splunk-source"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "connectionName": {
      "type": "string"
    },
    "enabled": {
      "type": "string"
    },
    "properties": {
      "type": "array"
    }
  }
}
Response  204
Response  404
HideShow

Responds with NotFound when the supplied channel id doesn’t match any known channel

Body
{
  "fields": [
    {
      "field": "Hello, world!",
      "error": "Hello, world!"
    }
  ],
  "error": "Hello, world!",
  "nonFieldErrors": []
}
Schema
{
  "type": "object",
  "properties": {
    "fields": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "field",
          "error"
        ]
      }
    },
    "error": {
      "type": "string"
    },
    "nonFieldErrors": {
      "type": "array",
      "description": "+"
    }
  },
  "required": [
    "fields",
    "error",
    "nonFieldErrors"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  409
HideShow

Responds with Conflict when the supplied channel name is already used

Body
{
  "fields": [
    {
      "field": "Hello, world!",
      "error": "Hello, world!"
    }
  ],
  "error": "Hello, world!",
  "nonFieldErrors": []
}
Schema
{
  "type": "object",
  "properties": {
    "fields": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "field",
          "error"
        ]
      }
    },
    "error": {
      "type": "string"
    },
    "nonFieldErrors": {
      "type": "array",
      "description": "+"
    }
  },
  "required": [
    "fields",
    "error",
    "nonFieldErrors"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  400
HideShow

An object wrapping field validation errors and other error messages

Headers
Content-Type: application/json
Body
{
  "fields": [
    {
      "field": "Hello, world!",
      "error": "Hello, world!"
    }
  ],
  "error": "Hello, world!",
  "nonFieldErrors": []
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "fields": {
      "type": "array"
    },
    "error": {
      "type": "string"
    },
    "nonFieldErrors": {
      "description": "+"
    }
  },
  "required": [
    "fields",
    "error",
    "nonFieldErrors"
  ]
}

Delete an audit channel
DELETE/api/v1/audit/channels/{id}

Permanently delete an audit channel

Example URI

DELETE /api/v1/audit/channels/90cb0419
URI Parameters
HideShow
id
string (required) Example: 90cb0419

5d15-4960-9ea6-2ccb4d26ebb4 (required) - The audit channel id

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  204
Response  404
HideShow

Responds with NotFound when the supplied channel id doesn’t match any known channel

Body
{
  "fields": [
    {
      "field": "Hello, world!",
      "error": "Hello, world!"
    }
  ],
  "error": "Hello, world!",
  "nonFieldErrors": []
}
Schema
{
  "type": "object",
  "properties": {
    "fields": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string"
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "field",
          "error"
        ]
      }
    },
    "error": {
      "type": "string"
    },
    "nonFieldErrors": {
      "type": "array",
      "description": "+"
    }
  },
  "required": [
    "fields",
    "error",
    "nonFieldErrors"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}

List audit entries
GET/api/audit{?pageSize,page,type,action,user,filter}

Returns audit entries divided into pages. Allows to specify page number and page size.

Example URI

GET /api/audit?pageSize=25&page=1&type=TOPIC&action=ADD&user=johnsmith&filter=Filters by resource Id and resource name. Allows a partial match, so that the user doesn't have to type in the entire resourceId
URI Parameters
HideShow
page
number (optional) Example: 1

The page number to be returned, must be greater than zero. Defaults to 1.

pageSize
number (required) Example: 25

The elements amount on a single page, must be greater than zero.

type
string (optional) Example: TOPIC

Allows to filter results by resource type affected

Choices: TOPIC TOPIC_DATA QUOTAS BROKER_CONFIG ACL SCHEMA PROCESSOR CONNECTOR KUBERNETES_EXTERNAL_APP KUBERNETES_SECRET KUBERNETES_NAMESPACE KUBERNETES_SERVICE_ACCOUNT KUBERNETES_SERVICE KUBERNETES_INGRESS CONSUMER_OFFSET DATA_POLICIES USER_MANAGEMENT_GROUP USER_MANAGEMENT_USER USER_MANAGEMENT_SERVICE_ACCOUNT LENSES USER CONNECTIONS

action
string (optional) Example: ADD

Allows to filter results by audit change

Choices: ADD REMOVE UPDATE INSERT STARTED STOPPED SCALED RESTARTED PAUSED VIEWED LOGIN LOGOUT

user
string (optional) Example: johnsmith

Allows to filter results by user who triggered audit entry

filter
string (required) Example: Filters by resource Id and resource name. Allows a partial match, so that the user doesn't have to type in the entire resourceId
Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "pagesAmount": 100,
  "values": [
    {
      "type": "TOPIC",
      "action": "ADD",
      "user": "johnsmith",
      "timestamp": 329185402,
      "resourceId": "topicAbc",
      "resourceName": "topicAbc",
      "content": {}
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "pagesAmount": {
      "type": "number",
      "description": "Total amount of pages"
    },
    "values": {
      "type": "array",
      "description": "The audit entries"
    }
  },
  "required": [
    "pagesAmount"
  ]
}
Response  400
HideShow

Invalid request body.

Headers
Content-Type: application/json
Body
[
  {
    "field": "name",
    "error": "name cannot be empty"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

List audit values
GET/api/audit/values

Returns audit unique values of user id, audit type and change.

Example URI

GET /api/audit/values
Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "users": [
    "Hello, world!"
  ],
  "types": [
    "Hello, world!"
  ],
  "actions": [
    "Hello, world!"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "users": {
      "type": "array",
      "description": "unique values of user ids in stored alerts"
    },
    "types": {
      "type": "array",
      "description": "unique values of audit types in stored alerts"
    },
    "actions": {
      "type": "array",
      "description": "unique values of audit changes in stored alerts"
    }
  }
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Delete audit entries
DELETE/api/audit{?timestamp}

Deletes audits with timestamps before the specified value

Example URI

DELETE /api/audit?timestamp=1562922585000
URI Parameters
HideShow
timestamp
number (required) Example: 1562922585000

Timestamp (milliseconds since the epoch), for which any audits older than it should be deleted

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Response  400
HideShow
Headers
Content-Type: text/plain
Body
Error Message
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Schemas

Lenses APIs for managing schemas in a Confluent API compatible schema registries.

List schemas

List schemas
GET/api/proxy-sr/subjects

Get a list of all subjects

Example URI

GET /api/proxy-sr/subjects
Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  "subject1",
  "schema2"
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Version of a subject

List subject versions
GET/api/proxy-sr/subjects/{subject}/versions

Example URI

GET /api/proxy-sr/subjects/subject/versions
URI Parameters
HideShow
subject
string (required) 

Name of the subject

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  "1",
  "2"
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Register a new schema under a particular subject
POST/api/proxy-sr/subjects/{subject}/versions

Example URI

POST /api/proxy-sr/subjects/subject/versions
URI Parameters
HideShow
subject
string (required) 

Name of the subject

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
"OK"
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Delete a subject and associated compatibility level
DELETE/api/proxy-sr/subjects/{subject}

Example URI

DELETE /api/proxy-sr/subjects/subject
URI Parameters
HideShow
subject
string (required) 

Name of the subject

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
"OK"
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Get the schema for a particular subject id
GET/api/proxy-sr/schemas/ids/{id}

Example URI

GET /api/proxy-sr/schemas/ids/id
URI Parameters
HideShow
id
number (required) 

The ID of the subject

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
"OK"
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Subject at version

Get the schema at a particular version
GET/api/proxy-sr/subjects/{subject}/versions/{versionId}

Example URI

GET /api/proxy-sr/subjects/subject/versions/versionId
URI Parameters
HideShow
subject
string (required) 

Name of the subject

versionId
number (required) 

The version of the subject to delete

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
"OK"
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Delete a particular version of a subject
DELETE/api/proxy-sr/subjects/{subject}/versions/{versionId}

Example URI

DELETE /api/proxy-sr/subjects/subject/versions/versionId
URI Parameters
HideShow
subject
string (required) 

Name of the subject

versionId
number (required) 

The version of the subject to delete

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
"OK"
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Compatibility Level

  • Request (application/json)

    • Headers

      X-Kafka-Lenses-Token: XXXXX

Update global compatibility level
PUT/api/proxy-sr/config

Example URI

PUT /api/proxy-sr/config
Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
"OK"
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Get global compatibility level
GET/api/proxy-sr/config

Example URI

GET /api/proxy-sr/config
Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
"OK"
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Change compatibility level of a subject
PUT/{subject}

Example URI

PUT /subject
URI Parameters
HideShow
subject
string (required) 

Name of the subject

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Body
{
  "compatibility": "BACKWARD"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "compatibility": {
      "type": "string",
      "enum": [
        "BACKWARD",
        "BACKWARD_TRANSITIVE",
        "FORWARD",
        "FORWARD_TRANSITIVE",
        "FULL",
        "FULL_TRANSITIVE",
        "NONE"
      ],
      "description": "Compatibility to set"
    }
  },
  "required": [
    "compatibility"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
"OK"
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Get compatibility level for a subject
GET/{subject}

Example URI

GET /subject
URI Parameters
HideShow
subject
string (required) 

Name of the subject

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "compatibility": "FULL"
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

SQL Processors

SQL Processors

Lenses APIs for managing Lenses SQL Processors.

List all processors
GET/api/v1/streams/

Example URI

GET /api/v1/streams/
Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "processors": {
    "targets": [
      {
        "cluster": "aks",
        "version": "aks",
        "namespaces": [
          "default"
        ]
      }
    ],
    "streams": [
      {
        "user": "alexjones",
        "id": "lsql_c7f177994db640cab95a99900c4fb7e7",
        "name": "cc_payments_freq_1min",
        "sql": "INSERT INTO",
        "clusterName": "aks",
        "namespace": "lenses_sql",
        "pipeline": "claims_eu",
        "runners": 1,
        "inputTopics": [
          "A",
          "B"
        ],
        "outputTopics": [
          "X",
          "Y",
          "Z"
        ],
        "state": {
          "deploymentStatus": "RUNNING",
          "deploymentError": "\"\"",
          "runnerStatus": {
            "runnerName": {
              "id": "e94433cf-cf99-4e46-9adc-407bb06b35c2",
              "worker": "e94433cf-cf99-4e46-9adc-407bb06b35c2",
              "state": "RUNNING",
              "errorMsg": "if there was an error it would be here"
            }
          }
        },
        "startTs": 3387090,
        "upTime": 1090,
        "stopTs": 3387090,
        "lastAction": {
          "action": "Started",
          "msg": "Stopped at 2019-10-01 10:01"
        },
        "settings": [
          {}
        ]
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "processors": {
      "type": "object",
      "properties": {
        "targets": {
          "type": "array",
          "description": "Available Kubernetes clusters and namespaces in the clusters"
        },
        "streams": {
          "type": "array",
          "description": "The registered SQL Processors"
        }
      }
    }
  }
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Get a processor
GET/api/v1/streams/{processor_id}

Example URI

GET /api/v1/streams/lsql_c7f177994db640cab95a99900c4fb7e7
URI Parameters
HideShow
processor_id
string (required) Example: lsql_c7f177994db640cab95a99900c4fb7e7

The processor id to look up

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "processor": {
    "user": "alexjones",
    "id": "lsql_c7f177994db640cab95a99900c4fb7e7",
    "name": "cc_payments_freq_1min",
    "sql": "INSERT INTO",
    "clusterName": "aks",
    "namespace": "lenses_sql",
    "pipeline": "claims_eu",
    "runners": 1,
    "inputTopics": [
      "A",
      "B"
    ],
    "outputTopics": [
      "X",
      "Y",
      "Z"
    ],
    "state": {
      "deploymentStatus": "RUNNING",
      "deploymentError": "\"\"",
      "runnerStatus": {
        "runnerName": {
          "id": "e94433cf-cf99-4e46-9adc-407bb06b35c2",
          "worker": "e94433cf-cf99-4e46-9adc-407bb06b35c2",
          "state": "RUNNING",
          "errorMsg": "if there was an error it would be here"
        }
      }
    },
    "startTs": 3387090,
    "upTime": 1090,
    "stopTs": 3387090,
    "lastAction": {
      "action": "Started",
      "msg": "Stopped at 2019-10-01 10:01"
    },
    "settings": [
      {}
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "processor": {
      "type": "object",
      "properties": {
        "user": {
          "type": "string",
          "description": "Name of the user who created the processor"
        },
        "id": {
          "type": "string",
          "description": "Processor id"
        },
        "name": {
          "type": "string",
          "description": "Name of the processor"
        },
        "sql": {
          "type": "string",
          "description": "SQL code"
        },
        "clusterName": {
          "type": "string",
          "description": "Name of the Kubernetes cluster the processor is deployed to if the SQL processor deployment mode is set to Kubernetes"
        },
        "namespace": {
          "type": "string",
          "description": "Name of the Kubernetes namespace where the SQL processor is deployed to if the SQL processor deployment mode is set to Kubernetes"
        },
        "pipeline": {
          "type": "string",
          "description": "The name which identifies the processing data flow graph"
        },
        "runners": {
          "type": "number",
          "description": "Number of runners deployed"
        },
        "inputTopics": {
          "type": "array",
          "description": "The topics used as data source for the SQL processor"
        },
        "outputTopics": {
          "type": "array",
          "description": "The topics used as data output for the SQL processor"
        },
        "state": {
          "type": "object",
          "properties": {
            "deploymentStatus": {
              "type": "string",
              "enum": [
                "RUNNING",
                "FAILED",
                "STOPPED",
                "UNKNOWN",
                "WARNING"
              ],
              "description": "The SQL processor status"
            },
            "deploymentError": {
              "type": "string",
              "description": "If the deploymentStatus is FAILED, this will contain the error information"
            },
            "runnerStatus": {
              "$ref": "#/definitions/runnerName",
              "description": "A map of runner details"
            }
          },
          "required": [
            "deploymentStatus"
          ],
          "description": "The SQL processor state"
        },
        "startTs": {
          "type": "number",
          "description": "Time epoch time the processor was last started. If the processor is stopped this field will not be set"
        },
        "upTime": {
          "type": "number",
          "description": "Time in epoch of how long the SQL processor has been running since last start action"
        },
        "stopTs": {
          "type": "number",
          "description": "The epoch time when the processor was stopped."
        },
        "lastAction": {
          "type": "object",
          "properties": {
            "action": {
              "type": "string",
              "enum": [
                "Started",
                "Stopped",
                "Scaled",
                "ConfigChange",
                "Recovered"
              ],
              "description": "the name of the last action"
            },
            "msg": {
              "type": "string",
              "description": "a human readable message about the last action"
            }
          },
          "description": "The last user action performed on the SQL processor"
        },
        "settings": {
          "type": "array",
          "description": "A set of key-values entries to allow setting CPU/Memory limits if SQL processor deployment mode is set to Kubernetes"
        }
      },
      "required": [
        "user",
        "id",
        "name",
        "sql",
        "clusterName",
        "runners",
        "inputTopics",
        "outputTopics"
      ]
    }
  },
  "definitions": {
    "runnerName": {
      "type": "object",
      "patternProperties": {
        "": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "Runner identifier"
            },
            "worker": {
              "type": "string",
              "description": "Host or Pod the runner is running in"
            },
            "state": {
              "type": "string",
              "enum": [
                "RUNNING",
                "FAILED",
                "STOPPED",
                "UNKNOWN"
              ],
              "description": "State of the runner"
            },
            "errorMsg": {
              "type": "string",
              "description": "Error message if failed"
            }
          },
          "required": [
            "id",
            "worker",
            "state"
          ]
        }
      }
    }
  }
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Create a processor
POST/api/v1/streams

Example URI

POST /api/v1/streams
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Body
{
  "name": "myProcessor",
  "appId": "myProcessor",
  "sql": "INSERT INTO topicB SELECT STREAM * FROM topicA",
  "runnerCount": 1,
  "cluster": "aks",
  "namespace": "io.lenses.accounts",
  "settings": {
    "key": "some_setting_value"
  },
  "pipeline": "claim_eu"
}
Schema
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Name of the processor"
    },
    "appId": {
      "type": "string",
      "description": "Optional value to set the application id. If not defined the name will be used for appId"
    },
    "sql": {
      "type": "string",
      "description": "The SQL code"
    },
    "runnerCount": {
      "type": "number",
      "description": "The number of runners for the SQL processor"
    },
    "cluster": {
      "type": "string",
      "description": "The Kubernetes cluster to deploy to if SQL processor deployment mode is set to be Kubernetes"
    },
    "namespace": {
      "type": "string",
      "description": "namespace for the runner. these can tie into app permissions"
    },
    "settings": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string"
        }
      },
      "description": "A set of key-values entries to allow setting CPU/Memory limits if SQL processor deployment mode is set to Kubernetes"
    },
    "pipeline": {
      "type": "string",
      "description": "The name which identifies the processing data flow graph"
    }
  },
  "required": [
    "name",
    "sql",
    "runnerCount",
    "cluster"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/text
Body
`lsql_c7f177994db640cab95a99900c4fb7e7`
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "fields": [
    {
      "field": "Hello, world!",
      "error": "Hello, world!"
    }
  ],
  "error": "Hello, world!",
  "nonFieldErrors": [],
  "Body": "Hello, world!"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "fields": {
      "type": "array"
    },
    "error": {
      "type": "string"
    },
    "nonFieldErrors": {
      "description": "+"
    },
    "Body": {
      "type": "string",
      "description": "    {\n      \"errors\": [\n        {\n          \"field\": \"field name\",\n          \"error\": \"The reason\"\n        }\n      ],\n      \"error\": \"The details of why the processor cannot be created\"\n    }"
    }
  },
  "required": [
    "fields",
    "error",
    "nonFieldErrors"
  ]
}

Scale a processor
PUT/api/v1/streams/{processor_id}/scale/{runners}

Example URI

PUT /api/v1/streams/lsql_c7f177994db640cab95a99900c4fb7e7/scale/5
URI Parameters
HideShow
processor_id
string (required) Example: lsql_c7f177994db640cab95a99900c4fb7e7

The processor_id to scale

runners
number (required) Example: 5

The number of runners to scale to

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/text
Body
Processor [lsql_c7f177994db640cab95a99900c4fb7e7] scaled
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Pause a processor
PUT/api/v1/streams/{processor_id}/stop

Example URI

PUT /api/v1/streams/lsql_c7f177994db640cab95a99900c4fb7e7/stop
URI Parameters
HideShow
processor_id
string (required) Example: lsql_c7f177994db640cab95a99900c4fb7e7

The processor_id to pause

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/text
Body
Processor [lsql_c7f177994db640cab95a99900c4fb7e7] paused
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Resume a processor
PUT/api/v1/streams/{processor_id}/resume

Example URI

PUT /api/v1/streams/lsql_c7f177994db640cab95a99900c4fb7e7/resume
URI Parameters
HideShow
processor_id
string (required) Example: lsql_c7f177994db640cab95a99900c4fb7e7

The processor_id to resume

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/text
Body
Processor [lsql_c7f177994db640cab95a99900c4fb7e7] resumed
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Delete a processor
DELETE/api/v1/streams/{processor_id}

Example URI

DELETE /api/v1/streams/lsql_c7f177994db640cab95a99900c4fb7e7
URI Parameters
HideShow
processor_id
string (required) Example: lsql_c7f177994db640cab95a99900c4fb7e7

The processor_id to delete

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/text
Body
Processor [lsql_c7f177994db640cab95a99900c4fb7e7] deleted
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Processor Topology
GET/api/v1/streams/{processor_id}/graph

Example URI

GET /api/v1/streams/lsql_c7f177994db640cab95a99900c4fb7e7/graph
URI Parameters
HideShow
processor_id
string (required) Example: lsql_c7f177994db640cab95a99900c4fb7e7

The processor identifier

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
+ graph (Processor Graph)
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Connections

APIs for managing connections.

Connection Templates

List all connection templates
GET/api/v1/connection/connection-templates

List all connection templates.

Example URI

GET /api/v1/connection/connection-templates
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application / json
Body
[
  {
    "name": "connection",
    "version": 1,
    "category": "Connection",
    "type": "Hello, world!",
    "metadata": {
      "author": "Lenses.io",
      "description": "Connection for Apache Cassandra"
    },
    "configuration": [
      {
        "key": "connect.cassandra.contact.points",
        "displayName": "Contact points",
        "placeholder": "host",
        "description": "Comma separated list of Cassandra nodes",
        "type": {
          "name": "STRING",
          "displayName": "long"
        },
        "required": true,
        "mounted": false
      }
    ],
    "builtIn": true,
    "enabled": true,
    "templateVersion": 1
  }
]
Schema
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "name": {
        "type": "string",
        "description": "template-name (required, string) - unique name for the connection template"
      },
      "version": {
        "type": "number",
        "description": "External service version (e.g ElasticSearch *5.2* or *6.0* )"
      },
      "category": {
        "enum": [
          "Connection",
          "App",
          "Integration"
        ],
        "description": "Connection category"
      },
      "type": {
        "type": "string",
        "description": "Connection type (e.g. Alerts integration(Slack or Datadog), Kafka connections(kafka, SR), Datasources connection(Elastic, Redis etc))"
      },
      "metadata": {
        "type": "object",
        "properties": {
          "author": {
            "type": "string",
            "description": "name of connection template author (Lenses.io for built in templates)"
          },
          "description": {
            "type": "string",
            "description": "short sentence describing the connection\\"
          }
        },
        "required": [
          "author",
          "description"
        ],
        "description": "additional connection information"
      },
      "configuration": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "key": {
              "type": "string",
              "description": "key assigned to the field (used to identify the field)"
            },
            "displayName": {
              "type": "string",
              "description": "label"
            },
            "placeholder": {
              "type": "string",
              "description": "001,host-002 (optional, string) - value displayed in the input element"
            },
            "description": {
              "type": "string",
              "description": "short property description"
            },
            "type": {
              "type": "object",
              "properties": {
                "name": {
                  "enum": [
                    "STRING",
                    "DOUBLE",
                    "LONG",
                    "SECRET",
                    "BOOLEAN",
                    "ARRAY",
                    "BASE64",
                    "MULTILINE"
                  ]
                },
                "displayName": {
                  "type": "string",
                  "description": "text (optional, string)"
                }
              },
              "required": [
                "name"
              ]
            },
            "required": {
              "type": "boolean",
              "description": "whether parameter is required or optional"
            },
            "mounted": {
              "type": "boolean",
              "description": "whether parameter value will be mounted as a file"
            }
          },
          "required": [
            "key",
            "displayName",
            "type",
            "required",
            "mounted"
          ]
        },
        "description": "connection template"
      },
      "builtIn": {
        "type": "boolean",
        "description": "true for built-in template, false for a custom template (defined by the user)"
      },
      "enabled": {
        "type": "boolean",
        "description": "true if it's an active connection template"
      },
      "templateVersion": {
        "type": "number",
        "description": "Lenses internal templating version - This version will be automatically increased in every update _(when update endpoint will be implementation)_"
      }
    },
    "required": [
      "version",
      "category",
      "type",
      "metadata",
      "configuration",
      "builtIn",
      "enabled",
      "templateVersion"
    ]
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  401
HideShow

The client is not authenticated.

Headers
Content-Type: text/plain
Response  403
HideShow

The client is unauthorized to list connection templates.

Headers
Content-Type: text/plain
Response  500
HideShow

Failed to read. Internal server error.

Headers
Content-Type: text/plain

Connection

Add Connection
POST/api/v1/connection/connections

Adds connection instance. Note that the name of the connection must be a 1-127 character string, containing only 0-9, a-z, A-Z, and -. Requires ManageConnections permission.

Example URI

POST /api/v1/connection/connections
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Body
{
  "tags": [
    "t1",
    "t2"
  ],
  "configuration": [
    {
      "key": "users",
      "value <number>": 1
    }
  ],
  "name": "users",
  "templateName": "template"
}
Schema
{
  "type": "object",
  "properties": {
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "list of tags assigned to the connection."
    },
    "configuration": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "store (required, string) - Name of the configuration property. Must be a 1-127 character string, containing only 0-9, a-z, A-Z, and -./"
          },
          "value <number>": {
            "type": "number",
            "description": "Value of the configuration property."
          },
          "value <string>": {
            "type": "string",
            "description": "Value of the configuration property."
          },
          "value <boolean>": {
            "type": "boolean",
            "description": "Value of the configuration property."
          },
          "value <array>": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Value of the configuration property."
          }
        },
        "allOf": [
          {
            "not": {
              "required": [
                "value <number>",
                "value <string>",
                "value <boolean>",
                "value <array>"
              ]
            }
          }
        ]
      },
      "description": "configuration properties needed by the connection to be built."
    },
    "name": {
      "type": "string",
      "description": "store (required, string) - Name of the connection. Must be a 1-127 character string, containing only 0-9, a-z, A-Z, and -."
    },
    "templateName": {
      "type": "string",
      "description": "name (required, string) - Template name the connection will be based on."
    }
  },
  "required": [
    "configuration"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow

The connection has been successfully added.

Headers
Content-Type: application/json
Body
{
  "name": "connection"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "name (required, string) - Name of the created connection."
    }
  }
}
Response  400
HideShow

Invalid request body. It can be due to invalid field content or the provided name already exists.

Headers
Content-Type: application/json
Body
{
  "fields": [
    {
      "field": "configuration.displayName",
      "error": "secretId cannot be empty"
    }
  ],
  "error": "required fields are missing"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "fields": {
      "type": "array",
      "description": "list of the fields with invalid or missing values (can be empty)"
    },
    "error": {
      "type": "string",
      "description": "description of the problem"
    }
  },
  "required": [
    "fields",
    "error"
  ]
}
Response  401
HideShow

The client is not authenticated.

Headers
Content-Type: text/plain
Body
The client is not authenticated
Response  403
HideShow

The client is not authorized to add a connection.

Headers
Content-Type: text/plain
Body
The client is not authorized to add custom connection templates
Response  500
HideShow

Internal server error.

Headers
Content-Type: text/plain
Body
Error creating a connection. Internal server error

List all connections
GET/api/v1/connection/connections

List all connection instances.

Example URI

GET /api/v1/connection/connections
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application / json
Body
[
  {
    "name": "users",
    "tags": [
      "t1",
      "t2"
    ],
    "templateName": "template",
    "templateVersion": 1,
    "readOnly": true
  }
]
Schema
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "name": {
        "type": "string",
        "description": "store (required, string) - name of the connection instance"
      },
      "tags": {
        "type": "array",
        "items": {
          "type": "string"
        },
        "description": "list of tags assigned to connection"
      },
      "templateName": {
        "type": "string",
        "description": "1 (required, string) - connection template name"
      },
      "templateVersion": {
        "type": "number",
        "description": "Version of the connection template"
      },
      "readOnly": {
        "type": "boolean",
        "description": "flags read-only connections that are provided with Lenses Installation(e.g: Kafka and Schema Registry)"
      }
    },
    "required": [
      "templateVersion"
    ]
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The client is not authenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
The client is unauthorized to list connections.
Response  500
HideShow
Headers
Content-Type: text/plain
Body
Failed to read. Internal server error.

Update Connection
PUT/api/v1/connection/connections/{name}

Updates connection instance. The connection name is not updatable as well as templateName. Existing configuration properties not provided in the update request body will be pruned. Requires ManageConnections permission.

Example URI

PUT /api/v1/connection/connections/name
URI Parameters
HideShow
name
string (required) 

Name of the connection to be updated.

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Body
{
  "tags": [
    "t1",
    "t2"
  ],
  "configuration": [
    {
      "key": "users",
      "value <number>": 1
    }
  ]
}
Schema
{
  "type": "object",
  "properties": {
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "list of tags assigned to the connection."
    },
    "configuration": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "store (required, string) - Name of the configuration property. Must be a 1-127 character string, containing only 0-9, a-z, A-Z, and -./"
          },
          "value <number>": {
            "type": "number",
            "description": "Value of the configuration property."
          },
          "value <string>": {
            "type": "string",
            "description": "Value of the configuration property."
          },
          "value <boolean>": {
            "type": "boolean",
            "description": "Value of the configuration property."
          },
          "value <array>": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Value of the configuration property."
          }
        },
        "allOf": [
          {
            "not": {
              "required": [
                "value <number>",
                "value <string>",
                "value <boolean>",
                "value <array>"
              ]
            }
          }
        ]
      },
      "description": "configuration properties needed by the connection to be built."
    }
  },
  "required": [
    "configuration"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow

The connection has been successfully updated. The response contains the name of the updated connection.

Headers
Content-Type: application/json
Body
{
  "name": "connection"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "name (required, string) - Name of the created connection."
    }
  }
}
Response  400
HideShow

Invalid request body. It can be due to invalid field content or the provided name already exists.

Headers
Content-Type: application/json
Body
{
  "fields": [
    {
      "field": "configuration.displayName",
      "error": "secretId cannot be empty"
    }
  ],
  "error": "required fields are missing"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "fields": {
      "type": "array",
      "description": "list of the fields with invalid or missing values (can be empty)"
    },
    "error": {
      "type": "string",
      "description": "description of the problem"
    }
  },
  "required": [
    "fields",
    "error"
  ]
}
Response  401
HideShow

The client is not authenticated.

Headers
Content-Type: text/plain
Body
The client is not authenticated
Response  403
HideShow

The client is not authorized to update the connection instance.

Headers
Content-Type: text/plain
Body
The client is not authorized to update connection instance
Response  404
HideShow

Connection with the provided name could not be found.

Headers
Content-Type: text/plain
Body
The requested connection could not be found
Response  409
HideShow

The connection is Read-Only and cannot be updated

Headers
Content-Type: application/json
Body
{
  "error": "`Read-only` Connection cannot be updated"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "description of an issue"
    }
  },
  "required": [
    "error"
  ]
}
Response  500
HideShow

Internal server error.

Headers
Content-Type: text/plain
Body
Error updating connection. Internal server error

Delete Connection
DELETE/api/v1/connection/connections/{name}

Delete a Connection instance. Requires ManageConnections permission.

Example URI

DELETE /api/v1/connection/connections/name
URI Parameters
HideShow
name
string (required) 

Name of the connection (Lenses)

removeFromSecretsProvider
boolean (optional) Default: false Example: true

Specifies whether the secret values assigned to the connection will be removed from the secret provider storing them.

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: text/plain
Body
Connection deleted
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied
Response  404
HideShow
Headers
Content-Type: text/plain
Body
The requested connection could not be found
Response  409
HideShow

The connection is Read-Only or in use and cannot be deleted

Headers
Content-Type: application/json
Body
{
  "error": "`Read-only` Connections cannot be deleted"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "description of an issue"
    }
  },
  "required": [
    "error"
  ]
}
Response  500
HideShow
Headers
Content-Type: text/plain
Body
Failed to delete the connection. Internal server error

Get connection details
GET/api/v1/connection/connections/{name}

Returns a Connection instance. The user will need ManageConnections permission to see the contents of the configuration array(sensitive data).

Example URI

GET /api/v1/connection/connections/name
URI Parameters
HideShow
name
string (required) 

Unique name assigned to the connection (Lenses)

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "name": "users",
  "tags": [
    "t1",
    "t2"
  ],
  "templateName": "template",
  "templateVersion": 1,
  "readOnly": true,
  "builtIn": true,
  "configuration": [
    {
      "key": "users",
      "value <number>": 1,
      "type": "STRING"
    }
  ],
  "createdBy": "user1",
  "createdAt": 1559353700,
  "modifiedBy": "user2",
  "modifiedAt": 1559353700
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "store (required, string) - name of the connection instance"
    },
    "tags": {
      "type": "array",
      "description": "list of tags assigned to connection"
    },
    "templateName": {
      "type": "string",
      "description": "1 (required, string) - connection template name"
    },
    "templateVersion": {
      "type": "number",
      "description": "Version of the connection template"
    },
    "readOnly": {
      "type": "boolean",
      "description": "flags read-only connections that are provided with Lenses Installation(e.g: Kafka and Schema Registry)"
    },
    "builtIn": {
      "type": "boolean",
      "description": "flags the connections that are based on built-in connection-templates provided by Lenses.io"
    },
    "configuration": {
      "type": "array",
      "description": "Configuration Options for each connection. The user will need *ManageConnections* permission in order to see the contents of the configuration array(sensitive data)."
    },
    "createdBy": {
      "type": "string"
    },
    "createdAt": {
      "type": "number"
    },
    "modifiedBy": {
      "type": "string"
    },
    "modifiedAt": {
      "type": "number"
    }
  },
  "required": [
    "templateVersion",
    "configuration",
    "createdBy",
    "createdAt",
    "modifiedBy",
    "modifiedAt"
  ]
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied
Response  404
HideShow
Headers
Content-Type: text/plain
Body
The requested connection could not be found
Response  500
HideShow
Headers
Content-Type: text/plain
Body
Failed to read the connection. Internal server error

User Group Management

User management allows clients to create, edit, and delete user accounts, service accounts and groups. In order to support the stringent requirements from enterprises, Lenses supports a few authentication modes as well as an authorization approach to meet the various configuration a client might have.

Lenses permission management system makes it easy to manage permissions for groups. The permissions system isn not based on hierarchical roles, but rather on groups, reflecting Unix and Windows-based permissions. You can create groups that have pre-defined (fully customizable) permissions sets; users added to a group inherit the permissions of that group.

Permissions are granted based on group assignment. Permissions are granted to groups and users are assigned to groups, as illustrated below:

Lenses group permissions

Groups

List groups
GET/api/v1/group

Returns all the groups.

Example URI

GET /api/v1/group
Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "name": "DevAdmin",
    "description": "some info 2",
    "namespaces": [
      {
        "wildcards": [
          "*"
        ],
        "permissions": [
          "CreateTopic",
          "DropTopic",
          "ConfigureTopic",
          "QueryTopic",
          "ShowTopic",
          "ViewSchema"
        ],
        "connection": "kafka"
      },
      {
        "wildcards": [
          "abc*"
        ],
        "permissions": [
          "QueryTopic",
          "ShowTopic",
          "ViewSchema"
        ],
        "connection": "kafka"
      }
    ],
    "scopedPermissions": [
      "ViewKafkaConsumers",
      "ManageKafkaConsumers",
      "ViewConnectors",
      "ManageConnectors",
      "ViewSQLProcessors",
      "ManageSQLProcessors",
      "ViewSchemaRegistry",
      "ViewTopology",
      "ManageTopology"
    ],
    "adminPermissions": [
      "ViewDataPolicies",
      "ViewAuditLogs",
      "ViewUsers",
      "ManageUsers",
      "ViewAlertRules",
      "ManageAlertRules",
      "ViewKafkaSettings",
      "ManageKafkaSettings"
    ],
    "connectClustersPermissions": [
      "kafka connect cluster name"
    ],
    "userAccounts": 1,
    "serviceAccounts": 0
  },
  {
    "name": "janitors",
    "description": "only head of janitors",
    "namespaces": [
      {
        "wildcards": [
          "*"
        ],
        "permissions": [
          "ConfigureTopic",
          "QueryTopic",
          "ShowTopic",
          "ViewSchema"
        ],
        "connection": "kafka"
      }
    ],
    "scopedPermissions": [
      "ViewKafkaConsumers",
      "ManageKafkaConsumers",
      "ViewConnectors",
      "ManageConnectors",
      "ViewSQLProcessors",
      "ViewSchemaRegistry",
      "ViewTopology"
    ],
    "adminPermissions": [
      "ViewDataPolicies",
      "ViewAuditLogs",
      "ViewUsers",
      "ManageUsers",
      "ViewAlertRules",
      "ManageAlertRules",
      "ViewKafkaSettings",
      "ManageKafkaSettings"
    ],
    "connectClustersPermissions": [],
    "userAccounts": 0,
    "serviceAccounts": 0
  }
]
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "view" permission.

Get a group
GET/api/v1/group/{groupname}

Returns a group identified by the group name

Example URI

GET /api/v1/group/groupname
URI Parameters
HideShow
groupname
string (required) 

The unique identifier for the user group (required)

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "name": "DevAdmin",
  "description": "some info 2",
  "namespaces": [
    {
      "wildcards": [
        "*"
      ],
      "permissions": [
        "CreateTopic",
        "DropTopic",
        "ConfigureTopic",
        "QueryTopic",
        "ShowTopic",
        "ViewSchema"
      ],
      "connection": "kafka"
    },
    {
      "wildcards": [
        "abc*"
      ],
      "permissions": [
        "QueryTopic",
        "ShowTopic",
        "ViewSchema"
      ],
      "connection": "kafka"
    }
  ],
  "scopedPermissions": [
    "ViewKafkaConsumers",
    "ManageKafkaConsumers",
    "ViewConnectors",
    "ManageConnectors",
    "ViewSQLProcessors",
    "ManageSQLProcessors",
    "ViewSchemaRegistry",
    "ViewTopology",
    "ManageTopology"
  ],
  "adminPermissions": [
    "ViewDataPolicies",
    "ViewAuditLogs",
    "ViewUsers",
    "ManageUsers",
    "ViewAlertRules",
    "ManageAlertRules",
    "ViewKafkaSettings",
    "ManageKafkaSettings"
  ],
  "connectClustersPermissions": [
    "kafka connect cluster name"
  ],
  "userAccounts": 1,
  "serviceAccounts": 0
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "manage" permission.
Response  404
HideShow
Headers
Content-Type: text/plain
Body
The requested group does not exist

Create a group
POST/api/v1/group

Creates a new group. The name must be unique.

Example URI

POST /api/v1/group
Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Body
{
  "name": "janitors",
  "description": "only head of janitors",
  "scopedPermissions": [
    "ViewKafkaConsumers",
    "ManageKafkaConsumers",
    "ViewConnectors",
    "ManageConnectors",
    "ViewSQLProcessors",
    "ManageSQLProcessors",
    "ViewSchemaRegistry",
    "ManageSchemaRegistry",
    "ViewTopology",
    "ManageTopology"
  ],
  "adminPermissions": [
    "ViewDataPolicies",
    "ManageDataPolicies",
    "ViewAuditLogs",
    "ManageAuditLogs",
    "ViewUsers",
    "ManageUsers",
    "ViewAlertRules",
    "ManageAlertRules",
    "ViewKafkaSettings",
    "ManageKafkaSettings",
    "ManageConnections",
    "ViewLogs",
    "ViewKubernetes",
    "ViewApprovalRequest",
    "ManageApprovalRequest",
    "ManageLensesLicense"
  ],
  "namespaces": [
    {
      "wildcards": [
        "*"
      ],
      "permissions": [
        "CreateTopic",
        "RequestTopicCreation",
        "DropTopic",
        "ConfigureTopic",
        "QueryTopic",
        "ShowTopic",
        "InsertData",
        "DeleteData",
        "UpdateSchema",
        "ViewSchema",
        "UpdateMetadata"
      ],
      "connection": "kafka"
    }
  ],
  "connectClustersPermissions": [
    "dev"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "required": true
    },
    "description": {
      "type": "string",
      "required": false
    },
    "adminPermissions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "required": false
    },
    "scopedPermissions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "required": true
    },
    "namespaces": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "instance": {
            "type": "string",
            "required": true
          },
          "system": {
            "type": "string",
            "required": true
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "required": false
          },
          "wildcards": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "required": false
          }
        }
      },
      "required": true
    },
    "connectClustersPermissions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "required": false
    }
  }
}
Response  200
HideShow
Headers
Content-Type: text/plain
Body
Group has been created.
Response  400
HideShow

The given group is invalid. Could be invalid or missing group name, invalid or missing regex on namespace, invalid description of group, invalid kafka connect cluster name.

Headers
Content-Type: application/json
Body
[
  {
    "field": "group",
    "error": "Invalid group name"
  },
  {
    "field": "namespace",
    "error": "Invalid namespace regex '*'"
  },
  {
    "field": "description",
    "error": "Invalid description"
  },
  {
    "field": "connectClusterPermissions",
    "error": "Some of the provided clusters don't exist."
  }
]
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "manage" permission.

Update a group
PUT/api/v1/group/{groupname}

Updates a group identified by the group name.

Example URI

PUT /api/v1/group/groupname
URI Parameters
HideShow
groupname
string (required) 

The unique identifier for the user (required)

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "name": "janitors",
  "description": "only head of janitors",
  "scopedPermissions": [
    "ViewKafkaConsumers",
    "ManageKafkaConsumers",
    "ViewConnectors",
    "ManageConnectors",
    "ViewSQLProcessors",
    "ManageSQLProcessors",
    "ViewSchemaRegistry",
    "ManageSchemaRegistry",
    "ViewTopology",
    "ManageTopology"
  ],
  "adminPermissions": [
    "ViewDataPolicies",
    "ManageDataPolicies",
    "ViewAuditLogs",
    "ManageAuditLogs",
    "ViewUsers",
    "ManageUsers",
    "ViewAlertRules",
    "ManageAlertRules",
    "ViewKafkaSettings",
    "ManageKafkaSettings",
    "ManageConnections",
    "ViewLogs",
    "ViewKubernetes",
    "ViewApprovalRequest",
    "ManageApprovalRequest",
    "ManageLensesLicense"
  ],
  "namespaces": [
    {
      "wildcards": [
        "*"
      ],
      "permissions": [
        "CreateTopic",
        "RequestTopicCreation",
        "DropTopic",
        "ConfigureTopic",
        "QueryTopic",
        "ShowTopic",
        "InsertData",
        "DeleteData",
        "UpdateSchema",
        "ViewSchema",
        "UpdateMetadata"
      ],
      "connection": "kafka"
    }
  ],
  "connectClustersPermissions": [
    "dev"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "description": {
      "type": "string",
      "required": false
    },
    "adminPermissions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "required": false
    },
    "scopedPermissions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "required": true
    },
    "namespaces": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "instance": {
            "type": "string",
            "required": true
          },
          "system": {
            "type": "string",
            "required": true
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "required": false
          },
          "wildcards": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "required": false
          }
        }
      },
      "required": true
    },
    "connectClustersPermissions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "required": false
    }
  }
}
Response  200
HideShow
Headers
Content-Type: text/plain
Body
Group has been update.
Response  400
HideShow

The given group is invalid. Could be invalid or missing group name, invalid or missing regex on namespace, invalid description of group, invalid kafka connect cluster name.

Headers
Content-Type: application/json
Body
[
  {
    "field": "group",
    "error": "Invalid group name"
  },
  {
    "field": "namespace",
    "error": "Invalid namespace regex '*'"
  },
  {
    "field": "description",
    "error": "Invalid description"
  },
  {
    "field": "connectClusterPermissions",
    "error": "Some of the provided clusters don't exist."
  }
]
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "manage" permission.

Delete a group
DELETE/api/v1/group/{groupname}

Deletes a group identified by the group name

Example URI

DELETE /api/v1/group/groupname
URI Parameters
HideShow
groupname
string (required) 

The unique identifier for the user group (required)

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: text/plain
Body
Group is deleted
Response  400
HideShow
Headers
Content-Type: text/plain
Body
The requested group does not exist or could not be deleted because it is in use by one or more users or service accounts.
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "manage" permission.

Clone a group
POST/api/v1/group/{group}/clone/{newname}

Copies a group with a new name.

Example URI

POST /api/v1/group/group/clone/newname
URI Parameters
HideShow
group
string (required) 

The unique identifier for the user group to copy (required)

newname
string (required) 

The unique identifier for the name of the copied group (required)

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: text/plain
Body
Group is has been copied under the new name
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "manage" permission.
Response  400
HideShow
Headers
Content-Type: text/plain
Body
The source group does not exist or the target group name already exists. This API will not overwrite an existing group.

Get connection permissions
GET/api/v1/groups/connections

Returns a list with all available connections, as well as their corresponsing perimissions and datasets.

Example URI

GET /api/v1/groups/connections
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
    {
        "connection": "kafka",
        "permissions": [
            {
                "type": "CreateTopic",
                "name": "Create Topic"
            },
            {
                "type": "RequestTopicCreation",
                "name": "Create Topic Request"
            },
            {
                "type": "DropTopic",
                "name": "Delete Topic"
            }
        ],
        "datasets": [
            "cc_data_590336152336427580546643e2c6ca23",
            "atopic1_6078c0b0ce034c458a3e68a436a0ac62",
        ]
    },
    {
        "connection": "es",
        "permissions": [
                {
                    "type": "ViewSchema",
                    "name": "View Schema"
                },
                {
                    "type": "ShowIndex",
                    "name": "Show Index"
                },
                {
                    "type": "QueryIndex",
                    "name": "Query Index"
                }
        ],
        "datasets": [
                "test_50c87263-2dfb-45ff-93d5-994a035cf7ab",
                "testac",
        ]
    }
]
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated

User Accounts

These are entries which are associated only with the basic authentication. With basic authentication, Lenses is responsible for managing the username and password entries. When LDAP is enabled (it is supported to combine basic and LDAP), the LDAP users are not listed/managed. Your LDAP setup would has tools to handle that.

List user accounts
GET/api/v1/user

Returns all the user accounts in the security management layer.

Example URI

GET /api/v1/user
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "username": "sam",
    "email": "sam@landoop.com",
    "groups": [
      "foo",
      "bar"
    ]
  },
  {
    "username": "stef",
    "groups": [
      "boo"
    ],
    "type": "BASIC"
  }
]
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "view" permission.

Get a user
GET/api/v1/user/{username}

Returns a user identified by the given username.

Example URI

GET /api/v1/user/username
URI Parameters
HideShow
username
string (required) 

The unique identifier for the user (required)

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "username": "sam",
  "email": "sam@landoop.com",
  "groups": [
    "foo",
    "bar"
  ],
  "type": "BASIC"
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "view" permission.
Response  404
HideShow
Headers
Content-Type: text/plain
Body
The requested user does not exist

Create a user
POST/api/v1/user/

Creates a new user, username (string) must be unique.

Example URI

POST /api/v1/user/
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Request
HideShow
Headers
Content-Type: application/json
Body
{
   "username":"sammy",
   "email":"sam@landoop.com",
   "password":"letmein",
   "groups:["foo"]
   "type": "BASIC/KERBEROS"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "username": {
      "type": "string",
      "required": true
    },
    "email": {
      "type": "string",
      "required": false
    },
    "password": {
      "type": "string",
      "required": true
    },
    "groups": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "required": true
    },
    "type": {
      "type": "string",
      "required": true
    },
  }
}
Response  200
HideShow
Headers
Content-Type: text/plain
Body
User has been created.
Response  400
HideShow

The provided entity is invalid. Examples include invalid or missing username, invalid email, invalid password, invalid group name or group name does not exist.

Headers
Content-Type: application/json
Body
[
  {
    "field": "username",
    "error": "Invalid username"
  },
  {
    "field": "groups",
    "error": "Invalid group name"
  },
  {
    "field": "password",
    "error": "Invalid password"
  },
  {
    "field": "email",
    "error": "Invalid email"
  }
]
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "manage" permission.

Update a user
PUT/api/v1/user/{username}

Updates a user identified by the username.

Example URI

PUT /api/v1/user/username
URI Parameters
HideShow
username
string (required) 

The unique identifier for the user (required)

Request
HideShow
Headers
Content-Type: application/json
Body
{
   "email":"sam@landoop.com",
   "groups:["foo"]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "required": false
    },
    "groups": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "required": true
    }
  }
}
Response  200
HideShow
Headers
Content-Type: text/plain
Body
User has been updated.
Response  400
HideShow

The provided entity is invalid. Examples include invalid email, invalid group name or group name does not exist.

Headers
Content-Type: application/json
Body
[
  {
    "field": "groups",
    "error": "Invalid group name"
  },
  {
    "field": "email",
    "error": "Invalid email"
  }
]
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "manage" permission.

Update user password
PUT/api/v1/user/{username}/password

Updates a users password, only if the user type is BASIC. For Kerberos this is not allowed

Example URI

PUT /api/v1/user/username/password
URI Parameters
HideShow
username
string (required) 

The unique identifier for the user (required)

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "value": "password"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "value": {
      "type": "string",
      "required": true
    }
  }
}
Response  200
HideShow
Headers
Content-Type: text/plain
Body
Password has been updated.
Response  400
HideShow

The provided entity is invalid. Examples include empty value or no value at all.

Headers
Content-Type: application/json
Body
"Invalid password"
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "manage" permission.

Delete a user
DELETE/api/v1/user/{username}

Deletes a user identified by the username.

Example URI

DELETE /api/v1/user/username
URI Parameters
HideShow
username
string (required) 

The unique identifier for the user (required)

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: text/plain
Body
User is deleted
Response  400
HideShow
Headers
Content-Type: text/plain
Body
The requested user does not exist.
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "manage" permission.

Service Accounts

List service accounts
GET/api/v1/serviceaccount

Returns all the service accounts in the security management layer.

Example URI

GET /api/v1/serviceaccount
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "name": "pam",
    "owner": "paul",
    "groups": [
      "foo"
    ]
  },
  {
    "name": "sam",
    "owner": null,
    "groups": [
      "bar"
    ]
  },
  {
    "name": "tim",
    "owner": null,
    "groups": [
      "foo"
    ]
  }
]
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "view" permission.

Get a service account
GET/api/v1/serviceaccount/{name}

Returns a service account identified by the given account name.

Example URI

GET /api/v1/serviceaccount/name
URI Parameters
HideShow
name
string (required) 

The unique identifier for the service account (required)

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "name": "pam",
  "owner": "paul",
  "groups": [
    "foo"
  ]
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "view" permission.
Response  404
HideShow
Headers
Content-Type: text/plain
Body
The requested service account does not exist

Create a service account
POST/api/v1/serviceaccount/

Creates a new service account. The name must be unique. If token is not provided one will be randomly generated and returned in the response.

Example URI

POST /api/v1/serviceaccount/
Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Body
{
  "name": "sammy",
  "owner": "bossman",
  "groups": [
    "foo",
    "bar"
  ],
  "token": "4cbddcfd-a5ca-4d6e-acc5-4f5db3c9548f"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "required": true
    },
    "owner": {
      "type": "string",
      "required": false
    },
    "groups": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "required": true
    },
    "token": {
      "type": "string",
      "required": false
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "token": "4cbddcfd-a5ca-4d6e-acc5-4f5db3c9548f"
}
Response  400
HideShow

The provided entity is invalid. Could be invalid or missing account name, invalid owner, invalid token, invalid group name or group name does not exist.

Headers
Content-Type: application/json
Body
[
  {
    "field": "name",
    "error": "Invalid account name"
  },
  {
    "field": "groups",
    "error": "Invalid group name"
  }
]
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "manage" permission.

Update a service account
PUT/api/v1/serviceaccount/{name}

Updates a service account identified by the account name.

Example URI

PUT /api/v1/serviceaccount/name
URI Parameters
HideShow
name
string (required) 

The unique identifier for the service account (required)

Request
HideShow
Headers
Content-Type: application/json
Body
{
   "owner":"sam@landoop.com",
   "groups:["foo"]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "owner": {
      "type": "string",
      "required": false
    },
    "groups": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "required": true
    }
  }
}
Response  200
HideShow
Headers
Content-Type: text/plain
Body
Service account has been updated.
Response  400
HideShow

The provided entity is invalid. Could be invalid or missing accout name, invalid owner, invalid or missing token, invalid group name or group name does not exist.

Headers
Content-Type: application/json
Body
[
  {
    "field": "name",
    "error": "Invalid account name"
  },
  {
    "field": "groups",
    "error": "Invalid group name"
  }
]
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "manage" permission.

Delete a service account
DELETE/api/v1/serviceaccount/{name}

Deletes a service account identified by the name.

Example URI

DELETE /api/v1/serviceaccount/name
URI Parameters
HideShow
name
string (required) 

The unique identifier for the service account (required)

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: text/plain
Body
Service account is deleted
Response  400
HideShow
Headers
Content-Type: text/plain
Body
The requested service account does not exist.
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "manage" permission.

Revoke a service account token
PUT/api/v1/serviceaccount/{name}/revoke

Revokes the current service account token. A new token is assigned to the service account.

Example URI

PUT /api/v1/serviceaccount/name/revoke
URI Parameters
HideShow
name
string (required) 

The unique identifier for the service account (required)

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Body
{
   "token":"4cbddcfd-a5ca-4d6e-acc5-4f5db3c9548f",
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "token": {
      "type": "string",
      "required": false
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "token": "4cbddcfd-a5ca-4d6e-acc5-4f5db3c9548f"
}
Response  400
HideShow
Headers
Content-Type: text/plain
Body
The requested service account does not exist.
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "manage" permission.

Permissions

These endpoints all return enumerations of permissions that can be included when creating or editing groups.

List namespace permissions
GET/api/v1/permission/namespace

Returns all the available namespace permissions, with a type that should be included in group requested, and a name that is a human readable version.

Example URI

GET /api/v1/permission/namespace
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "type": "CreateTopic",
    "name": "Create Topic",
    "system": "Kafka"
  },
  {
    "type": "DropTopic",
    "name": "Delete Topic",
    "system": "Kafka"
  },
  {
    "type": "ConfigureTopic",
    "name": "Configure Topic",
    "system": "Kafka"
  },
  {
    "type": "QueryTopic",
    "name": "View Data",
    "system": "Kafka"
  },
  {
    "type": "ShowTopic",
    "name": "Show Topic",
    "system": "Kafka"
  },
  {
    "type": "ViewSchema",
    "name": "View Topic Metadata",
    "system": "Kafka"
  },
  {
    "type": "InsertData",
    "name": "Insert Data",
    "system": "Kafka"
  },
  {
    "type": "DeleteData",
    "name": "Delete Data",
    "system": "Kafka"
  }
]
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "view" permission.

List namespace permissions
GET/api/v1/permission/namespace/{connectionName}/{entityName}

Returns all the available namespace permissions that the logged in user has for the given entity (typically a topic name)

Example URI

GET /api/v1/permission/namespace/connectionName/entityName
URI Parameters
HideShow
connectionName
string (required) 

The name of the connection under which the given entity exists. Currently ‘kafka’ is the only acceptable value. (required)

entityName
string (required) 

The name of the entity (required)

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "permissions": [
    "ShowTopic",
    "CreateTopic",
    "DropTopic",
    "ConfigureTopic",
    "QueryTopic",
    "InsertData",
    "DeleteData",
    "UpdateSchema",
    "ViewSchema"
  ]
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated

List scoped permissions
GET/api/v1/permission/scoped

Returns all the available scoped permissions, with a type that should be included in group requested, a name that is a human readable version, and two boolean flags which indicate if the permission can be set to viewable and / or manageable.

Example URI

GET /api/v1/permission/scoped
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "name": "Kafka Consumers",
    "viewable": "ViewKafkaConsumers",
    "manageable": "ManageKafkaConsumers"
  },
  {
    "name": "Kafka Connectors",
    "viewable": "ViewConnectors",
    "manageable": "ManageConnectors"
  },
  {
    "name": "SQL Processors",
    "viewable": "ViewSQLProcessors",
    "manageable": "ManageSQLProcessors"
  },
  {
    "name": "Schemas",
    "viewable": "ViewSchemaRegistry",
    "manageable": "ManageSchemaRegistry"
  },
  {
    "name": "Topology",
    "viewable": "ViewTopology",
    "manageable": "ManageTopology"
  }
]
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain

List admin permissions
GET/api/v1/permission/admin

Returns all the available admin permissions, with a type that should be included in group requested, a name that is a human readable version, and two boolean flags which indicate if the permission can be set to viewable and / or manageable.

Example URI

GET /api/v1/permission/admin
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "name": "Data Policies",
    "viewable": "ViewDataPolicies",
    "manageable": "ManageDataPolicies"
  },
  {
    "name": "Audit Logs",
    "viewable": "ViewAuditLogs",
    "manageable": null
  },
  {
    "name": "User Management",
    "viewable": "ViewUsers",
    "manageable": "ManageUsers"
  },
  {
    "name": "Alert Rules",
    "viewable": "ViewAlertRules",
    "manageable": "ManageAlertRules"
  },
  {
    "name": "Kafka Settings",
    "viewable": "ViewKafkaSettings",
    "manageable": "ManageKafkaSettings"
  },
  {
    "name": "Connection Management",
    "viewable": null,
    "manageable": "ManageConnections"
  }
]
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "view" permission.

Consumers

APIs for managing Kafka consumer groups.

Offsets

APIs for managing Kafka consumer group offsets.

Bulk update offsets for a consumer group
PUT/api/consumers/{groupId}/offsets

Updates consumer group offsets for all partitions of multiple topics of a consumer group.

If the optional topics array is omitted, then all topics will be affected. Otherwise only the specified topics will be affected.

Accepts multiple types of request payload:

  • timestamp - sets partition offset to that of the first record with timestamp greater or equal to the target timestamp

  • start - resets partition offset to earliest offset

  • end - sets partition offset to latest offset

Example URI

PUT /api/consumers/MyGroup/offsets
URI Parameters
HideShow
groupId
string (required) Example: MyGroup

The consumer group ID

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXXX
Body
{
  "type": "timestamp",
  "target": "2019-01-01T17:16:02+01:00",
  "topics": [
    "TopicA",
    "TopicB"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "timestamp"
      ]
    },
    "target": {
      "type": "string",
      "description": "The target timestamp in ISO 8601 format"
    },
    "topics": {
      "type": "array"
    }
  },
  "required": [
    "type",
    "target"
  ]
}
Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXXX
Body
{
  "type": "start",
  "topics": [
    "TopicA",
    "TopicB"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "start"
      ]
    },
    "topics": {
      "type": "array"
    }
  },
  "required": [
    "type"
  ]
}
Request
HideShow
  • HeadersBulkOffsetEnd X-Kafka-Lenses-Token: XXXXXX
Headers
Content-Type: application/json
Body
{
  "type": "end",
  "topics": [
    "TopicA",
    "TopicB"
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "end"
      ]
    },
    "topics": {
      "type": "array"
    }
  },
  "required": [
    "type"
  ]
}
Response  200
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
The client does not have the necessary permissions.

Update a single offset of a consumer group
PUT/api/consumers/{groupId}/offsets/topics/{topicName}/partitions/{partitionId}

Updates consumer group offsets for a single partition of a single topic.

Accepts multiple types of request payload:

  • absolute - sets partition offset to the provided value

  • start - resets partition offset to earliest offset

  • end - sets partition offset to latest offset

Example URI

PUT /api/consumers/MyGroup/offsets/topics/MyTopic/partitions/1
URI Parameters
HideShow
groupId
string (required) Example: MyGroup

The consumer group ID

topicName
string (required) Example: MyTopic

The topic name

partitionId
number (required) Example: 1

The partition ID

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXXX
Body
{
  "type": "absolute",
  "offset": 100
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "absolute"
      ]
    },
    "offset": {
      "type": "number"
    }
  },
  "required": [
    "type",
    "offset"
  ]
}
Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXXX
Body
{
  "type": "start"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "start"
      ]
    }
  },
  "required": [
    "type"
  ]
}
Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXXX
Body
{
  "type": "end"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "end"
      ]
    }
  },
  "required": [
    "type"
  ]
}
Response  200
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
The client does not have the necessary permissions.

External Apps

Lenses supports two types of External Apps. They can be either JVM Apps and HTTP Apps.

  • JVM Apps, can be instrumented by our JVM Client Library, by including it, as a dependancy in their codebase.

  • HTTP Apps can use our API to Register and Remove External Apps from Lenses.

External Apps

Register External Apps
POST/api/v1/apps/external

Register External Apps or App Runners. This endpoint is used to register a brand new app, or to update an existing one with more Runners. All requests (no matter if it is for the initial registration or adding an extra runner) MUST have the same body, except the runners key.

Example URI

POST /api/v1/apps/external
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Body
{
  "name": "app name",
  "metadata": {
    "owner": "prod",
    "tags": [
      "tag1",
      "tag2"
    ],
    "version": "1.0.2",
    "appType": "MicroService",
    "deployment": "Kubernetes",
    "description": "Description"
  },
  "input": [
    {
      "name": "nodeName"
    }
  ],
  "output": [
    {
      "name": "nodeName"
    }
  ],
  "runners": [
    {
      "url": "http://localhost:9999",
      "name": "runnerName",
      "healthCheckInterval": 100
    }
  ]
}
Schema
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "name should be unique, alphanumeric set of characters"
    },
    "metadata": {
      "type": "object",
      "properties": {
        "owner": {
          "type": "string",
          "description": "name of the owner of the app"
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "a set of unique strings"
        },
        "version": {
          "type": "string",
          "description": "version of the app"
        },
        "appType": {
          "type": "string",
          "description": "type of the app"
        },
        "deployment": {
          "type": "string",
          "description": "deployment of the app"
        },
        "description": {
          "type": "string",
          "description": "description of the app"
        }
      }
    },
    "input": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Node Name"
          }
        },
        "required": [
          "name"
        ]
      }
    },
    "output": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Node Name"
          }
        },
        "required": [
          "name"
        ]
      }
    },
    "runners": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "Url of the HealthCheck URL Endpoint"
          },
          "name": {
            "type": "string",
            "description": "Name of the Runner"
          },
          "healthCheckInterval": {
            "type": "number",
            "description": "How frequently we poll for updates(In ms)"
          }
        },
        "required": [
          "url",
          "healthCheckInterval"
        ]
      }
    }
  },
  "required": [
    "name"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow

The app has been successfully added.

Headers
Content-Type: application/json
Body
OK
Response  401
HideShow

The client is not authenticated.

Headers
Content-Type: text/plain
Body
The client is not authenticated
Response  403
HideShow

The client is not authorized

Headers
Content-Type: text/plain
Body
The supplied authentication is not authorized to access this resource
Response  409
HideShow

Conflict. External App already exists.

Headers
Content-Type: text/plain
Body
{ error: "The app with given name already exists, but with different data" }
Response  500
HideShow

Internal server error.

Headers
Content-Type: text/plain
Body
Internal Server Error. Description of the Problem

Remove External App
DELETE/api/v1/apps/external/{name}

Remove External Apps. This action will remove the external app as well as all the instances of the App

Example URI

DELETE /api/v1/apps/external/name
URI Parameters
HideShow
name
string (required) 

The unique identifier for the app

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: text/plain
Body
App is removed from lenses
Response  400
HideShow
Headers
Content-Type: text/plain
Body
The app with given name does not exist
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
The client is not authorized to register an app.
Response  500
HideShow

Internal server error.

Headers
Content-Type: text/plain
Body
Internal Server Error. Description of the Problem

Remove External App Runners
DELETE/api/v1/apps/external/{name}/runners

Remove External App Runners. This action will remove the runners from its App

Example URI

DELETE /api/v1/apps/external/name/runners
URI Parameters
HideShow
name
string (required) 

The unique identifier for the app

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Body
{
  "runners": [
    "192.123.342.12:8081",
    "192.123.342.12:8080"
  ]
}
Response  200
HideShow
Headers
Content-Type: text/plain
Body
Runners is removed
Response  400
HideShow
Headers
Content-Type: text/plain
Body
The app/runner you are trying to remove does not exist
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
The client is not authorized to register an app.
Response  500
HideShow

Internal server error.

Headers
Content-Type: text/plain
Body
Internal Server Error. Description of the Problem

Apps Listing

Get Apps
GET/api/ws/v1/apps

The client should be configured to handle Websockets. Once the connection has been opened it is expected the client sends one message containing the token to the server. If this first message does not arrive the server will cut the connection.

{
  "token": "LENSES SECURITY TOKEN",
}

The client should wait for incoming messages and stop when EOF is received.

Each message should contain a “type” key that indicates the content of the message.

  • HEARTBEAT - Heartbeat to keep the connection open, you must SKIP this (add continue)

  • DATA - JSON payload for the apps listing records

  • ERROR - Error message. json {type: "ERROR": message: "Error from server"}

Lifecycle:

  1. First send a DATA type message including the initial data
  2. Then send HEARTBEAT types of messages until we have an update apps listing
  3. Send a DATA type message including the updated data

Example Response for data (message type DATA)

{
    "type": "DATA"
    "data" : {
        "apps": [{}]
    },
}

Example Response for error (message type ERROR)

{
    "type": "ERROR"
    "data": {
        "error": "error message"
    }
}

Example Response for keeping the connection alive (message type HEARTBEAT)

{
    "type": "HEARTBEAT"
}

Example URI

GET /api/ws/v1/apps
Response  101
HideShow

The connection has been successfully added.

Headers
Content-Type: application/json
Body
{
  "type": "DATA",
  "data": {
    "apps": [
      {
        "name": "Application Name",
        "type": "EXTERNAL_APP",
        "subType": "Microservice",
        "actions": [
          "REMOVE_FROM_LENSES",
          "VIEW_TOPOLOGY"
        ],
        "owner": "Prod",
        "tags": [
          "tag1",
          "tag2"
        ],
        "version": "1.0.2",
        "source": "JVM",
        "deployment": {
          "cluster": "ClusterName",
          "namespace": "NamespaceName",
          "type": "CustomDeploymentType"
        },
        "description": "Description",
        "state": "RUNNING",
        "runners": {
          "active": 1,
          "expected": 2
        }
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "DATA",
        "ERROR",
        "HEARTBEAT"
      ],
      "description": "Type of message"
    },
    "data": {
      "type": "object",
      "properties": {
        "apps": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "EXTERNAL_APP"
                ],
                "description": "Type of application"
              },
              "subType": {
                "type": "string",
                "description": "This is the same as the appType when registering an app"
              },
              "actions": {
                "type": "array"
              },
              "owner": {
                "type": "string",
                "description": "name of the owner of the app"
              },
              "tags": {
                "type": "array",
                "description": "a set of strings"
              },
              "version": {
                "type": "string",
                "description": "version of the app"
              },
              "source": {
                "type": "string",
                "enum": [
                  "JVM",
                  "HTTP"
                ]
              },
              "deployment": {
                "type": "object",
                "properties": {
                  "cluster": {
                    "type": "string"
                  },
                  "namespace": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string"
                  }
                },
                "description": "deployment values"
              },
              "description": {
                "type": "string",
                "description": "description of the app"
              },
              "state": {
                "type": "string",
                "enum": [
                  "RUNNING",
                  "WARNING",
                  "UNKNOWN"
                ]
              },
              "runners": {
                "type": "object",
                "properties": {
                  "active": {
                    "type": "number",
                    "description": "Number of Runners with Running Status"
                  },
                  "expected": {
                    "type": "number",
                    "description": "Total number of Runners"
                  }
                },
                "required": [
                  "active",
                  "expected"
                ]
              }
            },
            "required": [
              "name",
              "type",
              "actions",
              "state"
            ]
          }
        }
      },
      "description": "JSON Payload for Apps"
    }
  },
  "required": [
    "type"
  ]
}

App Details - Metrics
GET/api/ws/v1/apps/{type}/{name}/metrics

The client should be configured to handle Websockets. Once the connection has been opened it is expected the client sends one message containing the token to the server. If this first message does not arrive the server will cut the connection.

{
  "token": "LENSES SECURITY TOKEN",
}

The client should wait for incoming messages and stop when EOF is received.

Each message should contain a “type” key that indicates the content of the message.

  • HEARTBEAT - Heartbeat to keep the connection open, you must SKIP this (add continue)

  • DATA - JSON payload for the apps listing records

  • ERROR - Error message

Lifecycle:

  1. First send a DATA type message including the initial data
  2. Then send HEARTBEAT types of messages until we have an update apps listing
  3. Send a DATA type message including the updated data

Example Response for data (message type DATA)

{
    "type": "DATA"
    "data" : {
        "metrics": {}
    },
}

Example Response for error (message type ERROR)

{
    "type": "ERROR"
    "data": {
        "error": "error message",
        "code": "NotFound"
    }
}

Example Response for keeping the connection alive (message type HEARTBEAT)

{
    "type": "HEARTBEAT"
}

Example URI

GET /api/ws/v1/apps/type/name/metrics
URI Parameters
HideShow
type
string (required) 

Type of the app (only external is handled at the moment)

name
string (required) 

Name of the app

Response  101
HideShow

The websocket connection has been successfully established. From now, server will send HEARTBEAT, ERROR (only in case of an error) or DATA messages. DATA messages format is described below.

Headers
Content-Type: application/json
Body
{
  "type": "DATA",
  "data": {
    "metrics": {
      "state": "RUNNING",
      "runners": {
        "active": 1,
        "expected": 2
      }
    },
    "runners": [
      {
        "url": "http://localhost:9991",
        "state": "RUNNING",
        "name": "runnerName",
        "healthCheckInterval": 100
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "DATA",
        "ERROR",
        "HEARTBEAT"
      ],
      "description": "Type of message"
    },
    "data": {
      "type": "object",
      "properties": {
        "metrics": {
          "type": "object",
          "properties": {
            "state": {
              "type": "string",
              "enum": [
                "RUNNING",
                "WARNING",
                "UNKNOWN"
              ]
            },
            "runners": {
              "type": "object",
              "properties": {
                "active": {
                  "type": "number",
                  "description": "Number of Runners with Running Status"
                },
                "expected": {
                  "type": "number",
                  "description": "Total number of Runners"
                }
              },
              "required": [
                "active",
                "expected"
              ]
            }
          },
          "required": [
            "state"
          ],
          "description": "The Metrics and Runners info for the App"
        },
        "runners": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string",
                "description": "The healthCheck Endpoint"
              },
              "state": {
                "type": "string",
                "enum": [
                  "RUNNING",
                  "UNKNOWN"
                ]
              },
              "name": {
                "type": "string",
                "description": "Name of the Runner"
              },
              "healthCheckInterval": {
                "type": "number",
                "description": "How frequently we poll for updates (in ms)"
              }
            },
            "required": [
              "url",
              "state",
              "healthCheckInterval"
            ]
          },
          "description": "The Runners with their individual information"
        }
      },
      "required": [
        "metrics"
      ],
      "description": "JSON Payload for Apps"
    }
  },
  "required": [
    "type"
  ]
}

App Details - Basic data
GET/api/ws/v1/apps/{type}/{name}/basic-data

The client should be configured to handle Websockets. Once the connection has been opened it is expected the client sends one message containing the token to the server. If this first message does not arrive the server will cut the connection.

{
  "token": "LENSES SECURITY TOKEN",
}

The client should wait for incoming messages and stop when EOF is received.

Each message should contain a “type” key that indicates the content of the message.

  • HEARTBEAT - Heartbeat to keep the connection open, you must SKIP this (add continue)

  • DATA - JSON payload for the apps listing records

  • ERROR - Error message

Lifecycle:

  1. First send a DATA type message including the initial data
  2. Then send HEARTBEAT types of messages until we have an update apps listing
  3. Send a DATA type message including the updated data

Example Response for data (message type DATA)

{
    "type": "DATA"
    "data" : {
        "metrics": {}
    },
}

Example Response for error (message type ERROR)

{
    "type": "ERROR"
    "data": {
        "error": "error message",
        "code": "NotFound"
    }
}

Example Response for keeping the connection alive (message type HEARTBEAT)

{
    "type": "HEARTBEAT"
}

Example URI

GET /api/ws/v1/apps/type/name/basic-data
URI Parameters
HideShow
type
string (required) 

Type of the app (only external is handled at the moment)

name
string (required) 

Name of the app

Response  101
HideShow

The websocket connection has been successfully established. From now, server will send HEARTBEAT, ERROR (only in case of an error) or DATA messages. DATA messages format is described below.

Headers
Content-Type: application/json
Body
{
  "type": "DATA",
  "data": {
    "name": "MyAppName",
    "type": "EXTERNAL_APP",
    "subType": "Microservice",
    "source": "JVM",
    "metadata": {
      "owner": "MyAwesomeTeam",
      "tags": [
        "remote",
        "cloud"
      ],
      "version": "v2.0.1",
      "description": "Description of my app"
    },
    "deployment": {
      "cluster": "ClusterName",
      "namespace": "NamespaceName",
      "type": "CustomDeploymentType"
    },
    "createdAt": 1573507281,
    "createdBy": "admin",
    "modifiedAt": 1591343138,
    "modifiedBy": "user_2"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "DATA",
        "ERROR",
        "HEARTBEAT"
      ],
      "description": "Type of message"
    },
    "data": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "name of the app"
        },
        "type": {
          "type": "string",
          "enum": [
            "EXTERNAL_APP"
          ],
          "description": "type of the application"
        },
        "subType": {
          "type": "string",
          "description": "subtype of the application"
        },
        "source": {
          "type": "string",
          "enum": [
            "JVM",
            "HTTP"
          ],
          "description": "source of the external app (JVM or HTTP)"
        },
        "metadata": {
          "type": "object",
          "properties": {
            "owner": {
              "type": "string"
            },
            "tags": {
              "type": "array",
              "items": [
                {
                  "type": "string"
                },
                {
                  "type": "string"
                }
              ]
            },
            "version": {
              "type": "string"
            },
            "description": {
              "type": "string"
            }
          },
          "description": "metadata details object"
        },
        "deployment": {
          "type": "object",
          "properties": {
            "cluster": {
              "type": "string"
            },
            "namespace": {
              "type": "string"
            },
            "type": {
              "type": "string"
            }
          },
          "description": "deployment details object"
        },
        "createdAt": {
          "type": "number",
          "description": "date & time the app was created, unix timestamp format"
        },
        "createdBy": {
          "type": "string",
          "description": "name of the user who registered the app"
        },
        "modifiedAt": {
          "type": "number",
          "description": "date & time the app was last modified, unix timestamp format"
        },
        "modifiedBy": {
          "type": "string",
          "description": "name of last user who modified the app"
        }
      },
      "required": [
        "name",
        "type",
        "metadata"
      ],
      "description": "JSON Payload for Apps"
    }
  },
  "required": [
    "type"
  ]
}

License

License

To run Lenses, a license is required. When it’s about to expire and you have obtained a new license, Lenses instance can be updated to use the new one.

Get License Details
GET/api/v1/license

Returns details of curently used license.

Example URI

GET /api/v1/license
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "maxBrokers": 12,
  "expiry": 1643673598000,
  "clientId": "",
  "isRespected": true,
  "settings": {
    "security": {
      "root": {
        "enabled": false
      },
      "basic": {
        "enabled": false,
        "restriction": {}
      },
      "ldap": {
        "enabled": false,
        "restriction": {}
      },
      "kerberos": {
        "enabled": false,
        "restriction": {}
      },
      "custom": {
        "enabled": false
      },
      "sso": {
        "enabled": false
      },
      "serviceAccount": {
        "enabled": false,
        "restriction": {}
      },
      "groups": {
        "enabled": false,
        "restriction": {}
      }
    },
    "sql": {
      "streaming": {
        "enabled": false,
        "restriction": {}
      },
      "sql": {
        "enabled": false
      }
    },
    "kafkaSettings": {
      "acls": false,
      "quotas": false,
      "consumerOffsetManagement": false
    },
    "audit": {
      "enabled": false,
      "integration": false
    },
    "connections": {
      "enabled": false
    },
    "application": {
      "topology": false,
      "connectorsOnKubernetes": false
    },
    "approval": {
      "enabled": false
    },
    "alerts": {
      "enabled": false,
      "rules": {},
      "integration": {
        "enabled": false,
        "channels": [],
        "max": {}
      }
    },
    "data": {
      "masking": false,
      "customSerde": false,
      "sla": false,
      "namespace": {
        "enabled": false,
        "max": {}
      }
    }
  },
  "currentTime": 0
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "maxBrokers": {
      "type": "number",
      "description": "How many brokers the license allows"
    },
    "expiry": {
      "type": "number",
      "description": "The epoch time when the license is terminating"
    },
    "clientId": {
      "type": "string",
      "description": "Unique client identifier"
    },
    "isRespected": {
      "type": "boolean",
      "description": "True if the license is met, false if the license requirements are broken"
    },
    "maxMessages": {
      "type": "number"
    },
    "message": {
      "type": "string"
    },
    "settings": {
      "type": "object",
      "properties": {
        "security": {
          "type": "object",
          "properties": {
            "root": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                }
              },
              "required": [
                "enabled"
              ]
            },
            "basic": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "restriction": {
                  "type": "object",
                  "properties": {}
                }
              },
              "required": [
                "enabled",
                "restriction"
              ]
            },
            "ldap": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "restriction": {
                  "type": "object",
                  "properties": {}
                }
              },
              "required": [
                "enabled",
                "restriction"
              ]
            },
            "kerberos": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "restriction": {
                  "type": "object",
                  "properties": {}
                }
              },
              "required": [
                "enabled",
                "restriction"
              ]
            },
            "custom": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                }
              },
              "required": [
                "enabled"
              ]
            },
            "sso": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                }
              },
              "required": [
                "enabled"
              ]
            },
            "serviceAccount": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "restriction": {
                  "type": "object",
                  "properties": {}
                }
              },
              "required": [
                "enabled",
                "restriction"
              ]
            },
            "groups": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "restriction": {
                  "type": "object",
                  "properties": {}
                }
              },
              "required": [
                "enabled",
                "restriction"
              ]
            }
          },
          "required": [
            "root",
            "basic",
            "ldap",
            "kerberos",
            "custom",
            "sso",
            "serviceAccount",
            "groups"
          ]
        },
        "sql": {
          "type": "object",
          "properties": {
            "streaming": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "restriction": {
                  "type": "object",
                  "properties": {}
                }
              },
              "required": [
                "enabled",
                "restriction"
              ]
            },
            "sql": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                }
              },
              "required": [
                "enabled"
              ]
            }
          },
          "required": [
            "streaming",
            "sql"
          ]
        },
        "kafkaSettings": {
          "type": "object",
          "properties": {
            "acls": {
              "type": "boolean"
            },
            "quotas": {
              "type": "boolean"
            },
            "consumerOffsetManagement": {
              "type": "boolean"
            }
          },
          "required": [
            "acls",
            "quotas",
            "consumerOffsetManagement"
          ]
        },
        "audit": {
          "type": "object",
          "properties": {
            "enabled": {
              "type": "boolean"
            },
            "integration": {
              "type": "boolean"
            }
          },
          "required": [
            "enabled",
            "integration"
          ]
        },
        "connections": {
          "type": "object",
          "properties": {
            "enabled": {
              "type": "boolean"
            }
          },
          "required": [
            "enabled"
          ]
        },
        "application": {
          "type": "object",
          "properties": {
            "topology": {
              "type": "boolean"
            },
            "connectorsOnKubernetes": {
              "type": "boolean"
            }
          },
          "required": [
            "topology",
            "connectorsOnKubernetes"
          ]
        },
        "approval": {
          "type": "object",
          "properties": {
            "enabled": {
              "type": "boolean"
            }
          },
          "required": [
            "enabled"
          ]
        },
        "alerts": {
          "type": "object",
          "properties": {
            "enabled": {
              "type": "boolean"
            },
            "rules": {
              "type": "object",
              "properties": {}
            },
            "integration": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "channels": {
                  "type": "array"
                },
                "max": {
                  "type": "object",
                  "properties": {}
                }
              },
              "required": [
                "enabled",
                "max"
              ]
            }
          },
          "required": [
            "enabled",
            "rules",
            "integration"
          ]
        },
        "data": {
          "type": "object",
          "properties": {
            "masking": {
              "type": "boolean"
            },
            "customSerde": {
              "type": "boolean"
            },
            "sla": {
              "type": "boolean"
            },
            "namespace": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "max": {
                  "type": "object",
                  "properties": {}
                }
              },
              "required": [
                "enabled",
                "max"
              ]
            }
          },
          "required": [
            "masking",
            "customSerde",
            "sla",
            "namespace"
          ]
        }
      },
      "required": [
        "security",
        "sql",
        "kafkaSettings",
        "audit",
        "connections",
        "application",
        "approval",
        "alerts",
        "data"
      ]
    },
    "currentTime": {
      "type": "number"
    }
  },
  "required": [
    "maxBrokers",
    "expiry",
    "clientId",
    "isRespected",
    "settings",
    "currentTime"
  ]
}
Response  401
HideShow

The client is not authenticated.

Headers
Content-Type: text/plain
Body
The client is not authenticated
Response  500
HideShow

Internal server error.

Headers
Content-Type: text/plain
Body
Internal Server Error. Description of the Problem

Update License
PUT/api/v1/license

Updates the Lenses license. The request body should contain the license content as received.

Example URI

PUT /api/v1/license
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Body
{
  "source": "Lenses.io Ltd",
  "clientId": "a3483f2f-4a4e-4ef7-bc67-4a9922efa94a",
  "details": "Lenses",
  "key": "eyJhbGciOiJBMTI4S1ciLCJlbmMiOiJBMTI4Q0JDLUhTMjU2In0"
}
Schema
{
  "type": "object",
  "properties": {
    "source": {
      "type": "string",
      "description": "License source"
    },
    "clientId": {
      "type": "string",
      "description": "Client ID"
    },
    "details": {
      "type": "string",
      "description": "License details"
    },
    "key": {
      "type": "string",
      "description": "License Key"
    }
  },
  "required": [
    "source",
    "clientId",
    "details",
    "key"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow

The license has been successfully updated.

Headers
Content-Type: application/json
Body
{
  "maxBrokers": 12,
  "expiry": 1643673598000,
  "clientId": "",
  "isRespected": true,
  "settings": {
    "security": {
      "root": {
        "enabled": false
      },
      "basic": {
        "enabled": false,
        "restriction": {}
      },
      "ldap": {
        "enabled": false,
        "restriction": {}
      },
      "kerberos": {
        "enabled": false,
        "restriction": {}
      },
      "custom": {
        "enabled": false
      },
      "sso": {
        "enabled": false
      },
      "serviceAccount": {
        "enabled": false,
        "restriction": {}
      },
      "groups": {
        "enabled": false,
        "restriction": {}
      }
    },
    "sql": {
      "streaming": {
        "enabled": false,
        "restriction": {}
      },
      "sql": {
        "enabled": false
      }
    },
    "kafkaSettings": {
      "acls": false,
      "quotas": false,
      "consumerOffsetManagement": false
    },
    "audit": {
      "enabled": false,
      "integration": false
    },
    "connections": {
      "enabled": false
    },
    "application": {
      "topology": false,
      "connectorsOnKubernetes": false
    },
    "approval": {
      "enabled": false
    },
    "alerts": {
      "enabled": false,
      "rules": {},
      "integration": {
        "enabled": false,
        "channels": [],
        "max": {}
      }
    },
    "data": {
      "masking": false,
      "customSerde": false,
      "sla": false,
      "namespace": {
        "enabled": false,
        "max": {}
      }
    }
  },
  "currentTime": 0
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "maxBrokers": {
      "type": "number",
      "description": "How many brokers the license allows"
    },
    "expiry": {
      "type": "number",
      "description": "The epoch time when the license is terminating"
    },
    "clientId": {
      "type": "string",
      "description": "Unique client identifier"
    },
    "isRespected": {
      "type": "boolean",
      "description": "True if the license is met, false if the license requirements are broken"
    },
    "maxMessages": {
      "type": "number"
    },
    "message": {
      "type": "string"
    },
    "settings": {
      "type": "object",
      "properties": {
        "security": {
          "type": "object",
          "properties": {
            "root": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                }
              },
              "required": [
                "enabled"
              ]
            },
            "basic": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "restriction": {
                  "type": "object",
                  "properties": {}
                }
              },
              "required": [
                "enabled",
                "restriction"
              ]
            },
            "ldap": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "restriction": {
                  "type": "object",
                  "properties": {}
                }
              },
              "required": [
                "enabled",
                "restriction"
              ]
            },
            "kerberos": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "restriction": {
                  "type": "object",
                  "properties": {}
                }
              },
              "required": [
                "enabled",
                "restriction"
              ]
            },
            "custom": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                }
              },
              "required": [
                "enabled"
              ]
            },
            "sso": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                }
              },
              "required": [
                "enabled"
              ]
            },
            "serviceAccount": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "restriction": {
                  "type": "object",
                  "properties": {}
                }
              },
              "required": [
                "enabled",
                "restriction"
              ]
            },
            "groups": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "restriction": {
                  "type": "object",
                  "properties": {}
                }
              },
              "required": [
                "enabled",
                "restriction"
              ]
            }
          },
          "required": [
            "root",
            "basic",
            "ldap",
            "kerberos",
            "custom",
            "sso",
            "serviceAccount",
            "groups"
          ]
        },
        "sql": {
          "type": "object",
          "properties": {
            "streaming": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "restriction": {
                  "type": "object",
                  "properties": {}
                }
              },
              "required": [
                "enabled",
                "restriction"
              ]
            },
            "sql": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                }
              },
              "required": [
                "enabled"
              ]
            }
          },
          "required": [
            "streaming",
            "sql"
          ]
        },
        "kafkaSettings": {
          "type": "object",
          "properties": {
            "acls": {
              "type": "boolean"
            },
            "quotas": {
              "type": "boolean"
            },
            "consumerOffsetManagement": {
              "type": "boolean"
            }
          },
          "required": [
            "acls",
            "quotas",
            "consumerOffsetManagement"
          ]
        },
        "audit": {
          "type": "object",
          "properties": {
            "enabled": {
              "type": "boolean"
            },
            "integration": {
              "type": "boolean"
            }
          },
          "required": [
            "enabled",
            "integration"
          ]
        },
        "connections": {
          "type": "object",
          "properties": {
            "enabled": {
              "type": "boolean"
            }
          },
          "required": [
            "enabled"
          ]
        },
        "application": {
          "type": "object",
          "properties": {
            "topology": {
              "type": "boolean"
            },
            "connectorsOnKubernetes": {
              "type": "boolean"
            }
          },
          "required": [
            "topology",
            "connectorsOnKubernetes"
          ]
        },
        "approval": {
          "type": "object",
          "properties": {
            "enabled": {
              "type": "boolean"
            }
          },
          "required": [
            "enabled"
          ]
        },
        "alerts": {
          "type": "object",
          "properties": {
            "enabled": {
              "type": "boolean"
            },
            "rules": {
              "type": "object",
              "properties": {}
            },
            "integration": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "channels": {
                  "type": "array"
                },
                "max": {
                  "type": "object",
                  "properties": {}
                }
              },
              "required": [
                "enabled",
                "max"
              ]
            }
          },
          "required": [
            "enabled",
            "rules",
            "integration"
          ]
        },
        "data": {
          "type": "object",
          "properties": {
            "masking": {
              "type": "boolean"
            },
            "customSerde": {
              "type": "boolean"
            },
            "sla": {
              "type": "boolean"
            },
            "namespace": {
              "type": "object",
              "properties": {
                "enabled": {
                  "type": "boolean"
                },
                "max": {
                  "type": "object",
                  "properties": {}
                }
              },
              "required": [
                "enabled",
                "max"
              ]
            }
          },
          "required": [
            "masking",
            "customSerde",
            "sla",
            "namespace"
          ]
        }
      },
      "required": [
        "security",
        "sql",
        "kafkaSettings",
        "audit",
        "connections",
        "application",
        "approval",
        "alerts",
        "data"
      ]
    },
    "currentTime": {
      "type": "number"
    }
  },
  "required": [
    "maxBrokers",
    "expiry",
    "clientId",
    "isRespected",
    "settings",
    "currentTime"
  ]
}
Response  401
HideShow

The client is not authenticated.

Headers
Content-Type: text/plain
Body
The client is not authenticated
Response  403
HideShow

The client is not authorized. The user requires permission to update the license.

Headers
Content-Type: text/plain
Body
The supplied authentication is not authorized to access this resource
Response  500
HideShow

Internal server error.

Headers
Content-Type: text/plain
Body
Internal Server Error. Description of the Problem

Generated by aglio on 08 Dec 2021