-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #113 from modular-magician/master
Add BigQuery, Source Repositories
- Loading branch information
Showing
137 changed files
with
2,298 additions
and
475 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,5 +13,6 @@ group :development do | |
gem 'passgen' | ||
gem 'pry-coolline' | ||
gem 'rake' | ||
gem 'vcr' | ||
gem 'webmock' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
--- | ||
title: About the google_bigquery_table resource | ||
platform: gcp | ||
--- | ||
|
||
## Syntax | ||
A `google_bigquery_table` is used to test a Google Table resource | ||
|
||
## Examples | ||
``` | ||
describe google_bigquery_table(project: 'chef-gcp-inspec', dataset: 'inspec_gcp_dataset', name: 'inspec_gcp_bigquery_table') do | ||
it { should exist } | ||
its('expiration_time') { should cmp '1738882264000' } | ||
its('time_partitioning.type') { should eq 'DAY' } | ||
its('description') { should eq 'A BigQuery table' } | ||
end | ||
describe google_bigquery_table(project: 'chef-gcp-inspec', dataset: 'inspec_gcp_dataset', name: 'nonexistent') do | ||
it { should_not exist } | ||
end | ||
``` | ||
|
||
## Properties | ||
Properties that can be accessed from the `google_bigquery_table` resource: | ||
|
||
* `table_reference`: Reference describing the ID of this table | ||
|
||
* `datasetId`: The ID of the dataset containing this table | ||
|
||
* `projectId`: The ID of the project containing this table | ||
|
||
* `tableId`: The ID of the the table | ||
|
||
* `creation_time`: The time when this dataset was created, in milliseconds since the epoch. | ||
|
||
* `description`: A user-friendly description of the dataset | ||
|
||
* `friendly_name`: A descriptive name for this table | ||
|
||
* `id`: An opaque ID uniquely identifying the table. | ||
|
||
* `labels`: The labels associated with this dataset. You can use these to organize and group your datasets | ||
|
||
* `last_modified_time`: The time when this table was last modified, in milliseconds since the epoch. | ||
|
||
* `location`: The geographic location where the table resides. This value is inherited from the dataset. | ||
|
||
* `name`: Name of the table | ||
|
||
* `num_bytes`: The size of this table in bytes, excluding any data in the streaming buffer. | ||
|
||
* `num_long_term_bytes`: The number of bytes in the table that are considered "long-term storage". | ||
|
||
* `num_rows`: The number of rows of data in this table, excluding any data in the streaming buffer. | ||
|
||
* `type`: Describes the table type | ||
|
||
* `view`: The view definition. | ||
|
||
* `useLegacySql`: Specifies whether to use BigQuery's legacy SQL for this view | ||
|
||
* `userDefinedFunctionResources`: Describes user-defined function resources used in the query. | ||
|
||
* `time_partitioning`: If specified, configures time-based partitioning for this table. | ||
|
||
* `expirationMs`: Number of milliseconds for which to keep the storage for a partition. | ||
|
||
* `type`: The only type supported is DAY, which will generate one partition per day. | ||
|
||
* `streaming_buffer`: Contains information regarding this table's streaming buffer, if one is present. This field will be absent if the table is not being streamed to or if there is no data in the streaming buffer. | ||
|
||
* `estimatedBytes`: A lower-bound estimate of the number of bytes currently in the streaming buffer. | ||
|
||
* `estimatedRows`: A lower-bound estimate of the number of rows currently in the streaming buffer. | ||
|
||
* `oldestEntryTime`: Contains the timestamp of the oldest entry in the streaming buffer, in milliseconds since the epoch, if the streaming buffer is available. | ||
|
||
* `schema`: Describes the schema of this table | ||
|
||
* `fields`: Describes the fields in a table. | ||
|
||
* `encryption_configuration`: Custom encryption configuration | ||
|
||
* `kmsKeyName`: Describes the Cloud KMS encryption key that will be used to protect destination BigQuery table. The BigQuery Service Account associated with your project requires access to this encryption key. | ||
|
||
* `expiration_time`: The time when this table expires, in milliseconds since the epoch. If not present, the table will persist indefinitely. | ||
|
||
* `external_data_configuration`: Describes the data format, location, and other properties of a table stored outside of BigQuery. By defining these properties, the data source can then be queried as if it were a standard BigQuery table. | ||
|
||
* `autodetect`: Try to detect schema and format options automatically. Any option specified explicitly will be honored. | ||
|
||
* `compression`: The compression type of the data source | ||
|
||
* `ignoreUnknownValues`: Indicates if BigQuery should allow extra values that are not represented in the table schema | ||
|
||
* `maxBadRecords`: The maximum number of bad records that BigQuery can ignore when reading data | ||
|
||
* `sourceFormat`: The data format | ||
|
||
* `sourceUris`: The fully-qualified URIs that point to your data in Google Cloud. For Google Cloud Storage URIs: Each URI can contain one '*' wildcard character and it must come after the 'bucket' name. Size limits related to load jobs apply to external data sources. For Google Cloud Bigtable URIs: Exactly one URI can be specified and it has be a fully specified and valid HTTPS URL for a Google Cloud Bigtable table. For Google Cloud Datastore backups, exactly one URI can be specified. Also, the '*' wildcard character is not allowed. | ||
|
||
* `schema`: The schema for the data. Schema is required for CSV and JSON formats | ||
|
||
* `googleSheetsOptions`: Additional options if sourceFormat is set to GOOGLE_SHEETS. | ||
|
||
* `csvOptions`: Additional properties to set if sourceFormat is set to CSV. | ||
|
||
* `bigtableOptions`: Additional options if sourceFormat is set to BIGTABLE. | ||
|
||
* `dataset`: Name of the dataset | ||
|
||
|
||
|
||
## GCP Permissions | ||
|
||
Ensure the [BigQuery API](https://console.cloud.google.com/apis/library/bigquery-json.googleapis.com/) is enabled for the current project. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
title: About the google_bigquery_tables resource | ||
platform: gcp | ||
--- | ||
|
||
## Syntax | ||
A `google_bigquery_tables` is used to test a Google Table resource | ||
|
||
## Examples | ||
``` | ||
describe.one do | ||
google_bigquery_tables(project: 'chef-gcp-inspec', dataset: 'inspec_gcp_dataset').table_references.each do |table_reference| | ||
describe google_bigquery_table(project: 'chef-gcp-inspec', dataset: 'inspec_gcp_dataset', name: table_reference.table_id) do | ||
its('expiration_time') { should cmp '1738882264000' } | ||
its('description') { should eq 'A BigQuery table' } | ||
end | ||
end | ||
end | ||
``` | ||
|
||
## Properties | ||
Properties that can be accessed from the `google_bigquery_tables` resource: | ||
|
||
See [google_bigquery_table.md](google_bigquery_table.md) for more detailed information | ||
* `table_references`: an array of `google_bigquery_table` table_reference | ||
* `creation_times`: an array of `google_bigquery_table` creation_time | ||
* `friendly_names`: an array of `google_bigquery_table` friendly_name | ||
* `ids`: an array of `google_bigquery_table` id | ||
* `labels`: an array of `google_bigquery_table` labels | ||
* `last_modified_times`: an array of `google_bigquery_table` last_modified_time | ||
* `locations`: an array of `google_bigquery_table` location | ||
* `num_bytes`: an array of `google_bigquery_table` num_bytes | ||
* `num_long_term_bytes`: an array of `google_bigquery_table` num_long_term_bytes | ||
* `num_rows`: an array of `google_bigquery_table` num_rows | ||
* `types`: an array of `google_bigquery_table` type | ||
* `views`: an array of `google_bigquery_table` view | ||
* `time_partitionings`: an array of `google_bigquery_table` time_partitioning | ||
* `streaming_buffers`: an array of `google_bigquery_table` streaming_buffer | ||
* `schemas`: an array of `google_bigquery_table` schema | ||
* `encryption_configurations`: an array of `google_bigquery_table` encryption_configuration | ||
* `expiration_times`: an array of `google_bigquery_table` expiration_time | ||
* `external_data_configurations`: an array of `google_bigquery_table` external_data_configuration | ||
* `datasets`: an array of `google_bigquery_table` dataset | ||
|
||
## Filter Criteria | ||
This resource supports all of the above properties as filter criteria, which can be used | ||
with `where` as a block or a method. | ||
|
||
## GCP Permissions | ||
|
||
Ensure the [BigQuery API](https://console.cloud.google.com/apis/library/bigquery-json.googleapis.com/) is enabled for the current project. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.