influxdb: Fix documentation (#67807)

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit ed306c7991)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
pull/69271/head
Abhijeet Kasurde 5 years ago committed by Matt Clay
parent e5d93a4f11
commit 17458a16ca

@ -60,7 +60,7 @@ class InfluxDb():
retries=dict(type='int', default=3), retries=dict(type='int', default=3),
proxies=dict(type='dict', default={}), proxies=dict(type='dict', default={}),
use_udp=dict(type='bool', default=False), use_udp=dict(type='bool', default=False),
udp_port=dict(type='int'), udp_port=dict(type='int', default=4444),
) )
def connect_to_influxdb(self): def connect_to_influxdb(self):

@ -1,6 +1,6 @@
#!/usr/bin/python #!/usr/bin/python
# (c) 2016, Kamil Szczygiel <kamil.szczygiel () intel.com> # Copyright: (c) 2016, Kamil Szczygiel <kamil.szczygiel () intel.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
@ -12,7 +12,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
'supported_by': 'community'} 'supported_by': 'community'}
DOCUMENTATION = ''' DOCUMENTATION = r'''
--- ---
module: influxdb_database module: influxdb_database
short_description: Manage InfluxDB databases short_description: Manage InfluxDB databases
@ -29,15 +29,17 @@ options:
description: description:
- Name of the database. - Name of the database.
required: true required: true
type: str
state: state:
description: description:
- Determines if the database should be created or destroyed. - Determines if the database should be created or destroyed.
choices: [ present, absent ] choices: [ absent, present ]
default: present default: present
type: str
extends_documentation_fragment: influxdb extends_documentation_fragment: influxdb
''' '''
EXAMPLES = ''' EXAMPLES = r'''
# Example influxdb_database command from Ansible Playbooks # Example influxdb_database command from Ansible Playbooks
- name: Create database - name: Create database
influxdb_database: influxdb_database:
@ -60,7 +62,7 @@ EXAMPLES = '''
validate_certs: yes validate_certs: yes
''' '''
RETURN = ''' RETURN = r'''
# only defaults # only defaults
''' '''

@ -12,10 +12,10 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
'supported_by': 'community'} 'supported_by': 'community'}
DOCUMENTATION = ''' DOCUMENTATION = r'''
--- ---
module: influxdb_query module: influxdb_query
short_description: Query data points from InfluxDB. short_description: Query data points from InfluxDB
description: description:
- Query data points from InfluxDB. - Query data points from InfluxDB.
version_added: 2.5 version_added: 2.5
@ -28,10 +28,12 @@ options:
description: description:
- Query to be executed. - Query to be executed.
required: true required: true
type: str
database_name: database_name:
description: description:
- Name of the database. - Name of the database.
required: true required: true
type: str
extends_documentation_fragment: influxdb extends_documentation_fragment: influxdb
''' '''
@ -55,7 +57,7 @@ EXAMPLES = r'''
var: connection.query_results var: connection.query_results
''' '''
RETURN = ''' RETURN = r'''
query_results: query_results:
description: Result from the query description: Result from the query
returned: success returned: success

@ -1,6 +1,6 @@
#!/usr/bin/python #!/usr/bin/python
# (c) 2016, Kamil Szczygiel <kamil.szczygiel () intel.com> # Copyright: (c) 2016, Kamil Szczygiel <kamil.szczygiel () intel.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
@ -11,12 +11,12 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
'supported_by': 'community'} 'supported_by': 'community'}
DOCUMENTATION = ''' DOCUMENTATION = r'''
--- ---
module: influxdb_retention_policy module: influxdb_retention_policy
short_description: Manage InfluxDB retention policies short_description: Manage InfluxDB retention policies
description: description:
- Manage InfluxDB retention policies - Manage InfluxDB retention policies.
version_added: 2.1 version_added: 2.1
author: "Kamil Szczygiel (@kamsz)" author: "Kamil Szczygiel (@kamsz)"
requirements: requirements:
@ -28,26 +28,30 @@ options:
description: description:
- Name of the database. - Name of the database.
required: true required: true
type: str
policy_name: policy_name:
description: description:
- Name of the retention policy - Name of the retention policy.
required: true required: true
type: str
duration: duration:
description: description:
- Determines how long InfluxDB should keep the data - Determines how long InfluxDB should keep the data.
required: true required: true
type: str
replication: replication:
description: description:
- Determines how many independent copies of each point are stored in the cluster - Determines how many independent copies of each point are stored in the cluster.
required: true required: true
type: int
default: default:
description: description:
- Sets the retention policy as default retention policy - Sets the retention policy as default retention policy.
required: true type: bool
extends_documentation_fragment: influxdb extends_documentation_fragment: influxdb
''' '''
EXAMPLES = ''' EXAMPLES = r'''
# Example influxdb_retention_policy command from Ansible Playbooks # Example influxdb_retention_policy command from Ansible Playbooks
- name: create 1 hour retention policy - name: create 1 hour retention policy
influxdb_retention_policy: influxdb_retention_policy:
@ -86,7 +90,7 @@ EXAMPLES = '''
validate_certs: no validate_certs: no
''' '''
RETURN = ''' RETURN = r'''
# only defaults # only defaults
''' '''

@ -1,6 +1,6 @@
#!/usr/bin/python #!/usr/bin/python
# (c) 2017, Vitaliy Zhhuta <zhhuta () gmail.com> # Copyright: (c) 2017, Vitaliy Zhhuta <zhhuta () gmail.com>
# insipred by Kamil Szczygiel <kamil.szczygiel () intel.com> influxdb_database module # insipred by Kamil Szczygiel <kamil.szczygiel () intel.com> influxdb_database module
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
@ -12,12 +12,12 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'], 'status': ['preview'],
'supported_by': 'community'} 'supported_by': 'community'}
DOCUMENTATION = ''' DOCUMENTATION = r'''
--- ---
module: influxdb_user module: influxdb_user
short_description: Manage InfluxDB users short_description: Manage InfluxDB users
description: description:
- Manage InfluxDB users - Manage InfluxDB users.
version_added: 2.5 version_added: 2.5
author: "Vitaliy Zhhuta (@zhhuta)" author: "Vitaliy Zhhuta (@zhhuta)"
requirements: requirements:
@ -28,10 +28,12 @@ options:
description: description:
- Name of the user. - Name of the user.
required: True required: True
type: str
user_password: user_password:
description: description:
- Password to be set for the user. - Password to be set for the user.
required: false required: false
type: str
admin: admin:
description: description:
- Whether the user should be in the admin role or not. - Whether the user should be in the admin role or not.
@ -41,19 +43,22 @@ options:
state: state:
description: description:
- State of the user. - State of the user.
choices: [ present, absent ] choices: [ absent, present ]
default: present default: present
type: str
grants: grants:
description: description:
- Privileges to grant to this user. Takes a list of dicts containing the - Privileges to grant to this user.
"database" and "privilege" keys. - Takes a list of dicts containing the "database" and "privilege" keys.
- If this argument is not provided, the current grants will be left alone. - If this argument is not provided, the current grants will be left alone.
If an empty list is provided, all grants for the user will be removed. - If an empty list is provided, all grants for the user will be removed.
version_added: 2.8 version_added: 2.8
type: list
elements: dict
extends_documentation_fragment: influxdb extends_documentation_fragment: influxdb
''' '''
EXAMPLES = ''' EXAMPLES = r'''
- name: Create a user on localhost using default login credentials - name: Create a user on localhost using default login credentials
influxdb_user: influxdb_user:
user_name: john user_name: john
@ -95,7 +100,7 @@ EXAMPLES = '''
state: absent state: absent
''' '''
RETURN = ''' RETURN = r'''
#only defaults #only defaults
''' '''
@ -204,7 +209,7 @@ def main():
user_name=dict(required=True, type='str'), user_name=dict(required=True, type='str'),
user_password=dict(required=False, type='str', no_log=True), user_password=dict(required=False, type='str', no_log=True),
admin=dict(default='False', type='bool'), admin=dict(default='False', type='bool'),
grants=dict(type='list') grants=dict(type='list', elements='dict'),
) )
module = AnsibleModule( module = AnsibleModule(
argument_spec=argument_spec, argument_spec=argument_spec,

@ -15,7 +15,7 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
DOCUMENTATION = r''' DOCUMENTATION = r'''
--- ---
module: influxdb_write module: influxdb_write
short_description: Write data points into InfluxDB. short_description: Write data points into InfluxDB
description: description:
- Write data points into InfluxDB. - Write data points into InfluxDB.
version_added: 2.5 version_added: 2.5
@ -28,10 +28,13 @@ options:
description: description:
- Data points as dict to write into the database. - Data points as dict to write into the database.
required: true required: true
type: list
elements: dict
database_name: database_name:
description: description:
- Name of the database. - Name of the database.
required: true required: true
type: str
extends_documentation_fragment: influxdb extends_documentation_fragment: influxdb
''' '''
@ -81,7 +84,7 @@ class AnsibleInfluxDBWrite(InfluxDb):
def main(): def main():
argument_spec = InfluxDb.influxdb_argument_spec() argument_spec = InfluxDb.influxdb_argument_spec()
argument_spec.update( argument_spec.update(
data_points=dict(required=True, type='list'), data_points=dict(required=True, type='list', elements='dict'),
database_name=dict(required=True, type='str'), database_name=dict(required=True, type='str'),
) )
module = AnsibleModule( module = AnsibleModule(

@ -2175,16 +2175,6 @@ lib/ansible/modules/commands/command.py validate-modules:undocumented-parameter
lib/ansible/modules/commands/command.py validate-modules:nonexistent-parameter-documented lib/ansible/modules/commands/command.py validate-modules:nonexistent-parameter-documented
lib/ansible/modules/commands/command.py validate-modules:doc-missing-type lib/ansible/modules/commands/command.py validate-modules:doc-missing-type
lib/ansible/modules/commands/expect.py validate-modules:doc-missing-type lib/ansible/modules/commands/expect.py validate-modules:doc-missing-type
lib/ansible/modules/database/influxdb/influxdb_database.py validate-modules:doc-default-does-not-match-spec
lib/ansible/modules/database/influxdb/influxdb_database.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/database/influxdb/influxdb_query.py validate-modules:doc-default-does-not-match-spec
lib/ansible/modules/database/influxdb/influxdb_query.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/database/influxdb/influxdb_retention_policy.py validate-modules:doc-default-does-not-match-spec
lib/ansible/modules/database/influxdb/influxdb_retention_policy.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/database/influxdb/influxdb_user.py validate-modules:doc-default-does-not-match-spec
lib/ansible/modules/database/influxdb/influxdb_user.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/database/influxdb/influxdb_write.py validate-modules:doc-default-does-not-match-spec
lib/ansible/modules/database/influxdb/influxdb_write.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/database/misc/elasticsearch_plugin.py validate-modules:parameter-type-not-in-doc lib/ansible/modules/database/misc/elasticsearch_plugin.py validate-modules:parameter-type-not-in-doc
lib/ansible/modules/database/misc/elasticsearch_plugin.py validate-modules:doc-missing-type lib/ansible/modules/database/misc/elasticsearch_plugin.py validate-modules:doc-missing-type
lib/ansible/modules/database/misc/kibana_plugin.py validate-modules:parameter-type-not-in-doc lib/ansible/modules/database/misc/kibana_plugin.py validate-modules:parameter-type-not-in-doc

Loading…
Cancel
Save