Containerizing recommendations API (Active Assist)
Leveraging APIs from GCP recommendations:
- https://cloud.google.com/recommender/docs/reference/rest
- https://cloud.google.com/recommender/docs/using-api#list_recommendations
Recommender IDs:
- Verify you have a GCP project that exists and open up cloud shell
gcloud config set project PROJECT_ID
gcloud services enable recommender.googleapis.com
- Clone this repo in your shell environment and then execute the following to start the node.js server:
cd cloud-recommendations/
npm install
npm start // Starts the node.js server
-
Change the environment variables (project, etc) by modifying the
package.json
file. Find thestart
script. -
To leverage Cloud Run to containerize & deploy your work, you just need to execute the following:
gcloud run deploy
- Accept all the apis that need to be enabled for the deployment and once its completed deployment, take the url that is given and run it in your browser.
Current APIs:
GET /bundle // TODO: partial implementation
POST /markClaimed //TODO: needs implementation
Note: If you need to execute anything within the container, then a Dockerfile or equivalent must be created an image to deployed. Cloud Build