Пример #1
0
# -*- coding: utf-8 -*-
'''
Created on 2017. 5. 30.
@author: HyechurnJang
'''

import pygics

pygics.server('0.0.0.0', 80, '../prometheus')
Пример #2
0
@pygics.rest('GET', '/mul')
def mul(req, a, b):
    return int(a) * int(b)

#===============================================================================
# PREPARED PYGICS REST API
#===============================================================================
# Load module on runtime
# Loading file save under <USER HOME>/.pygics/<SERVICE IP & PORT NAME>/<MODULE NAME>.py
# POST:<HOST>/pygics/module?name=<MODULE NAME>
# HEADERS:CONTENT_TYPE:"text/plain"
# BODY:<PYTHON CODE STRING WRITTEN WITH PYGICS>
# success ----> 200 OK >> {"result" : true}
# failed ----> 200 OK >> {"result" : false}
#
# Delete module on runtime
# DELETE:<HOST>/pygics/module?name=<MODULE NAME>
# success ----> 200 OK >> {"result" : true}
# failed ----> 200 OK >> {"result" : false}

#===============================================================================
# RUN SERVER
#===============================================================================
# Parameters
#    Name         : Type         : Example
#   ------------------------------------ -- -- - -
#    listener     : tuple        : ('<IP OR HOSTNAME>', <PORT>)
#    *file_paths  : [string,]    : 'any/other/path/module1.py', '/from/root/path/module2.py', ...
# pygics.server(('<IP OR HOSTNAME>', <PORT>), 'any/other/path/module1.py', '/from/root/path/module2.py', ...)
pygics.server('0.0.0.0', 80)
Пример #3
0
# -*- coding: utf-8 -*-
'''
Created on 2017. 10. 31.
@author: HyechurnJang
'''

import pygics

pygics.server('0.0.0.0', 80, '../bootpage')
Пример #4
0
# -*- coding: utf-8 -*-
'''
Created on 2018. 4. 27.
@author: HyechurnJang
'''

import os
import pygics
import argparse

if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    
    parser.add_argument('-m', '--mgmt', help='Restricted Mgmt NIC for NameSpace', required=True)
    parser.add_argument('-d', '--database', help='MySQL Database Hostname or IP', default='localhost')
    parser.add_argument('-p', '--password', help='MySQL Root Password', default='rdhcp')
    args = parser.parse_args()
    os.environ['RDHCP_IF_MGMT'] = args.mgmt
    os.environ['RDHCP_DATABASE'] = args.database
    os.environ['RDHCP_PASSWORD'] = args.password
    
    pygics.server('0.0.0.0', 8080, 'engine')
Пример #5
0
# -*- coding: utf-8 -*-
'''
Created on 2017. 5. 30.
@author: HyechurnJang
'''

import pygics

pygics.server('0.0.0.0', 80, '../sparkbot')
Пример #6
0
# -*- coding: utf-8 -*-
'''
Created on 2017. 5. 29.
@author: HyechurnJang
'''

import pygics

pygics.server('0.0.0.0', 80, '../netops')
Пример #7
0
# -*- coding: utf-8 -*-
'''
Created on 2018. 10. 23.
@author: Hyechurn Jang, <*****@*****.**>
'''

from pygics import server

server('0.0.0.0', 80, 'engine')