I have set up pi web api in a google cloud vm instance. I am able to access the pi web api server in the virtual machine. Is there a way to access it outside the vm.
You will need to get an external IP for your GCP VM so that you can access it publicly.
Reserving a Static External IP Address | Compute Engine Documentation | Google Cloud
https://<external-ip>/piwebapi is how i tried to access the api. This is giving me the following error:
external-ip took too long to respond.
But tried http://<external-ip>. It works and displays a windows iis server page.
I am not familiar with networking part. Can you suggest what might i be doing wrong in accessing the pi web api.
Do check that the firewall has allowed port 443 through as well.
How to open a specific port such as 9090 in Google Compute Engine - Stack Overflow
Looks like some issue with Public ip address and private ip address in the cloud. Request you to check network settings if you are using google cloud(external IP Address and firewall rules : IP Addresses | Compute Engine Documentation | Google Cloud especially firewall rules : Firewall Rules Overview | VPC | Google Cloud )
Click Create firewall rule.
Enter a name for the rule, such as default-allow-http.
Under Source IP ranges, enter 0.0.0.0/0 to allow traffic from all sources.
Under Protocols and ports, check Specified protocols and ports and enter tcp:443
Create your firewall rule.
Retrieving data ...