-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Expand file tree
/
Copy pathDisk.tsp
More file actions
148 lines (132 loc) · 4.62 KB
/
Copy pathDisk.tsp
File metadata and controls
148 lines (132 loc) · 4.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";
using TypeSpec.Rest;
using Azure.ResourceManager;
using TypeSpec.Http;
using TypeSpec.OpenAPI;
using Common;
namespace ComputeDisk;
/**
* Disk resource.
*/
model Disk is Azure.ResourceManager.TrackedResource<DiskProperties> {
...ResourceNameParameter<
Resource = Disk,
KeyName = "diskName",
SegmentName = "disks",
NamePattern = "^[^_\\W][\\w-._]{0,79}(?<![-.])$"
>;
/**
* A relative URI containing the ID of the VM that has the disk attached.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property"
@visibility(Lifecycle.Read)
managedBy?: string;
/**
* List of relative URIs containing the IDs of the VMs that have the disk attached. maxShares should be set to a value greater than one for disks to allow attaching them to multiple VMs.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property"
@visibility(Lifecycle.Read)
managedByExtended?: string[];
/**
* The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, UltraSSD_LRS, Premium_ZRS, StandardSSD_ZRS, or PremiumV2_LRS.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property"
sku?: DiskSku;
/**
* The Logical zone list for Disk.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property"
zones?: string[];
/**
* The extended location where the disk will be created. Extended location cannot be changed.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property"
extendedLocation?: ExtendedLocation;
}
@armResourceOperations
interface Disks {
/**
* Gets information about a disk.
*/
get is ComputeResourceRead<Disk>;
/**
* Creates or updates a disk.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "For backward compatibility"
#suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "For backward compatibility"
createOrUpdate is ComputeResourceCreateOrReplaceAsync<
Disk,
Response =
| ArmResourceUpdatedResponse<Disk>
| (ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = Disk> &
Azure.Core.Foundations.RetryAfterHeader> & {
@bodyRoot _: Disk;
})
>;
/**
* Updates (patches) a disk.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "For backward compatibility"
@patch(#{ implicitOptionality: false })
update is ComputeCustomPatchAsync<
Disk,
DiskUpdate,
Response =
| ArmResponse<Disk>
| (ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = Disk> &
Azure.Core.Foundations.RetryAfterHeader> & {
@bodyRoot _: Disk;
})
>;
/**
* Deletes a disk.
*/
#suppress "deprecated" "For backward compatibility"
#suppress "@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes" "For backward compatibility"
#suppress "@azure-tools/typespec-azure-core/no-response-body" "For backward compatibility"
delete is ComputeResourceDeleteAsync<Disk>;
/**
* Lists all the disks under a resource group.
*/
listByResourceGroup is ComputeResourceListByParent<Disk, Response = DiskList>;
/**
* Lists all the disks under a subscription.
*/
list is ComputeListBySubscription<Disk, Response = DiskList>;
/**
* Grants access to a disk.
*/
@action("beginGetAccess")
grantAccess is ComputeResourceActionAsync<Disk, GrantAccessData, AccessUri>;
/**
* Revokes access to a disk.
*/
@action("endGetAccess")
revokeAccess is ComputeResourceActionAsync<
Disk,
void,
OkResponse,
LroHeaders = ArmLroLocationHeader & Azure.Core.Foundations.RetryAfterHeader
>;
}
@@doc(
Disk.name,
"The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, underscore (_), hyphen (-), and dot (.). The maximum name length is 80 characters."
);
@@doc(Disk.properties, "Disk resource properties.");
@@doc(
Disks.createOrUpdate::parameters.resource,
"Disk object supplied in the body of the Put disk operation."
);
@@doc(
Disks.update::parameters.properties,
"Disk object supplied in the body of the Patch disk operation."
);
@@doc(
Disks.grantAccess::parameters.body,
"Access data object supplied in the body of the get disk access operation."
);