/** * Writes a value for the given key to Consul. * * @param key The key * @param value The value as a String * @return A {@link Publisher} that emits a boolean if the operation succeeded */ @Put(value = "/kv/{+key}", processes = MediaType.TEXT_PLAIN, single = true) Publisher<Boolean> putValue(String key, @Body String value);
/** * Register a new {@link CatalogEntry}. See https://www.consul.io/api/catalog.html. * * @param entry The entry to register * @return A {@link Publisher} that emits a boolean true if the operation was successful */ @Put(uri = "/catalog/register", single = true) Publisher<Boolean> register(@NotNull @Body CatalogEntry entry);
/** * Register a new {@link CatalogEntry}. See https://www.consul.io/api/catalog.html. * * @param entry The entry to register * @return A {@link Publisher} that emits a boolean true if the operation was successful */ @Put(uri = "/catalog/deregister", single = true) Publisher<Boolean> deregister(@NotNull @Body CatalogEntry entry);
/** * Register a new {@link CatalogEntry}. See https://www.consul.io/api/catalog.html. * * @param entry The entry to register * @return A {@link Publisher} that emits a boolean true if the operation was successful */ @Put("/agent/service/register") @Retryable( attempts = AbstractConsulClient.CONSUL_REGISTRATION_RETRY_COUNT, delay = AbstractConsulClient.CONSUL_REGISTRATION_RETRY_DELAY ) Publisher<HttpStatus> register(@NotNull @Body NewServiceEntry entry);
@Named("isbn-validator") Single<IsbnValidationResponse> validate(@Body IsbnValidationRequest request); // <1> }
/** * Registers a new {@link InstanceInfo} with the Eureka server. * * @param appId The application id * @param instance The instance * @return A status of {@link io.micronaut.http.HttpStatus#NO_CONTENT} on success */ @Post(uri = "/apps/{appId}", single = true) @Retryable( attempts = AbstractEurekaClient.EXPR_EUREKA_REGISTRATION_RETRY_COUNT, delay = AbstractEurekaClient.EXPR_EUREKA_REGISTRATION_RETRY_DELAY ) Publisher<HttpStatus> register(@NotBlank String appId, @Valid @NotNull @Body InstanceInfo instance);
@Post("/greet") @Status(HttpStatus.CREATED) Message echo(@Body Message message) { return message; }
@Post(value = "/hello", consumes = MediaType.TEXT_PLAIN, produces = MediaType.TEXT_PLAIN) @Status(HttpStatus.CREATED) String echoHello(@Body String message) { return message; }
@Post(value = "/book", consumes = {MediaType.APPLICATION_JSON, MediaType.APPLICATION_FORM_URLENCODED}) @Status(HttpStatus.CREATED) Book save(@Body Book book) { return book; } }
@Post("/calculate") CalculatePriceResult calculatePrice(@Body @NotNull CalculatePriceCommand cmd); }
@Post("/send") HttpResponse send(@Valid @Body Email email); }
@Post("/") Single<T> save(@Valid @Body T pet); }
@Post("/send") public HttpResponse send(@Valid @Body Email email) { log.info(email.toString()); if ( emailService == null ) { log.warn("Email service not injected"); return HttpResponse.serverError(); } emailService.send(email); return HttpResponse.ok(); } }