Commit 492a4051 authored by Dmitry Volodin's avatar Dmitry Volodin
Browse files

Disable mongo index autocreation

--HG--
branch : feature/microservices
parent e3026135
......@@ -36,6 +36,7 @@ class Dashboard(Document):
meta = {
"collection": "noc.dashboards",
"strict": False,
"auto_create_index": False,
"indexes": [
"owner", "tags"
]
......
......@@ -47,6 +47,7 @@ class DashboardLayout(Document):
meta = {
"collection": "noc.dashboardlayouts",
"strict": False,
"auto_create_index": False,
"json_collection": "bi.dashboardlayouts"
}
......
......@@ -20,6 +20,7 @@ class ErrorType(Document):
meta = {
"collection": "noc.errortypes",
"strict": False,
"auto_create_index": False,
"json_collection": "cm.errortypes"
}
name = StringField(unique=True)
......
......@@ -20,6 +20,7 @@ class ObjectFact(Document):
meta = {
"collection": "noc.objectfacts",
"strict": False,
"auto_create_index": False,
"indexes": [
"object",
"attrs.rule"
......
......@@ -24,7 +24,8 @@ class RuleItem(EmbeddedDocument):
class ValidationPolicy(Document):
meta = {
"collection": "noc.validationpolicy",
"strict": False
"strict": False,
"auto_create_index": False
}
name = StringField(unique=True)
......
......@@ -26,6 +26,7 @@ class ValidationPolicySettings(Document):
meta = {
"collection": "noc.validationpolicysettings",
"strict": False,
"auto_create_index": False,
"indexes": [("model_id", "object_id")]
}
model_id = StringField()
......
......@@ -51,7 +51,8 @@ class ObjectItem(EmbeddedDocument):
class ValidationRule(Document):
meta = {
"collection": "noc.validationrules",
"strict": False
"strict": False,
"auto_create_index": False
}
name = StringField(unique=True)
......
......@@ -15,6 +15,8 @@ from noc.models import get_model, iter_model_id, is_document
class Command(BaseCommand):
def handle(self, host=None, port=None, *args, **options):
import noc.lib.nosql
for model_id in iter_model_id():
model = get_model(model_id)
if not model:
......
......@@ -79,5 +79,6 @@ class Command(BaseCommand):
else:
self.print("No directories to pull")
if __name__ == "__main__":
Command().run()
......@@ -20,7 +20,8 @@ from noc.main.models.style import Style
class SubscriberProfile(Document):
meta = {
"collection": "noc.subscriberprofiles",
"strict": False
"strict": False,
"auto_create_index": False
}
name = StringField(unique=True)
......
......@@ -17,7 +17,8 @@ from noc.main.models.style import Style
class SupplierProfile(Document):
meta = {
"collection": "noc.supplierprofiles",
"strict": False
"strict": False,
"auto_create_index": False
}
name = StringField(unique=True)
......
......@@ -36,6 +36,7 @@ class ActiveAlarm(nosql.Document):
"collection": "noc.alarms.active",
"strict": False,
"auto_create_index": False,
"auto_create_index": False,
"indexes": [
"timestamp", "root", "-severity",
("alarm_class", "managed_object"),
......
......@@ -36,6 +36,7 @@ class ActiveEvent(Document):
meta = {
"collection": "noc.events.active",
"strict": False,
"auto_create_index": False,
"indexes": [
"timestamp", "discriminator", "alarms",
("timestamp", "event_class", "managed_object"),
......
......@@ -39,6 +39,7 @@ class AlarmClass(nosql.Document):
meta = {
"collection": "noc.alarmclasses",
"strict": False,
"auto_create_index": False,
"json_collection": "fm.alarmclasses",
"json_depends_on": [
"fm.alarmseverities"
......
......@@ -13,7 +13,8 @@ import noc.lib.nosql as nosql
class AlarmClassCategory(nosql.Document):
meta = {
"collection": "noc.alartmclasscategories", # @todo: Fix bug
"strict": False
"strict": False,
"auto_create_index": False
}
name = nosql.StringField()
parent = nosql.ObjectIdField(required=False)
......
......@@ -20,7 +20,8 @@ class AlarmClassConfig(Document):
"""
meta = {
"collection": "noc.alarmclassconfigs",
"strict": False
"strict": False,
"auto_create_index": False
}
alarm_class = PlainReferenceField(AlarmClass, unique=True)
......
......@@ -12,7 +12,8 @@ import noc.lib.nosql as nosql
class AlarmClassVar(nosql.EmbeddedDocument):
meta = {
"strict": False
"strict": False,
"auto_create_index": False
}
name = nosql.StringField(required=True)
description = nosql.StringField(required=False)
......
......@@ -21,6 +21,7 @@ class AlarmDiagnostic(Document):
meta = {
"collection": "noc.alarmdiagnostic",
"strict": False,
"auto_create_index": False,
"indexes": [
"alarm"
]
......
......@@ -36,6 +36,7 @@ class AlarmDiagnosticConfig(Document):
meta = {
"collection": "noc.alarmdiagnosticconfig",
"strict": False,
"auto_create_index": False,
"indexes": [
"alarm_class"
]
......
......@@ -68,7 +68,8 @@ class AlarmEscalation(Document):
"""
meta = {
"collection": "noc.alarmescalatons",
"strict": False
"strict": False,
"auto_create_index": False
}
name = StringField(unique=True)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment