Fix connections
This commit is contained in:
@@ -16,7 +16,6 @@ import io
|
||||
import zlib
|
||||
import os.path
|
||||
import requests
|
||||
from .reqs_graphql import get_catalog, get_object
|
||||
import xml.etree.ElementTree as ET
|
||||
from .reqs.request_xml_service import RequestXmlService
|
||||
import zipfile
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
|
||||
class Config:
|
||||
ret_path: str = 'http://10.10.8.83:32200/'
|
||||
self_bnd: str = 'bnd127'
|
||||
enserver: str = 'http://10.10.8.83:32210/xmlrpc'
|
||||
remote_bnd: str = 'bnd128'
|
||||
|
||||
pg_host: str = '10.10.8.83'
|
||||
pg_port: int = 32101
|
||||
@@ -27,7 +24,3 @@ class Config:
|
||||
s3_key_id: str = 's57'
|
||||
s3_access_key: str = 'd9MMinLF3U8TLSj'
|
||||
s3_bucket: str = 'itv'
|
||||
|
||||
gql_url: str = 'https://gql.ivazh.ru/graphql'
|
||||
gql_download: str = 'https://gql.ivazh.ru/item/{key}'
|
||||
gql_schema: str = 'pdim'
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
from gql import gql, Client
|
||||
from gql.transport.aiohttp import AIOHTTPTransport
|
||||
from .config import Config
|
||||
|
||||
transport = AIOHTTPTransport(url=Config.gql_url)
|
||||
service = Config.gql_schema
|
||||
|
||||
|
||||
def get_classifier():
|
||||
client = Client(transport=transport, fetch_schema_from_transport=True, execute_timeout=None)
|
||||
query = gql(
|
||||
"""
|
||||
query getClassifier($name: String!) {
|
||||
getClassifier(name: $name)
|
||||
}
|
||||
"""
|
||||
)
|
||||
result = client.execute(query, variable_values={"name": service}, )
|
||||
return result['getClassifier']
|
||||
|
||||
|
||||
def get_catalog():
|
||||
client = Client(transport=transport, fetch_schema_from_transport=True, execute_timeout=None)
|
||||
query = gql(
|
||||
"""
|
||||
query getCatalog($name: String!) {
|
||||
getCatalog(name: $name)
|
||||
}
|
||||
"""
|
||||
)
|
||||
result = client.execute(query, variable_values={"name": service})
|
||||
return result['getCatalog']
|
||||
|
||||
|
||||
def get_object(oid: str):
|
||||
client = Client(transport=transport, fetch_schema_from_transport=True, execute_timeout=None)
|
||||
query = gql(
|
||||
"""
|
||||
query getObjects($oid: String!, $name: String!) {
|
||||
getObject(name: $name, oid: $oid)
|
||||
}
|
||||
"""
|
||||
)
|
||||
params = {'oid': oid, 'name': service}
|
||||
result = client.execute(query, variable_values=params)
|
||||
return result['getObject']
|
||||
Reference in New Issue
Block a user