probator.schema

class probator.schema.ResourceType(data=None, **kargs)

Bases: sqlservice.model.ModelBase, sqlalchemy.ext.declarative.api.BaseModelMixin

Resource type object

resource_type_id

Unique resource type identifier

Type:int
resource_type

Resource type name

Type:str
classmethod get(resource_type)

Returns the ResourceType object for resource_type. If no existing object was found, a new type will be created in the database and returned

Parameters:resource_type (str, int, ResourceType) – Resource type name
Returns:ResourceType
class probator.schema.ResourceProperty(data=None, **kargs)

Bases: sqlservice.model.ModelBase, sqlalchemy.ext.declarative.api.BaseModelMixin

Resource Property object

class probator.schema.Resource(data=None, **kargs)

Bases: sqlservice.model.ModelBase, sqlalchemy.ext.declarative.api.BaseModelMixin

Resource object

resource_id

Unique Resource identifier

Type:str
account_id

ID of the account owning the resource

Type:int
location

Optional location of the resource (eg. aws region)

Type:str, optional
created

Time the resource was created

Type:datetime
updated

Time the resource was last updated

Type:datetime
resource_type

ResourceType reference

Type:str
tags

List of tags applied to the volume

Type:list of Tag
properties

List of properties of the resource

Type:list of ResourceProperty
static get(resource_id)

Return resource by ID

Parameters:resource_id (str) – Unique Resource identifier
Returns:Returns Resource object if found, else None
Return type:Resource
class probator.schema.ResourceMapping(data=None, **kargs)

Bases: sqlservice.model.ModelBase, sqlalchemy.ext.declarative.api.BaseModelMixin

Mapping resource relationships (parent/child)

Warning

This object should never be accessed directly, it should only be updated by SQLAlchemy

id

Internal unique ID

Type:int
parent

ID of the parent object

Type:int
child

ID of the child object

Type:int
class probator.schema.BaseModelMixin(**kwargs)

Bases: probator.schema.base.BaseModelMixin

Mixin class for Model object’s to expose some common functionality

class probator.schema.Account(data=None, **kargs)

Bases: sqlservice.model.ModelBase, sqlalchemy.ext.declarative.api.BaseModelMixin

static get(account_id, account_type_id=None)

Return account by ID and type

Parameters:
  • account_id (int, str) – Unique Account identifier
  • account_type_id (str) – Type of account to get
Returns:

Returns an Account object if found, else None

Return type:

Account

user_has_access(user)

Check if a user has access to view information for the account

Parameters:user (User) – User object to check
Returns:True if user has access to the account, else false
class probator.schema.Tag(resource_id=None, key=None, value=None)

Bases: sqlservice.model.ModelBase, sqlalchemy.ext.declarative.api.BaseModelMixin

Tag object

tag_id

Internal unique ID for the object

Type:int
resource_id

ID of the resource the tag is associated with

Type:str
key

Key of the tag

Type:str
value

Value of the tag

Type:str
created

The first time this tag was defined

Type:datetime
class probator.schema.LogEvent(data=None, **kargs)

Bases: sqlservice.model.ModelBase, sqlalchemy.ext.declarative.api.BaseModelMixin

Log Event object

log_event_id

Internal unique ID

Type:int
level

Log level name

Type:str
levelno

Numeric log level

Type:int
timestamp

Timestamp for log event

Type:datetime
message
Type:str
module
Type:str
filename
Type:str
lineno
Type:int
funcname
Type:str
pathname
Type:str
process_id
Type:int
stacktrace
Type:str
class probator.schema.Email(data=None, **kargs)

Bases: sqlservice.model.ModelBase, sqlalchemy.ext.declarative.api.BaseModelMixin

Email object

email_id

Internal unique ID

Type:int
timestamp

Timestamp when the email was sent

Type:datetime
subsystem

Subsystem that sent the email

Type:str
subject

Subject line

Type:str
sender

Email address of the sender

Type:str
recipients

List of recipients

Type:list of str
uuid

Unique ID for the message (for tracking purposes)

Type:str
message_html

HTML formatted message

Type:str
message_text

Text formatted message

Type:str
to_json(include_body=False)

Exports the object to a JSON friendly dict

Parameters:include_body (bool) – Include the body of the message in the output
Returns:Dict representation of object type
class probator.schema.ConfigNamespace(data=None, **kargs)

Bases: sqlservice.model.ModelBase, sqlalchemy.ext.declarative.api.BaseModelMixin

Configuration Namespace object

namespace_prefix

Unique namespace prefix

Type:str
name

Human-friendly name

Type:str
sort_order

Sorting value

Type:int
config_items

List of configuration items for the namespace

Type:list of ConfigItem
class probator.schema.ConfigItem(data=None, **kargs)

Bases: sqlservice.model.ModelBase, sqlalchemy.ext.declarative.api.BaseModelMixin

Configuration Item object

config_item_id

Internal unique ID

Type:int
key

Name / key of the item

Type:str
value

Value of the config item

Type:str
type

Type of configuration object (string, int, float, array, json)

Type:str
namespace_prefix

Namespace the item is under

Type:str
description

Brief description description of the uses of the config item

Type:str
classmethod get(ns, key)

Fetch an item by namespace and key

Parameters:
  • ns (str) – Namespace prefix
  • key (str) – Item key
Returns:

Returns config item object if found, else None

Return type:

Configitem

class probator.schema.Role(data=None, **kargs)

Bases: sqlservice.model.ModelBase, sqlalchemy.ext.declarative.api.BaseModelMixin

User role object

role_id

Internal unique ID

Type:int
name

Name of the role

Type:str
color

Color used in frontend to distinguish roles at a glance

Type:str
static get(name)

Returns a role object by name if found, else None

Parameters:name (str) – Name of the role to get
Returns:Role,`None`
classmethod from_json(data)

Return object based on JSON / dict input

Parameters:data (dict) – Dictionary containing a serialized Role object
Returns:Role object representing the data
Return type:Role
class probator.schema.User(data=None, **kargs)

Bases: sqlservice.model.ModelBase, sqlalchemy.ext.declarative.api.BaseModelMixin

User object

user_id

Internal unique ID

Type:int
username

Username

Type:str
password

Argon2 hashed password

Type:str
auth_system

Auth System that created the user

Type:str
roles

List of roles applied to the user

Type:list of Role
static add_role(user, roles)

Map roles for user in database

Parameters:
  • user (User) – User to add roles to
  • roles ([Role]) – List of roles to add
Returns:

None

classmethod from_json(data)

Return object based on JSON / dict input

Parameters:data (dict) – Dictionary containing a serialized User object
Returns:User object representing the data
Return type:User
to_json()

Exports the object to a JSON friendly dict

This method uses the base to_json method, but strips the password from the response

Returns:dict
class probator.schema.UserRole(data=None, **kargs)

Bases: sqlservice.model.ModelBase, sqlalchemy.ext.declarative.api.BaseModelMixin

User to role mapping object

Warning

This object should never be accessed directly, it should only be updated by SQLAlchemy

user_role_id

Internal unique ID

Type:int
user_id

ID of the user

Type:int
role_id

ID of the role

Type:int
class probator.schema.AuditLog(data=None, **kargs)

Bases: sqlservice.model.ModelBase, sqlalchemy.ext.declarative.api.BaseModelMixin

Audit Log Event

audit_log_event_id

Internal unique ID

Type:int
timestamp

Timestamp for the event

Type:datetime
actor

Actor (user or subsystem) triggering the event

Type:str
event

Action performed

Type:str
data

Any extra data necessary for describing the event

Type:dict
classmethod log(event=None, actor=None, data=None)

Generate and insert a new event

Parameters:
  • event (str) – Action performed
  • actor (str) – Actor (user or subsystem) triggering the event
  • data (dict) – Any extra data necessary for describing the event
Returns:

None

class probator.schema.SchedulerBatch(data=None, **kargs)

Bases: sqlservice.model.ModelBase, sqlalchemy.ext.declarative.api.BaseModelMixin

class probator.schema.SchedulerJob(data=None, **kargs)

Bases: sqlservice.model.ModelBase, sqlalchemy.ext.declarative.api.BaseModelMixin

class probator.schema.IssueTypeModel(data=None, **kargs)

Bases: sqlservice.model.ModelBase, sqlalchemy.ext.declarative.api.BaseModelMixin

Issue type object

issue_type_id

Unique issue type identifier

Type:int
issue_type

Issue type name

Type:str
classmethod get(issue_type)

Returns the IssueType object for issue_type. If no existing object was found, a new type will be created in the database and returned

Parameters:issue_type (str,int,IssueType) – Issue type name, id or class
Returns:IssueType
class probator.schema.IssuePropertyModel(data=None, **kargs)

Bases: sqlservice.model.ModelBase, sqlalchemy.ext.declarative.api.BaseModelMixin

Issue Property object

class probator.schema.IssueModel(data=None, **kargs)

Bases: sqlservice.model.ModelBase, sqlalchemy.ext.declarative.api.BaseModelMixin

Issue object

issue_id

Unique Issue identifier

Type:str
issue_type

IssueType reference

Type:str
created

Issue creation time

Type:datetime
updated

Last time the issue was updated

Type:datetime
properties

List of properties of the issue

Type:list of IssueProperty
static get(issue_id)

Return issue by ID

Parameters:issue_id (str) – Unique Issue identifier
Returns:Returns Issue object if found, else None
Return type:Issue
class probator.schema.Template(data=None, **kargs)

Bases: sqlservice.model.ModelBase, sqlalchemy.ext.declarative.api.BaseModelMixin

class probator.schema.AccountType(data=None, **kargs)

Bases: sqlservice.model.ModelBase, sqlalchemy.ext.declarative.api.BaseModelMixin

class probator.schema.AccountProperty(data=None, **kargs)

Bases: sqlservice.model.ModelBase, sqlalchemy.ext.declarative.api.BaseModelMixin

class probator.schema.Account(data=None, **kargs)

Bases: sqlservice.model.ModelBase, sqlalchemy.ext.declarative.api.BaseModelMixin

static get(account_id, account_type_id=None)

Return account by ID and type

Parameters:
  • account_id (int, str) – Unique Account identifier
  • account_type_id (str) – Type of account to get
Returns:

Returns an Account object if found, else None

Return type:

Account

user_has_access(user)

Check if a user has access to view information for the account

Parameters:user (User) – User object to check
Returns:True if user has access to the account, else false