Skip to content

Commit 88f4244

Browse files
authored
Add account_info Admin API (#1463)
Signed-off-by: Muhammed Hussein Karimi <[email protected]>
1 parent 69b3bee commit 88f4244

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

minio/minioadmin.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
@unique
5454
class _COMMAND(Enum):
5555
"""Admin Command enumerations."""
56+
ACCOUNT_INFO = "accountinfo"
5657
ADD_USER = "add-user"
5758
USER_INFO = "user-info"
5859
LIST_USERS = "list-users"
@@ -322,6 +323,15 @@ def info(self) -> str:
322323
)
323324
return response.data.decode()
324325

326+
def account_info(self, prefix_usage: bool = False) -> str:
327+
"""Get usage information for the authenticating account"""
328+
response = self._url_open(
329+
"GET",
330+
_COMMAND.ACCOUNT_INFO,
331+
query_params={"prefix-usage": "true"} if prefix_usage else None,
332+
)
333+
return response.data.decode()
334+
325335
def user_add(self, access_key: str, secret_key: str) -> str:
326336
"""Create user with access and secret keys"""
327337
body = json.dumps(

0 commit comments

Comments
 (0)