I am using Python to interact with Google Compute Engine. I am able to create/stop machines using Python directly. I have used sample code from GoogleCloudPlatform for this purpose and it is working fine.
Now I want to open some ports to interact with machine from outside world using the Python API.
This related question already tells how to open a specific port from Google console web and gcloud command, so my question is specifically how to do it with the Python API.