예제 #1
0
    def get(self, args):
        username = args['username']
        if str(username).__contains__('missing'):
            return json_response(username, 400)

        password = args['password']
        if str(password).__contains__('missing'):
            return json_response(password, 400)

        if username == 'gateway-user' and password == 'admin':
            return json_response(
                "Session Token-> BAMAuthToken: r0JiHMTU0NTkyNjAxOTM3MDpucXVvY3RoYWk= <- for User : gateway-user")
        else:
            return json_response('Invalid username or password.', 401)
예제 #2
0
 def post(self, args):
     return json_response('')
예제 #3
0
 def post(self, args):
     return json_response("{:0>6d}".format(random.randint(1, 9999999), 6))
예제 #4
0
 def delete(self, args):
     return json_response('')
예제 #5
0
 def post(self, args):
     name = args['name']
     if str(name).__contains__('wrong'):
         return json_response('option is wrong', 400)
     return json_response("{:0>6d}".format(random.randint(1, 9999999), 6))
예제 #6
0
 def get(self):
     return json_response(system_info)
예제 #7
0
 def get(self):
     return json_response(read_file(bluecat_api_list))