mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-04-07 11:20:28 -07:00
Initial addition of generated spanner database to terraform. (#159)
Signed-off-by: Modular Magician <magic-modules@google.com>
This commit is contained in:
parent
2bd4f747f9
commit
4b1523e833
2 changed files with 11 additions and 11 deletions
|
@ -50,9 +50,8 @@ options:
|
|||
name:
|
||||
description:
|
||||
- A unique identifier for the database, which cannot be changed after the instance
|
||||
is created. Values are of the form projects/<project>/instances/[a-z][-a-z0-9]*[a-z0-9].
|
||||
The final segment of the name must be between 6 and 30 characters in length.
|
||||
required: false
|
||||
is created. Values are of the form [a-z][-a-z0-9]*[a-z0-9].
|
||||
required: true
|
||||
extra_statements:
|
||||
description:
|
||||
- 'An optional list of DDL statements to run inside the newly created database.
|
||||
|
@ -103,8 +102,7 @@ RETURN = '''
|
|||
name:
|
||||
description:
|
||||
- A unique identifier for the database, which cannot be changed after the instance
|
||||
is created. Values are of the form projects/<project>/instances/[a-z][-a-z0-9]*[a-z0-9].
|
||||
The final segment of the name must be between 6 and 30 characters in length.
|
||||
is created. Values are of the form [a-z][-a-z0-9]*[a-z0-9].
|
||||
returned: success
|
||||
type: str
|
||||
extraStatements:
|
||||
|
@ -182,8 +180,7 @@ def create(module, link):
|
|||
|
||||
|
||||
def update(module, link):
|
||||
delete(module, self_link(module))
|
||||
create(module, collection(module))
|
||||
module.fail_json(msg="Database cannot be edited")
|
||||
|
||||
|
||||
def delete(module, link):
|
||||
|
@ -192,7 +189,11 @@ def delete(module, link):
|
|||
|
||||
|
||||
def resource_to_request(module):
|
||||
request = {u'name': module.params.get('name'), u'extraStatements': module.params.get('extra_statements')}
|
||||
request = {
|
||||
u'instance': replace_resource_dict(module.params.get(u'instance', {}), 'name'),
|
||||
u'name': module.params.get('name'),
|
||||
u'extraStatements': module.params.get('extra_statements'),
|
||||
}
|
||||
request = encode_request(request, module)
|
||||
return_vals = {}
|
||||
for k, v in request.items():
|
||||
|
@ -262,7 +263,7 @@ def is_different(module, response):
|
|||
# Remove unnecessary properties from the response.
|
||||
# This is for doing comparisons with Ansible's current parameters.
|
||||
def response_to_hash(module, response):
|
||||
return {u'name': response.get(u'name'), u'extraStatements': module.params.get('extra_statements')}
|
||||
return {u'name': module.params.get('name'), u'extraStatements': module.params.get('extra_statements')}
|
||||
|
||||
|
||||
def decode_response(response, module):
|
||||
|
|
|
@ -69,8 +69,7 @@ items:
|
|||
name:
|
||||
description:
|
||||
- A unique identifier for the database, which cannot be changed after the instance
|
||||
is created. Values are of the form projects/<project>/instances/[a-z][-a-z0-9]*[a-z0-9].
|
||||
The final segment of the name must be between 6 and 30 characters in length.
|
||||
is created. Values are of the form [a-z][-a-z0-9]*[a-z0-9].
|
||||
returned: success
|
||||
type: str
|
||||
extraStatements:
|
||||
|
|
Loading…
Add table
Reference in a new issue