Skip to content

Commit

Permalink
Add client tsp for StandybyPool (Azure#30488)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurMa1978 authored Sep 10, 2024
1 parent 7c3c055 commit 3519c80
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 237 deletions.
58 changes: 58 additions & 0 deletions specification/standbypool/StandbyPool.Management/client.tsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import "./main.tsp";
import "@azure-tools/typespec-client-generator-core";

using Azure.ClientGenerator.Core;
using Azure.ResourceManager.CommonTypes;
using Microsoft.StandbyPool;

@@access(Operations.list, Access.internal, "csharp");

@@clientName(StandbyContainerGroupPoolResource,
"StandbyContainerGroupPool",
"csharp"
);
@@clientName(StandbyContainerGroupPoolResourceProperties,
"StandbyContainerGroupPoolProperties",
"csharp"
);
@@clientName(StandbyVirtualMachinePoolResource,
"StandbyVirtualMachinePool",
"csharp"
);
@@clientName(StandbyVirtualMachinePoolResourceProperties,
"StandbyVirtualMachinePoolProperties",
"csharp"
);
@@clientName(StandbyVirtualMachineResource, "StandbyVirtualMachine", "csharp");
@@clientName(StandbyVirtualMachineResourceProperties,
"StandbyVirtualMachineProperties",
"csharp"
);
@@clientName(VirtualMachineState, "StandbyVirtualMachineState", "csharp");
@@clientName(ContainerGroupProfile, "StandbyContainerGroupProfile", "csharp");
@@clientName(ContainerGroupProperties,
"StandbyContainerGroupProperties",
"csharp"
);
@@clientName(StandbyContainerGroupPoolRuntimeViewResource,
"StandbyContainerGroupPoolRuntimeView",
"csharp"
);
@@clientName(StandbyContainerGroupPoolRuntimeViewResourceProperties,
"StandbyContainerGroupPoolRuntimeViewProperties",
"csharp"
);
@@clientName(StandbyVirtualMachinePoolRuntimeViewResource,
"StandbyVirtualMachinePoolRuntimeView",
"csharp"
);
@@clientName(StandbyVirtualMachinePoolRuntimeViewResourceProperties,
"StandbyVirtualMachinePoolRuntimeViewProperties",
"csharp"
);
@@clientName(VirtualMachineInstanceCountSummary,
"StandbyVirtualMachineInstanceCountSummary",
"csharp"
);
@@clientName(ProvisioningState, "StandbyProvisioningState", "csharp");
@@clientName(RefillPolicy, "StandbyRefillPolicy", "csharp");
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ interface StandbyContainerGroupPools {
LroHeaders = Azure.Core.Foundations.RetryAfterHeader
>;
delete is ArmResourceDeleteWithoutOkAsync<StandbyContainerGroupPoolResource>;
@parameterVisibility
update is ArmCustomPatchSync<
StandbyContainerGroupPoolResource,
Azure.ResourceManager.Foundations.ResourceUpdateModel<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ model StandbyVirtualMachineResource
@doc("Details of the StandbyVirtualMachine.")
model StandbyVirtualMachineResourceProperties {
@doc("Resource id of the virtual machine.")
virtualMachineResourceId: string;
virtualMachineResourceId: Azure.Core.armResourceIdentifier<[]>;

@doc("The status of the last operation.")
@visibility("read")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ interface StandbyVirtualMachinePools {
LroHeaders = Azure.Core.Foundations.RetryAfterHeader
>;
delete is ArmResourceDeleteWithoutOkAsync<StandbyVirtualMachinePoolResource>;
@parameterVisibility
update is ArmCustomPatchSync<
StandbyVirtualMachinePoolResource,
Azure.ResourceManager.Foundations.ResourceUpdateModel<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,8 @@ options:
namespace: "com.azure.resourcemanager.standbypool"
service-name: "Standby Pool"
examples-directory: "{project-root}/examples"
"@azure-tools/typespec-csharp":
package-dir: "Azure.ResourceManager.StandbyPool"
flavor: azure
clear-output-folder: true
namespace: "{package-dir}"
Original file line number Diff line number Diff line change
Expand Up @@ -847,29 +847,6 @@
"id"
]
},
"ContainerGroupProfileUpdate": {
"type": "object",
"description": "Details of the ContainerGroupProfile.",
"properties": {
"id": {
"type": "string",
"format": "arm-id",
"description": "Specifies container group profile id of standby container groups.",
"x-ms-arm-id-details": {
"allowedResources": [
{
"type": "Microsoft.ContainerInstance/containerGroupProfiles"
}
]
}
},
"revision": {
"type": "integer",
"format": "int64",
"description": "Specifies revision of container group profile."
}
}
},
"ContainerGroupProperties": {
"type": "object",
"description": "Details of the ContainerGroupProperties.",
Expand All @@ -890,23 +867,6 @@
"containerGroupProfile"
]
},
"ContainerGroupPropertiesUpdate": {
"type": "object",
"description": "Details of the ContainerGroupProperties.",
"properties": {
"containerGroupProfile": {
"$ref": "#/definitions/ContainerGroupProfileUpdate",
"description": "Specifies container group profile of standby container groups."
},
"subnetIds": {
"type": "array",
"description": "Specifies subnet Ids for container group.",
"items": {
"$ref": "#/definitions/Subnet"
}
}
}
},
"ProvisioningState": {
"type": "string",
"description": "Provisioning state",
Expand Down Expand Up @@ -982,23 +942,6 @@
"maxReadyCapacity"
]
},
"StandbyContainerGroupPoolElasticityProfileUpdate": {
"type": "object",
"description": "Specifies the elasticity profile of the standby container group pools.",
"properties": {
"maxReadyCapacity": {
"type": "integer",
"format": "int64",
"description": "Specifies maximum number of standby container groups in the standby pool.",
"minimum": 0,
"maximum": 2000
},
"refillPolicy": {
"$ref": "#/definitions/RefillPolicy",
"description": "Specifies refill policy of the pool."
}
}
},
"StandbyContainerGroupPoolResource": {
"type": "object",
"description": "A StandbyContainerGroupPoolResource.",
Expand Down Expand Up @@ -1082,11 +1025,11 @@
"description": "The updatable properties of the StandbyContainerGroupPoolResource.",
"properties": {
"elasticityProfile": {
"$ref": "#/definitions/StandbyContainerGroupPoolElasticityProfileUpdate",
"$ref": "#/definitions/StandbyContainerGroupPoolElasticityProfile",
"description": "Specifies elasticity profile of standby container group pools."
},
"containerGroupProperties": {
"$ref": "#/definitions/ContainerGroupPropertiesUpdate",
"$ref": "#/definitions/ContainerGroupProperties",
"description": "Specifies container group properties of standby container group pools."
}
}
Expand All @@ -1107,19 +1050,6 @@
"maxReadyCapacity"
]
},
"StandbyVirtualMachinePoolElasticityProfileUpdate": {
"type": "object",
"description": "Details of the elasticity profile.",
"properties": {
"maxReadyCapacity": {
"type": "integer",
"format": "int64",
"description": "Specifies the maximum number of virtual machines in the standby virtual machine pool.",
"minimum": 0,
"maximum": 2000
}
}
},
"StandbyVirtualMachinePoolResource": {
"type": "object",
"description": "A StandbyVirtualMachinePoolResource.",
Expand Down Expand Up @@ -1217,7 +1147,7 @@
"description": "The updatable properties of the StandbyVirtualMachinePoolResource.",
"properties": {
"elasticityProfile": {
"$ref": "#/definitions/StandbyVirtualMachinePoolElasticityProfileUpdate",
"$ref": "#/definitions/StandbyVirtualMachinePoolElasticityProfile",
"description": "Specifies the elasticity profile of the standby virtual machine pools."
},
"virtualMachineState": {
Expand Down Expand Up @@ -1284,7 +1214,11 @@
"properties": {
"virtualMachineResourceId": {
"type": "string",
"description": "Resource id of the virtual machine."
"format": "arm-id",
"description": "Resource id of the virtual machine.",
"x-ms-arm-id-details": {
"allowedResources": []
}
},
"provisioningState": {
"$ref": "#/definitions/ProvisioningState",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1082,29 +1082,6 @@
"id"
]
},
"ContainerGroupProfileUpdate": {
"type": "object",
"description": "Details of the ContainerGroupProfile.",
"properties": {
"id": {
"type": "string",
"format": "arm-id",
"description": "Specifies container group profile id of standby container groups.",
"x-ms-arm-id-details": {
"allowedResources": [
{
"type": "Microsoft.ContainerInstance/containerGroupProfiles"
}
]
}
},
"revision": {
"type": "integer",
"format": "int64",
"description": "Specifies revision of container group profile."
}
}
},
"ContainerGroupProperties": {
"type": "object",
"description": "Details of the ContainerGroupProperties.",
Expand All @@ -1125,23 +1102,6 @@
"containerGroupProfile"
]
},
"ContainerGroupPropertiesUpdate": {
"type": "object",
"description": "Details of the ContainerGroupProperties.",
"properties": {
"containerGroupProfile": {
"$ref": "#/definitions/ContainerGroupProfileUpdate",
"description": "Specifies container group profile of standby container groups."
},
"subnetIds": {
"type": "array",
"description": "Specifies subnet Ids for container group.",
"items": {
"$ref": "#/definitions/Subnet"
}
}
}
},
"PoolResourceStateCount": {
"type": "object",
"description": "Displays the counts of pooled resources in each state, as known by the StandbyPool resource provider.",
Expand Down Expand Up @@ -1236,23 +1196,6 @@
"maxReadyCapacity"
]
},
"StandbyContainerGroupPoolElasticityProfileUpdate": {
"type": "object",
"description": "Specifies the elasticity profile of the standby container group pools.",
"properties": {
"maxReadyCapacity": {
"type": "integer",
"format": "int64",
"description": "Specifies maximum number of standby container groups in the standby pool.",
"minimum": 0,
"maximum": 2000
},
"refillPolicy": {
"$ref": "#/definitions/RefillPolicy",
"description": "Specifies refill policy of the pool."
}
}
},
"StandbyContainerGroupPoolResource": {
"type": "object",
"description": "A StandbyContainerGroupPoolResource.",
Expand Down Expand Up @@ -1336,11 +1279,11 @@
"description": "The updatable properties of the StandbyContainerGroupPoolResource.",
"properties": {
"elasticityProfile": {
"$ref": "#/definitions/StandbyContainerGroupPoolElasticityProfileUpdate",
"$ref": "#/definitions/StandbyContainerGroupPoolElasticityProfile",
"description": "Specifies elasticity profile of standby container group pools."
},
"containerGroupProperties": {
"$ref": "#/definitions/ContainerGroupPropertiesUpdate",
"$ref": "#/definitions/ContainerGroupProperties",
"description": "Specifies container group properties of standby container group pools."
}
}
Expand Down Expand Up @@ -1428,26 +1371,6 @@
"maxReadyCapacity"
]
},
"StandbyVirtualMachinePoolElasticityProfileUpdate": {
"type": "object",
"description": "Details of the elasticity profile.",
"properties": {
"maxReadyCapacity": {
"type": "integer",
"format": "int64",
"description": "Specifies the maximum number of virtual machines in the standby virtual machine pool.",
"minimum": 0,
"maximum": 2000
},
"minReadyCapacity": {
"type": "integer",
"format": "int64",
"description": "Specifies the desired minimum number of virtual machines in the standby virtual machine pool. MinReadyCapacity cannot exceed MaxReadyCapacity.",
"minimum": 0,
"maximum": 2000
}
}
},
"StandbyVirtualMachinePoolResource": {
"type": "object",
"description": "A StandbyVirtualMachinePoolResource.",
Expand Down Expand Up @@ -1545,7 +1468,7 @@
"description": "The updatable properties of the StandbyVirtualMachinePoolResource.",
"properties": {
"elasticityProfile": {
"$ref": "#/definitions/StandbyVirtualMachinePoolElasticityProfileUpdate",
"$ref": "#/definitions/StandbyVirtualMachinePoolElasticityProfile",
"description": "Specifies the elasticity profile of the standby virtual machine pools."
},
"virtualMachineState": {
Expand Down Expand Up @@ -1672,7 +1595,11 @@
"properties": {
"virtualMachineResourceId": {
"type": "string",
"description": "Resource id of the virtual machine."
"format": "arm-id",
"description": "Resource id of the virtual machine.",
"x-ms-arm-id-details": {
"allowedResources": []
}
},
"provisioningState": {
"$ref": "#/definitions/ProvisioningState",
Expand Down
Loading

0 comments on commit 3519c80

Please sign in to comment.