2

i'm working on dashboard for a customer and i'd like to be able to execute script on my GCP Virtual Machine linux but from the API Javascript. Already check : https://cloud.google.com/compute/docs/reference/rest/v1/ But there is nothing about manage and execute the script from the VM herself.

Then i'd like to know if someone already did something like this

Just be able to execute "python3 /home/.../MyScript.py" but from the Google API. Like create html button with onclick and execute the script on the VM with this button, using js-api (i'm already using the BigQuery API to execute request, and thats work correctly)

Thanks :-)

2
  • You want to log into your vm and to run your JS script on it? And today it doesn't work, isn't it? I don't understand the relation between your script and the API. Commented Dec 2, 2019 at 13:34
  • @guillaumeblaquiere Just execute script located on the Gcloud VM from external (via Javascript, PHP etc ... ) using the API to execute CLI Google directly. Commented Dec 3, 2019 at 10:40

1 Answer 1

2

As of today, you will not be able to do what you are asking for. Nonetheless, I found out two options that might help you as a workaround:

1- On your app server install gcloud and execute shell or system command using your programming language (e.g. PHP).

2- Create a web trigger to execute the script on the GCE instance.

I hope this approach works for you.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.