From 6aef6f9b224cd9df527ab739569c81c3d12ba563 Mon Sep 17 00:00:00 2001 From: ilyal Date: Sun, 14 Jun 2020 09:56:17 +0300 Subject: [PATCH] Add parameter query for view element. Fix table info module --- plugins/modules/gcp_bigquery_table.py | 13 +++++++++++++ plugins/modules/gcp_bigquery_table_info.py | 10 ++++++++++ 2 files changed, 23 insertions(+) diff --git a/plugins/modules/gcp_bigquery_table.py b/plugins/modules/gcp_bigquery_table.py index b867aa6..70812b2 100644 --- a/plugins/modules/gcp_bigquery_table.py +++ b/plugins/modules/gcp_bigquery_table.py @@ -113,6 +113,11 @@ options: required: false type: dict suboptions: + query: + description: + - A query that BigQuery executes when the view is referenced. + required: true + type: str use_legacy_sql: description: - Specifies whether to use BigQuery's legacy SQL for this view . @@ -641,6 +646,11 @@ view: returned: success type: complex contains: + query: + description: + - A query that BigQuery executes when the view is referenced. + required: true + type: str useLegacySql: description: - Specifies whether to use BigQuery's legacy SQL for this view . @@ -1027,6 +1037,7 @@ def main(): view=dict( type='dict', options=dict( + query=dict(required=True, 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')) @@ -1311,6 +1322,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 @@ -1321,6 +1333,7 @@ class TableView(object): def from_response(self): return remove_nones_from_dict( { + u'query': self.request.get(u'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 f012617..9516252 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: + - A query that BigQuery executes when the view is referenced. + required: true + type: str useLegacySql: description: - Specifies whether to use BigQuery's legacy SQL for this view . @@ -444,6 +449,11 @@ resources: skip when reading the data. returned: success type: int + range: + description: + - Range of a sheet to query from. Only used when non-empty. + required: false + type: str csvOptions: description: - Additional properties to set if sourceFormat is set to CSV.