You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What: enumerate all vm instances in a situation where there are more than can be listed with a single request.
following the idiomatic paradigm of Javascript the SDK should ideally provide an async generator function that deals with pagination. At least there should be an easier way to paginate than to parse the response to assemble the next request. This is likely to affect all collections dealt with by the SDK (maybe a generic SDK generation thing)
Pagination is required in such a case, but the SDK is not helping in any way to iterate all pages, the following needs to be used and is pretty cumbersome: (ideally something like listInstances should be provided by the SDK for convenience)
asyncfunction*listInstances(){// get first pageletresponse=awaitservice.listInstances({limit: 1});do{for(letidx=0;idx<response.result.instances.length;idx++){yieldresponse.result.instances[idx];}// get next page if there is one...this is the ugly partif(response.result.next){constnextUrl=newURL(response.result.next.href);response=awaitservice.listInstances({limit: 1,start: nextUrl.searchParams.get("start")});}else{response=null;}}while(response);}
The text was updated successfully, but these errors were encountered:
What: enumerate all vm instances in a situation where there are more than can be listed with a single request.
following the idiomatic paradigm of Javascript the SDK should ideally provide an async generator function that deals with pagination. At least there should be an easier way to paginate than to parse the response to assemble the next request. This is likely to affect all collections dealt with by the SDK (maybe a generic SDK generation thing)
Pagination is required in such a case, but the SDK is not helping in any way to iterate all pages, the following needs to be used and is pretty cumbersome: (ideally something like listInstances should be provided by the SDK for convenience)
The text was updated successfully, but these errors were encountered: