{"id":265466,"date":"2015-09-11T18:11:03","date_gmt":"2015-09-11T14:11:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=265466"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=265466","title":{"rendered":"\u041c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0431\u0435\u0437 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432"},"content":{"rendered":"<p>       \u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435, \u0434\u043e\u0440\u043e\u0433\u0438\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438!<\/p>\n<p>  \u041a\u0430\u043a \u043f\u043e\u043c\u043d\u044f\u0442 \u0441\u0430\u043c\u044b\u0435 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438\u0437 \u0432\u0430\u0441, \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u043d\u0430\u0434 \u0438\u043d\u043d\u043e\u0432\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043a\u043d\u0438\u0433\u043e\u0439 \u043e <a href=\"http:\/\/habrahabr.ru\/company\/piter\/blog\/255029\/\">\u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u0430\u0445<\/a>, \u043d\u043e \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0438\u0448\u0443\u0442 \u0432 \u0421\u0435\u0442\u0438 \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0441\u043c\u043e\u0433\u043b\u0438 \u043f\u0440\u043e\u0439\u0442\u0438 \u043c\u0438\u043c\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0439\u0448\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0438\u0437 \u0431\u043b\u043e\u0433\u0430 Amazon, \u0430\u0432\u0442\u043e\u0440 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0422\u0438\u043c \u0412\u0430\u0433\u043d\u0435\u0440 \u0434\u0435\u043b\u0438\u0442\u0441\u044f \u0441\u0432\u043e\u0438\u043c\u0438 \u0432\u0437\u0433\u043b\u044f\u0434\u0430\u043c\u0438 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443.<\/p>\n<p>  \u041c\u043d\u043e\u0433\u043e Java, JavaScript, \u0441\u0445\u0435\u043c, \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0439 \u0438 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430<a name=\"habracut\"><\/a><\/p>\n<p>  \u041d\u0430 <a href=\"http:\/\/events.linuxfoundation.org\/events\/linuxcon-north-america\">\u043a\u043e\u043d\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0438 LinuxCon\/ContainerCon 2015<\/a> \u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b \u0434\u0435\u043c\u043e-\u0434\u043e\u043a\u043b\u0430\u0434 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u201c<a href=\"http:\/\/lccocc2015.sched.org\/event\/7a42a7e5369aa6321e6df5a8a335451e?iframe=no&amp;w=&amp;sidebar=yes&amp;bg=no#.VfLZBhGqpHw\">\u041c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u0431\u0435\u0437 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432<\/a>\u201d. \u0412 \u043d\u0435\u043c \u044f \u043e\u043f\u0438\u0441\u0430\u043b \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u043b \u0435\u0433\u043e \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0440\u0435\u0433\u0438\u043e\u043d\u0430\u0445, \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0435\u0435 \u044d\u0442\u043e\u0442 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430, \u0434\u043e\u0431\u0430\u0432\u0438\u043b API \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 HTTPS, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c Amazon API Gateway \u0438 \u0432\u0435\u0431-\u0441\u0430\u0439\u0442, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b \u0434\u043b\u044f \u0432\u0441\u0435\u0439 \u044d\u0442\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0435 \u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u2014 \u0432\u0441\u0435 \u0431\u0435\u0437 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432. <\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0432\u044b\u0448\u0435\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0439 \u0434\u043e\u043a\u043b\u0430\u0434 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0432\u043e \u0432\u0441\u0435\u0445 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u044f\u0445, \u043f\u0440\u0438\u0447\u0435\u043c \u043a\u043e\u0435-\u0433\u0434\u0435 \u044f \u0443\u0433\u043b\u0443\u0431\u043b\u044f\u044e\u0441\u044c \u0432 \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u2014 \u0432 \u043f\u043e\u0434\u0431\u043e\u0440\u043a\u0435 <a href=\"http:\/\/events.linuxfoundation.org\/sites\/events\/files\/slides\/cc15_wagner.pdf\">\u0441\u043b\u0430\u0439\u0434\u043e\u0432<\/a>. \u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u2013 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b <a href=\"https:\/\/aws.amazon.com\/ru\/blogs\/compute\/the-squirrelbin-architecture-a-serverless-microservice-using-aws-lambda\/\">SquirrelBin<\/a> \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 gist.<\/p>\n<p>  <b>\u0411\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430<\/b><\/p>\n<p>  \u0422\u0435\u0440\u043c\u0438\u043d \u201c\u0431\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0439\u201d \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u044f\u0432\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b, \u0442\u043e \u0435\u0441\u0442\u044c: \u043e\u0431\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u0431\u0435\u0437 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432, \u0431\u0435\u0437 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445, \u0431\u0435\u0437 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c. \u0411\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u043c\u0438 \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u0438 \u0441 \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u043e\u043c. \u041d\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0439 \u043d\u0438\u0436\u0435 \u0441\u0445\u0435\u043c\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044b \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0438 \u0438\u0445 \u0441\u0432\u044f\u0437\u0438: \u043b\u044f\u043c\u0431\u0434\u0430-\u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0438 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e\u0449\u0435\u0435\u0441\u044f \u043a \u043d\u0435\u043c\u0443, \u043f\u043b\u044e\u0441 \u0448\u043b\u044e\u0437 Amazon API Gateway, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e HTTP-\u0442\u043e\u0447\u043a\u0443 \u0434\u043b\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u043d\u0430 Amazon S3.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/2ee\/05a\/e66\/2ee05ae66dde49efaf53b2234a3e9242.png\"\/><\/p>\n<p>  \u0411\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0430\u044f \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0434\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u0438 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c AWS Lambda<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c!<\/p>\n<p>  <i><b>\u042d\u0442\u0430\u043f 1: \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/b><\/i><\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u043f\u0440\u043e\u0449\u0435, \u043c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 ImageMagick, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0432 \u044f\u0437\u044b\u043a nodejs \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 Lambda. \u041e\u0434\u043d\u0430\u043a\u043e, \u044d\u0442\u043e \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u2014 \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u0435\u0442\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 <a href=\"https:\/\/aws.amazon.com\/ru\/blogs\/compute\/nodejs-packages-in-lambda\/\">\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 JavaScript<\/a> \u0438\u043b\u0438 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, <a href=\"https:\/\/aws.amazon.com\/ru\/blogs\/compute\/using-python-in-an-aws-lambda-function\/\">\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c Python<\/a> \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 <a href=\"https:\/\/aws.amazon.com\/ru\/blogs\/compute\/running-executables-in-aws-lambda\/\">\u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u043a\u043e\u0434 \u0432 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438<\/a>. \u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u043d\u0430 nodejs, \u043d\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441 \u0442\u0435\u043c \u0436\u0435 \u0443\u0441\u043f\u0435\u0445\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <a href=\"https:\/\/aws.amazon.com\/ru\/blogs\/compute\/aws-lambda-announces-java-support\/\">Java<\/a>, <a href=\"https:\/\/aws.amazon.com\/ru\/blogs\/compute\/clojure\/\">Clojure<\/a>, <a href=\"https:\/\/aws.amazon.com\/ru\/blogs\/compute\/writing-aws-lambda-functions-in-scala\/\">Scala<\/a> \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u043e\u0433\u043e jvm-\u044f\u0437\u044b\u043a\u0430 \u0432 AWS Lambda.<\/p>\n<p>  \u041d\u0438\u0436\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0432\u043e\u0435\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u043c \u00abhello world\u00bb \u0434\u043b\u044f ImageMagick \u2014 \u043e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b (\u044d\u0442\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u2014 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f), \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0440\u043e\u0437\u044b \u0438 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0435\u0433\u043e. \u0415\u0441\u043b\u0438 \u043d\u0435 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430, \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0430 JSON, \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a.<\/p>\n<pre><code class=\"javascript\">var im = require(&quot;imagemagick&quot;); var fs = require(&quot;fs&quot;); exports.handler = function(event, context) {     if (event.operation) console.log(&quot;Operation &quot; + event.operation + &quot; requested&quot;);     switch (event.operation) {         case 'ping': context.succeed('pong'); return;         case 'getSample':             event.customArgs = [&quot;rose:&quot;, &quot;\/tmp\/rose.png&quot;];             im.convert(event.customArgs, function(err, output) {                 if (err) context.fail(err);                 else {                     var resultImgBase64 = new Buffer(fs.readFileSync(&quot;\/tmp\/rose.png&quot;)).toString('base64');                     try {fs.unlinkSync(&quot;\/tmp\/rose.png&quot;);} catch (e) {} \/\/ discard                     context.succeed(resultImgBase64);                 }             });             break; \/\/ \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430         default:             var error = new Error('Unrecognized operation &quot;' + event.operation + '&quot;');             context.fail(error);             return;     } }; <\/code><\/pre>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u0441\u0435\u0440\u0432\u0438\u0441 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 JSON \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0435 \u043e\u043a\u043d\u043e \u043a\u043e\u043d\u0441\u043e\u043b\u0438 AWS Lambda:<\/p>\n<pre><code class=\"javascript\">{   &quot;operation&quot;: &quot;ping&quot; } <\/code><\/pre>\n<p>  \u0412\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u043a\u043b\u0438\u043a \u201cpong\u201d. \u0414\u0430\u043b\u0435\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043a \u0432\u044b\u0437\u043e\u0432\u0443 ImageMagick, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044f \u0442\u0430\u043a\u043e\u0439 JSON:<\/p>\n<pre><code class=\"javascript\">{   &quot;operation&quot;: &quot;getSample&quot; }  <\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 PNG-\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0440\u043e\u0437\u044b \u0432 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0435 base64: \u201c\u201diVBORw0KGg\u2026Jggg==\u201d. \u0427\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b, \u0432\u044b\u0440\u0435\u0436\u044c\u0442\u0435 \u0438\u0445 \u0438 \u0432\u0441\u0442\u0430\u0432\u044c\u0442\u0435 (\u0431\u0435\u0437 \u0434\u0432\u043e\u0439\u043d\u044b\u0445 \u043a\u0430\u0432\u044b\u0447\u0435\u043a) \u0432 \u043b\u044e\u0431\u043e\u0439 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0434\u0435\u043a\u043e\u0434\u0435\u0440, \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0449\u0438\u0439 Base64 \u0432 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 codebeautify.org\/base64-to-image-converter. \u0423 \u0432\u0430\u0441 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0440\u043e\u0437\u044b:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/6fb\/059\/11a\/6fb05911a844401babce962394484d59.png\"\/><\/p>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f (\u043a\u0440\u0430\u0441\u043d\u0430\u044f \u0440\u043e\u0437\u0430)<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043e\u043f\u0438\u0448\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0432 \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u043e\u0441\u0442\u0430\u0432\u0448\u0443\u044e\u0441\u044f \u0447\u0430\u0441\u0442\u044c \u0435\u0433\u043e nodejs-\u043e\u0431\u0435\u0440\u0442\u043a\u0438. \u041c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442\u044c \u0440\u044f\u0434 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439: <\/p>\n<ul>\n<li>ping: \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430.<\/li>\n<li>getDimensions: \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0432\u044b\u0437\u043e\u0432\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 identify \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0441\u043e\u0442\u044b \u0438 \u0448\u0438\u0440\u0438\u043d\u044b \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f.<\/li>\n<li>identify: \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f.<\/li>\n<li>resize: \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u0430 (\u00ab\u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c\u00bb \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0430\u044f convert)<\/li>\n<li>thumbnail: \u0441\u0438\u043d\u043e\u043d\u0438\u043c resize.<\/li>\n<li>convert: \u201c\u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u0430\u044f\u201d \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u2013 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043c\u0435\u0434\u0438\u0430-\u0444\u043e\u0440\u043c\u0430\u0442\u044b, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u043f\u0435\u0440\u0435\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u0438 \u0442.\u0434. <\/li>\n<li>getSample: \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u043e\u0431\u0440\u0430\u0437\u0435\u0446 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f; \u044d\u0442\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u201chello world\u201d <\/li>\n<\/ul>\n<p>  \u0411\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430 \u0437\u0434\u0435\u0441\u044c \u043a\u0440\u0430\u0439\u043d\u0435 \u043f\u0440\u044f\u043c\u043e\u043b\u0438\u043d\u0435\u0439\u043d\u0430. \u041a\u043e\u0434 \u043e\u0431\u0435\u0440\u0442\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b ImageMagick, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 nodejs, \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 JSON (\u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0435 Lambda, \u043e\u0447\u0438\u0449\u0430\u0435\u0442\u0441\u044f \u0438 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f) \u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 (\u0442.\u043d. \u201c\u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435\u201d), \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0432 \u0432\u0438\u0434\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0441\u0442\u0440\u043e\u043a. \u041e\u0434\u0438\u043d \u0438\u0437 \u0430\u0441\u043f\u0435\u043a\u0442\u043e\u0432 \u044d\u0442\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u0435\u043d, \u0435\u0441\u043b\u0438 \u0432\u044b \u0440\u0430\u043d\u0435\u0435 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0438 \u0441 ImageMagick, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e: \u043e\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u0435\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0431\u0435\u0440\u0442\u043a\u0438 \u0434\u043b\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u0430 \u0438\u043c\u0435\u043d\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0442 \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u043e\u0439. \u0423 \u043d\u0430\u0441 \u0434\u0432\u0435 \u043a\u043e\u043d\u043a\u0443\u0440\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0438: \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043a\u043b\u0438\u0435\u043d\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0435\u043c\u0430\u043d\u0442\u0438\u043a\u0443 (\u043d\u0430\u043f\u0440., \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c, PNG \u043f\u0440\u043e\u0442\u0438\u0432 JPEG), \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0430\u0432\u0442\u043e\u0440 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c, \u0433\u0434\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 \u0434\u0438\u0441\u043a\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0443\u0442\u0435\u0447\u0435\u043a \u0434\u0435\u0442\u0430\u043b\u0435\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0427\u0442\u043e\u0431\u044b \u0440\u0435\u0448\u0438\u0442\u044c \u043e\u0431\u0435 \u044d\u0442\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e, \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0434\u0432\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0432 \u0441\u0445\u0435\u043c\u0435 JSON: \u201cinputExtension\u201d \u0438 \u201coutputExtension\u201d, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430, \u0441\u043e\u0432\u043c\u0435\u0449\u0430\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0443\u044e \u0447\u0430\u0441\u0442\u044c (\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430) \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 (\u0438\u043c\u044f \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0438 \u0431\u0430\u0437\u043e\u0432\u043e\u0435 \u0438\u043c\u044f). \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c (\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c!) \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c <a href=\"https:\/\/www.amazon.com\/ap\/signin?openid.assoc_handle=aws&amp;openid.return_to=https%3A%2F%2Fsignin.aws.amazon.com%2Foauth%3Fresponse_type%3Dcode%26client_id%3Darn%253Aaws%253Aiam%253A%253A015428540659%253Auser%252Flambda%26redirect_uri%3Dhttps%253A%252F%252Fconsole.aws.amazon.com%252Flambda%252Fhome%253Fregion%253Dus-east-1%2526state%253DhashArgs%252523%25252Fcreate%25253Fbp%25253Dimage-processing-service%252526step%25253D2%2526isauthcode%253Dtrue%26noAuthCookie%3Dtrue&amp;openid.mode=checkid_setup&amp;openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&amp;openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&amp;openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&amp;action=&amp;disableCorpSignUp=&amp;clientContext=&amp;marketPlaceId=&amp;poolName=&amp;authCookies=&amp;pageId=aws.ssop&amp;siteState=unregistered%2Cru_RU&amp;accountStatusPolicy=P1&amp;sso=&amp;openid.pape.preferred_auth_policies=MultifactorPhysical&amp;openid.pape.max_auth_age=120&amp;openid.ns.pape=http%3A%2F%2Fspecs.openid.net%2Fextensions%2Fpape%2F1.0&amp;server=%2Fap%2Fsignin%3Fie%3DUTF8&amp;accountPoolAlias=&amp;forceMobileApp=0&amp;language=ru_RU&amp;forceMobileLayout=0\">\u0447\u0435\u0440\u0442\u0435\u0436\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f<\/a>.<\/p>\n<p>  \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0442\u0435\u0441\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c (\u0447\u0442\u043e \u043c\u044b \u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043d\u0438\u0436\u0435), \u043d\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0432\u043d\u043e\u0432\u044c \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043c \u0442\u043e \u0441\u0430\u043c\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0440\u043e\u0437\u044b \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430 (\u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0435\u0433\u043e \u0438\u043d\u0432\u0435\u0440\u0441\u0438\u044e \u0446\u0432\u0435\u0442\u043e\u0432). \u041c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u043e\u043c JSON \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 Lambda, \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u043e\u043b\u044f base64Image \u0442\u0435\u043c\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0432\u0430\u0448\u0435\u043c\u0443 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044e (\u044d\u0442\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u0438\u043d\u043d\u0430\u044f).  <\/p>\n<pre><code class=\"javascript\"> {   &quot;operation&quot;: &quot;convert&quot;,   &quot;customArgs&quot;: [     &quot;-negate&quot;   ],   &quot;outputExtension&quot;: &quot;png&quot;,   &quot;base64Image&quot;: &quot;...fill this in with the rose sample image, base64-encoded...&quot; } <\/code><\/pre>\n<p>  \u0412\u044b\u0432\u043e\u0434, \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u2014 \u044d\u0442\u043e \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0431\u043e\u0442\u0430\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438\u0437\u044b\u0441\u043a, \u0433\u043e\u043b\u0443\u0431\u0430\u044f \u0440\u043e\u0437\u0430:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/7c5\/4e8\/d87\/7c54e8d87fa346d09abd9e893eb60b86.png\"\/><\/p>\n<p>  \u0413\u043e\u043b\u0443\u0431\u0430\u044f \u0440\u043e\u0437\u0430 (\u043d\u0435\u0433\u0430\u0442\u0438\u0432 \u043e\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441 \u043a\u0440\u0430\u0441\u043d\u043e\u0439 \u0440\u043e\u0437\u043e\u0439)<\/p>\n<p>  \u0412\u043e\u0442 \u0438 \u0432\u0441\u0435, \u0447\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430. \u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0437\u0434\u0435\u0441\u044c \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0437\u0430\u043a\u0430\u0432\u044b\u043a\u0438, \u043c\u044b \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043e\u0442 \u00ab\u043e\u0434\u043d\u0430\u0436\u0434\u044b \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e\u00bb \u043a \u00ab\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0438 \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0441 \u043a\u0440\u0443\u0433\u043b\u043e\u0441\u0443\u0442\u043e\u0447\u043d\u044b\u043c \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u0435\u043c \u0438 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0430\u00bb. \u041d\u043e \u0432 \u044d\u0442\u043e\u043c \u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a\u0440\u0430\u0441\u043e\u0442\u0430 Lambda: \u043d\u0430\u0448 \u043a\u043e\u0434 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0443\u0436\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044b\u043c \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c, \u0433\u043e\u0442\u043e\u0432\u044b\u043c \u043a \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0435\u0433\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u2026<\/p>\n<p>  <b>\u042d\u0442\u0430\u043f 2: \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442<\/b><\/p>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u0443 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043c\u043e\u0436\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438, \u043d\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0437\u0435\u0446 \u043a\u043b\u0438\u0435\u043d\u0442\u0430, \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f Android. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0439 \u043a\u043e\u0434, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0434\u043e\u043a\u043b\u0430\u0434\u0435 \u043d\u0430 ContainerCon. \u0417\u0434\u0435\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f Android, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0435\u0435 \u0432\u0437\u044f\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438 \u0444\u0438\u043b\u044c\u0442\u0440, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0444\u0438\u043b\u044c\u0442\u0440 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043a \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044e \u0432 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u201cconvert\u201d, \u0438 \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u0442\u043e\u0433\u0435. \u0424\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0432 AWS Lambda.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u0435\u0435, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u0438\u043a\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0443 AWS Lambda:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/716\/3d3\/1c4\/7163d31c46744ccea63324972d2c2c68.jpg\"\/><\/p>\n<p>  \u042d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 Android, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u043f\u0438\u043a\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0430 AWS Lambda<\/p>\n<p>  \u041c\u044b \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u201c\u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u044b\u0439\u201d \u0444\u0438\u043b\u044c\u0442\u0440, \u0447\u0442\u043e\u0431\u044b \u0438\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0446\u0432\u0435\u0442\u0430 \u043d\u0430 \u043f\u0438\u043a\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0435:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/9ce\/82c\/cee\/9ce82cceedb64634be84300ff515ece9.jpg\"\/><\/p>\n<p>  \u0412\u044b\u0431\u043e\u0440 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u2018Negate\u2019 \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 <\/p>\n<p>  \u2026\u0438 \u0432\u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: \u0433\u043e\u043b\u0443\u0431\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u043e\u043d\u0438\u043a\u0435\u0440\u0430 Lambda (\u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043e\u043d \u0431\u044b\u043b \u043e\u0440\u0430\u043d\u0436\u0435\u0432\u044b\u043c):<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/7e6\/ba8\/a16\/7e6ba8a1633649eaab69e4d266d0976a.jpg\"\/><\/p>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u2018Negate\u2019 \u043a \u043f\u0438\u043a\u0442\u043e\u0433\u0440\u0430\u043c\u043c\u0435 AWS Lambda<\/p>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u043f\u0440\u0438\u0434\u0430\u0442\u044c \u0432\u0438\u043d\u0442\u0430\u0436\u043d\u044b\u0439 \u0432\u0438\u0434 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043f\u0430\u043d\u043e\u0440\u0430\u043c\u0435 \u0421\u0438\u044d\u0442\u043b\u0430. \u0411\u0435\u0440\u0435\u043c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0441 \u0421\u0438\u044d\u0442\u043b\u043e\u043c \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u043a \u043d\u0435\u043c\u0443 \u0444\u0438\u043b\u044c\u0442\u0440 \u0432 \u0442\u043e\u043d\u0430\u0445 \u0441\u0435\u043f\u0438\u0438: <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/8a7\/805\/1d7\/8a78051d7cc943b0bf4a250c89e95f6c.jpg\"\/><\/p>\n<p>  \u041f\u0430\u043d\u043e\u0440\u0430\u043c\u0430 \u0421\u0438\u044d\u0442\u043b\u0430 \u0432 \u0442\u043e\u043d\u0430\u0445 \u0441\u0435\u043f\u0438\u0438.<\/p>\n<p>  \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u043a\u043e\u0434\u0443. \u042f \u043d\u0435 \u0441\u0442\u0440\u0435\u043c\u043b\u044e\u0441\u044c \u0437\u0434\u0435\u0441\u044c \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u0432\u0430\u0441 \u043e\u0441\u043d\u043e\u0432\u0430\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0434 Android, \u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u0440\u0430\u0449\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 Lambda-\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0442\u043e \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0430\u0440\u0445\u0438\u0432 AWS Mobile SDK, \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u043d\u0438\u0436\u0435 \u043e\u0431\u0440\u0430\u0437\u0446\u044b \u043a\u043e\u0434\u0430). \u041a\u043e\u043d\u0446\u0435\u043f\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u043a\u043e\u0434 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0447\u0430\u0441\u0442\u0435\u0439:<\/p>\n<ol>\n<li>\u0421\u0445\u0435\u043c\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 POJO <\/li>\n<li>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 (\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438)<\/li>\n<li>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/li>\n<li>\u0412\u044b\u0437\u043e\u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/li>\n<\/ol>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u0441\u0435 \u0447\u0430\u0441\u0442\u0438 \u043f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438.<\/p>\n<p>  \u0421\u0445\u0435\u043c\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0432\u0441\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c. \u0417\u0434\u0435\u0441\u044c \u043d\u0435\u0442 \u00abLambda-\u0438\u0437\u043c\u043e\u0432\u00bb; \u0432\u0441\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 POJO (Plain Old Java Object) \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438\u043b\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432. \u041c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0431\u0430\u0437\u043e\u0432\u043e\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435, \u0430 \u0437\u0430\u0442\u0435\u043c \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c \u0435\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0440\u0430\u0437\u0438\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043d\u0430\u0448\u0435\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438. \u041c\u043e\u0436\u0435\u0442\u0435 \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u00ab\u0434\u0436\u0430\u0432\u0430\u0444\u0438\u043a\u0430\u0446\u0438\u044f\u00bb \u0442\u043e\u0433\u043e JSON, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u043f\u0440\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0432\u044b\u0448\u0435. \u0415\u0441\u043b\u0438 \u0432\u044b \u0442\u0430\u043a\u0436\u0435 \u043f\u0438\u0448\u0435\u0442\u0435 \u0441\u0435\u0440\u0432\u0435\u0440 Java, \u0442\u043e, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0431\u0443\u0434\u0435\u0442\u0435 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0444\u0430\u0439\u043b\u044b \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u0449\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0441\u043e\u0431\u044b\u0442\u0438\u0439; \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044d\u0442\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b POJO \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0432 JSON \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<\/p>\n<p>  LambdaEvent.java<\/p>\n<pre><code class=\"java\">package com.amazon.lambda.androidimageprocessor.lambda; public class LambdaEvent {     private String operation;     public String getOperation() {return operation;}     public void setOperation(String operation) {this.operation = operation;}     public LambdaEvent(String operation) {setOperation(operation);} } <\/code><\/pre>\n<p>  ImageConvertRequest.java<\/p>\n<pre><code class=\"java\">package com.amazon.lambda.androidimageprocessor.lambda; import java.util.List; public class ImageConvertRequest extends LambdaEvent {     private String base64Image;     private String inputExtension;     private String outputExtension;     private List customArgs;     public ImageConvertRequest() {super(&quot;convert&quot;);}     public String getBase64Image() {return base64Image;}     public void setBase64Image(String base64Image) {this.base64Image = base64Image;}     public String getInputExtension() {return inputExtension;}     public void setInputExtension(String inputExtension) {this.inputExtension = inputExtension;}     public String getOutputExtension() {return outputExtension;}     public void setOutputExtension(String outputExtension) {this.outputExtension = outputExtension;}     public List getCustomArgs() {return customArgs;}     public void setCustomArgs(List customArgs) {this.customArgs = customArgs;} } <\/code><\/pre>\n<p>  \u041f\u043e\u043a\u0430 \u0432\u0441\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e. \u0422\u0435\u043f\u0435\u0440\u044c, \u0438\u043c\u0435\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0439 Java. \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0432\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u201cping\u201d \u0438 \u201cconvert\u201d; \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u043a\u043e\u0434, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u043a \u043d\u0438\u043c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043d\u0438\u0436\u0435 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u044d\u0442\u043e \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f. <\/p>\n<p>  ILambdaInvoker.java<\/p>\n<pre><code class=\"java\">package com.amazon.lambda.androidimageprocessor.lambda; import com.amazonaws.mobileconnectors.lambdainvoker.LambdaFunction; import java.util.Map; public interface ILambdaInvoker {     @LambdaFunction(functionName = &quot;ImageProcessor&quot;)     String ping(Map event);     @LambdaFunction(functionName = &quot;ImageProcessor&quot;)     String convert(ImageConvertRequest request); } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0433\u043e\u0442\u043e\u0432\u044b \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0417\u0434\u0435\u0441\u044c \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0442\u0440\u0430\u0444\u0430\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043e\u0434 Android, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043a\u043e\u0434 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438, \u043d\u043e \u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0442\u043c\u0435\u0447\u0443 \u043f\u0430\u0440\u0443 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 Lambda: <\/p>\n<p>  \u042d\u0442\u043e \u0440\u0430\u0437\u0434\u0435\u043b \u201cinit\u201d; \u0437\u0434\u0435\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 Lambda API \u0438 and creates a Lambda-\u0438\u043d\u0432\u043e\u043a\u0435\u0440, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435, \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b POJO \u0432 \u043d\u0430\u0448\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"java\"> \/\/ \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 CognitoCachingCredentialsProvider         CognitoCachingCredentialsProvider cognitoProvider = new CognitoCachingCredentialsProvider(                 this.getApplicationContext(), &quot;us-east-1:&lt;YOUR COGNITO IDENITY POOL GOES HERE&gt;&quot;, Regions.US_EAST_1);          \/\/ \u0421\u043e\u0437\u0434\u0430\u0435\u043c LambdaInvokerFactory, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0441\u0440\u0435\u0434\u043d\u0438\u043a\u0430 Lambda.         LambdaInvokerFactory factory = new LambdaInvokerFactory(this.getApplicationContext(),                 Regions.US_EAST_1, cognitoProvider);          \/\/ \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442-\u043f\u043e\u0441\u0440\u0435\u0434\u043d\u0438\u043a Lambda \u0441 \u0437\u0430\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u043c \u0434\u043b\u044f \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 Json.         lambda = factory.build(ILambdaInvoker.class); <\/code><\/pre>\n<p>  \u0414\u0440\u0443\u0433\u043e\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 (\u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e) \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u2014 \u044d\u0442\u043e \u0441\u0430\u043c \u0432\u044b\u0437\u043e\u0432 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b:<\/p>\n<pre><code class=\"java\"> try {                     return lambda.convert(params[0]);                 } catch (LambdaFunctionException e) {                     Log.e(&quot;Tag&quot;, &quot;Failed to convert image&quot;);                     return null;                 } <\/code><\/pre>\n<p>  \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043e\u043d \u043d\u0435 \u0442\u0430\u043a \u0443\u0436 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u0441\u044f \u043c\u0430\u0433\u0438\u044f (\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0438 \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430) \u043f\u0440\u043e\u0442\u0435\u043a\u0430\u0435\u0442 \u043d\u0435\u044f\u0432\u043d\u043e, \u0430 \u043d\u0430\u043c \u0437\u0434\u0435\u0441\u044c \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043b\u0438\u0448\u044c \u043a\u043e\u0435-\u043a\u0430\u043a\u0443\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043e\u0448\u0438\u0431\u043e\u043a.<br \/>  \u0412\u043e\u0442 \u043f\u043e\u043b\u043d\u044b\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0444\u0430\u0439\u043b:<\/p>\n<p>  MainActivity.java<\/p>\n<pre><code class=\"java\">package com.amazon.lambda.androidimageprocessor;  import android.app.Activity; import android.app.ProgressDialog; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.AsyncTask; import android.os.Bundle; import android.util.Base64; import android.util.Log; import android.view.View; import android.widget.ImageView; import android.widget.Spinner; import android.widget.Toast;  import com.amazon.lambda.androidimageprocessor.lambda.ILambdaInvoker; import com.amazon.lambda.androidimageprocessor.lambda.ImageConvertRequest; import com.amazonaws.auth.CognitoCachingCredentialsProvider; import com.amazonaws.mobileconnectors.lambdainvoker.LambdaFunctionException; import com.amazonaws.mobileconnectors.lambdainvoker.LambdaInvokerFactory; import com.amazonaws.regions.Regions;  import java.io.ByteArrayOutputStream; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects;  public class MainActivity extends Activity {      private ILambdaInvoker lambda;     private ImageView selectedImage;     private String selectedImageBase64;     private ProgressDialog progressDialog;      @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_main);          \/\/ \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 CognitoCachingCredentialsProvider         CognitoCachingCredentialsProvider cognitoProvider = new CognitoCachingCredentialsProvider(                 this.getApplicationContext(), &quot;us-east-1:2a40105a-b330-43cf-8d4e-b647d492e76e&quot;, Regions.US_EAST_1);          \/\/ \u0421\u043e\u0437\u0434\u0430\u0435\u043c LambdaInvokerFactory, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0438\u043d\u0441\u0442\u0430\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0441\u0440\u0435\u0434\u043d\u0438\u043a\u0430 Lambda.         LambdaInvokerFactory factory = new LambdaInvokerFactory(this.getApplicationContext(),                 Regions.US_EAST_1, cognitoProvider);          \/\/ \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043a\u0442-\u043f\u043e\u0441\u0440\u0435\u0434\u043d\u0438\u043a Lambda \u0441 \u0437\u0430\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u043c \u0434\u043b\u044f \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 Json.         lambda = factory.build(ILambdaInvoker.class);          \/\/ \u043f\u0438\u043d\u0433\u0443\u0435\u043c lambda-\u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0447\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442          pingLambda();     }      \/\/ \u043f\u0438\u043d\u0433\u0443\u0435\u043c lambda-\u0444\u0443\u043d\u043a\u0446\u0438\u044e     @SuppressWarnings(&quot;unchecked&quot;)     private void pingLambda() {         Map event = new HashMap();         event.put(&quot;operation&quot;, &quot;ping&quot;);          \/\/ \u0410\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u044f Lambda-\u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0441\u0435\u0442\u0435\u0432\u043e\u043c\u0443 \u0432\u044b\u0437\u043e\u0432\u0443.         \/\/ \u0423\u0431\u0435\u0436\u0434\u0430\u0435\u043c\u0441\u044f, \u0447\u0442\u043e \u0432\u044b\u0437\u043e\u0432 \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0438\u0437 \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430.         new AsyncTask&lt;Map, Void, String&gt;() {             @Override             protected String doInBackground(Map... params) {                 \/\/ \u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434 &quot;ping&quot;. \u0415\u0441\u043b\u0438 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e                 \/\/ \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 LambdaFunctionException.                 try {                     return lambda.ping(params[0]);                 } catch (LambdaFunctionException lfe) {                     Log.e(&quot;Tag&quot;, &quot;Failed to invoke ping&quot;, lfe);                     return null;                 }             }              @Override             protected void onPostExecute(String result) {                 if (result == null) {                     return;                 }                  \/\/ \u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c \u0431\u044b\u0441\u0442\u0440\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435                 Toast.makeText(MainActivity.this, &quot;Made contact with AWS lambda&quot;, Toast.LENGTH_LONG).show();             }         }.execute(event);     }      \/\/ \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0434\u043b\u044f \u043a\u043d\u043e\u043f\u043a\u0438 &quot;process image&quot;     public void processImage(View view) {         \/\/ \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u043a\u0430 \u043d\u0435 \u0432\u044b\u0431\u0440\u0430\u043d\u043e         if (selectedImageBase64 == null) {             Toast.makeText(this, &quot;Please tap one of the images above&quot;, Toast.LENGTH_LONG).show();             return;         }          \/\/ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u0444\u0438\u043b\u044c\u0442\u0440         String filter = ((Spinner) findViewById(R.id.filter_picker)).getSelectedItem().toString();         \/\/ \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441         ImageConvertRequest request = new ImageConvertRequest();         request.setBase64Image(selectedImageBase64);         request.setInputExtension(&quot;png&quot;);         request.setOutputExtension(&quot;png&quot;);          \/\/ \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430         List customArgs = new ArrayList();         request.setCustomArgs(customArgs);         switch (filter) {             case &quot;Sepia&quot;:                 customArgs.add(&quot;-sepia-tone&quot;);                 customArgs.add(&quot;65%&quot;);                 break;             case &quot;Black\/White&quot;:                 customArgs.add(&quot;-colorspace&quot;);                 customArgs.add(&quot;Gray&quot;);                 break;             case &quot;Negate&quot;:                 customArgs.add(&quot;-negate&quot;);                 break;             case &quot;Darken&quot;:                 customArgs.add(&quot;-fill&quot;);                 customArgs.add(&quot;black&quot;);                 customArgs.add(&quot;-colorize&quot;);                 customArgs.add(&quot;50%&quot;);                 break;             case &quot;Lighten&quot;:                 customArgs.add(&quot;-fill&quot;);                 customArgs.add(&quot;white&quot;);                 customArgs.add(&quot;-colorize&quot;);                 customArgs.add(&quot;50%&quot;);                 break;             default:                 return;         }          \/\/ async-\u0437\u0430\u043f\u0440\u043e\u0441 \u043a lambda-\u0444\u0443\u043d\u043a\u0446\u0438\u0438         new AsyncTask() {             @Override             protected String doInBackground(ImageConvertRequest... params) {                 try {                     return lambda.convert(params[0]);                 } catch (LambdaFunctionException e) {                     Log.e(&quot;Tag&quot;, &quot;Failed to convert image&quot;);                     return null;                 }             }              @Override             protected void onPostExecute(String result) {                 \/\/ \u0435\u0441\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435 \u0432\u0435\u0440\u043d\u0443\u043b\u0438\u0441\u044c, \u0442\u043e \u044d\u0442\u043e \u043e\u0442\u043a\u0430\u0437                 if (result == null || Objects.equals(result, &quot;&quot;)) {                     hideLoadingDialog();                     Toast.makeText(MainActivity.this, &quot;Processing failed&quot;, Toast.LENGTH_LONG).show();                     return;                 }                 \/\/ \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u0443\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 base64 \u0438 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0438\u0445 \u0432 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c                  byte[] imageData = Base64.decode(result, Base64.DEFAULT);                 selectedImage.setImageBitmap(BitmapFactory.decodeByteArray(imageData, 0, imageData.length));                 hideLoadingDialog();             }         }.execute(request);          showLoadingDialog();     }      \/*     \u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f      *\/      public void selectLambdaImage(View view) {         selectImage(R.drawable.lambda);         selectedImage = (ImageView) findViewById(R.id.static_lambda);         Toast.makeText(this, &quot;Selected image 'lambda'&quot;, Toast.LENGTH_LONG).show();     }      public void selectSeattleImage(View view) {         selectImage(R.drawable.seattle);         selectedImage = (ImageView) findViewById(R.id.static_seattle);         Toast.makeText(this, &quot;Selected image 'seattle'&quot;, Toast.LENGTH_LONG).show();     }      public void selectSquirrelImage(View view) {         selectImage(R.drawable.squirrel);         selectedImage = (ImageView) findViewById(R.id.static_squirrel);         Toast.makeText(this, &quot;Selected image 'squirrel'&quot;, Toast.LENGTH_LONG).show();     }      public void selectLinuxImage(View view) {         selectImage(R.drawable.linux);         selectedImage = (ImageView) findViewById(R.id.static_linux);         Toast.makeText(this, &quot;Selected image 'linux'&quot;, Toast.LENGTH_LONG).show();     }      \/\/ \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u2018id\u2019 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u0430, \u0437\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043a\u0430\u043a base64      private void selectImage(int id) {         Bitmap bmp = BitmapFactory.decodeResource(getResources(), id);         ByteArrayOutputStream stream = new ByteArrayOutputStream();         bmp.compress(Bitmap.CompressFormat.PNG, 100, stream);         selectedImageBase64 = Base64.encodeToString(stream.toByteArray(), Base64.DEFAULT);     }      \/\/ \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u0438\u0445 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435     public void reset(View view) {         ((ImageView) findViewById(R.id.static_lambda)).setImageDrawable(getResources().getDrawable(R.drawable.lambda, getTheme()));         ((ImageView) findViewById(R.id.static_seattle)).setImageDrawable(getResources().getDrawable(R.drawable.seattle, getTheme()));         ((ImageView) findViewById(R.id.static_squirrel)).setImageDrawable(getResources().getDrawable(R.drawable.squirrel, getTheme()));         ((ImageView) findViewById(R.id.static_linux)).setImageDrawable(getResources().getDrawable(R.drawable.linux, getTheme()));          Toast.makeText(this, &quot;Please choose from one of these images&quot;, Toast.LENGTH_LONG).show();     }      private void showLoadingDialog() {         progressDialog = ProgressDialog.show(this, &quot;Please wait...&quot;, &quot;Processing image&quot;, true, false);     }      private void hideLoadingDialog() {         progressDialog.dismiss();     } } <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0438 \u0432\u0441\u0435 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041e\u043d\u043e \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 (\u043a\u043b\u0430\u0441\u0441 Java), \u043c\u043e\u0434\u0435\u043b\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f (\u043f\u0430\u0440\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u0432), \u0442\u0440\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0441\u044f\u043a\u0438\u0445 \u0432\u0435\u0449\u0435\u0439, \u0430 \u0437\u0430\u0442\u0435\u043c \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432, \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0439 \u0432 \u0431\u043b\u043e\u043a try\/catch\u2026\u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e.<\/p>\n<p>  <b>\u0420\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0440\u0435\u0433\u0438\u043e\u043d\u0430\u0445<\/b><\/p>\n<p>  \u0414\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043c\u044b \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u043d\u0430 \u0442\u043e\u043c, \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434. Lambda \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0442\u043e\u0433\u043e \u0438\u043b\u0438 \u0438\u043d\u043e\u0433\u043e \u0440\u0435\u0433\u0438\u043e\u043d\u0430, \u043d\u043e \u0432\u0430\u043c \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0440\u0435\u0448\u0438\u0442\u044c, \u0432 \u043a\u0430\u043a\u0438\u0445 \u0435\u0449\u0435 \u0440\u0435\u0433\u0438\u043e\u043d\u0430\u0445 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u0412 \u043c\u043e\u0435\u0439 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0434\u0435\u043c\u043e-\u0432\u0435\u0440\u0441\u0438\u0438 \u044f \u043f\u0438\u0441\u0430\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430 \u0432\u043e\u0441\u0442\u043e\u043a\u0435 \u0421\u0428\u0410 \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u044d\u0442\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u0434\u0430\u0442\u0430\u0446\u0435\u043d\u0442\u0440\u0443 \u0432 \u0448\u0442\u0430\u0442\u0435 \u0412\u0438\u0440\u0433\u0438\u043d\u0438\u044f. \u0412\u044b\u0448\u0435 \u044f \u043f\u0438\u0441\u0430\u043b, \u0447\u0442\u043e \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u043c \u0437\u043e\u043d\u0443 \u0435\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043d\u0430 \u0437\u0430\u043f\u0430\u0434 \u0415\u0432\u0440\u043e\u043f\u044b (\u0418\u0440\u043b\u0430\u043d\u0434\u0438\u044f) \u0438 \u0442\u0438\u0445\u043e\u043e\u043a\u0435\u0430\u043d\u0441\u043a\u0438\u0439 \u0440\u0435\u0433\u0438\u043e\u043d (\u0422\u043e\u043a\u0438\u043e), \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0437 \u044d\u0442\u0438\u0445 \u0440\u0435\u0433\u0438\u043e\u043d\u043e\u0432 \u043c\u043e\u0433\u043b\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0443 \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u043e\u0439:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/77a\/9c2\/869\/77a9c2869e0a47b7aed01f659aa2545f.png\"\/><\/p>\n<p>  \u0411\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f Lambda-\u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 \u0434\u0432\u0443\u0445 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u0433\u0438\u043e\u043d\u0430\u0445<\/p>\n<p>  <b>\u0411\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0435 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0447\u0430\u0441\u0442\u044c 1: \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 API <\/b><\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u0441\u043b\u0443\u0436\u0430\u0449\u0438\u0439 \u0435\u0433\u043e \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0431\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0442\u0435\u0445 \u0442\u043e\u0432\u0430\u0440\u0438\u0449\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435, \u0430 \u043d\u0435 \u043d\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0435. \u041c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u0432 \u0434\u0432\u0430 \u044d\u0442\u0430\u043f\u0430. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 API \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u0417\u0430\u0442\u0435\u043c, \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0430\u043c \u0441\u0430\u0439\u0442, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c Amazon S3.<\/p>\n<p>  AWS Lambda \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0437\u0434\u0435\u0441\u044c \u0443\u0436\u0435 \u00ab\u0432\u0441\u0442\u0440\u043e\u0435\u043d\u00bb. \u041e\u0434\u043d\u0430\u043a\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u044b \u043a\u043b\u0438\u0435\u043d\u0442\u044b (\u0442\u0430\u043a\u0438\u0435, \u043a\u0430\u043a \u0442\u043e\u0442 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435), \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0443\u0447\u0435\u0442\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u043c\u0438 AWS. \u042d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u0440\u0435\u0448\u0430\u0435\u0442 \u043a\u043b\u0438\u0435\u043d\u0442 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 <a href=\"https:\/\/aws.amazon.com\/ru\/cognito\/\"> Amazon Cognito<\/a>, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0439 \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 Android, \u043d\u043e \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0431\u044b \u043c\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043e\u0431\u0449\u0438\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0443 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0447\u0435\u0440\u0435\u0437 \u0432\u0435\u0431-\u0441\u0430\u0439\u0442? <\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u043e\u0431\u0440\u0430\u0442\u0438\u043c\u0441\u044f \u043a \u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0443, <a href=\"https:\/\/aws.amazon.com\/ru\/api-gateway\/\">Amazon API Gateway<\/a>. \u042d\u0442\u043e\u0442 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c API, \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044f \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u2013 API \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f AWS. \u041c\u044b \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u043c \u0448\u043b\u044e\u0437 API \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 URL, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0443 \u0441\u0432\u043e\u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043b\u044e\u0431\u043e\u043c\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0421\u0435\u0442\u0438. \u0412 Amazon API Gateway \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043e\u043c \u043a \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c API: \u0432\u044b\u0437\u043e\u0432\u044b API \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0443\u0447\u0435\u0442\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 AWS, \u043b\u0438\u0431\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0440\u043a\u0435\u0440\u044b OAuth \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u043c\u0430\u0440\u043a\u0435\u0440\u043e\u0432 \u043d\u0430 \u0432\u0435\u0440\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u044e\u0447\u0438 API (\u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u043d\u0443\u0436\u0435\u043d \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u044b\u0439 \u0434\u043e\u0441\u0442\u0443\u043f) \u0438\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c API \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0431\u0449\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0437\u0434\u0435\u0441\u044c.<\/p>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 API Gateway \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u0440\u0430\u043c\u043a\u0438 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u044b (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u0430\u0449\u0438\u0442\u0430 \u043e\u0442 DDOS-\u0430\u0442\u0430\u043a), \u0430 \u0434\u0440\u0443\u0433\u0438\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0438 \u0438 \u0437\u0430\u0442\u0440\u0430\u0442\u044b \u043d\u0430 \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e\u0435 \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0432 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043a\u043e\u0441\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c\u0438 \u0438 (\u043c\u0438\u043a\u0440\u043e)\u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438, API Gateway \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c \u0438\u0445 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0439 \u0438 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 (staging). \u041f\u043e\u043a\u0430 \u0436\u0435 \u043c\u044b \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u043c\u0441\u044f \u043d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438: \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0438\u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 API.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0430\u0448 API. \u0412 AWS Console \u043d\u0430\u0436\u043c\u0438\u0442\u0435 API Gateway, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u201cNew API\u201d, \u0437\u0430\u0434\u0430\u0439\u0442\u0435 \u0438\u043c\u044f \u0434\u043b\u044f API, \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435. \u042f \u0432\u044b\u0431\u0440\u0430\u043b \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u201cImageAPI\u201d.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/8aa\/5f9\/bc0\/8aa5f9bc07324ee8a5329fbe1104c627.png\"\/><\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0440\u0435\u0441\u0443\u0440\u0441 \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e API (\u044f \u043d\u0430\u0437\u0432\u0430\u043b \u0435\u0433\u043e \u201cImageProcessingService\u201d), \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0441\u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0432 \u043d\u0435\u043c \u043c\u0435\u0442\u043e\u0434 POST. \u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u201cLambda function\u201d \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0442\u0438\u043f\u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0438 \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0438\u043c\u044f Lambda-\u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u0412 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u201cMethod Request\u201d \u0437\u0430\u0434\u0430\u0439\u0442\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0442\u0438\u043f\u0430 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u201cnone\u201d (\u0442\u043e \u0435\u0441\u0442\u044c, \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0449\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430). \u0412\u043e\u0442 \u0438 \u0432\u0441\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/19f\/d6d\/180\/19fd6d180ff6404d8da8894a13cf65c6.png\"\/><\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e, \u043d\u0430\u0436\u043c\u0438\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 \u201cTest\u201d:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/e54\/6df\/128\/e546df128ca642b69600995d895ef4e2.png\"\/><\/p>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0443\u043a\u0430\u0436\u0438\u0442\u0435 \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 {\u201coperation\u201d: \u201cping\u201d}. \u0412\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u201cpong\u201d, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439, \u0447\u0442\u043e \u0432\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u043b\u0438 \u0432\u0430\u0448 API \u0441 Lambda-\u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439.<\/p>\n<p>  \u0420\u0435\u043c\u0430\u0440\u043a\u0430: \u043d\u0438\u0436\u0435 \u043c\u044b \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u043d\u043e\u0435 (\u0438 \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0435) \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043d\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u044f \u043d\u0430\u0445\u043e\u0436\u0443 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u043c\u043e\u0439 API \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u043c\u0435\u0442\u043e\u0434 GET, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0432\u044f\u0437\u0430\u043d \u0441 \u043a\u0430\u043a\u043e\u0439-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0435\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, ping. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u044f \u043c\u043e\u0433\u0443 \u0431\u044b\u0441\u0442\u0440\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0438\u0437 \u043b\u044e\u0431\u043e\u0433\u043e \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430, \u0447\u0442\u043e \u043c\u043e\u0439 API \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u043d \u0441 Lambda-\u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439. \u0412 \u043d\u0430\u0448\u0435\u043c \u0434\u0435\u043c\u043e-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 (\u0438 \u0432\u043e\u043e\u0431\u0449\u0435) \u044d\u0442\u043e \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c, \u043d\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u0438\u0435\u043c \u0432\u0430\u043c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u0430\u043b\u044c\u0448\u0435 (\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 S3) \u043d\u0430\u043c \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c CORS. \u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e, \u043d\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u0442\u0430\u043f\u043e\u0432. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 API Gateway \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0443\u043f\u0440\u043e\u0449\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c \u0437\u0434\u0435\u0441\u044c \u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 (\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u0441\u043a\u043e\u0440\u0435 \u0443\u0441\u0442\u0430\u0440\u0435\u0442\u044c), \u043e\u0442\u0441\u044b\u043b\u0430\u044e \u0432\u0430\u0441 \u043a <a href=\"http:\/\/docs.aws.amazon.com\/apigateway\/latest\/developerguide\/how-to-cors.html\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>.<\/p>\n<p>  \u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 \u201cDeploy this API\u201d. \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u043e \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u0430\u0439\u0442\u0430!<\/p>\n<p>  <b>\u0411\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0435 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0447\u0430\u0441\u0442\u044c 2: \u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0441\u0430\u0439\u0442\u0430 \u043d\u0430 Amazon S3<\/b><\/p>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e: \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 Javascript-\u043a\u043e\u0434 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u0430 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 S3, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0430\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f:<\/p>\n<pre><code class=\"java\">var ENDPOINT = 'https:\/\/fuexvelc41.execute-api.us-east-1.amazonaws.com\/prod\/ImageProcessingService';  angular.module('app', ['ui.bootstrap'])      .controller('MainController', ['$scope', '$http', function($scope, $http) {         $scope.loading = false;         $scope.image = {             width: 100         };          $scope.ready = function() {             $scope.loading = false;         };          $scope.submit = function() {             var fileCtrl = document.getElementById('image-file');             if (fileCtrl.files && fileCtrl.files[0]) {                 $scope.loading = true;                 var fr = new FileReader();                 fr.onload = function(e) {                     $scope.image.base64Image = e.target.result.slice(e.target.result.indexOf(',') + 1);                     $scope.$apply();                     document.getElementById('original-image').src = e.target.result;                     \/\/ \u0422\u0435\u043f\u0435\u0440\u044c \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440!                     $http.post(ENDPOINT, angular.extend($scope.image, { operation: 'resize', outputExtension: fileCtrl.value.split('.').pop() }))                         .then(function(response) {                             document.getElementById('processed-image').src = &quot;data:image\/png;base64,&quot; + response.data;                         })                         .catch(console.log)                         .finally($scope.ready);                 };                 fr.readAsDataURL(fileCtrl.files[0]);             }         };     }]); <\/code><\/pre>\n<p>  \u0410 \u0432\u043e\u0442 HTML-\u043a\u043e\u0434 \u043d\u0430\u0448\u0435\u0433\u043e (\u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e) \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430:<\/p>\n<pre><code class=\"javascript\">&lt;!DOCTYPE html&gt; &lt;html lang=&quot;en&quot;&gt; &lt;head&gt;     &lt;title&gt;Image Processing Service&lt;\/title&gt;     &lt;meta charset=&quot;utf-8&quot;&gt;     &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt;     &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;     &lt;link rel=&quot;stylesheet&quot; type=&quot;text\/css&quot; href=&quot;https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/twitter-bootstrap\/3.3.4\/css\/bootstrap.min.css&quot;&gt;     &lt;link rel=&quot;stylesheet&quot; type=&quot;text\/css&quot; href=&quot;http:\/\/fonts.googleapis.com\/css?family=Open+Sans:400,700&quot;&gt;     &lt;link rel=&quot;stylesheet&quot; type=&quot;text\/css&quot; href=&quot;main.css&quot;&gt; &lt;\/head&gt; &lt;body ng-app=&quot;app&quot; ng-controller=&quot;MainController&quot;&gt;     &lt;div class=&quot;container&quot;&gt;         &lt;h1&gt;Image Processing Service&lt;\/h1&gt;         &lt;div class=&quot;row&quot;&gt;             &lt;div class=&quot;col-md-4&quot;&gt;                 &lt;form ng-submit=&quot;submit()&quot;&gt;                     &lt;div class=&quot;form-group&quot;&gt;                         &lt;label for=&quot;image-file&quot;&gt;Image&lt;\/label&gt;                         &lt;input id=&quot;image-file&quot; type=&quot;file&quot;&gt;                     &lt;\/div&gt;                     &lt;div class=&quot;form-group&quot;&gt;                         &lt;label for=&quot;image-width&quot;&gt;Width&lt;\/label&gt;                         &lt;input id=&quot;image-width&quot; class=&quot;form-control&quot; type=&quot;number&quot;                                ng-model=&quot;image.width&quot; min=&quot;1&quot; max=&quot;4096&quot;&gt;                     &lt;\/div&gt;                     &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary&quot;&gt;                         &lt;span class=&quot;glyphicon glyphicon-refresh&quot; ng-if=&quot;loading&quot;&gt;&lt;\/span&gt;                         Submit                     &lt;\/button&gt;                 &lt;\/form&gt;             &lt;\/div&gt;             &lt;div class=&quot;col-md-8&quot;&gt;                 &lt;accordion close-others=&quot;false&quot;&gt;                     &lt;accordion-group heading=&quot;Original Image&quot; is-open=&quot;true&quot;&gt;                         &lt;img id=&quot;original-image&quot; class=&quot;img-responsive&quot;&gt;                     &lt;\/accordion-group&gt;                     &lt;accordion-group heading=&quot;Processed Image&quot; is-open=&quot;true&quot;&gt;                         &lt;img id=&quot;processed-image&quot; class=&quot;img-responsive&quot;&gt;                     &lt;\/accordion-group&gt;                 &lt;\/accordion&gt;             &lt;\/div&gt;         &lt;\/div&gt;     &lt;\/div&gt;     &lt;script type=&quot;text\/javascript&quot; src=&quot;https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/angular.js\/1.3.15\/angular.min.js&quot;&gt;&lt;\/script&gt;     &lt;script type=&quot;text\/javascript&quot; src=&quot;https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/angular-ui-bootstrap\/0.13.3\/ui-bootstrap.min.js&quot;&gt;&lt;\/script&gt;     &lt;script type=&quot;text\/javascript&quot; src=&quot;https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/angular-ui-bootstrap\/0.13.3\/ui-bootstrap-tpls.min.js&quot;&gt;&lt;\/script&gt;     &lt;script type=&quot;text\/javascript&quot; src=&quot;main.js&quot;&gt;&lt;\/script&gt; &lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>  \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0432\u043e\u0442 CSS:<\/p>\n<pre><code class=\"css\">body {     font-family: 'Open Sans', sans-serif;     padding-bottom: 15px; }  a {     cursor: pointer; }  \/** LOADER **\/  .glyphicon-refresh {     -animation: spin .7s infinite linear;     -webkit-animation: spin .7s infinite linear; }  @keyframes spin {     from { transform: rotate(0deg); }     to { transform: rotate(360deg); } }  @-webkit-keyframes spin {     from { -webkit-transform: rotate(0deg); }     to { -webkit-transform: rotate(360deg); } } <\/code><\/pre>\n<p>  \u2026\u0434\u0430\u043b\u0435\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u043d\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u043e\u043c \u0432 S3:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/56c\/b5a\/597\/56cb5a59729441ac9caf93b97e3cee9c.png\"\/><\/p>\n<p>  URL \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u0440\u0435\u0433\u0438\u043e\u043d\u0430 S3 \u0438 \u0438\u043c\u0435\u043d \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043d\u0430\u043f\u0440., \u201chttp:\/\/image-processing-service.s3-website-us-east-1.amazonaws.com\/\u201d. \u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 URL \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u2014 \u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u044c\u0441\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0441 \u0432\u0430\u0448\u0438\u043c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/f52\/d13\/0af\/f52d130af16a4013b36860dcc68e3846.png\"\/><\/p>\n<p>  <b>\u041c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0435 \u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/b><\/p>\n<p>  API Gateway \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 Lambda-\u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u0443 \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e URL. \u0412 \u0432\u0430\u0448\u0435\u043c \u0440\u0430\u0441\u043f\u043e\u0440\u044f\u0436\u0435\u043d\u0438\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u041d\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0435\u0437 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b, \u043d\u043e \u0434\u0430\u0436\u0435 \u0431\u0435\u0437 \u043a\u043b\u0438\u0435\u043d\u0442\u0430! <br \/>  \u0418\u0442\u0430\u043a, \u043f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043d\u0430\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u044b\u0437\u043e\u0432\u044b \u0447\u0435\u0440\u0435\u0437 API. \u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e: \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u00ab\u0447\u0435\u0440\u0442\u0435\u0436 HTTPS-\u0432\u044b\u0437\u043e\u0432\u0430\u00bb Lambda, \u0447\u0442\u043e\u0431\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u043c POST \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c \u0442\u0443 \u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043f\u0440\u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0438 API Gateway:<\/p>\n<pre><code class=\"javascript\">{   &quot;options&quot;: {     &quot;host&quot;: &quot;fuexvelc41.execute-api.us-east-1.amazonaws.com&quot;,     &quot;path&quot;: &quot;\/prod\/ImageProcessingService&quot;,     &quot;method&quot;: &quot;POST&quot;   },   &quot;data&quot;: {     &quot;operation&quot;: &quot;getSample&quot;   } } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u0431\u0435\u0440\u043d\u0435\u043c \u0432\u0441\u0435 \u044d\u0442\u043e \u0432 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u0441\u0442. \u041d\u0430\u0448 \u0442\u0435\u0441\u0442 \u0434\u0435\u043b\u0430\u0435\u0442 \u043d\u0435 \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u044b: \u043e\u043d \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 Lambda-\u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u043d\u0430\u043c\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 Amazon DynamoDB. \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0439 \u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u044b\u0439 \u0442\u0435\u0441\u0442 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0447\u0435\u0440\u0442\u0435\u0436\u0430 Lambda, \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u00ab\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\u00bb:<\/p>\n<pre><code class=\"javascript\">{   &quot;operation&quot;: &quot;unit&quot;,   &quot;function&quot;: &quot;HTTPSInvoker&quot;,   &quot;resultsTable&quot;: &quot;unit-test-results&quot;,   &quot;testId&quot;: &quot;LinuxConDemo&quot;,   &quot;event&quot;: {     &quot;options&quot;: {       &quot;host&quot;: &quot;fuexvelc41.execute-api.us-east-1.amazonaws.com&quot;,       &quot;path&quot;: &quot;\/prod\/ImageProcessingService&quot;,       &quot;method&quot;: &quot;POST&quot;     },     &quot;data&quot;: {       &quot;operation&quot;: &quot;getSample&quot;     }   } } <\/code><\/pre>\n<p>  \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u044b\u0439 \u0442\u0435\u0441\u0442, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043f\u0440\u043e\u0433\u043e\u043d\u0438\u043c \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u0441\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u043d\u043e\u0432\u044c \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u043c \u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u044b\u043c \u0442\u0435\u0441\u0442\u043e\u043c \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0447\u0435\u0440\u0442\u0435\u0436\u0430 Lambda, \u043d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u00ab\u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\u00bb:<\/p>\n<pre><code class=\"javascript\">{   &quot;operation&quot;: &quot;load&quot;,   &quot;iterations&quot;: 100,   &quot;function&quot;: &quot;TestHarness&quot;,   &quot;event&quot;: {     &quot;operation&quot;: &quot;unit&quot;,     &quot;function&quot;: &quot;HTTPSInvoker&quot;,     &quot;resultsTable&quot;: &quot;unit-test-results&quot;,     &quot;testId&quot;: &quot;LinuxConLoadTestDemo&quot;,     &quot;event&quot;: {       &quot;options&quot;: {         &quot;host&quot;: &quot;fuexvelc41.execute-api.us-east-1.amazonaws.com&quot;,         &quot;path&quot;: &quot;\/prod\/ImageProcessingService&quot;,         &quot;method&quot;: &quot;POST&quot;       },       &quot;data&quot;: {         &quot;operation&quot;: &quot;getSample&quot;       }     }   } } <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0441\u0445\u0435\u043c\u0430 \u043d\u0430\u0448\u0435\u0439 \u0431\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/432\/405\/ece\/432405ece280445a803933ad2e003ab6.png\"\/><\/p>\n<p>  \u0411\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u043b\u044f \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0433\u043e \u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/p>\n<p>  \u041e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u0430\u0440\u044c\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u043a \u043d\u0435\u043c\u0443 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e, \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b \u0438 \u0442.\u0434. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u0430 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 API Gateway \u0438 \u0432\u044b\u0437\u043e\u0432 HTTP, \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u0441\u0435\u0440\u0432\u0438\u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043f\u0440\u044f\u043c\u043e \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0430. \u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043e\u0431\u043e\u0431\u0449\u0438\u0442\u044c \u0438 \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0432\u044b\u0432\u043e\u0434, \u0442\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u043b\u044f\u043c\u0431\u0434\u0430-\u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0435 DynamoDB, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0442\u0435\u0441\u0442\u0430.<\/p>\n<p>  <b>\u0420\u0435\u0437\u044e\u043c\u0435<\/b><\/p>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u0434\u043b\u0438\u043d\u043d\u044b\u0439 \u043f\u043e\u0441\u0442, \u043d\u043e \u0432 \u043d\u0435\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432\u0441\u0435, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445. \u042d\u0442\u043e\u0442 \u0441\u0435\u0440\u0432\u0438\u0441 \u043c\u043e\u0436\u0435\u0442 \u00ab\u0441\u043f\u0435\u0440\u0435\u0434\u0438\u00bb \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u043a \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c, \u0442\u0430\u043a \u0438 \u043a \u0441\u0430\u0439\u0442\u0443, \u043f\u0440\u0438\u0447\u0435\u043c \u043d\u0438 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043d\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432, \u043d\u0438 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0438\u043d\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b: \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430, \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430, API, \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0414\u0430 \u0437\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u044e\u0442 \u0431\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f!       <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/266703\/\"> http:\/\/habrahabr.ru\/post\/266703\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u0417\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0439\u0442\u0435, \u0434\u043e\u0440\u043e\u0433\u0438\u0435 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438!<\/p>\n<p>  \u041a\u0430\u043a \u043f\u043e\u043c\u043d\u044f\u0442 \u0441\u0430\u043c\u044b\u0435 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438\u0437 \u0432\u0430\u0441, \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u043d\u0430\u0434 \u0438\u043d\u043d\u043e\u0432\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u043a\u043d\u0438\u0433\u043e\u0439 \u043e <a href=\"http:\/\/habrahabr.ru\/company\/piter\/blog\/255029\/\">\u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u0430\u0445<\/a>, \u043d\u043e \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0438\u0448\u0443\u0442 \u0432 \u0421\u0435\u0442\u0438 \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0441\u043c\u043e\u0433\u043b\u0438 \u043f\u0440\u043e\u0439\u0442\u0438 \u043c\u0438\u043c\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0435\u0439\u0448\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0438\u0437 \u0431\u043b\u043e\u0433\u0430 Amazon, \u0430\u0432\u0442\u043e\u0440 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0422\u0438\u043c \u0412\u0430\u0433\u043d\u0435\u0440 \u0434\u0435\u043b\u0438\u0442\u0441\u044f \u0441\u0432\u043e\u0438\u043c\u0438 \u0432\u0437\u0433\u043b\u044f\u0434\u0430\u043c\u0438 \u043d\u0430 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043d\u0443\u044e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443.<\/p>\n<p>  \u041c\u043d\u043e\u0433\u043e Java, JavaScript, \u0441\u0445\u0435\u043c, \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0439 \u0438 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-265466","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/265466","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=265466"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/265466\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=265466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=265466"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=265466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}