summaryrefslogtreecommitdiff
path: root/src/services/vyos-http-api-server
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2021-08-06 14:55:55 -0500
committerJohn Estabrook <jestabro@vyos.io>2021-08-06 14:55:55 -0500
commit56467e9967d9bb3c5588bb76493a71868e177a10 (patch)
tree22196f7442102df1c92a76eac5ff5a8441038bcc /src/services/vyos-http-api-server
parent158d6f2141d5b7c8a0b234d7b4089dd5174c592b (diff)
downloadvyos-1x-56467e9967d9bb3c5588bb76493a71868e177a10.tar.gz
vyos-1x-56467e9967d9bb3c5588bb76493a71868e177a10.zip
Revert "http-api: T2768: example using GraphQL for high-level config operations"
This reverts commit a2b959c50c96698da173b9c4720369a51442cc5c.
Diffstat (limited to 'src/services/vyos-http-api-server')
-rwxr-xr-xsrc/services/vyos-http-api-server27
1 files changed, 0 insertions, 27 deletions
diff --git a/src/services/vyos-http-api-server b/src/services/vyos-http-api-server
index cd7c92270..cbf321dc8 100755
--- a/src/services/vyos-http-api-server
+++ b/src/services/vyos-http-api-server
@@ -36,16 +36,10 @@ from starlette.datastructures import FormData, MutableHeaders
from starlette.formparsers import FormParser, MultiPartParser
from multipart.multipart import parse_options_header
-from ariadne import make_executable_schema, load_schema_from_path, snake_case_fallback_resolvers
-from ariadne.asgi import GraphQL
-
import vyos.config
-import vyos.defaults
from vyos.configsession import ConfigSession, ConfigSessionError
-import api.state
-
DEFAULT_CONFIG_FILE = '/etc/vyos/http-api.conf'
CFG_GROUP = 'vyattacfg'
@@ -609,25 +603,6 @@ def show_op(data: ShowModel):
return success(res)
-###
-# GraphQL integration
-###
-
-api.state.init()
-
-from api.graphql.mutations import mutation
-from api.graphql.directives import DataDirective
-
-api_schema_dir = vyos.defaults.directories['api_schema']
-
-type_defs = load_schema_from_path(api_schema_dir)
-
-schema = make_executable_schema(type_defs, mutation, snake_case_fallback_resolvers, directives={"generate": DataDirective})
-
-app.add_route('/graphql', GraphQL(schema, debug=True))
-
-###
-
if __name__ == '__main__':
# systemd's user and group options don't work, do it by hand here,
# else no one else will be able to commit
@@ -651,8 +626,6 @@ if __name__ == '__main__':
app.state.vyos_debug = True if server_config['debug'] == 'true' else False
app.state.vyos_strict = True if server_config['strict'] == 'true' else False
- api.state.settings['app'] = app
-
try:
uvicorn.run(app, host=server_config["listen_address"],
port=int(server_config["port"]),