持久化处理
Last updated
2023-07-17 10:25:44
{"value":"\u6301\u4e45\u5316\u6570\u636e\u5904\u7406(pfop) \uff0c\u7528\u4e8e\u6ee1\u8db3\u6570\u636e\u5904\u7406\u65f6\u95f4\u8f83\u957f\u3001\u8ba1\u7b97\u91cf\u8f83\u5927\u7684\u573a\u666f\u3002\n\n- \u5f00\u53d1\u8005\u53ef\u4f7f\u7528\u8be5\u529f\u80fd\u5bf9 \u8d85\u5927\u56fe\u7247 \u505a\u5904\u7406\uff0c\u5e76\u5c06\u5904\u7406\u7ed3\u679c\u6c38\u4e45\u5b58\u50a8\u4e8e\u7a7a\u95f4\u4e2d\uff0c\u4ece\u800c\u5927\u5e45\u63d0\u5347\u8bbf\u95ee\u4f53\u9a8c\u3002\n- \u6301\u4e45\u5316\u6570\u636e\u5904\u7406\u529f\u80fd\u8fd8\u63d0\u4f9b\u5373\u65f6\u7684\u5904\u7406\u72b6\u6001\u901a\u77e5\u548c\u67e5\u8be2\u529f\u80fd\uff0c\u56e0\u6b64\u5f00\u53d1\u8005\u5728\u5f00\u59cb\u6267\u884c\u540e\u8fd8\u80fd\u968f\u65f6\u83b7\u53d6\u5904\u7406\u8fdb\u5ea6\u4fe1\u606f\u3002\n\n\u6301\u4e45\u5316\u6570\u636e\u5904\u7406(pfop) \uff0c\u53ef\u4ee5\u5728\u8d44\u6e90\u4e0a\u4f20\u65f6\uff0c\u81ea\u52a8\u89e6\u53d1\u5904\u7406\u6d41\u7a0b\u3002\u5982\u679c\u5e0c\u671b\u5728\u4e0a\u4f20\u6587\u4ef6\u8fc7\u7a0b\u4e2d\u81ea\u52a8\u89e6\u53d1\u6570\u636e\u5904\u7406\u8fc7\u7a0b\uff08\u5373\u9884\u8f6c\u6301\u4e45\u5316\uff09\uff0c\u9700\u8981\u5728\u6784\u9020\u4e0a\u4f20\u51ed\u8bc1\u65f6\u5728\u4e0a\u4f20\u7b56\u7565\u4e2d\u8bbe\u7f6e `persistentOps` \u548c`persistentNotifyUrl`\u4e24\u4e2a\u5b57\u6bb5\u3002 \u8be6\u7ec6\u8bf4\u660e\u53c2\u89c1 \u4e0a\u4f20\u7b56\u7565-persistentOps\u8be6\u89e3]\n\n## **\u72b6\u6001\u901a\u77e5\u548c\u67e5\u8be2**\n\n\u5904\u7406\u8fc7\u7a0b\u7684\u72b6\u6001\uff0c\u53ef\u901a\u8fc7\u4ee5\u4e0b\u4e24\u79cd\u65b9\u5f0f\u83b7\u53d6\uff1a\n\n- \u72b6\u6001\u901a\u77e5\n\n \u4e0a\u4f20\u65f6\u8bbe\u5b9a`persistentNotifyUrl`\u5b57\u6bb5\uff0c\u5219\u8be5URL\u4f1a\u6536\u5230\u4e3b\u52a8\u7684\u901a\u77e5\u3002\n\n \u670d\u52a1\u7aef\u5b8c\u6210\u6240\u6709\u7684\u6570\u636e\u5904\u7406\u540e\uff0c\u4f1a\u4ee5`HTTP POST` \u7684\u65b9\u5f0f\u5c06\u5904\u7406\u72b6\u6001\u53d1\u9001\u7ed9\u7528\u6237\u6307\u5b9a\u7684\u901a\u77e5URL\u3002\n\n- \u72b6\u6001\u67e5\u8be2\n\n \u5f00\u53d1\u8005\u53ef\u4ee5\u4f7f\u7528\u4e0a\u4f20\u65f6\u8fd4\u56de\u7684 `persistentId` \u6765\u968f\u65f6\u67e5\u8be2\u6570\u636e\u5904\u7406\u7684\u72b6\u6001\u3002\n\n\n## \u8bf7\u6c42\n\n\u670d\u52a1\u7aef\u6309\u987a\u5e8f\u5b8c\u6210\u6240\u6709\u6307\u5b9a\u7684\u4e91\u5904\u7406\u64cd\u4f5c\u540e\uff0c\u4f1a\u5c06\u5904\u7406\u7ed3\u679c\u72b6\u6001\u63d0\u4ea4\u5230`<persistentNotifyUrl>`\u6307\u5411\u7684\u7f51\u5740\u3002\n\n### \u8bf7\u6c42\u8bed\u6cd5\n\n```\nGET \/status\/get\/prefop?id=<persistentId> HTTP\/1.1\nHost: <APIHost>\n```\n\n### \u5934\u90e8\u4fe1\u606f\n\n| \u5934\u90e8\u540d\u79f0 | \u5fc5\u586b | \u8bf4\u660e |\n| :------- | :--- | :-------------------------------- |\n| Host | \u662f | API \u670d\u52a1\u57df\u540d\uff0c\u5177\u4f53\u53c2\u89c1 \u8bbf\u95ee\u57df\u540d\u3002 |\n\n## \u54cd\u5e94\n\n### \u54cd\u5e94\u8bed\u6cd5\n\n```\nHTTP\/1.1 200 OK\nContent-Type: application\/json\nContent-Length: <prefopResponseContentLength>\n\n<prefopResponseContent>\n```\n\n### \u5934\u90e8\u4fe1\u606f\n\n| \u5934\u90e8\u540d\u79f0 | \u5fc5\u586b | \u8bf4\u660e |\n| :----------- | :--- | :----------------------------------------------------------- |\n| Content-Type | \u662f | \u6b63\u5e38\u60c5\u51b5\u4e0b\u8be5\u503c\u5c06\u88ab\u8bbe\u4e3a`application\/json`\uff0c\u8868\u793a\u8fd4\u56deJSON\u683c\u5f0f\u7684\u6587\u672c\u4fe1\u606f\u3002 |\n\n### \u54cd\u5e94\u5185\u5bb9\n\n- \u5982\u679c\u8bf7\u6c42\u6210\u529f\uff0c\u8fd4\u56de\u5305\u542b\u5982\u4e0b\u5185\u5bb9\u7684JSON\u5b57\u7b26\u4e32\uff08\u5df2\u683c\u5f0f\u5316\uff0c\u4fbf\u4e8e\u9605\u8bfb\uff09\uff1a\n\n```\n{\n \"id\": \"16864pauo1vc9nhp12\",\n \"code\": 0,\n \"desc\": \"The fop was completed successfully\",\n \"inputKey\": \"sample.mp4\",\n \"inputBucket\": \"dutest\",\n \"items\": [\n {\n \"cmd\": \"avthumb\/mp4\/r\/30\/vb\/256k\/vcodec\/libx264\/ar\/22061\/ab\/64k\/acodec\/libmp3lame\",\n \"code\": 0,\n \"desc\": \"The fop was completed successfully\",\n \"error\": \"\",\n \"hash\": \"FrPNF2qz66Bt14JMdgU8Ya7axZx-\",\n \"key\": \"v-PtT-DzpyCcqv6xNU25neTMkcc=\/FjgJQXuH7OresQL4zgRqYG5bZ64x\",\n \"returnOld\": 0\n }\n ],\n \"pipeline\": \"0.default\",\n \"reqid\": \"ffmpeg.3hMAAH3p5Gupb6oT\"\n}\n```\n\n| \u5b57\u6bb5\u540d\u79f0 | \u5fc5\u586b | \u8bf4\u660e |\n| :---------- | :--- | :----------------------------------------------------------- |\n| id | \u662f | \u6301\u4e45\u5316\u5904\u7406\u7684\u8fdb\u7a0bID\uff0c\u5373\u524d\u6587\u4e2d\u7684`<persistentId>`\u3002 |\n| code | \u662f | \u72b6\u6001\u7801`0`\u6210\u529f\uff0c`1`\u7b49\u5f85\u5904\u7406\uff0c`2`\u6b63\u5728\u5904\u7406\uff0c`3`\u5904\u7406\u5931\u8d25\u3002 |\n| desc | \u662f | \u4e0e\u72b6\u6001\u7801\u76f8\u5bf9\u5e94\u7684\u8be6\u7ec6\u63cf\u8ff0\u3002 |\n| inputKey | \u662f | \u5904\u7406\u6e90\u6587\u4ef6\u7684\u6587\u4ef6\u540d\u3002 |\n| inputBucket | \u662f | \u5904\u7406\u6e90\u6587\u4ef6\u6240\u5728\u7684\u7a7a\u95f4\u540d\u3002 |\n| items | \u662f | \u4e91\u5904\u7406\u64cd\u4f5c\u5217\u8868\uff0c\u5305\u542b\u6bcf\u4e2a\u4e91\u5904\u7406\u64cd\u4f5c\u7684\u72b6\u6001\u4fe1\u606f\u3002 |\n| cmd | \u662f | \u6240\u6267\u884c\u7684\u4e91\u5904\u7406\u64cd\u4f5c\u547d\u4ee4`fopN`\u3002 |\n| error | | \u5982\u679c\u5904\u7406\u5931\u8d25\uff0c\u8be5\u5b57\u6bb5\u4f1a\u7ed9\u51fa\u5931\u8d25\u7684\u8be6\u7ec6\u539f\u56e0\u3002 |\n| hash | \u662f | \u4e91\u5904\u7406\u7ed3\u679c\u4fdd\u5b58\u5728\u670d\u52a1\u7aef\u7684\u552f\u4e00`hash`\u6807\u8bc6\u3002 |\n| key | \u662f | \u4e91\u5904\u7406\u7ed3\u679c\u7684\u5916\u94fe\u8d44\u6e90\u540d`Key`\u3002 |\n| returnOld | \u662f | \u9ed8\u8ba4\u4e3a0\u3002\u5f53\u7528\u6237\u6267\u884c`saveas`\u65f6\uff0c\u5982\u679c\u672a\u52a0`force`\u4e14\u6307\u5b9a\u7684`bucket`\uff1a`key`\u5b58\u5728\uff0c\u5219\u8fd4\u56de1 \uff0c\u544a\u8bc9\u7528\u6237\u8fd4\u56de\u7684\u662f\u65e7\u6570\u636e\u3002 |\n| pipeline | \u662f | \u4e91\u5904\u7406\u64cd\u4f5c\u7684\u5904\u7406\u961f\u5217\uff0c\u9ed8\u8ba4\u4f7f\u7528\u961f\u5217\u4e3a\u5171\u4eab\u961f\u5217`0.default`\u3002 |\n| reqid | \u662f | \u4e91\u5904\u7406\u8bf7\u6c42\u7684\u8bf7\u6c42id\uff0c\u4e3b\u8981\u7528\u4e8e\u95ee\u9898\u6392\u67e5\u3002 |\n\n- \u5982\u679c\u8bf7\u6c42\u5931\u8d25\uff0c\u8fd4\u56de\u5305\u542b\u5982\u4e0b\u5185\u5bb9\u7684JSON\u5b57\u7b26\u4e32\uff08\u5df2\u683c\u5f0f\u5316\uff0c\u4fbf\u4e8e\u9605\u8bfb\uff09\uff1a\n\n```\n{\n \"error\": \"<ErrMsg string>\"\n}\n```\n\n\n\n## \u54cd\u5e94\u72b6\u6001\u7801\n\n| HTTP\u72b6\u6001\u7801 | \u542b\u4e49 |\n| :--------- | :--------------- |\n| 200 | \u67e5\u8be2\u6210\u529f |\n| 400 | \u8bf7\u6c42\u62a5\u6587\u683c\u5f0f\u9519\u8bef |\n| 612 | \u67e5\u8be2\u5bf9\u8c61\u4e0d\u5b58\u5728 |\n| 599 | \u670d\u52a1\u7aef\u64cd\u4f5c\u5931\u8d25 |"}