Google Search Console – Adding Domain/Subdomain and sitemap for each

I have a WP website http://testexample.com and created a new subdomain with separate content and URL http://subdomain.testexample.com and I need to register both sites in Google Search Console now. The idea is that both sites are visible on Google and to be SEO optimized for different content they have. What is the best way to do this:

1) Add a new property type (Domain) of a testexample.com (without http and www) and after that just to submit both sitemaps (http://testexample.com/sitemap.xml and http://subdomain.testexample.com/sitemap.xml)

2) Add a new property type (URL Prefix) for both sites (http://testexample.com and http://subdomain.testexample.com) and a separate XML file for both sites in the correct property where they belong.

3) Or some other way?

Regards

Need API to programmatically make website available on specific domain/subdomain

I have a platform/program running on SERVER_1 with registered domain e.g. example.com. Registered user can add some data and program will generate HTML pages (static website) according to that data. A user also defines the NAME of the website.

GOAL is to upload these generated static websites on SERVER_2, so they have subdomain [NAME].example.com. So, every new website should have its one subdomain.

Where I am now:

I have the idea to set wildcard subdomain *.example.com pointing to SERVER_2, and then, on SERVER_2 to have virtual hosts which will examine which website to show according to a subdomain.

Problem is that I need to programmatically do everything of this (generate the site, upload to SERVER_2, setup subdomain …) and I need a practical way to do this using an API or do it using SSH, but I’m failing to find a solution that will fit my needs 100%.

I have done research on:

Firebase google – good API and docs but I haven’t seen virtual hosts, also they have limits on number of projects per account

Plesk – old XML API, virtual hosts

S3 – easy website deploy but does not fit subdomain mapping needs

Does somebody know what is the best and most practical way to do all of this fully automatically (back-end Spring-boot java)? Thank You!