Skip to content
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

clear unused files and argument #29

Merged
merged 2 commits into from
Jan 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions nutanix/ncp/plugins/module_utils/base_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -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", elements="str", 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),
Expand Down
11 changes: 0 additions & 11 deletions nutanix/ncp/plugins/module_utils/prism/images.py

This file was deleted.

11 changes: 0 additions & 11 deletions nutanix/ncp/plugins/module_utils/prism/subnets.py

This file was deleted.

172 changes: 0 additions & 172 deletions nutanix/ncp/plugins/modules/nutanix_images.py
Original file line number Diff line number Diff line change
@@ -1,172 +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

__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:
state:
description: This is the action used to indicate the type of request
aliases: ['action']
required: true
type: str
auth:
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
operations:
description: This acts as the sub_url in the requested url
required: false
type: list
elements: str
wait_timeout: ###
description: This is the wait_timeout description
required: False
type: int
default: 300
wait: ###
description: This is the wait description
required: False
type: bool
default: true
validate_certs: ###
description: This is the validate_certs description
required: False
type: bool
default: False

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
"""
from ..module_utils.base_module import BaseModule # noqa: E402
from ..module_utils.prism.images import Image # noqa: E402


def run_module():
module = BaseModule()
Image(module)


def main():
run_module()


if __name__ == "__main__":
main()
156 changes: 0 additions & 156 deletions nutanix/ncp/plugins/modules/nutanix_subnets.py
Original file line number Diff line number Diff line change
@@ -1,156 +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

__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:
state:
description: This is the action used to indicate the type of request
aliases: ['action']
required: true
type: str
auth:
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
operations:
description: This acts as the sub_url in the requested url
required: false
type: list
elements: str
wait_timeout: ###
description: This is the wait_timeout description
required: False
type: int
default: 300
wait: ###
description: This is the wait description
required: False
type: bool
default: true
validate_certs: ###
description: This is the validate_certs description
required: False
type: bool
default: False

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
"""
from ..module_utils.base_module import BaseModule # noqa: E402
from ..module_utils.prism.subnets import Subnet # noqa: E402


def run_module():
module = BaseModule()
Subnet(module)


def main():
run_module()


if __name__ == "__main__":
main()