lib/ansible/modules/cloud/alicloud/ali_rds_instance.py [24:172]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__metaclass__ = type

ANSIBLE_METADATA = {'metadata_version': '1.1',
                    'status': ['preview'],
                    'supported_by': 'community'}

DOCUMENTATION = '''
---
module: ali_rds_instance
short_description: Create, Restart or Delete an RDS Instance in Alibaba Cloud.
description:
    - Create, Restart, Delete and Modify connection_string, spec for RDS Instance.
    - An unique ali_rds_instance module is determined by parameters db_instance_name.
options:
  state:
    description:
      - If I(state=present), instance will be created.
      - If I(state=present) and instance exists, it will be updated.
      - If I(state=absent), instance will be removed.
      - If I(state=restart), instance will be restarted.
    choices: ['present', 'restart', 'absent']
    default: 'present'
    type: str
  zone_id:
    description:
      - Aliyun availability zone ID in which to launch the instance.
        If it is not specified, it will be allocated by system automatically.
    aliases: ['alicloud_zone']
    type: str
  engine:
    description:
      - The engine type of the database. Required when C(state=present).
    choices: ['MySQL', 'SQLServer', 'PostgreSQL', 'PPAS', 'MariaDB']
    type: str
  engine_version:
    description:
      - The version of the database. Required when C(state=present).
      - MySQL (5.5 | 5.6 | 5.7 | 8.0).
      - SQL Server (2008r2 | 2012 | 2012_ent_ha | 2012_std_ha | 2012_web | 2016_ent_ha | 2016_std_ha | 2016_web | 2017_ent).
      - PostgreSQL (9.4 | 10.0).
      - PPAS (9.3 | 10.0).
      - MariaDB (10.3).
      - see more (https://www.alibabacloud.com/help/doc-detail/26228.htm).
    type: str
  db_instance_class:
    description:
      - The instance type (specifications). For more information, see(https://www.alibabacloud.com/help/doc-detail/26312.htm).
        Required when C(state=present).
    aliases: ['instance_class']
    type: str
  db_instance_storage:
    description:
      - The storage capacity of the instance. Unit(GB). This value must be a multiple of 5. For more information see(https://www.alibabacloud.com/help/doc-detail/26312.htm).
        Required when C(state=present).
    aliases: ['instance_storage']
    type: int
  db_instance_net_type:
    description:
      - Instance of the network connection type (Internet on behalf of the public network, Intranet on behalf of the private network）
        Required when C(state=present).
    aliases: ['instance_net_type']
    choices: ["Internet", "Intranet"]
    type: str
  db_instance_name:
    description:
      - The instance name. It starts with a letter and contains 2 to 255 characters, including letters, digits, underscores (_), and hyphens (-).
        It cannot start with http:// or https://.
      - One of I(db_instance_id) and I(db_instance_name) must be specified when operate existing instance.
    aliases: ['description', 'name']
    type: str
  db_instance_id:
    description:
      - The instance id.
      - One of I(db_instance_id) and I(db_instance_name) must be specified when operate existing instance.
    aliases: ['id']
    type: str
  security_ip_list:
    description:
      - The IP address whitelist of the instance. Separate multiple IP addresses with commas (,). It can include up to 1,000 IP addresses. The IP addresses support two formats.
        IP address format. For example, 10.23.12.24. Classless Inter-Domain Routing (CIDR) format. For example, 10.23.12.24/24 (where /24 indicates the number of bits for the prefix of the IP address, in the range of 1 to 32).
        Required when C(state=present).
    aliases: ['security_ips']
    type: str
  pay_type:
    description:
      - The billing method of the instance. Required when C(state=present).
    choices: ["PostPaid", "PrePaid"]
    type: str
  period:
    description:
      - The duration of the instance. Required when C(pay_type=PrePaid).
    choices: [1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36]
    default: 1
    type: int
  connection_mode:
    description:
      - The access mode of the instance.
    choices: ["Standard", "Safe"]
    type: str
  vswitch_id:
    description:
      - The ID of the VSwitch.
        Required when C(engine=MariaDB)
    type: str
  private_ip_address:
    description:
      - The intranet IP address of the instance. It must be within the IP address range provided by the switch. 
        By default, the system automatically assigns an IP address based on the VPCId and VSwitchId.
    type: str
  auto_renew:
    description:
      - Indicates whether the instance is automatically renewed
    type: bool
    default: False
    aliases: ['auto_renew']
  port:
    description:
      - The target port.
    type: str
  auto_pay:
    description:
      - Auto renew or not.
    type: bool
    default: False
  current_connection_string:
    description:
      - The current connection address of an instance. It can be an internal network address, a public network address, or a classic network address in the hybrid access mode.
    type: str
  connection_string_prefix:
    description:
      - The prefix of the target connection address. Only the prefix of CurrentConnectionString can be modified.
    type: str
  tags:
    description:
      - A hash/dictionaries of rds tags. C({"key":"value"})
    type: dict
  purge_tags:
    description:
      - Delete existing tags on the rds that are not specified in the task.
        If True, it means you have to specify all the desired tags on each task affecting a rds.
    default: False
    type: bool
author:
    - "He Guimin (@xiaozhu36)"
    - "Li Xue (@lixue323)"
requirements:
    - "python >= 3.6"
    - "footmark >= 1.16.0"
extends_documentation_fragment:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



plugins/modules/ali_rds_instance.py [7:155]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
__metaclass__ = type

ANSIBLE_METADATA = {'metadata_version': '1.1',
                    'status': ['preview'],
                    'supported_by': 'community'}

DOCUMENTATION = '''
---
module: ali_rds_instance
short_description: Create, Restart or Delete an RDS Instance in Alibaba Cloud.
description:
    - Create, Restart, Delete and Modify connection_string, spec for RDS Instance.
    - An unique ali_rds_instance module is determined by parameters db_instance_name.
options:
  state:
    description:
      - If I(state=present), instance will be created.
      - If I(state=present) and instance exists, it will be updated.
      - If I(state=absent), instance will be removed.
      - If I(state=restart), instance will be restarted.
    choices: ['present', 'restart', 'absent']
    default: 'present'
    type: str
  zone_id:
    description:
      - Aliyun availability zone ID in which to launch the instance.
        If it is not specified, it will be allocated by system automatically.
    aliases: ['alicloud_zone']
    type: str
  engine:
    description:
      - The engine type of the database. Required when C(state=present).
    choices: ['MySQL', 'SQLServer', 'PostgreSQL', 'PPAS', 'MariaDB']
    type: str
  engine_version:
    description:
      - The version of the database. Required when C(state=present).
      - MySQL (5.5 | 5.6 | 5.7 | 8.0).
      - SQL Server (2008r2 | 2012 | 2012_ent_ha | 2012_std_ha | 2012_web | 2016_ent_ha | 2016_std_ha | 2016_web | 2017_ent).
      - PostgreSQL (9.4 | 10.0).
      - PPAS (9.3 | 10.0).
      - MariaDB (10.3).
      - see more (https://www.alibabacloud.com/help/doc-detail/26228.htm).
    type: str
  db_instance_class:
    description:
      - The instance type (specifications). For more information, see(https://www.alibabacloud.com/help/doc-detail/26312.htm).
        Required when C(state=present).
    aliases: ['instance_class']
    type: str
  db_instance_storage:
    description:
      - The storage capacity of the instance. Unit(GB). This value must be a multiple of 5. For more information see(https://www.alibabacloud.com/help/doc-detail/26312.htm).
        Required when C(state=present).
    aliases: ['instance_storage']
    type: int
  db_instance_net_type:
    description:
      - Instance of the network connection type (Internet on behalf of the public network, Intranet on behalf of the private network）
        Required when C(state=present).
    aliases: ['instance_net_type']
    choices: ["Internet", "Intranet"]
    type: str
  db_instance_name:
    description:
      - The instance name. It starts with a letter and contains 2 to 255 characters, including letters, digits, underscores (_), and hyphens (-).
        It cannot start with http:// or https://.
      - One of I(db_instance_id) and I(db_instance_name) must be specified when operate existing instance.
    aliases: ['description', 'name']
    type: str
  db_instance_id:
    description:
      - The instance id.
      - One of I(db_instance_id) and I(db_instance_name) must be specified when operate existing instance.
    aliases: ['id']
    type: str
  security_ip_list:
    description:
      - The IP address whitelist of the instance. Separate multiple IP addresses with commas (,). It can include up to 1,000 IP addresses. The IP addresses support two formats.
        IP address format. For example, 10.23.12.24. Classless Inter-Domain Routing (CIDR) format. For example, 10.23.12.24/24 (where /24 indicates the number of bits for the prefix of the IP address, in the range of 1 to 32).
        Required when C(state=present).
    aliases: ['security_ips']
    type: str
  pay_type:
    description:
      - The billing method of the instance. Required when C(state=present).
    choices: ["PostPaid", "PrePaid"]
    type: str
  period:
    description:
      - The duration of the instance. Required when C(pay_type=PrePaid).
    choices: [1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36]
    default: 1
    type: int
  connection_mode:
    description:
      - The access mode of the instance.
    choices: ["Standard", "Safe"]
    type: str
  vswitch_id:
    description:
      - The ID of the VSwitch.
        Required when C(engine=MariaDB)
    type: str
  private_ip_address:
    description:
      - The intranet IP address of the instance. It must be within the IP address range provided by the switch. 
        By default, the system automatically assigns an IP address based on the VPCId and VSwitchId.
    type: str
  auto_renew:
    description:
      - Indicates whether the instance is automatically renewed
    type: bool
    default: False
    aliases: ['auto_renew']
  port:
    description:
      - The target port.
    type: str
  auto_pay:
    description:
      - Auto renew or not.
    type: bool
    default: False
  current_connection_string:
    description:
      - The current connection address of an instance. It can be an internal network address, a public network address, or a classic network address in the hybrid access mode.
    type: str
  connection_string_prefix:
    description:
      - The prefix of the target connection address. Only the prefix of CurrentConnectionString can be modified.
    type: str
  tags:
    description:
      - A hash/dictionaries of rds tags. C({"key":"value"})
    type: dict
  purge_tags:
    description:
      - Delete existing tags on the rds that are not specified in the task.
        If True, it means you have to specify all the desired tags on each task affecting a rds.
    default: False
    type: bool
author:
    - "He Guimin (@xiaozhu36)"
    - "Li Xue (@lixue323)"
requirements:
    - "python >= 3.6"
    - "footmark >= 1.16.0"
extends_documentation_fragment:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



