laceworksdk.api.v1.custom_compliance_config
Lacework Custom Compliance Config API wrapper.
1# -*- coding: utf-8 -*- 2""" 3Lacework Custom Compliance Config API wrapper. 4""" 5 6import logging 7 8logger = logging.getLogger(__name__) 9 10 11class CustomComplianceConfigAPI: 12 """ 13 Lacework Custom Compliance Config API. 14 """ 15 16 def __init__(self, session): 17 """ 18 Initializes the CustomComplianceConfigAPI object. 19 20 :param session: An instance of the HttpSession class. 21 22 :return CustomComplianceConfigAPI object 23 """ 24 25 super().__init__() 26 27 self._session = session 28 29 def get(self): 30 """ 31 A method to get the custom compliance settings from Lacework. 32 33 :return response json 34 """ 35 36 logger.info("Getting custom compliance settings from Lacework...") 37 38 # Build the Custom Compliance Config request URI 39 api_uri = "/api/v1/external/CustomComplianceConfig" 40 41 response = self._session.get(api_uri) 42 43 return response.json() 44 45 def set(self, 46 data): 47 """ 48 A method to set the custom compliance settings in Lacework. 49 50 :param settings: A JSON object 51 52 :return response json 53 """ 54 55 logger.info("Setting custom compliance settings in Lacework...") 56 57 # Build the Custom Compliance Config request URI 58 api_uri = "/api/v1/external/CustomComplianceConfig" 59 60 response = self._session.post(api_uri, data=data) 61 62 return response.json()
class
CustomComplianceConfigAPI:
12class CustomComplianceConfigAPI: 13 """ 14 Lacework Custom Compliance Config API. 15 """ 16 17 def __init__(self, session): 18 """ 19 Initializes the CustomComplianceConfigAPI object. 20 21 :param session: An instance of the HttpSession class. 22 23 :return CustomComplianceConfigAPI object 24 """ 25 26 super().__init__() 27 28 self._session = session 29 30 def get(self): 31 """ 32 A method to get the custom compliance settings from Lacework. 33 34 :return response json 35 """ 36 37 logger.info("Getting custom compliance settings from Lacework...") 38 39 # Build the Custom Compliance Config request URI 40 api_uri = "/api/v1/external/CustomComplianceConfig" 41 42 response = self._session.get(api_uri) 43 44 return response.json() 45 46 def set(self, 47 data): 48 """ 49 A method to set the custom compliance settings in Lacework. 50 51 :param settings: A JSON object 52 53 :return response json 54 """ 55 56 logger.info("Setting custom compliance settings in Lacework...") 57 58 # Build the Custom Compliance Config request URI 59 api_uri = "/api/v1/external/CustomComplianceConfig" 60 61 response = self._session.post(api_uri, data=data) 62 63 return response.json()
Lacework Custom Compliance Config API.
CustomComplianceConfigAPI(session)
17 def __init__(self, session): 18 """ 19 Initializes the CustomComplianceConfigAPI object. 20 21 :param session: An instance of the HttpSession class. 22 23 :return CustomComplianceConfigAPI object 24 """ 25 26 super().__init__() 27 28 self._session = session
Initializes the CustomComplianceConfigAPI object.
Parameters
- session: An instance of the HttpSession class.
:return CustomComplianceConfigAPI object
def
get(self):
30 def get(self): 31 """ 32 A method to get the custom compliance settings from Lacework. 33 34 :return response json 35 """ 36 37 logger.info("Getting custom compliance settings from Lacework...") 38 39 # Build the Custom Compliance Config request URI 40 api_uri = "/api/v1/external/CustomComplianceConfig" 41 42 response = self._session.get(api_uri) 43 44 return response.json()
A method to get the custom compliance settings from Lacework.
:return response json
def
set(self, data):
46 def set(self, 47 data): 48 """ 49 A method to set the custom compliance settings in Lacework. 50 51 :param settings: A JSON object 52 53 :return response json 54 """ 55 56 logger.info("Setting custom compliance settings in Lacework...") 57 58 # Build the Custom Compliance Config request URI 59 api_uri = "/api/v1/external/CustomComplianceConfig" 60 61 response = self._session.post(api_uri, data=data) 62 63 return response.json()
A method to set the custom compliance settings in Lacework.
Parameters
- settings: A JSON object
:return response json