public static AzureOperationResponse <VirtualMachine> GetWithInstanceView(this IVirtualMachinesOperations iVmExtensionOperations,
                                                                                  string rgName, string vmName)
        {
            const InstanceViewTypes expand = InstanceViewTypes.InstanceView;
            var result = iVmExtensionOperations.GetWithHttpMessagesAsync(rgName, vmName, expand).GetAwaiter().GetResult();

            return(result);
        }
예제 #2
0
 internal static string ToSerializedValue(this InstanceViewTypes value)
 {
     switch (value)
     {
     case InstanceViewTypes.InstanceView:
         return("instanceView");
     }
     return(null);
 }
        static void Main(string[] args)
        {
            var token      = GetTokenCloudCredentials();
            var credential = new TokenCredentials(token);
            var computeManagementClient = new ComputeManagementClient(credential);

            computeManagementClient.SubscriptionId = subscriptionID;
            InstanceViewTypes expand = new InstanceViewTypes();
            var vm = computeManagementClient.VirtualMachines.Get("<the resource group name>", "<the VM>", expand);

            System.Console.WriteLine(vm.InstanceView.Statuses[1].Code);
            System.Console.WriteLine("Press ENTER to continue");
            System.Console.ReadLine();
        }
예제 #4
0
 /// <summary>
 /// Converts the <see cref="sourceValue" /> parameter to the <see cref="destinationType" /> parameter using <see cref="formatProvider"
 /// /> and <see cref="ignoreCase" />
 /// </summary>
 /// <param name="sourceValue">the <see cref="System.Object"/> to convert from</param>
 /// <param name="destinationType">the <see cref="System.Type" /> to convert to</param>
 /// <param name="formatProvider">not used by this TypeConverter.</param>
 /// <param name="ignoreCase">when set to <c>true</c>, will ignore the case when converting.</param>
 /// <returns>
 /// an instance of <see cref="InstanceViewTypes" />, or <c>null</c> if there is no suitable conversion.
 /// </returns>
 public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => InstanceViewTypes.CreateFrom(sourceValue);
예제 #5
0
 public static string ToSerialString(this InstanceViewTypes value) => value switch
 {