-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JIRA: PSDK-212 risk: low
- Loading branch information
Showing
9 changed files
with
662 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
docs/content/en/latest/administration/users/create_user_api_token.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
title: "create_user_api_token" | ||
linkTitle: "create_user_api_token" | ||
weight: 10 | ||
no_list: true | ||
superheading: "catalog_user." | ||
--- | ||
|
||
|
||
|
||
``create_user_api_token(user_id: str, api_token_id: str)`` | ||
|
||
Creates a new user or overwrites an existing user. | ||
|
||
{{% parameters-block title="Parameters"%}} | ||
{{< parameter p_name="user_id" p_type="string" >}} | ||
User identification string. e.g. "admin" | ||
{{< /parameter >}} | ||
{{< parameter p_name="api_token_id" p_type="string" >}} | ||
API token identification string. e.g. "admin_token" | ||
{{< /parameter >}} | ||
{{% /parameters-block %}} | ||
|
||
{{% parameters-block title="Returns" %}} | ||
{{< parameter p_type="CatalogApiToken" >}} | ||
Instance of CatalogApiToken holding the information about API token (its id, and bearer token). | ||
{{< /parameter >}} | ||
{{% /parameters-block %}} | ||
|
||
## Example | ||
|
||
```python | ||
# Create a user | ||
sdk.catalog_user.create_user_api_token(user_id="admin", api_token_id="admin_token") | ||
``` |
32 changes: 32 additions & 0 deletions
32
docs/content/en/latest/administration/users/delete_user_api_token.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
title: "delete_user_api_token" | ||
linkTitle: "delete_user_api_token" | ||
weight: 10 | ||
no_list: true | ||
superheading: "catalog_user." | ||
--- | ||
|
||
|
||
|
||
``delete_user_api_token(user_id: str, api_token_id: str)`` | ||
|
||
Creates a new user or overwrites an existing user. | ||
|
||
{{% parameters-block title="Parameters"%}} | ||
{{< parameter p_name="user_id" p_type="string" >}} | ||
User identification string. e.g. "admin" | ||
{{< /parameter >}} | ||
{{< parameter p_name="api_token_id" p_type="string" >}} | ||
API token identification string. e.g. "admin_token" | ||
{{< /parameter >}} | ||
{{% /parameters-block %}} | ||
|
||
{{% parameters-block title="Returns" None="yes" %}} | ||
{{% /parameters-block %}} | ||
|
||
## Example | ||
|
||
```python | ||
# Create a user | ||
sdk.catalog_user.delete_user_api_token(user_id="admin", api_token_id="admin_token") | ||
``` |
35 changes: 35 additions & 0 deletions
35
docs/content/en/latest/administration/users/get_user_api_token.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
title: "get_user_api_token" | ||
linkTitle: "get_user_api_token" | ||
weight: 10 | ||
no_list: true | ||
superheading: "catalog_user." | ||
--- | ||
|
||
|
||
|
||
``get_user_api_token(user_id: str, api_token_id: str)`` | ||
|
||
Creates a new user or overwrites an existing user. | ||
|
||
{{% parameters-block title="Parameters"%}} | ||
{{< parameter p_name="user_id" p_type="string" >}} | ||
User identification string. e.g. "admin" | ||
{{< /parameter >}} | ||
{{< parameter p_name="api_token_id" p_type="string" >}} | ||
API token identification string. e.g. "admin_token" | ||
{{< /parameter >}} | ||
{{% /parameters-block %}} | ||
|
||
{{% parameters-block title="Returns" %}} | ||
{{< parameter p_type="CatalogApiToken" >}} | ||
Instance of CatalogApiToken holding the information about API token. | ||
Note that the bearer token is not returned. It will always be None. | ||
{{< /parameter >}} | ||
{{% /parameters-block %}} | ||
## Example | ||
|
||
```python | ||
# Create a user | ||
sdk.catalog_user.get_user_api_token(user_id="admin", api_token_id="admin_token") | ||
``` |
33 changes: 33 additions & 0 deletions
33
docs/content/en/latest/administration/users/list_user_api_tokens.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
title: "list_user_api_tokens" | ||
linkTitle: "list_user_api_tokens" | ||
weight: 10 | ||
no_list: true | ||
superheading: "catalog_user." | ||
--- | ||
|
||
|
||
|
||
``list_user_api_tokens(user_id: str)`` | ||
|
||
Creates a new user or overwrites an existing user. | ||
|
||
{{% parameters-block title="Parameters"%}} | ||
{{< parameter p_name="user_id" p_type="string" >}} | ||
User identification string. e.g. "admin" | ||
{{< /parameter >}} | ||
{{% /parameters-block %}} | ||
|
||
{{% parameters-block title="Returns" %}} | ||
{{< parameter p_type="list[CatalogApiToken]" >}} | ||
List of CatalogApiToken instances holding the information about users API tokens. | ||
Note that the bearer token is not returned. It will always be None. | ||
{{< /parameter >}} | ||
{{% /parameters-block %}} | ||
|
||
## Example | ||
|
||
```python | ||
# Create a user | ||
sdk.catalog_user.list_user_api_tokens(user_id="admin") | ||
``` |
12 changes: 12 additions & 0 deletions
12
gooddata-sdk/gooddata_sdk/catalog/user/entity_model/api_token.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# (C) 2024 GoodData Corporation | ||
from typing import Optional | ||
|
||
from attrs import define | ||
|
||
from gooddata_sdk.catalog.base import Base | ||
|
||
|
||
@define(auto_attribs=True, kw_only=True) | ||
class CatalogApiToken(Base): | ||
id: str | ||
bearer_token: Optional[str] = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.