Kafka Instance API
- API version: 0.14.1-SNAPSHOT
API for interacting with Kafka Instance. Includes Produce, Consume and Admin APIs
Automatically generated by the OpenAPI Generator
Building the API client library requires:
- Java 1.8+
- Maven/Gradle
To install the API client library to your local Maven repository, simply execute:
mvn clean install
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn clean deploy
Refer to the OSSRH Guide for more information.
Add this dependency to your project's POM:
<dependency>
<groupId>com.redhat.cloud</groupId>
<artifactId>kafka-instance-sdk</artifactId>
<version>0.14.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
Add this dependency to your project's build file:
repositories {
mavenCentral() // Needed if the 'kafka-instance-sdk' jar has been published to maven central.
mavenLocal() // Needed if the 'kafka-instance-sdk' jar has been published to the local maven repo.
}
dependencies {
implementation "com.redhat.cloud:kafka-instance-sdk:0.14.1-SNAPSHOT"
}
At first generate the JAR by executing:
mvn clean package
Then manually install the following JARs:
target/kafka-instance-sdk-0.14.1-SNAPSHOT.jar
target/lib/*.jar
Please follow the installation instruction and execute the following Java code:
import com.openshift.cloud.api.kas.auth.invoker.*;
import com.openshift.cloud.api.kas.auth.invoker.auth.*;
import com.openshift.cloud.api.kas.auth.models.*;
import com.openshift.cloud.api.kas.auth.AclsApi;
public class AclsApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("http://localhost");
// Configure HTTP bearer authorization: Bearer
HttpBearerAuth Bearer = (HttpBearerAuth) defaultClient.getAuthentication("Bearer");
Bearer.setBearerToken("BEARER TOKEN");
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
AclsApi apiInstance = new AclsApi(defaultClient);
AclBinding aclBinding = new AclBinding(); // AclBinding | ACL to create.
try {
apiInstance.createAcl(aclBinding);
} catch (ApiException e) {
System.err.println("Exception when calling AclsApi#createAcl");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
All URIs are relative to http://localhost
Class | Method | HTTP request | Description |
---|---|---|---|
AclsApi | createAcl | POST /api/v1/acls | Create ACL binding |
AclsApi | deleteAcls | DELETE /api/v1/acls | Delete ACL bindings |
AclsApi | getAclResourceOperations | GET /api/v1/acls/resource-operations | Retrieve allowed ACL resources and operations |
AclsApi | getAcls | GET /api/v1/acls | List ACL bindings |
ErrorsApi | getError | GET /api/v1/errors/{errorId} | Get an error by its unique ID |
ErrorsApi | getErrors | GET /api/v1/errors | Get list of errors |
GroupsApi | deleteConsumerGroupById | DELETE /api/v1/consumer-groups/{consumerGroupId} | Delete a consumer group. |
GroupsApi | getConsumerGroupById | GET /api/v1/consumer-groups/{consumerGroupId} | Get a single consumer group by its unique ID. |
GroupsApi | getConsumerGroups | GET /api/v1/consumer-groups | List of consumer groups in the Kafka instance. |
GroupsApi | resetConsumerGroupOffset | POST /api/v1/consumer-groups/{consumerGroupId}/reset-offset | Reset the offset for a consumer group. |
RecordsApi | consumeRecords | GET /api/v1/topics/{topicName}/records | Consume records from a topic |
RecordsApi | produceRecord | POST /api/v1/topics/{topicName}/records | Send a record to a topic |
TopicsApi | createTopic | POST /api/v1/topics | Creates a new topic |
TopicsApi | deleteTopic | DELETE /api/v1/topics/{topicName} | Deletes a topic |
TopicsApi | getTopic | GET /api/v1/topics/{topicName} | Retrieves a single topic |
TopicsApi | getTopics | GET /api/v1/topics | Retrieves a list of topics |
TopicsApi | updateTopic | PATCH /api/v1/topics/{topicName} | Updates a single topic |
- AclBinding
- AclBindingAllOf
- AclBindingListPage
- AclBindingListPageAllOf
- AclBindingOrderKey
- AclOperation
- AclOperationFilter
- AclPatternType
- AclPatternTypeFilter
- AclPermissionType
- AclPermissionTypeFilter
- AclResourceType
- AclResourceTypeFilter
- ConfigEntry
- Consumer
- ConsumerGroup
- ConsumerGroupAllOf
- ConsumerGroupDescriptionOrderKey
- ConsumerGroupList
- ConsumerGroupListAllOf
- ConsumerGroupMetrics
- ConsumerGroupOrderKey
- ConsumerGroupResetOffsetParameters
- ConsumerGroupResetOffsetResult
- ConsumerGroupResetOffsetResultAllOf
- ConsumerGroupResetOffsetResultItem
- ConsumerGroupState
- Error
- ErrorAllOf
- ErrorList
- ErrorListAllOf
- ListDeprecated
- ModelList
- NewTopicInput
- Node
- ObjectReference
- OffsetType
- Partition
- Record
- RecordAllOf
- RecordIncludedProperty
- RecordList
- RecordListAllOf
- SortDirection
- Topic
- TopicAllOf
- TopicOrderKey
- TopicSettings
- TopicsList
- TopicsListAllOf
- TopicsToResetOffset
Authentication schemes defined for the API:
- Type: HTTP basic authentication
- Type: OAuth
- Flow: application
- Authorization URL:
- Scopes: N/A
It's recommended to create an instance of ApiClient
per thread in a multithreaded environment to avoid any potential issues.