Sure.
- Via console you can use gsutil command in this way. You just should install gsutil command.
- Via api rest you can use this service. You can try this api here.
- Also there are libraries for python, java or other languajes.
- From @MikeSchwartz suggestion. Using cloud console, you can manage your objects manually. Link.
Update 2: example on NodeJS
We can choose between three options. Using request module, Google cloud NodeJS client or Google API NodeJS client. But first of all, you should authorise your server to make request to Google Cloud Storage (GCS). To do that:
- Open the Console Credentials page
- If it's not already selected, select the project that you're creating credentials for.
- Click Create credentials and choose Service Account Key.
- In the dropdown select Compute Engine default service account. Then click create. A Json file will be downloaded.
- In the left panel click Overview and type cloud storage in the finder.
- Click Google Cloud Storage and make sure that this api is enabled.
- Rename the downloaded json to keyfile.json and put it in accesible path for your NodeJS code.
Google cloud NodeJS client. Here the official repository with a lot of samples.
var fs = require('fs');
var gcloud = require('gcloud');
var gcs = gcloud.storage({
projectId: 'your-project',
keyFilename: '/path/to/keyfile.json'
});
var bucket = gcs.bucket('your-bucket');
var file = bucket.file('your-file');
file.delete(function(err, apiResponse) {}):
Using request module.
npm install request
Then in your code:
var request = require('request');
request({
url: 'https://www.googleapis.com/storage/v1/b/your-bucket/o/your-file',
qs: {key: 'your-private-key'}, // you can find your private-key in your keyfile.json
method: 'DELETE'
}, function(error, response, body){});
- Using Google API NodeJS: I don't know how to use this, but there a lot of examples here.