Cliente api que executa pedidos ao registration server (eureka) para registar esta instância ou obter servidores com o qual pode comunicar.
Para ser usado em microserviços implementados em java.
Registration-client-api
- API version: 1.0.0
- Build date: 2020-11-03T14:38:29.767Z
Automatically generated by the Swagger Codegen
Building the API client library requires:
- Java 1.7+
- Maven/Gradle
Java version 8:
sudo apt install openjdk-8-jdk
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
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>pt.unl.fct.miei.usmanagement.manager</groupId>
<artifactId>registration-client-java</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
Add this dependency to your project's build file:
compile "pt.unl.fct.miei.usmanagement.manager:registration-client-java:1.0.0"
At first generate the JAR by executing:
mvn clean package
Then manually install the following JARs:
target/swagger-java-client-1.0.0.jar
target/lib/*.jar
Please follow the installation instruction and execute the following Java code:
import pt.unl.fct.miei.usmanagement.manager.client.*;
import pt.unl.fct.miei.usmanagement.manager.client.auth.*;
import pt.unl.fct.miei.usmanagement.manager.client.model.*;
import pt.unl.fct.miei.usmanagement.manager.client.api.EndpointsApi;
import java.io.File;
import java.util.*;
public class EndpointsApiExample {
public static void main(String[] args) {
EndpointsApi apiInstance = new EndpointsApi();
String service = "service_example"; // String | Service name
try {
Endpoint result = apiInstance.getServiceEndpoint(service);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling EndpointsApi#getServiceEndpoint");
e.printStackTrace();
}
}
}
All URIs are relative to http://localhost:1906/api
Class | Method | HTTP request | Description |
---|---|---|---|
EndpointsApi | getServiceEndpoint | GET /services/{service}/endpoint | Obtém o melhor endpoint para o serviço {service} |
EndpointsApi | getServiceEndpoints | GET /services/{service}/endpoints | Obtém todos os endpoints registados em nome do serviço {service} |
EndpointsApi | register | POST /register | Regista o endpoint no servidor eureka |
All endpoints do not require authorization. Authentication schemes defined for the API:
It's recommended to create an instance of ApiClient
per thread in a multithreaded environment to avoid any potential issues.
Registration-client-java está licenciado com a MIT license. Ver a licença no cabeçalho do respetivo ficheiro para confirmar.