// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/eventarc.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const eventarc = google.eventarc('v1beta1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/cloud-platform'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await eventarc.projects.locations.get({
// Resource name for the location.
name: 'projects/my-project/locations/my-location',
});
console.log(res.data);
// Example response
// {
// "displayName": "my_displayName",
// "labels": {},
// "locationId": "my_locationId",
// "metadata": {},
// "name": "my_name"
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/eventarc.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const eventarc = google.eventarc('v1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/cloud-platform'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await eventarc.projects.locations.operations.list({
// The standard list filter.
filter: 'placeholder-value',
// The name of the operation's parent resource.
name: 'projects/my-project/locations/my-location',
// The standard list page size.
pageSize: 'placeholder-value',
// The standard list page token.
pageToken: 'placeholder-value',
});
console.log(res.data);
// Example response
// {
// "nextPageToken": "my_nextPageToken",
// "operations": []
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/eventarc.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const eventarc = google.eventarc('v1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/cloud-platform'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await eventarc.projects.locations.channels.setIamPolicy({
// REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.
resource: 'projects/my-project/locations/my-location/channels/my-channel',
// Request body metadata
requestBody: {
// request body parameters
// {
// "policy": {},
// "updateMask": "my_updateMask"
// }
},
});
console.log(res.data);
// Example response
// {
// "auditConfigs": [],
// "bindings": [],
// "etag": "my_etag",
// "version": 0
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/eventarc.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const eventarc = google.eventarc('v1beta1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/cloud-platform'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await eventarc.projects.locations.operations.list({
// The standard list filter.
filter: 'placeholder-value',
// The name of the operation's parent resource.
name: 'projects/my-project/locations/my-location',
// The standard list page size.
pageSize: 'placeholder-value',
// The standard list page token.
pageToken: 'placeholder-value',
});
console.log(res.data);
// Example response
// {
// "nextPageToken": "my_nextPageToken",
// "operations": []
// }
}
main().catch(e => {
console.error(e);
throw e;
});
// Before running the sample:
// - Enable the API at:
// https://console.developers.google.com/apis/api/eventarc.googleapis.com
// - Login into gcloud by running:
// `$ gcloud auth application-default login`
// - Install the npm module by running:
// `$ npm install googleapis`
const {google} = require('googleapis');
const eventarc = google.eventarc('v1beta1');
async function main() {
const auth = new google.auth.GoogleAuth({
// Scopes can be specified either as an array or as a single, space-delimited string.
scopes: ['https://www.googleapis.com/auth/cloud-platform'],
});
// Acquire an auth client, and bind it to all future calls
const authClient = await auth.getClient();
google.options({auth: authClient});
// Do the magic
const res = await eventarc.projects.locations.triggers.setIamPolicy({
// REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.
resource: 'projects/my-project/locations/my-location/triggers/my-trigger',
// Request body metadata
requestBody: {
// request body parameters
// {
// "policy": {},
// "updateMask": "my_updateMask"
// }
},
});
console.log(res.data);
// Example response
// {
// "auditConfigs": [],
// "bindings": [],
// "etag": "my_etag",
// "version": 0
// }
}
main().catch(e => {
console.error(e);
throw e;
});