add network_route schema
This commit is contained in:
parent
33dd463180
commit
fffcb0963e
@ -108,15 +108,15 @@ const (
|
|||||||
// Manage the state of network routes
|
// Manage the state of network routes
|
||||||
type NetworkRoute struct {
|
type NetworkRoute struct {
|
||||||
Id string
|
Id string
|
||||||
To string `json:"to"`
|
To string `json:"to" yaml:"to"`
|
||||||
Interface string `json:"interface"`
|
Interface string `json:"interface" yaml:"interface"`
|
||||||
Gateway string `json:"gateway"`
|
Gateway string `json:"gateway" yaml:"gateway"`
|
||||||
Metric uint `json:"metric"`
|
Metric uint `json:"metric" yaml:"metric"`
|
||||||
Rtid NetworkRouteTableId `json:"rtid"`
|
Rtid NetworkRouteTableId `json:"rtid" yaml:"rtid"`
|
||||||
RouteType NetworkRouteType `json:"routetype"`
|
RouteType NetworkRouteType `json:"routetype" yaml:"routetype"`
|
||||||
Scope NetworkRouteScope `json:"scope"`
|
Scope NetworkRouteScope `json:"scope" yaml:"scope"`
|
||||||
Proto NetworkRouteProto `json:"proto"`
|
Proto NetworkRouteProto `json:"proto" yaml:"proto"`
|
||||||
State string `json:"state"`
|
State string `json:"state" yaml:"state"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewNetworkRoute() *NetworkRoute {
|
func NewNetworkRoute() *NetworkRoute {
|
||||||
|
@ -13,7 +13,8 @@
|
|||||||
{ "$ref": "package-declaration.jsonschema" },
|
{ "$ref": "package-declaration.jsonschema" },
|
||||||
{ "$ref": "file-declaration.jsonschema" },
|
{ "$ref": "file-declaration.jsonschema" },
|
||||||
{ "$ref": "user-declaration.jsonschema" },
|
{ "$ref": "user-declaration.jsonschema" },
|
||||||
{ "$ref": "exec-declaration.jsonschema" }
|
{ "$ref": "exec-declaration.jsonschema" },
|
||||||
|
{ "$ref": "network_route-declaration.jsonschema" }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"$id": "network_route-declaration.jsonschema",
|
||||||
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||||
|
"title": "network_route-declaration",
|
||||||
|
"type": "object",
|
||||||
|
"required": [ "type", "attributes" ],
|
||||||
|
"properties": {
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Resource type name.",
|
||||||
|
"enum": [ "network_route" ]
|
||||||
|
},
|
||||||
|
"attributes": {
|
||||||
|
"$ref": "network_route.jsonschema"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
43
internal/resource/schemas/network_route.jsonschema
Normal file
43
internal/resource/schemas/network_route.jsonschema
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
"$id": "network_route.jsonschema",
|
||||||
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||||
|
"title": "network_route",
|
||||||
|
"type": "object",
|
||||||
|
"required": [ "to", "gateway", "interface", "rtid", "metric", "type", "scope" ],
|
||||||
|
"properties": {
|
||||||
|
"to": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"gateway": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"interface": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"rtid": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Network route table id",
|
||||||
|
"pattern": "^(local|main|default|all|[0-9]+)$"
|
||||||
|
},
|
||||||
|
"metric": {
|
||||||
|
"type": "integer",
|
||||||
|
"description": "Network route metric",
|
||||||
|
"minimum": 0
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Network route type",
|
||||||
|
"pattern": "^(unicast|local|broadcast|multicast|throw|unreachable|prohibit|blackhole|nat|[0-9]+)$"
|
||||||
|
},
|
||||||
|
"scope": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Network route scope",
|
||||||
|
"pattern": "^(host|link|global|[0-9]+)$"
|
||||||
|
},
|
||||||
|
"proto": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Network route scope",
|
||||||
|
"pattern": "^(kernel|boot|static|[0-9]+)$"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user