Skip to content

Commit 3519c80

Browse files
authored
Add client tsp for StandybyPool (Azure#30488)
1 parent 7c3c055 commit 3519c80

File tree

8 files changed

+90
-237
lines changed

8 files changed

+90
-237
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import "./main.tsp";
2+
import "@azure-tools/typespec-client-generator-core";
3+
4+
using Azure.ClientGenerator.Core;
5+
using Azure.ResourceManager.CommonTypes;
6+
using Microsoft.StandbyPool;
7+
8+
@@access(Operations.list, Access.internal, "csharp");
9+
10+
@@clientName(StandbyContainerGroupPoolResource,
11+
"StandbyContainerGroupPool",
12+
"csharp"
13+
);
14+
@@clientName(StandbyContainerGroupPoolResourceProperties,
15+
"StandbyContainerGroupPoolProperties",
16+
"csharp"
17+
);
18+
@@clientName(StandbyVirtualMachinePoolResource,
19+
"StandbyVirtualMachinePool",
20+
"csharp"
21+
);
22+
@@clientName(StandbyVirtualMachinePoolResourceProperties,
23+
"StandbyVirtualMachinePoolProperties",
24+
"csharp"
25+
);
26+
@@clientName(StandbyVirtualMachineResource, "StandbyVirtualMachine", "csharp");
27+
@@clientName(StandbyVirtualMachineResourceProperties,
28+
"StandbyVirtualMachineProperties",
29+
"csharp"
30+
);
31+
@@clientName(VirtualMachineState, "StandbyVirtualMachineState", "csharp");
32+
@@clientName(ContainerGroupProfile, "StandbyContainerGroupProfile", "csharp");
33+
@@clientName(ContainerGroupProperties,
34+
"StandbyContainerGroupProperties",
35+
"csharp"
36+
);
37+
@@clientName(StandbyContainerGroupPoolRuntimeViewResource,
38+
"StandbyContainerGroupPoolRuntimeView",
39+
"csharp"
40+
);
41+
@@clientName(StandbyContainerGroupPoolRuntimeViewResourceProperties,
42+
"StandbyContainerGroupPoolRuntimeViewProperties",
43+
"csharp"
44+
);
45+
@@clientName(StandbyVirtualMachinePoolRuntimeViewResource,
46+
"StandbyVirtualMachinePoolRuntimeView",
47+
"csharp"
48+
);
49+
@@clientName(StandbyVirtualMachinePoolRuntimeViewResourceProperties,
50+
"StandbyVirtualMachinePoolRuntimeViewProperties",
51+
"csharp"
52+
);
53+
@@clientName(VirtualMachineInstanceCountSummary,
54+
"StandbyVirtualMachineInstanceCountSummary",
55+
"csharp"
56+
);
57+
@@clientName(ProvisioningState, "StandbyProvisioningState", "csharp");
58+
@@clientName(RefillPolicy, "StandbyRefillPolicy", "csharp");

specification/standbypool/StandbyPool.Management/standbyContainerGroupPool.tsp

+1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ interface StandbyContainerGroupPools {
113113
LroHeaders = Azure.Core.Foundations.RetryAfterHeader
114114
>;
115115
delete is ArmResourceDeleteWithoutOkAsync<StandbyContainerGroupPoolResource>;
116+
@parameterVisibility
116117
update is ArmCustomPatchSync<
117118
StandbyContainerGroupPoolResource,
118119
Azure.ResourceManager.Foundations.ResourceUpdateModel<

specification/standbypool/StandbyPool.Management/standbyVM.tsp

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ model StandbyVirtualMachineResource
3535
@doc("Details of the StandbyVirtualMachine.")
3636
model StandbyVirtualMachineResourceProperties {
3737
@doc("Resource id of the virtual machine.")
38-
virtualMachineResourceId: string;
38+
virtualMachineResourceId: Azure.Core.armResourceIdentifier<[]>;
3939

4040
@doc("The status of the last operation.")
4141
@visibility("read")

specification/standbypool/StandbyPool.Management/standbyVMPool.tsp

+1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ interface StandbyVirtualMachinePools {
9090
LroHeaders = Azure.Core.Foundations.RetryAfterHeader
9191
>;
9292
delete is ArmResourceDeleteWithoutOkAsync<StandbyVirtualMachinePoolResource>;
93+
@parameterVisibility
9394
update is ArmCustomPatchSync<
9495
StandbyVirtualMachinePoolResource,
9596
Azure.ResourceManager.Foundations.ResourceUpdateModel<

specification/standbypool/StandbyPool.Management/tspconfig.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,8 @@ options:
2525
namespace: "com.azure.resourcemanager.standbypool"
2626
service-name: "Standby Pool"
2727
examples-directory: "{project-root}/examples"
28+
"@azure-tools/typespec-csharp":
29+
package-dir: "Azure.ResourceManager.StandbyPool"
30+
flavor: azure
31+
clear-output-folder: true
32+
namespace: "{package-dir}"

specification/standbypool/resource-manager/Microsoft.StandbyPool/preview/2023-12-01-preview/standbypool.json

+8-74
Original file line numberDiff line numberDiff line change
@@ -847,29 +847,6 @@
847847
"id"
848848
]
849849
},
850-
"ContainerGroupProfileUpdate": {
851-
"type": "object",
852-
"description": "Details of the ContainerGroupProfile.",
853-
"properties": {
854-
"id": {
855-
"type": "string",
856-
"format": "arm-id",
857-
"description": "Specifies container group profile id of standby container groups.",
858-
"x-ms-arm-id-details": {
859-
"allowedResources": [
860-
{
861-
"type": "Microsoft.ContainerInstance/containerGroupProfiles"
862-
}
863-
]
864-
}
865-
},
866-
"revision": {
867-
"type": "integer",
868-
"format": "int64",
869-
"description": "Specifies revision of container group profile."
870-
}
871-
}
872-
},
873850
"ContainerGroupProperties": {
874851
"type": "object",
875852
"description": "Details of the ContainerGroupProperties.",
@@ -890,23 +867,6 @@
890867
"containerGroupProfile"
891868
]
892869
},
893-
"ContainerGroupPropertiesUpdate": {
894-
"type": "object",
895-
"description": "Details of the ContainerGroupProperties.",
896-
"properties": {
897-
"containerGroupProfile": {
898-
"$ref": "#/definitions/ContainerGroupProfileUpdate",
899-
"description": "Specifies container group profile of standby container groups."
900-
},
901-
"subnetIds": {
902-
"type": "array",
903-
"description": "Specifies subnet Ids for container group.",
904-
"items": {
905-
"$ref": "#/definitions/Subnet"
906-
}
907-
}
908-
}
909-
},
910870
"ProvisioningState": {
911871
"type": "string",
912872
"description": "Provisioning state",
@@ -982,23 +942,6 @@
982942
"maxReadyCapacity"
983943
]
984944
},
985-
"StandbyContainerGroupPoolElasticityProfileUpdate": {
986-
"type": "object",
987-
"description": "Specifies the elasticity profile of the standby container group pools.",
988-
"properties": {
989-
"maxReadyCapacity": {
990-
"type": "integer",
991-
"format": "int64",
992-
"description": "Specifies maximum number of standby container groups in the standby pool.",
993-
"minimum": 0,
994-
"maximum": 2000
995-
},
996-
"refillPolicy": {
997-
"$ref": "#/definitions/RefillPolicy",
998-
"description": "Specifies refill policy of the pool."
999-
}
1000-
}
1001-
},
1002945
"StandbyContainerGroupPoolResource": {
1003946
"type": "object",
1004947
"description": "A StandbyContainerGroupPoolResource.",
@@ -1082,11 +1025,11 @@
10821025
"description": "The updatable properties of the StandbyContainerGroupPoolResource.",
10831026
"properties": {
10841027
"elasticityProfile": {
1085-
"$ref": "#/definitions/StandbyContainerGroupPoolElasticityProfileUpdate",
1028+
"$ref": "#/definitions/StandbyContainerGroupPoolElasticityProfile",
10861029
"description": "Specifies elasticity profile of standby container group pools."
10871030
},
10881031
"containerGroupProperties": {
1089-
"$ref": "#/definitions/ContainerGroupPropertiesUpdate",
1032+
"$ref": "#/definitions/ContainerGroupProperties",
10901033
"description": "Specifies container group properties of standby container group pools."
10911034
}
10921035
}
@@ -1107,19 +1050,6 @@
11071050
"maxReadyCapacity"
11081051
]
11091052
},
1110-
"StandbyVirtualMachinePoolElasticityProfileUpdate": {
1111-
"type": "object",
1112-
"description": "Details of the elasticity profile.",
1113-
"properties": {
1114-
"maxReadyCapacity": {
1115-
"type": "integer",
1116-
"format": "int64",
1117-
"description": "Specifies the maximum number of virtual machines in the standby virtual machine pool.",
1118-
"minimum": 0,
1119-
"maximum": 2000
1120-
}
1121-
}
1122-
},
11231053
"StandbyVirtualMachinePoolResource": {
11241054
"type": "object",
11251055
"description": "A StandbyVirtualMachinePoolResource.",
@@ -1217,7 +1147,7 @@
12171147
"description": "The updatable properties of the StandbyVirtualMachinePoolResource.",
12181148
"properties": {
12191149
"elasticityProfile": {
1220-
"$ref": "#/definitions/StandbyVirtualMachinePoolElasticityProfileUpdate",
1150+
"$ref": "#/definitions/StandbyVirtualMachinePoolElasticityProfile",
12211151
"description": "Specifies the elasticity profile of the standby virtual machine pools."
12221152
},
12231153
"virtualMachineState": {
@@ -1284,7 +1214,11 @@
12841214
"properties": {
12851215
"virtualMachineResourceId": {
12861216
"type": "string",
1287-
"description": "Resource id of the virtual machine."
1217+
"format": "arm-id",
1218+
"description": "Resource id of the virtual machine.",
1219+
"x-ms-arm-id-details": {
1220+
"allowedResources": []
1221+
}
12881222
},
12891223
"provisioningState": {
12901224
"$ref": "#/definitions/ProvisioningState",

specification/standbypool/resource-manager/Microsoft.StandbyPool/preview/2024-03-01-preview/standbypool.json

+8-81
Original file line numberDiff line numberDiff line change
@@ -1082,29 +1082,6 @@
10821082
"id"
10831083
]
10841084
},
1085-
"ContainerGroupProfileUpdate": {
1086-
"type": "object",
1087-
"description": "Details of the ContainerGroupProfile.",
1088-
"properties": {
1089-
"id": {
1090-
"type": "string",
1091-
"format": "arm-id",
1092-
"description": "Specifies container group profile id of standby container groups.",
1093-
"x-ms-arm-id-details": {
1094-
"allowedResources": [
1095-
{
1096-
"type": "Microsoft.ContainerInstance/containerGroupProfiles"
1097-
}
1098-
]
1099-
}
1100-
},
1101-
"revision": {
1102-
"type": "integer",
1103-
"format": "int64",
1104-
"description": "Specifies revision of container group profile."
1105-
}
1106-
}
1107-
},
11081085
"ContainerGroupProperties": {
11091086
"type": "object",
11101087
"description": "Details of the ContainerGroupProperties.",
@@ -1125,23 +1102,6 @@
11251102
"containerGroupProfile"
11261103
]
11271104
},
1128-
"ContainerGroupPropertiesUpdate": {
1129-
"type": "object",
1130-
"description": "Details of the ContainerGroupProperties.",
1131-
"properties": {
1132-
"containerGroupProfile": {
1133-
"$ref": "#/definitions/ContainerGroupProfileUpdate",
1134-
"description": "Specifies container group profile of standby container groups."
1135-
},
1136-
"subnetIds": {
1137-
"type": "array",
1138-
"description": "Specifies subnet Ids for container group.",
1139-
"items": {
1140-
"$ref": "#/definitions/Subnet"
1141-
}
1142-
}
1143-
}
1144-
},
11451105
"PoolResourceStateCount": {
11461106
"type": "object",
11471107
"description": "Displays the counts of pooled resources in each state, as known by the StandbyPool resource provider.",
@@ -1236,23 +1196,6 @@
12361196
"maxReadyCapacity"
12371197
]
12381198
},
1239-
"StandbyContainerGroupPoolElasticityProfileUpdate": {
1240-
"type": "object",
1241-
"description": "Specifies the elasticity profile of the standby container group pools.",
1242-
"properties": {
1243-
"maxReadyCapacity": {
1244-
"type": "integer",
1245-
"format": "int64",
1246-
"description": "Specifies maximum number of standby container groups in the standby pool.",
1247-
"minimum": 0,
1248-
"maximum": 2000
1249-
},
1250-
"refillPolicy": {
1251-
"$ref": "#/definitions/RefillPolicy",
1252-
"description": "Specifies refill policy of the pool."
1253-
}
1254-
}
1255-
},
12561199
"StandbyContainerGroupPoolResource": {
12571200
"type": "object",
12581201
"description": "A StandbyContainerGroupPoolResource.",
@@ -1336,11 +1279,11 @@
13361279
"description": "The updatable properties of the StandbyContainerGroupPoolResource.",
13371280
"properties": {
13381281
"elasticityProfile": {
1339-
"$ref": "#/definitions/StandbyContainerGroupPoolElasticityProfileUpdate",
1282+
"$ref": "#/definitions/StandbyContainerGroupPoolElasticityProfile",
13401283
"description": "Specifies elasticity profile of standby container group pools."
13411284
},
13421285
"containerGroupProperties": {
1343-
"$ref": "#/definitions/ContainerGroupPropertiesUpdate",
1286+
"$ref": "#/definitions/ContainerGroupProperties",
13441287
"description": "Specifies container group properties of standby container group pools."
13451288
}
13461289
}
@@ -1428,26 +1371,6 @@
14281371
"maxReadyCapacity"
14291372
]
14301373
},
1431-
"StandbyVirtualMachinePoolElasticityProfileUpdate": {
1432-
"type": "object",
1433-
"description": "Details of the elasticity profile.",
1434-
"properties": {
1435-
"maxReadyCapacity": {
1436-
"type": "integer",
1437-
"format": "int64",
1438-
"description": "Specifies the maximum number of virtual machines in the standby virtual machine pool.",
1439-
"minimum": 0,
1440-
"maximum": 2000
1441-
},
1442-
"minReadyCapacity": {
1443-
"type": "integer",
1444-
"format": "int64",
1445-
"description": "Specifies the desired minimum number of virtual machines in the standby virtual machine pool. MinReadyCapacity cannot exceed MaxReadyCapacity.",
1446-
"minimum": 0,
1447-
"maximum": 2000
1448-
}
1449-
}
1450-
},
14511374
"StandbyVirtualMachinePoolResource": {
14521375
"type": "object",
14531376
"description": "A StandbyVirtualMachinePoolResource.",
@@ -1545,7 +1468,7 @@
15451468
"description": "The updatable properties of the StandbyVirtualMachinePoolResource.",
15461469
"properties": {
15471470
"elasticityProfile": {
1548-
"$ref": "#/definitions/StandbyVirtualMachinePoolElasticityProfileUpdate",
1471+
"$ref": "#/definitions/StandbyVirtualMachinePoolElasticityProfile",
15491472
"description": "Specifies the elasticity profile of the standby virtual machine pools."
15501473
},
15511474
"virtualMachineState": {
@@ -1672,7 +1595,11 @@
16721595
"properties": {
16731596
"virtualMachineResourceId": {
16741597
"type": "string",
1675-
"description": "Resource id of the virtual machine."
1598+
"format": "arm-id",
1599+
"description": "Resource id of the virtual machine.",
1600+
"x-ms-arm-id-details": {
1601+
"allowedResources": []
1602+
}
16761603
},
16771604
"provisioningState": {
16781605
"$ref": "#/definitions/ProvisioningState",

0 commit comments

Comments
 (0)