Пример #1
0
 def to_json(self):
     return to_json(self.json_data,
                    order=[
                        "name", "$collection", "uuid", "description",
                        "preference", "method", "param", "match_method",
                        "value", "action", "profile__name"
                    ])
Пример #2
0
 def to_json(self):
     r = {
         "name": self.name,
         "$collection": self._meta["json_collection"],
         "uuid": self.uuid,
         "single_service": self.single_service,
         "single_client": self.single_client,
         "allow_children": self.allow_children,
     }
     if self.description:
         r["description"] = self.description
     if self.service_model:
         r["service_model"] = self.service_model
     if self.client_model:
         r["client_model"] = self.client_model
     return to_json(
         r,
         order=[
             "name",
             "$collection",
             "uuid",
             "description",
             "service_model",
             "client_model",
             "single_service",
             "single_client",
             "allow_children",
         ],
     )
Пример #3
0
 def to_json(self):
     return to_json(
         self.json_data,
         order=[
             "name", "$collection",
             "uuid", "scope__name", "field_name", "field_type",
             "description", "measure", "vector_tag"])
Пример #4
0
 def to_json(self):
     return to_json(self.json_data,
                    order=[
                        "name", "$collection", "uuid", "vendor__code",
                        "description", "connection_rule__name",
                        "cr_context", "plugins"
                    ])
Пример #5
0
 def to_json(self):
     r = {
         "$collection": self._meta["json_collection"],
         "vendor__name": self.vendor.name,
         "name": self.name,
         "uuid": self.uuid
     }
     if self.aliases:
         r["aliases"] = [str(x) for x in self.aliases]
     if self.description:
         r["description"] = self.description
     if self.start_of_sale:
         r["start_of_sale"] = self.start_of_sale.strftime("%Y-%m-%d")
     if self.end_of_sale:
         r["end_of_sale"] = self.end_of_sale.strftime("%Y-%m-%d")
     if self.end_of_support:
         r["end_of_support"] = self.end_of_support.strftime("%Y-%m-%d")
     if self.snmp_sysobjectid:
         r["snmp_sysobjectid"] = self.snmp_sysobjectid
     return to_json(r,
                    order=[
                        "vendor__name", "name", "$collection", "uuid",
                        "aliases", "description", "start_of_sale",
                        "end_of_sale", "end_of_support", "snmp_sysobjectid"
                    ])
Пример #6
0
 def to_json(self):
     return to_json(self.json_data,
                    order=[
                        "name", "$collection", "uuid", "action__name",
                        "description", "profile", "config_mode",
                        "preference", "match", "commands", "timeout"
                    ])
Пример #7
0
 def to_json(self):
     return to_json(self.json_data,
                    order=[
                        "name", "$collection", "uuid", "description",
                        "revision", "quiz__name", "author", "profile__name",
                        "answers"
                    ])
Пример #8
0
 def to_json(self):
     return to_json({
         "$collection": self._meta["json_collection"],
         "rewrite_mib": self.rewrite_mib,
         "to_mib": self.to_mib,
         "uuid": self.uuid
     }, order=["$collection", "rewrite_mib", "to_mib", "uuid"])
Пример #9
0
 def to_json(self):
     return to_json(
         {
             "name": self.name,
             "$collection": self._meta["json_collection"],
             "uuid": self.uuid,
             "syntax": self.syntax
         },
         order=["name", "$collection", "uuid", "syntax"])
Пример #10
0
 def to_json(self):
     return to_json(
         {
             "name": self.name,
             "$collection": self._meta["json_collection"],
             "uuid": self.uuid,
             "values": self.values
         },
         order=["name", "$collection", "uuid"])
Пример #11
0
 def to_json(self):
     r = {
         "name": self.name,
         "$collection": self._meta["$collection"],
         "uuid": self.uuid
     }
     if self.description:
         r["description"] = self.description
     return to_json(r, order=["name", "$collection", "uuid", "description"])
Пример #12
0
 def to_json(self):
     return to_json(
         {
             "mib": self.mib,
             "$collection": self._meta["json_collection"],
             "uuid": self.uuid,
             "preference": self.preference
         },
         order=["mib", "$collection", "uuid", "preference"])
Пример #13
0
 def to_json(self):
     return to_json(
         {
             "$collection": self._meta["json_collection"],
             "name": self.name,
             "uuid": self.uuid,
             "description": self.description
         },
         order=["name", "uuid", "description"])
Пример #14
0
 def to_json(self):
     return to_json(
         {
             "name": self.name,
             "$collection": self._meta["json_collection"],
             "code": self.code,
             "site": self.site,
             "uuid": self.uuid
         },
         order=["name", "uuid", "code", "site"])
Пример #15
0
 def to_json(self):
     return to_json(
         {
             "$collection": self._meta["json_collection"],
             "profile__name": self.profile.name,
             "vendor__code": self.vendor.code,
             "version": self.version,
             "uuid": self.uuid
         },
         order=["profile__name", "vendor__code", "version", "uuid"])
Пример #16
0
 def to_json(self):
     return to_json(
         {
             "name": self.name,
             "$collection": self._meta["json_collection"],
             "uuid": self.uuid,
             "description": self.description,
             "cells": [s.to_json() for s in self.cells],
         },
         order=["name", "uuid", "description", "cells"],
     )
Пример #17
0
 def to_json(self):
     r = {
         "rewrite_oid": self.rewrite_oid,
         "to_oid": self.to_oid,
         "uuid": self.uuid,
         "$collection": self._meta["json_collection"],
     }
     if self.description:
         r["description"] = self.description
     return to_json(r,
                    order=["$collection", "rewrite_oid", "to_oid", "uuid"])
Пример #18
0
 def to_json(self):
     r = {
         "name": self.name,
         "$collection": self._meta["json_collection"],
         "uuid": self.uuid,
         "subject_template": self.subject_template,
         "body_template": self.body_template
     }
     if self.description:
         r["description"] = self.description
     return to_json(r, order=["name", "$collection",
                              "uuid", "description",
                              "subject_template", "body_template"])
Пример #19
0
 def to_json(self):
     return to_json(
         self.json_data,
         order=[
             "name",
             "$collection",
             "uuid",
             "table_name",
             "description",
             "key_fields",
             "path",
         ],
     )
Пример #20
0
Файл: quiz.py Проект: 0pt1on/noc
 def to_json(self):
     return to_json(
         self.json_data,
         order=[
             "name",
             "$collection",
             "uuid",
             "description",
             "revision",
             "disclaimer",
             "changes",
             "questions",
         ],
     )
Пример #21
0
 def to_json(self):
     return to_json(
         self.json_data,
         order=[
             "name",
             "$collection",
             "uuid",
             "label",
             "description",
             "access_level",
             "handler",
             "params",
         ],
     )
Пример #22
0
 def to_json(self):
     return to_json(
         {
             "name": self.name,
             "$collection": self._meta["json_collection"],
             "uuid": self.uuid,
             "description": self.description,
             "severity": self.severity,
             "style__name": self.style.name
         },
         order=[
             "name", "$collection", "uuid", "description", "severity",
             "style"
         ])
Пример #23
0
 def to_json(self):
     return to_json(
         {
             "name": self.name,
             "$collection": self._meta["json_collection"],
             "uuid": self.uuid,
             "re": self.re,
             "key_re": self.key_re,
             "value_re": self.value_re,
             "rewrite_from": self.rewrite_from,
             "rewrite_to": self.rewrite_to
         },
         order=[
             "name", "uuid", "re", "key_re", "value_re", "rewrite_from",
             "rewrite_to"
         ])
Пример #24
0
 def api_action_json(self, request, ids):
     r = [o.json_data for o in ids]
     s = to_json(r, order=["name", "vendor__code", "description"])
     return {"data": s}
Пример #25
0
 def to_json(self):
     return to_json(self.json_data,
                    order=["name", "$collection",
                           "uuid", "description",
                           "is_vector", "measure"])
Пример #26
0
 def to_json(self):
     return to_json(self.json_data,
                    order=["name", "$collection",
                           "uuid", "description",
                           "context", "rules"])
Пример #27
0
 def to_json(self):
     return to_json(
         self.json_data,
         order=["name", "$collection", "uuid", "description", "type"])