forked from Azure/azure-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_help.py
112 lines (90 loc) · 3.71 KB
/
_help.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from azure.cli.core.help_files import helps #pylint: disable=unused-import
#pylint: disable=line-too-long
helps['keyvault'] = """
type: group
short-summary: Safeguard and maintain control of keys, secrets, and certificates.
long-summary: If you don't have the keyvault component installed, add it with `az component update --add keyvault`.
"""
helps['keyvault create'] = """
type: command
short-summary: Create a key vault.
long-summary: "Default permissions are created for the current user unless the --no-self-perms flag is specified."
"""
helps['keyvault delete'] = """
type: command
short-summary: Delete a key vault.
"""
helps['keyvault list'] = """
type: command
short-summary: List key vaults.
"""
helps['keyvault show'] = """
type: command
short-summary: Show details of a key vault.
"""
helps['keyvault update'] = """
type: command
short-summary: Update the properties of a key vault.
"""
helps['keyvault key'] = """
type: group
short-summary: Manage keys.
"""
helps['keyvault secret'] = """
type: group
short-summary: Manage secrets.
"""
helps['keyvault certificate'] = """
type: group
short-summary: Manage certificates.
"""
helps['keyvault certificate get-default-policy'] = """
type: command
short-summary: Get a default policy for a self-signed certificate
long-summary: >
This default policy can be used in conjunction with `az keyvault create` to create a self-signed certificate.
The default policy can also be used as a starting point to create derivative policies. \n
Also see: https://docs.microsoft.com/en-us/rest/api/keyvault/certificates-and-policies
examples:
- name: Create a self-signed certificate with a the default policy
text: >
az keyvault create -g group-name -n vaultname -l westus --enabled-for-deployment true \\
--enabled-for-template-deployment true
az keyvault certificate create --vault-name vaultname -n cert1 \\
-p "$(az keyvault certificate get-default-policy)"
"""
helps['keyvault certificate create'] = """
type: command
long-summary: >
Create a Key Vault certificate. Certificates can also be used as a secrets in provisioned virtual machines.
examples:
- name: Create a self-signed certificate with a the default policy and add to a virtual machine
text: >
az keyvault certificate create --vault-name vaultname -n cert1 \\
-p "$(az keyvault certificate get-default-policy)"
secrets=$(az keyvault secret list-versions --vault-name vaultname \\
-n cert1 --query "[?attributes.enabled]")
vm_secrets=$(az vm format-secret -s "$secrets") \n
az vm create -g group-name -n vm-name --admin-username deploy \\
--image debian --secrets "$vm_secrets"
"""
helps['keyvault certificate pending'] = """
type: group
short-summary: Manage pending certificate creation operations.
"""
helps['keyvault certificate contact'] = """
type: group
short-summary: Manage contacts for certificate management.
"""
helps['keyvault certificate issuer'] = """
type: group
short-summary: Manage certificate issuer information.
"""
helps['keyvault certificate issuer admin'] = """
type: group
short-summary: Manage admin information for certificate issuers.
"""