Module static_topo_impl.model.instance

Expand source code
from typing import List

from schematics import Model
from schematics.types import IntType, ListType, ModelType, StringType, URLType


# Use when running as an agent-check
class InstanceInfo(Model):
    instance_url: str = StringType(required=True)
    instance_type: str = StringType(default="static_topo_dsl")
    min_collection_interval: int = IntType(default=300)
    topo_files: List[str] = ListType(StringType(), default=[])


# Rest of configuration used when running in cli mode.
class HealthSyncSpec(Model):
    source_name: str = StringType(required=True, default="static_health")
    stream_id: str = StringType(required=True)
    expiry_interval_seconds: int = IntType(required=False, default=0)  # Never
    repeat_interval_seconds: int = IntType(required=False, default=1800)  # 30 Minutes


class StackStateSpec(Model):
    receiver_url: str = URLType(required=True)
    api_key: str = StringType(required=True)
    instance_type: str = StringType()
    instance_url: str = StringType()
    health_sync: HealthSyncSpec = ModelType(HealthSyncSpec, required=False, default=None)
    internal_hostname: str = StringType(required=True, default="localhost")


class Configuration(Model):
    stackstate: StackStateSpec = ModelType(StackStateSpec, required=True)
    topo_files: List[str] = ListType(StringType(), default=[])

Classes

class Configuration (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=True settings from field definitions. Default: True :param bool strict: Complain about unrecognized keys. Default: True

Expand source code
class Configuration(Model):
    stackstate: StackStateSpec = ModelType(StackStateSpec, required=True)
    topo_files: List[str] = ListType(StringType(), default=[])

Ancestors

  • schematics.deprecated.patch_models..Model
  • schematics.deprecated.ModelCompatibilityMixin
  • schematics.models.Model

Class variables

var stackstateStackStateSpec
var topo_files : List[str]
class HealthSyncSpec (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=True settings from field definitions. Default: True :param bool strict: Complain about unrecognized keys. Default: True

Expand source code
class HealthSyncSpec(Model):
    source_name: str = StringType(required=True, default="static_health")
    stream_id: str = StringType(required=True)
    expiry_interval_seconds: int = IntType(required=False, default=0)  # Never
    repeat_interval_seconds: int = IntType(required=False, default=1800)  # 30 Minutes

Ancestors

  • schematics.deprecated.patch_models..Model
  • schematics.deprecated.ModelCompatibilityMixin
  • schematics.models.Model

Class variables

var expiry_interval_seconds : int
var repeat_interval_seconds : int
var source_name : str
var stream_id : str
class InstanceInfo (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=True settings from field definitions. Default: True :param bool strict: Complain about unrecognized keys. Default: True

Expand source code
class InstanceInfo(Model):
    instance_url: str = StringType(required=True)
    instance_type: str = StringType(default="static_topo_dsl")
    min_collection_interval: int = IntType(default=300)
    topo_files: List[str] = ListType(StringType(), default=[])

Ancestors

  • schematics.deprecated.patch_models..Model
  • schematics.deprecated.ModelCompatibilityMixin
  • schematics.models.Model

Class variables

var instance_type : str
var instance_url : str
var min_collection_interval : int
var topo_files : List[str]
class StackStateSpec (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=True settings from field definitions. Default: True :param bool strict: Complain about unrecognized keys. Default: True

Expand source code
class StackStateSpec(Model):
    receiver_url: str = URLType(required=True)
    api_key: str = StringType(required=True)
    instance_type: str = StringType()
    instance_url: str = StringType()
    health_sync: HealthSyncSpec = ModelType(HealthSyncSpec, required=False, default=None)
    internal_hostname: str = StringType(required=True, default="localhost")

Ancestors

  • schematics.deprecated.patch_models..Model
  • schematics.deprecated.ModelCompatibilityMixin
  • schematics.models.Model

Class variables

var api_key : str
var health_syncHealthSyncSpec
var instance_type : str
var instance_url : str
var internal_hostname : str
var receiver_url : str