зеркало из https://github.com/microsoft/azure-cli.git
Add help content
This commit is contained in:
Родитель
17da6853b3
Коммит
aae9b90a1a
|
@ -86,13 +86,16 @@ def print_arguments(help_file):
|
|||
indent,
|
||||
max_name_length + indent*4 + 2)
|
||||
|
||||
indent = 2
|
||||
indent = 4
|
||||
if p.long_summary:
|
||||
_print_indent('{0}'.format(p.long_summary.rstrip()), indent)
|
||||
|
||||
if p.value_sources:
|
||||
_print_indent('')
|
||||
_print_indent(L("Values from: {0}").format(', '.join(p.value_sources)), indent)
|
||||
|
||||
if p.long_summary or p.value_sources:
|
||||
print('')
|
||||
return indent
|
||||
|
||||
def _print_header(help_file):
|
||||
|
@ -249,10 +252,17 @@ class HelpParameter(object): #pylint: disable=too-few-public-methods
|
|||
data.get('required'),
|
||||
data.get('name')))
|
||||
|
||||
self.type = data.get('type')
|
||||
self.short_summary = data.get('short-summary')
|
||||
self.long_summary = data.get('long-summary')
|
||||
self.value_sources = data.get('populator-commands')
|
||||
if data.get('type'):
|
||||
self.type = data.get('type')
|
||||
|
||||
if data.get('short-summary'):
|
||||
self.short_summary = data.get('short-summary')
|
||||
|
||||
if data.get('long-summary'):
|
||||
self.long_summary = data.get('long-summary')
|
||||
|
||||
if data.get('populator-commands'):
|
||||
self.value_sources = data.get('populator-commands')
|
||||
|
||||
|
||||
class HelpExample(object): #pylint: disable=too-few-public-methods
|
||||
|
|
|
@ -8,6 +8,37 @@ helps = {'test_group1 test_group2': """
|
|||
examples:
|
||||
- name: foo example
|
||||
text: example details
|
||||
""",
|
||||
'vm create': """
|
||||
type: command
|
||||
short-summary: Create an Azure Virtual Machine
|
||||
long-summary: See https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-quick-create-cli/ for an end-to-end tutorial
|
||||
parameters:
|
||||
- name: --image
|
||||
type: string
|
||||
required: false
|
||||
short-summary: OS image
|
||||
long-summary: |
|
||||
Common OS types: CentOS, CoreOS, Debian, openSUSE, RHEL, SLES, UbuntuLTS,
|
||||
Win2012R2Datacenter, Win2012Datacenter, Win2008R2SP1
|
||||
Example URN: canonical:Ubuntu_Snappy_Core:15.04:2016.0318.1949
|
||||
Example URI: http://<storageAccount>.blob.core.windows.net/vhds/osdiskimage.vhd
|
||||
populator-commands:
|
||||
- az vm image list
|
||||
- az vm image show
|
||||
examples:
|
||||
- name: Create a simple Windows Server VM with private IP address
|
||||
text: >
|
||||
az vm create --image Win2012R2Datacenter --admin-username myadmin --admin-password Admin_001
|
||||
-l "West US" -g myvms --name myvm001
|
||||
- name: Create a Linux VM with SSH key authentication, add a public DNS entry and add to an existing Virtual Network and Availability Set.
|
||||
text: >
|
||||
az vm create --image canonical:Ubuntu_Snappy_Core:15.04:2016.0318.1949
|
||||
--admin-username myadmin --admin-password Admin_001 --authentication-type sshkey
|
||||
--virtual-network-type existing --virtual-network-name myvnet --subnet-name default
|
||||
--availability-set-type existing --availability-set-id myavailset
|
||||
--public-ip-address-type new --dns-name-for-public-ip myGloballyUniqueVmDnsName
|
||||
-l "West US" -g myvms --name myvm18o --ssh-key-value "<ssh-rsa-key>"
|
||||
"""
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче