Skip to content

Hide extraneous GCN plumbing from returned objects #2217

Description

@adam-sandor

Fetching a list of files from my bucket produces 271K of JSON output from the server. And I just have 4 files in the bucket.
The data includes things like the complete description of the bucket itself (per every file) or the description of the googlecloud storage library (authors, dependencies, etc). Some of this is probably not loaded from the server but is added by the node api library. Even if that doesn't lead to network traffic it's still unnecessary and inconvenient when I try to find the relevant data. The screenshot below show the data structure with most elements collapsed. None of those elements are relevant for listing files in the bucket. I only want to see the data that is printed by gsutil when doing ls.

https://www.dropbox.com/s/4dgpu7jh8z6lb9h/Screen%20Shot%202017-04-13%20at%2013.29.58.png?dl=0

I might be missing some option or parameter that would limit the output from getFiles.

Environment details

  • OS: OSX
  • Node.js version: 7.2.0
  • npm version: 3.10.9
  • google-cloud-node version: 1.0.0

Steps to reproduce

var storage = require('@google-cloud/storage');
var fs = require('fs');

var gcs = storage({
    projectId: 'MYPROJECT'
});

var bucket = gcs.bucket('MYBUCKET');

bucket.getFiles(function(err, files) {
    if (!err) {
        fs.writeFileSync("files.json", JSON.stringify(files))
    } else {
        console.error(err)
    }
});

Activity

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

Metadata

Metadata

Labels

api: storageIssues related to the Cloud Storage API.coretype: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions