def _create_next_relation(self) -> Iterator[GraphRelationship]: # Dashboard > Metric relation dashboard_metric_relation = GraphRelationship( start_label=MetricMetadata.METRIC_NODE_LABEL, start_key=self._get_metric_key(), end_label=MetricMetadata.DASHBOARD_NODE_LABEL, end_key=self._get_dashboard_key(), type=MetricMetadata.METRIC_DASHBOARD_RELATION_TYPE, reverse_type=MetricMetadata.DASHBOARD_METRIC_RELATION_TYPE, attributes={}) yield dashboard_metric_relation # Metric > Metric description relation if self.description: metric_description_relation = GraphRelationship( start_label=MetricMetadata.METRIC_NODE_LABEL, start_key=self._get_metric_key(), end_label=MetricMetadata.DESCRIPTION_NODE_LABEL, end_key=self._get_metric_description_key(), type=MetricMetadata.METRIC_DESCRIPTION_RELATION_TYPE, reverse_type=MetricMetadata.DESCRIPTION_METRIC_RELATION_TYPE, attributes={}) yield metric_description_relation # Metric > Metric tag relation if self.tags: for tag in self.tags: tag_relation = GraphRelationship( start_label=MetricMetadata.METRIC_NODE_LABEL, start_key=self._get_metric_key(), end_label=TagMetadata.TAG_NODE_LABEL, end_key=TagMetadata.get_tag_key(tag), type=MetricMetadata.METRIC_TAG_RELATION_TYPE, reverse_type=MetricMetadata.TAG_METRIC_RELATION_TYPE, attributes={}) yield tag_relation # Metric > Metric type relation if self.type: type_relation = GraphRelationship( start_label=MetricMetadata.METRIC_NODE_LABEL, start_key=self._get_metric_key(), end_label=MetricMetadata.METRIC_TYPE_NODE_LABEL, end_key=self._get_metric_type_key(), type=MetricMetadata.METRIC_METRIC_TYPE_RELATION_TYPE, reverse_type=MetricMetadata.METRIC_TYPE_METRIC_RELATION_TYPE, attributes={}) yield type_relation # FIXME: this logic is wrong and does nothing presently others: List[Any] = [] for rel_tuple in others: if rel_tuple not in MetricMetadata.serialized_rels: MetricMetadata.serialized_rels.add(rel_tuple) yield rel_tuple
def _create_next_node(self): # type: () -> Iterator[Any] # Cluster node if not self._get_cluster_key() in self._processed_cluster: self._processed_cluster.add(self._get_cluster_key()) yield { NODE_LABEL: cluster_constants.CLUSTER_NODE_LABEL, NODE_KEY: self._get_cluster_key(), cluster_constants.CLUSTER_NAME_PROP_KEY: self.cluster } # Dashboard node dashboard_node = { NODE_LABEL: DashboardMetadata.DASHBOARD_NODE_LABEL, NODE_KEY: self._get_dashboard_key(), DashboardMetadata.DASHBOARD_NAME: self.dashboard_name, } if self.created_timestamp: dashboard_node[DashboardMetadata.DASHBOARD_CREATED_TIME_STAMP] = self.created_timestamp if self.dashboard_url: dashboard_node[DashboardMetadata.DASHBOARD_URL] = self.dashboard_url yield dashboard_node # Dashboard group if self.dashboard_group and not self._get_dashboard_group_key() in self._processed_dashboard_group: self._processed_dashboard_group.add(self._get_dashboard_group_key()) dashboard_group_node = { NODE_LABEL: DashboardMetadata.DASHBOARD_GROUP_NODE_LABEL, NODE_KEY: self._get_dashboard_group_key(), DashboardMetadata.DASHBOARD_NAME: self.dashboard_group, } if self.dashboard_group_url: dashboard_group_node[DashboardMetadata.DASHBOARD_GROUP_URL] = self.dashboard_group_url yield dashboard_group_node # Dashboard group description if self.dashboard_group_description: yield {NODE_LABEL: DashboardMetadata.DASHBOARD_DESCRIPTION_NODE_LABEL, NODE_KEY: self._get_dashboard_group_description_key(), DashboardMetadata.DASHBOARD_DESCRIPTION: self.dashboard_group_description} # Dashboard description node if self.description: yield {NODE_LABEL: DashboardMetadata.DASHBOARD_DESCRIPTION_NODE_LABEL, NODE_KEY: self._get_dashboard_description_key(), DashboardMetadata.DASHBOARD_DESCRIPTION: self.description} # Dashboard tag node if self.tags: for tag in self.tags: yield {NODE_LABEL: TagMetadata.TAG_NODE_LABEL, NODE_KEY: TagMetadata.get_tag_key(tag), TagMetadata.TAG_TYPE: 'dashboard'}
def _create_next_relation(self): # type: () -> Iterator[Any] # Cluster <-> Dashboard group yield { RELATION_START_LABEL: cluster_constants.CLUSTER_NODE_LABEL, RELATION_END_LABEL: DashboardMetadata.DASHBOARD_GROUP_NODE_LABEL, RELATION_START_KEY: self._get_cluster_key(), RELATION_END_KEY: self._get_dashboard_group_key(), RELATION_TYPE: DashboardMetadata.CLUSTER_DASHBOARD_GROUP_RELATION_TYPE, RELATION_REVERSE_TYPE: DashboardMetadata.DASHBOARD_GROUP_CLUSTER_RELATION_TYPE } # Dashboard group > Dashboard group description relation if self.dashboard_group_description: yield { RELATION_START_LABEL: DashboardMetadata.DASHBOARD_GROUP_NODE_LABEL, RELATION_END_LABEL: DashboardMetadata.DASHBOARD_DESCRIPTION_NODE_LABEL, RELATION_START_KEY: self._get_dashboard_group_key(), RELATION_END_KEY: self._get_dashboard_group_description_key(), RELATION_TYPE: DashboardMetadata.DASHBOARD_DESCRIPTION_RELATION_TYPE, RELATION_REVERSE_TYPE: DashboardMetadata.DESCRIPTION_DASHBOARD_RELATION_TYPE } # Dashboard group > Dashboard relation yield { RELATION_START_LABEL: DashboardMetadata.DASHBOARD_NODE_LABEL, RELATION_END_LABEL: DashboardMetadata.DASHBOARD_GROUP_NODE_LABEL, RELATION_START_KEY: self._get_dashboard_key(), RELATION_END_KEY: self._get_dashboard_group_key(), RELATION_TYPE: DashboardMetadata.DASHBOARD_DASHBOARD_GROUP_RELATION_TYPE, RELATION_REVERSE_TYPE: DashboardMetadata.DASHBOARD_GROUP_DASHBOARD_RELATION_TYPE } # Dashboard > Dashboard description relation if self.description: yield { RELATION_START_LABEL: DashboardMetadata.DASHBOARD_NODE_LABEL, RELATION_END_LABEL: DashboardMetadata.DASHBOARD_DESCRIPTION_NODE_LABEL, RELATION_START_KEY: self._get_dashboard_key(), RELATION_END_KEY: self._get_dashboard_description_key(), RELATION_TYPE: DashboardMetadata.DASHBOARD_DESCRIPTION_RELATION_TYPE, RELATION_REVERSE_TYPE: DashboardMetadata.DESCRIPTION_DASHBOARD_RELATION_TYPE } # Dashboard > Dashboard tag relation if self.tags: for tag in self.tags: yield { RELATION_START_LABEL: DashboardMetadata.DASHBOARD_NODE_LABEL, RELATION_END_LABEL: TagMetadata.TAG_NODE_LABEL, RELATION_START_KEY: self._get_dashboard_key(), RELATION_END_KEY: TagMetadata.get_tag_key(tag), RELATION_TYPE: DashboardMetadata.DASHBOARD_TAG_RELATION_TYPE, RELATION_REVERSE_TYPE: DashboardMetadata.TAG_DASHBOARD_RELATION_TYPE }
def _create_next_node(self): # type: () -> Iterator[Any] # Dashboard node yield { NODE_LABEL: DashboardMetadata.DASHBOARD_NODE_LABEL, NODE_KEY: self._get_dashboard_key(), DashboardMetadata.DASHBOARD_NAME: self.dashboard_name, } # Dashboard group if self.dashboard_group: yield { NODE_LABEL: DashboardMetadata.DASHBOARD_GROUP_NODE_LABEL, NODE_KEY: self._get_dashboard_group_key(), DashboardMetadata.DASHBOARD_NAME: self.dashboard_group, } # Dashboard group description if self.dashboard_group_description: yield { NODE_LABEL: DashboardMetadata.DASHBOARD_DESCRIPTION_NODE_LABEL, NODE_KEY: self._get_dashboard_group_description_key(), DashboardMetadata.DASHBOARD_DESCRIPTION: self.dashboard_group_description } # Dashboard description node if self.description: yield { NODE_LABEL: DashboardMetadata.DASHBOARD_DESCRIPTION_NODE_LABEL, NODE_KEY: self._get_dashboard_description_key(), DashboardMetadata.DASHBOARD_DESCRIPTION: self.description } # Dashboard last reload time node if self.last_reload_time: yield { NODE_LABEL: DashboardMetadata.DASHBOARD_LAST_RELOAD_TIME_NODE_LABEL, NODE_KEY: self._get_dashboard_last_reload_time_key(), DashboardMetadata.DASHBOARD_LAST_RELOAD_TIME: self.last_reload_time } # Dashboard tag node if self.tags: for tag in self.tags: yield { NODE_LABEL: TagMetadata.TAG_NODE_LABEL, NODE_KEY: TagMetadata.get_tag_key(tag), TagMetadata.TAG_TYPE: 'dashboard' }
def _create_next_node(self) -> Iterator[Any]: # Metric node yield { NODE_LABEL: MetricMetadata.METRIC_NODE_LABEL, NODE_KEY: self._get_metric_key(), MetricMetadata.METRIC_NAME: self.name, MetricMetadata.METRIC_EXPRESSION_VALUE: self.expression } # Description node if self.description: yield { NODE_LABEL: MetricMetadata.DESCRIPTION_NODE_LABEL, NODE_KEY: self._get_metric_description_key(), MetricMetadata.METRIC_DESCRIPTION: self.description } # Metric tag node if self.tags: for tag in self.tags: yield { NODE_LABEL: TagMetadata.TAG_NODE_LABEL, NODE_KEY: TagMetadata.get_tag_key(tag), TagMetadata.TAG_TYPE: 'metric' } # Metric type node if self.type: yield { NODE_LABEL: MetricMetadata.METRIC_TYPE_NODE_LABEL, NODE_KEY: self._get_metric_type_key(), 'name': self.type } # FIXME: this logic is wrong and does nothing presently others: List[Any] = [] for node_tuple in others: if node_tuple not in MetricMetadata.serialized_nodes: MetricMetadata.serialized_nodes.add(node_tuple) yield { NODE_LABEL: node_tuple.label, NODE_KEY: node_tuple.key, 'name': node_tuple.name }
def _create_next_node(self) -> Iterator[GraphNode]: # Metric node metric_node = GraphNode(key=self._get_metric_key(), label=MetricMetadata.METRIC_NODE_LABEL, attributes={ MetricMetadata.METRIC_NAME: self.name, MetricMetadata.METRIC_EXPRESSION_VALUE: self.expression }) yield metric_node # Description node if self.description: description_node = GraphNode( key=self._get_metric_description_key(), label=MetricMetadata.DESCRIPTION_NODE_LABEL, attributes={ MetricMetadata.METRIC_DESCRIPTION: self.description }) yield description_node # Metric tag node if self.tags: for tag in self.tags: tag_node = GraphNode( key=TagMetadata.get_tag_key(tag), label=TagMetadata.TAG_NODE_LABEL, attributes={TagMetadata.TAG_TYPE: 'metric'}) yield tag_node # Metric type node if self.type: type_node = GraphNode(key=self._get_metric_type_key(), label=MetricMetadata.METRIC_TYPE_NODE_LABEL, attributes={'name': self.type}) yield type_node # FIXME: this logic is wrong and does nothing presently others: List[Any] = [] for node_tuple in others: if node_tuple not in MetricMetadata.serialized_nodes: MetricMetadata.serialized_nodes.add(node_tuple) yield node_tuple
def _create_next_relation(self) -> Iterator[Any]: # Dashboard > Metric relation yield { RELATION_START_LABEL: MetricMetadata.METRIC_NODE_LABEL, RELATION_END_LABEL: MetricMetadata.DASHBOARD_NODE_LABEL, RELATION_START_KEY: self._get_metric_key(), RELATION_END_KEY: self._get_dashboard_key(), RELATION_TYPE: MetricMetadata.METRIC_DASHBOARD_RELATION_TYPE, RELATION_REVERSE_TYPE: MetricMetadata.DASHBOARD_METRIC_RELATION_TYPE } # Metric > Metric description relation if self.description: yield { RELATION_START_LABEL: MetricMetadata.METRIC_NODE_LABEL, RELATION_END_LABEL: MetricMetadata.DESCRIPTION_NODE_LABEL, RELATION_START_KEY: self._get_metric_key(), RELATION_END_KEY: self._get_metric_description_key(), RELATION_TYPE: MetricMetadata.METRIC_DESCRIPTION_RELATION_TYPE, RELATION_REVERSE_TYPE: MetricMetadata.DESCRIPTION_METRIC_RELATION_TYPE } # Metric > Metric tag relation if self.tags: for tag in self.tags: yield { RELATION_START_LABEL: MetricMetadata.METRIC_NODE_LABEL, RELATION_END_LABEL: TagMetadata.TAG_NODE_LABEL, RELATION_START_KEY: self._get_metric_key(), RELATION_END_KEY: TagMetadata.get_tag_key(tag), RELATION_TYPE: MetricMetadata.METRIC_TAG_RELATION_TYPE, RELATION_REVERSE_TYPE: MetricMetadata.TAG_METRIC_RELATION_TYPE } # Metric > Metric type relation if self.type: yield { RELATION_START_LABEL: MetricMetadata.METRIC_NODE_LABEL, RELATION_END_LABEL: MetricMetadata.METRIC_TYPE_NODE_LABEL, RELATION_START_KEY: self._get_metric_key(), RELATION_END_KEY: self._get_metric_type_key(), RELATION_TYPE: MetricMetadata.METRIC_METRIC_TYPE_RELATION_TYPE, RELATION_REVERSE_TYPE: MetricMetadata.METRIC_TYPE_METRIC_RELATION_TYPE } # FIXME: this logic is wrong and does nothing presently others: List[Any] = [] for rel_tuple in others: if rel_tuple not in MetricMetadata.serialized_rels: MetricMetadata.serialized_rels.add(rel_tuple) yield { RELATION_START_LABEL: rel_tuple.start_label, RELATION_END_LABEL: rel_tuple.end_label, RELATION_START_KEY: rel_tuple.start_key, RELATION_END_KEY: rel_tuple.end_key, RELATION_TYPE: rel_tuple.type, RELATION_REVERSE_TYPE: rel_tuple.reverse_type }
def _create_record_iterator(self) -> Iterator[RDSModel]: # Cluster if not self._get_cluster_key() in self._processed_cluster: self._processed_cluster.add(self._get_cluster_key()) yield RDSDashboardCluster(rk=self._get_cluster_key(), name=self.cluster) # Dashboard group if self.dashboard_group and not self._get_dashboard_group_key( ) in self._processed_dashboard_group: self._processed_dashboard_group.add( self._get_dashboard_group_key()) dashboard_group_record = RDSDashboardGroup( rk=self._get_dashboard_group_key(), name=self.dashboard_group, cluster_rk=self._get_cluster_key()) if self.dashboard_group_url: dashboard_group_record.dashboard_group_url = self.dashboard_group_url yield dashboard_group_record # Dashboard group description if self.dashboard_group_description: yield RDSDashboardGroupDescription( rk=self._get_dashboard_group_description_key(), description=self.dashboard_group_description, dashboard_group_rk=self._get_dashboard_group_key()) # Dashboard dashboard_record = RDSDashboard( rk=self._get_dashboard_key(), name=self.dashboard_name, dashboard_group_rk=self._get_dashboard_group_key()) if self.created_timestamp: dashboard_record.created_timestamp = self.created_timestamp if self.dashboard_url: dashboard_record.dashboard_url = self.dashboard_url yield dashboard_record # Dashboard description if self.description: yield RDSDashboardDescription( rk=self._get_dashboard_description_key(), description=self.description, dashboard_rk=self._get_dashboard_key()) # Dashboard tag if self.tags: for tag in self.tags: tag_record = RDSTag( rk=TagMetadata.get_tag_key(tag), tag_type='dashboard', ) yield tag_record dashboard_tag_record = RDSDashboardTag( dashboard_rk=self._get_dashboard_key(), tag_rk=TagMetadata.get_tag_key(tag)) yield dashboard_tag_record
def _create_next_relation(self) -> Iterator[GraphRelationship]: # Cluster <-> Dashboard group cluster_dashboard_group_relationship = GraphRelationship( start_label=cluster_constants.CLUSTER_NODE_LABEL, start_key=self._get_cluster_key(), end_label=DashboardMetadata.DASHBOARD_GROUP_NODE_LABEL, end_key=self._get_dashboard_group_key(), type=DashboardMetadata.CLUSTER_DASHBOARD_GROUP_RELATION_TYPE, reverse_type=DashboardMetadata. DASHBOARD_GROUP_CLUSTER_RELATION_TYPE, attributes={}) yield cluster_dashboard_group_relationship # Dashboard group > Dashboard group description relation if self.dashboard_group_description: dashboard_group_description_relationship = GraphRelationship( start_label=DashboardMetadata.DASHBOARD_GROUP_NODE_LABEL, start_key=self._get_dashboard_group_key(), end_label=DashboardMetadata.DASHBOARD_DESCRIPTION_NODE_LABEL, end_key=self._get_dashboard_group_description_key(), type=DashboardMetadata.DASHBOARD_DESCRIPTION_RELATION_TYPE, reverse_type=DashboardMetadata. DESCRIPTION_DASHBOARD_RELATION_TYPE, attributes={}) yield dashboard_group_description_relationship # Dashboard group > Dashboard relation dashboard_group_dashboard_relationship = GraphRelationship( start_label=DashboardMetadata.DASHBOARD_NODE_LABEL, end_label=DashboardMetadata.DASHBOARD_GROUP_NODE_LABEL, start_key=self._get_dashboard_key(), end_key=self._get_dashboard_group_key(), type=DashboardMetadata.DASHBOARD_DASHBOARD_GROUP_RELATION_TYPE, reverse_type=DashboardMetadata. DASHBOARD_GROUP_DASHBOARD_RELATION_TYPE, attributes={}) yield dashboard_group_dashboard_relationship # Dashboard > Dashboard description relation if self.description: dashboard_description_relationship = GraphRelationship( start_label=DashboardMetadata.DASHBOARD_NODE_LABEL, end_label=DashboardMetadata.DASHBOARD_DESCRIPTION_NODE_LABEL, start_key=self._get_dashboard_key(), end_key=self._get_dashboard_description_key(), type=DashboardMetadata.DASHBOARD_DESCRIPTION_RELATION_TYPE, reverse_type=DashboardMetadata. DESCRIPTION_DASHBOARD_RELATION_TYPE, attributes={}) yield dashboard_description_relationship # Dashboard > Dashboard tag relation if self.tags: for tag in self.tags: dashboard_tag_relationship = GraphRelationship( start_label=DashboardMetadata.DASHBOARD_NODE_LABEL, end_label=TagMetadata.TAG_NODE_LABEL, start_key=self._get_dashboard_key(), end_key=TagMetadata.get_tag_key(tag), type=DashboardMetadata.DASHBOARD_TAG_RELATION_TYPE, reverse_type=DashboardMetadata.TAG_DASHBOARD_RELATION_TYPE, attributes={}) yield dashboard_tag_relationship
def _create_next_node(self) -> Iterator[GraphNode]: # Cluster node if not self._get_cluster_key() in self._processed_cluster: self._processed_cluster.add(self._get_cluster_key()) cluster_node = GraphNode( key=self._get_cluster_key(), label=cluster_constants.CLUSTER_NODE_LABEL, attributes={ cluster_constants.CLUSTER_NAME_PROP_KEY: self.cluster }) yield cluster_node # Dashboard node attributes dashboard_node_attributes: Dict[str, Any] = { DashboardMetadata.DASHBOARD_NAME: self.dashboard_name, } if self.created_timestamp: dashboard_node_attributes[ DashboardMetadata. DASHBOARD_CREATED_TIME_STAMP] = self.created_timestamp if self.dashboard_url: dashboard_node_attributes[ DashboardMetadata.DASHBOARD_URL] = self.dashboard_url dashboard_node = GraphNode( key=self._get_dashboard_key(), label=DashboardMetadata.DASHBOARD_NODE_LABEL, attributes=dashboard_node_attributes) yield dashboard_node # Dashboard group if self.dashboard_group and not self._get_dashboard_group_key( ) in self._processed_dashboard_group: self._processed_dashboard_group.add( self._get_dashboard_group_key()) dashboard_group_node_attributes = { DashboardMetadata.DASHBOARD_NAME: self.dashboard_group, } if self.dashboard_group_url: dashboard_group_node_attributes[ DashboardMetadata. DASHBOARD_GROUP_URL] = self.dashboard_group_url dashboard_group_node = GraphNode( key=self._get_dashboard_group_key(), label=DashboardMetadata.DASHBOARD_GROUP_NODE_LABEL, attributes=dashboard_group_node_attributes) yield dashboard_group_node # Dashboard group description if self.dashboard_group_description: dashboard_group_description_node = GraphNode( key=self._get_dashboard_group_description_key(), label=DashboardMetadata.DASHBOARD_DESCRIPTION_NODE_LABEL, attributes={ DashboardMetadata.DASHBOARD_DESCRIPTION: self.dashboard_group_description }) yield dashboard_group_description_node # Dashboard description node if self.description: dashboard_description_node = GraphNode( key=self._get_dashboard_description_key(), label=DashboardMetadata.DASHBOARD_DESCRIPTION_NODE_LABEL, attributes={ DashboardMetadata.DASHBOARD_DESCRIPTION: self.description }) yield dashboard_description_node # Dashboard tag node if self.tags: for tag in self.tags: dashboard_tag_node = GraphNode( key=TagMetadata.get_tag_key(tag), label=TagMetadata.TAG_NODE_LABEL, attributes={TagMetadata.TAG_TYPE: 'dashboard'}) yield dashboard_tag_node
def _create_next_relation(self): # type: () -> Iterator[Any] # Dashboard group > Dashboard relation yield { RELATION_START_LABEL: DashboardMetadata.DASHBOARD_NODE_LABEL, RELATION_END_LABEL: DashboardMetadata.DASHBOARD_GROUP_NODE_LABEL, RELATION_START_KEY: self._get_dashboard_key(), RELATION_END_KEY: self._get_dashboard_group_key(), RELATION_TYPE: DashboardMetadata.DASHBOARD_DASHBOARD_GROUP_RELATION_TYPE, RELATION_REVERSE_TYPE: DashboardMetadata.DASHBOARD_GROUP_DASHBOARD_RELATION_TYPE } # Dashboard > Dashboard description relation if self.description: yield { RELATION_START_LABEL: DashboardMetadata.DASHBOARD_NODE_LABEL, RELATION_END_LABEL: DashboardMetadata.DASHBOARD_DESCRIPTION_NODE_LABEL, RELATION_START_KEY: self._get_dashboard_key(), RELATION_END_KEY: self._get_dashboard_description_key(), RELATION_TYPE: DashboardMetadata.DASHBOARD_DESCRIPTION_RELATION_TYPE, RELATION_REVERSE_TYPE: DashboardMetadata.DESCRIPTION_DASHBOARD_RELATION_TYPE } # Dashboard > Dashboard last reload time relation if self.last_reload_time: yield { RELATION_START_LABEL: DashboardMetadata.DASHBOARD_NODE_LABEL, RELATION_END_LABEL: DashboardMetadata.DASHBOARD_LAST_RELOAD_TIME_NODE_LABEL, RELATION_START_KEY: self._get_dashboard_key(), RELATION_END_KEY: self._get_dashboard_last_reload_time_key(), RELATION_TYPE: DashboardMetadata.DASHBOARD_LAST_RELOAD_TIME_RELATION_TYPE, RELATION_REVERSE_TYPE: DashboardMetadata.LAST_RELOAD_TIME_DASHBOARD_RELATION_TYPE } # Dashboard > Dashboard tag relation if self.tags: for tag in self.tags: yield { RELATION_START_LABEL: DashboardMetadata.DASHBOARD_NODE_LABEL, RELATION_END_LABEL: TagMetadata.TAG_NODE_LABEL, RELATION_START_KEY: self._get_dashboard_key(), RELATION_END_KEY: TagMetadata.get_tag_key(tag), RELATION_TYPE: DashboardMetadata.DASHBOARD_TAG_RELATION_TYPE, RELATION_REVERSE_TYPE: DashboardMetadata.TAG_DASHBOARD_RELATION_TYPE } # Dashboard > Dashboard owner relation others = [ RelTuple( start_label=DashboardMetadata.DASHBOARD_NODE_LABEL, end_label=DashboardMetadata.OWNER_NODE_LABEL, start_key=self._get_dashboard_key(), end_key=self._get_owner_key(), type=DashboardMetadata.DASHBOARD_OWNER_RELATION_TYPE, reverse_type=DashboardMetadata.OWNER_DASHBOARD_RELATION_TYPE) ] for rel_tuple in others: if rel_tuple not in DashboardMetadata.serialized_rels: DashboardMetadata.serialized_rels.add(rel_tuple) yield { RELATION_START_LABEL: rel_tuple.start_label, RELATION_END_LABEL: rel_tuple.end_label, RELATION_START_KEY: rel_tuple.start_key, RELATION_END_KEY: rel_tuple.end_key, RELATION_TYPE: rel_tuple.type, RELATION_REVERSE_TYPE: rel_tuple.reverse_type }