Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generation of GA PowerShell module for Workloads 2024-09-01 api #26228

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
64 changes: 42 additions & 22 deletions src/Workloads/SapVirtualInstance.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ For information on how to develop for `Az.SapVirtualInstance`, see [how-to.md](h
> see https://aka.ms/autorest

```yaml
commit: 202321f386ea5b0c103b46902d43b3d3c50e029c
tag: package-preview-2023-10
# tag: package-2023-04
commit: 724933f1dfe3bc7831d74b6f1d0a189790fca5e0
tag: package-2024-09

require:
- $(this-folder)/../../readme.azure.noprofile.md
Expand Down Expand Up @@ -92,32 +91,38 @@ directive:
# SapCentralInstance
- where:
verb: New
subject: ^SapCentralInstance$
subject: ^SapCentralServerInstance$
remove: true

- where:
verb: Stop
subject: ^SapCentralInstance$
subject: ^SapCentralServerInstance$
variant: ^Stop$|^StopViaIdentity$
remove: true

- where:
verb: Update
subject: ^SapCentralInstance$
subject: ^SapCentralServerInstance$
variant: ^Update$|^UpdateViaIdentity$
remove: true

- where:
verb: Remove
subject: ^SapCentralInstance$
subject: ^SapCentralServerInstance$
remove: true

- where:
subject: SapCentralInstance
subject: SapCentralServerInstance
parameter-name: CentralInstanceName
set:
parameter-name: Name

- where:
verb: Get|Start|Stop|Update
subject: ^SapCentralServerInstance$
set:
subject: SapCentralInstance

# SapDatabaseInstance
- where:
verb: New
Expand Down Expand Up @@ -187,30 +192,48 @@ directive:
# SapAvailabilityZoneDetail
- where:
verb: Invoke
subject: ^SapAvailabilityZoneDetail$
subject: ^InvokeSapVirtualInstanceAvailabilityZoneDetail$
remove: true

# SapDiskConfiguration
- where:
verb: Invoke
subject: ^SapDiskConfiguration$
subject: ^InvokeSapVirtualInstanceDiskConfiguration$
variant: ^Sap$|^SapViaIdentity$
remove: true

- where:
verb: Invoke
subject: ^InvokeSapVirtualInstanceDiskConfiguration$
set:
subject: SapDiskConfiguration

# SapSizingRecommendation
- where:
verb: Invoke
subject: ^SapSizingRecommendation$
subject: ^InvokeSapVirtualInstanceSizingRecommendation$
variant: ^Sap$|^SapViaIdentity$
remove: true

- where:
verb: Invoke
subject: ^InvokeSapVirtualInstanceSizingRecommendation$
set:
subject: SapSizingRecommendation

# SapSupportedSku
- where:
verb: Invoke
subject: ^SapSupportedSku$
subject: ^InvokeSapVirtualInstanceSapSupportedSku$
variant: ^Sap$|^SapViaIdentity$
remove: true

- where:
verb: Invoke
subject: ^InvokeSapVirtualInstanceSapSupportedSku$
set:
subject: SapSupportedSku

#Aliasing
- where:
verb: New
Expand Down Expand Up @@ -397,35 +420,32 @@ directive:
- ProviderSpecificProperties
- SAPConfiguration
- ErrorInnerError
- model-cmdlet:
- SapLandscapeMonitorSidMapping
- SapLandscapeMonitorMetricThresholds

- from: swagger-document
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}"].delete.responses

transform: >-
return { "200": { "description": "OK" }, "202": { "description": "Accepted", "headers": { "Location": { "description": "The URL of the resource used to check the status of the asynchronous operation.", "type": "string" }, "Retry-After": { "description": "The recommended number of seconds to wait before calling the URI specified in Azure-AsyncOperation.", "type": "integer", "format": "int32" }, "Azure-AsyncOperation": { "description": "The URI to poll for completion status.", "type": "string" } } }, "204": { "description": "No Content" }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "/~https://github.com/Azure/azure-rest-api-specs/blob/202321f386ea5b0c103b46902d43b3d3c50e029c/specification/common-types/resource-management/v3/types.json#/definitions/ErrorResponse" } } }
return { "200": { "description": "OK" }, "202": { "description": "Accepted", "headers": { "Location": { "description": "The URL of the resource used to check the status of the asynchronous operation.", "type": "string" }, "Retry-After": { "description": "The recommended number of seconds to wait before calling the URI specified in Azure-AsyncOperation.", "type": "integer", "format": "int32" }, "Azure-AsyncOperation": { "description": "The URI to poll for completion status.", "type": "string" } } }, "204": { "description": "No Content" }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "/~https://github.com/Azure/azure-rest-api-specs/blob/724933f1dfe3bc7831d74b6f1d0a189790fca5e0/specification/common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }

# Result shoule be in SingleServerRecommendationResult and ThreeTierRecommendationResult
- from: source-file-csharp
where: $
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api20230401.ISapSizingRecommendationResult Property', 'public Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api20230401.ISapSizingRecommendationResult Property');
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api20231001Preview.ISapSizingRecommendationResult Property', 'public Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api20240901.ISapSizingRecommendationResult Property');

# remove System Data in module Monitor, ProviderInstance, SapApplicationServerInstance, SapCentralServerInstance, SapDatabaseInstance, SapLandscapeMonitor, SapVirtualInstance
- from: SapApplicationServerInstance.cs
where: $
transform: $ = $.replace('public Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api30.ISystemData SystemData', 'internal Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api30.ISystemData SystemData');
transform: $ = $.replace('public Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api30.ISystemData SystemData', 'internal Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api50.ISystemData SystemData');
- from: SapCentralServerInstance.cs
where: $
transform: $ = $.replace('public Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api30.ISystemData SystemData', 'internal Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api30.ISystemData SystemData');
transform: $ = $.replace('public Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api30.ISystemData SystemData', 'internal Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api50.ISystemData SystemData');
- from: SapDatabaseInstance.cs
where: $
transform: $ = $.replace('public Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api30.ISystemData SystemData', 'internal Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api30.ISystemData SystemData');
transform: $ = $.replace('public Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api30.ISystemData SystemData', 'internal Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api50.ISystemData SystemData');
- from: SapLandscapeMonitor.cs
where: $
transform: $ = $.replace('public Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api30.ISystemData SystemData', 'internal Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api30.ISystemData SystemData');
transform: $ = $.replace('public Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api30.ISystemData SystemData', 'internal Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api50.ISystemData SystemData');
- from: SapVirtualInstance.cs
where: $
transform: $ = $.replace('public Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api30.ISystemData SystemData', 'internal Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api30.ISystemData SystemData');
transform: $ = $.replace('public Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api30.ISystemData SystemData', 'internal Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api50.ISystemData SystemData');
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"resourceType": "locations",
"apiVersion": "2024-09-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.workloads"
},
"commands": [
{
"name": "Invoke-AzWorkloadsSapDiskConfiguration",
"description": "Get the SAP Disk Configuration Layout prod/non-prod SAP System.",
"path": "/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getDiskConfigurations",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.workloads/invoke-azworkloadssapdiskconfiguration"
},
"parameterSets": [
{
"parameters": [
"-Location <String>",
"[-SubscriptionId <String>]"
]
}
]
},
"examples": [
{
"description": "Get the SAP Disk Configuration Layout prod/non-prod SAP System.",
"parameters": [
{
"name": "-Location",
"value": "[Path.location]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
},
{
"name": "Invoke-AzWorkloadsSapSizingRecommendation",
"description": "Gets the sizing recommendations.",
"path": "/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getSizingRecommendations",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.workloads/invoke-azworkloadssapsizingrecommendation"
},
"parameterSets": [
{
"parameters": [
"-Location <String>",
"[-SubscriptionId <String>]"
]
}
]
},
"examples": [
{
"description": "Gets the sizing recommendations.",
"parameters": [
{
"name": "-Location",
"value": "[Path.location]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
},
{
"name": "Invoke-AzWorkloadsSapSupportedSku",
"description": "Get a list of SAP supported SKUs for ASCS, Application and Database tier.",
"path": "/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getSapSupportedSku",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.workloads/invoke-azworkloadssapsupportedsku"
},
"parameterSets": [
{
"parameters": [
"-Location <String>",
"[-SubscriptionId <String>]"
]
}
]
},
"examples": [
{
"description": "Get a list of SAP supported SKUs for ASCS, Application and Database tier.",
"parameters": [
{
"name": "-Location",
"value": "[Path.location]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "sapVirtualInstances/applicationInstances",
"apiVersion": "2023-10-01-preview",
"apiVersion": "2024-09-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.workloads"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "sapVirtualInstances/centralInstances",
"apiVersion": "2023-10-01-preview",
"apiVersion": "2024-09-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.workloads"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "sapVirtualInstances/databaseInstances",
"apiVersion": "2023-10-01-preview",
"apiVersion": "2024-09-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.workloads"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "sapVirtualInstances",
"apiVersion": "2023-10-01-preview",
"apiVersion": "2024-09-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.workloads"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Cmdlet
/// <remarks>
/// [OpenAPI] SAPSizingRecommendations=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getSizingRecommendations"
/// </remarks>
public partial class InvokeAzWorkloadsSapSizingRecommendation_SapExpanded : global::System.Management.Automation.PSCmdlet,
public partial class InvokeAzWorkloadsSapSizingRecommendation_InvokeExpanded : global::System.Management.Automation.PSCmdlet,
Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Runtime.IEventListener
{
/// <summary>a delegate that is called when the remote service returns 200 (OK).</summary>
/// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param>
/// <param name="response">the body result as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api20231001Preview.ISapSizingRecommendationResult">Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api20231001Preview.ISapSizingRecommendationResult</see>
/// <param name="response">the body result as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api20240901.ISapSizingRecommendationResult">Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api20240901.ISapSizingRecommendationResult</see>
/// from the remote call</param>
/// <returns>
/// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the method is completed.
/// </returns>
partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api20231001Preview.ISapSizingRecommendationResult> response, ref global::System.Threading.Tasks.Task<bool> returnNow)
partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api20240901.ISapSizingRecommendationResult> response, ref global::System.Threading.Tasks.Task<bool> returnNow)
{
// onOk - response for 200 / application/json
// should be Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api20231001Preview.ISapSizingRecommendationResult
// should be Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api20240901.ISapSizingRecommendationResult
WriteObject(response.Result);
returnNow = global::System.Threading.Tasks.Task.FromResult(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Cmdlet
/// <remarks>
/// [OpenAPI] SAPSizingRecommendations=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getSizingRecommendations"
/// </remarks>
public partial class InvokeAzWorkloadsSapSizingRecommendation_SapViaIdentityExpanded : global::System.Management.Automation.PSCmdlet,
public partial class InvokeAzWorkloadsSapSizingRecommendation_InvokeViaIdentityExpanded : global::System.Management.Automation.PSCmdlet,
Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Runtime.IEventListener
{
/// <summary>a delegate that is called when the remote service returns 200 (OK).</summary>
/// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param>
/// <param name="response">the body result as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api20231001Preview.ISapSizingRecommendationResult">Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api20231001Preview.ISapSizingRecommendationResult</see>
/// <param name="response">the body result as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api20240901.ISapSizingRecommendationResult">Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api20240901.ISapSizingRecommendationResult</see>
/// from the remote call</param>
/// <returns>
/// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the method is completed.
/// </returns>
partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api20231001Preview.ISapSizingRecommendationResult> response, ref global::System.Threading.Tasks.Task<bool> returnNow)
partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api20240901.ISapSizingRecommendationResult> response, ref global::System.Threading.Tasks.Task<bool> returnNow)
{
// onOk - response for 200 / application/json
// (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api20231001Preview.ISapSizingRecommendationResult
// (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api20240901.ISapSizingRecommendationResult
WriteObject(response.Result);
returnNow = global::System.Threading.Tasks.Task.FromResult(true);
}
Expand Down
Loading