Skip to content

Commit b2c8470

Browse files
rytruongRyan TruongMeet ShahRyangrizzlytheodore
authored
.NET SDK for DiskRP Swagger 2021-04-01 (#23612)
* .NET SDK for DiskRP Swagger * generated .NET sdk for diskrp swagger 2021-04-01 * Added accelnet test * Added test for CreationOption CopyStart * added recorded test * removed unwanted files * updated .net sdk after swagger is merged * added customization and fixed unit test failures * Update Disk.cs * removed default values * update custom * fix typo * update failing test Co-authored-by: Ryan Truong <rytruong@microsoft.com> Co-authored-by: Meet Shah <meeshah@microsoft.com> Co-authored-by: Ryan <luantruong210@gmail.com> Co-authored-by: Theodore Chang <thchan@microsoft.com>
1 parent d77f0da commit b2c8470

File tree

79 files changed

+24315
-20781
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+24315
-20781
lines changed

eng/mgmt/mgmtmetadata/compute_resource-manager.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ AutoRest installed successfully.
33
Commencing code generation
44
Generating CSharp code
55
Executing AutoRest command
6-
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/compute/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\Users\roip\dev\azure-sdk-for-net\sdk
6+
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/compute/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\work\azure-sdk-for-net\sdk
77
Autorest CSharp Version: 2.3.82
8-
2021-07-14 19:12:23 UTC
8+
2021-09-09 19:16:30 UTC
99
Azure-rest-api-specs repository information
1010
GitHub fork: Azure
1111
Branch: master
12-
Commit: f681d4785f2908967824f873f47de7f34519515d
12+
Commit: 92b58eb71fd5eb2ce5600e9233541074ecabf851
1313
AutoRest information
1414
Requested version: v2
1515
Bootstrapper version: autorest@2.0.4413
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
namespace Microsoft.Azure.Management.Compute.Models
2+
{
3+
using System.Collections.Generic;
4+
5+
/// <summary>
6+
/// Disk resource.
7+
/// </summary>
8+
public partial class Disk : Resource
9+
{
10+
/// <summary>
11+
/// Initializes a new instance of the Disk class.
12+
/// </summary>
13+
/// <param name="location">Resource location</param>
14+
/// <param name="creationData">Disk source information. CreationData
15+
/// information cannot be changed after the disk has been
16+
/// created.</param>
17+
/// <param name="id">Resource Id</param>
18+
/// <param name="name">Resource name</param>
19+
/// <param name="type">Resource type</param>
20+
/// <param name="tags">Resource tags</param>
21+
/// <param name="managedBy">A relative URI containing the ID of the VM
22+
/// that has the disk attached.</param>
23+
/// <param name="managedByExtended">List of relative URIs containing
24+
/// the IDs of the VMs that have the disk attached. maxShares should be
25+
/// set to a value greater than one for disks to allow attaching them
26+
/// to multiple VMs.</param>
27+
/// <param name="zones">The Logical zone list for Disk.</param>
28+
/// <param name="extendedLocation">The extended location where the disk
29+
/// will be created. Extended location cannot be changed.</param>
30+
/// <param name="timeCreated">The time when the disk was
31+
/// created.</param>
32+
/// <param name="osType">The Operating System type. Possible values
33+
/// include: 'Windows', 'Linux'</param>
34+
/// <param name="hyperVGeneration">The hypervisor generation of the
35+
/// Virtual Machine. Applicable to OS disks only. Possible values
36+
/// include: 'V1', 'V2'</param>
37+
/// <param name="purchasePlan">Purchase plan information for the the
38+
/// image from which the OS disk was created. E.g. - {name:
39+
/// 2019-Datacenter, publisher: MicrosoftWindowsServer, product:
40+
/// WindowsServer}</param>
41+
/// <param name="diskSizeGB">If creationData.createOption is Empty,
42+
/// this field is mandatory and it indicates the size of the disk to
43+
/// create. If this field is present for updates or creation with other
44+
/// options, it indicates a resize. Resizes are only allowed if the
45+
/// disk is not attached to a running VM, and can only increase the
46+
/// disk's size.</param>
47+
/// <param name="diskSizeBytes">The size of the disk in bytes. This
48+
/// field is read only.</param>
49+
/// <param name="uniqueId">Unique Guid identifying the
50+
/// resource.</param>
51+
/// <param name="encryptionSettingsCollection">Encryption settings
52+
/// collection used for Azure Disk Encryption, can contain multiple
53+
/// encryption settings per disk or snapshot.</param>
54+
/// <param name="provisioningState">The disk provisioning
55+
/// state.</param>
56+
/// <param name="diskIOPSReadWrite">The number of IOPS allowed for this
57+
/// disk; only settable for UltraSSD disks. One operation can transfer
58+
/// between 4k and 256k bytes.</param>
59+
/// <param name="diskMBpsReadWrite">The bandwidth allowed for this
60+
/// disk; only settable for UltraSSD disks. MBps means millions of
61+
/// bytes per second - MB here uses the ISO notation, of powers of
62+
/// 10.</param>
63+
/// <param name="diskIOPSReadOnly">The total number of IOPS that will
64+
/// be allowed across all VMs mounting the shared disk as ReadOnly. One
65+
/// operation can transfer between 4k and 256k bytes.</param>
66+
/// <param name="diskMBpsReadOnly">The total throughput (MBps) that
67+
/// will be allowed across all VMs mounting the shared disk as
68+
/// ReadOnly. MBps means millions of bytes per second - MB here uses
69+
/// the ISO notation, of powers of 10.</param>
70+
/// <param name="diskState">The state of the disk. Possible values
71+
/// include: 'Unattached', 'Attached', 'Reserved', 'Frozen',
72+
/// 'ActiveSAS', 'ActiveSASFrozen', 'ReadyToUpload',
73+
/// 'ActiveUpload'</param>
74+
/// <param name="encryption">Encryption property can be used to encrypt
75+
/// data at rest with customer managed keys or platform managed
76+
/// keys.</param>
77+
/// <param name="maxShares">The maximum number of VMs that can attach
78+
/// to the disk at the same time. Value greater than one indicates a
79+
/// disk that can be mounted on multiple VMs at the same time.</param>
80+
/// <param name="shareInfo">Details of the list of all VMs that have
81+
/// the disk attached. maxShares should be set to a value greater than
82+
/// one for disks to allow attaching them to multiple VMs.</param>
83+
/// <param name="networkAccessPolicy">Possible values include:
84+
/// 'AllowAll', 'AllowPrivate', 'DenyAll'</param>
85+
/// <param name="diskAccessId">ARM id of the DiskAccess resource for
86+
/// using private endpoints on disks.</param>
87+
/// <param name="tier">Performance tier of the disk (e.g, P4, S10) as
88+
/// described here:
89+
/// https://azure.microsoft.com/en-us/pricing/details/managed-disks/.
90+
/// Does not apply to Ultra disks.</param>
91+
/// <param name="burstingEnabled">Set to true to enable bursting beyond
92+
/// the provisioned performance target of the disk. Bursting is
93+
/// disabled by default. Does not apply to Ultra disks.</param>
94+
/// <param name="propertyUpdatesInProgress">Properties of the disk for
95+
/// which update is pending.</param>
96+
/// <param name="supportsHibernation">Indicates the OS on a disk
97+
/// supports hibernation.</param>
98+
/// <param name="securityProfile">Contains the security related
99+
/// information for the resource.</param>
100+
/// <param name="supportedCapabilities">List of supported capabilities
101+
/// for the image from which the OS disk was created.</param>
102+
/// <param name="completionPercent">Percentage complete for the
103+
/// background copy when a resource is created via the CopyStart
104+
/// operation.</param>
105+
/// <param name="publicNetworkAccess">Possible values include:
106+
/// 'Enabled', 'Disabled'</param>
107+
public Disk(string location, CreationData creationData, string id, string name, string type, IDictionary<string, string> tags, string managedBy, IList<string> managedByExtended, DiskSku sku, IList<string> zones, ExtendedLocation extendedLocation, System.DateTime? timeCreated, OperatingSystemTypes? osType, string hyperVGeneration, PurchasePlan purchasePlan, int? diskSizeGB, long? diskSizeBytes = default(long?), string uniqueId = default(string), EncryptionSettingsCollection encryptionSettingsCollection = default(EncryptionSettingsCollection), string provisioningState = default(string), long? diskIOPSReadWrite = default(long?), long? diskMBpsReadWrite = default(long?), long? diskIOPSReadOnly = default(long?), long? diskMBpsReadOnly = default(long?), string diskState = default(string), Encryption encryption = default(Encryption), int? maxShares = default(int?), IList<ShareInfoElement> shareInfo = default(IList<ShareInfoElement>), string networkAccessPolicy = default(string), string diskAccessId = default(string), string tier = default(string), bool? burstingEnabled = default(bool?), PropertyUpdatesInProgress propertyUpdatesInProgress = default(PropertyUpdatesInProgress), bool? supportsHibernation = default(bool?), DiskSecurityProfile securityProfile = default(DiskSecurityProfile))
108+
: base(location, id, name, type, tags)
109+
{
110+
ManagedBy = managedBy;
111+
ManagedByExtended = managedByExtended;
112+
Sku = sku;
113+
Zones = zones;
114+
ExtendedLocation = extendedLocation;
115+
TimeCreated = timeCreated;
116+
OsType = osType;
117+
HyperVGeneration = hyperVGeneration;
118+
PurchasePlan = purchasePlan;
119+
CreationData = creationData;
120+
DiskSizeGB = diskSizeGB;
121+
DiskSizeBytes = diskSizeBytes;
122+
UniqueId = uniqueId;
123+
EncryptionSettingsCollection = encryptionSettingsCollection;
124+
ProvisioningState = provisioningState;
125+
DiskIOPSReadWrite = diskIOPSReadWrite;
126+
DiskMBpsReadWrite = diskMBpsReadWrite;
127+
DiskIOPSReadOnly = diskIOPSReadOnly;
128+
DiskMBpsReadOnly = diskMBpsReadOnly;
129+
DiskState = diskState;
130+
Encryption = encryption;
131+
MaxShares = maxShares;
132+
ShareInfo = shareInfo;
133+
NetworkAccessPolicy = networkAccessPolicy;
134+
DiskAccessId = diskAccessId;
135+
Tier = tier;
136+
BurstingEnabled = burstingEnabled;
137+
PropertyUpdatesInProgress = propertyUpdatesInProgress;
138+
SupportsHibernation = supportsHibernation;
139+
SecurityProfile = securityProfile;
140+
CustomInit();
141+
}
142+
}
143+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
namespace Microsoft.Azure.Management.Compute.Models
2+
{
3+
/// <summary>
4+
/// Properties of disk restore point
5+
/// </summary>
6+
public partial class DiskRestorePoint : ProxyOnlyResource
7+
{
8+
/// <summary>
9+
/// Initializes a new instance of the DiskRestorePoint class.
10+
/// </summary>
11+
/// <param name="id">Resource Id</param>
12+
/// <param name="name">Resource name</param>
13+
/// <param name="type">Resource type</param>
14+
/// <param name="timeCreated">The timestamp of restorePoint
15+
/// creation</param>
16+
/// <param name="sourceResourceId">arm id of source disk</param>
17+
/// <param name="osType">The Operating System type. Possible values
18+
/// include: 'Windows', 'Linux'</param>
19+
/// <param name="hyperVGeneration">The hypervisor generation of the
20+
/// Virtual Machine. Applicable to OS disks only. Possible values
21+
/// include: 'V1', 'V2'</param>
22+
/// <param name="purchasePlan">Purchase plan information for the the
23+
/// image from which the OS disk was created.</param>
24+
/// was created.</param>
25+
/// <param name="familyId">id of the backing snapshot's MIS
26+
/// family</param>
27+
/// <param name="sourceUniqueId">unique incarnation id of the source
28+
/// disk</param>
29+
/// <param name="encryption">Encryption property can be used to encrypt
30+
/// data at rest with customer managed keys or platform managed
31+
/// keys.</param>
32+
/// <param name="supportsHibernation">Indicates the OS on a disk
33+
/// supports hibernation.</param>
34+
/// <param name="networkAccessPolicy">Possible values include:
35+
/// 'AllowAll', 'AllowPrivate', 'DenyAll'</param>
36+
/// <param name="publicNetworkAccess">Possible values include:
37+
/// 'Enabled', 'Disabled'</param>
38+
/// <param name="diskAccessId">ARM id of the DiskAccess resource for
39+
/// using private endpoints on disks.</param>
40+
/// <param name="completionPercent">Percentage complete for the
41+
/// background copy when a resource is created via the CopyStart
42+
/// operation.</param>
43+
/// <param name="supportedCapabilities">List of supported capabilities
44+
/// (like accelerated networking) for the image from which the OS disk
45+
public DiskRestorePoint(string id, string name, string type, System.DateTime? timeCreated, string sourceResourceId, OperatingSystemTypes? osType, string hyperVGeneration, PurchasePlan purchasePlan, string familyId, string sourceUniqueId = default(string), Encryption encryption = default(Encryption), bool? supportsHibernation = default(bool?))
46+
: base(id, name, type)
47+
{
48+
TimeCreated = timeCreated;
49+
SourceResourceId = sourceResourceId;
50+
OsType = osType;
51+
HyperVGeneration = hyperVGeneration;
52+
PurchasePlan = purchasePlan;
53+
FamilyId = familyId;
54+
SourceUniqueId = sourceUniqueId;
55+
Encryption = encryption;
56+
SupportsHibernation = supportsHibernation;
57+
CustomInit();
58+
}
59+
60+
}
61+
}

sdk/compute/Microsoft.Azure.Management.Compute/src/Customizations/DiskUpdate.cs

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
namespace Microsoft.Azure.Management.Compute.Models
22
{
3-
using Microsoft.Rest;
4-
using Microsoft.Rest.Serialization;
5-
using Newtonsoft.Json;
6-
using System.Collections;
73
using System.Collections.Generic;
8-
using System.Linq;
94

105
/// <summary>
116
/// Disk update resource.
@@ -58,7 +53,6 @@ public partial class DiskUpdate
5853
/// the provisioned performance target of the disk. Bursting is
5954
/// disabled by default. Does not apply to Ultra disks.</param>
6055
/// <param name="purchasePlan">Purchase plan information to be added on
61-
/// the OS disk</param>
6256
public DiskUpdate(OperatingSystemTypes? osType, int? diskSizeGB, EncryptionSettingsCollection encryptionSettingsCollection, long? diskIOPSReadWrite, long? diskMBpsReadWrite, long? diskIOPSReadOnly, long? diskMBpsReadOnly, int? maxShares, Encryption encryption, string networkAccessPolicy, string diskAccessId, string tier, bool? burstingEnabled, PurchasePlan purchasePlan)
6357
{
6458
OsType = osType;
@@ -118,5 +112,28 @@ public DiskUpdate(OperatingSystemTypes? osType, int? diskSizeGB, EncryptionSetti
118112
Sku = sku;
119113
CustomInit();
120114
}
115+
116+
public DiskUpdate(OperatingSystemTypes? osType, int? diskSizeGB, EncryptionSettingsCollection encryptionSettingsCollection, long? diskIOPSReadWrite, long? diskMBpsReadWrite, long? diskIOPSReadOnly, long? diskMBpsReadOnly, int? maxShares, Encryption encryption, string networkAccessPolicy, string diskAccessId, string tier, bool? burstingEnabled, PurchasePlan purchasePlan, PropertyUpdatesInProgress propertyUpdatesInProgress, bool? supportsHibernation = default(bool?), IDictionary<string, string> tags = default(IDictionary<string, string>), DiskSku sku = default(DiskSku))
117+
{
118+
OsType = osType;
119+
DiskSizeGB = diskSizeGB;
120+
EncryptionSettingsCollection = encryptionSettingsCollection;
121+
DiskIOPSReadWrite = diskIOPSReadWrite;
122+
DiskMBpsReadWrite = diskMBpsReadWrite;
123+
DiskIOPSReadOnly = diskIOPSReadOnly;
124+
DiskMBpsReadOnly = diskMBpsReadOnly;
125+
MaxShares = maxShares;
126+
Encryption = encryption;
127+
NetworkAccessPolicy = networkAccessPolicy;
128+
DiskAccessId = diskAccessId;
129+
Tier = tier;
130+
BurstingEnabled = burstingEnabled;
131+
PurchasePlan = purchasePlan;
132+
PropertyUpdatesInProgress = propertyUpdatesInProgress;
133+
SupportsHibernation = supportsHibernation;
134+
Tags = tags;
135+
Sku = sku;
136+
CustomInit();
137+
}
121138
}
122139
}

0 commit comments

Comments
 (0)