cos:GetObject, ci:CreateAIImageColoringJob.cos:PutObject.cos:GetObject, cos:PutObject (Note: The resource corresponding to GetObject is the source file, and the resource corresponding to PutObject is the transferred file).GET /<ObjectKey>?ci-process=AIImageColoring HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: <GMT Date>Authorization: <Auth String>
GET /?ci-process=AIImageColoring&detect-url=<detect-url> HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: <GMT Date>Authorization: <Auth String>
Parameter | Meaning | Type | Required or Not |
ObjectKey | object filename, for example: folder/document.jpg | String | No |
ci-process | Cloud Infinite processing capability, image coloring parameter fixed as AIImageColoring | String | Yes |
detect-url | You can process any publicly accessible image link by filling in detect-url. If detect-url is not filled in, the backend will default to processing the ObjectKey. If detect-url is filled in, the backend will process the detect-url link, and there is no need to fill in the ObjectKey. detect-url example: http://www.example.com/abc.jpg, needs to be UrlEncoded, processed as http%3A%2F%2Fwww.example.com%2Fabc.jpg | String | No |
HTTP/1.1 200 OKContent-Type: image/pngContent-Length: 98645Date: Tue, 23 Apr 2022 09:06:16 GMTStatus: 200 OKServer: tencent-cix-cos-request-id: NWFjMzQ0MDZfOTBmYTUwXzZkZV8z****[pic-content]
GET /filename.jpg?ci-process=AIImageColoring HTTP/1.1Host: examplebucket-1250000000.cos.ap-chengdu.myqcloud.comDate: Tue, 23 Apr 2022 09:06:16 GMTAuthorization: <Auth String>
HTTP/1.1 200 OKContent-Type: image/jpgContent-Length: 98645Date: Tue, 23 Apr 2022 09:06:16 GMTStatus: 200 OKServer: tencent-cix-cos-request-id: NWFjMzQ0MDZfOTBmYTUwXzZkZV8z****[pic-content]
PUT /<ObjectKey> HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: GMT DateAuthorization: Auth StringPic-Operations: <PicOperations>
Header Name | Description | Type |
Pic-Operations | Parameters for image operations | String |
Parameter Name | Type | Required or Not | Description |
is_pic_info | Int | No | Whether to return original image information, 0 for no return, 1 for return, default is 0 |
rules | Array | No | Processing rules, one rule corresponds to one processing result (currently supports five rules), leave blank to skip image processing |
Parameter Name | Type | Required or Not | Description |
bucket | String | No | The name of the destination bucket for storing results, in the format BucketName-AppId. If not specified, it defaults to the current bucket. |
fileid | String | Yes | Storage path and name of the processed file. Naming rules description: For example, the file path and filename of the source file are: /p1/test1.jpgPaths starting with / are absolute paths. For example, when the fileid value is /p2/test2.jpg, it means a file named test2.jpg is stored in the p2 folder. Paths not starting with / are relative paths. For example, when the fileid value is p2/test2.jpg, it means a p2 folder is created in the p1 folder, and then a file named test2.jpg is stored in the p2 folder. Do not end with /, otherwise an empty filename will occur. If you want the repaired image to overwrite the original image, set the fileid field to <ObjectKey> |
rule | String | Yes | Processing parameter, fixed as: ci-process = AIImageColoring |
Node Name (Keyword) | Parent Node | Description | Type |
UploadResult | None. | Request result. | Container |
Node Name (Keyword) | Parent Node | Description | Type |
OriginalInfo | UploadResult | Image information | Container |
ProcessResults | UploadResult | Request processing result | Container |
Node Name | Parent Node | Description | Type |
Key | OriginalInfo | Original image filename | String |
Location | OriginalInfo | path to the image | String |
ETag | OriginalInfo | Etag value of the original image | |
Node Name (Keyword) | Parent Node | Description | Type |
Object | ProcessResults | processing result of each image | Container |
Node Name (Keyword) | Parent Node | Description | Type |
Key | Object | Colorized image file name | String |
Location | Object | Colorized image link | String |
ETag | Object | ETag value of the colorized image | String |
Size | Object | Image size | Int |
PUT /<ObjectKey> HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: GMT DateAuthorization: Auth StringPic-Operations:{"is_pic_info": 1,"rules": [{"fileid": "exampleobject","rule": "ci-process=AIImageColoring"}]}
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 645Date: Tue, 23 Apr 2022 09:06:16 GMTStatus: 200 OKServer: tencent-cix-cos-request-id: NWFjMzQ0MDZfOTBmYTUwXzZkZV8z****<UploadResult><OriginalInfo><Key>ObjectKey</Key><Location>examplebucket-1250000000.cos.ap-chengdu.myqcloud.com/filename.jpg</Location><ETag>"ed60e3598e6862d8c8443a06acfb2153"</ETag></OriginalInfo><ProcessResults><Object><Key>exampleobject</Key><Location>examplebucket-1250000000.cos.ap-chengdu.myqcloud.com/exampleobject</Location><Format/><Size>354256</Size><ETag>"521451f63c331becf533e466732c1091"</ETag></Object></ProcessResults></UploadResult>
POST /<ObjectKey>?image_process HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: GMT DateAuthorization: Auth StringPic-Operations: <PicOperations>
Header Name | Description | Type |
Pic-Operations | Parameters for image operations | String |
Parameter Name | Type | Required or Not | Description |
is_pic_info | Int | No | Whether to return original image information, 0 for no return, 1 for return, default is 0 |
rules | Array | No | Processing rules, one rule corresponds to one processing result (currently supports five rules), leave blank to skip image processing |
Parameter Name | Type | Required or Not | Description |
bucket | String | No | The name of the destination bucket for storing results, in the format BucketName-AppId. If not specified, it defaults to the current bucket. |
fileid | String | Yes | Storage path and name of the processed file. Naming rules description: For example, the source file path and name are: /p1/test1.jpg Paths starting with / are absolute paths. For example, when the fileid value is /p2/test2.jpg, it means a file named test2.jpg is stored in the p2 folder. Paths not starting with / are relative paths. For example, when the fileid value is p2/test2.jpg, it means a p2 folder is created in the p1 folder, and then a file named test2.jpg is stored in the p2 folder. Note: Do not end with /, otherwise an empty filename will occur. If you want the repaired image to overwrite the original image, set the fileid field to <ObjectKey> |
rule | String | Yes | Processing parameter, fixed as: ci-process=AIImageColoring |
Node Name (Keyword) | Parent Node | Description | Type |
UploadResult | None. | Request result. | Container |
Node Name (Keyword) | Parent Node | Description | Type |
OriginalInfo | UploadResult | Image information | Container |
ProcessResults | UploadResult | Request processing result | Container |
Node Name | Parent Node | Description | Type |
Key | OriginalInfo | Original image filename | String |
Location | OriginalInfo | path to the image | String |
ETag | OriginalInfo | original image ETag | String |
Node Name (Keyword) | Parent Node | Description | Type |
Object | ProcessResults | processing result of each image | Container |
Node Name (Keyword) | Parent Node | Description | Type |
Key | Object | Colorized image file name | String |
Location | Object | Colorized image link | String |
ETag | Object | ETag value of the colorized image | String |
Size | Object | Size of the colorized image | Int |
POST /<ObjectKey>?image_process HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: GMT DateContent-length: SizeAuthorization: Auth StringPic-Operations:{"rules": [{"fileid": "exampleobject","rule": "ci-process=AIImageColoring"}]}
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 645Date: Tue, 23 Apr 2022 09:06:16 GMTStatus: 200 OKServer: tencent-cix-cos-request-id: NWFjMzQ0MDZfOTBmYTUwXzZkZV8z****<UploadResult><OriginalInfo><Key>ObjectKey</Key><Location>examplebucket-1250000000.cos.ap-chengdu.myqcloud.com/filename.jpg</Location><ETag>"ed60e3598e6862d8c8443a06acfb2153"</ETag></OriginalInfo><ProcessResults><Object><Key>exampleobject</Key><Location>examplebucket-1250000000.cos.ap-chengdu.myqcloud.com/exampleobject</Location><Format/><Size>354256</Size><ETag>"521451f63c331becf533e466732c1091"</ETag></Object></ProcessResults></UploadResult>
Feedback