Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List Bucket and List File #478

Closed
izzusan83 opened this issue Apr 3, 2015 · 4 comments
Closed

List Bucket and List File #478

izzusan83 opened this issue Apr 3, 2015 · 4 comments
Assignees
Labels
api: storage Issues related to the Cloud Storage API. 🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@izzusan83
Copy link

Hi all,
sorry but There isn't documentation about that.
is possible to have a bucket list and file list?

thanks

@izzusan83
Copy link
Author

ok i find the metod for to have bucket list and file list:

// list all BUCKET
storage.getBuckets(function(err, buckets, nextQuery) {

    for(var i = 0; i<buckets.length; i++ ){
    // The `metadata` property is populated for you with the metadata at the
    // time of fetching.
        console.log(buckets[i].metadata.id);
    }

 });

// list all file
bucket.getFiles(function(err, files, nextQuery) {


    // The `metadata` property is populated for you with the metadata at the
    // time of fetching.

    for(var i = 0; i<files.length; i++ ){
    // The `metadata` property is populated for you with the metadata at the
    // time of fetching.
        console.log(files[i].metadata.name);
    }



    // However, in cases where you are concerned the metadata could have
    // changed, use the `getMetadata` method.
   //files[0].getMetadata(function(err, metadata) {});
});

but now i have another question...

is possible to create a folder in the bucket?

thanks a lot

@leibale
Copy link
Contributor

leibale commented Apr 4, 2015

if you create file in path doesn't exist google will create the folders for you

@stephenplusplus stephenplusplus added the api: storage Issues related to the Cloud Storage API. label Apr 6, 2015
@stephenplusplus
Copy link
Contributor

As far as I know, that's the only way to create a folder outside of the Developer's Console UI. I think the solution of uploading a file and having a folder created in the process is fine, but feel free to correct me if you have a use case where that's not fine.

@izzusan83
Copy link
Author

yes, is true...

                        function(err,httpResponse,body){ 

                            var responseJson = JSON.parse(body);

                            if(responseJson.success){

                                callToFunctionInModule("Start Upload in GoogleStorage", cb);

                                var image = bucket.file('ddsImage.dds');

                                fs.createReadStream(__dirname + '../../temp/ddsConversion/' + folderName + '/ddsImage.dds')
                                    .pipe(image.createWriteStream())
                                    .on('error', function(err) {
                                        console.log(err);
                                    })
                                    .on('complete', function() {


                                        }

                                        console.log('The file upload is complete.');
                                });
                            }
                        });

The folder temp doesn't exist. The first time google create the folder id doesn't exist.

but if i need to remove the folder? I sow the method for remove file and buket but not for remove a folder,

Thanks a lot

@yoshi-automation yoshi-automation added 🚨 This issue needs some love. triage me I really want to be triaged. labels Apr 7, 2020
sofisl pushed a commit that referenced this issue Sep 27, 2022
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/de06ef39-12e7-44a8-903b-7c87ac7a56b4/targets

- [ ] To automatically regenerate this PR, check this box.

Source-Link: googleapis/synthtool@079dcce
sofisl pushed a commit that referenced this issue Oct 11, 2022
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/2a81bca4-7abd-4108-ac1f-21340f858709/targets

- [ ] To automatically regenerate this PR, check this box.

Source-Link: googleapis/synthtool@dc9caca
sofisl pushed a commit that referenced this issue Oct 12, 2022
🤖 I have created a release \*beep\* \*boop\*
---
### [2.2.5](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/compare/v2.2.4...v2.2.5) (2021-07-21)


### Bug Fixes

* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#477](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/issues/477)) ([aa0e611](https://www.github.com/googleapis/nodejs-bigquery-data-transfer/commit/aa0e6115e861006b6eabf0e58d3de8033d365918))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
sofisl pushed a commit that referenced this issue Oct 13, 2022
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/2a81bca4-7abd-4108-ac1f-21340f858709/targets

- [ ] To automatically regenerate this PR, check this box.

Source-Link: googleapis/synthtool@dc9caca
sofisl pushed a commit that referenced this issue Oct 13, 2022
sofisl pushed a commit that referenced this issue Nov 9, 2022
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/de06ef39-12e7-44a8-903b-7c87ac7a56b4/targets

- [ ] To automatically regenerate this PR, check this box.

Source-Link: googleapis/synthtool@079dcce
sofisl pushed a commit that referenced this issue Nov 10, 2022
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/2812cef8-9404-4275-bb51-8c6dafc1bc6f/targets

- [ ] To automatically regenerate this PR, check this box.

PiperOrigin-RevId: 361273630
Source-Link: googleapis/googleapis@5477122
sofisl pushed a commit that referenced this issue Nov 10, 2022
sofisl pushed a commit that referenced this issue Nov 11, 2022
sofisl pushed a commit that referenced this issue Nov 11, 2022
[PR](googleapis/gapic-generator-typescript#878) within
updated gapic-generator-typescript version 1.4.0

Committer: @summer-ji-eng
PiperOrigin-RevId: 375759421

Source-Link: googleapis/googleapis@95fa72f

Source-Link: googleapis/googleapis-gen@f40a343
sofisl pushed a commit that referenced this issue Nov 11, 2022
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node) ([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped)) | [`^16.0.0` -> `^18.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/16.18.3/18.11.9) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/compatibility-slim/16.18.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/confidence-slim/16.18.3)](https://docs.renovatebot.com/merge-confidence/) |

---

### Configuration

📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-scheduler).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4yNDEuMTEiLCJ1cGRhdGVkSW5WZXIiOiIzNC4xMS4xIn0=-->
sofisl pushed a commit that referenced this issue Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. 🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

4 participants