@RestController public class VisionController extends Object
ImageAnnotatorClient
, which is configured and produced
in Application
. See Application.imageAnnotatorClient(com.google.api.gax.core.CredentialsProvider)
to understand how the client is produced with the help of spring-cloud-gcp-starter.Constructor and Description |
---|
VisionController() |
Modifier and Type | Method and Description |
---|---|
String |
uploadImage(String imageUrl)
This method downloads an image from a URL and sends its contents to the Vision API for label detection.
|
@GetMapping(value="/vision") public String uploadImage(String imageUrl) throws Exception
imageUrl
- the URL of the imageException
- if the Vision API call produces an errorCopyright © 2018 Pivotal Software, Inc.. All rights reserved.