{ "name": "parades", "version": "0.0.1", "main": "index.js", "dependencies": { "actions-on-google": "^1.1.1" } }
const ApiAiApp = require('actions-on-google').ApiAiApp; function parade(app) { app.ask(`Chinese New Year Parade in Chinatown from 6pm to 9pm.`); } exports.parades = function(request, response) { var app = new ApiAiApp({request: request, response: response}); var actionMap = new Map(); actionMap.set("inquiry.parades", parade); app.handleRequest(actionMap); };
#define API_KEY @"YOUR_API_KEY"
NSDictionary *paramsDictionary = @{@"requests":@[ @{@"image": @{@"content":binaryImageData}, @"features":@[ @{@"type":@"LANDMARK_DETECTION", @"maxResults":@1}]}]};
#import AVSpeechUtterance *utterance = [[AVSpeechUtterance alloc] initWithString:message]; AVSpeechSynthesizer *synthesizer = [[AVSpeechSynthesizer alloc] init]; [synthesizer speakUtterance:utterance];
recognitionConfig.languageCode = @"en-US";
recognitionConfig.languageCode = @"zh-Hans";
#import AVSpeechUtterance *utterance = [[AVSpeechUtterance alloc] initWithString:message]; utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"zh-Hans"]; AVSpeechSynthesizer *synthesizer = [[AVSpeechSynthesizer alloc] init]; [synthesizer speakUtterance:utterance];
where
location
ticket
hours
map
#context.parameter
inquiry.where.location.ticket
#inquiry-where-location.location
$> gsutil notification create -f json -t your-topic gs://your-bucket
$> gcloud beta functions deploy helloWorld --stage-bucket cloud-functions --trigger-bucket your-bucket
Private Logs Viewer
「Google Cloud Audit Logging は本当に使いやすく、BigQuery と統合すれば、すべてのアプリケーションを 1 か所で監視できる強力なツールになります」 — Darren Cibis, Shine Solutions
SetIamPolicy
Copyright 2017 Google Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 'use strict'; exports.processFirewallAuditLogs = (event) => { const msg = JSON.parse(Buffer.from(event.data.data, 'base64').toString()); const logEntry = msg.protoPayload; if (logEntry && logEntry.request && logEntry.methodName === 'v1.compute.firewalls.insert') { let cancelFirewall = false; const allowed = logEntry.request.alloweds; if (allowed) { for (let key in allowed) { const entry = allowed[key]; for (let port in entry.ports) { if (parseInt(entry.ports[port], 10) !== 22) { cancelFirewall = true; break; } } } } if (cancelFirewall) { const resourceArray = logEntry.resourceName.split('/'); const resourceName = resourceArray[resourceArray.length - 1]; const compute = require('@google-cloud/compute')(); return compute.firewall(resourceName).delete(); } } return true; };
index.js
package.json
{ "name" : "audit-log-monitoring", "version" : "1.0.0", "description" : "monitor my audit logs", "main" : "index.js", "dependencies" : { "@google-cloud/compute" : "^0.4.1" } }