class LinkForm(ObjectForm): template = "object" form_type = HiddenField(default="link") id = HiddenField() source = InstanceField("Source", instance_type="Device") destination = InstanceField("Destination", instance_type="Device") color = StringField("Color")
class TaskForm(BaseForm): template = "object" form_type = HiddenField(default="task") id = HiddenField() is_active = BooleanField("Is Active") name = StringField("Name") description = StringField("Description") start_date = DateField("Start Date") end_date = DateField("End Date") frequency = IntegerField("Frequency", default=0) frequency_unit = SelectField( "Frequency Unit", choices=( ("seconds", "Seconds"), ("minutes", "Minutes"), ("hours", "Hours"), ("days", "Days"), ), ) crontab_expression = StringField("Crontab Expression") job = InstanceField("Job", instance_type="Job") scheduling_mode = SelectField( "Scheduling Mode", choices=(("standard", "Standard Scheduling"), ("cron", "Crontab Scheduling")), ) devices = MultipleInstanceField("Devices", instance_type="Device") pools = MultipleInstanceField("Pools", instance_type="Pool") payload = DictField("Payload")
class RunServiceForm(BaseForm): action = "eNMS.automation.runServicesOnTargets" button_label = "Run Service" button_class = "primary" form_type = HiddenField(default="run_service") targets = HiddenField() type = HiddenField() service = InstanceField("Services", model="service")
class AddServiceForm(BaseForm): action = "addToWorkflow" form_type = HiddenField(default="add_service") services = InstanceField("Add service", model="service") mode = SelectField( "Mode", choices=( ("deep", "Deep Copy (creates a duplicate from the service"), ("shallow", "Shallow Copy (creates a reference to the service"), ), )
class Form(BaseForm): form_type = HiddenField(default="custom") address = SelectField(choices=[("ipv4", "IPv4"), ("ipv6", "IPv6")]) connected_links = MultipleInstanceField("Links", model="link") hostname = StringField("Username", default="admin") ip_address = StringField("IP address") neighbor = InstanceField("Devices", model="device") ports = MultipleInstanceField("Port", model="port") password = PasswordField("Password") carry_customer_traffic = BooleanField("Carry Customer Traffic", default=False)
class WorkflowForm(ServiceForm): form_type = HiddenField(default="workflow") close_connection = BooleanField(default=False) run_method = SelectField( "Run Method", choices=( ("per_device", "Run the workflow device by device"), ( "per_service_with_workflow_targets", "Run the workflow service by service using workflow targets", ), ( "per_service_with_service_targets", "Run the workflow service by service using service targets", ), ), ) superworkflow = InstanceField("Superworkflow")
class IterationForm(ServiceForm): form_type = HiddenField(default="IterationService") has_targets = BooleanField("Has Target Devices") origin_of_values = SelectField( "Where Values come from", choices=( ("user_provided_values", "User-provided Values (dictionary)"), ("yaql_query", "YaQL Query on the Payload"), ), ) user_provided_values = DictField( "Iteration Values for Iteration: User provided " "(Expect dictionary {'all' : [...]} or {'device-name' : [...], ...})" ) yaql_query_values = SubstitutionField( "Iteration Values for Iteration: YaQL query on the payload" ) variable_name = StringField("Iteration Variable Name") iterated_job = InstanceField("Job to run for each Value", instance_type="Job")
class LinkForm(ObjectForm): action = "eNMS.base.processData" form_type = HiddenField(default="link") source = InstanceField("Source", model="device") destination = InstanceField("Destination", model="device") color = StringField("Color")