AzureInstancePlan

This parser reads the output of a command curl -s -H Metadata:true http://169.254.169.254/metadata/instance/compute/plan?api-version=2018-10-01&format=json, which is used to check whether the instance is a marketplace image.

For more details, See: https://docs.microsoft.com/en-us/rest/api/compute/virtualmachines/createorupdate#plan

class insights.parsers.azure_instance_plan.AzureInstancePlan(*args, **kwargs)[source]

Bases: CommandParser

Warning

This parser is deprecated, please use insights.parsers.azure_instance.AzureInstancePlan instead.

Class for parsing the Azure Instance Plan returned by command curl -s -H Metadata:true http://169.254.169.254/metadata/instance/compute/plan?api-version=2018-10-01&format=json,

Typical Output of this command is:

{
    "name": "planName",
    "product": "planProduct",
    "publisher": "planPublisher"
},
Raises:

SkipComponent -- When content is empty or no parse-able content.

name

The name of the plan for the VM Instance in Azure, e.g: rhel7

Type:

str

product

The product of the plan for the VM Instance in Azure, e.g: RHEL

Type:

str

publisher

The publisher of the plan for the VM Instance in Azure, e.g: Red hat

Type:

str

raw

The full JSON of the plan returned by the curl command

Type:

str

Examples

>>> azure_plan.name == 'planName'
True
>>> azure_plan.product == 'planProduct'
True
>>> azure_plan.publisher == 'planPublisher'
True
parse_content(content)[source]

This method must be implemented by classes based on this class.