laceworksdk.api.v2.cloud_accounts
Lacework CloudAccounts API wrapper.
Module Contents
Classes
A class used to represent the Cloud Accounts API endpoint |
- class laceworksdk.api.v2.cloud_accounts.CloudAccountsAPI(session)[source]
Bases:
laceworksdk.api.crud_endpoint.CrudEndpoint
A class used to represent the Cloud Accounts API endpoint
Cloud accounts are integrations between Lacework and cloud providers such as Amazon Web Services, Microsoft Azure, and Google Cloud Platform.
- property session
Get the
HttpSession
instance the object is using.
- create(name, type, enabled, data, **request_params)[source]
A method to create a new cloud accounts integration.
- Parameters:
name (str) – The name of the integration to create.
type (str) – The type of the integration. See the API docs for valid values.
enabled (bool|int) – Whether the object is enabled.
data (dict) –
The definition of the new integration to create. Note this changes depending on the value of the “type” field. See the API docs for valid values.
request_params (dict, optional) – Use to pass any additional parameters the API
- Returns:
Details of the newly created cloud account integration.
- Return type:
dict
- get(guid=None, type=None)[source]
A method to get cloud account integrations. Using no args will get all integrations.
- Parameters:
guid (str, optional) – The GUID of the integration to retrieve.
type (str, optional) – The type of the integration(s) to retrieve. Valid types are: “AwsCfg”, “AwsCtSqs”, “AwsEksAudit”, “AwsUsGovCfg”, “AwsUsGovCtSqs”, “AzureAlSeq”, “AzureCfg”, “GcpAtSes”, “GcpCfg”
- Returns:
The details of the requested integration(s)
- Return type:
dict
- get_by_guid(guid)[source]
A method to get a cloud account integration by its GUID.
- Parameters:
guid (str) – The GUID of the integration to retrieve.
- Returns:
The details of the requested integration.
- Return type:
dict
- get_by_type(type)[source]
A method to get cloud account integration(s) by type.
- Parameters:
type (str, optional) – The type of the integration(s) to retrieve. Valid types are: “AwsCfg”, “AwsCtSqs”, “AwsEksAudit”, “AwsUsGovCfg”, “AwsUsGovCtSqs”, “AzureAlSeq”, “AzureCfg”, “GcpAtSes”, “GcpCfg”
- Returns:
The details of the requested integration(s)
- Return type:
dict
- update(guid, name=None, type=None, enabled=None, data=None, **request_params)[source]
A method to update an CloudAccounts object.
- Parameters:
guid (str) – The GUID of the integration to update.
name (str, optional) – The integration name.
type (str) –
The type of the integration. See the API docs for valid values.
enabled (bool|int) – Whether the object is enabled.
data (dict) –
The definition of the new integration to create. Note this changes depending on the value of the “type” field. See the API docs for valid values.
request_params (dict, optional) – Use to pass any additional parameters the API
- Returns:
The updated details for the integration specified.
- Return type:
dict
- delete(guid)[source]
A method to delete a cloud account integration.
- Parameters:
guid (str) – The integration GUID to delete.
- Returns:
a Requests response object containing the response code
- Return type:
requests.models.Response
- search(json=None)
A method to search objects.
See the API documentation for this API endpoint for valid fields to search against.
NOTE: While the “value” and “values” fields are marked as “optional” you must use one of them, depending on the operation you are using.
- Parameters:
json (dict) –
The desired search parameters:
timeFilter (dict, optional): A dict containing the time frame for the search:
startTime (str): The start time for the search
endTime (str): The end time for the search
filters (list of dict, optional): Filters based on field contents:
field (str): The name of the data field to which the condition applies
expression (str): The comparison operator for the filter condition. Valid values are:
”eq”, “ne”, “in”, “not_in”, “like”, “ilike”, “not_like”, “not_ilike”, “not_rlike”, “rlike”, “gt”, “ge”, “lt”, “le”, “between”
value (str, optional): The value that the condition checks for in the specified field. Use this attribute when using an operator that requires a single value.
values (list of str, optional): The values that the condition checks for in the specified field. Use this attribute when using an operator that requires multiple values.
returns (list of str, optional): The fields to return
- Returns:
returns a dict containing the search results
- Return type:
dict