{"id":304899,"date":"2020-06-05T15:00:52","date_gmt":"2020-06-05T15:00:52","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=304899"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2020-06-05T15:00:52","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=304899","title":{"rendered":"\u0423\u043f\u0440\u043e\u0449\u0430\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 Check Point API \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Python SDK"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/505510\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/xf\/kx\/d6\/xfkxd68ynnabb65k6ygvksmoyzw.png\" alt=\"image\"\/>\u0412\u0441\u044f \u043c\u043e\u0449\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 API \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c API \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 API \u043e\u0442\u0432\u0435\u0442\u043e\u0432. \u041e\u0434\u043d\u0430\u043a\u043e, \u043c\u0430\u043b\u043e\u0437\u0430\u043c\u0435\u0442\u043d\u044b\u043c \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f <b>Python Software Development Kit<\/b> (\u0434\u0430\u043b\u0435\u0435 \u2014 Python SDK) \u0434\u043b\u044f <b>Check Point Management API<\/b>, \u0430 \u0437\u0440\u044f. \u041e\u043d \u043e\u0449\u0443\u0442\u0438\u043c\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0436\u0438\u0437\u043d\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0438 \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044f\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438. Python \u043f\u0440\u0438\u043e\u0431\u0440\u0451\u043b \u043e\u0433\u0440\u043e\u043c\u043d\u0443\u044e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0438 \u044f \u0440\u0435\u0448\u0438\u043b \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u0435\u043b \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0431\u0437\u043e\u0440 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u043d\u043e\u0441\u0442\u0435\u0439 <a href=\"https:\/\/github.com\/CheckPointSW\/cp_mgmt_api_python_sdk\">Check Point API Python Development Kit<\/a>. \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0441\u043b\u0443\u0436\u0438\u0442 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 <a href=\"https:\/\/habr.com\/ru\/company\/tssolution\/blog\/339924\/\">Check Point R80.10 API. \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 CLI, \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e<\/a>. \u041c\u044b \u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Python SDK \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043d\u0430 \u043d\u043e\u0432\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0435 Management API \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 1.6(\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 R80.40). \u0414\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 API \u0438 Python.<br \/>  <a name=\"habracut\"><\/a><br \/>  Check Point \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442 API \u0438 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430 \u0441\u0432\u0435\u0442 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c:<\/p>\n<ul>\n<li><a href=\"https:\/\/sc1.checkpoint.com\/documents\/latest\/APIs\/#introduction~v1.6\">Check Point Management API (\u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f 1.6)<\/a> \u2014 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 API(\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043d\u0430 \u0448\u043b\u044e\u0437\u0430\u0445 \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f) <\/li>\n<li><a href=\"https:\/\/sc1.checkpoint.com\/documents\/latest\/GaiaAPIs\/#introduction~v1.4\">Check Point GAIA API (\u0442\u0435\u043a\u0443\u0449\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f 1.4)<\/a> \u2014 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441\u043e \u0448\u043b\u044e\u0437\u0430\u043c\u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 <\/li>\n<li><a href=\"https:\/\/sc1.checkpoint.com\/documents\/TPAPI\/CP_1.0_ThreatPreventionAPI_APIRefGuide\/html_frameset.htm\">Threat Prevention API 1.0 <\/a> \u2014 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0435\u0439 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435 Check Point <\/li>\n<li><a href=\"https:\/\/sc1.checkpoint.com\/documents\/latest\/IdentityAPIs\/\">Identity Awareness API <\/a> \u2014 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 Identity Awareness blade \u043d\u0430 \u0448\u043b\u044e\u0437\u0430\u0445 <\/li>\n<li><a href=\"https:\/\/sc1.checkpoint.com\/documents\/latest\/SmpAPIs\/#introduction~v1\">Security Management Portal API <\/a> \u2014 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u043f\u043e\u0440\u0442\u0430\u043b\u043e\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f SMB \u0448\u043b\u044e\u0437\u0430\u043c\u0438 (<a href=\"https:\/\/habr.com\/ru\/company\/tssolution\/blog\/336298\/\">\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e SMB \u0448\u043b\u044e\u0437\u044b<\/a>) <\/li>\n<li><a href=\"https:\/\/sc1.checkpoint.com\/documents\/latest\/IoTAPI\/#introduction~v1.6\">IoT API<\/a> \u2014 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 c IoT \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u043c\u0438 <\/li>\n<li><a href=\"https:\/\/app.swaggerhub.com\/apis-docs\/Check-Point\/cloudguard-connect-api\/1.0.0\">CloudGuard Connect API<\/a> \u2014 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 <a href=\"https:\/\/www.checkpoint.com\/ru\/products\/branch-cloud-security\/\">CloudGuard Connect<\/a> (\u0440\u0435\u0448\u0435\u043d\u0438\u0435 SD-WAN security) <\/li>\n<li><a href=\"https:\/\/api-v2-docs.dome9.com\/\">Dome9 API<\/a> \u2014 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 <a href=\"https:\/\/www.checkpoint.com\/products\/cloud-security-orchestration\/\">Dome9<\/a> <\/li>\n<\/ul>\n<p>  Python SDK \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 Management API \u0438 <b>Gaia API<\/b>. \u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0430\u043c\u044b\u0435 \u0432\u0430\u0436\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b, \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/7v\/vt\/1x\/7vvt1xvikrzesgwntw5mrx8tqlu.jpeg\" alt=\"image\"\/><\/p>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043c\u043e\u0434\u0443\u043b\u044f<\/h2>\n<p>  \u041c\u043e\u0434\u0443\u043b\u044c <b>cpapi<\/b> \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0437 <a href=\"https:\/\/github.com\/CheckPointSW\/cp_mgmt_api_python_sdk\/\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u0430\u0440\u0438\u044f Check Point \u043d\u0430 github<\/a> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <b>pip<\/b>. \u041f\u043e\u0434\u0431\u0440\u043e\u0431\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u0435\u0441\u0442\u044c \u0432 <a href=\"https:\/\/github.com\/CheckPointSW\/cp_mgmt_api_python_sdk\/blob\/master\/README.md\">README.md<\/a>. \u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 Python 2.7 \u0438 3.7. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Python 3.7. \u041e\u0434\u043d\u0430\u043a\u043e, Python SDK \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u044f\u043c\u043e \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f Check Point (Smart Management), \u043d\u043e \u043d\u0430 \u043d\u0438\u0445 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0440\u0441\u0438\u044f Python 2.7, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d \u043a\u043e\u0434 \u0434\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0438 2.7. \u0421\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f\u0445 <b>examples_python2<\/b> \u0438 <b>examples_python3<\/b>.<\/p>\n<h2>\u041d\u0430\u0447\u0430\u043b\u043e \u0440\u0430\u0431\u043e\u0442\u044b<\/h2>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0443 \u043d\u0430\u0441 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f cpapi \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u044f <b>cpapi<\/b> \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0434\u0432\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u0430: <\/p>\n<p>  <b>APIClient<\/b> \u0438 <b>APIClientArgs<\/b><\/p>\n<pre><code class=\"python\">from cpapi import APIClient, APIClientArgs <\/code><\/pre>\n<p>  \u041a\u043b\u0430\u0441\u0441 <b>APIClientArgs<\/b> \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a API \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u0430 \u043a\u043b\u0430\u0441\u0441 <b>APIClient<\/b> \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 API.<\/p>\n<h2>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f<\/h2>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a API, \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 <b>APIClientArgs<\/b>. \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435 \u0435\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u0440\u0435\u0434\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0438 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c.<\/p>\n<pre><code class=\"python\">client_args = APIClientArgs()<\/code><\/pre>\n<p>  \u041d\u043e \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u043c \u0445\u043e\u0441\u0442\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c IP \u0430\u0434\u0440\u0435\u0441 \u0438\u043b\u0438 \u0438\u043c\u044f \u0445\u043e\u0441\u0442\u0430 API \u0441\u0435\u0440\u0432\u0435\u0440\u0430(\u043e\u043d \u0436\u0435 \u0441\u0435\u0440\u0432\u0435\u0440 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f). \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0438\u0436\u0435 \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f server \u0438 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u043c \u0435\u043c\u0443 \u0432 \u0432\u0438\u0434\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 IP \u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"python\">client_args = APIClientArgs(server='192.168.47.241')<\/code><\/pre>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0432\u0441\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438 \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043a API \u0441\u0435\u0440\u0432\u0435\u0440\u0443:<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043c\u0435\u0442\u043e\u0434\u0430 __init__ \u043a\u043b\u0430\u0441\u0441\u0430 APIClientArgs<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">class APIClientArgs:     &quot;&quot;&quot;     This class provides arguments for APIClient configuration.     All the arguments are configured with their default values.     &quot;&quot;&quot;      # port is set to None by default, but it gets replaced with 443 if not specified     # context possible values - web_api (default) or gaia_api     def __init__(self, port=None, fingerprint=None, sid=None, server=&quot;127.0.0.1&quot;, http_debug_level=0,                  api_calls=None, debug_file=&quot;&quot;, proxy_host=None, proxy_port=8080,                  api_version=None, unsafe=False, unsafe_auto_accept=False, context=&quot;web_api&quot;):         self.port = port         # management server fingerprint         self.fingerprint = fingerprint         # session-id.         self.sid = sid         # management server name or IP-address         self.server = server         # debug level         self.http_debug_level = http_debug_level         # an array with all the api calls (for debug purposes)         self.api_calls = api_calls if api_calls else []         # name of debug file. If left empty, debug data will not be saved to disk.         self.debug_file = debug_file         # HTTP proxy server address (without &quot;http:\/\/&quot;)         self.proxy_host = proxy_host         # HTTP proxy port         self.proxy_port = proxy_port         # Management server's API version         self.api_version = api_version         # Indicates that the client should not check the server's certificate         self.unsafe = unsafe         # Indicates that the client should automatically accept and save the server's certificate         self.unsafe_auto_accept = unsafe_auto_accept         # The context of using the client - defaults to web_api         self.context = context<\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u041f\u043e\u043b\u0430\u0433\u0430\u044e, \u0447\u0442\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430\u0445 \u043a\u043b\u0430\u0441\u0441\u0430 APIClientArgs, \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u044b \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430\u043c Check Point \u0438 \u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u043d\u0435 \u043d\u0443\u0436\u0434\u0430\u044e\u0442\u0441\u044f.<\/p>\n<h2>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 APIClient \u0438 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430<\/h2>\n<p>  \u041a\u043b\u0430\u0441\u0441 <b>APIClient<\/b> \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430. \u0412\u0441\u0451, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0443 \u043a\u043b\u0430\u0441\u0441\u0430 APIClient \u044d\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u043c \u0448\u0430\u0433\u0435.<\/p>\n<pre><code class=\"python\">with APIClient(client_args) as client: <\/code><\/pre>\n<p>  \u041c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043d\u0435 \u0441\u0442\u0430\u043d\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 login \u0432\u044b\u0437\u043e\u0432 \u043d\u0430 API \u0441\u0435\u0440\u0432\u0435\u0440, \u043e\u0434\u043d\u0430\u043a\u043e \u043e\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442 \u0432\u044b\u0437\u043e\u0432 logout \u043f\u0440\u0438 \u0432\u044b\u0445\u043e\u0434\u0435 \u0438\u0437 \u043d\u0435\u0433\u043e. \u0415\u0441\u043b\u0438 \u043f\u043e \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c logout \u043f\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 API \u0432\u044b\u0437\u043e\u0432\u0430\u043c\u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f, \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430:<\/p>\n<pre><code class=\"python\">client = APIClient(clieng_args)<\/code><\/pre>\n<h2>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f<\/h2>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u043b\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c \u043f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <b>check_fingerprint<\/b>. \u0415\u0441\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0445\u0435\u0448-\u0441\u0443\u043c\u043c\u044b sha1 \u0434\u043b\u044f fingerprint \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 API \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0435 \u043f\u0440\u043e\u0448\u043b\u0430(\u043c\u0435\u0442\u043e\u0434 \u0432\u0435\u0440\u043d\u0443\u043b <i>False<\/i>), \u0442\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u043e \u0432\u044b\u0437\u0432\u0430\u043d\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438 \u0441 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435\u043c \u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b(\u0438\u043b\u0438 \u0434\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f):<\/p>\n<pre><code class=\"python\">    if client.check_fingerprint() is False:         print(&quot;Could not get the server's fingerprint - Check connectivity with the server.&quot;)         exit(1) <\/code><\/pre>\n<p>  \u0423\u0447\u0442\u0438\u0442\u0435, \u0447\u0442\u043e \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043a\u043b\u0430\u0441\u0441 <b>APIClient<\/b> \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c API \u0432\u044b\u0437\u043e\u0432\u0435 (\u043c\u0435\u0442\u043e\u0434\u044b <b>api_call<\/b> \u0438 <b>api_query<\/b>, \u043e \u043d\u0438\u0445 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0451\u0442 \u0447\u0443\u0442\u044c \u0434\u0430\u043b\u044c\u0448\u0435) sha1 fingerprint \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u043d\u0430 API \u0441\u0435\u0440\u0432\u0435\u0440\u0435. \u0410 \u0432\u043e\u0442 \u0435\u0441\u043b\u0438 \u043f\u0440\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 sha1 fingerprint \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 API \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 (\u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d \u0438\u043b\u0438 \u0431\u044b\u043b \u0438\u0437\u043c\u0435\u043d\u0451\u043d), \u043c\u0435\u0442\u043e\u0434 <b>check_fingerprint<\/b> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c\/\u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043d\u0451\u043c \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 \u0432 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435. \u0414\u0430\u043d\u043d\u0443\u044e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u043e\u0432\u0441\u0435 (\u043d\u043e \u0442\u0430\u043a\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c API \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u043f\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u043a 127.0.0.1), \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 APIClientArgs \u2014 <b>unsafe_auto_accept<\/b> (\u0441\u043c. \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e APIClientArgs \u0440\u0430\u043d\u0435\u0435 \u0432 \u00ab\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u00bb).<\/p>\n<pre><code class=\"python\">client_args = APIClientArgs(unsafe_auto_accept=True)<\/code><\/pre>\n<p>  <\/p>\n<h2>Login \u043d\u0430 API \u0441\u0435\u0440\u0432\u0435\u0440<\/h2>\n<p>  \u0423 <b>APIClient<\/b> \u0435\u0441\u0442\u044c \u0446\u0435\u043b\u044b\u0445 3 \u043c\u0435\u0442\u043e\u0434\u0430 \u043b\u043e\u0433\u0438\u043d\u0430 \u043d\u0430 API \u0441\u0435\u0440\u0432\u0435\u0440, \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043d\u0438\u0445 \u0437\u0430\u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <b>sid<\/b>(session-id), \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c API \u0432\u044b\u0437\u043e\u0432\u0435 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435(\u0438\u043c\u044f \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 \u0443 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u2014 <b>X-chkp-sid<\/b>), \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440.<\/p>\n<h3>\u041c\u0435\u0442\u043e\u0434 login<\/h3>\n<p>  \u0412\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043b\u043e\u0433\u0438\u043d\u0430 \u0438 \u043f\u0430\u0440\u043e\u043b\u044f(\u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f admin \u0438 \u043f\u0430\u0440\u043e\u043b\u044c 1q2w3e \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u044b \u043a\u0430\u043a \u043f\u043e\u0437\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b):<\/p>\n<pre><code class=\"python\">     login = client.login('admin', '1q2w3e')  <\/code><\/pre>\n<p>  \u0412 \u043c\u0435\u0442\u043e\u0434\u0435 login \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043f\u0440\u0438\u0432\u043e\u0436\u0443 \u0438\u0445 \u0438\u043c\u0435\u043d\u0430 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e: <\/p>\n<pre><code class=\"python\">continue_last_session=False, domain=None, read_only=False, payload=None<\/code><\/pre>\n<p>  <\/p>\n<h3>\u041c\u0435\u0442\u043e\u0434 login_with_api_key<\/h3>\n<p>  \u0412\u0430\u0440\u0438\u0430\u043d\u0442 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c api \u043a\u043b\u044e\u0447\u0430(\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 \u043c\u0435\u043d\u0435\u0434\u0436\u043c\u0435\u043d\u0442\u0430 R80.40\/Management API v1.6, <i>\u00ab3TsbPJ8ZKjaJGvFyoFqHFA==\u00bb<\/i> \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0430 API \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 API key):<\/p>\n<pre><code class=\"python\">     login = client.login_with_api_key('3TsbPJ8ZKjaJGvFyoFqHFA==') <\/code><\/pre>\n<p>  \u0412 \u043c\u0435\u0442\u043e\u0434\u0435 <b>login_with_api_key<\/b> \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0442\u0430\u043a\u0438\u0435 \u0436\u0435 \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u0430\u043a \u0438 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 <b>login<\/b>.<\/p>\n<h3>\u041c\u0435\u0442\u043e\u0434 login_as_root<\/h3>\n<p>  \u0412\u0430\u0440\u0438\u0430\u043d\u0442 login&#8217;\u0430 \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443 \u0441 API \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c:<\/p>\n<pre><code class=\"python\">     login = client.login_as_root()<\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0430 \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430:<\/p>\n<pre><code class=\"python\">domain=None, payload=None<\/code><\/pre>\n<p>  <\/p>\n<h2>\u0418 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0441\u0430\u043c\u0438 API \u0432\u044b\u0437\u043e\u0432\u044b<\/h2>\n<p>  \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0434\u0435\u043b\u0430\u0442\u044c API \u0432\u044b\u0437\u043e\u0432\u044b \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u0442\u043e\u0434\u044b <b>api_call<\/b> \u0438 <b>api_query<\/b>. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u0432 \u0447\u0451\u043c \u043c\u0435\u0436\u0434\u0443 \u043d\u0438\u043c\u0438 \u0440\u0430\u0437\u043d\u0438\u0446\u0430.<\/p>\n<h3>api_call<\/h3>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0434\u043b\u044f \u043b\u044e\u0431\u044b\u0445 \u0432\u044b\u0437\u043e\u0432\u043e\u0432. \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0447\u0430\u0441\u0442\u044c \u0434\u043b\u044f api \u0432\u044b\u0437\u043e\u0432\u0430 \u0438 payload \u0432 \u0442\u0435\u043b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438. \u0415\u0441\u043b\u0438 payload \u043f\u0443\u0441\u0442\u043e\u0439, \u0442\u043e \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u043e\u0432\u0441\u0435:<\/p>\n<pre><code class=\"python\">api_versions = client.api_call('show-api-versions') <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0412\u044b\u0432\u043e\u0434 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c:<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">In [23]: api_versions                                                            Out[23]:  APIResponse({     &quot;data&quot;: {         &quot;current-version&quot;: &quot;1.6&quot;,         &quot;supported-versions&quot;: [             &quot;1&quot;,             &quot;1.1&quot;,             &quot;1.2&quot;,             &quot;1.3&quot;,             &quot;1.4&quot;,             &quot;1.5&quot;,             &quot;1.6&quot;         ]     },     &quot;res_obj&quot;: {         &quot;data&quot;: {             &quot;current-version&quot;: &quot;1.6&quot;,             &quot;supported-versions&quot;: [                 &quot;1&quot;,                 &quot;1.1&quot;,                 &quot;1.2&quot;,                 &quot;1.3&quot;,                 &quot;1.4&quot;,                 &quot;1.5&quot;,                 &quot;1.6&quot;             ]         },         &quot;status_code&quot;: 200     },     &quot;status_code&quot;: 200,     &quot;success&quot;: true }) <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  <\/p>\n<pre><code class=\"python\">show_host = client.api_call('show-host', {'name' : 'h_8.8.8.8'})<\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0412\u044b\u0432\u043e\u0434 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c:<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">In [25]: show_host                                                               Out[25]:  APIResponse({     &quot;data&quot;: {         &quot;color&quot;: &quot;black&quot;,         &quot;comments&quot;: &quot;&quot;,         &quot;domain&quot;: {             &quot;domain-type&quot;: &quot;domain&quot;,             &quot;name&quot;: &quot;SMC User&quot;,             &quot;uid&quot;: &quot;41e821a0-3720-11e3-aa6e-0800200c9fde&quot;         },         &quot;groups&quot;: [],         &quot;icon&quot;: &quot;Objects\/host&quot;,         &quot;interfaces&quot;: [],         &quot;ipv4-address&quot;: &quot;8.8.8.8&quot;,         &quot;meta-info&quot;: {             &quot;creation-time&quot;: {                 &quot;iso-8601&quot;: &quot;2020-05-01T21:49+0300&quot;,                 &quot;posix&quot;: 1588358973517             },             &quot;creator&quot;: &quot;admin&quot;,             &quot;last-modifier&quot;: &quot;admin&quot;,             &quot;last-modify-time&quot;: {                 &quot;iso-8601&quot;: &quot;2020-05-01T21:49+0300&quot;,                 &quot;posix&quot;: 1588358973517             },             &quot;lock&quot;: &quot;unlocked&quot;,             &quot;validation-state&quot;: &quot;ok&quot;         },         &quot;name&quot;: &quot;h_8.8.8.8&quot;,         &quot;nat-settings&quot;: {             &quot;auto-rule&quot;: false         },         &quot;read-only&quot;: false,         &quot;tags&quot;: [],         &quot;type&quot;: &quot;host&quot;,         &quot;uid&quot;: &quot;c210af07-1939-49d3-a351-953a9c471d9e&quot;     },     &quot;res_obj&quot;: {         &quot;data&quot;: {             &quot;color&quot;: &quot;black&quot;,             &quot;comments&quot;: &quot;&quot;,             &quot;domain&quot;: {                 &quot;domain-type&quot;: &quot;domain&quot;,                 &quot;name&quot;: &quot;SMC User&quot;,                 &quot;uid&quot;: &quot;41e821a0-3720-11e3-aa6e-0800200c9fde&quot;             },             &quot;groups&quot;: [],             &quot;icon&quot;: &quot;Objects\/host&quot;,             &quot;interfaces&quot;: [],             &quot;ipv4-address&quot;: &quot;8.8.8.8&quot;,             &quot;meta-info&quot;: {                 &quot;creation-time&quot;: {                     &quot;iso-8601&quot;: &quot;2020-05-01T21:49+0300&quot;,                     &quot;posix&quot;: 1588358973517                 },                 &quot;creator&quot;: &quot;admin&quot;,                 &quot;last-modifier&quot;: &quot;admin&quot;,                 &quot;last-modify-time&quot;: {                     &quot;iso-8601&quot;: &quot;2020-05-01T21:49+0300&quot;,                     &quot;posix&quot;: 1588358973517                 },                 &quot;lock&quot;: &quot;unlocked&quot;,                 &quot;validation-state&quot;: &quot;ok&quot;             },             &quot;name&quot;: &quot;h_8.8.8.8&quot;,             &quot;nat-settings&quot;: {                 &quot;auto-rule&quot;: false             },             &quot;read-only&quot;: false,             &quot;tags&quot;: [],             &quot;type&quot;: &quot;host&quot;,             &quot;uid&quot;: &quot;c210af07-1939-49d3-a351-953a9c471d9e&quot;         },         &quot;status_code&quot;: 200     },     &quot;status_code&quot;: 200,     &quot;success&quot;: true }) <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  <\/p>\n<h3>api_query<\/h3>\n<p>  \u0421\u0440\u0430\u0437\u0443 \u043e\u0433\u043e\u0432\u043e\u0440\u044e\u0441\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u043e\u0432, \u0432\u044b\u0432\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 offset(\u0441\u0434\u0432\u0438\u0433). \u0422\u0430\u043a\u043e\u0439 \u0432\u044b\u0432\u043e\u0434 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u0432 \u043d\u0451\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0438\u043b\u0438 \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u043f\u0438\u0441\u043a\u0430 \u0432\u0441\u0435\u0445 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0442\u0438\u043f\u0430 \u0445\u043e\u0441\u0442 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 API \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0437 50 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e(\u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u043b\u0438\u043c\u0438\u0442 \u0434\u043e 500 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 \u043e\u0442\u0432\u0435\u0442\u0435). \u0418 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0434\u0451\u0440\u0433\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437, \u043c\u0435\u043d\u044f\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 offset \u0432 API \u0437\u0430\u043f\u0440\u043e\u0441\u0435, \u0435\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434 api_query, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0430\u043d\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u0440\u043e\u0434\u0435\u043b\u044b\u0432\u0430\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438. \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0432\u044b\u0437\u043e\u0432\u043e\u0432, \u0433\u0434\u0435 \u043d\u0443\u0436\u0435\u043d \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434: <i>show-sessions, show-hosts, show-networks, show-wildcards, show-groups, show-address-ranges, show-simple-gateways, show-simple-clusters, show-access-roles, show-trusted-clients, show-packages<\/i>. \u041f\u043e \u0444\u0430\u043a\u0442\u0443, \u0432 \u0438\u043c\u0435\u043d\u0438 \u044d\u0442\u0438\u0445 API \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0441\u043b\u043e\u0432\u0430 \u0432\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u043c \u0447\u0438\u0441\u043b\u0435, \u0442\u0430\u043a \u0447\u0442\u043e \u044d\u0442\u0438 \u0432\u044b\u0437\u043e\u0432\u044b \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0449\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 <b>api_query<\/b><\/p>\n<pre><code class=\"python\">show_hosts = client.api_query('show-hosts') <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0412\u044b\u0432\u043e\u0434 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c:<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">In [21]: show_hosts                                                              Out[21]:  APIResponse({     &quot;data&quot;: [         {             &quot;domain&quot;: {                 &quot;domain-type&quot;: &quot;domain&quot;,                 &quot;name&quot;: &quot;SMC User&quot;,                 &quot;uid&quot;: &quot;41e821a0-3720-11e3-aa6e-0800200c9fde&quot;             },             &quot;ipv4-address&quot;: &quot;192.168.47.1&quot;,             &quot;name&quot;: &quot;h_192.168.47.1&quot;,             &quot;type&quot;: &quot;host&quot;,             &quot;uid&quot;: &quot;5d7d7086-d70b-4995-971a-0583b15a2bfc&quot;         },         {             &quot;domain&quot;: {                 &quot;domain-type&quot;: &quot;domain&quot;,                 &quot;name&quot;: &quot;SMC User&quot;,                 &quot;uid&quot;: &quot;41e821a0-3720-11e3-aa6e-0800200c9fde&quot;             },             &quot;ipv4-address&quot;: &quot;8.8.8.8&quot;,             &quot;name&quot;: &quot;h_8.8.8.8&quot;,             &quot;type&quot;: &quot;host&quot;,             &quot;uid&quot;: &quot;c210af07-1939-49d3-a351-953a9c471d9e&quot;         }     ],     &quot;res_obj&quot;: {         &quot;data&quot;: {             &quot;from&quot;: 1,             &quot;objects&quot;: [                 {                     &quot;domain&quot;: {                         &quot;domain-type&quot;: &quot;domain&quot;,                         &quot;name&quot;: &quot;SMC User&quot;,                         &quot;uid&quot;: &quot;41e821a0-3720-11e3-aa6e-0800200c9fde&quot;                     },                     &quot;ipv4-address&quot;: &quot;192.168.47.1&quot;,                     &quot;name&quot;: &quot;h_192.168.47.1&quot;,                     &quot;type&quot;: &quot;host&quot;,                     &quot;uid&quot;: &quot;5d7d7086-d70b-4995-971a-0583b15a2bfc&quot;                 },                 {                     &quot;domain&quot;: {                         &quot;domain-type&quot;: &quot;domain&quot;,                         &quot;name&quot;: &quot;SMC User&quot;,                         &quot;uid&quot;: &quot;41e821a0-3720-11e3-aa6e-0800200c9fde&quot;                     },                     &quot;ipv4-address&quot;: &quot;8.8.8.8&quot;,                     &quot;name&quot;: &quot;h_8.8.8.8&quot;,                     &quot;type&quot;: &quot;host&quot;,                     &quot;uid&quot;: &quot;c210af07-1939-49d3-a351-953a9c471d9e&quot;                 }             ],             &quot;to&quot;: 2,             &quot;total&quot;: 2         },         &quot;status_code&quot;: 200     },     &quot;status_code&quot;: 200,     &quot;success&quot;: true }) <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  <\/p>\n<h2>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 API \u0432\u044b\u0437\u043e\u0432\u043e\u0432<\/h2>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043b\u0430\u0441\u0441\u0430 <b>APIResponse<\/b>(\u043a\u0430\u043a \u0432\u043d\u0443\u0442\u0440\u0438 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u0430 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u0442\u0430\u043a \u0438 \u0441\u043d\u0430\u0440\u0443\u0436\u0438). \u0423 \u043a\u043b\u0430\u0441\u0441\u0430 <b>APIResponse<\/b> \u043f\u0440\u0435\u0434\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e 4 \u043c\u0435\u0442\u043e\u0434\u0430 \u0438 5 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043d\u0430 \u0441\u0430\u043c\u044b\u0445 \u0432\u0430\u0436\u043d\u044b\u0445 \u043c\u044b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yb\/1q\/av\/yb1qavksjibe6qizmrjxsaprdp4.jpeg\" alt=\"image\"\/><\/p>\n<h3>success<\/h3>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e API \u0432\u044b\u0437\u043e\u0432 \u043f\u0440\u043e\u0448\u0451\u043b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0438 \u0432\u0435\u0440\u043d\u0443\u043b \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <b>success<\/b>:<\/p>\n<pre><code class=\"python\">In [49]: api_versions.success                                                    Out[49]: True <\/code><\/pre>\n<p>  \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 True \u0435\u0441\u043b\u0438 API \u0432\u044b\u0437\u043e\u0432 \u043f\u0440\u043e\u0448\u0451\u043b \u0443\u0441\u043f\u0435\u0448\u043d\u043e(\u041a\u043e\u0434 \u043e\u0442\u0432\u0435\u0442\u0430 \u2014 200) \u0438 False \u0435\u0441\u043b\u0438 \u043d\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e(\u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u043a\u043e\u0434 \u043e\u0442\u0432\u0435\u0442\u0430). \u0423\u0434\u043e\u0431\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 API \u0432\u044b\u0437\u043e\u0432\u0430, \u0447\u0442\u043e\u0431\u044b \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u0434\u0430 \u043e\u0442\u0432\u0435\u0442\u0430 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0440\u0430\u0437\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e.<\/p>\n<pre><code class=\"python\">if api_ver.success:      print(api_versions.data)  else:      print(api_versions.err_message) <\/code><\/pre>\n<p>  <\/p>\n<h3>statuscode<\/h3>\n<p>  \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043a\u043e\u0434 \u043e\u0442\u0432\u0435\u0442\u0430 \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f API \u0432\u044b\u0437\u043e\u0432\u0430.<\/p>\n<pre><code class=\"python\">In [62]: api_versions.status_code                                                Out[62]: 400 <\/code><\/pre>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043a\u043e\u0434\u044b \u043e\u0442\u0432\u0435\u0442\u043e\u0432: <b>200,400,401,403,404,409,500,501<\/b>.<\/p>\n<h3>set_success_status<\/h3>\n<p>  \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 success. \u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438, \u0442\u0443\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e, \u0434\u0430\u0436\u0435 \u043e\u0431\u044b\u0447\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443. \u041d\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0431\u0440\u043e\u0441 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0432 False \u043f\u0440\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u043e\u043f\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445. \u041d\u0438\u0436\u0435 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0438, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0435 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u043d\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u043c(\u0432\u044b\u0441\u0442\u0430\u0432\u0438\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e success \u0432 <i>False<\/i>, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e API \u0432\u044b\u0437\u043e\u0432 \u0431\u044b\u043b \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0439 \u0438 \u0432\u0435\u0440\u043d\u0443\u043b \u043a\u043e\u0434 200).<\/p>\n<pre><code class=\"python\">for task in task_result.data[&quot;tasks&quot;]:     if task[&quot;status&quot;] == &quot;failed&quot; or task[&quot;status&quot;] == &quot;partially succeeded&quot;:         task_result.set_success_status(False)         break<\/code><\/pre>\n<p>  <\/p>\n<h3>response()<\/h3>\n<p>  \u041c\u0435\u0442\u043e\u0434 response \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0441 \u043a\u043e\u0434\u043e\u043c \u043e\u0442\u0432\u0435\u0442\u0430(status_code) \u0438 \u0441 \u0442\u0435\u043b\u043e\u043c \u043e\u0442\u0432\u0435\u0442\u0430(body).<\/p>\n<pre><code class=\"python\">In [94]: api_versions.response()                                                 Out[94]:  {'status_code': 200,  'data': {'current-version': '1.6',   'supported-versions': ['1', '1.1', '1.2', '1.3', '1.4', '1.5', '1.6']}} <\/code><\/pre>\n<p>  <\/p>\n<h3>data<\/h3>\n<p>  \u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u043b\u043e \u043e\u0442\u0432\u0435\u0442\u0430(body) \u0431\u0435\u0437 \u0438\u0437\u043b\u0438\u0448\u043d\u0435\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438.<\/p>\n<pre><code class=\"python\">In [93]: api_versions.data                                                       Out[93]:  {'current-version': '1.6',  'supported-versions': ['1', '1.1', '1.2', '1.3', '1.4', '1.5', '1.6']} <\/code><\/pre>\n<p>  <\/p>\n<h3>error_message<\/h3>\n<p>  \u0414\u0430\u043d\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430, \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 API \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430(\u043a\u043e\u0434 \u043e\u0442\u0432\u0435\u0442\u0430 <u>\u043d\u0435<\/u> 200). \u041f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0432\u043e\u0434\u0430  <\/p>\n<pre><code class=\"python\">In [107]: api_versions.error_message                                             Out[107]: 'code: generic_err_invalid_parameter_name\\nmessage: Unrecognized parameter [1]\\n' <\/code><\/pre>\n<p>  <\/p>\n<h2>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b<\/h2>\n<p>  \u041d\u0438\u0436\u0435 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u044b \u043f\u0440\u0438\u043c\u0435\u0440\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f API \u0432\u044b\u0437\u043e\u0432\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0432\u0435\u0440\u0441\u0438\u044e Management API 1.6.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 <b>add-host<\/b> \u0438 <b>add-address-range<\/b>. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0442\u0438\u043f\u0430 \u0445\u043e\u0441\u0442 \u0432\u0441\u0435 ip \u0430\u0434\u0440\u0435\u0441\u0430 \u043f\u043e\u0434\u0441\u0435\u0442\u0438 192.168.0.0\/24, \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043e\u043a\u0442\u0435\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0430\u0432\u0435\u043d 5, \u0430 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 ip \u0430\u0434\u0440\u0435\u0441\u0430 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0442\u0438\u043f\u0430 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0430\u0434\u0440\u0435\u0441\u043e\u0432. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0430\u0434\u0440\u0435\u0441 \u043f\u043e\u0434\u0441\u0435\u0442\u0438 \u0438 \u0448\u0438\u0440\u043e\u043a\u043e\u0432\u0435\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u0434\u0440\u0435\u0441 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u044c.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0441\u043a\u0440\u0438\u043f\u0442 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0438 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f 50 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0442\u0438\u043f\u0430 \u0445\u043e\u0441\u0442 \u0438 51 \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0430\u0434\u0440\u0435\u0441\u043e\u0432. \u041d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f 101 API \u0432\u044b\u0437\u043e\u0432(\u043d\u0435 \u0441\u0447\u0438\u0442\u0430\u044f \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 publish). \u0422\u0430\u043a\u0436\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0434\u0443\u043b\u044f timeit \u043c\u044b \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0434\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0421\u043a\u0440\u0438\u043f\u0442 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 add-host \u0438 add-address-range<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">import timeit from cpapi import APIClient, APIClientArgs  start = timeit.default_timer()  first_ip = 1 last_ip = 4  client_args = APIClientArgs(server=&quot;192.168.47.240&quot;)  with APIClient(client_args) as client:       login = client.login_with_api_key('3TsbPJ8ZKjaJGvFyoFqHFA==')      for ip in range(5,255,5):          add_host = client.api_call(&quot;add-host&quot;, {&quot;name&quot; : f&quot;h_192.168.0.{ip}&quot;, &quot;ip-address&quot;: f'192.168.0.{ip}'})      while last_ip &lt; 255:          add_range = client.api_call(&quot;add-address-range&quot;, {&quot;name&quot;: f&quot;r_192.168.0.{first_ip}-{last_ip}&quot;, &quot;ip-address-first&quot;: f&quot;192.168.0.{first_ip}&quot;, &quot;ip-address-last&quot;: f&quot;192.168.0.{last_ip}&quot;})          first_ip+=5          last_ip+=5      stop = timeit.default_timer()       publish = client.api_call(&quot;publish&quot;)       print(f'Time to execute batch request: {stop - start} seconds')  <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u0412 \u043c\u043e\u0435\u0439 \u043b\u0430\u0431\u043e\u0440\u0430\u0442\u043e\u0440\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u0435 \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0443\u0445\u043e\u0434\u0438\u0442 \u043e\u0442 30 \u0434\u043e 50 \u0441\u0435\u043a\u0443\u043d\u0434 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u0443 \u0436\u0435 \u0437\u0430\u0434\u0430\u0447\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e API \u0432\u044b\u0437\u043e\u0432\u0430 <b>add-objects-batch<\/b>, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0432 \u0432\u0435\u0440\u0441\u0438\u044e API 1.6. \u0414\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430 \u043e\u0434\u0438\u043d API \u0437\u0430\u043f\u0440\u043e\u0441 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432. \u041f\u0440\u0438\u0447\u0451\u043c \u044d\u0442\u043e \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432(\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0445\u043e\u0441\u0442\u044b, \u043f\u043e\u0434\u0441\u0435\u0442\u0438 \u0438 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u044b \u0430\u0434\u0440\u0435\u0441\u043e\u0432). \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043d\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0430 \u0432 \u0440\u0430\u043c\u043a\u0430\u0437 \u043e\u0434\u043d\u043e\u0433\u043e API \u0432\u044b\u0437\u043e\u0432\u0430.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0421\u043a\u0440\u0438\u043f\u0442 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 add-objects-batch<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">import timeit from cpapi import APIClient, APIClientArgs  start = timeit.default_timer()  client_args = APIClientArgs(server=&quot;192.168.47.240&quot;)  objects_list_ip = [] objects_list_range = []  for ip in range(5,255,5):     data = {&quot;name&quot;: f'h_192.168.0.{ip}', &quot;ip-address&quot;: f'192.168.0.{ip}'}     objects_list_ip.append(data)      first_ip = 1 last_ip = 4   while last_ip &lt; 255:     data = {&quot;name&quot;: f&quot;r_192.168.0.{first_ip}-{last_ip}&quot;, &quot;ip-address-first&quot;: f&quot;192.168.0.{first_ip}&quot;, &quot;ip-address-last&quot;: f&quot;192.168.0.{last_ip}&quot;}     objects_list_range.append(data)     first_ip+=5     last_ip+=5  data_for_batch = {   &quot;objects&quot; : [ {     &quot;type&quot; : &quot;host&quot;,     &quot;list&quot; : objects_list_ip }, {     &quot;type&quot; : &quot;address-range&quot;,     &quot;list&quot; : objects_list_range   }] }   with APIClient(client_args) as client:       login = client.login_with_api_key('3TsbPJ8ZKjaJGvFyoFqHFA==')      add_objects_batch = client.api_call(&quot;add-objects-batch&quot;, data_for_batch)      stop = timeit.default_timer()       publish = client.api_call(&quot;publish&quot;)       print(f'Time to execute batch request: {stop - start} seconds') <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u0410 \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432 \u043c\u043e\u0435\u0439 \u043b\u0430\u0431\u043e\u0440\u0430\u0442\u043e\u0440\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u0435 \u0443\u0445\u043e\u0434\u0438\u0442 \u043e\u0442 3 \u0434\u043e 7 \u0441\u0435\u043a\u0443\u043d\u0434 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0422\u043e \u0435\u0441\u0442\u044c, \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c, \u043d\u0430 101 \u043e\u0431\u044a\u0435\u043a\u0442\u0435 API \u0432\u044b\u0437\u043e\u0432 \u0442\u0438\u043f\u0430 batch, \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0432 10 \u0440\u0430\u0437 \u0431\u044b\u0441\u0442\u0440\u0435\u0435. \u041d\u0430 \u0431\u043e\u043b\u044c\u0448\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0431\u0443\u0434\u0435\u0442 \u0435\u0449\u0451 \u0431\u043e\u043b\u0435\u0435 \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u044f\u044e\u0449\u0435\u0439.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 <b>set-objects-batch<\/b>. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0430\u043d\u043d\u043e\u0433\u043e API \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043c\u0430\u0441\u0441\u043e\u0432\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u043f\u0435\u0440\u0432\u043e\u0439 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0435 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0438\u0437 \u043f\u0440\u043e\u0448\u043b\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 (\u0434\u043e .124 \u0445\u043e\u0441\u0442\u0430, \u043f\u0440\u0438\u0447\u0451\u043c \u0438 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430\u043c \u0442\u043e\u0436\u0435) \u0446\u0432\u0435\u0442 sienna, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0435 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u043c \u0446\u0432\u0435\u0442 khaki.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0446\u0432\u0435\u0442\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">from cpapi import APIClient, APIClientArgs  client_args = APIClientArgs(server=&quot;192.168.47.240&quot;)  objects_list_ip_first = [] objects_list_range_first = [] objects_list_ip_second = [] objects_list_range_second = []  for ip in range(5,125,5):     data = {&quot;name&quot;: f'h_192.168.0.{ip}', &quot;color&quot;: &quot;sienna&quot;}     objects_list_ip_first.append(data)      for ip in range(125,255,5):     data = {&quot;name&quot;: f'h_192.168.0.{ip}', &quot;color&quot;: &quot;khaki&quot;}     objects_list_ip_second.append(data)      first_ip = 1 last_ip = 4 while last_ip &lt; 125:     data = {&quot;name&quot;: f&quot;r_192.168.0.{first_ip}-{last_ip}&quot;, &quot;color&quot;: &quot;sienna&quot;}     objects_list_range_first.append(data)     first_ip+=5     last_ip+=5      while last_ip &lt; 255:     data = {&quot;name&quot;: f&quot;r_192.168.0.{first_ip}-{last_ip}&quot;, &quot;color&quot;: &quot;khaki&quot;}     objects_list_range_second.append(data)     first_ip+=5     last_ip+=5  data_for_batch_first  = {   &quot;objects&quot; : [ {     &quot;type&quot; : &quot;host&quot;,     &quot;list&quot; : objects_list_ip_first }, {     &quot;type&quot; : &quot;address-range&quot;,     &quot;list&quot; : objects_list_range_first   }] }  data_for_batch_second  = {   &quot;objects&quot; : [ {     &quot;type&quot; : &quot;host&quot;,     &quot;list&quot; : objects_list_ip_second }, {     &quot;type&quot; : &quot;address-range&quot;,     &quot;list&quot; : objects_list_range_second   }] }  with APIClient(client_args) as client:       login = client.login_with_api_key('3TsbPJ8ZKjaJGvFyoFqHFA==')       set_objects_batch_first = client.api_call(&quot;set-objects-batch&quot;, data_for_batch_first)      set_objects_batch_second = client.api_call(&quot;set-objects-batch&quot;, data_for_batch_second)      publish = client.api_call(&quot;publish&quot;) <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 \u043e\u0434\u043d\u043e\u043c API \u0432\u044b\u0437\u043e\u0432\u0435 \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <b>delete-objects-batch<\/b>. \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0432\u0441\u0435 \u0445\u043e\u0441\u0442\u044b, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u0440\u0430\u043d\u0435\u0435 \u0447\u0435\u0440\u0435\u0437 <b>add-objects-batch<\/b>.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e delete-objects-batch<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">from cpapi import APIClient, APIClientArgs  client_args = APIClientArgs(server=&quot;192.168.47.240&quot;)  objects_list_ip = [] objects_list_range = []  for ip in range(5,255,5):     data = {&quot;name&quot;: f'h_192.168.0.{ip}'}     objects_list_ip.append(data)  first_ip = 1 last_ip = 4 while last_ip &lt; 255:     data = {&quot;name&quot;: f&quot;r_192.168.0.{first_ip}-{last_ip}&quot;}     objects_list_range.append(data)     first_ip+=5     last_ip+=5  data_for_batch = {   &quot;objects&quot; : [ {     &quot;type&quot; : &quot;host&quot;,     &quot;list&quot; : objects_list_ip }, {     &quot;type&quot; : &quot;address-range&quot;,     &quot;list&quot; : objects_list_range   }] }  with APIClient(client_args) as client:       login = client.login_with_api_key('3TsbPJ8ZKjaJGvFyoFqHFA==')      delete_objects_batch = client.api_call(&quot;delete-objects-batch&quot;, data_for_batch)      publish = client.api_call(&quot;publish&quot;)  print(delete_objects_batch.data) <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u0412\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u043d\u043e\u0432\u044b\u0445 \u0440\u0435\u043b\u0438\u0437\u0430\u0445 \u041f\u041e Check Point, \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043e\u0431\u0440\u0435\u0442\u0430\u044e\u0442 \u0438 API \u0432\u044b\u0437\u043e\u0432\u044b. \u0422\u0430\u043a, \u0432 R80.40 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u0442\u0430\u043a\u0438\u0435 \u00ab\u0444\u0438\u0447\u0438\u00bb \u043a\u0430\u043a Revert to revision \u0438 Smart Task, \u0438 \u0434\u043b\u044f \u043d\u0438\u0445 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 API \u0432\u044b\u0437\u043e\u0432\u044b. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0432\u0435\u0441\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u0438\u0437 Legacy \u043a\u043e\u043d\u0441\u043e\u043b\u0435\u0439 \u0432 \u0440\u0435\u0436\u0438\u043c Unified Policy \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u0440\u0430\u0441\u0442\u0430\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 API. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043e\u043b\u0433\u043e\u0436\u0434\u0430\u043d\u043d\u044b\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 \u041f\u041e R80.40 \u0441\u0442\u0430\u043b \u043f\u0435\u0440\u0435\u0435\u0437\u0434 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 HTTPS Inspection \u0438\u0437 Legacy \u0440\u0435\u0436\u0438\u043c\u0430 \u0432 \u0440\u0435\u0436\u0438\u043c Unified Policy, \u0438 \u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b API \u0432\u044b\u0437\u043e\u0432\u044b. \u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430 \u0432\u0435\u0440\u0445\u043d\u044e\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e HTTPS Inspection policy \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0438\u0437 \u0438\u043d\u0441\u043f\u0435\u043a\u0446\u0438\u0438 3 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438(\u0417\u0434\u043e\u0440\u043e\u0432\u044c\u0435, \u0424\u0438\u043d\u0430\u043d\u0441\u044b, \u0413\u043e\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0443\u0441\u043b\u0443\u0433\u0438), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u043e \u0438\u043d\u0441\u043f\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0437\u0430\u043a\u043e\u043d\u0430\u0434\u0430\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u043e\u043c \u0432 \u0440\u044f\u0434\u0435 \u0441\u0442\u0440\u0430\u043d.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0432 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0443 HTTPS Inspection<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">from cpapi import APIClient, APIClientArgs  client_args = APIClientArgs(server=&quot;192.168.47.240&quot;)  data = {   &quot;layer&quot; : &quot;Default Layer&quot;,   &quot;position&quot; : &quot;top&quot;,   &quot;name&quot; : &quot;Legal Requirements&quot;,   &quot;action&quot;: &quot;bypass&quot;,   &quot;site-category&quot;: [&quot;Health&quot;, &quot;Government \/ Military&quot;, &quot;Financial Services&quot;] }  with APIClient(client_args) as client:       login = client.login_with_api_key('3TsbPJ8ZKjaJGvFyoFqHFA==')      add_https_rule = client.api_call(&quot;add-https-rule&quot;, data)      publish = client.api_call(&quot;publish&quot;) <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  <\/p>\n<h2>\u0417\u0430\u043f\u0443\u0441\u043a Python \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f Check Point<\/h2>\n<p>  \u0412\u0441\u0451 \u0432 \u0442\u043e\u043c \u0436\u0435 <a href=\"https:\/\/github.com\/CheckPointSW\/cp_mgmt_api_python_sdk\/blob\/master\/README.md\">README.md<\/a> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u043d\u0430 Python \u043f\u0440\u044f\u043c\u043e \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u043e, \u043a\u043e\u0433\u0434\u0430 \u0443 \u0432\u0430\u0441 \u043d\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a API \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b. \u042f \u0437\u0430\u043f\u0438\u0441\u0430\u043b \u0448\u0435\u0441\u0442\u0438\u043c\u0438\u043d\u0443\u0442\u043d\u043e\u0435 \u0432\u0438\u0434\u0435\u043e \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u043c\u043e\u0434\u0443\u043b\u044f <b>cpapi<\/b> \u0438 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Python \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043d\u043e\u0432\u043e\u0433\u043e \u0448\u043b\u044e\u0437\u0430 \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438, \u043a\u0430\u043a \u0430\u0443\u0434\u0438\u0442 \u0441\u0435\u0442\u0438 <b>Security CheckUp<\/b>. \u0418\u0437 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f: \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 Python 2.7 \u0435\u0449\u0451 \u043d\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f <b>input<\/b>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0432\u0432\u043e\u0434\u0438\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <b>raw_input<\/b>. \u0412 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u043c, \u043a\u043e\u0434 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u043a\u0430\u043a \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0430\u0448\u0438\u043d, \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <b>login_as_root<\/b>, \u0434\u0430\u0431\u044b \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0436\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 username, \u043f\u0430\u0440\u043e\u043b\u044c \u0438 IP \u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0435\u0449\u0451 \u0440\u0430\u0437.<\/p>\n<div class=\"oembed\">\n<div>\n<div style=\"left: 0; width: 100%; height: 0; position: relative; padding-bottom: 56.25%;\"><iframe src=\"https:\/\/www.youtube.com\/embed\/8B6pgCLT8Pg?rel=0&amp;showinfo=1&amp;hl=en-US\" style=\"border: 0; top: 0; left: 0; width: 100%; height: 100%; position: absolute;\" allowfullscreen scrolling=\"no\" allow=\"encrypted-media; accelerometer; gyroscope; picture-in-picture\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0421\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Security CheckUp<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">from __future__ import print_function import getpass import sys, os sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) from cpapi import APIClient, APIClientArgs  def main():     with APIClient() as client:        # if client.check_fingerprint() is False:        #     print(&quot;Could not get the server's fingerprint - Check connectivity with the server.&quot;)        #     exit(1)         login_res = client.login_as_root()          if login_res.success is False:             print(&quot;Login failed:\\n{}&quot;.format(login_res.error_message))             exit(1)          gw_name = raw_input(&quot;Enter the gateway name:&quot;)         gw_ip = raw_input(&quot;Enter the gateway IP address:&quot;)         if sys.stdin.isatty():             sic = getpass.getpass(&quot;Enter one-time password for the gateway(SIC): &quot;)         else:             print(&quot;Attention! Your password will be shown on the screen!&quot;)             sic = raw_input(&quot;Enter one-time password for the gateway(SIC): &quot;)         version = raw_input(&quot;Enter the gateway version(like RXX.YY):&quot;)         add_gw = client.api_call(&quot;add-simple-gateway&quot;, {'name' : gw_name, 'ipv4-address' : gw_ip, 'one-time-password' : sic, 'version': version.capitalize(), 'application-control' : 'true', 'url-filtering' : 'true', 'ips' : 'true', 'anti-bot' : 'true', 'anti-virus' : 'true', 'threat-emulation' : 'true'})         if add_gw.success and add_gw.data['sic-state'] != &quot;communicating&quot;:             print(&quot;Secure connection with the gateway hasn't established!&quot;)             exit(1)         elif add_gw.success:             print(&quot;The gateway was added successfully.&quot;)             gw_uid = add_gw.data['uid']             gw_name = add_gw.data['name']         else:             print(&quot;Failed to add the gateway - {}&quot;.format(add_gw.error_message))             exit(1)          change_policy = client.api_call(&quot;set-access-layer&quot;, {&quot;name&quot; : &quot;Network&quot;, &quot;applications-and-url-filtering&quot;: &quot;true&quot;, &quot;content-awareness&quot;: &quot;true&quot;})         if change_policy.success:             print(&quot;The policy has been changed successfully&quot;)         else:             print(&quot;Failed to change the policy- {}&quot;.format(change_policy.error_message))         change_rule = client.api_call(&quot;set-access-rule&quot;, {&quot;name&quot; : &quot;Cleanup rule&quot;, &quot;layer&quot; : &quot;Network&quot;, &quot;action&quot;: &quot;Accept&quot;, &quot;track&quot;: {&quot;type&quot;: &quot;Detailed Log&quot;, &quot;accounting&quot;: &quot;true&quot;}})         if change_rule.success:             print(&quot;The cleanup rule has been changed successfully&quot;)         else:             print(&quot;Failed to change the cleanup rule- {}&quot;.format(change_rule.error_message))          # publish the result         publish_res = client.api_call(&quot;publish&quot;, {})         if publish_res.success:             print(&quot;The changes were published successfully.&quot;)         else:                 print(&quot;Failed to publish the changes - {}&quot;.format(install_tp_policy.error_message))          install_access_policy = client.api_call(&quot;install-policy&quot;, {&quot;policy-package&quot; : &quot;Standard&quot;, &quot;access&quot; : 'true',  &quot;threat-prevention&quot; : 'false', &quot;targets&quot; : gw_uid})         if install_access_policy.success:             print(&quot;The access policy has been installed&quot;)         else:                 print(&quot;Failed to install access policy - {}&quot;.format(install_tp_policy.error_message))          install_tp_policy = client.api_call(&quot;install-policy&quot;, {&quot;policy-package&quot; : &quot;Standard&quot;, &quot;access&quot; : 'false',  &quot;threat-prevention&quot; : 'true', &quot;targets&quot; : gw_uid})         if install_tp_policy.success:             print(&quot;The threat prevention policy has been installed&quot;)         else:             print(&quot;Failed to install threat prevention policy - {}&quot;.format(install_tp_policy.error_message))                  # add passwords and passphrases to dictionary         with open('additional_pass.conf') as f:             line_num = 0             for line in f:                 line_num += 1                 add_password_dictionary = client.api_call(&quot;run-script&quot;, {&quot;script-name&quot; : &quot;Add passwords and passphrases&quot;, &quot;script&quot; : &quot;printf \\&quot;{}\\&quot; &gt;&gt; $FWDIR\/conf\/additional_pass.conf&quot;.format(line), &quot;targets&quot; : gw_name})                 if add_password_dictionary.success:                     print(&quot;The password dictionary line {} was added successfully&quot;.format(line_num))                 else:                     print(&quot;Failed to add the dictionary - {}&quot;.format(add_password_dictionary.error_message))  main()<\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u0444\u0430\u0439\u043b\u0430 \u0441\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u0451\u043c \u043f\u0430\u0440\u043e\u043b\u0435\u0439 additional_pass.conf<\/b>                         <\/p>\n<div class=\"spoiler_text\"><code>{<br \/>  &quot;passwords&quot; : [&quot;malware&quot;,&quot;malicious&quot;,&quot;infected&quot;,&quot;Infected&quot;],<br \/>  &quot;phrases&quot; : [&quot;password&quot;,&quot;Password&quot;,&quot;Pass&quot;,&quot;pass&quot;,&quot;codigo&quot;,&quot;key&quot;,&quot;pwd&quot;,&quot;\u043f\u0430\u0440\u043e\u043b\u044c&quot;,&quot;\u041f\u0430\u0440\u043e\u043b\u044c&quot;,&quot;\u041a\u043b\u044e\u0447&quot;,&quot;\u043a\u043b\u044e\u0447&quot;,&quot;\u0448\u0438\u0444\u0440&quot;,&quot;\u0428\u0438\u0444\u0440&quot;]<br \/>  }<\/code>  <\/div>\n<\/p><\/div>\n<p>  <\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442 \u043b\u0438\u0448\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b <b>Python SDK<\/b> \u0438 \u043c\u043e\u0434\u0443\u043b\u044f <b>cpapi<\/b>(\u043a\u0430\u043a \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f, \u044d\u0442\u043e \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0438\u043d\u043e\u043d\u0438\u043c\u044b), \u0438 \u0438\u0437\u0443\u0447\u0438\u0432 \u043a\u043e\u0434 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435 \u0432\u044b \u043e\u0442\u043a\u0440\u043e\u0435\u0442\u0435 \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0435\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u043d\u0438\u043c. \u041d\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u043e, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438, \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438, \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438. \u0412\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u0435\u043b\u0438\u0442\u0441\u044f \u0441\u0432\u043e\u0438\u043c\u0438 \u043d\u0430\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u043c\u0438 \u0438 \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0434\u043b\u044f Check Point \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 <a href=\"https:\/\/community.checkpoint.com\/t5\/API-CLI-Discussion-and-Samples\/bd-p\/codehub\">CodeHub<\/a> \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0435 <a href=\"http:\/\/community.checkpoint.com\/\">CheckMates<\/a>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0435\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<\/p>\n<p>  \u041f\u0440\u0438\u044f\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0438\u043d\u0433\u0430 \u0438 \u0441\u043f\u0430\u0441\u0438\u0431\u043e, \u0447\u0442\u043e \u0434\u043e\u0447\u0438\u0442\u0430\u043b\u0438 \u0434\u043e \u043a\u043e\u043d\u0446\u0430!<\/p><\/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=\"https:\/\/habr.com\/ru\/post\/505510\/\"> https:\/\/habr.com\/ru\/post\/505510\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/505510\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/xf\/kx\/d6\/xfkxd68ynnabb65k6ygvksmoyzw.png\" alt=\"image\"\/>\u0412\u0441\u044f \u043c\u043e\u0449\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 API \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c API \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 API \u043e\u0442\u0432\u0435\u0442\u043e\u0432. \u041e\u0434\u043d\u0430\u043a\u043e, \u043c\u0430\u043b\u043e\u0437\u0430\u043c\u0435\u0442\u043d\u044b\u043c \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f <b>Python Software Development Kit<\/b> (\u0434\u0430\u043b\u0435\u0435 \u2014 Python SDK) \u0434\u043b\u044f <b>Check Point Management API<\/b>, \u0430 \u0437\u0440\u044f. \u041e\u043d \u043e\u0449\u0443\u0442\u0438\u043c\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0436\u0438\u0437\u043d\u044c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0438 \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044f\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438. Python \u043f\u0440\u0438\u043e\u0431\u0440\u0451\u043b \u043e\u0433\u0440\u043e\u043c\u043d\u0443\u044e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u044c \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0438 \u044f \u0440\u0435\u0448\u0438\u043b \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u0435\u043b \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0431\u0437\u043e\u0440 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u043d\u043e\u0441\u0442\u0435\u0439 <a href=\"https:\/\/github.com\/CheckPointSW\/cp_mgmt_api_python_sdk\">Check Point API Python Development Kit<\/a>. \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0441\u043b\u0443\u0436\u0438\u0442 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435\u043c \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 <a href=\"https:\/\/habr.com\/ru\/company\/tssolution\/blog\/339924\/\">Check Point R80.10 API. \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 CLI, \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e<\/a>. \u041c\u044b \u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Python SDK \u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043d\u0430 \u043d\u043e\u0432\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0435 Management API \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 1.6(\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 R80.40). \u0414\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u043d\u0438\u044f \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 API \u0438 Python.  <\/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-304899","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/304899","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=304899"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/304899\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=304899"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=304899"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=304899"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}