Skip to content

Latest commit

 

History

History
166 lines (114 loc) · 5.22 KB

File metadata and controls

166 lines (114 loc) · 5.22 KB

registry-management-sdk

Service Registry Management API

  • API version: 1.0.0

Service Registry Management API is a REST API for managing Service Registry instances. Service Registry is a datastore for event schemas and API designs, which is based on the open source Apicurio Registry project.

For more information, please visit https://console.redhat.com/application-services/service-registry/

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>registry-management-sdk</artifactId>
  <version>1.0.0</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

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

  dependencies {
     implementation "com.redhat.cloud:registry-management-sdk:1.0.0"
  }

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/registry-management-sdk-1.0.0.jar
  • target/lib/*.jar

Getting Started

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

import com.openshift.cloud.api.srs.invoker.*;
import com.openshift.cloud.api.srs.invoker.auth.*;
import com.openshift.cloud.api.srs.models.*;
import com.openshift.cloud.api.srs.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);
        try {
            ServiceStatus result = apiInstance.getServiceStatus();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#getServiceStatus");
            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 getServiceStatus GET /api/serviceregistry_mgmt/v1/status
ErrorsApi getError GET /api/serviceregistry_mgmt/v1/errors/{id}
ErrorsApi getErrors GET /api/serviceregistry_mgmt/v1/errors
RegistriesApi createRegistry POST /api/serviceregistry_mgmt/v1/registries
RegistriesApi deleteRegistry DELETE /api/serviceregistry_mgmt/v1/registries/{id} Delete a Registry instance
RegistriesApi getRegistries GET /api/serviceregistry_mgmt/v1/registries
RegistriesApi getRegistry GET /api/serviceregistry_mgmt/v1/registries/{id} Get a Registry instance

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]