com.baidu.discovery.spec.api.RegistryRemoteApi Maven / Gradle / Ivy
package com.baidu.discovery.spec.api;
import com.baidu.discovery.spec.model.Instance;
import com.baidu.discovery.spec.model.Service;
import com.baidu.discovery.spec.model.Token;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* @author Bowu Dong ([email protected])
*/
@RequestMapping("/registry")
public interface RegistryRemoteApi {
@GetMapping("/services/{prefix}_{serviceId}/instances")
List getServiceInstances(@PathVariable("prefix") String prefix,
@PathVariable("serviceId") String serviceId);
@PostMapping("/services/{prefix}_{serviceId}/instances")
Instance registerInstance(@PathVariable("prefix") String prefix,
@PathVariable("serviceId") String serviceId, @RequestBody Instance instance);
@DeleteMapping("/services/{prefix}_{serviceId}/instances/{instanceId}")
void removeInstance(@PathVariable("prefix") String prefix,
@PathVariable("serviceId") String serviceId,
@PathVariable("instanceId") String instanceId);
@GetMapping("/authentication/http")
Token getProductToken(@RequestParam("productKey") String productKey);
@PostMapping("/products/{product}/services")
Service addService(@PathVariable("product") String product, @RequestBody Service.Data data);
@PutMapping("/h=provider/heartbeat")
List heartbeat(@RequestParam(value = "time", defaultValue = "60") Integer time,
@RequestBody List instanceIds);
@GetMapping("/services/{serviceId}")
Service getService(@PathVariable("serviceId") String serviceId);
@GetMapping("/registry/products/{productName}/services")
List getServiceIds(@PathVariable("productName") String productName);
}