Skip to content

Commit

Permalink
[ignore] Modify documentations and check sanity tests for all modules…
Browse files Browse the repository at this point in the history
… related to aci_route_control_profile.
  • Loading branch information
gmicol committed Sep 28, 2023
1 parent da80422 commit 0dcf72c
Show file tree
Hide file tree
Showing 8 changed files with 183 additions and 153 deletions.
72 changes: 44 additions & 28 deletions plugins/modules/aci_context_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

DOCUMENTATION = r"""
---
module: aci_route_control_profile
short_description: Manage Context Policy (rtcrtl:CtxP)
module: aci_context_policy
short_description: Manage Route Context Policy (rtcrtl:CtxP)
description:
- Manage Context Policies for the Route Control Profiles on Cisco ACI fabrics.
- Manage Route Context Policies for the Route Control Profiles on Cisco ACI fabrics.
options:
tenant:
description:
Expand All @@ -42,6 +42,20 @@
- The action required when the condition is met.
type: str
choices: [ deny, permit ]
action_rule:
description:
- Name of the action rule profile to be associated with this route context policy.
- Set the rules for a Route Map.
- See module M(cisco.aci.aci_tenant_action_rule_profile).
type: str
aliases: [ action_rule_name ]
subject_profile:
description:
- Name of the subject profile to be associated with this route context policy.
- Set the associated Matched rules.
- See module M(cisco.aci.aci_subject_profile).
type: str
aliases: [ subject_name ]
order:
description:
- The order of the policy context.
Expand Down Expand Up @@ -199,11 +213,11 @@ def main():
argument_spec.update(
tenant=dict(type="str", aliases=["tenant_name"]), # Not required for querying all objects
l3out=dict(type="str", aliases=["l3out_name"]), # Not required for querying all objects
route_control_profile=dict(type="str", aliases=["rtctrl_profile_name"]), # Not required for querying all objects
context_policy=dict(type="str", aliases=["name", "context_name"]), # Not required for querying all objects
route_control_profile=dict(type="str", aliases=["rtctrl_profile_name"]), # Not required for querying all objects
context_policy=dict(type="str", aliases=["name", "context_name"]), # Not required for querying all objects
subject_profile=dict(type="str", aliases=["subject_name"]),
action_rule=dict(type="str", aliases=["action_rule_name"]),
action = dict(type="str", choices=["deny", "permit"]),
action=dict(type="str", choices=["deny", "permit"]),
order=dict(type="int"),
description=dict(type="str", aliases=["descr"]),
name_alias=dict(type="str"),
Expand Down Expand Up @@ -236,26 +250,26 @@ def main():
child_classes = ["rtctrlRsCtxPToSubjP", "rtctrlScope"]

tenant_url_config = dict(
aci_class="fvTenant",
aci_rn="tn-{0}".format(tenant),
module_object=tenant,
target_filter={"name": tenant},
)
aci_class="fvTenant",
aci_rn="tn-{0}".format(tenant),
module_object=tenant,
target_filter={"name": tenant},
)

route_control_profile_url_config = dict(
aci_class="rtctrlProfile",
aci_rn="prof-{0}".format(route_control_profile),
module_object=route_control_profile,
target_filter={"name": route_control_profile},
)
aci_class="rtctrlProfile",
aci_rn="prof-{0}".format(route_control_profile),
module_object=route_control_profile,
target_filter={"name": route_control_profile},
)

context_policy_url_config = dict(
aci_class="rtctrlCtxP",
aci_rn="ctx-{0}".format(context_policy),
module_object=context_policy,
target_filter={"name": context_policy},
)
aci_class="rtctrlCtxP",
aci_rn="ctx-{0}".format(context_policy),
module_object=context_policy,
target_filter={"name": context_policy},
)

if l3out is not None:
aci.construct_url(
root_class=tenant_url_config,
Expand Down Expand Up @@ -285,9 +299,11 @@ def main():
child_configs.append({"rtctrlRsCtxPToSubjP": {"attributes": {"tnRtctrlSubjPName": subject_profile}}})
if action_rule is not None:
child_configs.append(
{"rtctrlScope": {"attributes": {"descr": ""},
"children": [{"rtctrlRsScopeToAttrP": {"attributes": {"tnRtctrlAttrPName": action_rule}}}],
}
{
"rtctrlScope": {
"attributes": {"descr": ""},
"children": [{"rtctrlRsScopeToAttrP": {"attributes": {"tnRtctrlAttrPName": action_rule}}}],
}
}
)

Expand All @@ -314,4 +330,4 @@ def main():


if __name__ == "__main__":
main()
main()
36 changes: 18 additions & 18 deletions plugins/modules/aci_match_as_path_regex_term.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

DOCUMENTATION = r"""
---
module: aci_subject_profile
module: aci_match_as_path_regex_term
short_description: Manage Match Regular Expression AS-Path Term (rtctrl:MatchAsPathRegexTerm)
description:
- Manage Match Rule Based on Route Regular Expression AS-Path for Subject Profiles on Cisco ACI fabrics.
Expand Down Expand Up @@ -187,7 +187,7 @@ def main():
argument_spec.update(aci_owner_spec())
argument_spec.update(
tenant=dict(type="str", aliases=["tenant_name"]), # Not required for querying all objects
subject_profile=dict(type="str", aliases=["subject_name"]), # Not required for querying all objects
subject_profile=dict(type="str", aliases=["subject_name"]), # Not required for querying all objects
match_as_path_regex_term=dict(type="str", aliases=["name", "match_rule_name"]),
regex=dict(type="str"),
description=dict(type="str", aliases=["descr"]),
Expand Down Expand Up @@ -216,23 +216,23 @@ def main():

aci.construct_url(
root_class=dict(
aci_class="fvTenant",
aci_rn="tn-{0}".format(tenant),
module_object=tenant,
target_filter={"name": tenant},
),
aci_class="fvTenant",
aci_rn="tn-{0}".format(tenant),
module_object=tenant,
target_filter={"name": tenant},
),
subclass_1=dict(
aci_class="rtctrlSubjP",
aci_rn="subj-{0}".format(subject_profile),
module_object=subject_profile,
target_filter={"name": subject_profile},
),
aci_class="rtctrlSubjP",
aci_rn="subj-{0}".format(subject_profile),
module_object=subject_profile,
target_filter={"name": subject_profile},
),
subclass_2=dict(
aci_class="rtctrlMatchAsPathRegexTerm",
aci_rn="aspathrxtrm-{0}".format(match_as_path_regex_term),
module_object=match_as_path_regex_term,
target_filter={"name": match_as_path_regex_term},
),
aci_class="rtctrlMatchAsPathRegexTerm",
aci_rn="aspathrxtrm-{0}".format(match_as_path_regex_term),
module_object=match_as_path_regex_term,
target_filter={"name": match_as_path_regex_term},
),
)

aci.get_existing()
Expand All @@ -259,4 +259,4 @@ def main():


if __name__ == "__main__":
main()
main()
48 changes: 24 additions & 24 deletions plugins/modules/aci_match_community_factor.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

DOCUMENTATION = r"""
---
module: aci_subject_profile
module: aci_match_community_factor
short_description: Manage Match Community Factor (rtctrl:MatchCommFactor)
description:
- Manage Match Community Factors for Match Rules Based on Community on Cisco ACI fabrics.
Expand Down Expand Up @@ -194,8 +194,8 @@ def main():
argument_spec.update(aci_owner_spec())
argument_spec.update(
tenant=dict(type="str", aliases=["tenant_name"]), # Not required for querying all objects
subject_profile=dict(type="str", aliases=["subject_name"]), # Not required for querying all objects
match_community_term=dict(type="str", aliases=["match_rule_name"]), # Not required for querying all objects
subject_profile=dict(type="str", aliases=["subject_name"]), # Not required for querying all objects
match_community_term=dict(type="str", aliases=["match_rule_name"]), # Not required for querying all objects
community=dict(type="str"),
scope=dict(type="str", choices=["transitive", "non-transitive"]),
description=dict(type="str", aliases=["descr"]),
Expand Down Expand Up @@ -225,29 +225,29 @@ def main():

aci.construct_url(
root_class=dict(
aci_class="fvTenant",
aci_rn="tn-{0}".format(tenant),
module_object=tenant,
target_filter={"name": tenant},
),
aci_class="fvTenant",
aci_rn="tn-{0}".format(tenant),
module_object=tenant,
target_filter={"name": tenant},
),
subclass_1=dict(
aci_class="rtctrlSubjP",
aci_rn="subj-{0}".format(subject_profile),
module_object=subject_profile,
target_filter={"name": subject_profile},
),
aci_class="rtctrlSubjP",
aci_rn="subj-{0}".format(subject_profile),
module_object=subject_profile,
target_filter={"name": subject_profile},
),
subclass_2=dict(
aci_class="rtctrlMatchCommTerm",
aci_rn="commtrm-{0}".format(match_community_term),
module_object=match_community_term,
target_filter={"name": match_community_term},
),
aci_class="rtctrlMatchCommTerm",
aci_rn="commtrm-{0}".format(match_community_term),
module_object=match_community_term,
target_filter={"name": match_community_term},
),
subclass_3=dict(
aci_class="rtctrlMatchCommFactor",
aci_rn="commfct-{0}".format(community),
module_object=community,
target_filter={"community": community},
),
aci_class="rtctrlMatchCommFactor",
aci_rn="commfct-{0}".format(community),
module_object=community,
target_filter={"community": community},
),
)

aci.get_existing()
Expand All @@ -274,4 +274,4 @@ def main():


if __name__ == "__main__":
main()
main()
39 changes: 20 additions & 19 deletions plugins/modules/aci_match_community_regex_term.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

DOCUMENTATION = r"""
---
module: aci_subject_profile
module: aci_match_community_regex_term
short_description: Manage Match Regular Expression Community Term (rtctrl:MatchCommRegexTerm)
description:
- Manage Match Rule Based on Route Regular Expression Community for Subject Profiles on Cisco ACI fabrics.
Expand All @@ -37,6 +37,7 @@
- The Community Type.
type: str
choices: [ extended, regular ]
default: regular
regex:
description:
- The Regular Expression.
Expand Down Expand Up @@ -192,8 +193,8 @@ def main():
argument_spec.update(aci_annotation_spec())
argument_spec.update(aci_owner_spec())
argument_spec.update(
tenant=dict(type="str", aliases=["tenant_name"]), # Not required for querying all objects
subject_profile=dict(type="str", aliases=["subject_name"]), # Not required for querying all objects
tenant=dict(type="str", aliases=["tenant_name"]), # Not required for querying all objects
subject_profile=dict(type="str", aliases=["subject_name"]), # Not required for querying all objects
match_community_regex_term=dict(type="str", aliases=["name", "match_rule_name"]),
community_type=dict(type="str", default="regular", choices=["extended", "regular"]),
regex=dict(type="str"),
Expand Down Expand Up @@ -224,23 +225,23 @@ def main():

aci.construct_url(
root_class=dict(
aci_class="fvTenant",
aci_rn="tn-{0}".format(tenant),
module_object=tenant,
target_filter={"name": tenant},
),
aci_class="fvTenant",
aci_rn="tn-{0}".format(tenant),
module_object=tenant,
target_filter={"name": tenant},
),
subclass_1=dict(
aci_class="rtctrlSubjP",
aci_rn="subj-{0}".format(subject_profile),
module_object=subject_profile,
target_filter={"name": subject_profile},
),
aci_class="rtctrlSubjP",
aci_rn="subj-{0}".format(subject_profile),
module_object=subject_profile,
target_filter={"name": subject_profile},
),
subclass_2=dict(
aci_class="rtctrlMatchCommRegexTerm",
aci_rn="commrxtrm-{0}".format(community_type),
module_object=community_type,
target_filter={"commType": community_type},
),
aci_class="rtctrlMatchCommRegexTerm",
aci_rn="commrxtrm-{0}".format(community_type),
module_object=community_type,
target_filter={"commType": community_type},
),
)

aci.get_existing()
Expand Down Expand Up @@ -268,4 +269,4 @@ def main():


if __name__ == "__main__":
main()
main()
36 changes: 18 additions & 18 deletions plugins/modules/aci_match_community_term.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

DOCUMENTATION = r"""
---
module: aci_subject_profile
module: aci_match_community_term
short_description: Manage Match Community Term (rtctrl:MatchCommTerm)
description:
- Manage Match Rule Based on Community for Subject Profiles on Cisco ACI fabrics.
Expand Down Expand Up @@ -183,7 +183,7 @@ def main():
argument_spec.update(aci_owner_spec())
argument_spec.update(
tenant=dict(type="str", aliases=["tenant_name"]), # Not required for querying all objects
subject_profile=dict(type="str", aliases=["subject_name"]), # Not required for querying all objects
subject_profile=dict(type="str", aliases=["subject_name"]), # Not required for querying all objects
match_community_term=dict(type="str", aliases=["name", "match_rule_name"]),
description=dict(type="str", aliases=["descr"]),
name_alias=dict(type="str"),
Expand All @@ -210,23 +210,23 @@ def main():

aci.construct_url(
root_class=dict(
aci_class="fvTenant",
aci_rn="tn-{0}".format(tenant),
module_object=tenant,
target_filter={"name": tenant},
),
aci_class="fvTenant",
aci_rn="tn-{0}".format(tenant),
module_object=tenant,
target_filter={"name": tenant},
),
subclass_1=dict(
aci_class="rtctrlSubjP",
aci_rn="subj-{0}".format(subject_profile),
module_object=subject_profile,
target_filter={"name": subject_profile},
),
aci_class="rtctrlSubjP",
aci_rn="subj-{0}".format(subject_profile),
module_object=subject_profile,
target_filter={"name": subject_profile},
),
subclass_2=dict(
aci_class="rtctrlMatchCommTerm",
aci_rn="commtrm-{0}".format(match_community_term),
module_object=match_community_term,
target_filter={"name": match_community_term},
),
aci_class="rtctrlMatchCommTerm",
aci_rn="commtrm-{0}".format(match_community_term),
module_object=match_community_term,
target_filter={"name": match_community_term},
),
)

aci.get_existing()
Expand All @@ -252,4 +252,4 @@ def main():


if __name__ == "__main__":
main()
main()
Loading

0 comments on commit 0dcf72c

Please sign in to comment.