mirror of
https://github.com/jumpserver/jumpserver.git
synced 2026-05-14 10:43:56 +00:00
15 lines
435 B
Python
15 lines
435 B
Python
from django.conf import settings
|
|
|
|
from pydantic import json
|
|
import requests_unixsocket
|
|
|
|
__all__ = ['request_jdmc']
|
|
|
|
|
|
def request_jdmc(method='GET', path='', timeout=(5, 60), **kwargs):
|
|
''' path: JDMC API path, e.g. /jdmc/api/v1/apps/license '''
|
|
url = settings.JDMC_BASE_URL + path
|
|
with requests_unixsocket.Session() as session:
|
|
response = session.request(method, url, timeout=timeout, **kwargs)
|
|
return response
|