-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Expand file tree
/
Copy pathVirtualMachineInstance.tsp
More file actions
132 lines (123 loc) · 4.46 KB
/
VirtualMachineInstance.tsp
File metadata and controls
132 lines (123 loc) · 4.46 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
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/rest";
import "./models.tsp";
using TypeSpec.Rest;
using Azure.ResourceManager;
using TypeSpec.Http;
using TypeSpec.OpenAPI;
namespace Microsoft.ScVmm;
/** Define the virtualMachineInstance. */
@singleton
model VirtualMachineInstance
is ExtensionResource<VirtualMachineInstanceProperties> {
/** Name of the virtual machine instance. */
@key
@segment("virtualMachineInstances")
@visibility("read")
@maxLength(54)
@minLength(1)
@pattern("[a-zA-Z0-9-_\\.]")
@path
name: string;
/** Gets or sets the extended location. */
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "This property is allowed but not recognized by the linter"
@visibility("read")
extendedLocation: ExtendedLocation;
}
/** The type used for update operations of the VirtualMachineInstance. */
model VirtualMachineInstanceUpdate
is UpdateableProperties<OmitProperties<
VirtualMachineInstance,
"properties"
>> {
/** The update properties of the VirtualMachineInstance. */
@extension("x-ms-client-flatten", true)
properties?: VirtualMachineInstanceUpdateProperties;
}
/** Delete From Host */
union DeleteFromHost {
/** Enable delete from host. */
`true`: "true",
/** Disable delete from host. */
`false`: "false",
string,
}
@armResourceOperations
interface VirtualMachineInstances {
/** Retrieves information about a virtual machine instance. */
@summary("Gets a virtual machine.")
get is ArmResourceRead<VirtualMachineInstance>;
/** The operation to create or update a virtual machine instance. Please note some properties can be set only during virtual machine instance creation. */
@summary("Implements virtual machine PUT method.")
createOrUpdate is ArmResourceCreateOrUpdateAsync<VirtualMachineInstance>;
/** The operation to update a virtual machine instance. */
@summary("Updates a virtual machine.")
@extension(
"x-ms-long-running-operation-options",
{
`final-state-via`: "azure-async-operation",
}
)
update is ArmCustomPatchAsync<
VirtualMachineInstance,
VirtualMachineInstanceUpdate
>;
/** The operation to delete a virtual machine instance. */
@summary("Deletes an virtual machine.")
@extension(
"x-ms-long-running-operation-options",
{
`final-state-via`: "azure-async-operation",
}
)
delete is ArmResourceDeleteWithoutOkAsync<
VirtualMachineInstance,
{
...Foundations.BaseParameters<VirtualMachineInstance>;
...QueryForceDelete;
/** Whether to disable the VM from azure and also delete it from Vmm. */
@query("deleteFromHost")
deleteFromHost?: DeleteFromHost;
}
>;
/** Lists all of the virtual machine instances within the specified parent resource. */
@summary("Implements List virtual machine instances.")
listByArm is ArmResourceListByParent<VirtualMachineInstance>;
/** The operation to power off (stop) a virtual machine instance. */
@summary("Implements the operation to stop a virtual machine.")
stop is ArmResourceActionNoResponseContentAsync<
VirtualMachineInstance,
StopVirtualMachineOptions
>;
/** The operation to start a virtual machine instance. */
@summary("Implements the operation to start a virtual machine.")
start is ArmResourceActionNoResponseContentAsync<
VirtualMachineInstance,
void
>;
/** The operation to restart a virtual machine instance. */
@summary("Implements the operation to restart a virtual machine.")
restart is ArmResourceActionNoResponseContentAsync<
VirtualMachineInstance,
void
>;
/** Creates a checkpoint in virtual machine instance. */
@summary("Implements the operation to creates a checkpoint in a virtual machine instance.")
createCheckpoint is ArmResourceActionNoResponseContentAsync<
VirtualMachineInstance,
VirtualMachineCreateCheckpoint
>;
/** Deletes a checkpoint in virtual machine instance. */
@summary("Implements the operation to delete a checkpoint in a virtual machine instance.")
deleteCheckpoint is ArmResourceActionNoResponseContentAsync<
VirtualMachineInstance,
VirtualMachineDeleteCheckpoint
>;
/** Restores to a checkpoint in virtual machine instance. */
@summary("Implements the operation to restores to a checkpoint in a virtual machine instance.")
restoreCheckpoint is ArmResourceActionNoResponseContentAsync<
VirtualMachineInstance,
VirtualMachineRestoreCheckpoint
>;
}