Skip to content

Commit

Permalink
Add ContrailConfig UVE for required object:
Browse files Browse the repository at this point in the history
    . tag
    . project
    . firewall-policy
    . firewall-rule
    . address-group
    . service-group
    . global-application-policy-set
    . local-application-policy-set
    . application-policy-set

Change-Id: Iae7dd7863ea95941d9a24e9406f85d79f2c7624a
Closes-bug: 1729679
  • Loading branch information
ZhiqiangCui committed Nov 21, 2017
1 parent 40c3195 commit ef4de38
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 1 deletion.
65 changes: 64 additions & 1 deletion src/analytics/viz.sandesh
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ const string LOGICAL_IF_TABLE = "ObjectLogicalInterfaceTable"
const string STORAGE_CLUSTER_TABLE = "ObjectStorageClusterTable"
const string USR_DEF_LOG_STAT_TABLE = "UserDefinedLogStatTable"
const string KUBERNETES_MANAGER_TABLE = "ObjectKubernetesManagerNode"
const string TAG_TABLE = "ObjectTagTable"
const string PROJECT_TABLE = "ObjectProjectTable"
const string FIREWALL_POLICY_TABLE = "ObjectFirewallPolicyTable"
const string FIREWALL_RULE_TABLE = "ObjectFirewallRuleTable"
const string ADDRESS_GROUP_TABLE = "ObjectAddressGroupTable"
const string SERVICE_GROUP_TABLE = "ObjectServiceGroupTable"
const string APPLICATION_POLICY_SET_TABLE = "ObjectApplicationPolicySetTable"

const string VN_DISPLAY_NAME = "Virtual Network"
const string VM_DISPLAY_NAME = "Virtual Machine"
Expand Down Expand Up @@ -123,6 +130,13 @@ const string PHYSICAL_IF_DISPLAY_NAME = "Physical Interface"
const string STORAGE_CLUSTER_DISPLAY_NAME = "Storage Cluster"
const string USR_DEF_LOG_STAT_DISPLAY_NAME = "User Defined Log Statistic"
const string KUBERNETES_MANAGER_NODE_DISPLAY_NAME = "Kubernetes Manager Node"
const string TAG_DISPLAY_NAME = "tag"
const string PROJECT_DISPLAY_NAME = "project"
const string FIREWALL_POLICY_DISPLAY_NAME = "firewall policy"
const string FIREWALL_RULE_DISPLAY_NAME = "firewall rule"
const string ADDRESS_GROUP_DISPLAY_NAME = "address group"
const string SERVICE_GROUP_DISPLAY_NAME = "service group"
const string APPLICATION_POLICY_SET_DISPLAY_NAME = "application policy set"

const string SYSTEM_LOG = "SystemLog"
const string OBJECT_LOG = "ObjectLog"
Expand Down Expand Up @@ -559,7 +573,14 @@ const map<string, string> UVE_MAP = {
"logical-interface" : LOGICAL_IF_TABLE,
"storage-cluster" : STORAGE_CLUSTER_TABLE,
"user-defined-log-statistic" : USR_DEF_LOG_STAT_TABLE,
"kubernetes-manager-node" : KUBERNETES_MANAGER_TABLE
"kubernetes-manager-node" : KUBERNETES_MANAGER_TABLE,
"tag" : TAG_TABLE,
"project" : PROJECT_TABLE,
"firewall-policy" : FIREWALL_POLICY_TABLE,
"firewall-rule" : FIREWALL_RULE_TABLE,
"address-group" : ADDRESS_GROUP_TABLE,
"service-group" : SERVICE_GROUP_TABLE,
"application-policy-set" : APPLICATION_POLICY_SET_TABLE
}

struct objtable_info {
Expand Down Expand Up @@ -761,6 +782,48 @@ const map<string, objtable_info> _OBJECT_TABLES = {
'is_uve' : true
'global_system_object' : true
}
TAG_TABLE: {
'objtable_display_name' : TAG_DISPLAY_NAME
'log_query_name' : "tag"
'is_uve' : true
'global_system_object' : false
}
PROJECT_TABLE: {
'objtable_display_name' : PROJECT_DISPLAY_NAME
'log_query_name' : "project"
'is_uve' : true
'global_system_object' : false
}
FIREWALL_POLICY_TABLE: {
'objtable_display_name' : FIREWALL_POLICY_DISPLAY_NAME
'log_query_name' : "firewall-policy"
'is_uve' : true
'global_system_object' : false
}
FIREWALL_RULE_TABLE: {
'objtable_display_name' : FIREWALL_RULE_DISPLAY_NAME
'log_query_name' : "firewall-rule"
'is_uve' : true
'global_system_object' : false
}
ADDRESS_GROUP_TABLE: {
'objtable_display_name' : ADDRESS_GROUP_DISPLAY_NAME
'log_query_name' : "address-group"
'is_uve' : true
'global_system_object' : false
}
SERVICE_GROUP_TABLE: {
'objtable_display_name' : SERVICE_GROUP_DISPLAY_NAME
'log_query_name' : "service-group"
'is_uve' : true
'global_system_object' : false
}
APPLICATION_POLICY_SET_TABLE: {
'objtable_display_name' : APPLICATION_POLICY_SET_DISPLAY_NAME
'log_query_name' : "application-policy-set"
'is_uve' : true
'global_system_object' : false
}
}

// Analytics table schema defination
Expand Down
7 changes: 7 additions & 0 deletions src/config/api-server/vnc_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,13 @@ def __init__(self, api_svr_mgr, db_srv_list, rabbit_servers, rabbit_port,
"service_chain" : ("ServiceChain", False),
"physical_router" : ("ObjectPRouter", True),
"bgp_router": ("ObjectBgpRouter", True),
"tag" : ("ObjectTagTable", False),
"project" : ("ObjectProjectTable", False),
"firewall_policy" : ("ObjectFirewallPolicyTable", False),
"firewall_rule" : ("ObjectFirewallRuleTable", False),
"address_group" : ("ObjectAddressGroupTable", False),
"service_group" : ("ObjectServiceGroupTable", False),
"application_policy_set" : ("ObjectApplicationPolicySetTable", False),
}

self._db_resync_done = gevent.event.Event()
Expand Down

0 comments on commit ef4de38

Please sign in to comment.