Skip to content

Commit

Permalink
Track rules that refer to an epg (#42)
Browse files Browse the repository at this point in the history
* Track rules that refer to an epg

* Track matching endpoint group from rule
  • Loading branch information
jojimt authored and shaleman committed Sep 5, 2016
1 parent f9a424e commit 7ec6db2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
6 changes: 6 additions & 0 deletions client/contivModelClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ type EndpointGroup struct {

type EndpointGroupLinkSets struct {
ExtContractsGrps map[string]Link `json:"ExtContractsGrps,omitempty"`
MatchRules map[string]Link `json:"MatchRules,omitempty"`
Policies map[string]Link `json:"Policies,omitempty"`
Services map[string]Link `json:"Services,omitempty"`
}
Expand Down Expand Up @@ -428,12 +429,17 @@ type Rule struct {

// add link-sets and links
LinkSets RuleLinkSets `json:"link-sets,omitempty"`
Links RuleLinks `json:"links,omitempty"`
}

type RuleLinkSets struct {
Policies map[string]Link `json:"Policies,omitempty"`
}

type RuleLinks struct {
MatchEndpointGroup Link `json:"MatchEndpointGroup,omitempty"`
}

type RuleInspect struct {
Config Rule
}
Expand Down
6 changes: 6 additions & 0 deletions contivModel.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ type EndpointGroup struct {

type EndpointGroupLinkSets struct {
ExtContractsGrps map[string]modeldb.Link `json:"ExtContractsGrps,omitempty"`
MatchRules map[string]modeldb.Link `json:"MatchRules,omitempty"`
Policies map[string]modeldb.Link `json:"Policies,omitempty"`
Services map[string]modeldb.Link `json:"Services,omitempty"`
}
Expand Down Expand Up @@ -302,12 +303,17 @@ type Rule struct {

// add link-sets and links
LinkSets RuleLinkSets `json:"link-sets,omitempty"`
Links RuleLinks `json:"links,omitempty"`
}

type RuleLinkSets struct {
Policies map[string]modeldb.Link `json:"Policies,omitempty"`
}

type RuleLinks struct {
MatchEndpointGroup modeldb.Link `json:"MatchEndpointGroup,omitempty"`
}

type RuleInspect struct {
Config Rule
}
Expand Down
3 changes: 3 additions & 0 deletions endpointGroup.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@
"policies": {
"ref": "policy"
},
"matchRules": {
"ref": "rule"
},
"extContractsGrps": {
"ref": "extContractsGrp"
}
Expand Down
7 changes: 6 additions & 1 deletion rule.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,12 @@
"policies": {
"ref": "policy"
}
}
},
"links": {
"matchEndpointGroup": {
"ref": "endpointGroup"
}
}
}
]
}

0 comments on commit 7ec6db2

Please sign in to comment.