Back to top

Lenses API (v3.0)

Authentication

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

Login

Login
POST/api/login

On successful login, it returns the security token each further HTTP request has to provide as an HTTP Header x-kafka-lenses-token:myToken in subsequent requests.

Example URI

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

Contains the full Lenses security token

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

User Details

User Details
GET/api/auth

Returns current user permission

Example URI

GET /api/auth
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "user": "johnsmith",
  "schemaRegistryDelete": false,
  "permissions": [
    "Hello, world!",
    "ManageKafkaSettings",
    "ViewKafkaSettings",
    "ManageKubernetes",
    "ViewKubernetes",
    "ViewLog",
    "ManageUsers",
    "ViewUsers",
    "ManageAlertRules",
    "ViewAlertRules",
    "ViewAuditLog",
    "ManageDataPolicies",
    "ViewDataPolicies",
    "ManageSQLProcessors",
    "ViewSQLProcessors",
    "ManageSchemas",
    "ViewSchemas",
    "ManageTopology",
    "ViewTopology",
    "ManageConnectors",
    "ViewConnectors",
    "ManageCustomApp",
    "ViewCustomApp",
    "ManageKafkaConsumers",
    "ViewKafkaConsumers"
  ],
  "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 non scoped permissions linked to this user"
    },
    "security": {
      "type": "object",
      "properties": {
        "ldap": {
          "type": "boolean",
          "description": "If true LDAP is enabled, false otherwise"
        },
        "kerberos": {
          "type": "boolean",
          "description": "If true Kerberos is enabled, false otherwise"
        },
        "http": {
          "type": "boolean",
          "description": "If true Custom HTTP is enabled, false otherwise"
        }
      },
      "required": [
        "ldap",
        "kerberos",
        "http"
      ],
      "description": "Provides details on the authentication modes"
    },
    "runtime": {
      "type": "object",
      "properties": {
        "adminDefaultPassword": {
          "type": "boolean",
          "description": "If true the full admin user has the default password; false otherwise"
        }
      },
      "required": [
        "adminDefaultPassword"
      ],
      "description": "Provides details on runtime"
    },
    "token": {
      "type": "string",
      "description": "Login token"
    }
  },
  "required": [
    "user",
    "schemaRegistryDelete",
    "permissions",
    "security",
    "runtime",
    "token"
  ]
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Logout

Logout
GET/api/logout

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

Example URI

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

List admin permission

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

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

Example URI

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

List supported security types

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

Returns all supported user types.

Example URI

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

Admin Kafka

Lenses APIs for managing Kafka.

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

ACL

APIs for managing Kafka Access Control Lists

List Kafka ACL
GET/api/acl

Example URI

GET /api/acl
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Body
{
  "resourceType": "Topic",
  "resourceName": "trades",
  "principal": "User:Alice",
  "permissionType": "Allow",
  "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"
    },
    "host": {
      "type": "string",
      "description": "The hosts to apply the ACL to"
    },
    "operation": {
      "enum": [
        "Read",
        "Write",
        "Describe",
        "Delete",
        "DescribeConfigs",
        "AlterConfigs",
        "IdempotentWrite",
        "ClusterAction"
      ],
      "description": "The operation type"
    }
  },
  "required": [
    "resourceType",
    "resourceName",
    "principal",
    "permissionType",
    "host",
    "operation"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "acls": [
    {
      "resourceType": "Topic",
      "resourceName": "trades",
      "principal": "User:Alice",
      "permissionType": "Allow",
      "host": "Hello, world!",
      "operation": "Read"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "acls": {
      "type": "array"
    }
  }
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Create or update an ACL
PUT/api/acl

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

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

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

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

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

  • DelegationToken : “Describe” | “All”

Example URI

PUT /api/acl
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Body
{
  "resourceType": "Topic",
  "resourceName": "trades",
  "principal": "User:Alice",
  "permissionType": "Allow",
  "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"
    },
    "host": {
      "type": "string",
      "description": "The hosts to apply the ACL to"
    },
    "operation": {
      "enum": [
        "Read",
        "Write",
        "Describe",
        "Delete",
        "DescribeConfigs",
        "AlterConfigs",
        "IdempotentWrite",
        "ClusterAction"
      ],
      "description": "The operation type"
    }
  },
  "required": [
    "resourceType",
    "resourceName",
    "principal",
    "permissionType",
    "host",
    "operation"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Delete ACLs
DELETE/api/acl

Example URI

DELETE /api/acl
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Body
{
  "resourceType": "Topic",
  "resourceName": "trades",
  "principal": "User:Alice",
  "permissionType": "Allow",
  "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"
    },
    "host": {
      "type": "string",
      "description": "The hosts to apply the ACL to"
    },
    "operation": {
      "enum": [
        "Read",
        "Write",
        "Describe",
        "Delete",
        "DescribeConfigs",
        "AlterConfigs",
        "IdempotentWrite",
        "ClusterAction"
      ],
      "description": "The operation type"
    }
  },
  "required": [
    "resourceType",
    "resourceName",
    "principal",
    "permissionType",
    "host",
    "operation"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/json
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Quotas

APIs for managing Kafka Quotas.

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

  1. /config/users//clients/

  2. /config/users//clients/

  3. /config/users/

  4. /config/users//clients/

  5. /config/users//clients/

  6. /config/users/

  7. /config/clients/

  8. /config/clients/

List Kafka Quotas
GET/api/quotas

Returns all the quotas setup in your cluster.

Example URI

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

Create for all users
PUT/api/quotas/users

Create a quota for all users and all clients

Example URI

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

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

Create a quota for a specific user

Example URI

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

The user to create the quota for

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

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

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

Example URI

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

The user to create the quota for

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

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

Create a quota for a specific client of a specific user

Example URI

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

The user to create the quota for

client
string (required) Example: client1

The client id to create the quota for

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

Delete for all users
DELETE/api/quotas

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

Example URI

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

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

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

Example URI

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

The user to create the quota for

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

Delete for all users
DELETE/api/quotas/users

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

Example URI

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

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

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

Example URI

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

The user to create the quota for

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

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

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

Example URI

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

The user to create the quota for

client
string (required) Example: client1

The client id to create the quota for

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

Create for all clients
PUT/api/quotas/clients

Create a quota for all clients

Example URI

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

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

Create a quota for a specific client

Example URI

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

The client id to create the quota for

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

Delete for all clients
DELETE/api/quotas/clients

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

Example URI

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

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

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

Example URI

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

The client id to create the quota for

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

Connectors

Lenses APIs to manage Kafka Connect connectors

Connectors

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

Example URI

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

The connect cluster alias name

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

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

Example URI

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

The connect cluster alias name

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

Running Connectors

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

Example URI

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

The connect cluster alias name

connectorName
string (required) 

The connector name to get information for

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

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

Example URI

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

The connect cluster alias name

connectorName
string (required) 

The unique connector name

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

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

Example URI

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

The connect cluster alias name

connectorName
string (required) 

The connector name to get information for

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

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

Example URI

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

The connect cluster alias name

connectorName
string (required) 

The connector name to set information to

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

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

Example URI

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

The connect cluster alias name

connectorName
string (required) 

The connector name to get status for

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

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

Example URI

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

The connect cluster alias name

connectorName
string (required) 

The connector name to pause

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

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

Example URI

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

The connect cluster alias name

connectorName
string (required) 

The connector name to resume

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

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

Example URI

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

The connect cluster alias name

connectorName
string (required) 

The connector name to restart

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

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

Example URI

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

The connect cluster alias name

connectorName
string (required) 

The connector name to get info for

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

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

Example URI

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

The connect cluster alias name

connectorName
string (required) 

The unique connector name

task_id
string (required) 

The task id to get status

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

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

Example URI

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

The connect cluster alias name

connectorName
string (required) 

The unique connector name

task_id
string (required) 

The task id to restart

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

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

Example URI

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

The connect cluster alias name

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

Data Access

Lenses APIs for SQL.

Query data via SQL

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

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

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

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

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

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

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

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

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

Example Response for a record (message type 1)

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

Example Response for stop (message type 2)

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

Example Response for an error (message type 3)

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

Example URI

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

Encoded URL Lenses SQL query

stats
number (required) Example: 4000

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

offsets
boolean (required) Example: false

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

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

Delete from Kafka

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

Delete Records from Topic/Partition up to a specified Offset

This works only for kafka versions 0.11+

Example URI

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

The topic name to delete from

partition
number (required) Example: 1

The partition to delete from

offset
number (required) Example: 1000

The offset to delete upto

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

Data Entities

APIs for managing data entities in:

  • Apache Kafka

Apache Kafka Topics

APIs for managing Apache Kafka topics

Create topic
POST/api/topics/

Create a new Kafka topic

Example URI

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

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

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

Example URI

GET /api/v1/kafka/topics
URI Parameters
HideShow
pageSize
number (required) Example: 25

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

page
number (optional) Example: 1

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

name
string (optional) 

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

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

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

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

Example URI

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

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

page
number (optional) Example: 1

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

name
string (optional) 

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

sortBy
string (optional) Example: partitions

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

sortingOrder
string (optional) Example: asc

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

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

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

Update topic configuration

Example URI

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

The topic to update/configure

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

Delete topic
DELETE/api/topics/{topicName}

Example URI

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

The topic to delete

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

Topic Meta Data

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

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

Retrieve all data catalog metadata.

Example URI

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

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

Example URI

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

The topic to get metadata

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

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

Example URI

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

The topic to set metadata

keyType
string (required) Example: STRING

The type for the key

valueType
string (required) Example: STRING

The type for the value

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

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

Example URI

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

The topic to delete metadata

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

Data Governance

Lenses APIs for data governance.

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

Data Policies

List obfuscation functions
GET/api/protection

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

Example URI

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

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

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

Example URI

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

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

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

Example URI

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

List all data policies
GET/api/protection/policy

Get all current Data Protection policies - with relevant stats

Example URI

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

Create new policy
POST/api/protection

Create a new Data Protection Policy that gets activated immediately.

Example URI

POST /api/protection
Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Body
{
  "id": "id",
  "name": "name",
  "category": "category",
  "impactType": "HIGH",
  "obfuscation": "Email",
  "fields": [
    "fields"
  ]
}
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"
    }
  },
  "required": [
    "name",
    "category",
    "impactType",
    "obfuscation",
    "fields"
  ]
}
Response  201
HideShow
Headers
Content-Type: application/json
Body
Policy created
Response  400
HideShow
Headers
Content-Type: application/json
Body
Failed to create policy. Error [error message]
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied
Response  500
HideShow
Headers
Content-Type: text/plain
Body
Failed to create policy. Error [error message]

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

Update a Data Policy by ID

Example URI

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

The unique identifier for the policy

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Body
{
  "id": "id",
  "name": "name",
  "category": "category",
  "impactType": "HIGH",
  "obfuscation": [
    "Email",
    "Initials",
    "First"
  ],
  "fields": [
    "fields"
  ]
}
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"
    }
  },
  "required": [
    "name",
    "category",
    "impactType",
    "fields"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
Policy updated
Response  400
HideShow
Headers
Content-Type: application/json
Body
Failed to update policy. Error [error message]
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied
Response  404
HideShow
Headers
Content-Type: application/json
Body
Not found
Response  500
HideShow
Headers
Content-Type: text/plain
Body
Failed to update policy. Error [error message]

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

Example URI

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

The unique identifier for the policy

Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "array": {
    "id": "0",
    "name": "name",
    "category": "category",
    "impact": "HIGH",
    "obfuscation": "Email",
    "fields": [
      "The fields to protect"
    ],
    "lastUpdated": "2018-12-01 16:00:01",
    "lastUpdatedUser": "admin"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "array": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Policy version. All versions share this"
        },
        "name": {
          "type": "string",
          "description": "The name for the entry"
        },
        "category": {
          "type": "string",
          "description": "A grouping offered for the policy entries"
        },
        "impact": {
          "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"
        },
        "lastUpdated": {
          "type": "string",
          "description": "ISO8601 date timestamp the policy is effective from"
        },
        "lastUpdatedUser": {
          "type": "string",
          "description": "The user who created/changed the entry"
        }
      },
      "description": "Policy versions"
    }
  }
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied
Response  404
HideShow
Headers
Content-Type: application/json
Body
Not found
Response  500
HideShow
Headers
Content-Type: text/plain
Body
Failed to retrieve policy. Error [error message]

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

Delete a Data Policy by ID

Example URI

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

The unique identifier for the policy

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

Monitoring

Lenses Monitoring APIs

Alerts

List alert settings
GET/api/alerts/settings

Example URI

GET /api/alerts/settings
Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: text/plain
Body
[
  {
    "conditions": [
      {
        "28bbad2b-69bb-4c01-8e37-28e2e7083aa9": "Hello, world!"
      }
    ],
    "conditionRegex": "lag >= ([1-9][0-9]*) on group (\\b\\S+\\b) and topic (\\b\\S+\\b)",
    "description": "Consumer Lag exceeded",
    "enabled": true,
    "docs": "Raises an alert when the consumer lag exceeds the threshold",
    "id": 1000,
    "category": [
      "is the category of the alert",
      "either Infrastructure or Consumers"
    ],
    "isAvailable": true,
    "conditionTemplate": "lag >= $Threshold"
  }
]
Schema
{
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "conditions": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "28bbad2b-69bb-4c01-8e37-28e2e7083aa9": {
              "type": "string",
              "description": "lag >= 100000 on group group and topic topicA"
            }
          }
        },
        "description": "The condition to be met for the alert to be fired,"
      },
      "conditionRegex": {
        "type": "string",
        "description": "The regular expression to validate the condition set based on the conditionTemplate."
      },
      "description": {
        "type": "string",
        "description": "The description of the alert"
      },
      "enabled": {
        "type": "boolean",
        "description": "Flag to indicate if this alert is enabled"
      },
      "docs": {
        "type": "string",
        "description": "Documentaion link"
      },
      "id": {
        "type": "number",
        "description": "Alert id"
      },
      "category": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "isAvailable": {
        "type": "boolean",
        "description": "Indicates whether or not the alert is available, because some alerts need JMX enabled (If JMX not available, some alerts are disabled)"
      },
      "conditionTemplate": {
        "type": "string",
        "description": "Number on group $Consumer-Group and topic $Topic-Name (string) - String template for the condition"
      }
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Get an alert setting
GET/api/alerts/settings/{alert_setting_id}

Retrieve a specific alert setting.

Example URI

GET /api/alerts/settings/1
URI Parameters
HideShow
alert_setting_id
number (required) Example: 1

The Alert ID to enable

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: text/plain
Body
{
  "conditions": [
    {
      "28bbad2b-69bb-4c01-8e37-28e2e7083aa9": "Hello, world!"
    }
  ],
  "conditionRegex": "lag >= ([1-9][0-9]*) on group (\\b\\S+\\b) and topic (\\b\\S+\\b)",
  "description": "Consumer Lag exceeded",
  "enabled": true,
  "docs": "Raises an alert when the consumer lag exceeds the threshold",
  "id": 1000,
  "category": [
    "is the category of the alert",
    "either Infrastructure or Consumers"
  ],
  "isAvailable": true,
  "conditionTemplate": "lag >= $Threshold"
}
Schema
{
  "type": "object",
  "properties": {
    "conditions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "28bbad2b-69bb-4c01-8e37-28e2e7083aa9": {
            "type": "string",
            "description": "lag >= 100000 on group group and topic topicA"
          }
        }
      },
      "description": "The condition to be met for the alert to be fired,"
    },
    "conditionRegex": {
      "type": "string",
      "description": "The regular expression to validate the condition set based on the conditionTemplate."
    },
    "description": {
      "type": "string",
      "description": "The description of the alert"
    },
    "enabled": {
      "type": "boolean",
      "description": "Flag to indicate if this alert is enabled"
    },
    "docs": {
      "type": "string",
      "description": "Documentaion link"
    },
    "id": {
      "type": "number",
      "description": "Alert id"
    },
    "category": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "isAvailable": {
      "type": "boolean",
      "description": "Indicates whether or not the alert is available, because some alerts need JMX enabled (If JMX not available, some alerts are disabled)"
    },
    "conditionTemplate": {
      "type": "string",
      "description": "Number on group $Consumer-Group and topic $Topic-Name (string) - String template for the condition"
    }
  },
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

List alerts notifications
GET/api/alerts{?page,pageSize,summary,category,level}

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

Example URI

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

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

pageSize
number (required) Example: 25

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

summary
string (optional) Example: active controllers

Allows to filter results by partial summary text

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

Allows to filter results by category

Choices: Infrastructure Consumers Kafka Connect Topics

level
string (optional) Example: INFO

Allows to filter results by level

Choices: INFO LOW MEDIUM HIGH CRITICAL

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

Delete alerts
DELETE/api/alerts{?timestamp}

Deletes alerts with timestamps before the specified value

Example URI

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

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

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

Enable an alert setting
PUT/api/alerts/settings/{alert_setting_id}

Example URI

PUT /api/alerts/settings/1
URI Parameters
HideShow
alert_setting_id
number (required) Example: 1

The Alert ID to enable

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

Create or update an alert setting
POST/api/alerts/settings/{alert_setting_id}/condition/{condition_uuid}

Example URI

POST /api/alerts/settings/1/condition/1
URI Parameters
HideShow
alert_setting_id
number (required) Example: 1

The Alert ID to enable

condition_uuid
number (required) Example: 1

The UUID of the Alert

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

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

Example URI

DELETE /api/alerts/settings/1/condition/1)
URI Parameters
HideShow
alert_setting_id
number (required) Example: 1

The Alert ID to enable

condition_uuid
number (required) Example: 1

The UUID of the Alert

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

Alert SSE API
GET/api/sse/alerts

The client should be configured to expect Server Side Events

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

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

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

Example URI

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

Get integrations
GET/api/alerts/integrations

Returns alerts integration information.

Example URI

GET /api/alerts/integrations
Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "name": "Slack",
    "description": "Forwards alerts to a configured slack channel",
    "configuration": {}
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array"
}
Response  400
HideShow
Headers
Content-Type: text/plain
Body
Error Message
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Prometheus

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

Prometheus endpoint
GET/metrics

Returns Prometheus formatted information for consumer lags and other kpis

  • Headers

    X-Kafka-Lenses-Token: XXXXX

Example URI

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

Audit

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

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

Example URI

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

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

pageSize
number (required) Example: 25

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

type
string (optional) Example: TOPIC

Allows to filter results by resource type affected

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

action
string (optional) Example: ADD

Allows to filter results by audit change

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

user
string (optional) Example: johnsmith

Allows to filter results by user who triggered audit entry

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

Invalid request body.

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

List audit values
GET/api/audit/values

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

Example URI

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

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

Deletes audits with timestamps before the specified value

Example URI

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

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

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

Schemas

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

List schemas

List schemas
GET/api/proxy-sr/subjects

Get a list of all subjects

Example URI

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

Version of a subject

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

Example URI

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

Name of the subject

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

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

Example URI

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

Name of the subject

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

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

Example URI

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

Name of the subject

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

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

Example URI

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

The ID of the subject

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

Subject at version

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

Example URI

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

Name of the subject

versionId
number (required) 

The version of the subject to delete

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

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

Example URI

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

Name of the subject

versionId
number (required) 

The version of the subject to delete

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

Compatibility Level

  • Request (application/json)

    • Headers

      X-Kafka-Lenses-Token: XXXXX

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

Example URI

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

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

Example URI

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

Change compatibility level of a subject
PUT/{subject}

Example URI

PUT /subject
URI Parameters
HideShow
subject
string (required) 

Name of the subject

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

Get compatibility level for a subject
GET/{subject}

Example URI

GET /subject
URI Parameters
HideShow
subject
string (required) 

Name of the subject

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

SQL Processors

SQL Processors

Lenses APIs for managing Lenses SQL Processors.

List all processors
GET/api/streams/

Example URI

GET /api/streams/
Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "processors": {
    "targets": {
      "cluster": "aks",
      "namespaces": [
        "default"
      ]
    },
    "streams": {
      "id": "lsql_c7f177994db640cab95a99900c4fb7e7",
      "name": "cc_payments_freq_1min",
      "clusterName": "aks",
      "user": "admin",
      "uptime": 3387090,
      "sql": "INSERT INTO",
      "runners": 1,
      "deploymentState": "RUNNING",
      "topicValueDecoder": "STRING",
      "topicKeyDecoder": "LONG",
      "pipeline": "lenses",
      "startTs": 1522180383208,
      "toTopics": [
        "cc_payments_1m_freq"
      ],
      "runnerState": {
        "e94433cf-cf99-4e46-9adc-407bb06b35c2": {
          "id": "e94433cf-cf99-4e46-9adc-407bb06b35c2",
          "worker": "e94433cf-cf99-4e46-9adc-407bb06b35c2",
          "state": "RUNNING",
          "errorMsg": "Hello, world!"
        }
      },
      "lastAction": "Scaled to 3",
      "topology": [
        {
          "keyType": "LONG",
          "name": "cc_payments_freq_1min",
          "description": "cc_payments_freq_1min",
          "parents": [
            "Hello, world!"
          ],
          "valueType": "STRING",
          "descendants": [
            "Hello, world!"
          ],
          "isTable": false,
          "type": "TOPIC"
        }
      ]
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "processors": {
      "type": "object",
      "properties": {
        "targets": {
          "type": "object",
          "properties": {
            "cluster": {
              "type": "string",
              "description": "Available Kubernetes or Kafka Connect cluster to deploy to"
            },
            "namespaces": {
              "type": "array",
              "description": "Available Kubernetes namespaces if in Kubernetes mode"
            }
          },
          "required": [
            "cluster"
          ],
          "description": "Available Kubernetes clusters and namespaces in the clusters"
        },
        "streams": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "description": "Processor id"
            },
            "name": {
              "type": "string",
              "description": "Name of the procesor"
            },
            "clusterName": {
              "type": "string",
              "description": "Name of the Kubernetes or Kafka Connect cluster the procesor is deployed to (kubeconfig context name)"
            },
            "user": {
              "type": "string",
              "description": "Name of the user that deploy the procesor"
            },
            "uptime": {
              "type": "number",
              "description": "Time the procesor has been running in milliseconds"
            },
            "sql": {
              "type": "string",
              "description": "Lenses SQL statement"
            },
            "runners": {
              "type": "number",
              "description": "Number of runners deployed"
            },
            "deploymentState": {
              "type": "string",
              "enum": [
                "RUNNING",
                "FAILED",
                "STOPPED",
                "UNKNOWN"
              ],
              "description": "State of the deployment"
            },
            "topicValueDecoder": {
              "type": "string",
              "description": "The type of decoder used for the value of the messages"
            },
            "topicKeyDecoder": {
              "type": "string",
              "description": "The type of decoder used for the key of the messages"
            },
            "pipeline": {
              "type": "string",
              "description": "Tag added to the Kubernetes deployment"
            },
            "startTs": {
              "type": "number",
              "description": "Start time in milliseconds"
            },
            "toTopics": {
              "type": "array",
              "description": "The target topic to insert into"
            },
            "runnerState": {
              "type": "object",
              "properties": {
                "e94433cf-cf99-4e46-9adc-407bb06b35c2": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Runner id"
                    },
                    "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"
                  ],
                  "description": "Map of runner Runner Id to Runner State"
                }
              },
              "description": "State of the runner, map of runner id to state"
            },
            "lastAction": {
              "type": "string",
              "description": "Last action performed on the processor"
            },
            "topology": {
              "type": "array",
              "description": "The topology of the processor"
            }
          },
          "required": [
            "id",
            "name",
            "clusterName",
            "user",
            "uptime",
            "sql",
            "runners",
            "deploymentState",
            "topicValueDecoder",
            "topicKeyDecoder",
            "pipeline",
            "startTs",
            "toTopics",
            "lastAction"
          ],
          "description": "The registered SQL Processors"
        }
      }
    }
  }
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

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

Example URI

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

The processor id to look up

Request
HideShow
Headers
Content-Type: application/json
X-Kafka-Lenses-Token: XXXXX
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "processor": {
    "id": "lsql_c7f177994db640cab95a99900c4fb7e7",
    "name": "cc_payments_freq_1min",
    "clusterName": "aks",
    "user": "admin",
    "uptime": 3387090,
    "sql": "INSERT INTO",
    "runners": 1,
    "deploymentState": "RUNNING",
    "topicValueDecoder": "STRING",
    "topicKeyDecoder": "LONG",
    "pipeline": "lenses",
    "startTs": 1522180383208,
    "toTopics": [
      "cc_payments_1m_freq"
    ],
    "runnerState": {
      "e94433cf-cf99-4e46-9adc-407bb06b35c2": {
        "id": "e94433cf-cf99-4e46-9adc-407bb06b35c2",
        "worker": "e94433cf-cf99-4e46-9adc-407bb06b35c2",
        "state": "RUNNING",
        "errorMsg": "Hello, world!"
      }
    },
    "lastAction": "Scaled to 3",
    "topology": [
      {
        "keyType": "LONG",
        "name": "cc_payments_freq_1min",
        "description": "cc_payments_freq_1min",
        "parents": [
          "Hello, world!"
        ],
        "valueType": "STRING",
        "descendants": [
          "Hello, world!"
        ],
        "isTable": false,
        "type": "TOPIC"
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "processor": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Processor id"
        },
        "name": {
          "type": "string",
          "description": "Name of the procesor"
        },
        "clusterName": {
          "type": "string",
          "description": "Name of the Kubernetes or Kafka Connect cluster the procesor is deployed to (kubeconfig context name)"
        },
        "user": {
          "type": "string",
          "description": "Name of the user that deploy the procesor"
        },
        "uptime": {
          "type": "number",
          "description": "Time the procesor has been running in milliseconds"
        },
        "sql": {
          "type": "string",
          "description": "Lenses SQL statement"
        },
        "runners": {
          "type": "number",
          "description": "Number of runners deployed"
        },
        "deploymentState": {
          "type": "string",
          "enum": [
            "RUNNING",
            "FAILED",
            "STOPPED",
            "UNKNOWN"
          ],
          "description": "State of the deployment"
        },
        "topicValueDecoder": {
          "type": "string",
          "description": "The type of decoder used for the value of the messages"
        },
        "topicKeyDecoder": {
          "type": "string",
          "description": "The type of decoder used for the key of the messages"
        },
        "pipeline": {
          "type": "string",
          "description": "Tag added to the Kubernetes deployment"
        },
        "startTs": {
          "type": "number",
          "description": "Start time in milliseconds"
        },
        "toTopics": {
          "type": "array",
          "description": "The target topic to insert into"
        },
        "runnerState": {
          "type": "object",
          "properties": {
            "e94433cf-cf99-4e46-9adc-407bb06b35c2": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Runner id"
                },
                "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"
              ],
              "description": "Map of runner Runner Id to Runner State"
            }
          },
          "description": "State of the runner, map of runner id to state"
        },
        "lastAction": {
          "type": "string",
          "description": "Last action performed on the processor"
        },
        "topology": {
          "type": "array",
          "description": "The topology of the processor"
        }
      },
      "required": [
        "id",
        "name",
        "clusterName",
        "user",
        "uptime",
        "sql",
        "runners",
        "deploymentState",
        "topicValueDecoder",
        "topicKeyDecoder",
        "pipeline",
        "startTs",
        "toTopics",
        "lastAction"
      ]
    }
  }
}
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

Create a processor
POST/api/streams/

Example URI

POST /api/streams/
Request
HideShow
Headers
X-Kafka-Lenses-Token: XXXXX
Body
{
  "name": "myProcessor",
  "sql": "SET autocreate=true;INSERT INTO topicB SELECT * FROM topicA",
  "runners": 1,
  "clusterName": "aks",
  "namespace": "lenses"
}
Schema
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Name of the processor"
    },
    "sql": {
      "type": "string",
      "description": "The SQL to runner"
    },
    "runners": {
      "type": "number",
      "description": "The number of runners (instances) to runner"
    },
    "clusterName": {
      "type": "string",
      "description": "The cluster to deploy to"
    },
    "namespace": {
      "type": "string",
      "description": "The Kubernetes namespace to deploy if in Kubernetes mode"
    }
  },
  "required": [
    "name",
    "sql",
    "runners",
    "clusterName"
  ],
  "$schema": "http://json-schema.org/draft-04/schema#"
}
Response  200
HideShow
Headers
Content-Type: application/text
Body
`lsql_c7f177994db640cab95a99900c4fb7e7`
Response  401
HideShow
Headers
Content-Type: text/plain
Body
The request is unauthenticated
Response  403
HideShow
Headers
Content-Type: text/plain
Body
Permission denied

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

Example URI

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

The processor_id to scale

runners
number (required) Example: 5

The number of runners to scale to

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

Pause a processor
PUT/api/streams/{processor_id}/pause

Example URI

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

The processor_id to pause

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

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

Example URI

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

The processor_id to resume

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

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

Example URI

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

The processor_id to delete

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

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:

TODO https://www.dynatrace.com/support/help/how-to-use-dynatrace/data-privacy-and-security/configuration/manage-groups-and-permissions/

Groups

List groups
GET/api/v1/group

Returns all the groups.

Example URI

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

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

Returns a group identified by the group name

Example URI

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

The unique identifier for the user group (required)

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

Create a group
POST/api/v1/group/

Creates a new group. The name must be unique.

Example URI

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

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

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

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

Updates a group identified by the group name.

Example URI

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

The unique identifier for the user (required)

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "description": "only head of janitors",
  "scopedPermissions": [
    "ViewKafkaConsumers",
    "ManageKafkaConsumers",
    "ViewConnectors",
    "ManageConnectors",
    "ViewSQLProcessors",
    "ManageSQLProcessors",
    "ViewSchemas",
    "ManageSchemas",
    "ViewTopology",
    "ManageTopology"
  ],
  "adminPermissions": [
    "ViewDataPolicies",
    "ManageDataPolicies",
    "ViewAuditLogs",
    "ViewUsers",
    "ManageUsers",
    "ViewAlertRules",
    "ManageAlertRules",
    "ViewKafkaSettings",
    "ManageKafkaSettings"
  ],
  "namespaces": [
    {
      "wildcards": [
        "*"
      ],
      "permissions": [
        "CreateTopic",
        "DropTopic",
        "ConfigureTopic",
        "QueryTopic",
        "ShowTopic",
        "ViewTopicMetadata",
        "InsertData",
        "DeleteData",
        "UpdateTablestore"
      ],
      "system": "Kafka",
      "instance": "Dev"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "description": {
      "type": "string",
      "required": false
    },
    "adminPermissions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "required": false
    },
    "scopedPermissions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "required": true
    },
    "namespaces": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "instance": {
            "type": "string",
            "required": true
          },
          "system": {
            "type": "string",
            "required": true
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "required": false
          },
          "wildcards": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "required": false
          }
        }
      },
      "required": true
    }
  }
}
Response  200
HideShow
Headers
Content-Type: text/plain
Body
Group has been update.
Response  400
HideShow

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

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

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

Deletes a group identified by the group name

Example URI

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

The unique identifier for the user group (required)

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

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

Copies a group with a new name.

Example URI

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

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

newname
string (required) 

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

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

User Accounts

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

List user accounts
GET/api/v1/user

Returns all the user accounts in the security management layer.

Example URI

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

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

Returns a user identified by the given username.

Example URI

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

The unique identifier for the user (required)

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

Create a user
POST/api/v1/user/

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

Example URI

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

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

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

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

Updates a user identified by the username.

Example URI

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

The unique identifier for the user (required)

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

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

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

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

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

Example URI

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

The unique identifier for the user (required)

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

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

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

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

Deletes a user identified by the username.

Example URI

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

The unique identifier for the user (required)

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

Service Accounts

List service accounts
GET/api/v1/serviceaccount

Returns all the service accounts in the security management layer.

Example URI

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

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

Returns a service account identified by the given account name.

Example URI

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

The unique identifier for the service account (required)

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

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

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

Example URI

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

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

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

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

Updates a service account identified by the account name.

Example URI

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

The unique identifier for the service account (required)

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

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

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

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

Deletes a service account identified by the name.

Example URI

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

The unique identifier for the service account (required)

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

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

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

Example URI

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

The unique identifier for the service account (required)

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

Permissions

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

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

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

Example URI

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

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

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

Example URI

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

Generated by aglio on 19 Sep 2019