From 386dabb99ba6e69663c3fa9bb2aa292dde2af3c0 Mon Sep 17 00:00:00 2001 From: Ceri Hopkins Date: Tue, 29 Mar 2022 13:35:31 +0100 Subject: [PATCH] bigquery_table: Add query to view definition --- plugins/modules/gcp_bigquery_table.py | 13 +++++++++++++ plugins/modules/gcp_bigquery_table_info.py | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/plugins/modules/gcp_bigquery_table.py b/plugins/modules/gcp_bigquery_table.py index d02d220..b08ceed 100644 --- a/plugins/modules/gcp_bigquery_table.py +++ b/plugins/modules/gcp_bigquery_table.py @@ -110,6 +110,11 @@ options: required: false type: dict suboptions: + query: + description: + - The SQL query defining this view. + required: false + type: str use_legacy_sql: description: - Specifies whether to use BigQuery's legacy SQL for this view . @@ -633,6 +638,11 @@ view: returned: success type: complex contains: + query: + description: + - The SQL query defining this view. + returned: success + type: str useLegacySql: description: - Specifies whether to use BigQuery's legacy SQL for this view . @@ -1019,6 +1029,7 @@ def main(): view=dict( type='dict', options=dict( + query=dict(type='str'), use_legacy_sql=dict(type='bool'), user_defined_function_resources=dict( type='list', elements='dict', options=dict(inline_code=dict(type='str'), resource_uri=dict(type='str')) @@ -1297,6 +1308,7 @@ class TableView(object): def to_request(self): return remove_nones_from_dict( { + u'query': self.request.get('query'), u'useLegacySql': self.request.get('use_legacy_sql'), u'userDefinedFunctionResources': TableUserdefinedfunctionresourcesArray( self.request.get('user_defined_function_resources', []), self.module @@ -1307,6 +1319,7 @@ class TableView(object): def from_response(self): return remove_nones_from_dict( { + u'query': self.request.get('query'), u'useLegacySql': self.request.get(u'useLegacySql'), u'userDefinedFunctionResources': TableUserdefinedfunctionresourcesArray( self.request.get(u'userDefinedFunctionResources', []), self.module diff --git a/plugins/modules/gcp_bigquery_table_info.py b/plugins/modules/gcp_bigquery_table_info.py index 99b89ac..78ad48e 100644 --- a/plugins/modules/gcp_bigquery_table_info.py +++ b/plugins/modules/gcp_bigquery_table_info.py @@ -214,6 +214,11 @@ resources: returned: success type: complex contains: + query: + description: + - The SQL query defining this view. + returned: success + type: str useLegacySql: description: - Specifies whether to use BigQuery's legacy SQL for this view .