|
| 1 | +// |
| 2 | +// Copyright (c) Microsoft and contributors. All rights reserved. |
| 3 | +// |
| 4 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +// you may not use this file except in compliance with the License. |
| 6 | +// You may obtain a copy of the License at |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// |
| 13 | +// See the License for the specific language governing permissions and |
| 14 | +// limitations under the License. |
| 15 | +// |
| 16 | + |
| 17 | +// Warning: This code was generated by a tool. |
| 18 | +// |
| 19 | +// Changes to this file may cause incorrect behavior and will be lost if the |
| 20 | +// code is regenerated. |
| 21 | + |
| 22 | +using Microsoft.Azure.Management.Compute.Models; |
| 23 | +using Newtonsoft.Json; |
| 24 | +using System.Collections.Generic; |
| 25 | +using System.Text.RegularExpressions; |
| 26 | + |
| 27 | +namespace Microsoft.Azure.Commands.Compute.Models |
| 28 | +{ |
| 29 | + public class PSVirtualMachine : PSOperation |
| 30 | + { |
| 31 | + // Gets or sets the property of 'ResourceGroupName' |
| 32 | + public string ResourceGroupName |
| 33 | + { |
| 34 | + get |
| 35 | + { |
| 36 | + if (string.IsNullOrEmpty(Id)) return null; |
| 37 | + Regex r = new Regex(@"(.*?)/resourcegroups/(?<rgname>\S+)/providers/(.*?)", RegexOptions.IgnoreCase); |
| 38 | + Match m = r.Match(Id); |
| 39 | + return m.Success ? m.Groups["rgname"].Value : null; |
| 40 | + } |
| 41 | + } |
| 42 | + |
| 43 | + // Gets or sets the property of 'Id' |
| 44 | + public string Id { get; set; } |
| 45 | + |
| 46 | + // Gets or sets the property of 'Name' |
| 47 | + public string Name { get; set; } |
| 48 | + |
| 49 | + // Gets or sets the property of 'Type' |
| 50 | + public string Type { get; set; } |
| 51 | + |
| 52 | + // Gets or sets the property of 'Location' |
| 53 | + public string Location { get; set; } |
| 54 | + |
| 55 | + // Gets or sets the property of 'Tags' |
| 56 | + public IDictionary<string, string> Tags { get; set; } |
| 57 | + |
| 58 | + [JsonIgnore] |
| 59 | + public string TagsText |
| 60 | + { |
| 61 | + get { return JsonConvert.SerializeObject(Tags, Formatting.Indented); } |
| 62 | + } |
| 63 | + |
| 64 | + // Gets or sets the reference Id of the availailbity set to which this virtual machine belongs. |
| 65 | + public SubResource AvailabilitySetReference { get; set; } |
| 66 | + |
| 67 | + [JsonIgnore] |
| 68 | + public string AvailabilitySetReferenceText |
| 69 | + { |
| 70 | + get { return JsonConvert.SerializeObject(AvailabilitySetReference, Formatting.Indented); } |
| 71 | + } |
| 72 | + |
| 73 | + // Gets or sets the diagnostics profile. |
| 74 | + public DiagnosticsProfile DiagnosticsProfile { get; set; } |
| 75 | + |
| 76 | + [JsonIgnore] |
| 77 | + public string DiagnosticsProfileText |
| 78 | + { |
| 79 | + get { return JsonConvert.SerializeObject(DiagnosticsProfile, Formatting.Indented); } |
| 80 | + } |
| 81 | + |
| 82 | + // Gets the virtual machine child extension resources. |
| 83 | + public IList<VirtualMachineExtension> Extensions { get; set; } |
| 84 | + |
| 85 | + [JsonIgnore] |
| 86 | + public string ExtensionsText |
| 87 | + { |
| 88 | + get { return JsonConvert.SerializeObject(Extensions, Formatting.Indented); } |
| 89 | + } |
| 90 | + |
| 91 | + // Gets or sets the hardware profile. |
| 92 | + public HardwareProfile HardwareProfile { get; set; } |
| 93 | + |
| 94 | + [JsonIgnore] |
| 95 | + public string HardwareProfileText |
| 96 | + { |
| 97 | + get { return JsonConvert.SerializeObject(HardwareProfile, Formatting.Indented); } |
| 98 | + } |
| 99 | + |
| 100 | + // Gets the virtual machine instance view. |
| 101 | + public VirtualMachineInstanceView InstanceView { get; set; } |
| 102 | + |
| 103 | + [JsonIgnore] |
| 104 | + public string InstanceViewText |
| 105 | + { |
| 106 | + get { return JsonConvert.SerializeObject(InstanceView, Formatting.Indented); } |
| 107 | + } |
| 108 | + |
| 109 | + // Gets or sets the network profile. |
| 110 | + public NetworkProfile NetworkProfile { get; set; } |
| 111 | + |
| 112 | + [JsonIgnore] |
| 113 | + public string NetworkProfileText |
| 114 | + { |
| 115 | + get { return JsonConvert.SerializeObject(NetworkProfile, Formatting.Indented); } |
| 116 | + } |
| 117 | + |
| 118 | + // Gets or sets the OS profile. |
| 119 | + public OSProfile OSProfile { get; set; } |
| 120 | + |
| 121 | + [JsonIgnore] |
| 122 | + public string OSProfileText |
| 123 | + { |
| 124 | + get { return JsonConvert.SerializeObject(OSProfile, Formatting.Indented); } |
| 125 | + } |
| 126 | + |
| 127 | + // Gets or sets the purchase plan when deploying virtual machine from VM Marketplace images. |
| 128 | + public Plan Plan { get; set; } |
| 129 | + |
| 130 | + [JsonIgnore] |
| 131 | + public string PlanText |
| 132 | + { |
| 133 | + get { return JsonConvert.SerializeObject(Plan, Formatting.Indented); } |
| 134 | + } |
| 135 | + |
| 136 | + // Gets or sets the provisioning state, which only appears in the response. |
| 137 | + public string ProvisioningState { get; set; } |
| 138 | + |
| 139 | + // Gets or sets the storage profile. |
| 140 | + public StorageProfile StorageProfile { get; set; } |
| 141 | + |
| 142 | + [JsonIgnore] |
| 143 | + public string StorageProfileText |
| 144 | + { |
| 145 | + get { return JsonConvert.SerializeObject(StorageProfile, Formatting.Indented); } |
| 146 | + } |
| 147 | + |
| 148 | + [JsonIgnore] |
| 149 | + public string[] DataDiskNames |
| 150 | + { |
| 151 | + get |
| 152 | + { |
| 153 | + if (this.StorageProfile == null) return null; |
| 154 | + var listStr = new List<string>(); |
| 155 | + foreach (var item in StorageProfile.DataDisks) |
| 156 | + { |
| 157 | + listStr.Add(item.Name); |
| 158 | + } |
| 159 | + return listStr.ToArray(); |
| 160 | + } |
| 161 | + } |
| 162 | + |
| 163 | + [JsonIgnore] |
| 164 | + public string[] NetworkInterfaceIDs |
| 165 | + { |
| 166 | + get |
| 167 | + { |
| 168 | + if (this.NetworkProfile == null) return null; |
| 169 | + var listStr = new List<string>(); |
| 170 | + foreach (var item in NetworkProfile.NetworkInterfaces) |
| 171 | + { |
| 172 | + listStr.Add(item.Id); |
| 173 | + } |
| 174 | + return listStr.ToArray(); |
| 175 | + } |
| 176 | + } |
| 177 | + } |
| 178 | +} |
0 commit comments