As of January 1, 2020 this library no longer supports Python 2 on the latest released version. Library versions released prior to that date will continue to be available. For more information please visit Python 2 support on Google Cloud.

Types for Google Cloud Bigquery Logging v1 API

class google.cloud.bigquery_logging_v1.types.AuditData(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

BigQuery request and response messages for audit log. Note: Table.schema has been deprecated in favor of Table.schemaJson. Table.schema may continue to be present in your logs during this transition.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

table_insert_request

Table insert request.

This field is a member of oneof request.

Type

google.cloud.bigquery_logging_v1.types.TableInsertRequest

table_update_request

Table update request.

This field is a member of oneof request.

Type

google.cloud.bigquery_logging_v1.types.TableUpdateRequest

dataset_list_request

Dataset list request.

This field is a member of oneof request.

Type

google.cloud.bigquery_logging_v1.types.DatasetListRequest

dataset_insert_request

Dataset insert request.

This field is a member of oneof request.

Type

google.cloud.bigquery_logging_v1.types.DatasetInsertRequest

dataset_update_request

Dataset update request.

This field is a member of oneof request.

Type

google.cloud.bigquery_logging_v1.types.DatasetUpdateRequest

job_insert_request

Job insert request.

This field is a member of oneof request.

Type

google.cloud.bigquery_logging_v1.types.JobInsertRequest

job_query_request

Job query request.

This field is a member of oneof request.

Type

google.cloud.bigquery_logging_v1.types.JobQueryRequest

job_get_query_results_request

Job get query results request.

This field is a member of oneof request.

Type

google.cloud.bigquery_logging_v1.types.JobGetQueryResultsRequest

table_data_list_request

Table data-list request.

This field is a member of oneof request.

Type

google.cloud.bigquery_logging_v1.types.TableDataListRequest

set_iam_policy_request

Iam policy request.

This field is a member of oneof request.

Type

google.iam.v1.iam_policy_pb2.SetIamPolicyRequest

table_insert_response

Table insert response.

This field is a member of oneof response.

Type

google.cloud.bigquery_logging_v1.types.TableInsertResponse

table_update_response

Table update response.

This field is a member of oneof response.

Type

google.cloud.bigquery_logging_v1.types.TableUpdateResponse

dataset_insert_response

Dataset insert response.

This field is a member of oneof response.

Type

google.cloud.bigquery_logging_v1.types.DatasetInsertResponse

dataset_update_response

Dataset update response.

This field is a member of oneof response.

Type

google.cloud.bigquery_logging_v1.types.DatasetUpdateResponse

job_insert_response

Job insert response.

This field is a member of oneof response.

Type

google.cloud.bigquery_logging_v1.types.JobInsertResponse

job_query_response

Job query response.

This field is a member of oneof response.

Type

google.cloud.bigquery_logging_v1.types.JobQueryResponse

job_get_query_results_response

Job get query results response.

This field is a member of oneof response.

Type

google.cloud.bigquery_logging_v1.types.JobGetQueryResultsResponse

job_query_done_response

Deprecated: Job query-done response. Use this information for usage analysis.

This field is a member of oneof response.

Type

google.cloud.bigquery_logging_v1.types.JobQueryDoneResponse

policy_response

Iam Policy.

This field is a member of oneof response.

Type

google.iam.v1.policy_pb2.Policy

job_completed_event

A job completion event.

Type

google.cloud.bigquery_logging_v1.types.JobCompletedEvent

table_data_read_events

Information about the table access events.

Type

MutableSequence[google.cloud.bigquery_logging_v1.types.TableDataReadEvent]

class google.cloud.bigquery_logging_v1.types.BigQueryAcl(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

An access control list.

entries

Access control entry list.

Type

MutableSequence[google.cloud.bigquery_logging_v1.types.BigQueryAcl.Entry]

class Entry(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Access control entry.

role

The granted role, which can be READER, WRITER, or OWNER.

Type

str

group_email

Grants access to a group identified by an email address.

Type

str

user_email

Grants access to a user identified by an email address.

Type

str

domain

Grants access to all members of a domain.

Type

str

special_group

Grants access to special groups. Valid groups are PROJECT_OWNERS, PROJECT_READERS, PROJECT_WRITERS and ALL_AUTHENTICATED_USERS.

Type

str

view_name

Grants access to a BigQuery View.

Type

google.cloud.bigquery_logging_v1.types.TableName

class google.cloud.bigquery_logging_v1.types.Dataset(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

BigQuery dataset information. See the Dataset API resource for more details on individual fields.

dataset_name

The name of the dataset.

Type

google.cloud.bigquery_logging_v1.types.DatasetName

info

User-provided metadata for the dataset.

Type

google.cloud.bigquery_logging_v1.types.DatasetInfo

create_time

The time the dataset was created.

Type

google.protobuf.timestamp_pb2.Timestamp

update_time

The time the dataset was last modified.

Type

google.protobuf.timestamp_pb2.Timestamp

acl

The access control list for the dataset.

Type

google.cloud.bigquery_logging_v1.types.BigQueryAcl

default_table_expire_duration

If this field is present, each table that does not specify an expiration time is assigned an expiration time by adding this duration to the table’s createTime. If this field is empty, there is no default table expiration time.

Type

google.protobuf.duration_pb2.Duration

class google.cloud.bigquery_logging_v1.types.DatasetInfo(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

User-provided metadata for a dataset.

friendly_name

A short name for the dataset, such as"Analytics Data 2011".

Type

str

description

A long description, perhaps several paragraphs, describing the dataset contents in detail.

Type

str

labels

Labels provided for the dataset.

Type

MutableMapping[str, str]

class LabelsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Bases: proto.message.Message

class google.cloud.bigquery_logging_v1.types.DatasetInsertRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Dataset insert request.

resource

The dataset to be inserted.

Type

google.cloud.bigquery_logging_v1.types.Dataset

class google.cloud.bigquery_logging_v1.types.DatasetInsertResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Dataset insert response.

resource

Final state of the inserted dataset.

Type

google.cloud.bigquery_logging_v1.types.Dataset

class google.cloud.bigquery_logging_v1.types.DatasetListRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Dataset list request.

list_all

Whether to list all datasets, including hidden ones.

Type

bool

class google.cloud.bigquery_logging_v1.types.DatasetName(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The fully-qualified name for a dataset.

project_id

The project ID.

Type

str

dataset_id

The dataset ID within the project.

Type

str

class google.cloud.bigquery_logging_v1.types.DatasetUpdateRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Dataset update request.

resource

The dataset to be updated.

Type

google.cloud.bigquery_logging_v1.types.Dataset

class google.cloud.bigquery_logging_v1.types.DatasetUpdateResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Dataset update response.

resource

Final state of the updated dataset.

Type

google.cloud.bigquery_logging_v1.types.Dataset

class google.cloud.bigquery_logging_v1.types.EncryptionInfo(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Describes encryption properties for a table or a job

kms_key_name

unique identifier for cloud kms key

Type

str

class google.cloud.bigquery_logging_v1.types.Job(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Describes a job.

job_name

Job name.

Type

google.cloud.bigquery_logging_v1.types.JobName

job_configuration

Job configuration.

Type

google.cloud.bigquery_logging_v1.types.JobConfiguration

job_status

Job status.

Type

google.cloud.bigquery_logging_v1.types.JobStatus

job_statistics

Job statistics.

Type

google.cloud.bigquery_logging_v1.types.JobStatistics

class google.cloud.bigquery_logging_v1.types.JobCompletedEvent(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Query job completed event.

event_name

Name of the event.

Type

str

job

Job information.

Type

google.cloud.bigquery_logging_v1.types.Job

class google.cloud.bigquery_logging_v1.types.JobConfiguration(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Job configuration information. See the Jobs API resource for more details on individual fields.

This message has oneof fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

query

Query job information.

This field is a member of oneof configuration.

Type

google.cloud.bigquery_logging_v1.types.JobConfiguration.Query

load

Load job information.

This field is a member of oneof configuration.

Type

google.cloud.bigquery_logging_v1.types.JobConfiguration.Load

extract

Extract job information.

This field is a member of oneof configuration.

Type

google.cloud.bigquery_logging_v1.types.JobConfiguration.Extract

table_copy

TableCopy job information.

This field is a member of oneof configuration.

Type

google.cloud.bigquery_logging_v1.types.JobConfiguration.TableCopy

dry_run

If true, don’t actually run the job. Just check that it would run.

Type

bool

labels

Labels provided for the job.

Type

MutableMapping[str, str]

class Extract(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Describes an extract job, which exports data to an external source via the export pipeline.

destination_uris

Google Cloud Storage URIs where extracted data should be written.

Type

MutableSequence[str]

source_table

The source table.

Type

google.cloud.bigquery_logging_v1.types.TableName

class LabelsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Bases: proto.message.Message

class Load(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Describes a load job, which loads data from an external source via the import pipeline.

source_uris

URIs for the data to be imported. Only Google Cloud Storage URIs are supported.

Type

MutableSequence[str]

schema_json

The table schema in JSON format representation of a TableSchema.

Type

str

destination_table

The table where the imported data is written.

Type

google.cloud.bigquery_logging_v1.types.TableName

create_disposition

Describes when a job is allowed to create a table: CREATE_IF_NEEDED, CREATE_NEVER.

Type

str

write_disposition

Describes how writes affect existing tables: WRITE_TRUNCATE, WRITE_APPEND, WRITE_EMPTY.

Type

str

destination_table_encryption

Result table encryption information. Set when non-default encryption is used.

Type

google.cloud.bigquery_logging_v1.types.EncryptionInfo

class Query(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Describes a query job, which executes a SQL-like query.

query

The SQL query to run.

Type

str

destination_table

The table where results are written.

Type

google.cloud.bigquery_logging_v1.types.TableName

create_disposition

Describes when a job is allowed to create a table: CREATE_IF_NEEDED, CREATE_NEVER.

Type

str

write_disposition

Describes how writes affect existing tables: WRITE_TRUNCATE, WRITE_APPEND, WRITE_EMPTY.

Type

str

default_dataset

If a table name is specified without a dataset in a query, this dataset will be added to table name.

Type

google.cloud.bigquery_logging_v1.types.DatasetName

table_definitions

Describes data sources outside BigQuery, if needed.

Type

MutableSequence[google.cloud.bigquery_logging_v1.types.TableDefinition]

query_priority

Describes the priority given to the query: QUERY_INTERACTIVE or QUERY_BATCH.

Type

str

destination_table_encryption

Result table encryption information. Set when non-default encryption is used.

Type

google.cloud.bigquery_logging_v1.types.EncryptionInfo

statement_type

Type of the statement (e.g. SELECT, INSERT, CREATE_TABLE, CREATE_MODEL..)

Type

str

class TableCopy(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Describes a copy job, which copies an existing table to another table.

source_tables

Source tables.

Type

MutableSequence[google.cloud.bigquery_logging_v1.types.TableName]

destination_table

Destination table.

Type

google.cloud.bigquery_logging_v1.types.TableName

create_disposition

Describes when a job is allowed to create a table: CREATE_IF_NEEDED, CREATE_NEVER.

Type

str

write_disposition

Describes how writes affect existing tables: WRITE_TRUNCATE, WRITE_APPEND, WRITE_EMPTY.

Type

str

destination_table_encryption

Result table encryption information. Set when non-default encryption is used.

Type

google.cloud.bigquery_logging_v1.types.EncryptionInfo

class google.cloud.bigquery_logging_v1.types.JobGetQueryResultsRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Job getQueryResults request.

max_results

Maximum number of results to return.

Type

int

start_row

Zero-based row number at which to start.

Type

int

class google.cloud.bigquery_logging_v1.types.JobGetQueryResultsResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Job getQueryResults response.

total_results

Total number of results in query results.

Type

int

job

The job that was created to run the query. It completed if job.status.state is DONE. It failed if job.status.errorResult is also present.

Type

google.cloud.bigquery_logging_v1.types.Job

class google.cloud.bigquery_logging_v1.types.JobInsertRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Job insert request.

resource

Job insert request.

Type

google.cloud.bigquery_logging_v1.types.Job

class google.cloud.bigquery_logging_v1.types.JobInsertResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Job insert response.

resource

Job insert response.

Type

google.cloud.bigquery_logging_v1.types.Job

class google.cloud.bigquery_logging_v1.types.JobName(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The fully-qualified name for a job.

project_id

The project ID.

Type

str

job_id

The job ID within the project.

Type

str

location

The job location.

Type

str

class google.cloud.bigquery_logging_v1.types.JobQueryDoneResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Job getQueryDone response.

job

The job and status information. The job completed if job.status.state is DONE.

Type

google.cloud.bigquery_logging_v1.types.Job

class google.cloud.bigquery_logging_v1.types.JobQueryRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Job query request.

query

The query.

Type

str

max_results

The maximum number of results.

Type

int

default_dataset

The default dataset for tables that do not have a dataset specified.

Type

google.cloud.bigquery_logging_v1.types.DatasetName

project_id

Project that the query should be charged to.

Type

str

dry_run

If true, don’t actually run the job. Just check that it would run.

Type

bool

class google.cloud.bigquery_logging_v1.types.JobQueryResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Job query response.

total_results

The total number of rows in the full query result set.

Type

int

job

Information about the queried job.

Type

google.cloud.bigquery_logging_v1.types.Job

class google.cloud.bigquery_logging_v1.types.JobStatistics(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Job statistics that may change after a job starts.

create_time

Time when the job was created.

Type

google.protobuf.timestamp_pb2.Timestamp

start_time

Time when the job started.

Type

google.protobuf.timestamp_pb2.Timestamp

end_time

Time when the job ended.

Type

google.protobuf.timestamp_pb2.Timestamp

total_processed_bytes

Total bytes processed for a job.

Type

int

total_billed_bytes

Processed bytes, adjusted by the job’s CPU usage.

Type

int

billing_tier

The tier assigned by CPU-based billing.

Type

int

total_slot_ms

The total number of slot-ms consumed by the query job.

Type

int

reservation_usage

Reservation usage. This field reported misleading information and will no longer be populated. Aggregate usage of all jobs submitted to a reservation should provide a more reliable indicator of reservation imbalance.

Type

MutableSequence[google.cloud.bigquery_logging_v1.types.JobStatistics.ReservationResourceUsage]

reservation

Reservation name or “unreserved” for on-demand resource usage.

Type

str

referenced_tables

The first N tables accessed by the query job. Older queries that reference a large number of tables may not have all of their tables in this list. You can use the total_tables_processed count to know how many total tables were read in the query. For new queries, there is currently no limit.

Type

MutableSequence[google.cloud.bigquery_logging_v1.types.TableName]

total_tables_processed

Total number of unique tables referenced in the query.

Type

int

referenced_views

The first N views accessed by the query job. Older queries that reference a large number of views may not have all of their views in this list. You can use the total_tables_processed count to know how many total tables were read in the query. For new queries, there is currently no limit.

Type

MutableSequence[google.cloud.bigquery_logging_v1.types.TableName]

total_views_processed

Total number of unique views referenced in the query.

Type

int

query_output_row_count

Number of output rows produced by the query job.

Type

int

total_load_output_bytes

Total bytes loaded for an import job.

Type

int

class ReservationResourceUsage(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Job resource usage breakdown by reservation.

name

Reservation name or “unreserved” for on-demand resources usage.

Type

str

slot_ms

Total slot milliseconds used by the reservation for a particular job.

Type

int

class google.cloud.bigquery_logging_v1.types.JobStatus(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Running state of a job.

state

State of a job: PENDING, RUNNING, or DONE.

Type

str

error

If the job did not complete successfully, this field describes why.

Type

google.rpc.status_pb2.Status

additional_errors

Errors encountered during the running of the job. Do not necessarily mean that the job has completed or was unsuccessful.

Type

MutableSequence[google.rpc.status_pb2.Status]

class google.cloud.bigquery_logging_v1.types.Table(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Describes a BigQuery table. See the Table API resource for more details on individual fields. Note: Table.schema has been deprecated in favor of Table.schemaJson. Table.schema may continue to be present in your logs during this transition.

table_name

The name of the table.

Type

google.cloud.bigquery_logging_v1.types.TableName

info

User-provided metadata for the table.

Type

google.cloud.bigquery_logging_v1.types.TableInfo

schema_json

A JSON representation of the table’s schema.

Type

str

view

If present, this is a virtual table defined by a SQL query.

Type

google.cloud.bigquery_logging_v1.types.TableViewDefinition

expire_time

The expiration date for the table, after which the table is deleted and the storage reclaimed. If not present, the table persists indefinitely.

Type

google.protobuf.timestamp_pb2.Timestamp

create_time

The time the table was created.

Type

google.protobuf.timestamp_pb2.Timestamp

truncate_time

The time the table was last truncated by an operation with a writeDisposition of WRITE_TRUNCATE.

Type

google.protobuf.timestamp_pb2.Timestamp

update_time

The time the table was last modified.

Type

google.protobuf.timestamp_pb2.Timestamp

encryption

The table encryption information. Set when non-default encryption is used.

Type

google.cloud.bigquery_logging_v1.types.EncryptionInfo

class google.cloud.bigquery_logging_v1.types.TableDataListRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Table data-list request.

start_row

Starting row offset.

Type

int

max_results

Maximum number of results to return.

Type

int

class google.cloud.bigquery_logging_v1.types.TableDataReadEvent(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Table data read event. Only present for tables, not views, and is only included in the log record for the project that owns the table.

table_name

Name of the accessed table.

Type

google.cloud.bigquery_logging_v1.types.TableName

referenced_fields

A list of referenced fields. This information is not included by default. To enable this in the logs, please contact BigQuery support or open a bug in the BigQuery issue tracker.

Type

MutableSequence[str]

class google.cloud.bigquery_logging_v1.types.TableDefinition(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Describes an external data source used in a query.

name

Name of the table, used in queries.

Type

str

source_uris

Google Cloud Storage URIs for the data to be imported.

Type

MutableSequence[str]

class google.cloud.bigquery_logging_v1.types.TableInfo(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

User-provided metadata for a table.

friendly_name

A short name for the table, such as"Analytics Data - Jan 2011".

Type

str

description

A long description, perhaps several paragraphs, describing the table contents in detail.

Type

str

labels

Labels provided for the table.

Type

MutableMapping[str, str]

class LabelsEntry(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Bases: proto.message.Message

class google.cloud.bigquery_logging_v1.types.TableInsertRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Table insert request.

resource

The new table.

Type

google.cloud.bigquery_logging_v1.types.Table

class google.cloud.bigquery_logging_v1.types.TableInsertResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Table insert response.

resource

Final state of the inserted table.

Type

google.cloud.bigquery_logging_v1.types.Table

class google.cloud.bigquery_logging_v1.types.TableName(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

The fully-qualified name for a table.

project_id

The project ID.

Type

str

dataset_id

The dataset ID within the project.

Type

str

table_id

The table ID of the table within the dataset.

Type

str

class google.cloud.bigquery_logging_v1.types.TableUpdateRequest(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Table update request.

resource

The table to be updated.

Type

google.cloud.bigquery_logging_v1.types.Table

class google.cloud.bigquery_logging_v1.types.TableUpdateResponse(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Table update response.

resource

Final state of the updated table.

Type

google.cloud.bigquery_logging_v1.types.Table

class google.cloud.bigquery_logging_v1.types.TableViewDefinition(mapping=None, *, ignore_unknown_fields=False, **kwargs)[source]

Bases: proto.message.Message

Describes a virtual table defined by a SQL query.

query

SQL query defining the view.

Type

str