Add settingsVersion property to Cloud SQL instance settings (#84)

<!-- This change is generated by MagicModules. -->
/cc @slevenick
This commit is contained in:
The Magician 2018-09-05 10:56:56 -07:00 committed by Alex Stephen
commit 94c0e91a5a

View file

@ -82,13 +82,6 @@ options:
to Second Generation instances. to Second Generation instances.
required: false required: false
suboptions: suboptions:
available:
description:
- The availability status of the failover replica. A false status indicates
that the failover replica is out of sync. The master can only failover to
the failover replica when the status is true.
required: false
type: bool
name: name:
description: description:
- The name of the failover replica. If specified at instance creation, a failover - The name of the failover replica. If specified at instance creation, a failover
@ -259,12 +252,67 @@ options:
For MySQL instances, this field determines whether the instance is Second For MySQL instances, this field determines whether the instance is Second
Generation (recommended) or First Generation. Generation (recommended) or First Generation.
required: false required: false
availability_type:
description:
- The availabilityType define if your postgres instance is run zonal or regional.
required: false
choices:
- ZONAL
- REGIONAL
backup_configuration:
description:
- The daily backup configuration for the instance.
required: false
suboptions:
ip_configuration:
description:
- The settings for IP Management. This allows to enable or disable the instance IP
and manage which external networks can connect to the instance. The IPv4 address
cannot be disabled for Second Generation instances.
required: false
suboptions:
ipv4_enabled:
description:
- Whether the instance should be assigned an IP address or not.
required: false
type: bool
authorized_networks:
description:
- The list of external networks that are allowed to connect to the instance using
the IP. In CIDR notation, also known as 'slash' notation (e.g. 192.168.100.0/24).
required: false
suboptions:
expiration_time:
description:
- The time when this access control entry expires in RFC 3339 format, for example
2012-11-15T16:19:00.094Z.
required: false
name:
description:
- An optional label to identify this entry.
required: false
value:
description:
- The whitelisted value for the access control list. For example, to grant access
to a client from an external IP (IPv4 or IPv6) address or subnet, use that address
or subnet here.
required: false
require_ssl:
description:
- Whether the mysqld should default to 'REQUIRE X509' for users connecting over IP.
required: false
type: bool
tier:
description:
- The tier or machine type for this instance, for example db-n1-standard-1. For MySQL
instances, this field determines whether the instance is Second Generation (recommended)
or First Generation.
required: false
settings_version: settings_version:
description: description:
- The version of instance settings. This is a required field for update method - The version of instance settings. This is a required field for update method to
to make sure concurrent updates are handled properly. During update, use make sure concurrent updates are handled properly. During update, use the most
the most recent settingsVersion value for this instance and do not try to recent settingsVersion value for this instance and do not try to update this value.
update this value.
required: false required: false
extends_documentation_fragment: gcp extends_documentation_fragment: gcp
''' '''
@ -280,8 +328,8 @@ EXAMPLES = '''
value: 8.8.8.8/32 value: 8.8.8.8/32
tier: db-n1-standard-1 tier: db-n1-standard-1
region: us-central1 region: us-central1
project: "test_project" project: test_project
auth_kind: "serviceaccount" auth_kind: serviceaccount
service_account_file: "/tmp/auth.pem" service_account_file: "/tmp/auth.pem"
state: present state: present
''' '''
@ -323,128 +371,73 @@ failoverReplica:
returned: success returned: success
type: bool type: bool
name: name:
description:
- The name of the failover replica. If specified at instance creation, a failover
replica is created for the instance. The name doesn't include the project
ID. This property is applicable only to Second Generation instances.
returned: success
type: str
instanceType:
description:
- The instance type. This can be one of the following.
- "* CLOUD_SQL_INSTANCE: A Cloud SQL instance that is not replicating from a master."
- "* ON_PREMISES_INSTANCE: An instance running on the customer's premises."
- "* READ_REPLICA_INSTANCE: A Cloud SQL instance configured as a read-replica."
returned: success
type: str
ipAddresses:
description:
- The assigned IP addresses for the instance.
returned: success
type: complex
contains:
ipAddress:
description:
- The IP address assigned.
returned: success
type: str
timeToRetire:
description:
- The due time for this IP to be retired in RFC 3339 format, for example 2012-11-15T16:19:00.094Z.
This field is only available when the IP is scheduled to be retired.
returned: success
type: str
type:
description:
- The type of this IP address. A PRIMARY address is an address that can accept
incoming connections. An OUTGOING address is the source address of connections
originating from the instance, if supported.
returned: success
type: str
ipv6Address:
description:
- The IPv6 address assigned to the instance. This property is applicable only to
First Generation instances.
returned: success
type: str
masterInstanceName:
description:
- The name of the instance which will act as master in the replication setup.
returned: success
type: str
maxDiskSize:
description:
- The maximum disk size of the instance in bytes.
returned: success
type: int
name:
description: description:
- Name of the Cloud SQL instance. This does not include the project ID. - Name of the Cloud SQL instance. This does not include the project ID.
returned: success returned: success
type: str type: str
region: region:
description: description:
- The geographical region. Defaults to us-central or us-central1 depending on the - The geographical region. Defaults to us-central or us-central1 depending on the
instance type (First Generation or Second Generation/PostgreSQL). instance type (First Generation or Second Generation/PostgreSQL).
returned: success returned: success
type: str type: str
replicaConfiguration: replica_configuration:
description: description:
- Configuration specific to failover replicas and read replicas. - Configuration specific to failover replicas and read replicas.
returned: success returned: success
type: complex type: complex
contains: contains:
failoverTarget: failover_target:
description: description:
- Specifies if the replica is the failover target. If the field is set to true - Specifies if the replica is the failover target. If the field is set to true the
the replica will be designated as a failover replica. replica will be designated as a failover replica.
- In case the master instance fails, the replica instance will be promoted as - In case the master instance fails, the replica instance will be promoted as the
the new master instance. new master instance.
- Only one replica can be specified as failover target, and the replica has - Only one replica can be specified as failover target, and the replica has to be
to be in different zone with the master instance. in different zone with the master instance.
returned: success returned: success
type: bool type: bool
mysqlReplicaConfiguration: mysql_replica_configuration:
description: description:
- MySQL specific configuration when replicating from a MySQL on-premises master. - MySQL specific configuration when replicating from a MySQL on-premises master. Replication
Replication configuration information such as the username, password, certificates, configuration information such as the username, password, certificates, and keys
and keys are not stored in the instance metadata. The configuration information are not stored in the instance metadata. The configuration information is used
is used only to set up the replication connection and is stored by MySQL in only to set up the replication connection and is stored by MySQL in a file named
a file named master.info in the data directory. master.info in the data directory.
returned: success returned: success
type: complex type: complex
contains: contains:
caCertificate: ca_certificate:
description: description:
- PEM representation of the trusted CA's x509 certificate. - PEM representation of the trusted CA's x509 certificate.
returned: success returned: success
type: str type: str
clientCertificate: client_certificate:
description: description:
- PEM representation of the slave's x509 certificate . - PEM representation of the slave's x509 certificate .
returned: success returned: success
type: str type: str
clientKey: client_key:
description: description:
- PEM representation of the slave's private key. The corresponding public - PEM representation of the slave's private key. The corresponsing public key is encoded
key is encoded in the client's certificate. in the client's asf asd certificate.
returned: success returned: success
type: str type: str
connectRetryInterval: connect_retry_interval:
description: description:
- Seconds to wait between connect retries. MySQL's default is 60 seconds. - Seconds to wait between connect retries. MySQL's default is 60 seconds.
returned: success returned: success
type: int type: int
dumpFilePath: dump_file_path:
description: description:
- Path to a SQL dump file in Google Cloud Storage from which the slave instance - Path to a SQL dump file in Google Cloud Storage from which the slave instance is
is to be created. The URI is in the form gs://bucketName/fileName. Compressed to be created. The URI is in the form gs://bucketName/fileName. Compressed gzip
gzip files (.gz) are also supported. Dumps should have the binlog co-ordinates files (.gz) are also supported. Dumps should have the binlog co-ordinates from which
from which replication should begin. This can be accomplished by setting replication should begin. This can be accomplished by setting --master-data to 1
--master-data to 1 when using mysqldump. when using mysqldump.
returned: success returned: success
type: str type: str
masterHeartbeatPeriod: master_heartbeat_period:
description: description:
- Interval in milliseconds between replication heartbeats. - Interval in milliseconds between replication heartbeats.
returned: success returned: success
@ -454,7 +447,7 @@ replicaConfiguration:
- The password for the replication connection. - The password for the replication connection.
returned: success returned: success
type: str type: str
sslCipher: ssl_cipher:
description: description:
- A list of permissible ciphers to use for SSL encryption. - A list of permissible ciphers to use for SSL encryption.
returned: success returned: success
@ -464,53 +457,53 @@ replicaConfiguration:
- The username for the replication connection. - The username for the replication connection.
returned: success returned: success
type: str type: str
verifyServerCertificate: verify_server_certificate:
description: description:
- Whether or not to check the master's Common Name value in the certificate - Whether or not to check the master's Common Name value in the certificate that it
that it sends during the SSL handshake. sends during the SSL handshake.
returned: success returned: success
type: bool type: bool
replicaNames: replica_names:
description: description:
- The replicas of the instance. - The replicas of the instance.
returned: success returned: success
type: list type: list
serviceAccountEmailAddress: service_account_email_address:
description: description:
- The service account email address assigned to the instance. This property - The service account email address assigned to the instance. This property is applicable
is applicable only to Second Generation instances. only to Second Generation instances.
returned: success returned: success
type: str type: str
settings: settings:
description: description:
- The user settings. - The user settings.
returned: success returned: success
type: complex type: complex
contains: contains:
ipConfiguration: ip_configuration:
description: description:
- The settings for IP Management. This allows to enable or disable the instance - The settings for IP Management. This allows to enable or disable the instance IP
IP and manage which external networks can connect to the instance. The IPv4 and manage which external networks can connect to the instance. The IPv4 address
address cannot be disabled for Second Generation instances. cannot be disabled for Second Generation instances.
returned: success returned: success
type: complex type: complex
contains: contains:
ipv4Enabled: ipv4_enabled:
description: description:
- Whether the instance should be assigned an IP address or not. - Whether the instance should be assigned an IP address or not.
returned: success returned: success
type: bool type: bool
authorizedNetworks: authorized_networks:
description: description:
- The list of external networks that are allowed to connect to the instance - The list of external networks that are allowed to connect to the instance using
using the IP. In CIDR notation, also known as 'slash' notation (e.g. 192.168.100.0/24). the IP. In CIDR notation, also known as 'slash' notation (e.g. 192.168.100.0/24).
returned: success returned: success
type: complex type: complex
contains: contains:
expirationTime: expiration_time:
description: description:
- The time when this access control entry expires in RFC 3339 format, - The time when this access control entry expires in RFC 3339 format, for example
for example 2012-11-15T16:19:00.094Z. 2012-11-15T16:19:00.094Z.
returned: success returned: success
type: str type: str
name: name:
@ -520,30 +513,28 @@ settings:
type: str type: str
value: value:
description: description:
- The whitelisted value for the access control list. For example, to - The whitelisted value for the access control list. For example, to grant access
grant access to a client from an external IP (IPv4 or IPv6) address to a client from an external IP (IPv4 or IPv6) address or subnet, use that address
or subnet, use that address or subnet here. or subnet here.
returned: success returned: success
type: str type: str
requireSsl: require_ssl:
description: description:
- Whether the mysqld should default to 'REQUIRE X509' for users connecting - Whether the mysqld should default to 'REQUIRE X509' for users connecting over IP.
over IP.
returned: success returned: success
type: bool type: bool
tier: tier:
description: description:
- The tier or machine type for this instance, for example db-n1-standard-1. - The tier or machine type for this instance, for example db-n1-standard-1. For MySQL
For MySQL instances, this field determines whether the instance is Second instances, this field determines whether the instance is Second Generation (recommended)
Generation (recommended) or First Generation. or First Generation.
returned: success returned: success
type: str type: str
settingsVersion: settings_version:
description: description:
- The version of instance settings. This is a required field for update method - The version of instance settings. This is a required field for update method to
to make sure concurrent updates are handled properly. During update, use the make sure concurrent updates are handled properly. During update, use the most
most recent settingsVersion value for this instance and do not try to update recent settingsVersion value for this instance and do not try to update this value.
this value.
returned: success returned: success
type: int type: int
''' '''
@ -570,20 +561,16 @@ def main():
backend_type=dict(type='str', choices=['FIRST_GEN', 'SECOND_GEN', 'EXTERNAL']), backend_type=dict(type='str', choices=['FIRST_GEN', 'SECOND_GEN', 'EXTERNAL']),
connection_name=dict(type='str'), connection_name=dict(type='str'),
database_version=dict(type='str', choices=['MYSQL_5_5', 'MYSQL_5_6', 'MYSQL_5_7', 'POSTGRES_9_6']), database_version=dict(type='str', choices=['MYSQL_5_5', 'MYSQL_5_6', 'MYSQL_5_7', 'POSTGRES_9_6']),
failover_replica=dict(type='dict', options=dict(available=dict(type='bool'), name=dict(type='str'))), failover_replica=dict(type='dict', options=dict(name=dict(type='str'))),
instance_type=dict(type='str', choices=['CLOUD_SQL_INSTANCE', 'ON_PREMISES_INSTANCE', 'READ_REPLICA_INSTANCE']), instance_type=dict(type='str', choices=['CLOUD_SQL_INSTANCE', 'ON_PREMISES_INSTANCE', 'READ_REPLICA_INSTANCE']),
ipv6_address=dict(type='str'), ipv6_address=dict(type='str'),
master_instance_name=dict(type='str'), master_instance_name=dict(type='str'),
max_disk_size=dict(type='int'), max_disk_size=dict(type='int'),
name=dict(required=True, type='str'), name=dict(required=True, type='str'),
region=dict(type='str'), region=dict(type='str'),
replica_configuration=dict( replica_configuration=dict(type='dict', options=dict(
type='dict',
options=dict(
failover_target=dict(type='bool'), failover_target=dict(type='bool'),
mysql_replica_configuration=dict( mysql_replica_configuration=dict(type='dict', options=dict(
type='dict',
options=dict(
ca_certificate=dict(type='str'), ca_certificate=dict(type='str'),
client_certificate=dict(type='str'), client_certificate=dict(type='str'),
client_key=dict(type='str'), client_key=dict(type='str'),
@ -593,30 +580,24 @@ def main():
password=dict(type='str'), password=dict(type='str'),
ssl_cipher=dict(type='str'), ssl_cipher=dict(type='str'),
username=dict(type='str'), username=dict(type='str'),
verify_server_certificate=dict(type='bool'), verify_server_certificate=dict(type='bool')
), )),
),
replica_names=dict(type='list', elements='str'), replica_names=dict(type='list', elements='str'),
service_account_email_address=dict(type='str'), service_account_email_address=dict(type='str')
), )),
), settings=dict(type='dict', options=dict(
settings=dict( ip_configuration=dict(type='dict', options=dict(
type='dict',
options=dict(
ip_configuration=dict(
type='dict',
options=dict(
ipv4_enabled=dict(type='bool'), ipv4_enabled=dict(type='bool'),
authorized_networks=dict( authorized_networks=dict(type='list', elements='dict', options=dict(
type='list', elements='dict', options=dict(expiration_time=dict(type='str'), name=dict(type='str'), value=dict(type='str')) expiration_time=dict(type='str'),
), name=dict(type='str'),
require_ssl=dict(type='bool'), value=dict(type='str')
), )),
), require_ssl=dict(type='bool')
)),
tier=dict(type='str'), tier=dict(type='str'),
settings_version=dict(type='int'), settings_version=dict(type='int')
), ))
),
) )
) )
@ -808,10 +789,10 @@ class InstanceFailoverreplica(object):
self.request = {} self.request = {}
def to_request(self): def to_request(self):
return remove_nones_from_dict({u'available': self.request.get('available'), u'name': self.request.get('name')}) return remove_nones_from_dict({u'name': self.request.get('name')})
def from_response(self): def from_response(self):
return remove_nones_from_dict({u'available': self.request.get(u'available'), u'name': self.request.get(u'name')}) return remove_nones_from_dict({u'name': self.request.get(u'name')})
class InstanceIpaddressesArray(object): class InstanceIpaddressesArray(object):
@ -922,22 +903,18 @@ class InstanceSettings(object):
self.request = {} self.request = {}
def to_request(self): def to_request(self):
return remove_nones_from_dict( return remove_nones_from_dict({
{ u'ipConfiguration': InstanceIpConfiguration(self.request.get('ip_configuration', {}), self.module).to_request(),
u'ipConfiguration': InstanceIpconfiguration(self.request.get('ip_configuration', {}), self.module).to_request(),
u'tier': self.request.get('tier'), u'tier': self.request.get('tier'),
u'settingsVersion': self.request.get('settings_version'), u'settingsVersion': self.request.get('settings_version')
} })
)
def from_response(self): def from_response(self):
return remove_nones_from_dict( return remove_nones_from_dict({
{ u'ipConfiguration': InstanceIpConfiguration(self.request.get(u'ipConfiguration', {}), self.module).from_response(),
u'ipConfiguration': InstanceIpconfiguration(self.request.get(u'ipConfiguration', {}), self.module).from_response(),
u'tier': self.request.get(u'tier'), u'tier': self.request.get(u'tier'),
u'settingsVersion': self.request.get(u'settingsVersion'), u'settingsVersion': self.request.get(u'settingsVersion')
} })
)
class InstanceIpconfiguration(object): class InstanceIpconfiguration(object):
@ -994,5 +971,24 @@ class InstanceAuthorizednetworksArray(object):
return remove_nones_from_dict({u'expirationTime': item.get(u'expirationTime'), u'name': item.get(u'name'), u'value': item.get(u'value')}) return remove_nones_from_dict({u'expirationTime': item.get(u'expirationTime'), u'name': item.get(u'name'), u'value': item.get(u'value')})
class InstanceBackupconfiguration(object):
def __init__(self, request, module):
self.module = module
if request:
self.request = request
else:
self.request = {}
def to_request(self):
return remove_nones_from_dict(
{u'enabled': self.request.get('enabled'), u'binaryLogEnabled': self.request.get('binary_log_enabled'), u'startTime': self.request.get('start_time')}
)
def from_response(self):
return remove_nones_from_dict(
{u'enabled': self.request.get(u'enabled'), u'binaryLogEnabled': self.request.get(u'binaryLogEnabled'), u'startTime': self.request.get(u'startTime')}
)
if __name__ == '__main__': if __name__ == '__main__':
main() main()