Is there a way to create organizations programmatically in GCP using gcloud command or an API. I have several small orgs under which there are departments and then teams and finally products(projects). I wanted to have clean inheritance for security policies, standards, shared storage which could be defined at top level and applied across projects and also I wanted to have billing metrics at org level, so that it can be easily tracked where the spending is going..
Organization can be created only on console , although in the documentation for gcloud organizations
command description is:
create and manage Google Cloud Platform Organizations
but there is no command for create.
Looking at your example I don't think that maintaining of several organization is good idea, as in another doc I found that:
The Organization resource is the root node
Which, I understand, is meant to be only one.
However, I suggest to use concept of "folder" which is described here. This concept is designed to create organization structure, and there is both API and for creation of folders .