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

tsp, avs, rename List API response schema back to ##List #29408

Merged
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
7 changes: 7 additions & 0 deletions specification/vmware/Microsoft.AVS/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -2224,3 +2224,10 @@ model ResourceSkuRequired {
@doc("The SKU (Stock Keeping Unit) assigned to this resource.")
sku: Foundations.Sku;
}

@doc("The response of a {name} list operation.", Resource)
@friendlyName(FriendlyNameFormat, Resource)
model ResourceList<
Resource extends Foundations.Resource,
FriendlyNameFormat extends valueof string = "{name}List"
> is Azure.Core.Page<Resource>;
129 changes: 105 additions & 24 deletions specification/vmware/Microsoft.AVS/routes.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,15 @@ interface Locations {
interface PrivateClouds {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("PrivateClouds_List")
list is ArmResourceListByParent<PrivateCloud>;
list is ArmResourceListByParent<
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will the naming fix be covered in 0.57.0? if yes, we will need to regen after typespec is released for this right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this release, we likely would generate from Swagger. And operationId in Swagger is specified on above @operationId("PrivateClouds_List") line.

We are renaming these List in another PR (in client.tsp) #29308
But as we know, the problem is how to rename resource group...

PrivateCloud,
Response = ArmResponse<ResourceList<PrivateCloud>>
>;

listInSubscription is ArmListBySubscription<PrivateCloud>;
listInSubscription is ArmListBySubscription<
PrivateCloud,
Response = ArmResponse<ResourceList<PrivateCloud>>
>;

get is ArmResourceRead<PrivateCloud>;

Expand Down Expand Up @@ -109,7 +115,10 @@ interface PrivateClouds {
interface Clusters {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("Clusters_List")
list is ArmResourceListByParent<Cluster>;
list is ArmResourceListByParent<
Cluster,
Response = ArmResponse<ResourceList<Cluster>>
>;

get is ArmResourceRead<Cluster>;

Expand Down Expand Up @@ -167,7 +176,10 @@ interface Clusters {
interface Datastores {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("Datastores_List")
list is ArmResourceListByParent<Datastore>;
list is ArmResourceListByParent<
Datastore,
Response = ArmResponse<ResourceList<Datastore>>
>;

get is ArmResourceRead<Datastore>;

Expand All @@ -192,7 +204,10 @@ interface Datastores {
interface HcxEnterpriseSites {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("HcxEnterpriseSites_List")
list is ArmResourceListByParent<HcxEnterpriseSite>;
list is ArmResourceListByParent<
HcxEnterpriseSite,
Response = ArmResponse<ResourceList<HcxEnterpriseSite>>
>;

get is ArmResourceRead<HcxEnterpriseSite>;

Expand All @@ -217,7 +232,10 @@ interface HcxEnterpriseSites {
interface Authorizations {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("Authorizations_List")
list is ArmResourceListByParent<ExpressRouteAuthorization>;
list is ArmResourceListByParent<
ExpressRouteAuthorization,
Response = ArmResponse<ResourceList<ExpressRouteAuthorization>>
>;

get is ArmResourceRead<ExpressRouteAuthorization>;

Expand Down Expand Up @@ -247,7 +265,10 @@ interface Authorizations {
interface GlobalReachConnections {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("GlobalReachConnections_List")
list is ArmResourceListByParent<GlobalReachConnection>;
list is ArmResourceListByParent<
GlobalReachConnection,
Response = ArmResponse<ResourceList<GlobalReachConnection>>
>;

get is ArmResourceRead<GlobalReachConnection>;

Expand Down Expand Up @@ -278,14 +299,20 @@ interface WorkloadNetworks {

#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_List")
list is ArmResourceListByParent<WorkloadNetwork>;
list is ArmResourceListByParent<
WorkloadNetwork,
Response = ArmResponse<ResourceList<WorkloadNetwork>>
>;
}

@armResourceOperations
interface WorkloadNetworkSegments {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_ListSegments")
list is ArmResourceListByParent<WorkloadNetworkSegment>;
list is ArmResourceListByParent<
WorkloadNetworkSegment,
Response = ArmResponse<ResourceList<WorkloadNetworkSegment, "{name}sList">>
>;

#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_GetSegment")
Expand Down Expand Up @@ -340,7 +367,10 @@ interface WorkloadNetworkSegments {
interface WorkloadNetworkDhcpConfigurations {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_ListDhcp")
list is ArmResourceListByParent<WorkloadNetworkDhcp>;
list is ArmResourceListByParent<
WorkloadNetworkDhcp,
Response = ArmResponse<ResourceList<WorkloadNetworkDhcp>>
>;

#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-operation" "DhcpIdParameter should be last, but it is breaking to correct it."
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
Expand Down Expand Up @@ -410,7 +440,10 @@ interface WorkloadNetworkDhcpConfigurations {
interface WorkloadNetworkGateways {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_ListGateways")
list is ArmResourceListByParent<WorkloadNetworkGateway>;
list is ArmResourceListByParent<
WorkloadNetworkGateway,
Response = ArmResponse<ResourceList<WorkloadNetworkGateway>>
>;

#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_GetGateway")
Expand All @@ -424,7 +457,10 @@ interface WorkloadNetworkGateways {
interface WorkloadNetworkPortMirroringProfiles {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_ListPortMirroring")
list is ArmResourceListByParent<WorkloadNetworkPortMirroring>;
list is ArmResourceListByParent<
WorkloadNetworkPortMirroring,
Response = ArmResponse<ResourceList<WorkloadNetworkPortMirroring>>
>;

#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_GetPortMirroring")
Expand Down Expand Up @@ -498,7 +534,10 @@ interface WorkloadNetworkPortMirroringProfiles {
interface WorkloadNetworkVmGroups {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_ListVMGroups")
list is ArmResourceListByParent<WorkloadNetworkVMGroup>;
list is ArmResourceListByParent<
WorkloadNetworkVMGroup,
Response = ArmResponse<ResourceList<WorkloadNetworkVMGroup, "{name}sList">>
>;

#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_GetVMGroup")
Expand Down Expand Up @@ -570,7 +609,13 @@ interface WorkloadNetworkVmGroups {
interface WorkloadNetworkVirtualMachines {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_ListVirtualMachines")
list is ArmResourceListByParent<WorkloadNetworkVirtualMachine>;
list is ArmResourceListByParent<
WorkloadNetworkVirtualMachine,
Response = ArmResponse<ResourceList<
WorkloadNetworkVirtualMachine,
"{name}sList"
>>
>;

#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_GetVirtualMachine")
Expand All @@ -584,7 +629,13 @@ interface WorkloadNetworkVirtualMachines {
interface WorkloadNetworkDnsServices {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_ListDnsServices")
list is ArmResourceListByParent<WorkloadNetworkDnsService>;
list is ArmResourceListByParent<
WorkloadNetworkDnsService,
Response = ArmResponse<ResourceList<
WorkloadNetworkDnsService,
"{name}sList"
>>
>;

#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_GetDnsService")
Expand Down Expand Up @@ -658,7 +709,10 @@ interface WorkloadNetworkDnsServices {
interface WorkloadNetworkDnsZones {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_ListDnsZones")
list is ArmResourceListByParent<WorkloadNetworkDnsZone>;
list is ArmResourceListByParent<
WorkloadNetworkDnsZone,
Response = ArmResponse<ResourceList<WorkloadNetworkDnsZone, "{name}sList">>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe a minor concern, is this the right way to get plural if the name is policy?

>;

#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_GetDnsZone")
Expand Down Expand Up @@ -731,7 +785,10 @@ interface WorkloadNetworkDnsZones {
interface WorkloadNetworkPublicIps {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_ListPublicIPs")
list is ArmResourceListByParent<WorkloadNetworkPublicIP>;
list is ArmResourceListByParent<
WorkloadNetworkPublicIP,
Response = ArmResponse<ResourceList<WorkloadNetworkPublicIP, "{name}sList">>
>;

#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("WorkloadNetworks_GetPublicIP")
Expand Down Expand Up @@ -782,7 +839,10 @@ interface WorkloadNetworkPublicIps {
interface CloudLinks {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("CloudLinks_List")
list is ArmResourceListByParent<CloudLink>;
list is ArmResourceListByParent<
CloudLink,
Response = ArmResponse<ResourceList<CloudLink>>
>;

get is ArmResourceRead<CloudLink>;

Expand All @@ -807,7 +867,10 @@ interface CloudLinks {
interface Addons {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("Addons_List")
list is ArmResourceListByParent<Addon>;
list is ArmResourceListByParent<
Addon,
Response = ArmResponse<ResourceList<Addon>>
>;

get is ArmResourceRead<Addon>;

Expand All @@ -832,7 +895,10 @@ interface Addons {
interface VirtualMachines {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("VirtualMachines_List")
list is ArmResourceListByParent<VirtualMachine>;
list is ArmResourceListByParent<
VirtualMachine,
Response = ArmResponse<ResourceList<VirtualMachine, "{name}sList">>
>;

get is ArmResourceRead<VirtualMachine>;

Expand All @@ -854,7 +920,13 @@ interface VirtualMachines {
interface PlacementPolicies {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("PlacementPolicies_List")
list is ArmResourceListByParent<PlacementPolicy>;
list is ArmResourceListByParent<
PlacementPolicy,
Response = ArmResponse<ResourceList<
PlacementPolicy,
"PlacementPoliciesList"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I see we can specify the full name here.

>>
>;

get is ArmResourceRead<PlacementPolicy>;

Expand Down Expand Up @@ -910,7 +982,10 @@ interface PlacementPolicies {
interface ScriptPackages {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("ScriptPackages_List")
list is ArmResourceListByParent<ScriptPackage>;
list is ArmResourceListByParent<
ScriptPackage,
Response = ArmResponse<ResourceList<ScriptPackage, "{name}sList">>
>;

get is ArmResourceRead<ScriptPackage>;
}
Expand All @@ -919,7 +994,10 @@ interface ScriptPackages {
interface ScriptCmdlets {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("ScriptCmdlets_List")
list is ArmResourceListByParent<ScriptCmdlet>;
list is ArmResourceListByParent<
ScriptCmdlet,
Response = ArmResponse<ResourceList<ScriptCmdlet, "{name}sList">>
>;

get is ArmResourceRead<ScriptCmdlet>;
}
Expand All @@ -928,7 +1006,10 @@ interface ScriptCmdlets {
interface ScriptExecutions {
#suppress "@azure-tools/typespec-azure-core/no-operation-id" "Can not change existing operationId."
@operationId("ScriptExecutions_List")
list is ArmResourceListByParent<ScriptExecution>;
list is ArmResourceListByParent<
ScriptExecution,
Response = ArmResponse<ResourceList<ScriptExecution, "{name}sList">>
>;

get is ArmResourceRead<ScriptExecution>;

Expand Down
Loading