AzureInstanceType¶
This parser simply reads the output of command
curl -s -H Metadata:true http://169.254.169.254/metadata/instance/compute/vmSize?api-version=2018-10-01&format=text
,
which is used to check the type of the Azure instance of the host.
For more details, See: https://docs.microsoft.com/en-us/azure/virtual-machines/linux/sizes
-
class
insights.parsers.azure_instance_type.
AzureInstanceType
(context, extra_bad_lines=[])[source]¶ Bases:
insights.core.CommandParser
Class for parsing the Azure Instance type returned by command
curl -s -H Metadata:true http://169.254.169.254/metadata/instance/compute/vmSize?api-version=2018-10-01&format=text
,Typical output of this command is:
Standard_L64s_v2
- Raises
SkipException -- When content is empty or no parse-able content.
ParseException -- When type cannot be recognized.
-
type
¶ The type of VM instance in Azure, e.g: Standard
- Type
str
-
size
¶ The size of VM instance in Azure, e.g: L64s, NC12s
- Type
str
-
version
¶ The version of VM instance in Azure, e.g: v2, v3, None for non-version
- Type
str
-
raw
¶ The fully type string returned by the
curl
command- Type
str
Examples
>>> azure_inst.type 'Standard' >>> azure_inst.size 'L64s' >>> azure_inst.version 'v2' >>> azure_inst.raw 'Standard_L64s_v2'