Create an image library
Call this operation to create a sample image library for image similarity searches.
Usage notes
API operation: /green/similarity/library/add
After you create a sample image library, you can manage its sample images by dimension.
Limits
- An Alibaba Cloud account can have up to 10 image libraries, including the default system library.
- Each image library can contain a maximum of 100,000 sample images.
QPS limit
The queries per second (QPS) limit for this API is 10 per user. Exceeding this limit triggers throttling, which can impact your business. Plan your calls accordingly.
Request parameters
For more information about common request parameters, see Common parameters.
The request body is a JSON object. The following table describes the fields of the object.
| Name | Type | Required | Example | Description |
| name | String | Yes | xxxx | The name of the image library to create. The name must be unique within the same region. The name can be up to 64 characters long and can contain Chinese characters, letters, and underscores. |
Response data
For more information about response parameters, see Response structure.
The data field in the response is a JSON array. Each element of the array contains the following fields.
| Name | Type | Example | Description |
| code | Integer | 200 | The error code. It is the same as the HTTP status code. For more information, see Common error codes. |
| msg | String | OK | The response message for the request. |
| name | String | xxxx | The name of the image library. |
| createTime | Integer | 1614588092 | The UNIX timestamp when the image library was created. |
| imageCount | Integer | 0 | The number of sample images in the library. |
| region | String | cn-shanghai | The region where the image library is located. |
| requestId | String | 33921869-CF8A-4E62-8C31-44F37341FFC1 | The ID of the request. |
Examples
Request example
http(s)://[Endpoint]/green/similarity/library/add
&<Common request parameters>
{
"name": "xxxx"
}Response example
{
"msg": "OK",
"code": 200,
"requestId": "33921869-CF8A-4E62-8C31-44F37341FFC1",
"name": "xxxx",
"createTime":,
"imageCount":0,
"region":"cn-shanghai"
}