[PR #9394/912065ad backport][stable-10] h*.py: normalize docs (#9417)

h*.py: normalize docs (#9394)

* h*.py: normalize docs

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 912065ad0e)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2024-12-26 22:44:08 +01:00 committed by GitHub
parent f66bd1035d
commit 0e99b006a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 2272 additions and 2513 deletions

View file

@ -12,155 +12,135 @@ __metaclass__ = type
# Documentation
###############################################################################
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: hwc_evs_disk
description:
- block storage management.
- Block storage management.
short_description: Creates a resource of Evs/Disk in Huawei Cloud
version_added: '0.2.0'
author: Huawei Inc. (@huaweicloud)
requirements:
- keystoneauth1 >= 3.6.0
- keystoneauth1 >= 3.6.0
attributes:
check_mode:
support: full
diff_mode:
support: none
check_mode:
support: full
diff_mode:
support: none
options:
state:
description:
- Whether the given object should exist in Huaweicloud Cloud.
type: str
choices: ['present', 'absent']
default: 'present'
timeouts:
description:
- The timeouts for each operations.
type: dict
default: {}
suboptions:
create:
description:
- The timeouts for create operation.
type: str
default: '30m'
update:
description:
- The timeouts for update operation.
type: str
default: '30m'
delete:
description:
- The timeouts for delete operation.
type: str
default: '30m'
availability_zone:
description:
- Specifies the AZ where you want to create the disk.
type: str
required: true
name:
description:
- Specifies the disk name. The value can contain a maximum of 255
bytes.
type: str
required: true
volume_type:
description:
- Specifies the disk type. Currently, the value can be SSD, SAS, or
SATA.
- SSD specifies the ultra-high I/O disk type.
- SAS specifies the high I/O disk type.
- SATA specifies the common I/O disk type.
- If the specified disk type is not available in the AZ, the
disk will fail to create. If the EVS disk is created from a
snapshot, the volume_type field must be the same as that of the
snapshot's source disk.
type: str
required: true
backup_id:
description:
- Specifies the ID of the backup that can be used to create a disk.
This parameter is mandatory when you use a backup to create the
disk.
type: str
required: false
state:
description:
- Whether the given object should exist in Huawei Cloud.
type: str
choices: ['present', 'absent']
default: 'present'
timeouts:
description:
- The timeouts for each operations.
type: dict
default: {}
suboptions:
create:
description:
- Specifies the disk description. The value can contain a maximum
of 255 bytes.
- The timeouts for create operation.
type: str
required: false
enable_full_clone:
default: '30m'
update:
description:
- If the disk is created from a snapshot and linked cloning needs
to be used, set this parameter to True.
type: bool
required: false
enable_scsi:
description:
- If this parameter is set to True, the disk device type will be
SCSI, which allows ECS OSs to directly access underlying storage
media. SCSI reservation command is supported. If this parameter
is set to False, the disk device type will be VBD, which supports
only simple SCSI read/write commands.
- If parameter enable_share is set to True and this parameter
is not specified, shared SCSI disks are created. SCSI EVS disks
cannot be created from backups, which means that this parameter
cannot be True if backup_id has been specified.
type: bool
required: false
enable_share:
description:
- Specifies whether the disk is shareable. The default value is
False.
type: bool
required: false
encryption_id:
description:
- Specifies the encryption ID. The length of it fixes at 36 bytes.
- The timeouts for update operation.
type: str
required: false
enterprise_project_id:
default: '30m'
delete:
description:
- Specifies the enterprise project ID. This ID is associated with
the disk during the disk creation. If it is not specified, the
disk is bound to the default enterprise project.
- The timeouts for delete operation.
type: str
required: false
image_id:
description:
- Specifies the image ID. If this parameter is specified, the disk
is created from an image. BMS system disks cannot be
created from BMS images.
type: str
required: false
size:
description:
- Specifies the disk size, in GB. Its values are as follows, System
disk 1 GB to 1024 GB, Data disk 10 GB to 32768 GB. This
parameter is mandatory when you create an empty disk or use an
image or a snapshot to create a disk. If you use an image or a
snapshot to create a disk, the disk size must be greater than or
equal to the image or snapshot size. This parameter is optional
when you use a backup to create a disk. If this parameter is not
specified, the disk size is equal to the backup size.
type: int
required: false
snapshot_id:
description:
- Specifies the snapshot ID. If this parameter is specified, the
disk is created from a snapshot.
type: str
required: false
default: '30m'
availability_zone:
description:
- Specifies the AZ where you want to create the disk.
type: str
required: true
name:
description:
- Specifies the disk name. The value can contain a maximum of 255 bytes.
type: str
required: true
volume_type:
description:
- Specifies the disk type. Currently, the value can be SSD, SAS, or SATA.
- SSD specifies the ultra-high I/O disk type.
- SAS specifies the high I/O disk type.
- SATA specifies the common I/O disk type.
- If the specified disk type is not available in the AZ, the disk will fail to create. If the EVS disk is created from
a snapshot, the volume_type field must be the same as that of the snapshot's source disk.
type: str
required: true
backup_id:
description:
- Specifies the ID of the backup that can be used to create a disk. This parameter is mandatory when you use a backup
to create the disk.
type: str
required: false
description:
description:
- Specifies the disk description. The value can contain a maximum of 255 bytes.
type: str
required: false
enable_full_clone:
description:
- If the disk is created from a snapshot and linked cloning needs to be used, set this parameter to True.
type: bool
required: false
enable_scsi:
description:
- If this parameter is set to True, the disk device type will be SCSI, which allows ECS OSs to directly access underlying
storage media. SCSI reservation command is supported. If this parameter is set to False, the disk device type will
be VBD, which supports only simple SCSI read/write commands.
- If parameter enable_share is set to True and this parameter is not specified, shared SCSI disks are created. SCSI
EVS disks cannot be created from backups, which means that this parameter cannot be True if backup_id has been specified.
type: bool
required: false
enable_share:
description:
- Specifies whether the disk is shareable. The default value is False.
type: bool
required: false
encryption_id:
description:
- Specifies the encryption ID. The length of it fixes at 36 bytes.
type: str
required: false
enterprise_project_id:
description:
- Specifies the enterprise project ID. This ID is associated with the disk during the disk creation. If it is not specified,
the disk is bound to the default enterprise project.
type: str
required: false
image_id:
description:
- Specifies the image ID. If this parameter is specified, the disk is created from an image. BMS system disks cannot
be created from BMS images.
type: str
required: false
size:
description:
- Specifies the disk size, in GB. Its values are as follows, System disk 1 GB to 1024 GB, Data disk 10 GB to 32768 GB.
This parameter is mandatory when you create an empty disk or use an image or a snapshot to create a disk. If you use
an image or a snapshot to create a disk, the disk size must be greater than or equal to the image or snapshot size.
This parameter is optional when you use a backup to create a disk. If this parameter is not specified, the disk size
is equal to the backup size.
type: int
required: false
snapshot_id:
description:
- Specifies the snapshot ID. If this parameter is specified, the disk is created from a snapshot.
type: str
required: false
extends_documentation_fragment:
- community.general.hwc
- community.general.attributes
"""
'''
EXAMPLES = '''
EXAMPLES = r"""
# test create disk
- name: Create a disk
community.general.hwc_evs_disk:
@ -168,176 +148,153 @@ EXAMPLES = '''
name: "ansible_evs_disk_test"
volume_type: "SATA"
size: 10
'''
"""
RETURN = '''
availability_zone:
description:
- Specifies the AZ where you want to create the disk.
type: str
returned: success
name:
description:
- Specifies the disk name. The value can contain a maximum of 255
bytes.
type: str
returned: success
volume_type:
description:
- Specifies the disk type. Currently, the value can be SSD, SAS, or
SATA.
- SSD specifies the ultra-high I/O disk type.
- SAS specifies the high I/O disk type.
- SATA specifies the common I/O disk type.
- If the specified disk type is not available in the AZ, the
disk will fail to create. If the EVS disk is created from a
snapshot, the volume_type field must be the same as that of the
snapshot's source disk.
type: str
returned: success
backup_id:
description:
- Specifies the ID of the backup that can be used to create a disk.
This parameter is mandatory when you use a backup to create the
disk.
type: str
returned: success
description:
description:
- Specifies the disk description. The value can contain a maximum
of 255 bytes.
type: str
returned: success
enable_full_clone:
description:
- If the disk is created from a snapshot and linked cloning needs
to be used, set this parameter to True.
type: bool
returned: success
enable_scsi:
description:
- If this parameter is set to True, the disk device type will be
SCSI, which allows ECS OSs to directly access underlying storage
media. SCSI reservation command is supported. If this parameter
is set to False, the disk device type will be VBD, which supports
only simple SCSI read/write commands.
- If parameter enable_share is set to True and this parameter
is not specified, shared SCSI disks are created. SCSI EVS disks
cannot be created from backups, which means that this parameter
cannot be True if backup_id has been specified.
type: bool
returned: success
enable_share:
description:
- Specifies whether the disk is shareable. The default value is
False.
type: bool
returned: success
encryption_id:
description:
- Specifies the encryption ID. The length of it fixes at 36 bytes.
type: str
returned: success
enterprise_project_id:
description:
- Specifies the enterprise project ID. This ID is associated with
the disk during the disk creation. If it is not specified, the
disk is bound to the default enterprise project.
type: str
returned: success
image_id:
description:
- Specifies the image ID. If this parameter is specified, the disk
is created from an image. BMS system disks cannot be
created from BMS images.
type: str
returned: success
size:
description:
- Specifies the disk size, in GB. Its values are as follows, System
disk 1 GB to 1024 GB, Data disk 10 GB to 32768 GB. This
parameter is mandatory when you create an empty disk or use an
image or a snapshot to create a disk. If you use an image or a
snapshot to create a disk, the disk size must be greater than or
equal to the image or snapshot size. This parameter is optional
when you use a backup to create a disk. If this parameter is not
specified, the disk size is equal to the backup size.
type: int
returned: success
snapshot_id:
description:
- Specifies the snapshot ID. If this parameter is specified, the
disk is created from a snapshot.
type: str
returned: success
attachments:
description:
- Specifies the disk attachment information.
type: complex
returned: success
contains:
attached_at:
description:
- Specifies the time when the disk was attached. Time
format is 'UTC YYYY-MM-DDTHH:MM:SS'.
type: str
returned: success
attachment_id:
description:
- Specifies the ID of the attachment information.
type: str
returned: success
device:
description:
- Specifies the device name.
type: str
returned: success
server_id:
description:
- Specifies the ID of the server to which the disk is
attached.
type: str
returned: success
backup_policy_id:
description:
- Specifies the backup policy ID.
type: str
returned: success
created_at:
description:
- Specifies the time when the disk was created. Time format is 'UTC
YYYY-MM-DDTHH:MM:SS'.
type: str
returned: success
is_bootable:
description:
- Specifies whether the disk is bootable.
type: bool
returned: success
is_readonly:
description:
- Specifies whether the disk is read-only or read/write. True
indicates that the disk is read-only. False indicates that the
disk is read/write.
type: bool
returned: success
source_volume_id:
description:
- Specifies the source disk ID. This parameter has a value if the
disk is created from a source disk.
type: str
returned: success
status:
description:
- Specifies the disk status.
type: str
returned: success
tags:
description:
- Specifies the disk tags.
type: dict
returned: success
'''
RETURN = r"""
availability_zone:
description:
- Specifies the AZ where you want to create the disk.
type: str
returned: success
name:
description:
- Specifies the disk name. The value can contain a maximum of 255 bytes.
type: str
returned: success
volume_type:
description:
- Specifies the disk type. Currently, the value can be SSD, SAS, or SATA.
- SSD specifies the ultra-high I/O disk type.
- SAS specifies the high I/O disk type.
- SATA specifies the common I/O disk type.
- If the specified disk type is not available in the AZ, the disk will fail to create. If the EVS disk is created from
a snapshot, the volume_type field must be the same as that of the snapshot's source disk.
type: str
returned: success
backup_id:
description:
- Specifies the ID of the backup that can be used to create a disk. This parameter is mandatory when you use a backup
to create the disk.
type: str
returned: success
description:
description:
- Specifies the disk description. The value can contain a maximum of 255 bytes.
type: str
returned: success
enable_full_clone:
description:
- If the disk is created from a snapshot and linked cloning needs to be used, set this parameter to True.
type: bool
returned: success
enable_scsi:
description:
- If this parameter is set to True, the disk device type will be SCSI, which allows ECS OSs to directly access underlying
storage media. SCSI reservation command is supported. If this parameter is set to False, the disk device type will be
VBD, which supports only simple SCSI read/write commands.
- If parameter enable_share is set to True and this parameter is not specified, shared SCSI disks are created. SCSI EVS
disks cannot be created from backups, which means that this parameter cannot be True if backup_id has been specified.
type: bool
returned: success
enable_share:
description:
- Specifies whether the disk is shareable. The default value is False.
type: bool
returned: success
encryption_id:
description:
- Specifies the encryption ID. The length of it fixes at 36 bytes.
type: str
returned: success
enterprise_project_id:
description:
- Specifies the enterprise project ID. This ID is associated with the disk during the disk creation. If it is not specified,
the disk is bound to the default enterprise project.
type: str
returned: success
image_id:
description:
- Specifies the image ID. If this parameter is specified, the disk is created from an image. BMS system disks cannot be
created from BMS images.
type: str
returned: success
size:
description:
- Specifies the disk size, in GB. Its values are as follows, System disk 1 GB to 1024 GB, Data disk 10 GB to 32768 GB.
This parameter is mandatory when you create an empty disk or use an image or a snapshot to create a disk. If you use
an image or a snapshot to create a disk, the disk size must be greater than or equal to the image or snapshot size.
This parameter is optional when you use a backup to create a disk. If this parameter is not specified, the disk size
is equal to the backup size.
type: int
returned: success
snapshot_id:
description:
- Specifies the snapshot ID. If this parameter is specified, the disk is created from a snapshot.
type: str
returned: success
attachments:
description:
- Specifies the disk attachment information.
type: complex
returned: success
contains:
attached_at:
description:
- Specifies the time when the disk was attached. Time format is 'UTC YYYY-MM-DDTHH:MM:SS'.
type: str
returned: success
attachment_id:
description:
- Specifies the ID of the attachment information.
type: str
returned: success
device:
description:
- Specifies the device name.
type: str
returned: success
server_id:
description:
- Specifies the ID of the server to which the disk is attached.
type: str
returned: success
backup_policy_id:
description:
- Specifies the backup policy ID.
type: str
returned: success
created_at:
description:
- Specifies the time when the disk was created. Time format is 'UTC YYYY-MM-DDTHH:MM:SS'.
type: str
returned: success
is_bootable:
description:
- Specifies whether the disk is bootable.
type: bool
returned: success
is_readonly:
description:
- Specifies whether the disk is read-only or read/write. True indicates that the disk is read-only. False indicates that
the disk is read/write.
type: bool
returned: success
source_volume_id:
description:
- Specifies the source disk ID. This parameter has a value if the disk is created from a source disk.
type: str
returned: success
status:
description:
- Specifies the disk status.
type: str
returned: success
tags:
description:
- Specifies the disk tags.
type: dict
returned: success
"""
from ansible_collections.community.general.plugins.module_utils.hwc_utils import (
Config, HwcClientException, HwcModule, are_different_dicts, build_path,