class
Channel
Source: channel.
Create a channel object to interact with a Cloud Storage channel.
Method
new Channel(id, resourceId)
Example
const {Storage} = require('@google-cloud/storage');
const storage = new Storage();
const channel = storage.channel('id', 'resource-id');
Parameters
Name | Type | Optional | Description |
---|---|---|---|
id |
|
|
The ID of the channel. |
resourceId |
|
|
The resource ID of the channel. |
- See also
Method
stop([callback]) → Promise containing StopResponse
Stop this channel.
Example
const {Storage} = require('@google-cloud/storage');
const storage = new Storage();
const channel = storage.channel('id', 'resource-id');
channel.stop(function(err, apiResponse) {
if (!err) {
// Channel stopped successfully.
}
});
//-
// If the callback is omitted, we'll return a Promise.
//-
channel.stop().then(function(data) {
const apiResponse = data[0];
});
Parameter
Name | Type | Optional | Description |
---|---|---|---|
callback |
Yes |
Callback function. |
- Returns
-
Promise containing StopResponse