antimatter.session_mixins.general_mixin#

Module Contents#

Classes#

GeneralMixin

Session mixin defining CRUD functionality for other general functionality.

class antimatter.session_mixins.general_mixin.GeneralMixin(authz: antimatter.authz.Authorization, **kwargs)#

Bases: antimatter.session_mixins.base.BaseMixin

Session mixin defining CRUD functionality for other general functionality.

get_private_info() antimatter_api.DomainPrivateInfo#

Returns a Domain’s summary information.

Returns:

The private summary info for a domain

get_public_info() antimatter_api.DomainPublicInfo#

Returns a Domain’s summary information. This endpoint does not require authorization

Returns:

The public summary info for a domain

get_settings() antimatter_api.DomainSettings#

Return the domain settings.

put_settings(settings: antimatter.builders.settings_put.SettingsPutBuilder) antimatter_api.DomainSettings#

Updates the domain settings with the provided settings.

Parameters:

settings – The domain settings to be updated.

Returns:

The domain settings after applying the proposed updates

get_status() antimatter_api.DomainStatus#

Return the domain status, which contains important notifications for administrators of the domain.

list_hooks() List[antimatter_api.DomainHooksListHooksInner]#

Return a list of available hooks in this domain. A hook is a data processor, like a PII classifier

list_resources() List[antimatter_api.DomainResourceSummarySchemaInner]#

Return a list of resource strings that can be used in policy rules, and the set of permissions that you can assign to them.

query_access_log(start_date: datetime.datetime | str | None = None, end_date: datetime.datetime | str | None = None, duration: datetime.timedelta | dateutil.relativedelta.relativedelta | str | None = None, session: str | None = None, location: str | None = None, location_prefixed: bool | None = None, operation_type: str | None = None, allowed_tag: str | antimatter.CapsuleTag | antimatter.ColumnTag | antimatter.SpanTag | None = None, redacted_or_tokenized_tag: str | antimatter.CapsuleTag | antimatter.ColumnTag | antimatter.SpanTag | None = None, capsule_id: str | None = None) Iterator[antimatter_api.AccessLogEntry]#

Query the data access log for this domain. This contains all operations interacting with capsules within this domain. An iterator is returned over the results in reverse chronological order.

Parameters:
  • start_date – The earlier date of the date range. As results are returned in reverse chronological order, this date corresponds with the end of the result set. This should be a timezone-aware datetime, or else will be treated as the system timezone

  • end_date – The later date of the date range. As results are returned in reverse chronological order, this date corresponds with the beginning of the result set. If not specified, defaults to the current time. This should be a timezone-aware datetime, or else will be treated as the system timezone

  • duration – The query time range duration. This can be a timedelta or a string such as ‘2h’. When using duration, by default the query time range ends ‘now’, unless one of start_date or end_date is specified. If both start_date and end_date are specified, duration is ignored. If using a string value, valid time units are “ns”, “us” (or “µs”), “ms”, “s”, “m”, “h”, “d”, “mo”, “y”. These can be grouped together, such as 1h5m30s

  • session – The session you would like to filter on. This will return results for only the provided session. If not specified, this field is ignored

  • location – The location you would like to filter on. This is a matched filter and will return results starting with the provided string. If not specified, this field is ignored

  • location_prefixed – A boolean indicator to indicate that the location you provided is a prefix or not. If this is set to true, then the filter provided in location is treated as a prefix. If not specified, this is treated as false

  • operation_type – The operation you would like to filter on. This will filter on the provided operation type and return all results using the provided operation type. If not specified, this field is ignored

  • allowed_tag – The allow tag key you would like to filter on. This accepts tag key only and will return all allowed tag results matching the provided tag key. If not specified, this field is ignored

  • redacted_or_tokenized_tag – The redacted or tokenized tag key you would like to filter on. This accepts a tag key only and will return all redacted and tokenized tag key results matching the provided tag key. If not specified, this field is ignored

  • capsule_id – The ID for a specific capsule. Use this to limit results to a single capsule

Returns:

An iterator over the access logs matching the filters

query_control_log(start_date: datetime.datetime | str | None = None, end_date: datetime.datetime | str | None = None, duration: datetime.timedelta | dateutil.relativedelta.relativedelta | str | None = None, session: str | None = None, url: str | None = None, description: str | None = None) Iterator[antimatter_api.DomainControlLogEntry]#

Query the domain control-plane audit log. An iterator is returned over the results in reverse chronological order.

Parameters:
  • start_date – The earlier date of the date range. As results are returned in reverse chronological order, this date corresponds with the end of the result set. This should be a timezone-aware datetime, or else will be treated as the system timezone

  • end_date – The later date of the date range. As results are returned in reverse chronological order, this date corresponds with the beginning of the result set. If not specified, defaults to the current time. This should be a timezone-aware datetime, or else will be treated as the system timezone

  • duration – The query time range duration. This can be a timedelta or a string such as ‘2h’. When using duration, by default the query time range ends ‘now’, unless one of start_date or end_date is specified. If both start_date and end_date are specified, duration is ignored. If using a string value, valid time units are “ns”, “us” (or “µs”), “ms”, “s”, “m”, “h”, “d”, “mo”, “y”. These can be grouped together, such as 1h5m30s

  • session – The session you would like to filter on. This will return results for only the provided session. If not specified, this field is ignored

  • url – The URL you would like to filter on. This is a prefix matched filter and will return results starting with the provided string. If not specified, this field is ignored

  • description – The description you would like to filter on. This is an in matched filter and will return results that contain the provided string. If not specified, this field is ignored

Returns:

An iterator over the control logs matching the filters