This commit is contained in:
Burt Bielicki 2016-05-04 10:55:45 -07:00
Родитель 539813ba88 6522fc0b23
Коммит eee849d0fd
7 изменённых файлов: 596 добавлений и 23 удалений

Просмотреть файл

@ -1,4 +1,6 @@
import json
import json
import re
try:
from urllib.request import urlopen
except ImportError:
@ -113,45 +115,133 @@ def _vm_disk_detach(args, instance):
except StopIteration:
raise RuntimeError("No disk with the name '%s' found" % args.get('name'))
#temporary behavior, filters for publisher, sku, etc will be supported soon
@command_table.command('vm image list-aliases')
@command_table.description(L('a temporary command you can query for the most common images'
', and use the details to create a new VM.'))
def _list_images(_):
return read_images_from_aliases_doc()
def read_images_from_aliases_doc():
def _load_images_from_aliases_doc(publisher, offer, sku):
target_url = ('https://raw.githubusercontent.com/Azure/azure-rest-api-specs/'
'master/arm-compute/quickstart-templates/aliases.json')
txt = urlopen(target_url).read()
dic = json.loads(txt.decode())
try:
result = dic['outputs']['aliases']['value']
all_images = []
result = (dic['outputs']['aliases']['value'])
for v in result.values(): #loop around os
for vv in v.values(): #loop around distros
vv['urn'] = ':'.join([vv['publisher'], vv['offer'], vv['sku'], vv['version']])
return result
all_images.append({
'publisher': vv['publisher'],
'offer': vv['offer'],
'sku': vv['sku'],
'version': vv['version']
})
all_images = [i for i in all_images if (_partial_matched(publisher, i['publisher']) and
_partial_matched(offer, i['offer']) and
_partial_matched(sku, i['sku']))]
return all_images
except KeyError:
raise RuntimeError('Could not retrieve image list from {}'.format(target_url))
def _load_images_thru_services(publisher, offer, sku, location):
from concurrent.futures import ThreadPoolExecutor
all_images = []
client = _compute_client_factory({})
def _load_images_from_publisher(publisher):
offers = client.virtual_machine_images.list_offers(location, publisher)
if offer:
offers = [o for o in offers if _partial_matched(offer, o.name)]
for o in offers:
skus = client.virtual_machine_images.list_skus(location, publisher, o.name)
if sku:
skus = [s for s in skus if _partial_matched(sku, s.name)]
for s in skus:
images = client.virtual_machine_images.list(location, publisher, o.name, s.name)
for i in images:
all_images.append({
'publisher': publisher,
'offer': o.name,
'sku': s.name,
'version': i.name})
publishers = client.virtual_machine_images.list_publishers(location)
if publisher:
publishers = [p for p in publishers if _partial_matched(publisher, p.name)]
publisher_num = len(publishers)
if publisher_num > 1:
with ThreadPoolExecutor(max_workers=40) as executor:
for p in publishers:
executor.submit(_load_images_from_publisher, p.name)
elif publisher_num == 1:
_load_images_from_publisher(publishers[0].name)
return all_images
def _partial_matched(pattern, string):
if not pattern:
return True # empty pattern means wildcard-match
pattern = r'.*' + pattern
return re.match(pattern, string, re.I)
def _create_image_instance(publisher, offer, sku, version):
return {
'publisher': publisher,
'offer': offer,
'sku': sku,
'version': version
}
#
# Composite convenience commands for the CLI
#
def _parse_rg_name(strid):
'''From an ID, extract the contained (resource group, name) tuple
'''
import re
parts = re.split('/', strid)
if parts[3] != 'resourceGroups':
raise KeyError()
return (parts[4], parts[8])
class ConvenienceVmCommands(object): # pylint: disable=too-few-public-methods
def __init__(self, _):
pass
def list_ip_addresses(self, optional_resource_group_name=None, vm_name=None): # pylint: disable=no-self-use
# pylint: disable=no-self-use,too-many-arguments
def list_vm_images(self,
image_location=None,
publisher=None,
offer=None,
sku=None,
all=False): #pylint: disable=redefined-builtin
'''vm image list
:param str location:Image location
:param str publisher:Image publisher name
:param str offer:Image offer name
:param str sku:Image sku name
:param bool all:Retrieve all versions of images from all publishers
'''
load_thru_services = all
if load_thru_services and not image_location:
raise RuntimeError('Argument of --location/-l is required to use with --all flag')
if load_thru_services:
all_images = _load_images_thru_services(publisher,
offer,
sku,
image_location)
else:
all_images = _load_images_from_aliases_doc(publisher, offer, sku)
for i in all_images:
i['urn'] = ':'.join([i['publisher'], i['offer'], i['sku'], i['version']])
return all_images
def list_ip_addresses(self,
optional_resource_group_name=None,
vm_name=None):
''' Get IP addresses from one or more Virtual Machines
:param str optional_resource_group_name:Name of resource group.
:param str vm_name:Name of virtual machine.
@ -204,3 +294,5 @@ class ConvenienceVmCommands(object): # pylint: disable=too-few-public-methods
})
return result

Просмотреть файл

@ -76,7 +76,6 @@ build_operation("vm image",
_compute_client_factory,
[
AutoCommandDefinition(VirtualMachineImagesOperations.get, 'VirtualMachineImage', command_alias='show'),
AutoCommandDefinition(VirtualMachineImagesOperations.list, '[VirtualMachineImageResource]'),
AutoCommandDefinition(VirtualMachineImagesOperations.list_offers, '[VirtualMachineImageResource]'),
AutoCommandDefinition(VirtualMachineImagesOperations.list_publishers, '[VirtualMachineImageResource]'),
AutoCommandDefinition(VirtualMachineImagesOperations.list_skus, '[VirtualMachineImageResource]'),
@ -262,3 +261,16 @@ build_operation('vm',
command_table,
vm_param_aliases,
extra_parameters)
build_operation("vm image",
None,
ConvenienceVmCommands,
[
AutoCommandDefinition(ConvenienceVmCommands.list_vm_images, 'object', 'list')
],
command_table,
_patch_aliases({
#get rid of the alias with work on https://www.pivotaltracker.com/projects/1535539/stories/118884633
'image_location' : {'name': '--location -l', 'help': 'Image location'}
}))

Просмотреть файл

@ -1,4 +1,27 @@
# AZURE CLI VM TEST DEFINITIONS
# AZURE CLI VM TEST DEFINITIONS
from azure.cli.utils.command_test_script import CommandTestScript
#pylint: disable=method-hidden
class VMImageListByAliasesScenarioTest(CommandTestScript):
def test_body(self):
result = self.run('vm image list --offer ubuntu -o tsv')
assert result.index('14.04.4-LTS') >= 0
def __init__(self):
super(VMImageListByAliasesScenarioTest, self).__init__(None, self.test_body, None)
class VMImageListThruServiceScenarioTest(CommandTestScript):
def test_body(self):
cmd = ('vm image list -l westus --publisher Canonical --offer '
'Ubuntu_Snappy_Core -o tsv --all')
result = self.run(cmd)
assert result.index('15.04') >= 0
def __init__(self):
super(VMImageListThruServiceScenarioTest, self).__init__(None, self.test_body, None)
ENV_VAR = {}
@ -10,5 +33,15 @@ TEST_DEF = [
{
'test_name': 'vm_list_from_group',
'command': 'vm list --resource-group XPLATTESTGEXTENSION9085',
},
{
'test_name': 'vm_images_list_by_aliases',
'command': VMImageListByAliasesScenarioTest()
},
{
'test_name': 'vm_images_list_thru_services',
'command': VMImageListThruServiceScenarioTest()
}
]

Просмотреть файл

@ -1,4 +1,6 @@
{
"test_vm_images_list_by_aliases": "",
"test_vm_images_list_thru_services": "",
"test_vm_list_from_group": "Availability Set : None\nId : /subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/XPLATTESTGEXTENSION9085/providers/Microsoft.Compute/virtualMachines/xplatvmExt1314\nInstance View : None\nLicense Type : None\nLocation : southeastasia\nName : xplatvmExt1314\nPlan : None\nProvisioning State : Succeeded\nResource Group : XPLATTESTGEXTENSION9085\nResources : None\nType : Microsoft.Compute/virtualMachines\nDiagnostics Profile :\n Boot Diagnostics :\n Enabled : True\n Storage Uri : https://xplatstoragext4633.blob.core.windows.net/\nHardware Profile :\n Vm Size : Standard_A1\nNetwork Profile :\n Network Interfaces :\n Id : /subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/xplatTestGExtension9085/providers/Microsoft.Network/networkInterfaces/xplatnicExt4843\n Primary : None\n Resource Group : xplatTestGExtension9085\nOs Profile :\n Admin Password : None\n Admin Username : azureuser\n Computer Name : xplatvmExt1314\n Custom Data : None\n Linux Configuration : None\n Secrets :\n None\n Windows Configuration :\n Additional Unattend Content : None\n Enable Automatic Updates : True\n Provision Vm Agent : True\n Time Zone : None\n Win Rm : None\nStorage Profile :\n Data Disks :\n None\n Image Reference :\n Offer : WindowsServerEssentials\n Publisher : MicrosoftWindowsServerEssentials\n Sku : WindowsServerEssentials\n Version : 1.0.20131018\n Os Disk :\n Caching : ReadWrite\n Create Option : fromImage\n Disk Size Gb : None\n Encryption Settings : None\n Image : None\n Name : cli1eaed78b36def353-os-1453419539945\n Os Type : Windows\n Vhd :\n Uri : https://xplatstoragext4633.blob.core.windows.net/xplatstoragecntext1789/cli1eaed78b36def353-os-1453419539945.vhd\nTags :\n None\n\n\n",
"test_vm_usage_list_westus": "[\n {\n \"currentValue\": 0,\n \"limit\": 2000,\n \"name\": {\n \"localizedValue\": \"Availability Sets\",\n \"value\": \"availabilitySets\"\n },\n \"unit\": \"Count\"\n },\n {\n \"currentValue\": 7,\n \"limit\": 100,\n \"name\": {\n \"localizedValue\": \"Total Regional Cores\",\n \"value\": \"cores\"\n },\n \"unit\": \"Count\"\n },\n {\n \"currentValue\": 5,\n \"limit\": 10000,\n \"name\": {\n \"localizedValue\": \"Virtual Machines\",\n \"value\": \"virtualMachines\"\n },\n \"unit\": \"Count\"\n },\n {\n \"currentValue\": 0,\n \"limit\": 50,\n \"name\": {\n \"localizedValue\": \"Virtual Machine Scale Sets\",\n \"value\": \"virtualMachineScaleSets\"\n },\n \"unit\": \"Count\"\n },\n {\n \"currentValue\": 1,\n \"limit\": 100,\n \"name\": {\n \"localizedValue\": \"Standard D Family Cores\",\n \"value\": \"standardDFamily\"\n },\n \"unit\": \"Count\"\n },\n {\n \"currentValue\": 6,\n \"limit\": 100,\n \"name\": {\n \"localizedValue\": \"Standard A0-A7 Family Cores\",\n \"value\": \"standardA0_A7Family\"\n },\n \"unit\": \"Count\"\n }\n]\n"
}

Просмотреть файл

@ -0,0 +1,71 @@
interactions:
- request:
body: null
headers:
Connection: [close]
Host: [raw.githubusercontent.com]
User-Agent: [Python-urllib/3.5]
method: GET
uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json
response:
body: {string: "{\n \"$schema\":\"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\"\
,\n \"contentVersion\":\"1.0.0.0\",\n \"parameters\":{},\n \"variables\"\
:{},\n \"resources\":[],\n\n \"outputs\":{\n \"aliases\":{\n \"\
metadata\":{\n \"description\":\"This list of aliases is used by Azure\
\ XPLAT CLI, Azure Powershell, and Azure Portal as shorthands for commonly\
\ used VM images. If you change this file, please verify that this doesn't\
\ break VMSS creation from Portal :).\"\n },\n \"type\":\"object\"\
,\n \"value\":{\n\n \"Linux\":{\n \"CentOS\":{\n \
\ \"publisher\":\"OpenLogic\",\n \"offer\":\"CentOS\",\n\
\ \"sku\":\"7.2\",\n \"version\":\"latest\"\n \
\ },\n \"CoreOS\":{\n \"publisher\":\"CoreOS\",\n \
\ \"offer\":\"CoreOS\",\n \"sku\":\"Stable\",\n \
\ \"version\":\"latest\"\n },\n \"Debian\":{\n \
\ \"publisher\":\"credativ\",\n \"offer\":\"Debian\",\n\
\ \"sku\":\"8\",\n \"version\":\"latest\"\n \
\ },\n \"openSUSE\":{\n \"publisher\":\"SUSE\",\n \
\ \"offer\":\"openSUSE\",\n \"sku\":\"13.2\",\n \
\ \"version\":\"latest\"\n },\n \"RHEL\":{\n \
\ \"publisher\":\"RedHat\",\n \"offer\":\"RHEL\",\n \
\ \"sku\":\"7.2\",\n \"version\":\"latest\"\n },\n\
\ \"SLES\":{\n \"publisher\":\"SUSE\",\n \"\
offer\":\"SLES\",\n \"sku\":\"12-SP1\",\n \"version\"\
:\"latest\"\n },\n \"UbuntuLTS\":{\n \"publisher\"\
:\"Canonical\",\n \"offer\":\"UbuntuServer\",\n \"sku\"\
:\"14.04.4-LTS\",\n \"version\":\"latest\"\n }\n \
\ },\n\n \"Windows\":{\n \"Win2012R2Datacenter\":{\n \
\ \"publisher\":\"MicrosoftWindowsServer\",\n \"offer\"\
:\"WindowsServer\",\n \"sku\":\"2012-R2-Datacenter\",\n \
\ \"version\":\"latest\"\n },\n \"Win2012Datacenter\"\
:{\n \"publisher\":\"MicrosoftWindowsServer\",\n \"\
offer\":\"WindowsServer\",\n \"sku\":\"2012-Datacenter\",\n \
\ \"version\":\"latest\"\n },\n \"Win2008R2SP1\"\
:{\n \"publisher\":\"MicrosoftWindowsServer\",\n \"\
offer\":\"WindowsServer\",\n \"sku\":\"2008-R2-SP1\",\n \
\ \"version\":\"latest\"\n }\n }\n }\n }\n }\n\
}\n"}
headers:
Accept-Ranges: [bytes]
Access-Control-Allow-Origin: ['*']
Cache-Control: [max-age=300]
Connection: [close]
Content-Length: ['2297']
Content-Security-Policy: [default-src 'none'; style-src 'unsafe-inline']
Content-Type: [text/plain; charset=utf-8]
Date: ['Tue, 03 May 2016 03:40:49 GMT']
ETag: ['"db78eb36618a060181b32ac2de91b1733f382e01"']
Expires: ['Tue, 03 May 2016 03:45:49 GMT']
Source-Age: ['0']
Strict-Transport-Security: [max-age=31536000]
Vary: ['Authorization,Accept-Encoding']
Via: [1.1 varnish]
X-Cache: [MISS]
X-Cache-Hits: ['0']
X-Content-Type-Options: [nosniff]
X-Fastly-Request-ID: [13192701239be1866c66d0f0c6155cadff9d7f9d]
X-Frame-Options: [deny]
X-GitHub-Request-Id: ['17EB2F14:6091:7F1D34B:57281DC1']
X-Served-By: [cache-sjc3122-SJC]
X-XSS-Protection: [1; mode=block]
status: {code: 200, message: OK}
version: 1

Просмотреть файл

@ -0,0 +1,363 @@
interactions:
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.0 requests/2.9.1 msrest/0.3.0 msrest_azure/0.3.0 computemanagementclient/2015-06-15
Azure-SDK-For-Python AZURECLI_0.0.32]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/publishers?api-version=2015-06-15
response:
body:
string: !!binary |
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcpl
VmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/Ir73iz8q
q2nWFtXyo0cfXeVNu24+Gn20zBY5/b2/ajL6q5jR73dfryfNtC5WaNvc3Znsnn+6/2B3e3dyvrO9
P5tl21k+vbc9nTzce7B3vvPw/sOduy/r6rKY5XVz94tiWldNdd6OT6rFat3md59rt81d6fXuy/Wk
LJo5WnO/v2S0GberrJ7d+/Q+ffLDx8/0fQOOD4qmKtf4Eh/+0NH0u78B02x3Z5m3V1X9Fh/+0DH1
u78J00nxi9YV/f3DR1J6vgm/6TQvS3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RPe16u8oRiWPvnhY2v6vgHH9SSv
p2W1/jlZCnad34TlksCTyfm5wFG7vh2G29OqXtGnP1doSv834dr83KBI3d6A2eWk+jnRTNzvTbjl
U4IEkOxX/FxgGWJwI755tqA/fw7QRMc3YVfMimZVLH9uCGk7vwWWP1j8nLhc9BJ3fSOGNTEF/f1z
gCD3fDN+7Torr6r6LT79ucDS9X8jrlj5+f2bqlyjBb75OcC3g8NNOC/adT35ueFQ7foGDH+yqhd5
W9Py7s8Bjq7z22LJbvXpu58TM9RH4tZY29/eIKRckX1YtqfLaX3NeNMbP4eDsb/FcbthjJftz42N
oG5vwOy7x0+3f/KL1695tujjHzqOIQI3Y7t3fDZ+WmQXy6ppi2kjr/3c4B1F5RYjOL0k5vn2etJ/
+edoHMMI3TAa8uGyNv85iWlM1zdjmF9V5fl23kzo058LNF3/N+LaTufn6xLA8R5983OAbweHm3DO
J02+bPLtbLXIinL1c4N0D4kbsL5akApf5uXPCbKm75twhLs3pynYpvzSfFmV1cXPSQoyiseNuF/9
IKM/fw6QRcc3YPcunxRZmU3w0Q8dQ9f5TVieF0tKkRbLnxOn0+v9JjwXK0qp/1ygyB3fhF39cxJY
otubMKMFiUU+y9qfE0Hxer8Bz+u8LKsrYgf66IeOpuv8Jiyrdb3dzKvVdrUskRX5uUC2i8MNOP+A
ZmDZFvjkh46r7ftGHJc/J2l17vcm3KpqwRz8c4Gf6fuXfP//AWl5lqpNaAEA
headers:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Type: [application/json; charset=utf-8]
Date: ['Tue, 03 May 2016 03:52:45 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0]
Strict-Transport-Security: [max-age=31536000; includeSubDomains]
Vary: [Accept-Encoding]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.0 requests/2.9.1 msrest/0.3.0 msrest_azure/0.3.0 computemanagementclient/2015-06-15
Azure-SDK-For-Python AZURECLI_0.0.32]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/publishers/Canonical/artifacttypes/vmimage/offers?api-version=2015-06-15
response:
body:
string: !!binary |
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcpl
VmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/Ir73Gydp
+ovxT5p+VFbTrC2q5UeP0o+u8qZdNx+N9Ktltsjx8VeT9bJd794f7+y/Xmar1bVtUczw/d3X60kz
rYsV4DR3dya755/uP9jd3p2c72zvz2bZdpZP721PJw/3Huyd7zy8/3Dn7su6uixmed3c/aKY1lVT
nbfjk2qxWrf53eeKUnNXELr7cj0pi2aO1ifZsloW06y8e1y3xXk2bd9cr/Lm7k9+cbbILvK7X56f
o1kfZWD8SxjvDxn502r6Nq9tu//vjF8RB95fkwp1VZbF8kLA2Tb/L6dAiDRw/pqjf53Xl0Q/8+X/
y4et2ALZrzne319I9vufVHVum/y/fNQBzkD5Gxj776+CY1r+f4gEBnVg/kt+4+T7/w+0FbQ39wUA
AA==
headers:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Type: [application/json; charset=utf-8]
Date: ['Tue, 03 May 2016 03:52:45 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0]
Strict-Transport-Security: [max-age=31536000; includeSubDomains]
Vary: [Accept-Encoding]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.0 requests/2.9.1 msrest/0.3.0 msrest_azure/0.3.0 computemanagementclient/2015-06-15
Azure-SDK-For-Python AZURECLI_0.0.32]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/publishers/Canonical/artifacttypes/vmimage/offers/Ubuntu_Snappy_Core/skus?api-version=2015-06-15
response:
body:
string: !!binary |
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcpl
VmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/Ir73Gydp
+ovxT5p+VFbTrC2q5UeP0o+u8qZdNx+N9Ktltsjx8e798c6+/bSY4bO7r9eTZloXK7zb3N2Z7J5/
uv9gd3t3cr6zvT+bZdtZPr23PZ083Huwd77z8P7Dnbsv6+qymOV1c/eLYlpXTXXejk+qxWrd5nef
KxrNXUHi7sv1pCyaOVqfZMtqWUyz8u5x3Rbn2bR9c73Km7s/+cXZIrvI7355fo5mX03Wy3b9+79e
ZqvV9e9/UtX53ddvCZKgD+x/CY/hPUb+qirLYnlhP///3NjNAID/L/mNk+//P29+Lmz7AQAA
headers:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Type: [application/json; charset=utf-8]
Date: ['Tue, 03 May 2016 03:52:45 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0]
Strict-Transport-Security: [max-age=31536000; includeSubDomains]
Vary: [Accept-Encoding]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.0 requests/2.9.1 msrest/0.3.0 msrest_azure/0.3.0 computemanagementclient/2015-06-15
Azure-SDK-For-Python AZURECLI_0.0.32]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/publishers/Canonical/artifacttypes/vmimage/offers/Ubuntu_Snappy_Core/skus/15.04/versions?api-version=2015-06-15
response:
body:
string: !!binary |
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcpl
VmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/Ir73Gydp
+ovxT5p+VFbTrC2q5UeP0o+u8qZdNx+N9Ktltsjx8d7O7v3xzsHew/HOp/fv2a+LGb68+3o9aaZ1
sQKQ5u7OZPf80/0Hu9u7k/Od7f3ZLNvO8um97enk4d6DvfOdh/cf7tx9WVeXxSyvm7tfFNO6aqrz
dnxSLVbrNr/7XPFp7go2d1+uJ2XRzNH6JFtWy2KalXeP67Y4z6btm+tV3tz9yS/OFtlFfvfL83M0
+2qyXrbr3//1Mlutrn//k6rO775+S5Awiv27P0lNGH5nWBjVL+GxvTdpHu7tj3cP7t+3X///gzR2
WBjV1yHNp+OdPcAAec3X/z8gjT8sjOprk+b+mP7//z/S6LAwqq9NmofjvR2CYb7+/wtpdFgY1dck
zb3dg/Hug/t79uv/f5DGDguj+hDSPNx/aL/+/xFpMCyM6pf8xsn3/x81FIciwAcAAA==
headers:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Type: [application/json; charset=utf-8]
Date: ['Tue, 03 May 2016 03:52:46 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0]
Strict-Transport-Security: [max-age=31536000; includeSubDomains]
Vary: [Accept-Encoding]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.0 requests/2.9.1 msrest/0.3.0 msrest_azure/0.3.0 computemanagementclient/2015-06-15
Azure-SDK-For-Python AZURECLI_0.0.32]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/publishers/Canonical/artifacttypes/vmimage/offers/Ubuntu_Snappy_Core/skus/Rolling/versions?api-version=2015-06-15
response:
body:
string: !!binary |
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcpl
VmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/Ir73/f8H
KbtMDQIAAAA=
headers:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Type: [application/json; charset=utf-8]
Date: ['Tue, 03 May 2016 03:52:46 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0]
Strict-Transport-Security: [max-age=31536000; includeSubDomains]
Vary: [Accept-Encoding]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.0 requests/2.9.1 msrest/0.3.0 msrest_azure/0.3.0 computemanagementclient/2015-06-15
Azure-SDK-For-Python AZURECLI_0.0.32]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/publishers/Canonical/artifacttypes/vmimage/offers/Ubuntu_Snappy_Core_Docker/skus?api-version=2015-06-15
response:
body:
string: !!binary |
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcpl
VmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/Ir73Gydp
+ovxT5p+VFbTrC2q5UeP0o+u8qZdNx+N9Ktltsjx8e798c6+/bSY4bO7r9eTZloXK7zb3N2Z7J5/
uv9gd3t3cr6zvT+bZdtZPr23PZ083Huwd77z8P7Dnbsv6+qymOV1c/eLYlpXTXXejk+qxWrd5nef
KxrNXUHi7sv1pCyaOVqfZMtqWUyz8u5x3Rbn2bR9c73Km7s/+cXZIrvI7355fo5mX03Wy3b9+79e
ZqvV9e9/UtX57/+0mr7N67uv3xJAGQUG8Ut+4+T7/w9aDaNvBAEAAA==
headers:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Type: [application/json; charset=utf-8]
Date: ['Tue, 03 May 2016 03:52:47 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0]
Strict-Transport-Security: [max-age=31536000; includeSubDomains]
Vary: [Accept-Encoding]
status: {code: 200, message: OK}
- request:
body: null
headers:
Accept: [application/json]
Accept-Encoding: ['gzip, deflate']
Connection: [keep-alive]
Content-Type: [application/json; charset=utf-8]
User-Agent: [python/3.5.0 requests/2.9.1 msrest/0.3.0 msrest_azure/0.3.0 computemanagementclient/2015-06-15
Azure-SDK-For-Python AZURECLI_0.0.32]
accept-language: [en-US]
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/westus/publishers/Canonical/artifacttypes/vmimage/offers/Ubuntu_Snappy_Core_Docker/skus/15.04/versions?api-version=2015-06-15
response:
body:
string: !!binary |
H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3mkuwdaUcjKasqgcpl
VmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZkAWz2zkrayZ4hgKrIHz9+fB8/Ir73Gydp
+ovxT5p+VFbTrC2q5UeP0o+u8qZdNx+N9Ktltsjx8d7O7v3xzoOdg/Huw90H9utihi/vvl5Pmmld
rACkubsz2T3/dP/B7vbu5Hxne382y7azfHpvezp5uPdg73zn4f2HO3df1tVlMcvr5u4XxbSumuq8
HZ9Ui9W6ze8+V3yau4LN3ZfrSVk0c7Q+yZbVsphm5d3jui3Os2n75nqVN3d/8ouzRXaR3/3y/BzN
vpqsl+3693+9zFar69//pKrz3/9pNX2b13dfvyWAGMz+3Z+kltxNZ3QY3C/hIb43hQ72DsZ79/Y/
tV///4pCdnQY3C/5jZPv/z+2HDgHRwIAAA==
headers:
Cache-Control: [no-cache]
Content-Encoding: [gzip]
Content-Type: [application/json; charset=utf-8]
Date: ['Tue, 03 May 2016 03:52:47 GMT']
Expires: ['-1']
Pragma: [no-cache]
Server: [Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0]
Strict-Transport-Security: [max-age=31536000; includeSubDomains]
Vary: [Accept-Encoding]
status: {code: 200, message: OK}
version: 1

Просмотреть файл

@ -1,8 +1,8 @@
import os.path
import os.path
import unittest
import mock
from azure.cli.command_modules.vm.custom import read_images_from_aliases_doc
from azure.cli.command_modules.vm.custom import _load_images_from_aliases_doc
class TestVMImage(unittest.TestCase):
@mock.patch('azure.cli.command_modules.vm.custom.urlopen', autospec=True)
@ -17,14 +17,14 @@ class TestVMImage(unittest.TestCase):
mock_urlopen.return_value = mock_read
#action
images = read_images_from_aliases_doc()
images = _load_images_from_aliases_doc(None, None, None)
#assert
self.assertEqual(images['Windows']['Win2012Datacenter']['publisher'],
'MicrosoftWindowsServer')
self.assertEqual(images['Linux']['UbuntuLTS']['publisher'], 'Canonical')
self.assertEqual(images['Linux']['UbuntuLTS']['urn'],
'Canonical:UbuntuServer:14.04.4-LTS:latest')
win_images = [i for i in images if i['publisher'] == 'MicrosoftWindowsServer']
self.assertTrue(len(win_images) > 0)
ubuntu_image = next(i for i in images if i['publisher'] == 'Canonical')
self.assertEqual(ubuntu_image['publisher'], 'Canonical')
self.assertEqual(ubuntu_image['offer'], 'UbuntuServer')
if __name__ == '__main__':
unittest.main()