laceworksdk.api.v1.account
Lacework Account API wrapper.
1# -*- coding: utf-8 -*- 2""" 3Lacework Account API wrapper. 4""" 5 6import logging 7 8logger = logging.getLogger(__name__) 9 10 11class AccountAPI: 12 """ 13 Lacework Account API. 14 """ 15 16 def __init__(self, session): 17 """ 18 Initializes the AccountAPI object. 19 20 :param session: An instance of the HttpSession class. 21 22 :return AccountAPI object 23 """ 24 25 super().__init__() 26 27 self._session = session 28 29 def get_org_info(self): 30 """ 31 A method to get Account's organization info 32 33 :return response json 34 """ 35 36 logger.info("Getting Account information from Lacework...") 37 38 # Build the Account request URI 39 api_uri = "/api/v1/external/account/organizationInfo" 40 41 response = self._session.get(api_uri) 42 43 return response.json()
class
AccountAPI:
12class AccountAPI: 13 """ 14 Lacework Account API. 15 """ 16 17 def __init__(self, session): 18 """ 19 Initializes the AccountAPI object. 20 21 :param session: An instance of the HttpSession class. 22 23 :return AccountAPI object 24 """ 25 26 super().__init__() 27 28 self._session = session 29 30 def get_org_info(self): 31 """ 32 A method to get Account's organization info 33 34 :return response json 35 """ 36 37 logger.info("Getting Account information from Lacework...") 38 39 # Build the Account request URI 40 api_uri = "/api/v1/external/account/organizationInfo" 41 42 response = self._session.get(api_uri) 43 44 return response.json()
Lacework Account API.
AccountAPI(session)
17 def __init__(self, session): 18 """ 19 Initializes the AccountAPI object. 20 21 :param session: An instance of the HttpSession class. 22 23 :return AccountAPI object 24 """ 25 26 super().__init__() 27 28 self._session = session
Initializes the AccountAPI object.
Parameters
- session: An instance of the HttpSession class.
:return AccountAPI object
def
get_org_info(self):
30 def get_org_info(self): 31 """ 32 A method to get Account's organization info 33 34 :return response json 35 """ 36 37 logger.info("Getting Account information from Lacework...") 38 39 # Build the Account request URI 40 api_uri = "/api/v1/external/account/organizationInfo" 41 42 response = self._session.get(api_uri) 43 44 return response.json()
A method to get Account's organization info
:return response json