sauryadas / Azure-CLI-VMSS

Azure CLI VM Scale Sets (VMSS) Samples
1 stars 1 forks source link

Azure vmss get to be renamed to azure vmss show and the results formatted in a table #27

Closed sauryadas closed 8 years ago

sauryadas commented 8 years ago

@huangpf - Per user feedback they expect the create, list, show, delete commands like we have for vm, storage, networking commands.

Our users use the tabulated results with grep (they have used this consistently in vm get/show and it would break them not to have the same functionality for vmss get/show)

huangpf commented 8 years ago

Fixed the tabular part:

azure vmssvm get  xxxxxxxxxxxx       vmss281 0
info:    Executing command vmssvm get
data:
data:     Id                              /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxx/providers/Microsoft.Compute/virtualMachineScaleSets/vmss281/virtualMachines/0
data:     Name                            vmss281_0
data:     Type                            Microsoft.Compute/virtualMachineScaleSets/virtualMachines
data:     Location                        southeastasia
data:     Tags
data:       RG                            rg
data:       TestTag                       1
data:     InstanceId                      0
data:     Sku
data:       Name                          Standard_A0
data:       Tier                          Standard
data:     Resources
data:       #0
data:         Id                          /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxx/providers/Microsoft.Compute/virtualMachines/vmss281_0/extensions/vmssext01
data:         Name                        vmssext01
data:         Type                        Microsoft.Compute/virtualMachines/extensions
data:         Location                    southeastasia
data:         Publisher                   Microsoft.Compute
data:         VirtualMachineExtensionType VMAccessAgent
data:         TypeHandlerVersion          2.0
data:         AutoUpgradeMinorVersion     true
data:         Settings                    {}
data:         ProvisioningState           Succeeded
data:     LatestModelApplied              true
data:     StorageProfile
data:       ImageReference
data:         Publisher                   MicrosoftWindowsServer
data:         Offer                       WindowsServer
data:         Sku                         2012-R2-Datacenter
data:         Version                     4.0.20151120
data:       OsDisk
data:         OsType                      Windows
data:         Name                        test-os-0-50db5d67cab1438483022fc27d0fe274
data:         Vhd
data:           Uri                       https://xxxxxxxxxxxxxx.blob.core.windows.net/xxxxxxxxxxxxx/test-os-0-50db5d67cab1438483022fc27d0fe274.vh
d
data:         Caching                     None
data:         CreateOption                FromImage
data:     OsProfile
data:       ComputerName                  test-0
data:       AdminUsername                 Foo12
data:       CustomData                    Q3VzdG9tIGRhdGE=
data:       WindowsConfiguration
data:         ProvisionVMAgent            true
data:         EnableAutomaticUpdates      true
data:       Secrets
data:     NetworkProfile
data:       NetworkInterfaces
data:         #0
data:           Id                        /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxx/providers/Microsoft.Compute/virtualMachineScaleSets/vmss281/virtualMachines/0/networkInterfaces/vmsstestnetconfig7423
data:     ProvisioningState               Succeeded
info:    vmssvm get command OK

JSON output:

azure vmssvm get  xxxxxxxxxxxx       vmss281 0 --json
{
  "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxx/providers/Microsoft.Compute/virtualMachineScaleSets/vmss281/virtualMachines/0",
  "name": "vmss281_0",
  "type": "Microsoft.Compute/virtualMachineScaleSets/virtualMachines",
  "location": "southeastasia",
  "tags": {
    "RG": "rg",
    "testTag": "1"
  },
  "instanceId": "0",
  "sku": {
    "name": "Standard_A0",
    "tier": "Standard"
  },
  "resources": [
    {
      "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxx/providers/Microsoft.Compute/virtualMachines/vmss281_0/extensions/vmssext01",
      "name": "vmssext01",
      "type": "Microsoft.Compute/virtualMachines/extensions",
      "location": "southeastasia",
      "publisher": "Microsoft.Compute",
      "virtualMachineExtensionType": "VMAccessAgent",
      "typeHandlerVersion": "2.0",
      "autoUpgradeMinorVersion": true,
      "settings": "{}",
      "provisioningState": "Succeeded"
    }
  ],
  "latestModelApplied": true,
  "storageProfile": {
    "imageReference": {
      "publisher": "MicrosoftWindowsServer",
      "offer": "WindowsServer",
      "sku": "2012-R2-Datacenter",
      "version": "4.0.20151120"
    },
    "osDisk": {
      "osType": "Windows",
      "name": "test-os-0-50db5d67cab1438483022fc27d0fe274",
      "vhd": {
        "uri": "https://xxxxxxxxxxxxxx.blob.core.windows.net/xxxxxxxxxxxxx/test-os-0-50db5d67cab1438483022fc27d0fe274.vhd"
      },
      "caching": "None",
      "createOption": "FromImage"
    }
  },
  "osProfile": {
    "computerName": "test-0",
    "adminUsername": "Foo12",
    "customData": "Q3VzdG9tIGRhdGE=",
    "windowsConfiguration": {
      "provisionVMAgent": true,
      "enableAutomaticUpdates": true
    },
    "secrets": []
  },
  "networkProfile": {
    "networkInterfaces": [
      {
        "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/xxxxxxxxxxxx/providers/Microsoft.Compute/virtualMachineScaleSets/vmss281/virtualMachines/0/networkInterfaces/vmsstestnetconfig7423"
      }
    ]
  },
  "provisioningState": "Succeeded"
}
sauryadas commented 8 years ago

@huangpf this is so awesome!.. let me know when you check in.. i just checked .. does not like it has made it in..

huangpf commented 8 years ago

Please check it now. I push it to AzureRT.

sauryadas commented 8 years ago

Works!

screen shot 2016-03-11 at 10 24 26 am