| Copyright | (c) 2013-2023 Brendan Hay |
|---|---|
| License | Mozilla Public License, v. 2.0. |
| Maintainer | Brendan Hay |
| Stability | auto-generated |
| Portability | non-portable (GHC extensions) |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Amazonka.Grafana.CreateWorkspaceApiKey
Description
Creates a Grafana API key for the workspace. This key can be used to authenticate requests sent to the workspace's HTTP API. See https://docs.aws.amazon.com/grafana/latest/userguide/Using-Grafana-APIs.html for available APIs and example requests.
Synopsis
- data CreateWorkspaceApiKey = CreateWorkspaceApiKey' {
- keyName :: Text
- keyRole :: Text
- secondsToLive :: Natural
- workspaceId :: Text
- newCreateWorkspaceApiKey :: Text -> Text -> Natural -> Text -> CreateWorkspaceApiKey
- createWorkspaceApiKey_keyName :: Lens' CreateWorkspaceApiKey Text
- createWorkspaceApiKey_keyRole :: Lens' CreateWorkspaceApiKey Text
- createWorkspaceApiKey_secondsToLive :: Lens' CreateWorkspaceApiKey Natural
- createWorkspaceApiKey_workspaceId :: Lens' CreateWorkspaceApiKey Text
- data CreateWorkspaceApiKeyResponse = CreateWorkspaceApiKeyResponse' {
- httpStatus :: Int
- key :: Sensitive Text
- keyName :: Text
- workspaceId :: Text
- newCreateWorkspaceApiKeyResponse :: Int -> Text -> Text -> Text -> CreateWorkspaceApiKeyResponse
- createWorkspaceApiKeyResponse_httpStatus :: Lens' CreateWorkspaceApiKeyResponse Int
- createWorkspaceApiKeyResponse_key :: Lens' CreateWorkspaceApiKeyResponse Text
- createWorkspaceApiKeyResponse_keyName :: Lens' CreateWorkspaceApiKeyResponse Text
- createWorkspaceApiKeyResponse_workspaceId :: Lens' CreateWorkspaceApiKeyResponse Text
Creating a Request
data CreateWorkspaceApiKey Source #
See: newCreateWorkspaceApiKey smart constructor.
Constructors
| CreateWorkspaceApiKey' | |
Fields
| |
Instances
newCreateWorkspaceApiKey Source #
Arguments
| :: Text | |
| -> Text | |
| -> Natural | |
| -> Text | |
| -> CreateWorkspaceApiKey |
Create a value of CreateWorkspaceApiKey with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
CreateWorkspaceApiKey, createWorkspaceApiKey_keyName - Specifies the name of the key. Keynames must be unique to the workspace.
$sel:keyRole:CreateWorkspaceApiKey', createWorkspaceApiKey_keyRole - Specifies the permission level of the key.
Valid values: VIEWER|EDITOR|ADMIN
$sel:secondsToLive:CreateWorkspaceApiKey', createWorkspaceApiKey_secondsToLive - Specifies the time in seconds until the key expires. Keys can be valid
for up to 30 days.
CreateWorkspaceApiKey, createWorkspaceApiKey_workspaceId - The ID of the workspace to create an API key.
Request Lenses
createWorkspaceApiKey_keyName :: Lens' CreateWorkspaceApiKey Text Source #
Specifies the name of the key. Keynames must be unique to the workspace.
createWorkspaceApiKey_keyRole :: Lens' CreateWorkspaceApiKey Text Source #
Specifies the permission level of the key.
Valid values: VIEWER|EDITOR|ADMIN
createWorkspaceApiKey_secondsToLive :: Lens' CreateWorkspaceApiKey Natural Source #
Specifies the time in seconds until the key expires. Keys can be valid for up to 30 days.
createWorkspaceApiKey_workspaceId :: Lens' CreateWorkspaceApiKey Text Source #
The ID of the workspace to create an API key.
Destructuring the Response
data CreateWorkspaceApiKeyResponse Source #
See: newCreateWorkspaceApiKeyResponse smart constructor.
Constructors
| CreateWorkspaceApiKeyResponse' | |
Fields
| |
Instances
newCreateWorkspaceApiKeyResponse Source #
Arguments
| :: Int | |
| -> Text | |
| -> Text | |
| -> Text | |
| -> CreateWorkspaceApiKeyResponse |
Create a value of CreateWorkspaceApiKeyResponse with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:httpStatus:CreateWorkspaceApiKeyResponse', createWorkspaceApiKeyResponse_httpStatus - The response's http status code.
$sel:key:CreateWorkspaceApiKeyResponse', createWorkspaceApiKeyResponse_key - The key token. Use this value as a bearer token to authenticate HTTP
requests to the workspace.
CreateWorkspaceApiKey, createWorkspaceApiKeyResponse_keyName - The name of the key that was created.
CreateWorkspaceApiKey, createWorkspaceApiKeyResponse_workspaceId - The ID of the workspace that the key is valid for.
Response Lenses
createWorkspaceApiKeyResponse_httpStatus :: Lens' CreateWorkspaceApiKeyResponse Int Source #
The response's http status code.
createWorkspaceApiKeyResponse_key :: Lens' CreateWorkspaceApiKeyResponse Text Source #
The key token. Use this value as a bearer token to authenticate HTTP requests to the workspace.
createWorkspaceApiKeyResponse_keyName :: Lens' CreateWorkspaceApiKeyResponse Text Source #
The name of the key that was created.
createWorkspaceApiKeyResponse_workspaceId :: Lens' CreateWorkspaceApiKeyResponse Text Source #
The ID of the workspace that the key is valid for.