Skip to content

Commit ef729ee

Browse files
committed
Add 'contivmodel/' from commit '21d55827df093ccf432760d0ff375dbec276cc9b'
git-subtree-dir: contivmodel git-subtree-mainline: 2e310d6 git-subtree-split: 21d5582
2 parents 2e310d6 + 21d5582 commit ef729ee

File tree

374 files changed

+188247
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

374 files changed

+188247
-0
lines changed

contivmodel/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# data is extracted from this file and merged into spec/docs/contiv.html as part of the build process
2+
# but we don't actually need to keep it around.
3+
spec/docs/auth_proxy.html

contivmodel/Godeps/Godeps.json

+84
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contivmodel/Godeps/Readme

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contivmodel/LICENSE

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright 2017 Cisco Systems Inc. All rights reserved.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software
9+
distributed under the License is distributed on an "AS IS" BASIS,
10+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
See the License for the specific language governing permissions and
12+
limitations under the License.
13+

contivmodel/Makefile

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
.PHONY: all build godep modelgen systemtests
3+
4+
all: build
5+
6+
build: modelgen
7+
@bash ./scripts/build.sh
8+
9+
godep:
10+
godep save ./...
11+
12+
modelgen:
13+
@if [ -z "`which modelgen`" ]; then go get -v github.com/contiv/modelgen; fi
14+
15+
# systemtest runs all of the systemtests
16+
systemtests:
17+
go test -v -timeout 5m ./systemtests -check.v

contivmodel/README.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[![GoDoc](https://godoc.org/github.com/contiv/contivmodel/client?status.png)](https://godoc.org/github.com/contiv/contivmodel/client)
2+
3+
# Contiv Object Model
4+
This is how current object model looks like:
5+
6+
![Contiv Object Model](./contivModel.png "Contiv Object Model")
7+
8+
### Using go client
9+
Here is an example of how to use contiv go client
10+
11+
```
12+
package main
13+
14+
import (
15+
"log"
16+
17+
"github.com/contiv/contivModel/client"
18+
)
19+
20+
func main() {
21+
cl, err := client.NewContivClient("localhost:9999")
22+
if err != nil {
23+
log.Fatal(err)
24+
}
25+
26+
// Define a policy
27+
policy := client.Policy{
28+
TenantName: "tenant1",
29+
PolicyName: "policy",
30+
}
31+
32+
// Create policy
33+
err = cl.PostPolicy(policy)
34+
if err != nil {
35+
log.Errorf("Policy Creation failed. Err: %v", err)
36+
}
37+
}
38+
```

contivmodel/aciGw.json

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"name": "contivModel",
3+
"objects": [
4+
{
5+
"name": "aciGw",
6+
"version": "v1",
7+
"type": "object",
8+
"key": [ "name"],
9+
"cfgProperties": {
10+
"name": {
11+
"type": "string",
12+
"title": "name of this block(must be 'aciGw')",
13+
"length": 64,
14+
"format": "^(aciGw)$",
15+
"ShowSummary": true
16+
},
17+
"pathBindings": {
18+
"type": "string",
19+
"title": "List of ACI fabric ports connected to cluster",
20+
"length": 2048,
21+
"format": "^$|^(topology/pod-[0-9]{1,4}/paths-[0-9]{1,4}/pathep-\\\\[eth[0-9]{1,2}/[0-9]{1,2}\\\\]){1}(,topology/pod-[0-9]{1,4}/paths-[0-9]{1,4}/pathep-\\\\[eth[0-9]{1,2}/[0-9]{1,2}\\\\])*$",
22+
"ShowSummary": true
23+
},
24+
"nodeBindings": {
25+
"type": "string",
26+
"title": "List of ACI complete nodes to be bound",
27+
"length": 2048,
28+
"format": "^$|^(topology/pod-[0-9]{1,4}/node-[0-9]{1,4}){1}(,topology/pod-[0-9]{1,4}/node-[0-9]{1,4})*$",
29+
"ShowSummary": true
30+
},
31+
"physicalDomain": {
32+
"type": "string",
33+
"title": "Name of the physical domain",
34+
"length": 128,
35+
"format": "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\\\-]*[a-zA-Z0-9])\\\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\\\-]*[A-Za-z0-9])$"
36+
},
37+
"enforcePolicies": {
38+
"type": "string",
39+
"title": "Enforce security policy",
40+
"length": 64,
41+
"format": "^(yes|no){1}$",
42+
"ShowSummary": true
43+
},
44+
"includeCommonTenant": {
45+
"type": "string",
46+
"title": "Include common tenant when searching for objects",
47+
"length": 64,
48+
"format": "^(yes|no){1}$",
49+
"ShowSummary": true
50+
}
51+
},
52+
"operProperties": {
53+
"numAppProfiles": {
54+
"type": "int"
55+
}
56+
}
57+
}
58+
]
59+
}

contivmodel/appProfile.json

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "contivModel",
3+
"objects": [
4+
{
5+
"name": "appProfile",
6+
"type": "object",
7+
"version": "v1",
8+
"key": [ "tenantName", "appProfileName" ],
9+
"cfgProperties": {
10+
"tenantName": {
11+
"type": "string",
12+
"title": "Tenant Name",
13+
"length": 64,
14+
"format": "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\\\-]*[a-zA-Z0-9])\\\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\\\-]*[A-Za-z0-9])$"
15+
},
16+
"appProfileName": {
17+
"type": "string",
18+
"title": "Application Profile Name",
19+
"length": 64,
20+
"format": "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\\\-]*[a-zA-Z0-9])\\\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\\\-]*[A-Za-z0-9])$"
21+
},
22+
"endpointGroups": {
23+
"type": "array",
24+
"items": "string",
25+
"title": "Member groups of the appProf"
26+
}
27+
},
28+
"link-sets": {
29+
"endpointGroups": {
30+
"ref": "endpointGroup"
31+
}
32+
},
33+
"links": {
34+
"tenant": {
35+
"ref": "tenant"
36+
}
37+
}
38+
}
39+
]
40+
}

contivmodel/bgphost.json

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"name": "contivModel",
3+
"objects": [{
4+
"name": "Bgp",
5+
"version": "v1",
6+
"type": "object",
7+
"key": ["hostname"],
8+
"cfgProperties": {
9+
"hostname": {
10+
"type": "string",
11+
"title": "host name",
12+
"length": 256,
13+
"format": "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\\\-]*[a-zA-Z0-9])\\\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\\\-]*[A-Za-z0-9])$"
14+
},
15+
"routerip": {
16+
"type": "string",
17+
"title": "Bgp router intf ip",
18+
"format": "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\\\\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3})(\\\\-(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9]))?/(3[0-1]|2[0-9]|1[0-9]|[1-9])$"
19+
},
20+
"as": {
21+
"type": "string",
22+
"title": "AS id",
23+
"length": 64
24+
},
25+
"neighbor-as": {
26+
"type": "string",
27+
"title": "AS id",
28+
"length": 64
29+
},
30+
"neighbor": {
31+
"type": "string",
32+
"title": "Bgp neighbor",
33+
"length": 15,
34+
"format": "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(\\\\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3})?$"
35+
}
36+
},
37+
"operProperties": {
38+
"numRoutes": {
39+
"type": "int",
40+
"title": "number of routes"
41+
},
42+
"neighborStatus": {
43+
"type": "string",
44+
"title": "neighbor status"
45+
},
46+
"adminStatus": {
47+
"type": "string",
48+
"title": "admin status"
49+
},
50+
"routes": {
51+
"type": "array",
52+
"items": "string",
53+
"title": "routes"
54+
}
55+
}
56+
}]
57+
}

0 commit comments

Comments
 (0)