Skip to content
This repository has been archived by the owner on Feb 27, 2020. It is now read-only.

Commit

Permalink
Updates after testing
Browse files Browse the repository at this point in the history
  • Loading branch information
eleanor-merry committed Jul 14, 2017
1 parent 866e247 commit df498cd
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 117 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"server": {
"type": "string",
"format": "uri",
"regex": "^sip:"
"pattern": "^sip:"
},
"priority": {
"type": "integer",
Expand All @@ -27,7 +27,9 @@
"description": "Each number represents a capability, as defined by the operator",
"type": "array",
"items": {
"type": "integer"
"type": "integer",
"maximum": 4294967295,
"minimum": 0
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,13 @@ SCHEMA=/usr/share/clearwater/clearwater-config-manager/scripts/config_validation

. /usr/share/clearwater/utils/check-root-permissions 1

# Validate config json against schema for syntactic errors
python /usr/share/clearwater/clearwater-config-manager/scripts/validate_config.py $SCHEMA $FILENAME
# Pass optional argument directly to upload_json, which checks for --allow-large
# option that allows file upload larger than advisable
/usr/share/clearwater/clearwater-config-manager/scripts/upload_generic_json $FILENAME $KEY $SCHEMA $@

# Abort uploading and warn user if validation fails
rc=$?
if [[ $rc != 0 ]]; then
echo "Abort uploading $FILENAME, pls fix syntax and upload again"
return $rc
if [[ $rc == 0 ]]; then
echo "Successfully uploaded the new ENUM configuration"
fi

# Pass optional argument directly to upload_json, which checks for --allow-large
# option that allows file upload larger than advisable
/usr/share/clearwater/clearwater-config-manager/scripts/upload_json $FILENAME $KEY $1
exit $rc

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@

FILENAME=mmf_targets.json
KEY=mmf_targets_json
SCHEMA=/usr/share/clearwater/clearwater-config-manager/scripts/config_validation/mmf_targets_schema.json

# Pass optional argument directly to upload_json, which checks for --allow-large
# option that allows file upload larger than advisable
/usr/share/clearwater/clearwater-config-manager/scripts/upload_json $FILENAME $KEY $1
/usr/share/clearwater/clearwater-config-manager/scripts/upload_generic_json $FILENAME $KEY $SCHEMA $@

rc=$?
if [[ $rc == 0 ]]; then
echo "Successfully uploaded the new MMF targets configuration"
fi

exit $rc
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,17 @@

FILENAME=s-cscf.json
KEY=scscf_json
SCHEMA=/usr/share/clearwater/clearwater-config-manager/scripts/scscf_schema.json
SCHEMA=/usr/share/clearwater/clearwater-config-manager/scripts/config_validation/scscf_schema.json

. /usr/share/clearwater/utils/check-root-permissions 1

# Validate config json against schema for syntactic errors
python /usr/share/clearwater/clearwater-config-manager/scripts/validate_config.py $SCHEMA $FILENAME
# Pass optional argument directly to upload_json, which checks for --allow-large
# option that allows file upload larger than advisable
/usr/share/clearwater/clearwater-config-manager/scripts/upload_generic_json $FILENAME $KEY $SCHEMA $@

# Abort uploading and warn user if validation fails
rc=$?
if [[ $rc != 0 ]]; then
echo "Abort uploading $FILENAME, pls fix the syntax and upload again"
return $rc
if [[ $rc == 0 ]]; then
echo "Successfully uploaded the new S-CSCF configuration"
fi

# Pass optional argument directly to upload_json, which checks for --allow-large
# option that allows file upload larger than advisable
/usr/share/clearwater/clearwater-config-manager/scripts/upload_json $FILENAME $KEY $1
exit $rc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"domain": {
"type": "string",
"description": "SIP trunk IP address or domain name"
"description": "SIP trunk IP address or domain name",
"maxLength": 253
},
"number": {
Expand All @@ -25,8 +25,7 @@
"type": "array",
"items": {
"type": "string",
"format": "uri",
"regex": "^sip:",
"pattern": "^sip:",
"minItems": 1
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@

FILENAME=bgcf.json
KEY=bgcf_json
SCHEMA=/usr/share/clearwater/clearwater-config-manager/scripts/bgcf_schema.json
SCHEMA=/usr/share/clearwater/clearwater-config-manager/scripts/config_validation/bgcf_schema.json

. /usr/share/clearwater/utils/check-root-permissions 1

# Validate config json against schema for syntactic errors
python /usr/share/clearwater/clearwater-config-manager/scripts/validate_config.py $SCHEMA $FILENAME

# Pass optional argument directly to upload_json, which checks for --allow-large
# option that allows file upload larger than advisable
/usr/share/clearwater/clearwater-config-manager/scripts/upload_json $FILENAME $KEY $1
/usr/share/clearwater/clearwater-config-manager/scripts/upload_generic_json $FILENAME $KEY $SCHEMA $@

rc=$?
if [[ $rc == 0 ]]; then
echo "Successfully uploaded the new BGCF configuration"
fi

exit $rc

0 comments on commit df498cd

Please sign in to comment.