Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sparse-spec
Submodule sparse-spec added at 2fcd8e
17 changes: 17 additions & 0 deletions specification/compute/Common.Management/legacy.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,23 @@ namespace Azure.ResourceManager.Legacy {
Response extends {} = ArmResponse<ResourceListResult<Resource>>
>(...ParentParameters, ...Parameters): Response | ErrorType;

/**
* @dev List a single page of the resource
* @template Resource The resource being listed
* @template Parameters Optional. Additional parameters after the path parameters
* @template Response Optional. The response returned by the list
*/
@segmentOf(ResourceTypeParameter)
@doc("List a {name}", Resource)
@get
@listsResource(Resource)
@armResourceList(Resource)
ListSinglePage<
Resource extends Azure.ResourceManager.CommonTypes.Resource,
Parameters extends {} = {},
Response extends {} = ArmResponse<ResourceListResult<Resource>>
>(...ParentParameters, ...Parameters): Response | ErrorType;

/**
* @dev List a resource
* @template Resource The resource being listed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ interface CapacityReservations {
*/
createOrUpdate is ComputeResourceCreateOrReplaceAsync<
CapacityReservation,
LroHeaders = ArmLroLocationHeader & Azure.Core.Foundations.RetryAfterHeader
LroHeaders = ArmLroLocationHeader<FinalResult = CapacityReservation> &
Azure.Core.Foundations.RetryAfterHeader
>;

/**
Expand All @@ -64,7 +65,8 @@ interface CapacityReservations {
update is ComputeCustomPatchAsync<
CapacityReservation,
CapacityReservationUpdate,
LroHeaders = ArmLroLocationHeader & Azure.Core.Foundations.RetryAfterHeader
LroHeaders = ArmLroLocationHeader<FinalResult = CapacityReservation> &
Azure.Core.Foundations.RetryAfterHeader
>;

/**
Expand Down
5 changes: 3 additions & 2 deletions specification/compute/Compute.Management/DedicatedHost.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ interface DedicatedHosts {
*/
createOrUpdate is ComputeResourceCreateOrReplaceAsync<
DedicatedHost,
LroHeaders = ArmLroLocationHeader & Azure.Core.Foundations.RetryAfterHeader
LroHeaders = ArmLroLocationHeader<FinalResult = DedicatedHost> &
Azure.Core.Foundations.RetryAfterHeader
>;

/**
Expand All @@ -63,7 +64,7 @@ interface DedicatedHosts {
DedicatedHost,
DedicatedHostUpdate,
Response = ArmResponse<DedicatedHost> &
ArmLroLocationHeader &
ArmLroLocationHeader<FinalResult = DedicatedHost> &
Azure.Core.Foundations.RetryAfterHeader
>;

Expand Down
5 changes: 3 additions & 2 deletions specification/compute/Compute.Management/Image.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ interface Images {
*/
createOrUpdate is ComputeResourceCreateOrReplaceAsync<
Image,
LroHeaders = ArmLroLocationHeader & Azure.Core.Foundations.RetryAfterHeader
LroHeaders = ArmLroLocationHeader<FinalResult = Image> &
Azure.Core.Foundations.RetryAfterHeader
>;

/**
Expand All @@ -61,7 +62,7 @@ interface Images {
ImageUpdate,
Response = ArmResponse<Image> | ArmResourceCreatedResponse<
Image,
LroHeaders = ArmLroLocationHeader &
LroHeaders = ArmLroLocationHeader<FinalResult = Image> &
Azure.Core.Foundations.RetryAfterHeader
>
>;
Expand Down
3 changes: 2 additions & 1 deletion specification/compute/Compute.Management/RestorePoint.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ interface RestorePoints {
RestorePoint,
Response = ArmResourceCreatedResponse<
RestorePoint,
ArmLroLocationHeader & Azure.Core.Foundations.RetryAfterHeader
ArmLroLocationHeader<FinalResult = RestorePoint> &
Azure.Core.Foundations.RetryAfterHeader
>
>;

Expand Down
48 changes: 37 additions & 11 deletions specification/compute/Compute.Management/VirtualMachine.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ interface VirtualMachines {
@header("If-None-Match")
IfNoneMatch?: string;
},
LroHeaders = ArmLroLocationHeader & Azure.Core.Foundations.RetryAfterHeader
LroHeaders = ArmLroLocationHeader<FinalResult = VirtualMachine> &
Azure.Core.Foundations.RetryAfterHeader
>;

/**
Expand All @@ -129,7 +130,7 @@ interface VirtualMachines {
IfNoneMatch?: string;
},
Response = ArmResponse<VirtualMachine> &
ArmLroLocationHeader &
ArmLroLocationHeader<FinalResult = VirtualMachine> &
Azure.Core.Foundations.RetryAfterHeader
>;

Expand Down Expand Up @@ -231,7 +232,8 @@ interface VirtualMachines {
convertToManagedDisks is ComputeResourceActionAsync<
VirtualMachine,
void,
Response = OkResponse
Response = OkResponse,
LroHeaders = ArmLroLocationHeader & Azure.Core.Foundations.RetryAfterHeader
>;

/**
Expand All @@ -247,7 +249,8 @@ interface VirtualMachines {
*/
@query("hibernate")
hibernate?: boolean;
}
},
LroHeaders = ArmLroLocationHeader & Azure.Core.Foundations.RetryAfterHeader
>;

/**
Expand Down Expand Up @@ -280,7 +283,8 @@ interface VirtualMachines {
performMaintenance is ComputeResourceActionAsync<
VirtualMachine,
void,
OkResponse
OkResponse,
LroHeaders = ArmLroLocationHeader & Azure.Core.Foundations.RetryAfterHeader
>;

/**
Expand All @@ -296,18 +300,29 @@ interface VirtualMachines {
*/
@query("skipShutdown")
skipShutdown?: boolean;
}
},
LroHeaders = ArmLroLocationHeader & Azure.Core.Foundations.RetryAfterHeader
>;

/**
* The operation to reapply a virtual machine's state.
*/
reapply is ComputeResourceActionAsync<VirtualMachine, void, OkResponse>;
reapply is ComputeResourceActionAsync<
VirtualMachine,
void,
OkResponse,
LroHeaders = ArmLroLocationHeader & Azure.Core.Foundations.RetryAfterHeader
>;

/**
* Shuts down the virtual machine, moves it to a new node, and powers it back on.
*/
redeploy is ComputeResourceActionAsync<VirtualMachine, void, OkResponse>;
redeploy is ComputeResourceActionAsync<
VirtualMachine,
void,
OkResponse,
LroHeaders = ArmLroLocationHeader & Azure.Core.Foundations.RetryAfterHeader
>;

/**
* Reimages (upgrade the operating system) a virtual machine which don't have a ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. NOTE: The retaining of old OS disk depends on the value of deleteOption of OS disk. If deleteOption is detach, the old OS disk will be preserved after reimage. If deleteOption is delete, the old OS disk will be deleted after reimage. The deleteOption of the OS disk should be updated accordingly before performing the reimage.
Expand All @@ -320,13 +335,19 @@ interface VirtualMachines {
*/
@bodyRoot parameters?: VirtualMachineReimageParameters;
},
OkResponse
OkResponse,
LroHeaders = ArmLroLocationHeader & Azure.Core.Foundations.RetryAfterHeader
>;

/**
* The operation to restart a virtual machine.
*/
restart is ComputeResourceActionAsync<VirtualMachine, void, OkResponse>;
restart is ComputeResourceActionAsync<
VirtualMachine,
void,
OkResponse,
LroHeaders = ArmLroLocationHeader & Azure.Core.Foundations.RetryAfterHeader
>;

/**
* The operation to retrieve SAS URIs for a virtual machine's boot diagnostic logs.
Expand Down Expand Up @@ -356,7 +377,12 @@ interface VirtualMachines {
/**
* The operation to start a virtual machine.
*/
start is ComputeResourceActionAsync<VirtualMachine, void, OkResponse>;
start is ComputeResourceActionAsync<
VirtualMachine,
void,
OkResponse,
LroHeaders = ArmLroLocationHeader & Azure.Core.Foundations.RetryAfterHeader
>;

/**
* Lists all available virtual machine sizes to which the specified virtual machine can be resized.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,27 @@ model VirtualMachineExtension
>;
}

@armResourceOperations
interface VirtualMachineExtensionOps
extends Azure.ResourceManager.Legacy.ComputeLegacyOperations<
{
...Azure.ResourceManager.Legacy.BasePath,

@doc("The name of the virtual machine.")
@path
@segment("virtualMachines")
vmName: string,
},
KeysOf<{
...ResourceNameParameter<
VirtualMachineExtension,
SegmentName = "extensions",
KeyName = "vmExtensionName",
NamePattern = ""
>,
}>
> {}

@armResourceOperations
interface VirtualMachineExtensions {
/**
Expand All @@ -46,7 +67,8 @@ interface VirtualMachineExtensions {
*/
createOrUpdate is ComputeResourceCreateOrReplaceAsync<
VirtualMachineExtension,
LroHeaders = ArmLroLocationHeader & Azure.Core.Foundations.RetryAfterHeader
LroHeaders = ArmLroLocationHeader<FinalResult = VirtualMachineExtension> &
Azure.Core.Foundations.RetryAfterHeader
>;

/**
Expand All @@ -57,7 +79,7 @@ interface VirtualMachineExtensions {
VirtualMachineExtension,
VirtualMachineExtensionUpdate,
Response = ArmResponse<VirtualMachineExtension> &
ArmLroLocationHeader &
ArmLroLocationHeader<FinalResult = VirtualMachineExtension> &
Azure.Core.Foundations.RetryAfterHeader
>;

Expand All @@ -72,7 +94,7 @@ interface VirtualMachineExtensions {
/**
* The operation to get all extensions of a Virtual Machine.
*/
list is ComputeResourceListByParent<
list is VirtualMachineExtensionOps.ListSinglePage<
VirtualMachineExtension,
Parameters = {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ interface VirtualMachineRunCommands {
*/
createOrUpdate is VirtualMachineRunCommandOps.CreateOrUpdateAsync<
VirtualMachineRunCommand,
LroHeaders = ArmLroLocationHeader & Azure.Core.Foundations.RetryAfterHeader
LroHeaders = ArmLroLocationHeader<FinalResult = VirtualMachineRunCommand> &
Azure.Core.Foundations.RetryAfterHeader
>;

/**
Expand All @@ -81,7 +82,7 @@ interface VirtualMachineRunCommands {
VirtualMachineRunCommand,
VirtualMachineRunCommandUpdate,
Response = ArmResponse<VirtualMachineRunCommand> &
ArmLroLocationHeader &
ArmLroLocationHeader<FinalResult = VirtualMachineRunCommand> &
Azure.Core.Foundations.RetryAfterHeader
>;

Expand Down Expand Up @@ -165,7 +166,8 @@ interface VirtualMachineScaleSetVMRunCommands {
@operationId("VirtualMachineScaleSetVMRunCommands_CreateOrUpdate")
createOrUpdate is VirtualMachineScaleSetVMRunCommandOps.CreateOrUpdateAsync<
VirtualMachineRunCommand,
LroHeaders = ArmLroLocationHeader & Azure.Core.Foundations.RetryAfterHeader
LroHeaders = ArmLroLocationHeader<FinalResult = VirtualMachineRunCommand> &
Azure.Core.Foundations.RetryAfterHeader
>;

/**
Expand All @@ -178,7 +180,7 @@ interface VirtualMachineScaleSetVMRunCommands {
VirtualMachineRunCommand,
VirtualMachineRunCommandUpdate,
Response = ArmResponse<VirtualMachineRunCommand> &
ArmLroLocationHeader &
ArmLroLocationHeader<FinalResult = VirtualMachineRunCommand> &
Azure.Core.Foundations.RetryAfterHeader
>;

Expand Down
Loading
Loading