Skip to content

New GrafanaApiKey

Stephen Valdinger edited this page Apr 3, 2019 · 1 revision

external help file: PSGrafana-help.xml Module Name: PSGrafana online version: schema: 2.0.0

New-GrafanaApiKey

SYNOPSIS

Creates a new API key in Grafana

SYNTAX

New-GrafanaApiKey [-Name] <String> [-Role] <String> [<CommonParameters>]

DESCRIPTION

EXAMPLES

EXAMPLE 1

New-GrafanaApiKey -Name RickyBobby -Role Admin

EXAMPLE 2

New-GrafanaApiKey -Name Alice -Role Editor

PARAMETERS

-Name

The friendly name of the API key

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Role

The access level for the key. Available options are Admin,Editor, and Viewer

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES

The generated API key is only displayed at runtime. If you need to retain it for any reason, be sure to it somewhere safe. It is highly recommended you run this command saved to a variable such as $ApiKey = New-GrafanaApiKey -Name ElmerFudd -Role Viewer. This way you can access the properties Name and Key within the variable. E.g. $ApiKey.name, or $ApiKey.key.

RELATED LINKS

Clone this wiki locally