init first version of pbs_special_agent
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env python3
|
||||
# Shebang needed only for editors
|
||||
|
||||
from cmk.rulesets.v1.form_specs import Dictionary, DictElement, String, Password, migrate_to_password, DefaultValue
|
||||
from cmk.rulesets.v1.rule_specs import SpecialAgent, Topic, Help, Title
|
||||
|
||||
def _formspec():
|
||||
return Dictionary(
|
||||
title=Title("PBS API-Token Login"),
|
||||
help_text=Help("This rule is used to showcase a special agent with configuration."),
|
||||
elements={
|
||||
"port": DictElement(
|
||||
required=True,
|
||||
parameter_form=String(
|
||||
title=Title("Port of the PBS API."),
|
||||
prefill=DefaultValue("8007"),
|
||||
),
|
||||
),
|
||||
"fingerprint": DictElement(
|
||||
required=True,
|
||||
parameter_form=String(
|
||||
title=Title("Fingerprint of the PBS"),
|
||||
prefill=DefaultValue(""),
|
||||
),
|
||||
),
|
||||
"tokenid": DictElement(
|
||||
required=True,
|
||||
parameter_form=String(
|
||||
title=Title("API Token with audit permissions."),
|
||||
),
|
||||
),
|
||||
"secret": DictElement(
|
||||
required=True,
|
||||
parameter_form=Password(
|
||||
title=Title("Secret for API Token."),
|
||||
migrate=migrate_to_password,
|
||||
),
|
||||
),
|
||||
}
|
||||
)
|
||||
|
||||
rule_spec_pbs_special_agent = SpecialAgent(
|
||||
topic=Topic.CLOUD,
|
||||
name="pbs_special_agent",
|
||||
title=Title("Proxmox PBS"),
|
||||
parameter_form=_formspec
|
||||
)
|
||||
Reference in New Issue
Block a user