laceworksdk.api.v2.team_users

Lacework TeamUsers API wrapper.

Module Contents

Classes

TeamUsersAPI

A class used to represent the Team Users API endpoint .

class laceworksdk.api.v2.team_users.TeamUsersAPI(session)[source]

Bases: laceworksdk.api.crud_endpoint.CrudEndpoint

A class used to represent the Team Users API endpoint .

The Team Users API works with the new Lacework role-based access control (RBAC) model. After you enable RBAC in the Lacework Console, the Team Users API is available and the legacy Team Members API (deprecated) is disabled.

property session

Get the HttpSession instance the object is using.

get(guid=None)[source]

(Experimental API) A method to get team users. Using no args will get all team users.

Parameters:

guid (str, optional) – The GUID of the team user to get.

Returns:

The requested team user(s)

Return type:

dict

get_by_guid(guid)[source]

(Experimental API) A method to get a TeamUsers object by GUID.

Parameters:

guid (str) – The GUID of the team user to get.

Returns:

The requested team user(s)

Return type:

dict

create(name, email=None, company=None, description=None, user_enabled=True, type='StandardUser', **request_params)[source]

A method to create a new team users standard user object.

Parameters:
  • name (str) – The friendly name of the user.

  • email (str) – The email address of the user (valid only for type=StandardUser).

  • company (str) – The company of the user (valid only for type=StandardUser).

  • description (str) – A description text for describing service accounts (valid only for ServiceUser)

  • user_enabled (bool|int, optional) – Whether the new team user is enabled.

  • type (str, optional) – The type of the user to create. Valid values: “StandardUser”, “ServiceUser” (Default value = “StandardUser”)

  • request_params (dict, optional) – Use to pass any additional parameters the API

Returns:

The newly created team user

Return type:

dict

update(guid, name=None, user_enabled=None, description=None, **request_params)[source]

(Experimental API) A method to update a TeamUsers object.

Parameters:
  • guid (str) – The GUID of the team user to update

  • name (str) – The friendly name of the user.

  • user_enabled (bool|int, optional) – Whether the new team user is enabled.

  • description (str) – A description text for describing service accounts (valid only for ServiceUser).

  • request_params (dict, optional) – Use to pass any additional parameters the API

Returns:

The newly created team user

Return type:

dict

delete(guid)[source]

A method to delete a team user.

Parameters:

guid (str) – The GUID of the team user 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