Skip to content

Commit

Permalink
[improve] Implement cascading parameter list for SNMP protocol (#1976)
Browse files Browse the repository at this point in the history
  • Loading branch information
zuobiao-zhou authored May 13, 2024
1 parent 9263727 commit ca93a65
Show file tree
Hide file tree
Showing 13 changed files with 387 additions and 265 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,13 @@ public class ParamDefine {
@LastModifiedDate
private LocalDateTime gmtUpdate;

/**
* Depends on which parameters
*/
@Schema(title = "Depends on which parameters", example = "{0, 1}", accessMode = READ_WRITE)
@Convert(converter = JsonStringListAttributeConverter.class)
private List<Object> parent;

/**
* Parameter option configuration
*/
Expand Down
20 changes: 17 additions & 3 deletions manager/src/main/resources/define/app-cisco_switch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ params:
# default value
defaultValue: 161
# field-param field key
- field: version
- field: snmpVersion
# name-param field display i18n name
name:
zh-CN: SNMP 版本
Expand Down Expand Up @@ -87,6 +87,8 @@ params:
required: false
# param field input placeholder
placeholder: 'Snmp community for v1 v2c'
# dependent parameter values list
parent: [ 0,1 ]
# field-param field key
- field: username
# name-param field display i18n name
Expand All @@ -101,6 +103,8 @@ params:
required: false
# param field input placeholder
placeholder: 'Snmp username for v3'
# dependent parameter values list
parent: [ 3 ]
# field-param field key
- field: contextName
# name-param field display i18n name
Expand All @@ -115,6 +119,8 @@ params:
required: false
# param field input placeholder
placeholder: 'Snmp contextName for v3'
# dependent parameter values list
parent: [ 3 ]
# field-param field key
- field: authPassphrase
# name-param field display i18n name
Expand All @@ -129,6 +135,8 @@ params:
required: false
# param field input placeholder
placeholder: 'Snmp authPassword for v3'
# dependent parameter values list
parent: [ 3 ]
# field-param field key
- field: authPasswordEncryption
# name-param field display i18n name
Expand All @@ -145,6 +153,8 @@ params:
value: 0
- label: SHA1
value: 1
# dependent parameter values list
parent: [ 3 ]
# field-param field key
- field: privPassphrase
# name-param field display i18n name
Expand All @@ -159,6 +169,8 @@ params:
required: false
# param field input placeholder
placeholder: 'Snmp authPassword for v3'
# dependent parameter values list
parent: [ 3 ]
# field-param field key
- field: privPasswordEncryption
# name-param field display i18n name
Expand All @@ -175,6 +187,8 @@ params:
value: 0
- label: AES128
value: 1
# dependent parameter values list
parent: [ 3 ]
# field-param field key
- field: timeout
# name-param field display i18n name
Expand Down Expand Up @@ -261,7 +275,7 @@ metrics:
# snmp community
community: ^_^community^_^
# snmp version
version: ^_^version^_^
version: ^_^snmpVersion^_^
# snmp operation: get, walk
operation: get
# metrics oids: metric_name - oid_value
Expand Down Expand Up @@ -389,7 +403,7 @@ metrics:
contextName: ^_^contextName^_^
timeout: ^_^timeout^_^
community: ^_^community^_^
version: ^_^version^_^
version: ^_^snmpVersion^_^
operation: walk
oids:
ifIndex: 1.3.6.1.2.1.2.2.1.1
Expand Down
20 changes: 17 additions & 3 deletions manager/src/main/resources/define/app-h3c_switch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ params:
# default value
defaultValue: 161
# field-param field key
- field: version
- field: snmpVersion
# name-param field display i18n name
name:
zh-CN: SNMP 版本
Expand Down Expand Up @@ -87,6 +87,8 @@ params:
required: false
# param field input placeholder
placeholder: 'Snmp community for v1 v2c'
# dependent parameter values list
parent: [ 0,1 ]
# field-param field key
- field: username
# name-param field display i18n name
Expand All @@ -101,6 +103,8 @@ params:
required: false
# param field input placeholder
placeholder: 'Snmp username for v3'
# dependent parameter values list
parent: [ 3 ]
# field-param field key
- field: contextName
# name-param field display i18n name
Expand All @@ -115,6 +119,8 @@ params:
required: false
# param field input placeholder
placeholder: 'Snmp contextName for v3'
# dependent parameter values list
parent: [ 3 ]
# field-param field key
- field: authPassphrase
# name-param field display i18n name
Expand All @@ -129,6 +135,8 @@ params:
required: false
# param field input placeholder
placeholder: 'Snmp authPassword for v3'
# dependent parameter values list
parent: [ 3 ]
# field-param field key
- field: authPasswordEncryption
# name-param field display i18n name
Expand All @@ -145,6 +153,8 @@ params:
value: 0
- label: SHA1
value: 1
# dependent parameter values list
parent: [ 3 ]
# field-param field key
- field: privPassphrase
# name-param field display i18n name
Expand All @@ -159,6 +169,8 @@ params:
required: false
# param field input placeholder
placeholder: 'Snmp authPassword for v3'
# dependent parameter values list
parent: [ 3 ]
# field-param field key
- field: privPasswordEncryption
# name-param field display i18n name
Expand All @@ -175,6 +187,8 @@ params:
value: 0
- label: AES128
value: 1
# dependent parameter values list
parent: [ 3 ]
# field-param field key
- field: timeout
# name-param field display i18n name
Expand Down Expand Up @@ -261,7 +275,7 @@ metrics:
# snmp 团体字
community: ^_^community^_^
# snmp version
version: ^_^version^_^
version: ^_^snmpVersion^_^
# snmp operation: get, walk
operation: get
# metrics oids: metric_name - oid_value
Expand Down Expand Up @@ -388,7 +402,7 @@ metrics:
contextName: ^_^contextName^_^
timeout: ^_^timeout^_^
community: ^_^community^_^
version: ^_^version^_^
version: ^_^snmpVersion^_^
operation: walk
oids:
ifIndex: 1.3.6.1.2.1.2.2.1.1
Expand Down
20 changes: 17 additions & 3 deletions manager/src/main/resources/define/app-hpe_switch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ params:
# default value
defaultValue: 161
# field-param field key
- field: version
- field: snmpVersion
# name-param field display i18n name
name:
zh-CN: SNMP 版本
Expand Down Expand Up @@ -87,6 +87,8 @@ params:
required: false
# param field input placeholder
placeholder: 'Snmp community for v1 v2c'
# dependent parameter values list
parent: [ 0,1 ]
# field-param field key
- field: username
# name-param field display i18n name
Expand All @@ -101,6 +103,8 @@ params:
required: false
# param field input placeholder
placeholder: 'Snmp username for v3'
# dependent parameter values list
parent: [ 3 ]
# field-param field key
- field: contextName
# name-param field display i18n name
Expand All @@ -115,6 +119,8 @@ params:
required: false
# param field input placeholder
placeholder: 'Snmp contextName for v3'
# dependent parameter values list
parent: [ 3 ]
# field-param field key
- field: authPassphrase
# name-param field display i18n name
Expand All @@ -129,6 +135,8 @@ params:
required: false
# param field input placeholder
placeholder: 'Snmp authPassword for v3'
# dependent parameter values list
parent: [ 3 ]
# field-param field key
- field: authPasswordEncryption
# name-param field display i18n name
Expand All @@ -145,6 +153,8 @@ params:
value: 0
- label: SHA1
value: 1
# dependent parameter values list
parent: [ 3 ]
# field-param field key
- field: privPassphrase
# name-param field display i18n name
Expand All @@ -159,6 +169,8 @@ params:
required: false
# param field input placeholder
placeholder: 'Snmp authPassword for v3'
# dependent parameter values list
parent: [ 3 ]
# field-param field key
- field: privPasswordEncryption
# name-param field display i18n name
Expand All @@ -175,6 +187,8 @@ params:
value: 0
- label: AES128
value: 1
# dependent parameter values list
parent: [ 3 ]
# field-param field key
- field: timeout
# name-param field display i18n name
Expand Down Expand Up @@ -261,7 +275,7 @@ metrics:
# snmp 团体字
community: ^_^community^_^
# snmp version
version: ^_^version^_^
version: ^_^snmpVersion^_^
# snmp operation: get, walk
operation: get
# metrics oids: metric_name - oid_value
Expand Down Expand Up @@ -389,7 +403,7 @@ metrics:
contextName: ^_^contextName^_^
timeout: ^_^timeout^_^
community: ^_^community^_^
version: ^_^version^_^
version: ^_^snmpVersion^_^
operation: walk
oids:
ifIndex: 1.3.6.1.2.1.2.2.1.1
Expand Down
20 changes: 17 additions & 3 deletions manager/src/main/resources/define/app-huawei_switch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ params:
# default value
defaultValue: 161
# field-param field key
- field: version
- field: snmpVersion
# name-param field display i18n name
name:
zh-CN: SNMP 版本
Expand Down Expand Up @@ -87,6 +87,8 @@ params:
required: false
# param field input placeholder
placeholder: 'Snmp community for v1 v2c'
# dependent parameter values list
parent: [ 0,1 ]
# field-param field key
- field: username
# name-param field display i18n name
Expand All @@ -101,6 +103,8 @@ params:
required: false
# param field input placeholder
placeholder: 'Snmp username for v3'
# dependent parameter values list
parent: [ 3 ]
# field-param field key
- field: contextName
# name-param field display i18n name
Expand All @@ -115,6 +119,8 @@ params:
required: false
# param field input placeholder
placeholder: 'Snmp contextName for v3'
# dependent parameter values list
parent: [ 3 ]
# field-param field key
- field: authPassphrase
# name-param field display i18n name
Expand All @@ -129,6 +135,8 @@ params:
required: false
# param field input placeholder
placeholder: 'Snmp authPassword for v3'
# dependent parameter values list
parent: [ 3 ]
# field-param field key
- field: authPasswordEncryption
# name-param field display i18n name
Expand All @@ -145,6 +153,8 @@ params:
value: 0
- label: SHA1
value: 1
# dependent parameter values list
parent: [ 3 ]
# field-param field key
- field: privPassphrase
# name-param field display i18n name
Expand All @@ -159,6 +169,8 @@ params:
required: false
# param field input placeholder
placeholder: 'Snmp authPassword for v3'
# dependent parameter values list
parent: [ 3 ]
# field-param field key
- field: privPasswordEncryption
# name-param field display i18n name
Expand All @@ -175,6 +187,8 @@ params:
value: 0
- label: AES128
value: 1
# dependent parameter values list
parent: [ 3 ]
# field-param field key
- field: timeout
# name-param field display i18n name
Expand Down Expand Up @@ -260,7 +274,7 @@ metrics:
# snmp community
community: ^_^community^_^
# snmp version
version: ^_^version^_^
version: ^_^snmpVersion^_^
# snmp operation: get, walk
operation: get
# metrics oids: metric_name - oid_value
Expand Down Expand Up @@ -387,7 +401,7 @@ metrics:
contextName: ^_^contextName^_^
timeout: ^_^timeout^_^
community: ^_^community^_^
version: ^_^version^_^
version: ^_^snmpVersion^_^
operation: walk
oids:
ifIndex: 1.3.6.1.2.1.2.2.1.1
Expand Down
Loading

0 comments on commit ca93a65

Please sign in to comment.