edu-dis-labs-private/assets/js/25.cc4d9332.js

1 line
34 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window.webpackJsonp=window.webpackJsonp||[]).push([[25],{651:function(t,a,o){"use strict";o.r(a);var s=o(34),l=Object(s.a)({},(function(){var t=this,a=t.$createElement,o=t._self._c||a;return o("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[o("h1",{attrs:{id:"тестування-працездатності-системи"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#тестування-працездатності-системи"}},[t._v("#")]),t._v(" Тестування працездатності системи")]),t._v(" "),o("h2",{attrs:{id:"передумови"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#передумови"}},[t._v("#")]),t._v(" Передумови")]),t._v(" "),o("ol",[o("li",[t._v("Налаштування віртуального середовища")])]),t._v(" "),o("div",{staticClass:"language-bash extra-class"},[o("pre",{pre:!0,attrs:{class:"language-bash"}},[o("code",[t._v("python3 -m venv "),o("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v(".")]),t._v("\n"),o("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("source")]),t._v(" bin/activate.fish\npip3 "),o("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" flask mariadb\n")])])]),o("ol",{attrs:{start:"2"}},[o("li",[t._v("Запуск сервера:")])]),t._v(" "),o("div",{staticClass:"language-bash extra-class"},[o("pre",{pre:!0,attrs:{class:"language-bash"}},[o("code",[t._v("flask --app server run\n")])])]),o("h2",{attrs:{id:"тестування-компонентів"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#тестування-компонентів"}},[t._v("#")]),t._v(" Тестування компонентів")]),t._v(" "),o("p",[t._v("Система має два варіанти передачі індексів: у рядку шляху або в тілі запиту. Перевіримо, як працюють обидва варіанти.")]),t._v(" "),o("h3",{attrs:{id:"api-survey"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#api-survey"}},[t._v("#")]),t._v(" /api/survey")]),t._v(" "),o("p",[t._v("Цей шлях дозволяє використовувати всі 4 HTTP-методи, що використовуються в домовленості REST (GET, POST, PUT, DELETE).\nПротестуємо кожен з них на практичному прикладі:")]),t._v(" "),o("pre",{staticStyle:{color:"#ffffff","font-size":"10pt"}},[o("span",{staticStyle:{filter:"contrast(70%) brightness(190%)",color:"lime"}},[t._v("user")]),t._v("@debian-laptop "),o("span",{staticStyle:{color:"lime"}},[t._v("~/D/f/t/f/d/m/e/s/demo")]),t._v(" (master)> "),o("span",{staticStyle:{color:"#3333FF"}},[t._v("curl")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("-s")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("http://127.0.0.1:5000/api/survey")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"lime"}},[t._v("|")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"#3333FF"}},[t._v("jq")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v(".")]),t._v("\n"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v("[\n {\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"id"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("1"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"isPaused"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("0"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"isNamed"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("0"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"name"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),o("span",{staticStyle:{color:"lime"}},[t._v('"Test 1"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"duration"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),o("span",{staticStyle:{color:"lime"}},[t._v('"1w"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"account_id"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("10"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v("\n }")]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n {\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"id"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("4"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"isPaused"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("0"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"isNamed"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("0"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"name"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),o("span",{staticStyle:{color:"lime"}},[t._v('"Test 2"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"duration"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),o("span",{staticStyle:{color:"lime"}},[t._v('"1w"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"account_id"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("5"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v("\n }")]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v("\n]")]),t._v("\n"),o("span",{staticStyle:{color:"dimgray"}}),o("span",{staticStyle:{filter:"contrast(70%) brightness(190%)",color:"lime"}},[t._v("user")]),t._v("@debian-laptop "),o("span",{staticStyle:{color:"lime"}},[t._v("~/D/f/t/f/d/m/e/s/demo")]),t._v(" (master)> "),o("span",{staticStyle:{color:"#3333FF"}},[t._v("curl")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("-X")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("POST")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("-d")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"yellow"}},[t._v('\'{"isPaused": false, "isNamed": true, "name": "Test 3", "duration": "1w", "account_id": 2}\'')]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("--header")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"yellow"}},[t._v('"Content-Type: application/json"')]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("http://127.0.0.1:5000/api/survey")]),t._v('\n{"success": true}\n'),o("span",{staticStyle:{color:"dimgray"}}),o("span",{staticStyle:{filter:"contrast(70%) brightness(190%)",color:"lime"}},[t._v("user")]),t._v("@debian-laptop "),o("span",{staticStyle:{color:"lime"}},[t._v("~/D/f/t/f/d/m/e/s/demo")]),t._v(" (master)> "),o("span",{staticStyle:{color:"#3333FF"}},[t._v("curl")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("-s")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("http://127.0.0.1:5000/api/survey")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"lime"}},[t._v("|")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"#3333FF"}},[t._v("jq")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v(".")]),t._v("\n"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v("[\n {\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"id"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("1"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"isPaused"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("0"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"isNamed"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("0"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"name"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),o("span",{staticStyle:{color:"lime"}},[t._v('"Test 1"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"duration"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),o("span",{staticStyle:{color:"lime"}},[t._v('"1w"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"account_id"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("10"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v("\n }")]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n {\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"id"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("4"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"isPaused"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("0"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"isNamed"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("0"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"name"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),o("span",{staticStyle:{color:"lime"}},[t._v('"Test 2"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"duration"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),o("span",{staticStyle:{color:"lime"}},[t._v('"1w"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"account_id"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("5"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v("\n }")]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n {\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"id"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("12"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"isPaused"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("0"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"isNamed"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("1"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"name"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),o("span",{staticStyle:{color:"lime"}},[t._v('"Test 3"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"duration"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),o("span",{staticStyle:{color:"lime"}},[t._v('"1w"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"account_id"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("2"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v("\n }")]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v("\n]")]),t._v("\n"),o("span",{staticStyle:{color:"dimgray"}}),o("span",{staticStyle:{filter:"contrast(70%) brightness(190%)",color:"lime"}},[t._v("user")]),t._v("@debian-laptop "),o("span",{staticStyle:{color:"lime"}},[t._v("~/D/f/t/f/d/m/e/s/demo")]),t._v(" (master)> "),o("span",{staticStyle:{color:"#3333FF"}},[t._v("curl")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("-X")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("PUT")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("-d")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"yellow"}},[t._v('\'{"id": 8, "isPaused": true, "isNamed": true, "name": "Test 3", "duration": "4w", "account_id": 2}\'')]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("--header")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"yellow"}},[t._v('"Content-Type: application/json"')]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("http://127.0.0.1:5000/api/survey")]),t._v('\n{"success": true}\n'),o("span",{staticStyle:{color:"dimgray"}}),o("span",{staticStyle:{filter:"contrast(70%) brightness(190%)",color:"lime"}},[t._v("user")]),t._v("@debian-laptop "),o("span",{staticStyle:{color:"lime"}},[t._v("~/D/f/t/f/d/m/e/s/demo")]),t._v(" (master)> "),o("span",{staticStyle:{color:"#3333FF"}},[t._v("curl")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("-s")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("http://127.0.0.1:5000/api/survey")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"lime"}},[t._v("|")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"#3333FF"}},[t._v("jq")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v(".")]),t._v("\n"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v("[\n {\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"id"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("1"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"isPaused"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("0"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"isNamed"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("0"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"name"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),o("span",{staticStyle:{color:"lime"}},[t._v('"Test 1"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"duration"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),o("span",{staticStyle:{color:"lime"}},[t._v('"1w"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"account_id"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("10"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v("\n }")]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n {\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"id"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("4"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"isPaused"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("0"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"isNamed"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("0"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"name"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),o("span",{staticStyle:{color:"lime"}},[t._v('"Test 2"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"duration"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),o("span",{staticStyle:{color:"lime"}},[t._v('"1w"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"account_id"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("5"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v("\n }")]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n {\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"id"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("12"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"isPaused"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("1"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"isNamed"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("1"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"name"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),o("span",{staticStyle:{color:"lime"}},[t._v('"Test 3"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"duration"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),o("span",{staticStyle:{color:"lime"}},[t._v('"4w"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"account_id"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("2"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v("\n }")]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v("\n]")]),t._v("\n"),o("span",{staticStyle:{color:"dimgray"}}),o("span",{staticStyle:{filter:"contrast(70%) brightness(190%)",color:"lime"}},[t._v("user")]),t._v("@debian-laptop "),o("span",{staticStyle:{color:"lime"}},[t._v("~/D/f/t/f/d/m/e/s/demo")]),t._v(" (master)> "),o("span",{staticStyle:{color:"#3333FF"}},[t._v("curl")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("-X")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("DELETE")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("-d")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"yellow"}},[t._v("'{\"id\": 12}'")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("--header")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"yellow"}},[t._v('"Content-Type: application/json"')]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("http://127.0.0.1:5000/api/survey")]),t._v("\n[{'id': 12, 'isPaused': 1, 'isNamed': 1, 'name': 'Test 3', 'duration': '4w', 'account_id': 2}]\n"),o("span",{staticStyle:{color:"dimgray"}}),o("span",{staticStyle:{filter:"contrast(70%) brightness(190%)",color:"lime"}},[t._v("user")]),t._v("@debian-laptop "),o("span",{staticStyle:{color:"lime"}},[t._v("~/D/f/t/f/d/m/e/s/demo")]),t._v(" (master)> "),o("span",{staticStyle:{color:"#3333FF"}},[t._v("curl")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("-s")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("http://127.0.0.1:5000/api/survey")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"lime"}},[t._v("|")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"#3333FF"}},[t._v("jq")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v(".")]),t._v("\n"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v("[\n {\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"id"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("1"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"isPaused"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("0"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"isNamed"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("0"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"name"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),o("span",{staticStyle:{color:"lime"}},[t._v('"Test 1"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"duration"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),o("span",{staticStyle:{color:"lime"}},[t._v('"1w"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"account_id"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("10"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v("\n }")]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n {\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"id"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("4"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"isPaused"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("0"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"isNamed"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("0"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"name"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),o("span",{staticStyle:{color:"lime"}},[t._v('"Test 2"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"duration"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),o("span",{staticStyle:{color:"lime"}},[t._v('"1w"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"account_id"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("5"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v("\n }")]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v("\n]")]),t._v("\n")]),t._v(" "),o("h3",{attrs:{id:"api-survey-id"}},[o("a",{staticClass:"header-anchor",attrs:{href:"#api-survey-id"}},[t._v("#")]),t._v(" /api/survey/<id>")]),t._v(" "),o("p",[t._v("У цьому випадку доступні лише 3 методи (GET, PUT, DELETE), оскільки під час створення нового опитування його ідентифікатор визначається безпосередньо базою даних.")]),t._v(" "),o("pre",{staticStyle:{color:"#ffffff","font-size":"10pt"}},[o("span",{staticStyle:{filter:"contrast(70%) brightness(190%)",color:"lime"}},[t._v("user")]),t._v("@debian-laptop "),o("span",{staticStyle:{color:"lime"}},[t._v("~/D/f/t/f/d/m/e/s/restful-server")]),t._v(" (master)> "),o("span",{staticStyle:{color:"#3333FF"}},[t._v("curl")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("-s")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("http://127.0.0.1:5000/api/survey")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"lime"}},[t._v("|")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"#3333FF"}},[t._v("jq")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v(".")]),t._v("\n"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v("[\n {\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"id"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("1"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"isPaused"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("0"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"isNamed"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("0"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"name"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),o("span",{staticStyle:{color:"lime"}},[t._v('"Test 1"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"duration"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),o("span",{staticStyle:{color:"lime"}},[t._v('"1w"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"account_id"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("10"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v("\n }")]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n {\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"id"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("4"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"isPaused"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("0"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"isNamed"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("1"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"name"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),o("span",{staticStyle:{color:"lime"}},[t._v('"Test 3"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"duration"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),o("span",{staticStyle:{color:"lime"}},[t._v('"1w"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"account_id"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("5"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v("\n }")]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v("\n]")]),t._v("\n"),o("span",{staticStyle:{color:"dimgray"}}),o("span",{staticStyle:{filter:"contrast(70%) brightness(190%)",color:"lime"}},[t._v("user")]),t._v("@debian-laptop "),o("span",{staticStyle:{color:"lime"}},[t._v("~/D/f/t/f/d/m/e/s/restful-server")]),t._v(" (master)> "),o("span",{staticStyle:{color:"#3333FF"}},[t._v("curl")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("-X")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("PUT")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" \\\n"),o("span",{staticStyle:{color:"aqua"}},[t._v("-d")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"yellow"}},[t._v('\'{"isPaused": true,\n"isNamed": true,\n"name": "Test 4",\n"duration": "2w"}\'')]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" \\\n"),o("span",{staticStyle:{color:"aqua"}},[t._v("--header")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"yellow"}},[t._v('"Content-Type: application/json"')]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" \\\n"),o("span",{staticStyle:{color:"aqua"}},[t._v("-s")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("http://127.0.0.1:5000/api/survey/4 ")]),t._v('\n{"success": true}\n'),o("span",{staticStyle:{color:"dimgray"}}),o("span",{staticStyle:{filter:"contrast(70%) brightness(190%)",color:"lime"}},[t._v("user")]),t._v("@debian-laptop "),o("span",{staticStyle:{color:"lime"}},[t._v("~/D/f/t/f/d/m/e/s/restful-server")]),t._v(" (master)> "),o("span",{staticStyle:{color:"#3333FF"}},[t._v("curl")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("-s")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("http://127.0.0.1:5000/api/survey/4")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"lime"}},[t._v("|")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"#3333FF"}},[t._v("jq")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v(".")]),o("span",{staticStyle:{color:"dimgray"}}),t._v("\n"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v("[\n {\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"id"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("4"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"isPaused"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("1"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"isNamed"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("1"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"name"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),o("span",{staticStyle:{color:"lime"}},[t._v('"Test 4"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"duration"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),o("span",{staticStyle:{color:"lime"}},[t._v('"2w"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(",\n ")]),o("span",{staticStyle:{"font-weight":"bold",color:"#3333FF"}},[t._v('"account_id"')]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v(": ")]),t._v("5"),o("span",{staticStyle:{"font-weight":"bold"}},[t._v("\n }")]),o("span",{staticStyle:{"font-weight":"bold"}},[t._v("\n]")]),t._v("\n"),o("span",{staticStyle:{color:"dimgray"}}),o("span",{staticStyle:{filter:"contrast(70%) brightness(190%)",color:"lime"}},[t._v("user")]),t._v("@debian-laptop "),o("span",{staticStyle:{color:"lime"}},[t._v("~/D/f/t/f/d/m/e/s/restful-server")]),t._v(" (master)> "),o("span",{staticStyle:{color:"#3333FF"}},[t._v("curl")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("-v")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("-X")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("DELETE")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("--header")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"yellow"}},[t._v('"Content-Type: application/json"')]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("-d")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"yellow"}},[t._v("'{}'")]),o("span",{staticStyle:{color:"dimgray"}}),t._v(" "),o("span",{staticStyle:{color:"aqua"}},[t._v("http://127.0.0.1:5000/api/survey/4 ")]),t._v("\n* Trying 127.0.0.1:5000...\n* Connected to 127.0.0.1 (127.0.0.1) port 5000 (#0)\n> DELETE /api/survey/4 HTTP/1.1\n> Host: 127.0.0.1:5000\n> User-Agent: curl/7.88.1\n> Accept: */*\n> Content-Type: application/json\n> Content-Length: 2\n> \n< HTTP/1.1 200 OK\n< Server: Werkzeug/3.0.3 Python/3.11.2\n< Date: Tue, 21 May 2024 14:45:09 GMT\n< Content-Type: text/html; charset=utf-8\n< Content-Length: 94\n< Connection: close\n< \n[{'id': 4, 'isPaused': 1, 'isNamed': 1, 'name': 'Test 4', 'duration': '2w', 'account_id': 5}]\n* Closing connection 0\n"),o("span",{staticStyle:{color:"dimgray"}}),o("span",{staticStyle:{filter:"contrast(70%) brightness(190%)",color:"lime"}},[t._v("user")]),t._v("@debian-laptop "),o("span",{staticStyle:{color:"lime"}},[t._v("~/D/f/t/f/d/m/e/s/restful-server")]),t._v(" (master)>\n")]),t._v(" "),o("p",[t._v("Бачимо, що ми можемо отримувати інформацію про окремі опитування, змінювати та видаляти їх.")])])}),[],!1,null,null,null);a.default=l.exports}}]);