-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for request batching via /batch endpoint? #9271
Comments
(sniffed from the portal) {
"requests": [{
"url": "https://management.azure.com/subscriptions/XXXXXXXX/resourceGroups/rgfluentchash-6828/providers/Microsoft.Compute/virtualMachines/chashvm?api-version=2017-03-30&$expand=instanceView",
"httpMethod": "GET"
}, {
"url": "https://management.azure.com/subscriptions/XXXXXXXX/resourceGroups/javacsmrg3492/providers/Microsoft.Compute/virtualMachines/extvm3158?api-version=2017-03-30&$expand=instanceView",
"httpMethod": "GET"
}, {
"url": "https://management.azure.com/subscriptions/XXXXXXXX/resourceGroups/vmbdtest2680/providers/Microsoft.Compute/virtualMachines/javavm?api-version=2017-03-30&$expand=instanceView",
"httpMethod": "GET"
}, {
"url": "https://management.azure.com/subscriptions/XXXXXXXX/resourceGroups/vmbdtest2819/providers/Microsoft.Compute/virtualMachines/javavm?api-version=2017-03-30&$expand=instanceView",
"httpMethod": "GET"
}, {
"url": "https://management.azure.com/subscriptions/XXXXXXXX/resourceGroups/vmbdtest3413/providers/Microsoft.Compute/virtualMachines/javavm?api-version=2017-03-30&$expand=instanceView",
"httpMethod": "GET"
}, {
"url": "https://management.azure.com/subscriptions/XXXXXXXX/resourceGroups/vmbdtest5047/providers/Microsoft.Compute/virtualMachines/javavm?api-version=2017-03-30&$expand=instanceView",
"httpMethod": "GET"
}]
} response {
"responses": [{
"httpStatusCode": 200,
"headers": {
"Pragma": "no-cache",
"x-ms-ratelimit-remaining-resource": "Microsoft.Compute/LowCostGet3Min;4799,Microsoft.Compute/LowCostGet30Min;38399",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"x-ms-served-by": "XXXXXXXXXXXX",
"x-ms-request-id": "XXXXXXX",
"Cache-Control": "no-cache",
"Server": "Microsoft-HTTPAPI/2.0,Microsoft-HTTPAPI/2.0",
"x-ms-ratelimit-remaining-subscription-reads": "14989",
"x-ms-correlation-request-id": "XXXXXXXXXX",
"x-ms-routing-request-id": "WESTUS2:20180105T165654Z:cfe09e58-53d6-4079-b426-51ecb0ac88bd",
"Date": "Fri, 05 Jan 2018 16:56:53 GMT"
},
"content": {
"properties": {
"type": "Microsoft.Compute/virtualMachines",
"location": "southcentralus",
"tags": {},
"id": "/subscriptions/XXXXXXXX/resourceGroups/rgfluentchash-6828/providers/Microsoft.Compute/virtualMachines/chashvm",
"name": "chashvm"
},
"contentLength": 4058
}
} |
I don't know why the API is not publicly documented (I have asked in the past but not gotten an authoritative answer). I may be that the endpoints don't have the SLAs needed for them to be supported for arbitrary usage. @ravbhatnagar, any insights? |
💯 Uhm... That's something we should have documented. |
Yeah, it's definitely handy... The ARM implementation switches from a single synchronous response to a standard polled long-running operation at 20+ items (which that C# client didn't seem to take into account at first glance), and maxes out at 500 embedded requests. I don't have enough VMs laying around in my test account to poke at the limits for the instanceView use case that I care most about, but in my crusty prototype, fetching instanceView for 10 VMs usually comes back in < 1s, which is a HUGE improvement over 10 additional round trips. I'm sure there are a number of other things this could be useful for, but the fact that it remains undocumented on ARM is definitely of concern. I'm leaning toward using it anyway for our new inventory plugin; perhaps with a switch or auto-fallback to the standard method on any unexpected failures. |
Any update on getting the /batch API documented? I'd like to understand it better, for example can it do more than just GET requests, how to I specify a request body, etc. |
Is there any update here? I can't find any documentation for the /batch endpoint. It's also used by Azure Monitor to fetch data across multiple resources which would otherwise be many API calls. |
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @armleads-azure |
3 similar comments
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @armleads-azure |
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @armleads-azure |
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @armleads-azure |
@ifeoluwaokunoren any update on this issue? |
Hi @nitzmahone. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “ |
Hi @nitzmahone, since you haven’t asked that we “ |
/unresolve |
Hi kaptajnen, only the original author of the issue can ask that it be unresolved. Please open a new issue with your scenario and details if you would like to discuss this topic with the team. |
After seeing how the portal batch-fetches VM
instanceView
s for PowerState so quickly via the/batch
endpoint, I hacked together a batched version ofinstance_view()
onComputeManagementClient
. I couldn't find any docs about the batch endpoint though (complicated by the prevalence of docs for the Batch service)..Is
/batch
actually supported, and if so, any chance for "official" support for batched operations via msrestazure and/or the Python SDK? The bulk VM instanceView fetch is the only thing I can think of right now that I'd need it for, but there are probably plenty of other things out there too...cc @lmazuel
The text was updated successfully, but these errors were encountered: