Module static_topo_impl.model.stackstate_receiver
Expand source code
from datetime import datetime
from typing import Any, Dict, List
from schematics import Model
from schematics.transforms import blacklist, wholelist
from schematics.types import (BooleanType, DictType, IntType, ListType,
ModelType, StringType)
from static_topo_impl.model.stackstate import (AnyType, Component, Event,
HealthCheckState, Relation,
TimestampType)
class Instance(Model):
instance_type: str = StringType(required=True, serialized_name="type")
url: str = StringType(required=True)
class Options:
roles = {"public": wholelist()}
class TopologySync(Model):
start_snapshot: bool = BooleanType(default=True)
stop_snapshot: bool = BooleanType(default=True)
instance: Instance = ModelType(Instance, required=True)
delete_ids: List[str] = ListType(StringType(), default=[])
components: List[Component] = ListType(ModelType(Component), default=[])
relations: List[Relation] = ListType(ModelType(Relation), default=[])
class Options:
roles = {"public": wholelist()}
class HealthSyncStartSnapshot(Model):
expiry_interval_s: int = IntType()
repeat_interval_s: int = IntType(required=True, default=1800) # 30 Minutes
class Options:
roles = {"public": blacklist("expiry_interval_s")}
class HealthStream(Model):
urn: str = StringType(required=True)
sub_stream_id: str = StringType()
class Options:
roles = {"public": blacklist("sub_stream_id")}
class HealthSync(Model):
start_snapshot: HealthSyncStartSnapshot = ModelType(HealthSyncStartSnapshot, required=True)
stop_snapshot: Dict[str, Any] = DictType(AnyType, required=True, default={})
stream: HealthStream = ModelType(HealthStream, required=True)
check_states: List[HealthCheckState] = ListType(ModelType(HealthCheckState), default=[])
class Options:
roles = {"public": wholelist()}
class ReceiverApi(Model):
apiKey: str = StringType(required=True)
collection_timestamp: datetime = TimestampType(required=True)
internal_hostname: str = StringType(required=True, serialized_name="internalHostname")
events: Dict[str, List[Event]] = DictType(ListType(ModelType(Event), default=[]), default={})
metrics: List[Any] = ListType(AnyType(), default=[])
service_checks: List[Any] = ListType(AnyType(), default=[])
health: List[HealthSync] = ListType(ModelType(HealthSync), default=[])
topologies: List[TopologySync] = ListType(ModelType(TopologySync), default=[])
class Options:
roles = {"public": wholelist()}
class SyncStats(Model):
components: int = IntType()
relations: int = IntType()
checks: int = IntType()
events: int = IntType()
payloads: List[str] = ListType(StringType, default=[])
Classes
class HealthStream (raw_data=None, trusted_data=None, deserialize_mapping=None, init=True, partial=True, strict=True, validate=False, app_data=None, lazy=False, **kwargs)-
Enclosure for fields and validation. Same pattern deployed by Django models, SQLAlchemy declarative extension and other developer friendly libraries.
:param Mapping raw_data: The data to be imported into the model instance. :param Mapping deserialize_mapping: Can be used to provide alternative input names for fields. Values may be strings or lists of strings, keyed by the actual field name. :param bool partial: Allow partial data to validate. Essentially drops the
required=Truesettings from field definitions. Default: True :param bool strict: Complain about unrecognized keys. Default: TrueExpand source code
class HealthStream(Model): urn: str = StringType(required=True) sub_stream_id: str = StringType() class Options: roles = {"public": blacklist("sub_stream_id")}Ancestors
- schematics.deprecated.patch_models.
.Model - schematics.deprecated.ModelCompatibilityMixin
- schematics.models.Model
Class variables
var Optionsvar sub_stream_id : strvar urn : str
- schematics.deprecated.patch_models.
class HealthSync (raw_data=None, trusted_data=None, deserialize_mapping=None, init=True, partial=True, strict=True, validate=False, app_data=None, lazy=False, **kwargs)-
Enclosure for fields and validation. Same pattern deployed by Django models, SQLAlchemy declarative extension and other developer friendly libraries.
:param Mapping raw_data: The data to be imported into the model instance. :param Mapping deserialize_mapping: Can be used to provide alternative input names for fields. Values may be strings or lists of strings, keyed by the actual field name. :param bool partial: Allow partial data to validate. Essentially drops the
required=Truesettings from field definitions. Default: True :param bool strict: Complain about unrecognized keys. Default: TrueExpand source code
class HealthSync(Model): start_snapshot: HealthSyncStartSnapshot = ModelType(HealthSyncStartSnapshot, required=True) stop_snapshot: Dict[str, Any] = DictType(AnyType, required=True, default={}) stream: HealthStream = ModelType(HealthStream, required=True) check_states: List[HealthCheckState] = ListType(ModelType(HealthCheckState), default=[]) class Options: roles = {"public": wholelist()}Ancestors
- schematics.deprecated.patch_models.
.Model - schematics.deprecated.ModelCompatibilityMixin
- schematics.models.Model
Class variables
var Optionsvar check_states : List[HealthCheckState]var start_snapshot : HealthSyncStartSnapshotvar stop_snapshot : Dict[str, Any]var stream : HealthStream
- schematics.deprecated.patch_models.
class HealthSyncStartSnapshot (raw_data=None, trusted_data=None, deserialize_mapping=None, init=True, partial=True, strict=True, validate=False, app_data=None, lazy=False, **kwargs)-
Enclosure for fields and validation. Same pattern deployed by Django models, SQLAlchemy declarative extension and other developer friendly libraries.
:param Mapping raw_data: The data to be imported into the model instance. :param Mapping deserialize_mapping: Can be used to provide alternative input names for fields. Values may be strings or lists of strings, keyed by the actual field name. :param bool partial: Allow partial data to validate. Essentially drops the
required=Truesettings from field definitions. Default: True :param bool strict: Complain about unrecognized keys. Default: TrueExpand source code
class HealthSyncStartSnapshot(Model): expiry_interval_s: int = IntType() repeat_interval_s: int = IntType(required=True, default=1800) # 30 Minutes class Options: roles = {"public": blacklist("expiry_interval_s")}Ancestors
- schematics.deprecated.patch_models.
.Model - schematics.deprecated.ModelCompatibilityMixin
- schematics.models.Model
Class variables
var Optionsvar expiry_interval_s : intvar repeat_interval_s : int
- schematics.deprecated.patch_models.
class Instance (raw_data=None, trusted_data=None, deserialize_mapping=None, init=True, partial=True, strict=True, validate=False, app_data=None, lazy=False, **kwargs)-
Enclosure for fields and validation. Same pattern deployed by Django models, SQLAlchemy declarative extension and other developer friendly libraries.
:param Mapping raw_data: The data to be imported into the model instance. :param Mapping deserialize_mapping: Can be used to provide alternative input names for fields. Values may be strings or lists of strings, keyed by the actual field name. :param bool partial: Allow partial data to validate. Essentially drops the
required=Truesettings from field definitions. Default: True :param bool strict: Complain about unrecognized keys. Default: TrueExpand source code
class Instance(Model): instance_type: str = StringType(required=True, serialized_name="type") url: str = StringType(required=True) class Options: roles = {"public": wholelist()}Ancestors
- schematics.deprecated.patch_models.
.Model - schematics.deprecated.ModelCompatibilityMixin
- schematics.models.Model
Class variables
var Optionsvar instance_type : strvar url : str
- schematics.deprecated.patch_models.
class ReceiverApi (raw_data=None, trusted_data=None, deserialize_mapping=None, init=True, partial=True, strict=True, validate=False, app_data=None, lazy=False, **kwargs)-
Enclosure for fields and validation. Same pattern deployed by Django models, SQLAlchemy declarative extension and other developer friendly libraries.
:param Mapping raw_data: The data to be imported into the model instance. :param Mapping deserialize_mapping: Can be used to provide alternative input names for fields. Values may be strings or lists of strings, keyed by the actual field name. :param bool partial: Allow partial data to validate. Essentially drops the
required=Truesettings from field definitions. Default: True :param bool strict: Complain about unrecognized keys. Default: TrueExpand source code
class ReceiverApi(Model): apiKey: str = StringType(required=True) collection_timestamp: datetime = TimestampType(required=True) internal_hostname: str = StringType(required=True, serialized_name="internalHostname") events: Dict[str, List[Event]] = DictType(ListType(ModelType(Event), default=[]), default={}) metrics: List[Any] = ListType(AnyType(), default=[]) service_checks: List[Any] = ListType(AnyType(), default=[]) health: List[HealthSync] = ListType(ModelType(HealthSync), default=[]) topologies: List[TopologySync] = ListType(ModelType(TopologySync), default=[]) class Options: roles = {"public": wholelist()}Ancestors
- schematics.deprecated.patch_models.
.Model - schematics.deprecated.ModelCompatibilityMixin
- schematics.models.Model
Class variables
var Optionsvar apiKey : strvar collection_timestamp : datetime.datetimevar events : Dict[str, List[Event]]var health : List[HealthSync]var internal_hostname : strvar metrics : List[Any]var service_checks : List[Any]var topologies : List[TopologySync]
- schematics.deprecated.patch_models.
class SyncStats (raw_data=None, trusted_data=None, deserialize_mapping=None, init=True, partial=True, strict=True, validate=False, app_data=None, lazy=False, **kwargs)-
Enclosure for fields and validation. Same pattern deployed by Django models, SQLAlchemy declarative extension and other developer friendly libraries.
:param Mapping raw_data: The data to be imported into the model instance. :param Mapping deserialize_mapping: Can be used to provide alternative input names for fields. Values may be strings or lists of strings, keyed by the actual field name. :param bool partial: Allow partial data to validate. Essentially drops the
required=Truesettings from field definitions. Default: True :param bool strict: Complain about unrecognized keys. Default: TrueExpand source code
class SyncStats(Model): components: int = IntType() relations: int = IntType() checks: int = IntType() events: int = IntType() payloads: List[str] = ListType(StringType, default=[])Ancestors
- schematics.deprecated.patch_models.
.Model - schematics.deprecated.ModelCompatibilityMixin
- schematics.models.Model
Class variables
var checks : intvar components : intvar events : intvar payloads : List[str]var relations : int
- schematics.deprecated.patch_models.
class TopologySync (raw_data=None, trusted_data=None, deserialize_mapping=None, init=True, partial=True, strict=True, validate=False, app_data=None, lazy=False, **kwargs)-
Enclosure for fields and validation. Same pattern deployed by Django models, SQLAlchemy declarative extension and other developer friendly libraries.
:param Mapping raw_data: The data to be imported into the model instance. :param Mapping deserialize_mapping: Can be used to provide alternative input names for fields. Values may be strings or lists of strings, keyed by the actual field name. :param bool partial: Allow partial data to validate. Essentially drops the
required=Truesettings from field definitions. Default: True :param bool strict: Complain about unrecognized keys. Default: TrueExpand source code
class TopologySync(Model): start_snapshot: bool = BooleanType(default=True) stop_snapshot: bool = BooleanType(default=True) instance: Instance = ModelType(Instance, required=True) delete_ids: List[str] = ListType(StringType(), default=[]) components: List[Component] = ListType(ModelType(Component), default=[]) relations: List[Relation] = ListType(ModelType(Relation), default=[]) class Options: roles = {"public": wholelist()}Ancestors
- schematics.deprecated.patch_models.
.Model - schematics.deprecated.ModelCompatibilityMixin
- schematics.models.Model
Class variables
var Optionsvar components : List[Component]var delete_ids : List[str]var instance : Instancevar relations : List[Relation]var start_snapshot : boolvar stop_snapshot : bool
- schematics.deprecated.patch_models.