Skip to content

Commit

Permalink
Correction in the request validation structures. In the deploy_template
Browse files Browse the repository at this point in the history
  • Loading branch information
JosePabloOcampo1212 committed Feb 24, 2025
1 parent 2ac074f commit 5ba274a
Show file tree
Hide file tree
Showing 8 changed files with 243 additions and 189 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added
- Cisco_IMC module added

## [2.3.7.9.3] - 2025-02-24
### Bug fix
- Correction in the request validation structures. In the deploy_template functions in version 1 and 2. In 2.3.5.3, 2.3.7.6 and 2.3.7.9.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __init__(self):
},
"memberTemplateDeploymentInfo": {
"items": {
"type": "string"
"type": "object"
},
"type": "array"
},
Expand All @@ -69,7 +69,7 @@ def __init__(self):
},
"resourceParams": {
"items": {
"type": "string"
"type": "object"
},
"type": "array"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ def __init__(self):
"forcePushTemplate": {
"type": "boolean"
},
"copyingConfig": {
"type": "boolean"
},
"isComposite": {
"type": "boolean"
},
Expand All @@ -51,7 +54,7 @@ def __init__(self):
},
"memberTemplateDeploymentInfo": {
"items": {
"type": "string"
"type": "object"
},
"type": "array"
},
Expand All @@ -69,7 +72,7 @@ def __init__(self):
},
"resourceParams": {
"items": {
"type": "string"
"type": "object"
},
"type": "array"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,100 +39,115 @@ def __init__(self):
self._validator = fastjsonschema.compile(json.loads(
'''{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"cliTransport": {
"type": "string"
},
"computeDevice": {
"type": "boolean"
},
"enablePassword": {
"type": "string"
},
"extendedDiscoveryInfo": {
"type": "string"
},
"httpPassword": {
"type": "string"
},
"httpPort": {
"type": "string"
},
"httpSecure": {
"type": "boolean"
},
"httpUserName": {
"type": "string"
},
"ipAddress": {
"items": {
"type": "string"
},
"type": "array"
},
"merakiOrgId": {
"items": {
"type": "string"
},
"type": "array"
},
"netconfPort": {
"type": "string"
},
"password": {
"type": "string"
},
"serialNumber": {
"type": "string"
},
"snmpAuthPassphrase": {
"type": "string"
},
"snmpAuthProtocol": {
"type": "string"
},
"snmpMode": {
"type": "string"
},
"snmpPrivPassphrase": {
"type": "string"
},
"snmpPrivProtocol": {
"type": "string"
},
"snmpROCommunity": {
"type": "string"
},
"snmpRWCommunity": {
"type": "string"
},
"snmpRetry": {
"type": "integer"
},
"snmpTimeout": {
"type": "integer"
},
"snmpUserName": {
"type": "string"
},
"snmpVersion": {
"type": "string"
},
"type": {
"enum": [
"COMPUTE_DEVICE",
"MERAKI_DASHBOARD",
"THIRD_PARTY_DEVICE",
"NETWORK_DEVICE"
],
"type": "string"
},
"userName": {
"type": "string"
"cliTransport": {
"type": "string"
},
"computeDevice": {
"type": "boolean"
},
"enablePassword": {
"type": "string"
},
"extendedDiscoveryInfo": {
"type": "string"
},
"httpPassword": {
"type": "string"
},
"httpPort": {
"type": "string"
},
"httpSecure": {
"type": "boolean"
},
"httpUserName": {
"type": "string"
},
"ipAddress": {
"type": "array",
"items": {
"type": "string"
}
},
"merakiOrgId": {
"type": "array",
"items": {
"type": "string"
}
},
"netconfPort": {
"type": "string"
},
"password": {
"type": "string"
},
"serialNumber": {
"type": "string"
},
"snmpAuthPassphrase": {
"type": "string"
},
"snmpAuthProtocol": {
"type": "string"
},
"snmpMode": {
"type": "string"
},
"snmpPrivPassphrase": {
"type": "string"
},
"snmpPrivProtocol": {
"type": "string"
},
"snmpROCommunity": {
"type": "string"
},
"snmpRWCommunity": {
"type": "string"
},
"snmpRetry": {
"type": "integer"
},
"snmpTimeout": {
"type": "integer"
},
"snmpUserName": {
"type": "string"
},
"snmpVersion": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"COMPUTE_DEVICE",
"MERAKI_DASHBOARD",
"THIRD_PARTY_DEVICE",
"NETWORK_DEVICE"
]
},
"userName": {
"type": "string"
},
"updateMgmtIPaddressList": {
"type": "array",
"items": {
"type": "object",
"properties": {
"existMgmtIpAddress": {
"type": "string"
},
"newMgmtIpAddress": {
"type": "string"
}
},
"required": ["existMgmtIpAddress", "newMgmtIpAddress"]
}
}
}
},
"type": "object"
}'''.replace("\n" + ' ' * 16, '')
}'''.replace("\n" + ' ' * 16, '')
))

def validate(self, request):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ def __init__(self):
"forcePushTemplate": {
"type": "boolean"
},
"copyingConfig": {
"type": "boolean"
},
"isComposite": {
"type": "boolean"
},
Expand Down
Loading

0 comments on commit 5ba274a

Please sign in to comment.