API | Description |
Enables the search by image feature for a bucket | |
Adds an image to the image library | |
Searches for an image in the image library | |
Removes an image from the image library |
boolean openImageSearch(OpenImageSearchRequest imageSearchRequest);
//1. Create a job request objectOpenImageSearchRequest request = new OpenImageSearchRequest();//2. Add request parameters as detailed in the API documentationrequest.setBucketName("demobucket-123456789");request.setMaxCapacity("100");request.setMaxQps("10");//3. Call the API to get the job response objectboolean response = client.openImageSearch(request);
Request
has the following sub-nodes:Node Name (Keyword) | Parent Node | Description | Type | Required |
bucketName | Request | String | Yes | |
maxCapacity | Request | Maximum capacity of the image library | String | Yes |
MaxQps | Request | Maximum QPS of the image library | String | No |
true
is returned upon success. CosClientException
or CosServiceException
exception. For more information, see Troubleshooting.boolean addGalleryImages(ImageSearchRequest imageSearchRequest);
//1. Create a job request objectImageSearchRequest request = new ImageSearchRequest();//2. Add request parameters as detailed in the API documentationrequest.setBucketName("demobucket-123456789");request.setObjectKey("1.png");request.setEntityId("mark1");//3. Call the API to get the job response objectboolean response = client.addGalleryImages(request);
Request
has the following sub-nodes:Node Name (Keyword) | Parent Node | Description | Type | Required |
bucketName | Request | String | Yes | |
objectKey | Request | Location of the image in the bucket | String | Yes |
entityId | Request | Entity ID, which can contain up to 64 characters. If EntityId already exists, this request will add the image to it. | String | Yes |
customContent | Request | Custom content, which can contain up to 4,096 characters. The content set will be returned when the image is queried. | String | No |
tags | Request | Custom image tags. The value is a JSON string containing up to 10 key:value pairs. | String | No |
true
is returned upon success. CosClientException
or CosServiceException
exception. For more information, see Troubleshooting.ImageSearchResponse searchGalleryImages(ImageSearchRequest imageSearchRequest);
//1. Create a job request objectImageSearchRequest request = new ImageSearchRequest();//2. Add request parameters as detailed in the API documentationrequest.setBucketName("demobucket-123456789");request.setObjectKey("1.png");//3. Call the API to get the job response objectImageSearchResponse response = client.searchGalleryImages(request);
Request
has the following sub-nodes:Node Name (Keyword) | Parent Node | Description | Type | Required |
bucketName | Request | String | Yes | |
objectKey | Request | Location of the image in the bucket | String | Yes |
matchThreshold | Request | Only images scoring higher than the value of MatchThreshold will be returned. Default value: 0 . | String | No |
Offset | Request | Starting number. Default value: 0 . | String | No |
limit | Request | Number of results to be returned. Default value: 10 . Maximum value: 100 . | String | No |
filter | Request | Uses image tags to filter images. You can use AND and OR to set multiple conditions (>, >=, <, <=, =, !=). | String | No |
ImageSearchResponse
response object is returned upon success.CosClientException
or CosServiceException
exception. For more information, see Troubleshooting.boolean deleteGalleryImages(ImageSearchRequest imageSearchRequest);
//1. Create a job request objectImageSearchRequest request = new ImageSearchRequest();//2. Add request parameters as detailed in the API documentationrequest.setBucketName("demobucket-123456789");request.setObjectKey("1.png");request.setEntityId("mark");//3. Call the API to get the job response objectboolean response = client.deleteGalleryImages(request);
Request
has the following sub-nodes:Node Name (Keyword) | Parent Node | Description | Type | Required |
bucketName | Request | String | Yes | |
objectKey | Request | Location of the image in the bucket | String | Yes |
entityId | Request | Entity ID | String | Yes |
true
is returned upon success.CosClientException
or CosServiceException
exception. For more information, see Troubleshooting.
Apakah halaman ini membantu?