Lenses API (v4.1)
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 ¶
LoginPOST/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
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"
]
}
200
Contains the full Lenses security token
Headers
Content-Type: text/plain
Body
a1f44cb8-0f37-4b96-828c-57bbd8000000
401
Headers
Content-Type: application/json
Body
UNAUTHORIZED
User Details ¶
User DetailsGET/api/auth
Returns current user permission
Example URI
Headers
X-Kafka-Lenses-Token: XXXXX
200
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"
]
}
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Logout ¶
LogoutGET/api/logout
Closes the user session and the security token associated with it is dropped.
Example URI
Headers
Content-Type: application/json
200
Headers
Content-Type: application/json
Body
When the operation is successful.
401
Headers
Content-Type: application/json
Body
UNAUTHORIZED
List admin permission ¶
List admin permissionGET/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
Headers
X-Kafka-Lenses-Token: XXXXX
200
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"
}
]
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "view" permission.
List supported security types ¶
List supported security typesGET/api/v1/security/type/user
Returns all supported user types.
Example URI
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXXX
200
Headers
Content-Type: application/json
Body
[
"BASIC",
"KERBEROS"
]
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
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 LoginPOST/api/v2/login/saml
Initiates the SAML SSO protocol with the configured external Identity Provider (IdP). This is a browser-based API.
Example URI
302
Headers
Location: https://my.saml.sso.provider
Set-Cookie: ll.pac4j=xxxx
SAML Callback ¶
SAML CallbackPOST/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
- client_name
string
(required) Example: SAML2ClientSpecify for Lenses to treat it as a SAML protocol
302
Headers
Location: https://my.lenses.io?fromSSO=true
SAML Metadata ¶
SAML MetadataGET/api/v2/auth/saml/sp-metadata
The Lenses SAML XML metadata as a Service Provider (SP).
Example URI
200
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&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&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&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&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 ACLGET/api/acl
Example URI
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#"
}
200
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"
}
}
}
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Create or update an ACLPUT/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
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#"
}
200
Headers
Content-Type: application/json
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Delete ACLsDELETE/api/acl
Example URI
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#"
}
200
Headers
Content-Type: application/json
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
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:
-
/config/users/
/clients/ -
/config/users/
/clients/ -
/config/users/
-
/config/users/
/clients/ -
/config/users/
/clients/ -
/config/users/
-
/config/clients/
-
/config/clients/
List Kafka QuotasGET/api/quotas
Returns all the quotas setup in your cluster.
Example URI
Headers
X-Kafka-Lenses-Token: XXXXX
200
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"
}
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Create for all usersPUT/api/quotas/users
Create a quota for all users and all clients
Example URI
Headers
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Create a quota for a userPUT/api/quotas/users/{user}
Create a quota for a specific user
Example URI
- user
string
(required) Example: adminThe user to create the quota for
Headers
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Create for all clients of a userPUT/api/quotas/users/{user}/clients
Create a quota for a specific user for all him client apps
Example URI
- user
string
(required) Example: adminThe user to create the quota for
Headers
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Create for a user and a clientPUT/api/quotas/users/{user}/clients/{client}
Create a quota for a specific client of a specific user
Example URI
- user
string
(required) Example: adminThe user to create the quota for
- client
string
(required) Example: client1The client id to create the quota for
Headers
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Delete for all usersDELETE/api/quotas
Delete a quota for all users and all clients. Deletes properties sent in the payload.
Example URI
Headers
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Delete a user quotaDELETE/api/quotas/users/{user}
Deletes a quota for a specific user. Deletes properties sent in the payload.
Example URI
- user
string
(required) Example: adminThe user to create the quota for
Headers
X-Kafka-Lenses-Token: XXXXX
Body
[
"producer_byte_rate",
"consumer_byte_rate",
"request_percentage"
]
200
Headers
Content-Type: application/json
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Delete for all usersDELETE/api/quotas/users
Deletes the default quota of all users. Deletes properties sent in the payload.
Example URI
Headers
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Delete for a user and all clientDELETE/api/quotas/users/{user}/clients
Delete a quota for a specific user for all clients. Deletes properties sent in the payload.
Example URI
- user
string
(required) Example: adminThe user to create the quota for
Headers
X-Kafka-Lenses-Token: XXXXX
Body
[
"producer_byte_rate",
"consumer_byte_rate",
"request_percentage"
]
200
Headers
Content-Type: application/json
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Delete for a user and a clientDELETE/api/quotas/users/{user}/clients/{client}
Delete a quota for a specific user and specific client. Deletes properties sent in the payload.
Example URI
- user
string
(required) Example: adminThe user to create the quota for
- client
string
(required) Example: client1The client id to create the quota for
Headers
X-Kafka-Lenses-Token: XXXXX
Body
[
"producer_byte_rate",
"consumer_byte_rate",
"request_percentage"
]
200
Headers
Content-Type: application/json
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Create for all clientsPUT/api/quotas/clients
Create a quota for all clients
Example URI
Headers
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Create a quota for a clientPUT/api/quotas/clients/{client}
Create a quota for a specific client
Example URI
- client
string
(required) Example: client1The client id to create the quota for
Headers
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Delete for all clientsDELETE/api/quotas/clients
Delete a quota for all clients. Deletes properties sent in the payload.
Example URI
Headers
X-Kafka-Lenses-Token: XXXXX
Body
[
"producer_byte_rate",
"consumer_byte_rate",
"request_percentage"
]
200
Headers
Content-Type: application/json
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Delete a client quotaDELETE/api/quotas/clients/{client}
Delete a quota for a specific clients. Deletes properties sent in the payload.
Example URI
- client
string
(required) Example: client1The client id to create the quota for
Headers
X-Kafka-Lenses-Token: XXXXX
Body
[
"producer_byte_rate",
"consumer_byte_rate",
"request_percentage"
]
200
Headers
Content-Type: application/json
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
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 connectorsGET/api/proxy-connect/{clusterAlias}/connectors
Example URI
- clusterAlias
string
(required)The connect cluster
alias
name
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
+ Attributes (Kafka Connect API Response)
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Create new connectorPOST/api/proxy-connect/{clusterAlias}/connectors
Example URI
- clusterAlias
string
(required)The connect cluster
alias
name
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
+ Attributes (Kafka Connect API Response)
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Running Connectors ¶
Get information about a specific connectorGET/api/proxy-connect/{clusterAlias}/connectors/{connectorName}
Example URI
- clusterAlias
string
(required)The connect cluster
alias
name- connectorName
string
(required)The connector name to get information for
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
+ Attributes (Kafka Connect API Response)
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Remove a running connectorDELETE/api/proxy-connect/{clusterAlias}/connectors/{connectorName}
Example URI
- clusterAlias
string
(required)The connect cluster
alias
name- connectorName
string
(required)The unique connector name
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
+ Attributes (Kafka Connect API Response)
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Get connector configGET/api/proxy-connect/{clusterAlias}/connectors/{connectorName}/config
Example URI
- clusterAlias
string
(required)The connect cluster
alias
name- connectorName
string
(required)The connector name to get information for
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
+ Attributes (Kafka Connect API Response)
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Set connector configPUT/api/proxy-connect/{clusterAlias}/connectors/{connectorName}/config
Example URI
- clusterAlias
string
(required)The connect cluster
alias
name- connectorName
string
(required)The connector name to set information to
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
+ Attributes (Kafka Connect API Response)
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Get connector statusGET/api/proxy-connect/{clusterAlias}/connectors/{connectorName}/status
Example URI
- clusterAlias
string
(required)The connect cluster
alias
name- connectorName
string
(required)The connector name to get status for
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
+ Attributes (Kafka Connect API Response)
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Pause a connectorPUT/api/proxy-connect/{clusterAlias}/connectors/{connectorName}/pause
Example URI
- clusterAlias
string
(required)The connect cluster
alias
name- connectorName
string
(required)The connector name to pause
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
+ Attributes (Kafka Connect API Response)
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Resume a paused connectorPUT/api/proxy-connect/{clusterAlias}/connectors/{connectorName}/resume
Example URI
- clusterAlias
string
(required)The connect cluster
alias
name- connectorName
string
(required)The connector name to resume
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
+ Attributes (Kafka Connect API Response)
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Restart a connectorPOST/api/proxy-connect/{clusterAlias}/connectors/{connectorName}/restart
Example URI
- clusterAlias
string
(required)The connect cluster
alias
name- connectorName
string
(required)The connector name to restart
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
+ Attributes (Kafka Connect API Response)
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
List connector tasksGET/api/proxy-connect/{clusterAlias}/connectors/{connectorName}/tasks
Example URI
- clusterAlias
string
(required)The connect cluster
alias
name- connectorName
string
(required)The connector name to get info for
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
+ Attributes (Kafka Connect API Response)
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Get connector task statusGET/api/proxy-connect/{clusterAlias}/connectors/{connectorName}/tasks/{task_id}/status
Example URI
- 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
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
+ Attributes (Kafka Connect API Response)
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Restart a connector taskPOST/api/proxy-connect/{clusterAlias}/connectors/{connectorName})/tasks/{task_id}/restart
Example URI
- clusterAlias
string
(required)The connect cluster
alias
name- connectorName
string
(required)The unique connector name
- task_id
string
(required)The task id to restart
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
+ Attributes (Kafka Connect API Response)
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
List available connector pluginsGET/api/proxy-connect/{clusterAlias}/connector-plugins
Example URI
- clusterAlias
string
(required)The connect cluster
alias
name
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
+ Attributes (Kafka Connect API Response)
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Data Access ¶
Lenses APIs for SQL.
Query data via SQL ¶
Query data via SQLGET/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
- sql
string
(required) Example: SELECT+*+FROM+%60topicA%60%0ALIMIT+1000Encoded URL Lenses SQL query
- stats
number
(required) Example: 4000Stats are enabled and pushed out every x(stats=4000 means every 4 seconds)
- offsets
boolean
(required) Example: falseThe end record will pull the offsets for the topic and will be attached to the end record, Optional
200
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 KafkaDELETE/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
- topicName
string
(required) Example: tradesThe topic name to delete from
- partition
number
(required) Example: 1The partition to delete from
- offset
number
(required) Example: 1000The offset to delete upto
Headers
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
Records deleted
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
404
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 topicPOST/api/topics/
Create a new Kafka topic
Example URI
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"
]
}
400
Headers
Content-Type: text/plain
Body
Error Message
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Get extended info for all topicsGET/api/topics
Returns description of all topics.
Example URI
Headers
X-Kafka-Lenses-Token: XXXXX
200
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"
]
}
]
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}
400
Headers
Content-Type: text/plain
Body
Error Message
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Get topic infoGET/api/topics/{topicName}
Returns description of the specified topic
Example URI
- topicName
string
(required)The topic to retrieve
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
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"
]
}
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"
}
},
"required": [
"topicName",
"partitions",
"replication",
"isControlTopic",
"isCompacted",
"keyType",
"valueType",
"totalMessages",
"messagesPerSecond",
"isMarkedForDeletion",
"timestamp",
"permissions"
]
}
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
404
Headers
Content-Type: text/plain
Body
Topic summary requested for topic {topicName} but no such summary exists
Get topic list - v1GET/api/v1/kafka/topics
Returns a list of topics accessible by the user
Example URI
Headers
X-Kafka-Lenses-Token: XXXXX
200
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"
}
400
Headers
Content-Type: text/plain
Body
Error Message
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Get topic list - v2GET/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
- pageSize
number
(required) Example: 25The items per single page, must be greater than zero.
- page
number
(optional) Example: 1The 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: partitionsUsed for sorting the paged results. Accepts topic field names (e.g. topicName, partitions)
- sortingOrder
string
(optional) Example: ascAllows to specify sorting order. Accepted values: asc (ascending, default value), desc (descending)
- includeSystemTopics
boolean
(optional) Example: falseAllows to include system topics. Default value is false
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
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"
}
}
}
400
Headers
Content-Type: text/plain
Body
Error Message
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Update topicPUT/api/configs/topics/{topicName}
Update topic configuration
Example URI
- topicName
string
(required)The topic to update/configure
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"
}
}
}
200
Headers
Content-Type: text/plain
Body
"OK"
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Delete topicDELETE/api/topics/{topicName}
Example URI
- topicName
string
(required)The topic to delete
200
Headers
Content-Type: text/plain
Body
"OK"
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
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 metadataGET/api/metadata/topics
Retrieve all data catalog metadata.
Example URI
Headers
X-Kafka-Lenses-Token: XXXXX
200
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"
}
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Get topic metadataGET/api/metadata/topics/{topicName}
Example URI
- topicName
string
(required)The topic to get metadata
Headers
X-Kafka-Lenses-Token: XXXXX
200
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#"
}
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Set topic metadataPOST/api/metadata/topics/{topicName}?keyType={keyType}&valueType={valueType}
Example URI
- topicName
string
(required) Example: testThe topic to set metadata
- keyType
string
(required) Example: STRINGThe type for the key
- valueType
string
(required) Example: STRINGThe type for the value
Headers
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: text/plain
Body
"OK"
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Delete topic metadataDELETE/api/system/topics/metadata/{topicName}
Example URI
- topicName
string
(required)The topic to delete metadata
Headers
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: text/plain
Body
"OK"
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Apache Kafka Topics V1 ¶
APIs for managing Apache Kafka topics
Create topic and attach schema to itPOST/api/v1/kafka/topic
Create a new Kafka topic and the schema attached to it
Example URI
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Body
{
"name": "newTopic",
"replication": 1,
"partitions": 1,
"configs": {
"key": "cleanup.policy",
"value": "compact"
},
"format": {
"key": {
"format": "INT/LONG/STRING/AVRO/JSON/CSV/XML",
"schema": "AVRO_SCHEMA_JSON"
},
"value": {
"format": "INT/LONG/STRING/AVRO/JSON/CSV/XML",
"schema": "AVRO_SCHEMA_JSON"
}
}
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"name": {
"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"
},
"format": {
"type": "object",
"properties": {
"key": {
"type": "object",
"properties": {
"format": {
"type": "string",
"description": "the message key storage format"
},
"schema": {
"type": "string",
"description": "Required only for AVRO/JSON/CSV/XML. For the primitives this field should not be provided"
}
},
"required": [
"format"
],
"description": "contains the message key data information"
},
"value": {
"type": "object",
"properties": {
"format": {
"type": "string",
"description": "the message key storage format"
},
"schema": {
"type": "string",
"description": "Required only for AVRO/JSON/CSV/XML. For the primitives this field should not be provided"
}
},
"required": [
"format"
],
"description": "contains the message value data information"
}
},
"description": "contains the topic format information"
}
},
"required": [
"name"
]
}
200
Headers
Content-Type: application/json
Body
+ Attributes (Create Topic V1 Response)
400
Headers
Content-Type: application/json
Body
+ Attributes (Endpoint Error)
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
500
Headers
Content-Type: text/plain
Body
An error has occurred
ElasticSearch Indexes ¶
APIs for managing ElasticSearch Indexes
Get ES Indixes listGET/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
- connectionName
string
(optional) Example: esConnectionThe name of the connection to get indexes from.
- includeSystemIndexes
boolean
(optional)Whether to include the system indexes or not
Headers
X-Kafka-Lenses-Token: XXXXX
200
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"
}
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
404
Headers
Content-Type: text/plain
Body
Not found
500
Headers
Content-Type: text/plain
Body
Failed to retrieve ES Indexes. Error [error message]
Details of an ES IndexGET/api/elastic/indexes/{connectionName}/{indexName}
The result will be an object.
Example URI
- connectionName
string
(required) Example: esConnectionThe name of the connection to get indexes from
- indexName
string
(required) Example: IndexNameThe name of the index to get records from
Headers
X-Kafka-Lenses-Token: XXXXX
200
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"
}
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"
}
}
}
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
404
Headers
Content-Type: text/plain
Body
Not found
500
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 datasetsGET/api/v1/datasets?pageSize={pageSize}&page={page}&query={query}&connections={connections}&sortBy={sortBy}&sortingOrder={sortingOrder}&includeSystemEntities={includeSystemEntities}&includeMetadata={includeMetadata}
Example URI
- pageSize
number
(required) Example: 25The items per single page, must be greater than zero.
- page
number
(optional) Example: 1The page number to be returned, must be greater than zero. Defaults to 1.
- query
number
(optional) Example: ordersA search keyword to match against the dataset name, fields and field descriptions.
- connections
array[string]
(optional) Example: kafkaA list of connection name to filter the datasets by (an empty value results in no filtering).
- sortBy
string
(optional) Example: partitionsUsed for sorting the paged results. Accepts dataset field names (e.g. name, records, sizeBytes, connectionName, sourceType, etc.)
- sortingOrder
string
(optional) Example: ascAllows to specify sorting order. Accepted values: asc (ascending, default value), desc (descending)
- includeSystemEntities
boolean
(optional) Example: falseAllows to include system topics (e.g. Kafka’s
__consumer_offsets
). Default value is false.- includeMetadata
boolean
(optional) Example: falseWhether to search only by table name, or also to include field names/documentation (defaults to true).
Headers
X-Kafka-Lenses-Token: XXXXX
200
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,
"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"
],
"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"
],
"sourceType": "Elastic"
}
],
"pagesAmount": 1,
"totalCount": 2
},
"sourceTypes": [
"Kafka",
"Elastic"
]
}
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Periodically produced messagesGET/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
- connectionName
string
(required) Example: kafkaName of the connection where entity exists
- entityName
string
(required) Example: topicAName of the entity
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
[
{
"date": "2020-05-26T00:00:00Z",
"messagesCount": 100,
},
...
{
"date": "2020-06-24T00:00:00Z",
"messagesCount": 200
}
]
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
404
Headers
Content-Type: text/plain
Body
The requested resource could not be found.
Live dataset metricsGET/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:
- First send a DATA type message including the initial data
- Then send HEARTBEAT types of messages until we have an update of metrics
- 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
- connectionName
string
(required) Example: kafkaName of the connection where entity exists
- entityName
string
(required) Example: topicAName of the entity
101
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"
]
}
Requests ¶
Lenses APIs for requesting/approving/rejecting the creation of Kafka topics.
Requests ¶
Create a RequestPOST/api/v1/approvals
Creates a request.
Example URI
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#"
}
200
Headers
Content-Type: application/json
Body
{id: "92384-234-23"}
400
Headers
Content-Type: text/plain
Body
Bad Request
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
List of RequestsGET/api/v1/approvals?pageSize={pageSize}&page={page}
Returns all Requests.
Example URI
- page
number
(optional) Example: 1The page number to be returned, must be greater than zero. Defaults to 1.
- pageSize
number
(required) Example: 10The elements amount on a single page, must be greater than zero.
- approvalStatus
string
(optional) Example: PendingFilter for request status.
- entityName
string
(optional) Example: topicFilter for entity names beginning with this.
- sortField
string
(optional) Example: fieldSort by specific field.
- sortOrder
'asc' | 'desc'
(optional) Example: fieldSort order.
Headers
X-Kafka-Lenses-Token: XXXXX
200
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 RequestGET/api/v1/approvals/{id}
Returns the details of the request with the specific id.
Example URI
- id
string
(required) Example: 473872The id of the request that we want the details of.
Headers
X-Kafka-Lenses-Token: XXXXX
200
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 RequestPUT/api/v1/approvals/{id}/approve
Approves the request and proceeds to the requested action
Example URI
- id
string
(required) Example: 473872The id of the request that we want to approve.
Headers
X-Kafka-Lenses-Token: XXXXX
204
Headers
Content-Type: No Content
400
Headers
Content-Type: text/plain
Body
Bad Request
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Reject a RequestPUT/api/v1/approvals/{id}/reject
Rejects the request.
Example URI
- id
string
(required) Example: 473872The id of the request that we want to approve.
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"
}
}
}
204
Headers
Content-Type: No Content
400
Headers
Content-Type: text/plain
Body
Bad Request
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
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 functionsGET/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
Headers
X-Kafka-Lenses-Token: XXXXX
200
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"
}
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
500
Headers
Content-Type: text/plain
Body
Failed to retrieve obfuscation types. Error [error message]
List data categoriesGET/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
Headers
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
[
"PII",
"Financial",
"Classified"
]
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
List impact typesGET/api/protection/static/impact
A data policy impact on the data can be assessed by the person setting it.
Example URI
Headers
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
[
"Low",
"Medium",
"High"
]
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
List all data policiesGET/api/protection/policy
Get all current Data Protection policies - with relevant stats
Example URI
Headers
X-Kafka-Lenses-Token: XXXXX
200
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": "dimitris",
"impact": {
"topics": [
"topics"
],
"connectionEntities": [
{
"connectionName": "connectionName",
"connectionType": "connectionType",
"datasetsWithFields": [
{
"datasetName": "name",
"matchingKeyFields": [
{
"name": "name",
"parents": [
"parent"
]
}
],
"matchingValueFields": [
{
"name": "name",
"parents": [
"parent"
]
}
]
}
],
"entities": [
"Hello, world!"
]
}
],
"apps": [
{
"name": "name",
"type": "type"
}
],
"connectors": [
"connectors"
],
"processors": [
"processors"
]
}
}
]
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
500
Headers
Content-Type: text/plain
Body
Failed to retrieve policies. Error [error message]
Create new policyPOST/api/protection/policy
Create a new Data Protection Policy that gets activated immediately.
Example URI
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"
]
}
201
Headers
Content-Type: application/json
Body
Policy created
400
Headers
Content-Type: application/json
Body
Failed to create policy. Error [error message]
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
500
Headers
Content-Type: text/plain
Body
Failed to create policy. Error [error message]
Update a policyPUT/api/protection/policy/{policy_id}
Update a Data Policy by ID
Example URI
- policy_id
string
(required) Example: 0The unique identifier for the policy
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"
]
}
200
Headers
Content-Type: application/json
Body
Policy updated
400
Headers
Content-Type: application/json
Body
Failed to update policy. Error [error message]
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
404
Headers
Content-Type: application/json
Body
Not found
500
Headers
Content-Type: text/plain
Body
Failed to update policy. Error [error message]
List data policy versionsGET/api/protection/policy/{policy_id}/versions
Example URI
- policy_id
string
(required) Example: 0The unique identifier for the policy
Headers
X-Kafka-Lenses-Token: XXXXX
200
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",
"impact": {
"topics": [
"topics"
],
"connectionEntities": [
{
"connectionName": "connectionName",
"connectionType": "connectionType",
"datasetsWithFields": [
{
"datasetName": "name",
"matchingKeyFields": [
{
"name": "name",
"parents": [
"parent"
]
}
],
"matchingValueFields": [
{
"name": "name",
"parents": [
"parent"
]
}
]
}
],
"entities": [
"Hello, world!"
]
}
],
"apps": [
{
"name": "name",
"type": "type"
}
],
"connectors": [
"connectors"
],
"processors": [
"processors"
]
}
}
}
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"
},
"impact": {
"type": "object",
"properties": {
"topics": {
"type": "array",
"description": "The topics the policy applies to"
},
"connectionEntities": {
"type": "array",
"description": "Entities (topics/indexes) affected by this policy, group by connection"
},
"apps": {
"type": "array",
"description": "The applications the policy applies to"
},
"connectors": {
"type": "array",
"description": "The connectors the policy applies to"
},
"processors": {
"type": "array",
"description": "The Lenses SQL processors the policy applies to"
}
},
"description": "The entities impacted by this policy"
}
},
"description": "Policy versions"
}
}
}
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
404
Headers
Content-Type: application/json
Body
Not found
500
Headers
Content-Type: text/plain
Body
Failed to retrieve policy. Error [error message]
Delete policyDELETE/api/protection/policy/{policy_id}
Delete a Data Policy by ID
Example URI
- policy_id
number
(required) Example: 0The unique identifier for the policy
Headers
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
Policy [policy_id] deleted
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
404
Headers
Content-Type: application/json
Body
Not found
500
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 templatesGET/api/v1/alert/channel-templates
List alert channel templates with their applicable connections
Example URI
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
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 channelsGET/api/v1/alert/channels{?page,pageSize,templateName,channelName,sortField,sortOrder}
Lists alert channels ordered by their creation time (most recent first)
Example URI
- page
string
(optional) Example: 1The page number to be fetched, must be greater than zero. Defaults to 1.
- pageSize
string
(required) Example: 25The amount of items to return in a single page, must be greater than zero.
- templateName
string
(optional) Example: SlackFilter channels by template name.
- channelName
string
(optional) Example: kafka-prdFilter channels whith a name matching the supplied string (e.g.
kafka-prd
would matchkafka-prd-pagerduty
andkafka-prd-slack
).- sortField
string
(optional) Example: updatedAtThe field to sort channel results by. Defults to
createdAt
.Choices:
name
templateName
createdAt
updatedAt
- sortOrder
string
(optional) Example: descChoices:
asc
desc
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
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 channelPOST/api/v1/alert/channels
The JSON object representing the properties to set this channel with
Example URI
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"
]
}
200
Headers
Content-Type: application/json
Body
{
"id": "db2391fe-8a71-4bfe-8c42-046201c1cf23",
}
409
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#"
}
400
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 channelPUT/api/v1/alert/channels/{id}
The JSON object representing the properties to set this channel with
Example URI
- id
string
(required) Example: 1812c74a5731-4921-9da4-9dd586160ef0 (required) - The alert channel id
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"
]
}
204
404
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#"
}
409
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#"
}
400
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 channelPATCH/api/v1/alert/channels/{id}
The JSON object representing the properties to set this channel with
Example URI
- id
string
(required) Example: 1812c74a5731-4921-9da4-9dd586160ef0 (required) - The alert channel id
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"
}
}
}
204
404
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#"
}
409
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#"
}
400
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 channelDELETE/api/v1/alert/channels/{id}
Permanently delete an alert channel
Example URI
- id
string
(required) Example: 90cb04195d15-4960-9ea6-2ccb4d26ebb4 (required) - The alert channel id
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
204
404
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 settingsGET/api/v1/alert/settings
Example URI
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
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
}
]
}
}
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Update a fixed alert settingPUT/api/v1/alert/settings/{alert_setting_id}
Update a fixed alert setting.
Example URI
- alert_setting_id
string
(required) Example: 1000The Alert ID to update
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"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"enable": {
"type": "boolean"
},
"channels": {
"type": "array"
}
},
"required": [
"enable",
"channels"
]
}
200
Headers
Content-Type: application/json
Body
{
"message": "Ok"
}
404
Headers
Content-Type: application/json
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Patch a fixed alert settingPATCH/api/v1/alert/settings/{alert_setting_id}
Partial update of a fixed alert setting.
Example URI
- alert_setting_id
string
(required) Example: 1000The Alert ID to patch
A request payload specifying whether to enable/disable the alert or set the distinct list of channel ids to route this alert to.
Headers
Content-Type: application/json
Body
{
"enable": true,
"channels": [
"56fa0d2c-1f7c-4597-a61b-b52e1b43d81b"
]
}
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"enable": {
"type": "boolean"
},
"channels": {
"type": "array"
}
}
}
200
Headers
Content-Type: application/json
Body
{
"message": "Ok"
}
404
Headers
Content-Type: application/json
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Create an alert setting conditionPOST/api/v1/alert/settings/{alert_setting_id}/conditions
For conditional rules, create a new custom alert condition.
Example URI
- alert_setting_id
string
(required) Example: 2000The Alert ID to enable. ConsumerLag (
2000
) and DataProduced (5000
) support conditions.
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"
]
}
201
The newly created alert condition unique id
Headers
Content-Type: application/json
Body
{
"id": "1e385be7-8ca0-4c6d-935f-67c7d3761499"
}
Update an alert setting conditionPUT/api/v1/alert/settings/{alert_setting_id}/conditions/{condition_uuid}
For conditional rules, update an existing custom alert condition.
Example URI
- alert_setting_id
string
(required) Example: 2000The Alert ID to enable. ConsumerLag (
2000
) and DataProduced (5000
) support conditions.- condition_uuid
string
(required) Example: 50716b0ca171-48f7-a99f-dff915894f72 (required) - The condition unique identifier
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"
]
}
200
Body
"OK"
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
404
Headers
Content-Type: text/plain
Body
The condition cannot be found
Delete an alert setting conditionDELETE/api/v1/alert/settings/{alert_setting_id}/conditions/{condition_uuid})
Example URI
- alert_setting_id
string
(required) Example: 2000The Alert ID to enable. ConsumerLag (
2000
) and DataProduced (5000
) support conditions.- condition_uuid
string
(required) Example: 50716b0ca171-48f7-a99f-dff915894f72 (required) - The condition unique identifier
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: text/plain
Body
"OK"
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
404
Headers
Content-Type: text/plain
Body
The condition cannot be found
List alerts eventsGET/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
- page
number
(optional) Example: 1The page number to be returned, must be greater than zero. Defaults to 1.
- pageSize
number
(required) Example: 25The elements amount on a single page, must be greater than zero.
- summary
string
(optional) Example: active controllersAllows to filter results by partial summary text
- category
enum[string] - Allows to filter results by category
(optional) Example: InfrastructureAllows to filter results by category
Choices:
Infrastructure
Consumers
Kafka Connect
Topics
- level
string
(optional) Example: INFOAllows to filter results by level
Choices:
INFO
LOW
MEDIUM
HIGH
CRITICAL
- alertId
number
(optional) Example: 1000Allows to filter by alert setting ID
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
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"
]
}
400
Headers
Content-Type: text/plain
Body
Error Message
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Delete alert eventsDELETE/api/v1/alert/events{?timestamp}
Deletes alerts events with timestamps before the specified value
Example URI
- timestamp
number
(required) Example: 1562922585000Timestamp (milliseconds since the epoch), for which any alerts older than it should be deleted
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
400
Headers
Content-Type: text/plain
Body
Error Message
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Alert SSE APIGET/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
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
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"
}
}
}
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
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 endpointGET/metrics
Returns Prometheus formatted information for consumer lags and other kpis
-
Headers
X-Kafka-Lenses-Token: XXXXX
Example URI
200
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
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Audit ¶
List audit channel templatesGET/api/v1/audit/channel-templates
List audit channel templates with their applicable connections
Example URI
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
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 channelsGET/api/v1/audit/channels{?page,pageSize,templateName,channelName,sortField,sortOrder}
Lists audit channels ordered by their creation time (most recent first)
Example URI
- page
string
(optional) Example: 1The page number to be fetched, must be greater than zero. Defaults to 1.
- pageSize
string
(required) Example: 25The amount of items to return in a single page, must be greater than zero.
- templateName
string
(optional) Example: SlackFilter channels by template name.
- channelName
string
(required) Example: kafkaprd (optional) - Filter channels whith a name matching the supplied string (e.g.
kafka-prd
would matchkafka-prd-pagerduty
andkafka-prd-slack
).- sortField
string
(optional) Example: updatedAtThe field to sort channel results by. Defults to
createdAt
.Choices:
name
templateName
createdAt
updatedAt
- sortOrder
string
(optional) Example: descChoices:
asc
desc
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
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 channelPOST/api/v1/audit/channels
The JSON object representing the properties to set this channel with
Example URI
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"
]
}
200
Headers
Content-Type: application/json
Body
{
"id": "db2391fe-8a71-4bfe-8c42-046201c1cf23",
}
409
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#"
}
400
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 channelPUT/api/v1/audit/channels/{id}
The JSON object representing the properties to set this channel with
Example URI
- id
string
(required) Example: 1812c74a5731-4921-9da4-9dd586160ef0 (required) - The audit channel id
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"
]
}
204
404
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#"
}
409
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#"
}
400
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 channelPATCH/api/v1/audit/channels/{id}
The JSON object representing the properties to set this channel with
Example URI
- id
string
(required) Example: 1812c74a5731-4921-9da4-9dd586160ef0 (required) - The audit channel id
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"
}
}
}
204
404
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#"
}
409
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#"
}
400
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 channelDELETE/api/v1/audit/channels/{id}
Permanently delete an audit channel
Example URI
- id
string
(required) Example: 90cb04195d15-4960-9ea6-2ccb4d26ebb4 (required) - The audit channel id
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
204
404
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 entriesGET/api/audit{?pageSize,page,type,action,user,filter}
Returns audit entries divided into pages. Allows to specify page number and page size.
Example URI
- page
number
(optional) Example: 1The page number to be returned, must be greater than zero. Defaults to 1.
- pageSize
number
(required) Example: 25The elements amount on a single page, must be greater than zero.
- type
string
(optional) Example: TOPICAllows 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: ADDAllows to filter results by audit change
Choices:
ADD
REMOVE
UPDATE
INSERT
STARTED
STOPPED
SCALED
RESTARTED
PAUSED
VIEWED
LOGIN
LOGOUT
- user
string
(optional) Example: johnsmithAllows 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
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
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"
]
}
400
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"
}
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
List audit valuesGET/api/audit/values
Returns audit unique values of user id, audit type and change.
Example URI
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
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"
}
}
}
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Delete audit entriesDELETE/api/audit{?timestamp}
Deletes audits with timestamps before the specified value
Example URI
- timestamp
number
(required) Example: 1562922585000Timestamp (milliseconds since the epoch), for which any audits older than it should be deleted
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
400
Headers
Content-Type: text/plain
Body
Error Message
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Schemas ¶
Lenses APIs for managing schemas in a Confluent API compatible schema registries.
List schemas ¶
List schemasGET/api/proxy-sr/subjects
Get a list of all subjects
Example URI
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
[
"subject1",
"schema2"
]
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Version of a subject ¶
List subject versionsGET/api/proxy-sr/subjects/{subject}/versions
Example URI
- subject
string
(required)Name of the subject
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
[
"1",
"2"
]
Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "array"
}
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Register a new schema under a particular subjectPOST/api/proxy-sr/subjects/{subject}/versions
Example URI
- subject
string
(required)Name of the subject
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
"OK"
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Delete a subject and associated compatibility levelDELETE/api/proxy-sr/subjects/{subject}
Example URI
- subject
string
(required)Name of the subject
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
"OK"
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Get the schema for a particular subject idGET/api/proxy-sr/schemas/ids/{id}
Example URI
- id
number
(required)The ID of the subject
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
"OK"
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Subject at version ¶
Get the schema at a particular versionGET/api/proxy-sr/subjects/{subject}/versions/{versionId}
Example URI
- subject
string
(required)Name of the subject
- versionId
number
(required)The version of the subject to delete
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
"OK"
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Delete a particular version of a subjectDELETE/api/proxy-sr/subjects/{subject}/versions/{versionId}
Example URI
- subject
string
(required)Name of the subject
- versionId
number
(required)The version of the subject to delete
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
"OK"
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Compatibility Level ¶
-
Request (application/json)
-
Headers
X-Kafka-Lenses-Token: XXXXX
-
Update global compatibility levelPUT/api/proxy-sr/config
Example URI
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
"OK"
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Get global compatibility levelGET/api/proxy-sr/config
Example URI
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
"OK"
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Change compatibility level of a subjectPUT/{subject}
Example URI
- subject
string
(required)Name of the subject
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"
]
}
200
Headers
Content-Type: application/json
Body
"OK"
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Get compatibility level for a subjectGET/{subject}
Example URI
- subject
string
(required)Name of the subject
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
{
"compatibility": "FULL"
}
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
SQL Processors ¶
SQL Processors ¶
Lenses APIs for managing Lenses SQL Processors.
List all processorsGET/api/v1/streams/
Example URI
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
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"
}
}
}
}
}
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Get a processorGET/api/v1/streams/{processor_id}
Example URI
- processor_id
string
(required) Example: lsql_c7f177994db640cab95a99900c4fb7e7The processor id to look up
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
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"
]
}
}
}
}
}
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Create a processorPOST/api/v1/streams
Example URI
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#"
}
200
Headers
Content-Type: application/text
Body
`lsql_c7f177994db640cab95a99900c4fb7e7`
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
400
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 processorPUT/api/v1/streams/{processor_id}/scale/{runners}
Example URI
- processor_id
string
(required) Example: lsql_c7f177994db640cab95a99900c4fb7e7The processor_id to scale
- runners
number
(required) Example: 5The number of runners to scale to
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/text
Body
Processor [lsql_c7f177994db640cab95a99900c4fb7e7] scaled
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Pause a processorPUT/api/v1/streams/{processor_id}/stop
Example URI
- processor_id
string
(required) Example: lsql_c7f177994db640cab95a99900c4fb7e7The processor_id to pause
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/text
Body
Processor [lsql_c7f177994db640cab95a99900c4fb7e7] paused
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Resume a processorPUT/api/v1/streams/{processor_id}/resume
Example URI
- processor_id
string
(required) Example: lsql_c7f177994db640cab95a99900c4fb7e7The processor_id to resume
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/text
Body
Processor [lsql_c7f177994db640cab95a99900c4fb7e7] resumed
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Delete a processorDELETE/api/v1/streams/{processor_id}
Example URI
- processor_id
string
(required) Example: lsql_c7f177994db640cab95a99900c4fb7e7The processor_id to delete
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/text
Body
Processor [lsql_c7f177994db640cab95a99900c4fb7e7] deleted
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Processor TopologyGET/api/v1/streams/{processor_id}/graph
Example URI
- processor_id
string
(required) Example: lsql_c7f177994db640cab95a99900c4fb7e7The processor identifier
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
+ graph (Processor Graph)
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
Connections ¶
APIs for managing connections.
Connection Templates ¶
List all connection templatesGET/api/v1/connection/connection-templates
List all connection templates.
Example URI
Headers
X-Kafka-Lenses-Token: XXXXX
200
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#"
}
401
The client is not authenticated.
Headers
Content-Type: text/plain
403
The client is unauthorized to list connection templates.
Headers
Content-Type: text/plain
500
Failed to read. Internal server error.
Headers
Content-Type: text/plain
Connection ¶
Add ConnectionPOST/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
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#"
}
200
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."
}
}
}
400
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"
]
}
401
The client is not authenticated.
Headers
Content-Type: text/plain
Body
The client is not authenticated
403
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
500
Internal server error.
Headers
Content-Type: text/plain
Body
Error creating a connection. Internal server error
List all connectionsGET/api/v1/connection/connections
List all connection instances.
Example URI
Headers
X-Kafka-Lenses-Token: XXXXX
200
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#"
}
401
Headers
Content-Type: text/plain
Body
The client is not authenticated
403
Headers
Content-Type: text/plain
Body
The client is unauthorized to list connections.
500
Headers
Content-Type: text/plain
Body
Failed to read. Internal server error.
Update ConnectionPUT/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
- name
string
(required)Name of the connection to be updated.
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#"
}
200
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."
}
}
}
400
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"
]
}
401
The client is not authenticated.
Headers
Content-Type: text/plain
Body
The client is not authenticated
403
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
404
Connection with the provided name could not be found.
Headers
Content-Type: text/plain
Body
The requested connection could not be found
409
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"
]
}
500
Internal server error.
Headers
Content-Type: text/plain
Body
Error updating connection. Internal server error
Delete ConnectionDELETE/api/v1/connection/connections/{name}
Delete a Connection instance. Requires ManageConnections permission.
Example URI
- name
string
(required)Name of the connection (Lenses)
- removeFromSecretsProvider
boolean
(optional) Default: false Example: trueSpecifies whether the secret values assigned to the connection will be removed from the secret provider storing them.
Headers
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: text/plain
Body
Connection deleted
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
404
Headers
Content-Type: text/plain
Body
The requested connection could not be found
409
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"
]
}
500
Headers
Content-Type: text/plain
Body
Failed to delete the connection. Internal server error
Get connection detailsGET/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
- name
string
(required)Unique name assigned to the connection (Lenses)
Headers
X-Kafka-Lenses-Token: XXXXX
200
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"
]
}
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
Permission denied
404
Headers
Content-Type: text/plain
Body
The requested connection could not be found
500
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:
Groups ¶
List groupsGET/api/v1/group
Returns all the groups.
Example URI
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXXX
200
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
}
]
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "view" permission.
Get a groupGET/api/v1/group/{groupname}
Returns a group identified by the group name
Example URI
- groupname
string
(required)The unique identifier for the user group (required)
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
200
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
}
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "manage" permission.
404
Headers
Content-Type: text/plain
Body
The requested group does not exist
Create a groupPOST/api/v1/group
Creates a new group. The name must be unique.
Example URI
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",
"ViewUsers",
"ManageUsers",
"ViewAlertRules",
"ManageAlertRules",
"ViewKafkaSettings",
"ManageKafkaSettings"
],
"namespaces": [
{
"wildcards": [
"*"
],
"permissions": [
"CreateTopic",
"DropTopic",
"ConfigureTopic",
"QueryTopic",
"ShowTopic",
"ViewSchema",
"InsertData",
"DeleteData",
"UpdateTablestore"
],
"connection": "kafka"
}
],
"connectClustersPermissions": [
"kafka connect cluster name"
]
}
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
}
}
}
200
Headers
Content-Type: text/plain
Body
Group has been created.
400
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."
}
]
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "manage" permission.
Update a groupPUT/api/v1/group/{groupname}
Updates a group identified by the group name.
Example URI
- groupname
string
(required)The unique identifier for the user (required)
Headers
Content-Type: application/json
Body
{
"description": "only head of janitors",
"scopedPermissions": [
"ViewKafkaConsumers",
"ManageKafkaConsumers",
"ViewConnectors",
"ManageConnectors",
"ViewSQLProcessors",
"ManageSQLProcessors",
"ViewSchemaRegistry",
"ManageSchemaRegistry",
"ViewTopology",
"ManageTopology"
],
"adminPermissions": [
"ViewDataPolicies",
"ManageDataPolicies",
"ViewAuditLogs",
"ViewUsers",
"ManageUsers",
"ViewAlertRules",
"ManageAlertRules",
"ViewKafkaSettings",
"ManageKafkaSettings"
],
"namespaces": [
{
"wildcards": [
"*"
],
"permissions": [
"CreateTopic",
"DropTopic",
"ConfigureTopic",
"QueryTopic",
"ShowTopic",
"ViewSchema",
"InsertData",
"DeleteData",
"UpdateTablestore"
],
"connection": "kafka"
}
],
"connectClustersPermissions": [
"kafka connect cluster name"
]
}
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
}
}
}
200
Headers
Content-Type: text/plain
Body
Group has been update.
400
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."
}
]
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "manage" permission.
Delete a groupDELETE/api/v1/group/{groupname}
Deletes a group identified by the group name
Example URI
- groupname
string
(required)The unique identifier for the user group (required)
Headers
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: text/plain
Body
Group is deleted
400
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.
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "manage" permission.
Clone a groupPOST/api/v1/group/{group}/clone/{newname}
Copies a group with a new name.
Example URI
- 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)
Headers
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: text/plain
Body
Group is has been copied under the new name
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "manage" permission.
400
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 permissionsGET/api/v1/groups/connections
Returns a list with all available connections, as well as their corresponsing perimissions and datasets.
Example URI
Headers
X-Kafka-Lenses-Token: XXXXX
200
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",
]
}
]
401
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 accountsGET/api/v1/user
Returns all the user accounts in the security management layer.
Example URI
Headers
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
[
{
"username": "sam",
"email": "sam@landoop.com",
"groups": [
"foo",
"bar"
]
},
{
"username": "stef",
"groups": [
"boo"
],
"type": "BASIC"
}
]
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "view" permission.
Get a userGET/api/v1/user/{username}
Returns a user identified by the given username.
Example URI
- username
string
(required)The unique identifier for the user (required)
Headers
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
{
"username": "sam",
"email": "sam@landoop.com",
"groups": [
"foo",
"bar"
],
"type": "BASIC"
}
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "view" permission.
404
Headers
Content-Type: text/plain
Body
The requested user does not exist
Create a userPOST/api/v1/user/
Creates a new user, username (string) must be unique.
Example URI
Headers
X-Kafka-Lenses-Token: XXXXX
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
},
}
}
200
Headers
Content-Type: text/plain
Body
User has been created.
400
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"
}
]
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "manage" permission.
Update a userPUT/api/v1/user/{username}
Updates a user identified by the username.
Example URI
- username
string
(required)The unique identifier for the user (required)
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
}
}
}
200
Headers
Content-Type: text/plain
Body
User has been updated.
400
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"
}
]
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "manage" permission.
Update user passwordPUT/api/v1/user/{username}/password
Updates a users password, only if the user type is BASIC. For Kerberos this is not allowed
Example URI
- username
string
(required)The unique identifier for the user (required)
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
}
}
}
200
Headers
Content-Type: text/plain
Body
Password has been updated.
400
The provided entity is invalid. Examples include empty value or no value at all.
Headers
Content-Type: application/json
Body
"Invalid password"
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "manage" permission.
Delete a userDELETE/api/v1/user/{username}
Deletes a user identified by the username.
Example URI
- username
string
(required)The unique identifier for the user (required)
Headers
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: text/plain
Body
User is deleted
400
Headers
Content-Type: text/plain
Body
The requested user does not exist.
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "manage" permission.
Service Accounts ¶
List service accountsGET/api/v1/serviceaccount
Returns all the service accounts in the security management layer.
Example URI
Headers
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
[
{
"name": "pam",
"owner": "paul",
"groups": [
"foo"
]
},
{
"name": "sam",
"owner": null,
"groups": [
"bar"
]
},
{
"name": "tim",
"owner": null,
"groups": [
"foo"
]
}
]
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "view" permission.
Get a service accountGET/api/v1/serviceaccount/{name}
Returns a service account identified by the given account name.
Example URI
- name
string
(required)The unique identifier for the service account (required)
Headers
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
{
"name": "pam",
"owner": "paul",
"groups": [
"foo"
]
}
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "view" permission.
404
Headers
Content-Type: text/plain
Body
The requested service account does not exist
Create a service accountPOST/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
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
}
}
}
200
Headers
Content-Type: application/json
Body
{
"token": "4cbddcfd-a5ca-4d6e-acc5-4f5db3c9548f"
}
400
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"
}
]
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "manage" permission.
Update a service accountPUT/api/v1/serviceaccount/{name}
Updates a service account identified by the account name.
Example URI
- name
string
(required)The unique identifier for the service account (required)
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
}
}
}
200
Headers
Content-Type: text/plain
Body
Service account has been updated.
400
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"
}
]
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "manage" permission.
Delete a service accountDELETE/api/v1/serviceaccount/{name}
Deletes a service account identified by the name.
Example URI
- name
string
(required)The unique identifier for the service account (required)
Headers
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: text/plain
Body
Service account is deleted
400
Headers
Content-Type: text/plain
Body
The requested service account does not exist.
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "manage" permission.
Revoke a service account tokenPUT/api/v1/serviceaccount/{name}/revoke
Revokes the current service account token. A new token is assigned to the service account.
Example URI
- name
string
(required)The unique identifier for the service account (required)
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
}
}
}
200
Headers
Content-Type: application/json
Body
{
"token": "4cbddcfd-a5ca-4d6e-acc5-4f5db3c9548f"
}
400
Headers
Content-Type: text/plain
Body
The requested service account does not exist.
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
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 permissionsGET/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
Headers
X-Kafka-Lenses-Token: XXXXX
200
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"
},
{
"type": "UpdateTablestore",
"name": "Update Tablestore",
"system": "Kafka"
}
]
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
The client does not have the UserManagement "view" permission.
List namespace permissionsGET/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
- 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)
Headers
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: application/json
Body
{
"permissions": [
"ShowTopic",
"CreateTopic",
"DropTopic",
"ConfigureTopic",
"QueryTopic",
"InsertData",
"DeleteData",
"UpdateSchema",
"ViewSchema"
]
}
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
List scoped permissionsGET/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
Headers
X-Kafka-Lenses-Token: XXXXX
200
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"
}
]
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
List admin permissionsGET/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
Headers
X-Kafka-Lenses-Token: XXXXX
200
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"
}
]
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
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 groupPUT/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
- groupId
string
(required) Example: MyGroupThe consumer group ID
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"
]
}
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"
]
}
- 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"
]
}
200
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
The client does not have the necessary permissions.
Update a single offset of a consumer groupPUT/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
- groupId
string
(required) Example: MyGroupThe consumer group ID
- topicName
string
(required) Example: MyTopicThe topic name
- partitionId
number
(required) Example: 1The partition ID
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"
]
}
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"
]
}
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"
]
}
200
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
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 AppsPOST/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
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#"
}
200
The app has been successfully added.
Headers
Content-Type: application/json
Body
OK
401
The client is not authenticated.
Headers
Content-Type: text/plain
Body
The client is not authenticated
403
The client is not authorized
Headers
Content-Type: text/plain
Body
The supplied authentication is not authorized to access this resource
409
Conflict. External App already exists.
Headers
Content-Type: text/plain
Body
{ error: "The app with given name already exists, but with different data" }
500
Internal server error.
Headers
Content-Type: text/plain
Body
Internal Server Error. Description of the Problem
Remove External AppDELETE/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
- name
string
(required)The unique identifier for the app
Headers
X-Kafka-Lenses-Token: XXXXX
200
Headers
Content-Type: text/plain
Body
App is removed from lenses
400
Headers
Content-Type: text/plain
Body
The app with given name does not exist
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
The client is not authorized to register an app.
500
Internal server error.
Headers
Content-Type: text/plain
Body
Internal Server Error. Description of the Problem
Remove External App RunnersDELETE/api/v1/apps/external/{name}/runners
Remove External App Runners. This action will remove the runners from its App
Example URI
- name
string
(required)The unique identifier for the app
Headers
X-Kafka-Lenses-Token: XXXXX
Body
{
"runners": [
"192.123.342.12:8081",
"192.123.342.12:8080"
]
}
200
Headers
Content-Type: text/plain
Body
Runners is removed
400
Headers
Content-Type: text/plain
Body
The app/runner you are trying to remove does not exist
401
Headers
Content-Type: text/plain
Body
The request is unauthenticated
403
Headers
Content-Type: text/plain
Body
The client is not authorized to register an app.
500
Internal server error.
Headers
Content-Type: text/plain
Body
Internal Server Error. Description of the Problem
Apps Listing ¶
Get AppsGET/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:
- First send a DATA type message including the initial data
- Then send HEARTBEAT types of messages until we have an update apps listing
- 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
101
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 - MetricsGET/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:
- First send a DATA type message including the initial data
- Then send HEARTBEAT types of messages until we have an update apps listing
- 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
- type
string
(required)Type of the app (only
external
is handled at the moment)- name
string
(required)Name of the app
101
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 dataGET/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:
- First send a DATA type message including the initial data
- Then send HEARTBEAT types of messages until we have an update apps listing
- 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
- type
string
(required)Type of the app (only
external
is handled at the moment)- name
string
(required)Name of the app
101
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 DetailsGET/api/v1/license
Returns details of curently used license.
Example URI
200
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, galse 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"
]
}
401
The client is not authenticated.
Headers
Content-Type: text/plain
Body
The client is not authenticated
500
Internal server error.
Headers
Content-Type: text/plain
Body
Internal Server Error. Description of the Problem
Update LicensePUT/api/v1/license
Updates the Lenses license. The request body should contain the license content as received.
Example URI
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#"
}
200
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, galse 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"
]
}
401
The client is not authenticated.
Headers
Content-Type: text/plain
Body
The client is not authenticated
403
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
500
Internal server error.
Headers
Content-Type: text/plain
Body
Internal Server Error. Description of the Problem