Skip to content

Commit

Permalink
Add account_info Admin API (#1463)
Browse files Browse the repository at this point in the history
Signed-off-by: Muhammed Hussein Karimi <[email protected]>
  • Loading branch information
mhkarimi1383 authored Jan 19, 2025
1 parent 69b3bee commit 88f4244
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions minio/minioadmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
@unique
class _COMMAND(Enum):
"""Admin Command enumerations."""
ACCOUNT_INFO = "accountinfo"
ADD_USER = "add-user"
USER_INFO = "user-info"
LIST_USERS = "list-users"
Expand Down Expand Up @@ -322,6 +323,15 @@ def info(self) -> str:
)
return response.data.decode()

def account_info(self, prefix_usage: bool = False) -> str:
"""Get usage information for the authenticating account"""
response = self._url_open(
"GET",
_COMMAND.ACCOUNT_INFO,
query_params={"prefix-usage": "true"} if prefix_usage else None,
)
return response.data.decode()

def user_add(self, access_key: str, secret_key: str) -> str:
"""Create user with access and secret keys"""
body = json.dumps(
Expand Down

0 comments on commit 88f4244

Please sign in to comment.