GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — getMetadata: allow arbitrary request parameters · Issue #2684 · googleapis/google-cloud-node

getMetadata: allow arbitrary request parameters #2684

New issue
Copy link
New issue
Copy link
Closed
Closed
getMetadata: allow arbitrary request parameters#2684
Copy link
Assignees
stephenplusplus
Labels
api: bigqueryIssues related to the BigQuery API.

Description

@c0b
c0b
opened on Oct 20, 2017
Issue body actions

the REST API reference mentioned selectedFields [2], and all google cloud services support the fields parameter [3]; but from [1] I'm not seeing how can I pass these parameters?

  1. https://googlecloudplatform.github.io/google-cloud-node/#/docs/bigquery/0.9.6/bigquery/table?method=getMetadata
  2. https://cloud.google.com/bigquery/docs/reference/rest/v2/tables/get
  3. https://developers.google.com/apis-explorer/#p/bigquery/v2/bigquery.tables.get

Background is we have some tens of thousands tables in bigquery want to figure out which ones are the most expensive ones (using the most storage), so write a little script to enumerate all table metadata, but it runs slow because each API call need to retrieve all metadata, want to use the fields to get only the needed information; if anyone knows a workaround, let me know.
(the http command here is an advanced version of curl; from https://httpie.org/)

$ access_token=$(gcloud auth application-default print-access-token)
$ http https://www.googleapis.com/bigquery/v2/projects/<projectId>/datasets/<datasetId>/tables/<tableId> \
 fields==id,numBytes,numLongTermBytes,numRows,creationTime,expirationTime,lastModifiedTime,type,location \
 access_token==$access_token
[...]
{
 "id": "<projectId>:<datasetId>.<tableId>",
 "numBytes": "112728076",
 "numLongTermBytes": "0",
 "numRows": "28431",
 "creationTime": "1505962477264",
 "expirationTime": "1513738477264",
 "lastModifiedTime": "1505962477264",
 "type": "TABLE",
 "location": "US"
}

Activity

  1. c0b commented on Oct 20, 2017

    @c0b
    c0b
    on Oct 20, 2017
    ContributorAuthor
    More actions

    I see the fields parameter is the use case to mitigate the problem resolved by GraphQL API, but is it possible to ask google services to have GraphQL API?

  2. callmehiphop
    added
    api: bigqueryIssues related to the BigQuery API.
    type: enhancement
    on Nov 1, 2017
  3. callmehiphop commented on Nov 1, 2017

    @callmehiphop
    callmehiphop
    on Nov 1, 2017
    Contributor
    More actions

    @stephenplusplus I don't think it is very common for get/getMetadata to accept query parameters, however do you think we should add support for this in the common library?

  4. stephenplusplus commented on Nov 1, 2017

    @stephenplusplus
    stephenplusplus
    on Nov 1, 2017
    Contributor
    More actions

    I do! Best to be as raw as possible in the common layer.

    Reacted by Dave and Tyler Johnson
  5. stephenplusplus
    changed the title [-]bigquery get metadata: how to pass the selectedFields and fields?[/-] [+]getMetadata: allow arbitrary request parameters[/+] on Nov 2, 2017
  6. tejohnso commented on Nov 2, 2017

    @tejohnso
    tejohnso
    on Nov 2, 2017
    More actions

    @c0b have you tried eg getMetadata({fields: "lastModifiedTime"})?
    It works in the storage module.

  7. c0b commented on Nov 3, 2017

    @c0b
    c0b
    on Nov 3, 2017
    ContributorAuthor
    More actions

    no; I did try that do not work in @google-cloud/[email protected]; current getMetadata take one parameter only which is expected to be the callback function, if pass in an obj then the error is TypeError: callback is not a function

  8. c0b commented on Nov 3, 2017

    @c0b
    c0b
    on Nov 3, 2017
    ContributorAuthor
    More actions

    @tejohnso the storage module works because of #2626 storage has its own repo that has support of that

    https://github.com/googleapis/nodejs-storage/search?q=getMetadata+path:src

  9. stephenplusplus commented on Nov 17, 2017

    @stephenplusplus
    stephenplusplus
    on Nov 17, 2017
    Contributor
    More actions

    This issue was moved to googleapis/nodejs-bigquery#11

  10. stephenplusplus
    closed this as completedon Nov 17, 2017
  11. stephenplusplus
    removed
    type: enhancement
    on Nov 17, 2017
  12. JustinBeckwith
    assigned
    stephenplusplus
    on Feb 1, 2021
  13. sofisl
    added a commit that references this issue on Feb 25, 2026

    chore(main): release 7.18.0 (#2684)

    e8d9a20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @stephenplusplus
    stephenplusplus

Labels

api: bigqueryIssues related to the BigQuery API.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.