Skip to content

Latest commit

 

History

History
222 lines (170 loc) · 10 KB

File metadata and controls

222 lines (170 loc) · 10 KB

kafka-management-sdk

Kafka Management API

  • API version: 1.16.0

Kafka Management API is a REST API to manage Kafka instances

Automatically generated by the OpenAPI Generator

Requirements

Building the API client library requires:

  1. Java 1.8+
  2. Maven/Gradle

Installation

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.

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>com.redhat.cloud</groupId>
  <artifactId>kafka-management-sdk</artifactId>
  <version>1.16.0</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

  repositories {
    mavenCentral()     // Needed if the 'kafka-management-sdk' jar has been published to maven central.
    mavenLocal()       // Needed if the 'kafka-management-sdk' jar has been published to the local maven repo.
  }

  dependencies {
     implementation "com.redhat.cloud:kafka-management-sdk:1.16.0"
  }

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/kafka-management-sdk-1.16.0.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

import com.openshift.cloud.api.kas.invoker.*;
import com.openshift.cloud.api.kas.invoker.auth.*;
import com.openshift.cloud.api.kas.models.*;
import com.openshift.cloud.api.kas.DefaultApi;

public class DefaultApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://api.openshift.com");
        
        // Configure HTTP bearer authorization: Bearer
        HttpBearerAuth Bearer = (HttpBearerAuth) defaultClient.getAuthentication("Bearer");
        Bearer.setBearerToken("BEARER TOKEN");

        DefaultApi apiInstance = new DefaultApi(defaultClient);
        Boolean async = true; // Boolean | Perform the action in an asynchronous manner
        KafkaRequestPayload kafkaRequestPayload = new KafkaRequestPayload(); // KafkaRequestPayload | Kafka data
        try {
            KafkaRequest result = apiInstance.createKafka(async, kafkaRequestPayload);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#createKafka");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://api.openshift.com

Class Method HTTP request Description
DefaultApi createKafka POST /api/kafkas_mgmt/v1/kafkas
DefaultApi deleteKafkaById DELETE /api/kafkas_mgmt/v1/kafkas/{id}
DefaultApi federateMetrics GET /api/kafkas_mgmt/v1/kafkas/{id}/metrics/federate
DefaultApi getCloudProviderRegions GET /api/kafkas_mgmt/v1/cloud_providers/{id}/regions
DefaultApi getCloudProviders GET /api/kafkas_mgmt/v1/cloud_providers
DefaultApi getInstanceTypesByCloudProviderAndRegion GET /api/kafkas_mgmt/v1/instance_types/{cloud_provider}/{cloud_region}
DefaultApi getKafkaById GET /api/kafkas_mgmt/v1/kafkas/{id}
DefaultApi getKafkas GET /api/kafkas_mgmt/v1/kafkas
DefaultApi getMetricsByInstantQuery GET /api/kafkas_mgmt/v1/kafkas/{id}/metrics/query
DefaultApi getMetricsByRangeQuery GET /api/kafkas_mgmt/v1/kafkas/{id}/metrics/query_range
DefaultApi getVersionMetadata GET /api/kafkas_mgmt/v1
DefaultApi promoteKafka POST /api/kafkas_mgmt/v1/kafkas/{id}/promote
DefaultApi updateKafkaById PATCH /api/kafkas_mgmt/v1/kafkas/{id}
EnterpriseDataplaneClustersApi deleteEnterpriseClusterById DELETE /api/kafkas_mgmt/v1/clusters/{id}
EnterpriseDataplaneClustersApi getEnterpriseClusterAddonParameters GET /api/kafkas_mgmt/v1/clusters/{id}/addon_parameters
EnterpriseDataplaneClustersApi getEnterpriseClusterById GET /api/kafkas_mgmt/v1/clusters/{id}
EnterpriseDataplaneClustersApi getEnterpriseOsdClusters GET /api/kafkas_mgmt/v1/clusters
EnterpriseDataplaneClustersApi registerEnterpriseOsdCluster POST /api/kafkas_mgmt/v1/clusters
ErrorsApi getErrorById GET /api/kafkas_mgmt/v1/errors/{id}
ErrorsApi getErrors GET /api/kafkas_mgmt/v1/errors
SecurityApi createServiceAccount POST /api/kafkas_mgmt/v1/service_accounts
SecurityApi deleteServiceAccountById DELETE /api/kafkas_mgmt/v1/service_accounts/{id}
SecurityApi getServiceAccountById GET /api/kafkas_mgmt/v1/service_accounts/{id}
SecurityApi getServiceAccounts GET /api/kafkas_mgmt/v1/service_accounts
SecurityApi getSsoProviders GET /api/kafkas_mgmt/v1/sso_providers
SecurityApi resetServiceAccountCreds POST /api/kafkas_mgmt/v1/service_accounts/{id}/reset_credentials

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

Bearer

  • Type: HTTP basic authentication

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Author

[email protected]