Created
October 29, 2022 09:05
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* HTTP function get data from event and resize the GKE cluster pools based on data */ | |
const container = require("@google-cloud/container"); | |
const client = new container.v1.ClusterManagerClient(); | |
exports.helloHTTP = async (req, res) => { | |
console.log(`Request Body`, req.body); | |
const request = { | |
projectId: req.body.projectId, | |
zone: req.body.zone, | |
clusterId: req.body.cluster_id, | |
nodePoolId: req.body.node_pool_id, | |
nodeCount: req.body.node_count, | |
}; | |
const result = await client.setNodePoolSize(request); | |
const operation = result[0]; | |
console.log(operation); | |
res.status(200); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment