Skip to content

Refs #1656 - add modules for data collection rules #1952

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

Klaas-
Copy link
Contributor

@Klaas- Klaas- commented May 28, 2025

SUMMARY
ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

azure_rm_monitordatacollectionrules
azure_rm_monitordatacollectionrules_info

ADDITIONAL INFORMATION

Create/Update/Delete data collection rules
Show/List data collection rules

@Klaas-
Copy link
Contributor Author

Klaas- commented May 28, 2025

If you had a look at this, give me a heads up and I'll write tests for it.

@Fred-sun Fred-sun added the work in In trying to solve, or in working with contributors label May 30, 2025
@Fred-sun
Copy link
Collaborator

@Klaas- Please update!

ERROR: Found 34 pep8 issue(s) which need to be resolved:
ERROR: plugins/module_utils/azure_rm_common.py:1390:81: E128: continuation line under-indented for visual indent
ERROR: plugins/module_utils/azure_rm_common.py:1391:81: E128: continuation line under-indented for visual indent
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:60:161: E501: line too long (163 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:64:161: E501: line too long (164 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:107:161: E501: line too long (223 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:149:161: E501: line too long (178 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:179:1: E302: expected 2 blank lines, found 1
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:222:60: E127: continuation line over-indented for visual indent
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:223:60: E127: continuation line over-indented for visual indent
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:229:9: E303: too many blank lines (2)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:244:9: E303: too many blank lines (4)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:262:28: E711: comparison to None should be 'if cond is None:'

ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:262:15: singleton-comparison: Comparison 'before_dict == None' should be 'before_dict is None'
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:300:34: singleton-comparison: Comparison 'self.results['changed'] == False' should be 'self.results['changed'] is False' if checking for the singleton value False, or 'not self.results['changed']' if testing for falsiness
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:310:40: singleton-comparison: Comparison 'before_dict != None' should be 'before_dict is not None'

ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:0:0: module should not be executable
ERROR: plugins/modules/azure_rm_monitordatacollectionrules_info.py:0:0: module should not be executable

ERROR: Found 10 validate-modules issue(s) which need to be resolved:
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:0:0: doc-default-does-not-match-spec: Argument 'append_tags' in argument_spec defines default as (True) but documentation defines default as (None)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:0:0: doc-default-does-not-match-spec: Argument 'kind' in argument_spec defines default as (None) but documentation defines default as ('present')
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:0:0: parameter-list-no-elements: Argument 'data_flows' in argument_spec defines type as list but elements is not defined
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:0:0: parameter-list-no-elements: DOCUMENTATION.options.data_flows: Argument defines type as list but elements is not defined for dictionary value @ data['options']['data_flows']. Got {'description': ['[https://learn.microsoft.com/en-us/python/api/azure-mgmt-monitor/azure.mgmt.monitor.v2022_06_01.models.dataflow?view=azure-python'],](https://learn.microsoft.com/en-us/python/api/azure-mgmt-monitor/azure.mgmt.monitor.v2022_06_01.models.dataflow?view=azure-python%27],) 'type': 'list'}
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:0:0: parameter-type-not-in-doc: Argument 'append_tags' in argument_spec defines type as 'bool' but documentation doesn't define type
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:0:0: parameter-type-not-in-doc: Argument 'tags' in argument_spec defines type as 'dict' but documentation doesn't define type
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:0:0: undocumented-parameter: Argument 'append_tags' is listed in the argument_spec, but not documented in the module documentation
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:0:0: undocumented-parameter: Argument 'tags' is listed in the argument_spec, but not documented in the module documentation
ERROR: plugins/modules/azure_rm_monitordatacollectionrules_info.py:0:0: doc-required-mismatch: Argument 'name' in argument_spec is not required, but is documented as being required
ERROR: plugins/modules/azure_rm_monitordatacollectionrules_info.py:0:0: invalid-documentation: DOCUMENTATION.options.name.required: expected bool for dictionary value @ data['options']['name']['required']. Got 'optional'

@Fred-sun Fred-sun mentioned this pull request Jun 3, 2025
@Klaas- Klaas- force-pushed the Klaas-dcr_modules branch 17 times, most recently from 7d57837 to c32549f Compare June 6, 2025 15:27
@Klaas-
Copy link
Contributor Author

Klaas- commented Jun 6, 2025

Hi @Fred-sun
I've fixed everything, except for long lines on the URLs, how can I fix those without breaking the link?

@Klaas- Klaas- force-pushed the Klaas-dcr_modules branch 3 times, most recently from b7d59cb to f445b73 Compare June 10, 2025 09:10
"description": "Description of your data collection rule",
"destinations": {},
"etag": "str",
"id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resource_group_name/providers/Microsoft.Insights/dataCollectionRules/data_collection_rule_name",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resource_group_name/providers/Microsoft.Insights/dataCollectionRules/data_collection_rule_name",
"id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/resource_group_name/
providers/Microsoft.Insights/dataCollectionRules/data_collection_rule_name",

- dynamic
data_sources:
description:
- The specification of data sources. This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- The specification of data sources. This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint.
- The specification of data sources.
- This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint.

data_sources:
description:
- The specification of data sources. This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint.
- U(https://learn.microsoft.com/en-us/python/api/azure-mgmt-monitor/azure.mgmt.monitor.v2022_06_01.models.datacollectionruledatasources?view=azure-python)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The URL is too long and I have no good solution. Currently, I suggest breaking the line and doing the same for the rest! Thank you!

Suggested change
- U(https://learn.microsoft.com/en-us/python/api/azure-mgmt-monitor/azure.mgmt.monitor.v2022_06_01.models.datacollectionruledatasources?view=azure-python)
- U(https://learn.microsoft.com/en-us/python/api/azure-mgmt-monitor/azure.mgmt.monitor.v2022_06_01.
models.datacollectionruledatasources?view=azure-python)

@Fred-sun
Copy link
Collaborator

ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:85:161: E501: line too long (172 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:90:161: E501: line too long (218 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:91:161: E501: line too long (166 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:97:161: E501: line too long (208 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:106:161: E501: line too long (240 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:111:161: E501: line too long (171 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:116:161: E501: line too long (170 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:122:161: E501: line too long (208 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:132:161: E501: line too long (171 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:137:161: E501: line too long (161 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:143:161: E501: line too long (208 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:158:161: E501: line too long (171 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:162:161: E501: line too long (230 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:163:161: E501: line too long (164 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:169:161: E501: line too long (208 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:188:161: E501: line too long (171 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:193:161: E501: line too long (163 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:199:161: E501: line too long (208 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:222:161: E501: line too long (171 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:227:161: E501: line too long (162 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:243:161: E501: line too long (171 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:248:161: E501: line too long (174 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:259:161: E501: line too long (171 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:264:161: E501: line too long (174 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:275:161: E501: line too long (224 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:279:161: E501: line too long (171 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:284:161: E501: line too long (172 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:295:161: E501: line too long (171 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:300:161: E501: line too long (171 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:310:161: E501: line too long (179 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:322:161: E501: line too long (167 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:328:161: E501: line too long (168 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:338:161: E501: line too long (171 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:343:161: E501: line too long (173 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:353:161: E501: line too long (171 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:358:161: E501: line too long (180 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:363:161: E501: line too long (164 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:373:161: E501: line too long (171 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:378:161: E501: line too long (170 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:388:161: E501: line too long (171 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:393:161: E501: line too long (167 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:407:161: E501: line too long (171 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:412:161: E501: line too long (168 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:426:161: E501: line too long (171 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:431:161: E501: line too long (167 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:445:161: E501: line too long (171 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:457:161: E501: line too long (175 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:515:161: E501: line too long (223 > 160 characters)
ERROR: plugins/modules/azure_rm_monitordatacollectionrules.py:556:161: E501: line too long (178 > 160 characters)

@Klaas- Klaas- force-pushed the Klaas-dcr_modules branch from f445b73 to 5e3f031 Compare June 12, 2025 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
work in In trying to solve, or in working with contributors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants