Azure / Azure/azure-libraries-for-java

[BUG] CosmosDBAccountsImpl.list() and CosmosDBAccountsImpl.listAsync() methods do not call List Database Accounts REST API

オープン
#716 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Cosmos customer-reported Mgmt
主要言語
Java
スター
97
フォーク
102
PR マージ指標
30日以内にマージされた PR はありません

説明

Describe the bug
The list() and listAsync() APIs for CosmosDB do not call the List all in subscription REST API: https://docs.microsoft.com/en-us/rest/api/cosmos-db-resource-provider/databaseaccounts/list

Instead these methods first call the List all Resource Groups in subscription REST API, then for each Resource Group, it calls List Database Accounts by Resource Group:

https://docs.microsoft.com/en-us/rest/api/resources/resourcegroups/list

https://docs.microsoft.com/en-us/rest/api/cosmos-db-resource-provider/databaseaccounts/listbyresourcegroup

This results in a lot of API calls for subscriptions with many resource groups. It is also confusing behavior considering that most other list() and listAsync() APIs in the SDK call the List all in subscription API for the given resource, as opposed to this two-pronged approach where the List all Resource Groups API, then List all in Resource Group APIs are called.

Exception or Stack Trace
N/A

To Reproduce
Call the CosmosDBAccountsImpl.list() or the CosmosDBAccountsImpl.listAsync() method.

Code Snippet
azure.cosmosDBAccounts().list()
azure.cosmosDBAccounts().listAsync()

Expected behavior
The list() and listAsync() SDK methods should call the corresponding List REST API. The typical convention across Azure Resource Manager providers in the SDK is that the list() and listAsync() methods call the corresponding List REST API, which fetches all instances of that resource in a subscription.

Screenshots
N/A

Setup (please complete the following information):

  • OS: macOS 10.14.3
  • IDE : IntelliJ IDEA 2018.3.5
  • Version of the Library used: 1.20.1

Additional context
N/A

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

CosmosDBAccountsImpl.list() と listAsync() を調査し、現在のリソース グループ呼び出しを、リンク先の List Database Accounts REST API と比較します。azure.cosmosDBAccounts().list() と listAsync() で再現します。両方のメソッドがリソース グループを列挙するのではなく、サブスクリプション レベルの List API を使用すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
azure, java
領域
api, cloud, databases
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。