Skip to content

Commit

Permalink
feat(client): add Java Client for Azkarra
Browse files Browse the repository at this point in the history
This commit adds a new module azkarra-client containing
a java client for Azkarra generated from openapi specification
  • Loading branch information
fhussonnois committed Feb 23, 2021
1 parent 21ffbc0 commit eed9aa9
Show file tree
Hide file tree
Showing 47 changed files with 1,751 additions and 327 deletions.
Expand Up @@ -76,7 +76,7 @@ public interface StreamsExecutionEnvironment<T extends StreamsExecutionEnvironme
* Sets whether this execution environment should be the default.
*
* @param isDefault {@code true} to set this environment as default.
*
*
* @return this {@link StreamsExecutionEnvironment} instance.
*/
T isDefault(final boolean isDefault);
Expand Down
Expand Up @@ -19,11 +19,12 @@
package io.streamthoughts.azkarra.api.streams.store;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.streamthoughts.azkarra.api.model.HasName;

import java.util.List;
import java.util.Objects;

public class LocalStorePartitionLags {
public class LocalStorePartitionLags implements HasName {

private final String name;

Expand All @@ -41,6 +42,10 @@ public LocalStorePartitionLags(final String name,
this.positions = Objects.requireNonNull(positions, "positions cannot be null");
}

/**
* {@inheritDoc}
*/
@Override
@JsonProperty
public String name() {
return name;
Expand Down
9 changes: 9 additions & 0 deletions azkarra-client/.openapi-generator-ignore
@@ -0,0 +1,9 @@
.gitignore
.travis.yml
*gradle*
*sbt*
**/gradle
git_push.sh
README.md
pom.xml
**/AndroidManifest.xml
83 changes: 83 additions & 0 deletions azkarra-client/api/api.yaml
@@ -0,0 +1,83 @@
openapi: 3.0.1
info:
title: Azkarra
version: ${project.version}
servers:
- url: /
paths:
/version:
get:
description: get the API current version
operationId: getCurrentVersion
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/Version'
description: version of Azkarra
tags:
- azkarra_version
x-accepts: application/json
x-contentType: application/json
/api/v1/streams:
$ref: "./paths/streams.getAllStreamsInstanceIds.yaml"
/api/v1/streams/{containerId}:
$ref: "./paths/streams.getStreamsInstanceDetails.yaml"
/api/v1/streams/{containerId}/stop:
$ref: "./paths/streams.postStreamsInstanceStop.yaml"
/api/v1/streams/{containerId}/restart:
$ref: "./paths/streams.postStreamsInstanceRestart.yaml"
/api/v1/streams/{containerId}/status:
$ref: "./paths/streams.getStreamsInstanceStatus.yaml"
/api/v1/streams/{containerId}/config:
$ref: "./paths/streams.getStreamsInstanceConfig.yaml"
/api/v1/streams/{containerId}/offsets:
$ref: "./paths/streams.getStreamsInstanceConsumerOffsets.yaml"
/api/v1/streams/{containerId}/topology:
$ref: "./paths/streams.getStreamsInstanceTopology.yaml"
/api/v1/streams/{containerId}/metadata:
$ref: "./paths/streams.getStreamsInstanceMetadata.yaml"
/api/v1/streams/{containerId}/store-offsets:
$ref: "./paths/streams.getStreamsInstanceStoreOffsets.yaml"
/api/v1/streams/{containerId}/metrics:
$ref: "./paths/streams.getStreamsInstanceMetrics.yaml"
/api/v1/streams/{containerId}/metrics/group/{group}:
$ref: "./paths/streams.getStreamsInstanceMetricsByGroup.yaml"
/api/v1/streams/{containerId}/metrics/group/{group}/name/{name}:
$ref: "./paths/streams.getStreamsInstanceMetricsByGroupAndName.yaml"
/api/v1/streams/{containerId}/metrics/group/{group}/name/{name}/value:
$ref: "./paths/streams.getStreamsInstanceMetricValue.yaml"
/api/v1/applications:
$ref: "./paths/applications.getAllKafkaStreamsApplicationIds.yaml"
/api/v1/applications/{applicationId}/stores/{storeName}:
$ref: "./paths/applications.postQueryStateStore.yaml"
components:
schemas:
Version:
properties:
azkarraVersion:
description: Version of Azkarra Framework
type: string
commitId:
description: Commit id of Azkarra Framework
type: string
branch:
description: Branch of Azkarra Framework
type: string
v1.TopicPartition:
properties:
topic:
description: The name of the topic
type: string
partition:
description: The partition of the topic
type: integer
required:
- topic
- partition
securitySchemes:
basicAuth:
scheme: basic
type: http

@@ -0,0 +1,22 @@
get:
description: list all ids for the Kafka Streams applications for which at least one instance
is currently running. application
operationId: listKafkaStreamsApplicationIds
responses:
"200":
content:
application/json:
schema:
items:
type: string
type: array
description: Array of Kafka Streams application ids
"401":
content: {}
description: Unauthorized
security:
- basicAuth: []
tags:
- azkarra_v1
x-accepts: application/json
x-contentType: application/json
44 changes: 44 additions & 0 deletions azkarra-client/api/paths/applications.postQueryStateStore.yaml
@@ -0,0 +1,44 @@
post:
description: Query a Kafka Streams state store, also known as executing an 'Interactive
Query'.
operationId: queryStateStore
parameters:
- description: identifier of the KafkaStreams application, also known as the
'application.id'
explode: false
in: path
name: applicationId
required: true
schema:
type: string
style: simple
- description: name of the state store to query
explode: false
in: path
name: storeName
required: true
schema:
type: string
style: simple
requestBody:
content:
application/json:
schema:
$ref: '../schemas/applications.query.v1.yaml#/v1.Query'
required: true
responses:
"200":
content:
application/json:
schema:
$ref: '../schemas/applications.query.v1.yaml#/v1.QueryResult'
description: OK
"401":
content: {}
description: Unauthorized
security:
- basicAuth: []
tags:
- azkarra_v1
x-accepts: application/json
x-contentType: application/json
22 changes: 22 additions & 0 deletions azkarra-client/api/paths/streams.getAllStreamsInstanceIds.yaml
@@ -0,0 +1,22 @@
get:
description: list the KafkaStreams instances currently active on the local Azkarra
application
operationId: listStreamsInstanceIds
responses:
"200":
content:
application/json:
schema:
items:
type: string
type: array
description: Array of Kafka Streams instance ids
"401":
content: {}
description: Unauthorized
security:
- basicAuth: []
tags:
- azkarra_v1
x-accepts: application/json
x-contentType: application/json
28 changes: 28 additions & 0 deletions azkarra-client/api/paths/streams.getStreamsInstanceConfig.yaml
@@ -0,0 +1,28 @@
get:
description: get the configuration of the KafkaStreams instance
operationId: getStreamsInstanceConfig
parameters:
- description: identifier of the KafkaStreams instance, also known as the 'containerId.id'
explode: false
in: path
name: containerId
required: true
schema:
type: string
style: simple
responses:
"200":
content:
application/json:
schema:
additionalProperties: true
type: object
description: OK
"401":
content: {}
description: Unauthorized
security:
- basicAuth: []
tags:
- azkarra_v1
x-accepts: application/json
@@ -0,0 +1,27 @@
get:
description: get the offset posititions for the consumers of the Kafka Streams instance
operationId: getStreamsInstanceConsumerOffsets
parameters:
- description: identifier of the KafkaStreams instance, also known as the 'container.id'
explode: false
in: path
name: containerId
required: true
schema:
type: string
style: simple
responses:
"200":
content:
application/json:
schema:
$ref: '../schemas/streams.offsets.v1.yaml#/v1.StreamsConsumerGroupOffsets'
description: OK
"401":
content: {}
description: Unauthorized
security:
- basicAuth: []
tags:
- azkarra_v1
x-accepts: application/json
28 changes: 28 additions & 0 deletions azkarra-client/api/paths/streams.getStreamsInstanceDetails.yaml
@@ -0,0 +1,28 @@
get:
description: get details about a Kafka Streams instance
operationId: getStreamsInstanceDetails
parameters:
- description: identifier of the KafkaStreams instance, also known as the 'container.id'
explode: false
in: path
name: containerId
required: true
schema:
type: string
style: simple
responses:
"200":
content:
application/json:
schema:
$ref: '../schemas/streams.details.v1.yaml#/v1.StreamsDetails'
description: OK
"401":
content: {}
description: Unauthorized
security:
- basicAuth: []
tags:
- azkarra_v1
x-accepts: application/json
x-contentType: application/json
29 changes: 29 additions & 0 deletions azkarra-client/api/paths/streams.getStreamsInstanceMetadata.yaml
@@ -0,0 +1,29 @@
get:
description: list the KafkaStreams instances currently active on the local Azkarra
application
operationId: getStreamsInstanceMetadata
parameters:
- description: identifier of the KafkaStreams instance, also known as the 'container.id'
explode: false
in: path
name: containerId
required: true
schema:
type: string
style: simple
responses:
"200":
content:
application/json:
schema:
$ref: '../schemas/streams.metadata.v1.yaml#/v1.StreamsMetadata'
description: OK
"401":
content: {}
description: Unauthorized
security:
- basicAuth: []
tags:
- azkarra_v1
x-accepts: application/json
x-contentType: application/json
@@ -0,0 +1,45 @@
get:
description: get the current metric value for the streams application, metric
group and name
operationId: getStreamsInstanceMetricValue
parameters:
- description: identifier of the KafkaStreams instance, also known as the 'container.id'
explode: false
in: path
name: containerId
required: true
schema:
type: string
style: simple
- description: name of the group
explode: false
in: path
name: group
required: true
schema:
type: string
style: simple
- description: name of the metric
explode: false
in: path
name: name
required: true
schema:
type: string
style: simple
responses:
"200":
content:
application/json:
schema:
type: string
description: OK
"401":
content: {}
description: Unauthorized
security:
- basicAuth: []
tags:
- azkarra_v1
x-accepts: application/json
x-contentType: application/json

0 comments on commit eed9aa9

Please sign in to comment.