From 5a91cfbb480b89ba7f52cd1787a3b097bfbc256a Mon Sep 17 00:00:00 2001 From: Gevorg-Khachatryaan Date: Mon, 24 Jan 2022 14:57:56 +0400 Subject: [PATCH] clear unused files and argument --- .../ncp/plugins/module_utils/base_module.py | 2 - .../ncp/plugins/module_utils/prism/images.py | 11 -- .../ncp/plugins/module_utils/prism/subnets.py | 11 -- nutanix/ncp/plugins/modules/nutanix_images.py | 164 ------------------ .../ncp/plugins/modules/nutanix_subnets.py | 148 ---------------- 5 files changed, 336 deletions(-) delete mode 100644 nutanix/ncp/plugins/module_utils/prism/images.py delete mode 100644 nutanix/ncp/plugins/module_utils/prism/subnets.py delete mode 100644 nutanix/ncp/plugins/modules/nutanix_images.py delete mode 100644 nutanix/ncp/plugins/modules/nutanix_subnets.py diff --git a/nutanix/ncp/plugins/module_utils/base_module.py b/nutanix/ncp/plugins/module_utils/base_module.py index 5b6d19a40..c29ec60e9 100644 --- a/nutanix/ncp/plugins/module_utils/base_module.py +++ b/nutanix/ncp/plugins/module_utils/base_module.py @@ -13,8 +13,6 @@ class BaseModule(AnsibleModule): argument_spec = dict( action=dict(type="str", required=True, aliases=["state"]), auth=dict(type="dict", required=True), - data=dict(type="dict", required=False), - operations=dict(type="list", required=False), wait=dict(type="bool", required=False, default=True), wait_timeout=dict(type="int", required=False, default=300), validate_certs=dict(type="bool", required=False, default=False), diff --git a/nutanix/ncp/plugins/module_utils/prism/images.py b/nutanix/ncp/plugins/module_utils/prism/images.py deleted file mode 100644 index 4c8932f4b..000000000 --- a/nutanix/ncp/plugins/module_utils/prism/images.py +++ /dev/null @@ -1,11 +0,0 @@ -# This file is part of Ansible -# 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 .prism import Prism - -__metaclass__ = type - - -class Image(Prism): - kind = "image" diff --git a/nutanix/ncp/plugins/module_utils/prism/subnets.py b/nutanix/ncp/plugins/module_utils/prism/subnets.py deleted file mode 100644 index 70150ff36..000000000 --- a/nutanix/ncp/plugins/module_utils/prism/subnets.py +++ /dev/null @@ -1,11 +0,0 @@ -# This file is part of Ansible -# 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 .prism import Prism - -__metaclass__ = type - - -class Subnet(Prism): - kind = "subnet" diff --git a/nutanix/ncp/plugins/modules/nutanix_images.py b/nutanix/ncp/plugins/modules/nutanix_images.py deleted file mode 100644 index 859a98a7e..000000000 --- a/nutanix/ncp/plugins/modules/nutanix_images.py +++ /dev/null @@ -1,164 +0,0 @@ -#!/usr/bin/python - -# Copyright: (c) 2021 -# 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 ..module_utils.base_module import BaseModule -from ..module_utils.prism.images import Image - -__metaclass__ = type - - -DOCUMENTATION = r""" ---- -module: nutanix_images - -short_description: This module allows to communicate with the resource /images - -version_added: "1.0.0" - -description: This module allows to perform the following tasks on /images - -options: - action: - description: This is the action used to indicate the type of request - required: true - type: str - credentials: - description: Credentials needed for authenticating to the subnet - required: true - type: dict (Variable from file) - data: - description: This acts as either the params or the body payload depending on the HTTP action - required: false - type: dict - operation: - description: This acts as the sub_url in the requested url - required: false - type: str - ip_address: - description: This acts as the ip_address of the subnet. It can be passed as a list in ansible using with_items - required: True - type: str (Variable from file) - port: - description: This acts as the port of the subnet. It can be passed as a list in ansible using with_items - required: True - type: str (Variable from file) - -author: - - Gevorg Khachatryan (@gevorg_khachatryan) -""" - -EXAMPLES = r""" - -#CREATE action, request to /images -- hosts: [hosts_group] - tasks: - - name: create Image - nutanix_images: - action: create - credentials: str (Variable from file) - ip_address: str (Variable from file) - port: str (Variable from file) - data: - spec: - name: string - resources: - image_type: string - source_uri: string - -#UPDATE action, request to /images/{uuid} -- hosts: [hosts_group] - tasks: - - name: update Image - nutanix_images: - action: update - credentials: str (Variable from file) - ip_address: str (Variable from file) - port: str (Variable from file) - data: - metadata: - uuid: string - spec: - name: string - resources: - image_type: string - source_uri: string - -#LIST action, request to /images/list -- hosts: [hosts_group] - tasks: - - name: List Images - nutanix_images: - action: list - credentials: str (Variable from file) - ip_address: str (Variable from file) - port: str (Variable from file) - data: - - kind: string - - sort_attribute: string - - filter: string - - length: integer - - sort_order: string - - offset: integer - -#DELETE action, request to /images/{uuid} -- hosts: [hosts_group] - tasks: - - name: delete Image - nutanix_images: - action: delete - credentials: str (Variable from file) - ip_address: str (Variable from file) - port: str (Variable from file) - data: - metadata: - uuid: string -""" - -RETURN = r""" -CREATE: - description: CREATE /images Response for nutanix imagese - returned: (for CREATE /images operation) - type: str - sample: - - default Internal Error - - 202 Request Accepted -UPDATE: - description: UPDATE /images/{uuid} Response for nutanix images - returned: (for UPDATE /images operation) - type: str - sample: - - default Internal Error - - 404 Invalid UUID provided - - 202 Request Accepted -LIST: - description: LIST /images/list Response for nutanix imagese - returned: (for LIST /images operation) - type: str - sample: - - default Internal Error - - 200 Success -DELETE: - description: DELETE /images/{uuid} Response for nutanix images - returned: (for DELETE /images operation) - type: str - sample: - - default Internal Error - - 404 Invalid UUID provided - - 202 Request Accepted -""" - - -def run_module(): - module = BaseModule() - Image(module) - - -def main(): - run_module() - - -if __name__ == "__main__": - main() diff --git a/nutanix/ncp/plugins/modules/nutanix_subnets.py b/nutanix/ncp/plugins/modules/nutanix_subnets.py deleted file mode 100644 index 1d736717a..000000000 --- a/nutanix/ncp/plugins/modules/nutanix_subnets.py +++ /dev/null @@ -1,148 +0,0 @@ -#!/usr/bin/python - -# Copyright: (c) 2021 -# 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 ..module_utils.base_module import BaseModule -from ..module_utils.prism.subnets import Subnet - -__metaclass__ = type - - -DOCUMENTATION = r""" ---- -module: nutanix_subnets - -short_description: This module allows to communicate with the resource /subnets - -version_added: "1.0.0" - -description: This module allows to perform the following tasks on /subnets - -options: - action: - description: This is the HTTP action used to indicate the type of request - required: true - type: str - credentials: - description: Credentials needed for authenticating to the subnet - required: true - type: dict (Variable from file) - data: - description: This acts as either the params or the body payload depending on the HTTP action - required: false - type: dict - operation: - description: This acts as the sub_url in the requested url - required: false - type: str - ip_address: - description: This acts as the ip_address of the subnet. It can be passed as a list in ansible using with_items - required: True - type: str (Variable from file) - port: - description: This acts as the port of the subnet. It can be passed as a list in ansible using with_items - required: True - type: str (Variable from file) - -author: - - Gevorg Khachatryan (@gevorg_khachatryan-97) -""" - -EXAMPLES = r""" - -#CREATE action, request to /subnets -- hosts: [hosts_group] - tasks: - - nutanix_subnets: - action: create - credentials: str (Variable from file) - ip_address: str (Variable from file) - port: str (Variable from file) - data: - - spec: object - - metadata: object - -#UPDATE action, request to /subnets/{uuid} -- hosts: [hosts_group] - tasks: - - nutanix_subnets: - action: update - credentials: str (Variable from file) - ip_address: str (Variable from file) - port: str (Variable from file) - data: - metadata: - uuid: string - spec: object - -#LIST action, request to /subnets/list -- hosts: [hosts_group] - tasks: - - nutanix_subnets: - action: list - data: - - kind: string - - sort_attribute: string - - filter: string - - length: integer - - sort_order: string - - offset: integer - -#DELETE action, request to /subnets/{uuid} -- hosts: [hosts_group] - tasks: - - nutanix_subnets: - action: delete - data: - metadata: - uuid: string - -""" - -RETURN = r""" -CREATE: - description: CREATE /subnets Response for nutanix subnets - returned: (for CREATE /subnets operation) - type: str - sample: - - default Internal Error - - 202 Request Accepted -UPDATE: - description: UPDATE /subnets/{uuid} Response for nutanix subnets - returned: (for UPDATE /subnets operation) - type: str - sample: - - default Internal Error - - 404 Invalid UUID provided - - 202 Request Accepted -LIST: - description: LIST /subnets/list Response for nutanix subnets - returned: (for LIST /subnets operation) - type: str - sample: - - default Internal Error - - 200 Success -DELETE: - description: DELETE /subnets/{uuid} Response for nutanix subnets - returned: (for DELETE /subnets operation) - type: str - sample: - - default Internal Error - - 404 Invalid UUID provided - - 202 Request Accepted -""" - - -def run_module(): - module = BaseModule() - Subnet(module) - - -def main(): - run_module() - - -if __name__ == "__main__": - main()