Skip to content

Commit

Permalink
updated documenation
Browse files Browse the repository at this point in the history
  • Loading branch information
segadson committed Jun 7, 2024
1 parent 84fa783 commit bddda06
Showing 1 changed file with 91 additions and 4 deletions.
95 changes: 91 additions & 4 deletions plugins/modules/cloud_builder_sddc_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
import sys


# current_dir = os.path.dirname(os.path.realpath(__file__))
# parent_dir = os.path.dirname(current_dir)
# sys.path.append(parent_dir)


from ansible.module_utils.basic import *
from ansible.module_utils.cloud_builder import CloudBuilderApiClient
Expand All @@ -17,9 +15,98 @@

import yaml

#Todo Documentation
DOCUMENTATION = '''
---
module: cloud_builder_sddc_validation
short_description: Ansible module for validating SDDC management domain using Cloud Builder API
description:
- "This module connects to the Cloud Builder API and validates the SDDC management domain using the provided parameters."
- "It requires the following parameters:"
- "cloud_builder_ip: IP address of the Cloud Builder"
- "cloud_builder_user: Username for authentication with the Cloud Builder"
- "cloud_builder_password: Password for authentication with the Cloud Builder"
- "sddc_management_domain_payload: Payload containing the SDDC management domain details"
- "The module returns the validation result as a JSON object."
version_added: "2.9"
author: "Sean Gadson"
options:
cloud_builder_ip:
description:
- IP address of the Cloud Builder
required: true
cloud_builder_user:
description:
- Username for authentication with the Cloud Builder
required: true
cloud_builder_password:
description:
- Password for authentication with the Cloud Builder
required: true
sddc_management_domain_payload:
description:
- Payload containing the SDDC management domain details
required: true
'''

RETURN = '''
meta:
description: Validation result
type: dict
'''

EXAMPLES = '''
- name: Validate SDDC management domain
cloud_builder_sddc_validation:
cloud_builder_ip: "{{ cloud_builder_ip }}"
cloud_builder_user: "{{ cloud_builder_user }}"
cloud_builder_password: "{{ cloud_builder_password }}"
sddc_management_domain_payload:
name: "{{ sddc_name }}"
region: "{{ region }}"
sddc_type: "{{ sddc_type }}"
num_hosts: "{{ num_hosts }}"
provider: "{{ provider }}"
vpc_cidr: "{{ vpc_cidr }}"
vpc_id: "{{ vpc_id }}"
vpc_subnet_cidr: "{{ vpc_subnet_cidr }}"
vpc_subnet_id: "{{ vpc_subnet_id }}"
sddc_management_subnet_cidr: "{{ sddc_management_subnet_cidr }}"
sddc_management_subnet_id: "{{ sddc_management_subnet_id }}"
sddc_management_subnet_az: "{{ sddc_management_subnet_az }}"
sddc_management_subnet_gateway: "{{ sddc_management_subnet_gateway }}"
sddc_management_subnet_dns_servers: "{{ sddc_management_subnet_dns_servers }}"
sddc_management_subnet_ntp_servers: "{{ sddc_management_subnet_ntp_servers }}"
sddc_management_subnet_cidr: "{{ sddc_management_subnet_cidr }}"
sddc_management_subnet_id: "{{ sddc_management_subnet_id }}"
sddc_management_subnet_az: "{{ sddc_management_subnet_az }}"
sddc_management_subnet_gateway: "{{ sddc_management_subnet_gateway }}"
sddc_management_subnet_dns_servers: "{{ sddc_management_subnet_dns_servers }}"
sddc_management_subnet_ntp_servers: "{{ sddc_management_subnet_ntp_servers }}"
sddc_management_subnet_cidr: "{{ sddc_management_subnet_cidr }}"
sddc_management_subnet_id: "{{ sddc_management_subnet_id }}"
sddc_management_subnet_az: "{{ sddc_management_subnet_az }}"
sddc_management_subnet_gateway: "{{ sddc_management_subnet_gateway }}"
sddc_management_subnet_dns_servers: "{{ sddc_management_subnet_dns_servers }}"
sddc_management_subnet_ntp_servers: "{{ sddc_management_subnet_ntp_servers }}"
'''


def main():
"""
Ansible module for validating SDDC management domain using Cloud Builder API.
This module connects to the Cloud Builder API and validates the SDDC management domain
using the provided parameters. It requires the following parameters:
- cloud_builder_ip: IP address of the Cloud Builder
- cloud_builder_user: Username for authentication with the Cloud Builder
- cloud_builder_password: Password for authentication with the Cloud Builder
- sddc_management_domain_payload: Payload containing the SDDC management domain details
The module returns the validation result as a JSON object.
:return: JSON object containing the validation result
"""
parameters = {
"cloud_builder_ip": {"required": True, "type": "str"},
"cloud_builder_user": {"required": True, "type": "str"},
Expand Down

0 comments on commit bddda06

Please sign in to comment.