Skip to content

Commit 6f50abf

Browse files
gmicollhercot
authored andcommitted
[minor_change] Rename module aci_context_policy and aci_subject_profile to aci_route_control_context and aci_match_rule. Applied changes to all Documentations and Modules.
1 parent 1f5aa6d commit 6f50abf

File tree

19 files changed

+894
-524
lines changed

19 files changed

+894
-524
lines changed

plugins/modules/aci_match_as_path_regex_term.py

Lines changed: 59 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,30 @@
1515
module: aci_match_as_path_regex_term
1616
short_description: Manage Match Regular Expression AS-Path Term (rtctrl:MatchAsPathRegexTerm)
1717
description:
18-
- Manage Match Rule Based on Route Regular Expression AS-Path for Subject Profiles on Cisco ACI fabrics.
18+
- Manage Match Term Based on Route Regular Expression AS-Path for Match Rule Profiles on Cisco ACI fabrics.
1919
options:
2020
tenant:
2121
description:
2222
- The name of an existing tenant.
2323
type: str
2424
aliases: [ tenant_name ]
25-
subject_profile:
25+
match_rule:
2626
description:
27-
- Name of an exising subject profile.
27+
- The name of an exising match rule profile.
2828
type: str
29-
aliases: [ subject_name ]
29+
aliases: [ match_rule_name ]
3030
match_as_path_regex_term:
3131
description:
32-
- Name of the Match Regular Expression AS-Path Term.
32+
- The name of the match regex AS-Path term.
3333
type: str
34-
aliases: [ name, match_rule_name ]
34+
aliases: [ name, match_as_path_regex_term_name ]
3535
regex:
3636
description:
3737
- The Regular Expression.
3838
type: str
3939
description:
4040
description:
41-
- The description for the Match Regular Expression AS-Path Term.
41+
- The description for the match regex AS-Path term.
4242
type: str
4343
aliases: [ descr ]
4444
state:
@@ -58,10 +58,11 @@
5858
- cisco.aci.owner
5959
6060
notes:
61-
- The C(tenant) and the C(subject_profile) used must exist before using this module in your playbook.
62-
The M(cisco.aci.aci_tenant) and the M(cisco.aci.subject_profile) modules can be used for this.
61+
- The C(tenant) and the C(match_rule) used must exist before using this module in your playbook.
62+
The M(cisco.aci.aci_tenant) and the M(cisco.aci.aci_match_rule) modules can be used for this.
6363
seealso:
6464
- module: cisco.aci.aci_tenant
65+
- module: cisco.aci.aci_match_rule
6566
- name: APIC Management Information Model reference
6667
description: More information about the internal APIC class B(rtctrl:MatchAsPathRegexTerm).
6768
link: https://developer.cisco.com/docs/apic-mim-ref/
@@ -70,6 +71,49 @@
7071
"""
7172

7273
EXAMPLES = r"""
74+
- name: Create a match match AS-path regex term
75+
cisco.aci.match_as_path_regex_term:
76+
host: apic
77+
username: admin
78+
password: SomeSecretPassword
79+
match_rule: prod_match_rule
80+
match_as_path_regex_term: prod_match_as_path_regex_term
81+
regex: .*
82+
tenant: production
83+
state: present
84+
delegate_to: localhost
85+
86+
- name: Delete a match match AS-path regex term
87+
cisco.aci.match_as_path_regex_term:
88+
host: apic
89+
username: admin
90+
password: SomeSecretPassword
91+
match_rule: prod_match_rule
92+
tenant: production
93+
match_as_path_regex_term: prod_match_as_path_regex_term
94+
state: absent
95+
delegate_to: localhost
96+
97+
- name: Query all match AS-path regex terms
98+
cisco.aci.match_as_path_regex_term:
99+
host: apic
100+
username: admin
101+
password: SomeSecretPassword
102+
state: query
103+
delegate_to: localhost
104+
register: query_result
105+
106+
- name: Query a specific match match AS-path regex term
107+
cisco.aci.match_as_path_regex_term:
108+
host: apic
109+
username: admin
110+
password: SomeSecretPassword
111+
match_rule: prod_match_rule
112+
tenant: production
113+
match_as_path_regex_term: prod_match_as_path_regex_term
114+
state: query
115+
delegate_to: localhost
116+
register: query_result
73117
"""
74118

75119
RETURN = r"""
@@ -187,8 +231,8 @@ def main():
187231
argument_spec.update(aci_owner_spec())
188232
argument_spec.update(
189233
tenant=dict(type="str", aliases=["tenant_name"]), # Not required for querying all objects
190-
subject_profile=dict(type="str", aliases=["subject_name"]), # Not required for querying all objects
191-
match_as_path_regex_term=dict(type="str", aliases=["name", "match_rule_name"]),
234+
match_rule=dict(type="str", aliases=["match_rule_name"]), # Not required for querying all objects
235+
match_as_path_regex_term=dict(type="str", aliases=["name", "match_as_path_regex_term_name"]),
192236
regex=dict(type="str"),
193237
description=dict(type="str", aliases=["descr"]),
194238
name_alias=dict(type="str"),
@@ -209,7 +253,7 @@ def main():
209253
regex = module.params.get("regex")
210254
state = module.params.get("state")
211255
tenant = module.params.get("tenant")
212-
subject_profile = module.params.get("subject_profile")
256+
match_rule = module.params.get("match_rule")
213257
name_alias = module.params.get("name_alias")
214258

215259
aci = ACIModule(module)
@@ -223,9 +267,9 @@ def main():
223267
),
224268
subclass_1=dict(
225269
aci_class="rtctrlSubjP",
226-
aci_rn="subj-{0}".format(subject_profile),
227-
module_object=subject_profile,
228-
target_filter={"name": subject_profile},
270+
aci_rn="subj-{0}".format(match_rule),
271+
module_object=match_rule,
272+
target_filter={"name": match_rule},
229273
),
230274
subclass_2=dict(
231275
aci_class="rtctrlMatchAsPathRegexTerm",

plugins/modules/aci_match_community_factor.py

Lines changed: 67 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,37 +15,37 @@
1515
module: aci_match_community_factor
1616
short_description: Manage Match Community Factor (rtctrl:MatchCommFactor)
1717
description:
18-
- Manage Match Community Factors for Match Rules Based on Community on Cisco ACI fabrics.
18+
- Manage Match Community Factors for Match Terms Based on Community on Cisco ACI fabrics.
1919
options:
2020
tenant:
2121
description:
2222
- The name of an existing tenant.
2323
type: str
2424
aliases: [ tenant_name ]
25-
subject_profile:
25+
match_rule:
2626
description:
27-
- Name of an exising subject profile.
27+
- The name of an exising match rule profile.
2828
type: str
29-
aliases: [ subject_name ]
29+
aliases: [ match_rule_name ]
3030
match_community_term:
3131
description:
32-
- Name of an existing match community term.
32+
- The name of an existing match community term.
3333
type: str
34-
aliases: [ match_rule_name ]
34+
aliases: [ match_community_term_name ]
3535
community:
3636
description:
3737
- The match community value.
3838
type: str
3939
scope:
4040
description:
4141
- The item scope.
42-
- if the scope is transitive, this community may be passed between ASs.
43-
- if the scope is Non transitive, this community should be carried only within the local AS.
42+
- If the scope is transitive, this community may be passed between ASs.
43+
- If the scope is Non transitive, this community should be carried only within the local AS.
4444
type: str
4545
choices: [ transitive, non-transitive ]
4646
description:
4747
description:
48-
- The description for the Match Community Term.
48+
- The description for the match community factor.
4949
type: str
5050
aliases: [ descr ]
5151
state:
@@ -65,10 +65,12 @@
6565
- cisco.aci.owner
6666
6767
notes:
68-
- The C(tenant), the C(subject_profile) and the C(match_community_term) used must exist before using this module in your playbook.
69-
The M(cisco.aci.aci_tenant), the M(cisco.aci.subject_profile) and M(cisco.aci.match_community_term) modules can be used for this.
68+
- The C(tenant), the C(match_rule) and the C(match_community_term) used must exist before using this module in your playbook.
69+
The M(cisco.aci.aci_tenant), the M(cisco.aci.aci_match_rule) and M(cisco.aci.aci_match_community_term) modules can be used for this.
7070
seealso:
7171
- module: cisco.aci.aci_tenant
72+
- module: cisco.aci.aci_match_rule
73+
- module: cisco.aci.aci_match_community_term
7274
- name: APIC Management Information Model reference
7375
description: More information about the internal APIC class B(rtctrl:MatchCommFactor).
7476
link: https://developer.cisco.com/docs/apic-mim-ref/
@@ -77,6 +79,52 @@
7779
"""
7880

7981
EXAMPLES = r"""
82+
- name: Create a match match AS-path regex term
83+
cisco.aci.match_community_term:
84+
host: apic
85+
username: admin
86+
password: SomeSecretPassword
87+
match_rule: prod_match_rule
88+
match_community_term: prod_match_community_term
89+
community: regular:as2-nn2:4:15
90+
scope: transitive
91+
tenant: production
92+
state: present
93+
delegate_to: localhost
94+
95+
- name: Delete a match match AS-path regex term
96+
cisco.aci.match_community_term:
97+
host: apic
98+
username: admin
99+
password: SomeSecretPassword
100+
match_rule: prod_match_rule
101+
tenant: production
102+
match_community_term: prod_match_community_term
103+
community: regular:as2-nn2:4:15
104+
state: absent
105+
delegate_to: localhost
106+
107+
- name: Query all match AS-path regex terms
108+
cisco.aci.match_community_term:
109+
host: apic
110+
username: admin
111+
password: SomeSecretPassword
112+
state: query
113+
delegate_to: localhost
114+
register: query_result
115+
116+
- name: Query a specific match match AS-path regex term
117+
cisco.aci.match_community_term:
118+
host: apic
119+
username: admin
120+
password: SomeSecretPassword
121+
match_rule: prod_match_rule
122+
tenant: production
123+
match_community_term: prod_match_community_term
124+
community: regular:as2-nn2:4:15
125+
state: query
126+
delegate_to: localhost
127+
register: query_result
80128
"""
81129

82130
RETURN = r"""
@@ -194,8 +242,8 @@ def main():
194242
argument_spec.update(aci_owner_spec())
195243
argument_spec.update(
196244
tenant=dict(type="str", aliases=["tenant_name"]), # Not required for querying all objects
197-
subject_profile=dict(type="str", aliases=["subject_name"]), # Not required for querying all objects
198-
match_community_term=dict(type="str", aliases=["match_rule_name"]), # Not required for querying all objects
245+
match_rule=dict(type="str", aliases=["match_rule_name"]), # Not required for querying all objects
246+
match_community_term=dict(type="str", aliases=["match_community_term_name"]), # Not required for querying all objects
199247
community=dict(type="str"),
200248
scope=dict(type="str", choices=["transitive", "non-transitive"]),
201249
description=dict(type="str", aliases=["descr"]),
@@ -207,8 +255,8 @@ def main():
207255
argument_spec=argument_spec,
208256
supports_check_mode=True,
209257
required_if=[
210-
["state", "absent", ["community", "tenant", "subject_profile", "match_community_term"]],
211-
["state", "present", ["community", "tenant", "subject_profile", "match_community_term"]],
258+
["state", "absent", ["community", "tenant", "match_rule", "match_community_term"]],
259+
["state", "present", ["community", "tenant", "match_rule", "match_community_term"]],
212260
],
213261
)
214262

@@ -217,7 +265,7 @@ def main():
217265
description = module.params.get("description")
218266
state = module.params.get("state")
219267
tenant = module.params.get("tenant")
220-
subject_profile = module.params.get("subject_profile")
268+
match_rule = module.params.get("match_rule")
221269
match_community_term = module.params.get("match_community_term")
222270
name_alias = module.params.get("name_alias")
223271

@@ -232,9 +280,9 @@ def main():
232280
),
233281
subclass_1=dict(
234282
aci_class="rtctrlSubjP",
235-
aci_rn="subj-{0}".format(subject_profile),
236-
module_object=subject_profile,
237-
target_filter={"name": subject_profile},
283+
aci_rn="subj-{0}".format(match_rule),
284+
module_object=match_rule,
285+
target_filter={"name": match_rule},
238286
),
239287
subclass_2=dict(
240288
aci_class="rtctrlMatchCommTerm",

0 commit comments

Comments
 (0)