API v2 has no endpoint providing FULL list of ALL available locations in a Data Center
Hi, while studying how to work with the locations and their infraestructures through the API v2, I've realized that it's impossible to get the FULL list of ALL available locations in a concrete Data Center. To better illustrate the problem, I'll explain a simple but possible scenario:
- A third party platform uses API v2 to create a Customer Tenant in a certain Acronis Data Center. This tenant has no services enabled yet.
- Now the Customer Tenant wants to enable the Backup Service (on any edition), but she needs to choose the location where the data will be stored.
- Since currently the API v2 doesn't provide any endpoint that provides the FULL list of locations available in the tenant's Data Center, this forces the development team of the third party platform to code a cumbersome way to obtain it by first getting the service's infra offering items and, from those, get the "infras" themselves. After that, then they can call the GET /api/2/locations endpoint with the location IDs obtained through the infras, and finally build the list of available locations.
The scenario described above is far from ideal, since it implies too many calls that could hurt the user's perception of that third party platform's performance. Maybe is there another way provided by the API v2 that I haven't noticed?

- Accedi per poter commentare

No, you misunderstood. I'm talking about the info of the LOCATIONS. Remember that now Acronis offers up to three different possible locations (Acronis, Google, Azure), each with their own list of infrastructures. Before a user can choose a concrete infrastructure, she must be able to choose the location first. This requires a list of all available locations in a Data Center, but this is not currently provided by the API v2.
Stanislav Pavlov wrote:If I understand your scenario correct, you don't need information regarding all infras in a DC. You need to have info regarding infra, availiable for your main parent tenant: GET /api/2/{tenant_id}/infras and then GET batch info regarding those infras GET /api/2/infra?uuids={coma-separated-list}
- Accedi per poter commentare

You just mention infras and locations so I was missed a little bit, what you need at the final stage, sorry. You've mentioned enabling Backup Services, and then infras, so I assume, you use offering items for that. Offering items JSON use infra_id for appropriate items to indicate where it should be stored. So I assume you need more infras information than locations.
But in any case, for the locations the same APIs available as I mentioned for infras:
GET {{base_url}}/api/2/tenants/{{my_tenant_id}}/locations for your root tenant
and
then
{{base_url}}/api/2/locations?uuids=<list of comma separated uuids obtained at previous call>
Just to to be on the same page, the routing expected to be used to set up offering items for a tenant is following:
- GET available offering_items for a needed child tenant filtering by kind {customer or partner} and editions {standard, advanced, all etc.){{base_url}}/api/2/tenants/{{my_tenant_id}}/offering_items/available_for_child?edition={{edition}}&kind={{kind}}
- Filter the received offering items list by needed criteria, for example type of infras, received by infra id or application_id or anything else you need
- PUT offering items to the needed child tenant{{base_url}}/api/2/tenants/{{partner_tenant_id}}/offering_items
Eduardo Higueras wrote:No, you misunderstood. I'm talking about the info of the LOCATIONS. Remember that now Acronis offers up to three different possible locations (Acronis, Google, Azure), each with their own list of infrastructures. Before a user can choose a concrete infrastructure, she must be able to choose the location first. This requires a list of all available locations in a Data Center, but this is not currently provided by the API v2.
Stanislav Pavlov wrote:If I understand your scenario correct, you don't need information regarding all infras in a DC. You need to have info regarding infra, availiable for your main parent tenant: GET /api/2/{tenant_id}/infras and then GET batch info regarding those infras GET /api/2/infra?uuids={coma-separated-list}
- Accedi per poter commentare

Ok, my problem has been forgetting about getting the root tenant's list of available locations first. I was just thinking about when you create a new tenant through API, it's created completely empty and without any services or offering items enabled. Therefore, that new tenant won't have any location available when you query her locations with the endpoint GET {{base_url}}/api/2/tenants/{{my_tenant_id}}/locations.
Now I understand it properly, thanks.
- Accedi per poter commentare