File: //proc/thread-self/root/lib/google-cloud-sdk/data/cli/bq.json
{
"CLI_VERSION": "2.0.61",
"VERSION": "1",
"capsule": "",
"commands": {
"add-iam-policy-binding": {
"capsule": "",
"commands": {},
"flags": {},
"groups": {},
"is_group": false,
"is_hidden": false,
"path": [
"bq",
"add-iam-policy-binding"
],
"positionals": [],
"release": "GA",
"sections": {
"DESCRIPTION": "Add a binding to a BigQuery resource's policy in IAM.\n\nUsage:\nadd-iam-policy-binding --member=<member>\n--role=<role> <identifier>\n\nOne binding consists of a member and a role, which\nare specified with (required) flags.\n",
"EXAMPLES": "\nbq add-iam-policy-binding \\\n--member='user:myaccount@gmail.com' \\\n--role='roles/bigquery.dataViewer' \\\ntable1\n\nbq add-iam-policy-binding \\\n--member='serviceAccount:my.service.account@my-\ndomain.com' \\\n--role='roles/bigquery.dataEditor' \\\nproject1:dataset1.table1\n\nbq add-iam-policy-binding \\\n--member='allAuthenticatedUsers' \\\n--role='roles/bigquery.dataViewer' \\\n--project_id=proj -t ds.table1\n"
}
},
"cancel": {
"capsule": "",
"commands": {},
"flags": {},
"groups": {},
"is_group": false,
"is_hidden": false,
"path": [
"bq",
"cancel"
],
"positionals": [],
"release": "GA",
"sections": {
"DESCRIPTION": "Request a cancel and waits for the job to be\ncancelled.\n\nRequests a cancel and then either: a) waits until the\njob is done if the sync flag is set [default], or b)\nreturns immediately if the sync flag is not set. Not\nall job types support a cancel, an error is returned\nif it cannot be cancelled. Even for jobs that support\na cancel, success is not guaranteed, the job may have\ncompleted by the time the cancel request is noticed,\nor the job may be in a stage where it cannot be\ncancelled.\n",
"EXAMPLES": "bq cancel job_id # Requests a cancel and waits until\nthe job is done.\nbq --nosync cancel job_id # Requests a cancel and\nreturns immediately.\n"
}
},
"cp": {
"capsule": "",
"commands": {},
"flags": {},
"groups": {},
"is_group": false,
"is_hidden": false,
"path": [
"bq",
"cp"
],
"positionals": [],
"release": "GA",
"sections": {
"DESCRIPTION": "Copies one table to another.\n",
"EXAMPLES": "bq cp dataset.old_table dataset2.new_table\nbq cp --destination_kms_key=kms_key dataset.old_table\ndataset2.new_table\n"
}
},
"extract": {
"capsule": "",
"commands": {},
"flags": {},
"groups": {},
"is_group": false,
"is_hidden": false,
"path": [
"bq",
"extract"
],
"positionals": [],
"release": "GA",
"sections": {
"DESCRIPTION": "Perform an extract operation of source into\ndestination_uris.\n\nUsage:\nextract <source_table> <destination_uris>\n\nUse -m option to extract a source_model.\n",
"EXAMPLES": "bq extract ds.table gs://mybucket/table.csv\nbq extract -m ds.model gs://mybucket/model\n"
}
},
"get-iam-policy": {
"capsule": "",
"commands": {},
"flags": {},
"groups": {},
"is_group": false,
"is_hidden": false,
"path": [
"bq",
"get-iam-policy"
],
"positionals": [],
"release": "GA",
"sections": {
"DESCRIPTION": "Get the IAM policy for a resource.\n\nGets the IAM policy for a dataset or table resource,\nand prints it to stdout. The policy is in JSON\nformat.\n\nUsage: get-iam-policy <identifier>\n",
"EXAMPLES": "bq get-iam-policy ds.table1\nbq get-iam-policy --project_id=proj -t ds.table1\nbq get-iam-policy proj:ds.table1\n"
}
},
"head": {
"capsule": "",
"commands": {},
"flags": {},
"groups": {},
"is_group": false,
"is_hidden": false,
"path": [
"bq",
"head"
],
"positionals": [],
"release": "GA",
"sections": {
"DESCRIPTION": "Displays rows in a table.\n",
"EXAMPLES": "bq head dataset.table\nbq head -j job\nbq head -n 10 dataset.table\nbq head -s 5 -n 10 dataset.table\n"
}
},
"help": {
"capsule": "",
"commands": {},
"flags": {},
"groups": {},
"is_group": false,
"is_hidden": false,
"path": [
"bq",
"help"
],
"positionals": [],
"release": "GA",
"sections": {
"DESCRIPTION": "Help for all or selected command:\nbq_lite help [<command>]\n\nTo retrieve help with global flags:\nbq_lite --help\n\nTo retrieve help with flags only from the main\nmodule:\nbq_lite --helpshort [<command>]\n"
}
},
"init": {
"capsule": "",
"commands": {},
"flags": {},
"groups": {},
"is_group": false,
"is_hidden": false,
"path": [
"bq",
"init"
],
"positionals": [],
"release": "GA",
"sections": {
"DESCRIPTION": "Authenticate and create a default .bigqueryrc file.\n"
}
},
"insert": {
"capsule": "",
"commands": {},
"flags": {},
"groups": {},
"is_group": false,
"is_hidden": false,
"path": [
"bq",
"insert"
],
"positionals": [],
"release": "GA",
"sections": {
"DESCRIPTION": "Inserts rows in a table.\n\nInserts the records formatted as newline delimited\nJSON from file into the specified table. If file is\nnot specified, reads from stdin. If there were any\ninsert errors it prints the errors to stdout.\n",
"EXAMPLES": "bq insert dataset.table /tmp/mydata.json\necho '{\"a\":1, \"b\":2}' | bq insert dataset.table\n\nTemplate table examples: Insert to\ndataset.template_suffix table using dataset.template\ntable as its template.\nbq insert -x=_suffix dataset.table /tmp/mydata.json\n"
}
},
"load": {
"capsule": "",
"commands": {},
"flags": {},
"groups": {},
"is_group": false,
"is_hidden": false,
"path": [
"bq",
"load"
],
"positionals": [],
"release": "GA",
"sections": {
"DESCRIPTION": "Perform a load operation of source into\ndestination_table.\n\nUsage:\nload <destination_table> <source> [<schema>]\n\nThe <destination_table> is the fully-qualified table\nname of table to create, or append to if the table\nalready exists.\n\nThe <source> argument can be a path to a single local\nfile, or a comma-separated list of URIs.\n\nThe <schema> argument should be either the name of a\nJSON file or a text schema. This schema should be\nomitted if the table already has one.\n\nIn the case that the schema is provided in text form,\nit should be a comma-separated list of entries of the\nform name[:type], where type will default to string\nif not specified.\n\nIn the case that <schema> is a filename, it should be\na JSON file containing a single array, each entry of\nwhich should be an object with properties 'name',\n'type', and (optionally) 'mode'. For more detail: htt\nps://cloud.google.com/bigquery/docs/schemas#specifyin\ng_a_json_schema_file\n\nNote: the case of a single-entry schema with no type\nspecified is ambiguous; one can use name:string to\nforce interpretation as a text schema.\n",
"EXAMPLES": "bq load ds.new_tbl ./info.csv ./info_schema.json\nbq load ds.new_tbl gs://mybucket/info.csv\n./info_schema.json\nbq load ds.small gs://mybucket/small.csv\nname:integer,value:string\nbq load ds.small gs://mybucket/small.csv\nfield1,field2,field3\n"
}
},
"ls": {
"capsule": "",
"commands": {},
"flags": {},
"groups": {},
"is_group": false,
"is_hidden": false,
"path": [
"bq",
"ls"
],
"positionals": [],
"release": "GA",
"sections": {
"DESCRIPTION": "List the objects contained in the named collection.\n\nList the objects in the named project or dataset. A\ntrailing : or . can be used to signify a project or\ndataset.\n* With -j, show the jobs in the named project.\n* With -p, show all projects.\n",
"EXAMPLES": "bq ls\nbq ls -j proj\nbq ls -p -n 1000\nbq ls mydataset\nbq ls -a\nbq ls -m mydataset\nbq ls --routines mydataset (requires whitelisting)\nbq ls --filter labels.color:red\nbq ls --filter 'labels.color:red labels.size:*'\nbq ls --transfer_config --transfer_location='us'\n--filter='dataSourceIds:play,adwords'\nbq ls --transfer_run\n--filter='states:SUCCESSED,PENDING'\n--run_attempt='LATEST'\nprojects/p/locations/l/transferConfigs/c\nbq ls --transfer_log\n--message_type='messageTypes:INFO,ERROR'\nprojects/p/locations/l/transferConfigs/c/runs/r\nbq ls --capacity_commitment --project_id=proj\n--location='us'\nbq ls --reservation --project_id=proj --location='us'\nbq ls --reservation_assignment --project_id=proj\n--location='us'\nbq ls --reservation_assignment --project_id=proj\n--location='us'\n<reservation_id>\nbq ls --connection --project_id=proj --location=us\n"
}
},
"mk": {
"capsule": "",
"commands": {},
"flags": {},
"groups": {},
"is_group": false,
"is_hidden": false,
"path": [
"bq",
"mk"
],
"positionals": [],
"release": "GA",
"sections": {
"DESCRIPTION": "Create a dataset, table, view, or transfer\nconfiguration with this name.\n\nSee 'bq help load' for more information on specifying\nthe schema.\n",
"EXAMPLES": "bq mk new_dataset\nbq mk new_dataset.new_table\nbq --dataset_id=new_dataset mk table\nbq mk -t new_dataset.newtable\nname:integer,value:string\nbq mk --view='select 1 as num' new_dataset.newview\n(--view_udf_resource=path/to/file.js)\nbq mk --materialized_view='select sum(x) as sum_x\nfrom dataset.table'\nnew_dataset.newview\nbq mk -d --data_location=EU new_dataset\nbq mk --transfer_config --target_dataset=dataset\n--display_name=name\n-p='{\"param\":\"value\"}' --data_source=source\n--schedule_start_time={schedule_start_time}\n--schedule_end_time={schedule_end_time}\nbq mk --transfer_run --start_time={start_time}\n--end_time={end_time}\nprojects/p/locations/l/transferConfigs/c\nbq mk --transfer_run --run_time={run_time}\nprojects/p/locations/l/transferConfigs/c\nbq mk --reservation --project_id=project\n--location=us reservation_name\nbq mk --reservation_assignment\n--reservation_id=project:us.dev\n--job_type=QUERY --assignee_type=PROJECT\n--assignee_id=myproject\nbq mk --reservation_assignment\n--reservation_id=project:us.dev\n--job_type=QUERY --assignee_type=FOLDER\n--assignee_id=123\nbq mk --reservation_assignment\n--reservation_id=project:us.dev\n--job_type=QUERY --assignee_type=ORGANIZATION\n--assignee_id=456\nbq mk --connection --connection_type='CLOUD_SQL'\n--properties='{\"instanceId\" : \"instance\",\n\"database\" : \"db\", \"type\" : \"MYSQL\" }'\n--connection_credential='{\"username\":\"u\",\n\"password\":\"p\"}'\n--project_id=proj --location=us --display_name=name\nnew_connection\n"
}
},
"mkdef": {
"capsule": "",
"commands": {},
"flags": {},
"groups": {},
"is_group": false,
"is_hidden": false,
"path": [
"bq",
"mkdef"
],
"positionals": [],
"release": "GA",
"sections": {
"DESCRIPTION": "Emits a definition in JSON for an external table,\nsuch as GCS.\n\nThe output of this command can be redirected to a\nfile and used for the external_table_definition flag\nwith the \"bq query\" and \"bq mk\" commands. It produces\na definition with the most commonly used values for\noptions. You can modify the output to override option\nvalues.\n\nThe <source_uris> argument is a comma-separated list\nof URIs indicating the data referenced by this\nexternal table.\n\nThe <schema> argument should be either the name of a\nJSON file or a text schema.\n\nIn the case that the schema is provided in text form,\nit should be a comma-separated list of entries of the\nform name[:type], where type will default to string\nif not specified.\n\nIn the case that <schema> is a filename, it should be\na JSON file containing a single array, each entry of\nwhich should be an object with properties 'name',\n'type', and (optionally) 'mode'. For more detail: htt\nps://cloud.google.com/bigquery/docs/schemas#specifyin\ng_a_json_schema_file\n\nNote: the case of a single-entry schema with no type\nspecified is ambiguous; one can use name:string to\nforce interpretation as a text schema.\n\nUsage:\nmkdef <source_uris> [<schema>]\n",
"EXAMPLES": "bq mkdef 'gs://bucket/file.csv'\nfield1:integer,field2:string\n"
}
},
"partition": {
"capsule": "",
"commands": {},
"flags": {},
"groups": {},
"is_group": false,
"is_hidden": false,
"path": [
"bq",
"partition"
],
"positionals": [],
"release": "GA",
"sections": {
"DESCRIPTION": "Copies source tables into partitioned tables.\n\nUsage: bq partition <source_table_prefix>\n<destination_partitioned_table>\n\nCopies tables of the format\n<source_table_prefix><YYYYmmdd> to a destination\npartitioned table, with the date suffix of the source\ntables becoming the partition date of the destination\ntable partitions.\n\nIf the destination table does not exist, one will be\ncreated with a schema and that matches the last table\nthat matches the supplied prefix.\n",
"EXAMPLES": "bq partition dataset1.sharded_\ndataset2.partitioned_table\n"
}
},
"query": {
"capsule": "",
"commands": {},
"flags": {},
"groups": {},
"is_group": false,
"is_hidden": false,
"path": [
"bq",
"query"
],
"positionals": [],
"release": "GA",
"sections": {
"DESCRIPTION": "Execute a query.\n\nQuery should be specified on command line, or passed\non stdin.\n",
"EXAMPLES": "bq query 'select count(*) from\npublicdata:samples.shakespeare'\necho 'select count(*) from\npublicdata:samples.shakespeare' | bq query\n\nUsage:\nquery [<sql_query>]\n"
}
},
"remove-iam-policy-binding": {
"capsule": "",
"commands": {},
"flags": {},
"groups": {},
"is_group": false,
"is_hidden": false,
"path": [
"bq",
"remove-iam-policy-binding"
],
"positionals": [],
"release": "GA",
"sections": {
"DESCRIPTION": "Remove a binding from a BigQuery resource's policy in\nIAM.\n\nUsage:\nremove-iam-policy-binding --member=<member>\n--role=<role> <identifier>\n\nOne binding consists of a member and a role, which\nare specified with (required) flags.\n",
"EXAMPLES": "\nbq remove-iam-policy-binding \\\n--member='user:myaccount@gmail.com' \\\n--role='roles/bigquery.dataViewer' \\\ntable1\n\nbq remove-iam-policy-binding \\\n--member='serviceAccount:my.service.account@my-\ndomain.com' \\\n--role='roles/bigquery.dataEditor' \\\nproject1:dataset1.table1\n\nbq remove-iam-policy-binding \\\n--member='allAuthenticatedUsers' \\\n--role='roles/bigquery.dataViewer' \\\n--project_id=proj -t ds.table1\n"
}
},
"rm": {
"capsule": "",
"commands": {},
"flags": {},
"groups": {},
"is_group": false,
"is_hidden": false,
"path": [
"bq",
"rm"
],
"positionals": [],
"release": "GA",
"sections": {
"DESCRIPTION": "Delete the dataset, table, transfer config, or\nreservation described by identifier.\n\nAlways requires an identifier, unlike the show and ls\ncommands. By default, also requires confirmation\nbefore deleting. Supports the -d -t flags to signify\nthat the identifier is a dataset or table.\n* With -f, don't ask for confirmation before\ndeleting.\n* With -r, remove all tables in the named dataset.\n",
"EXAMPLES": "bq rm ds.table\nbq rm -m ds.model\nbq rm --routine ds.routine (requires whitelisting)\nbq rm -r -f old_dataset\nbq rm --transfer_config=projects/p/locations/l/transf\nerConfigs/c\nbq rm --connection --project_id=proj --location=us\ncon\nbq rm --capacity_commitment\nproj:US.capacity_commitment_id\nbq rm --reservation --project_id=proj --location=us\nreservation_name\nbq rm --reservation_assignment --project_id=proj\n--location=us\nassignment_name\n"
}
},
"set-iam-policy": {
"capsule": "",
"commands": {},
"flags": {},
"groups": {},
"is_group": false,
"is_hidden": false,
"path": [
"bq",
"set-iam-policy"
],
"positionals": [],
"release": "GA",
"sections": {
"DESCRIPTION": "Set the IAM policy for a resource.\n\nSets the IAM policy for a dataset or table resource.\nAfter setting the policy, the new policy is printed\nto stdout. Policies are in JSON format.\n\nIf the 'etag' field is present in the policy, it must\nmatch the value in the current policy, which can be\nobtained with 'bq get-iam-policy'. Otherwise this\ncommand will fail. This feature allows users to\nprevent concurrent updates.\n\nUsage: set-iam-policy <identifier> <filename>\n",
"EXAMPLES": "bq set-iam-policy ds.table1 /tmp/policy.json\nbq set-iam-policy --project_id=proj -t ds.table1\n/tmp/policy.json\nbq set-iam-policy proj:ds.table1 /tmp/policy.json\n"
}
},
"shell": {
"capsule": "",
"commands": {},
"flags": {},
"groups": {},
"is_group": false,
"is_hidden": false,
"path": [
"bq",
"shell"
],
"positionals": [],
"release": "GA",
"sections": {
"DESCRIPTION": "Start an interactive bq session.\n"
}
},
"show": {
"capsule": "",
"commands": {},
"flags": {},
"groups": {},
"is_group": false,
"is_hidden": false,
"path": [
"bq",
"show"
],
"positionals": [],
"release": "GA",
"sections": {
"DESCRIPTION": "Show all information about an object.\n",
"EXAMPLES": "bq show -j <job_id>\nbq show dataset\nbq show [--schema] dataset.table\nbq show [--view] dataset.view\nbq show [--materialized_view]\ndataset.materialized_view\nbq show -m ds.model\nbq show --routine ds.routine (requires whitelisting)\nbq show --transfer_config\nprojects/p/locations/l/transferConfigs/c\nbq show --transfer_run\nprojects/p/locations/l/transferConfigs/c/runs/r\nbq show --encryption_service_account\nbq show --connection --project_id=project\n--location=us connection\nbq show --capacity_commitment\nproject:US.capacity_commitment_id\nbq show --reservation --location=US\n--project_id=project reservation_name\nbq show --reservation_assignment --project_id=project\n--location=US\n--assignee_type=PROJECT --assignee_id=myproject\n--job_type=QUERY\nbq show --reservation_assignment --project_id=project\n--location=US\n--assignee_type=FOLDER --assignee_id=123\n--job_type=QUERY\nbq show --reservation_assignment --project_id=project\n--location=US\n--assignee_type=ORGANIZATION --assignee_id=456\n--job_type=QUERY\n"
}
},
"update": {
"capsule": "",
"commands": {},
"flags": {},
"groups": {},
"is_group": false,
"is_hidden": false,
"path": [
"bq",
"update"
],
"positionals": [],
"release": "GA",
"sections": {
"DESCRIPTION": "Updates a dataset, table, view or transfer\nconfiguration with this name.\n\nSee 'bq help load' for more information on specifying\nthe schema.\n",
"EXAMPLES": "bq update --description \"Dataset description\"\nexisting_dataset\nbq update --description \"My table\"\nexisting_dataset.existing_table\nbq update --description \"My model\" -m\nexisting_dataset.existing_model\nbq update -t existing_dataset.existing_table\nname:integer,value:string\nbq update --destination_kms_key\nprojects/p/locations/l/keyRings/r/cryptoKeys/k\nexisting_dataset.existing_table\nbq update --view='select 1 as num'\nexisting_dataset.existing_view\n(--view_udf_resource=path/to/file.js)\nbq update --transfer_config --display_name=name\n-p='{\"param\":\"value\"}'\nprojects/p/locations/l/transferConfigs/c\nbq update --transfer_config --target_dataset=dataset\n--refresh_window_days=5 --update_credentials\nprojects/p/locations/l/transferConfigs/c\nbq update --reservation --location=US\n--project_id=my-project\n--reservation_size=2G\nbq update --capacity_commitment --location=US\n--project_id=my-project\n--plan=MONTHLY --renewal_plan=FLEX commitment_id\nbq update --capacity_commitment --location=US\n--project_id=my-project\n--split --slots=500 commitment_id\nbq update --capacity_commitment --location=US\n--project_id=my-project\n--merge commitment_id1,commitment_id2\nbq update --reservation_assignment\n--destination_reservation_id=proj:US.new_reservation\nproj:US.old_reservation.assignment_id\nbq update --connection_credential='{\"username\":\"u\",\n\"password\":\"p\"}'\n--location=US --project_id=my-project\nexisting_connection\n"
}
},
"version": {
"capsule": "",
"commands": {},
"flags": {},
"groups": {},
"is_group": false,
"is_hidden": false,
"path": [
"bq",
"version"
],
"positionals": [],
"release": "GA",
"sections": {
"DESCRIPTION": "Return the version of bq.\n"
}
},
"wait": {
"capsule": "",
"commands": {},
"flags": {},
"groups": {},
"is_group": false,
"is_hidden": false,
"path": [
"bq",
"wait"
],
"positionals": [],
"release": "GA",
"sections": {
"DESCRIPTION": "Wait some number of seconds for a job to finish.\n\nPoll job_id until either (1) the job is DONE or (2)\nthe specified number of seconds have elapsed. Waits\nforever if unspecified. If no job_id is specified,\nand there is only one running job, we poll that job.\n",
"EXAMPLES": "bq wait # Waits forever for the currently running\njob.\nbq wait job_id # Waits forever\nbq wait job_id 100 # Waits 100 seconds\nbq wait job_id 0 # Polls if a job is done, then\nreturns immediately.\n# These may exit with a non-zero status code to\nindicate \"failure\":\nbq wait --fail_on_error job_id # Succeeds if job\nsucceeds.\nbq wait --fail_on_error job_id 100 # Succeeds if job\nsucceeds in 100 sec.\n"
}
}
},
"flags": {},
"groups": {},
"is_group": true,
"is_hidden": false,
"path": [
"bq"
],
"positionals": [],
"release": "GA",
"sections": {}
}