forked from ohcnetwork/care
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up asset classes (ohcnetwork#2494)
Clean up asset classes (ohcnetwork#2494) --------- Co-authored-by: Aakash Singh <[email protected]>
- Loading branch information
1 parent
05cf1cf
commit 5b2b304
Showing
7 changed files
with
227 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
meta_object_schema = { | ||
"type": "object", | ||
"properties": { | ||
"id": {"type": "string"}, | ||
"local_ip_address": {"type": "string", "format": "ipv4"}, | ||
"middleware_hostname": {"type": "string"}, | ||
"insecure_connection": {"type": "boolean", "default": False}, | ||
"camera_access_key": { | ||
"type": "string", | ||
"pattern": "^[^:]+:[^:]+:[^:]+$", # valid pattern for "abc:def:ghi" , "123:456:789" | ||
}, | ||
}, | ||
"required": ["local_ip_address", "middleware_hostname"], | ||
"allOf": [ | ||
{ | ||
"if": {"properties": {"_name": {"const": "onvif"}}}, | ||
"then": { | ||
"properties": {"camera_access_key": {"type": "string"}}, | ||
"required": [ | ||
"camera_access_key" | ||
], # Require camera_access_key for Onvif | ||
}, | ||
"else": { | ||
"properties": {"id": {"type": "string"}}, | ||
"required": ["id"], # Require id for non-Onvif assets | ||
"not": { | ||
"required": [ | ||
"camera_access_key" | ||
] # Make camera_access_key not required for non-Onvif | ||
}, | ||
}, | ||
} | ||
], | ||
} |
Oops, something went wrong.