-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[TypeSpec Conversion] AKS #38641
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
Merged
Merged
[TypeSpec Conversion] AKS #38641
Changes from 6 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
d320825
convert to TypeSpec
d45f488
fix model validation
a0db9e4
Merge branch 'main' into aks-conversion
v-jiaodi a2d1527
format
c8399b7
update
v-jiaodi 3bca479
update union name
v-jiaodi 6db3535
java config
XiaofeiCao 49c01c8
Add Python client names for ContainerService
ChenxiJiang333 43e373d
Merge branch 'main' into aks-conversion
v-jiaodi 93992dc
Enable compatibility-lro in tspconfig.yaml
v-jiaodi da22392
Merge branch 'main' into aks-conversion
pshao25 f0014e7
Fix tags
048eda8
review fix
84f1d4d
Merge branch 'main' into aks-conversion
pshao25 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
192 changes: 192 additions & 0 deletions
192
specification/containerservice/resource-manager/Microsoft.ContainerService/aks/AgentPool.tsp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,192 @@ | ||
| import "@azure-tools/typespec-azure-core"; | ||
| import "@azure-tools/typespec-azure-resource-manager"; | ||
| import "@typespec/rest"; | ||
| import "./models.tsp"; | ||
| import "./ManagedCluster.tsp"; | ||
|
|
||
| using TypeSpec.Rest; | ||
| using Azure.ResourceManager; | ||
| using TypeSpec.Http; | ||
| using Versioning; | ||
|
|
||
| namespace Microsoft.ContainerService; | ||
| /** | ||
| * Agent Pool. | ||
| */ | ||
| @parentResource(ManagedCluster) | ||
| model AgentPool | ||
| is Azure.ResourceManager.ProxyResource<ManagedClusterAgentPoolProfileProperties> { | ||
| ...ResourceNameParameter< | ||
| Resource = AgentPool, | ||
| KeyName = "agentPoolName", | ||
| SegmentName = "agentPools", | ||
| NamePattern = "^[a-z][a-z0-9]{0,11}$" | ||
| >; | ||
| } | ||
|
|
||
| @armResourceOperations(#{ allowStaticRoutes: true }) | ||
| interface AgentPools { | ||
| /** | ||
| * Gets the specified managed cluster agent pool. | ||
| */ | ||
| get is ArmResourceRead<AgentPool>; | ||
|
|
||
| /** | ||
| * Creates or updates an agent pool in the specified managed cluster. | ||
| */ | ||
| createOrUpdate is ArmResourceCreateOrReplaceAsync< | ||
| AgentPool, | ||
| Parameters = { | ||
| /** | ||
| * The request should only proceed if an entity matches this string. | ||
| */ | ||
| @header | ||
| ifMatch?: string; | ||
|
|
||
| /** | ||
| * The request should only proceed if no entity matches this string. | ||
| */ | ||
| @header | ||
| ifNoneMatch?: string; | ||
| }, | ||
| LroHeaders = ArmLroLocationHeader<FinalResult = AgentPool> & | ||
| Azure.Core.Foundations.RetryAfterHeader | ||
| >; | ||
|
|
||
| /** | ||
| * Deletes an agent pool in the specified managed cluster. | ||
| */ | ||
| delete is ArmResourceDeleteWithoutOkAsync< | ||
| AgentPool, | ||
| Parameters = { | ||
| /** | ||
| * ignore-pod-disruption-budget=true to delete those pods on a node without considering Pod Disruption Budget | ||
| */ | ||
| #suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| @query("ignore-pod-disruption-budget") | ||
| `ignore-pod-disruption-budget`?: boolean; | ||
|
|
||
| /** | ||
| * The request should only proceed if an entity matches this string. | ||
| */ | ||
| @header | ||
| ifMatch?: string; | ||
| } | ||
| >; | ||
|
|
||
| /** | ||
| * Gets a list of agent pools in the specified managed cluster. | ||
| */ | ||
| list is ArmResourceListByParent<AgentPool>; | ||
|
|
||
| /** | ||
| * Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation completes before cancellation can take place, a 409 error code is returned. | ||
| */ | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/arm-post-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| @action("abort") | ||
| @summary("Aborts last operation running on agent pool.") | ||
| abortLatestOperation is ArmResourceActionAsync< | ||
| AgentPool, | ||
| void, | ||
| NoContentResponse, | ||
| LroHeaders = ArmCombinedLroHeaders<FinalResult = void> & | ||
| Azure.Core.Foundations.RetryAfterHeader | ||
| >; | ||
|
|
||
| /** | ||
| * Completes the upgrade operation for the specified agent pool. | ||
| */ | ||
| @added(Versions.v2025_10_02_preview) | ||
| @summary("Completes the upgrade of an agent pool.") | ||
| completeUpgrade is ArmResourceActionAsyncBase< | ||
| AgentPool, | ||
| void, | ||
| ArmAcceptedLroResponse<LroHeaders = ArmCombinedLroHeaders<FinalResult = void> & | ||
| Azure.Core.Foundations.RetryAfterHeader>, | ||
| BaseParameters = Azure.ResourceManager.Foundations.DefaultBaseParameters<AgentPool> | ||
| >; | ||
|
|
||
| /** | ||
| * Deletes specific machines in an agent pool. | ||
| */ | ||
| deleteMachines is ArmResourceActionAsyncBase< | ||
| AgentPool, | ||
| AgentPoolDeleteMachinesParameter, | ||
| ArmAcceptedLroResponse, | ||
| BaseParameters = Azure.ResourceManager.Foundations.DefaultBaseParameters<AgentPool> | ||
| >; | ||
|
|
||
| /** | ||
| * Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade | ||
| */ | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/lro-location-header" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| @summary("Upgrades the node image version of an agent pool to the latest.") | ||
| upgradeNodeImageVersion is ArmResourceActionAsyncBase< | ||
| AgentPool, | ||
| void, | ||
| { | ||
| ...AcceptedResponse; | ||
| ...ArmAsyncOperationHeader<FinalResult = void>; | ||
| ...Azure.Core.Foundations.RetryAfterHeader; | ||
|
|
||
| @body | ||
| body: AgentPool; | ||
| } | OkResponse, | ||
| Foundations.DefaultBaseParameters<AgentPool> | ||
| >; | ||
|
|
||
| /** | ||
| * Get the status of a specific operation in the specified agent pool. | ||
| */ | ||
| @get | ||
| @route("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/operations/{operationId}") | ||
| @added(Versions.v2025_10_02_preview) | ||
| getByAgentPool is AgentPoolsOps.ActionSync< | ||
| AgentPool, | ||
| void, | ||
| ArmResponse<Azure.ResourceManager.CommonTypes.OperationStatusResult>, | ||
| Parameters = { | ||
| /** | ||
| * The ID of an ongoing async operation. | ||
| */ | ||
| @minLength(1) | ||
| @path | ||
| operationId: string; | ||
| } | ||
| >; | ||
| } | ||
|
|
||
| #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator" | ||
| interface AgentPoolsOps | ||
| extends Azure.ResourceManager.Legacy.RoutedOperations< | ||
| { | ||
| ...ApiVersionParameter, | ||
| ...SubscriptionIdParameter, | ||
| ...ResourceGroupParameter, | ||
| ...ParentKeysOf<AgentPool>, | ||
| }, | ||
| { | ||
| /** | ||
| * The name of the agent pool. | ||
| */ | ||
| @path | ||
| @pattern("^[a-z][a-z0-9]{0,11}$") | ||
| @segment("agentPools") | ||
| @maxLength(12) | ||
| @minLength(1) | ||
| agentPoolName: string, | ||
| }, | ||
| ErrorResponse, | ||
| #{ useStaticRoute: true } | ||
| > {} | ||
|
|
||
| @@maxLength(AgentPool.name, 12); | ||
| @@minLength(AgentPool.name, 1); | ||
| @@doc(AgentPool.name, "The name of the agent pool."); | ||
| @@doc(AgentPool.properties, "Properties of an agent pool."); | ||
| @@doc(AgentPools.createOrUpdate::parameters.resource, | ||
| "The agent pool to create or update." | ||
| ); | ||
| @@doc(AgentPools.deleteMachines::parameters.body, | ||
| "A list of machines from the agent pool to be deleted." | ||
| ); |
41 changes: 41 additions & 0 deletions
41
...tainerservice/resource-manager/Microsoft.ContainerService/aks/AgentPoolUpgradeProfile.tsp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| import "@azure-tools/typespec-azure-core"; | ||
| import "@azure-tools/typespec-azure-resource-manager"; | ||
| import "@typespec/rest"; | ||
| import "./models.tsp"; | ||
| import "./AgentPool.tsp"; | ||
|
|
||
| using TypeSpec.Rest; | ||
| using Azure.ResourceManager; | ||
| using TypeSpec.Http; | ||
|
|
||
| namespace Microsoft.ContainerService; | ||
| /** | ||
| * The list of available upgrades for an agent pool. | ||
| */ | ||
| @singleton("default") | ||
| @parentResource(AgentPool) | ||
| model AgentPoolUpgradeProfile | ||
| is Azure.ResourceManager.ProxyResource< | ||
| AgentPoolUpgradeProfileProperties, | ||
| false | ||
| > { | ||
| ...ResourceNameParameter< | ||
| Resource = AgentPoolUpgradeProfile, | ||
| KeyName = "upgradeProfile", | ||
| SegmentName = "upgradeProfiles", | ||
| NamePattern = "" | ||
| >; | ||
| } | ||
|
|
||
| @armResourceOperations | ||
| interface AgentPoolUpgradeProfiles { | ||
| /** | ||
| * Gets the upgrade profile for an agent pool. | ||
| */ | ||
| getUpgradeProfile is ArmResourceRead<AgentPoolUpgradeProfile>; | ||
| } | ||
|
|
||
| @@doc(AgentPoolUpgradeProfile.name, ""); | ||
| @@doc(AgentPoolUpgradeProfile.properties, | ||
| "The properties of the agent pool upgrade profile." | ||
| ); |
56 changes: 56 additions & 0 deletions
56
...nerservice/resource-manager/Microsoft.ContainerService/aks/GuardrailsAvailableVersion.tsp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| import "@azure-tools/typespec-azure-core"; | ||
| import "@azure-tools/typespec-azure-resource-manager"; | ||
| import "@typespec/rest"; | ||
| import "./models.tsp"; | ||
|
|
||
| using TypeSpec.Rest; | ||
| using Azure.ResourceManager; | ||
| using TypeSpec.Http; | ||
| using Versioning; | ||
|
|
||
| namespace Microsoft.ContainerService; | ||
| /** | ||
| * Available Guardrails Version | ||
| */ | ||
| @added(Versions.v2025_10_02_preview) | ||
| @parentResource(SubscriptionLocationResource) | ||
| model GuardrailsAvailableVersion | ||
| is Azure.ResourceManager.ProxyResource< | ||
| GuardrailsAvailableVersionsProperties, | ||
| false | ||
| > { | ||
| ...ResourceNameParameter< | ||
| Resource = GuardrailsAvailableVersion, | ||
| KeyName = "version", | ||
| SegmentName = "guardrailsVersions", | ||
| NamePattern = "" | ||
| >; | ||
| } | ||
|
|
||
| @armResourceOperations | ||
| @added(Versions.v2025_10_02_preview) | ||
| interface GuardrailsAvailableVersions { | ||
| /** | ||
| * Contains Guardrails version along with its support info and whether it is a default version. | ||
| */ | ||
| getGuardrailsVersions is ArmResourceRead< | ||
| GuardrailsAvailableVersion, | ||
| BaseParameters = Azure.ResourceManager.Foundations.SubscriptionBaseParameters | ||
| >; | ||
|
|
||
| /** | ||
| * Contains list of Guardrails version along with its support info and whether it is a default version. | ||
| */ | ||
| listGuardrailsVersions is ArmResourceListByParent< | ||
| GuardrailsAvailableVersion, | ||
| BaseParameters = Azure.ResourceManager.Foundations.SubscriptionBaseParameters, | ||
| Response = ArmResponse<GuardrailsAvailableVersionsList> | ||
| >; | ||
| } | ||
|
|
||
| @@maxLength(GuardrailsAvailableVersion.name, 24); | ||
| @@minLength(GuardrailsAvailableVersion.name, 1); | ||
| @@doc(GuardrailsAvailableVersion.name, "Safeguards version"); | ||
| @@doc(GuardrailsAvailableVersion.properties, | ||
| "Whether the version is default or not and support info." | ||
| ); | ||
69 changes: 69 additions & 0 deletions
69
...tion/containerservice/resource-manager/Microsoft.ContainerService/aks/IdentityBinding.tsp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| import "@azure-tools/typespec-azure-core"; | ||
| import "@azure-tools/typespec-azure-resource-manager"; | ||
| import "@typespec/rest"; | ||
| import "./models.tsp"; | ||
| import "./ManagedCluster.tsp"; | ||
|
|
||
| using TypeSpec.Rest; | ||
| using Azure.ResourceManager; | ||
| using TypeSpec.Http; | ||
| using Versioning; | ||
|
|
||
| namespace Microsoft.ContainerService; | ||
| /** | ||
| * The IdentityBinding resource. | ||
| */ | ||
| @parentResource(ManagedCluster) | ||
| @added(Versions.v2025_10_02_preview) | ||
| model IdentityBinding | ||
| is Azure.ResourceManager.ProxyResource<IdentityBindingProperties> { | ||
| ...ResourceNameParameter< | ||
| Resource = IdentityBinding, | ||
| KeyName = "identityBindingName", | ||
| SegmentName = "identityBindings", | ||
| NamePattern = "^[a-z][a-z0-9]{0,63}$" | ||
| >; | ||
| ...Azure.ResourceManager.EntityTagProperty; | ||
| } | ||
|
|
||
| @armResourceOperations | ||
| @added(Versions.v2025_10_02_preview) | ||
| interface IdentityBindings { | ||
| /** | ||
| * Gets the specified Identity Binding. | ||
| */ | ||
| get is ArmResourceRead<IdentityBinding>; | ||
|
|
||
| /** | ||
| * Creates or updates an identity binding in the specified managed cluster. | ||
| */ | ||
| createOrUpdate is ArmResourceCreateOrReplaceAsync< | ||
| IdentityBinding, | ||
| LroHeaders = ArmCombinedLroHeaders<FinalResult = IdentityBinding> & | ||
| Azure.Core.Foundations.RetryAfterHeader | ||
| >; | ||
|
|
||
| /** | ||
| * Deletes an identity binding in the specified managed cluster. | ||
| */ | ||
| delete is ArmResourceDeleteWithoutOkAsync< | ||
| IdentityBinding, | ||
| LroHeaders = ArmCombinedLroHeaders<FinalResult = void> & | ||
| Azure.Core.Foundations.RetryAfterHeader | ||
| >; | ||
|
|
||
| /** | ||
| * Gets a list of identity bindings in the specified managed cluster. | ||
| */ | ||
| listByManagedCluster is ArmResourceListByParent<IdentityBinding>; | ||
| } | ||
|
|
||
| @@maxLength(IdentityBinding.name, 63); | ||
| @@minLength(IdentityBinding.name, 1); | ||
| @@doc(IdentityBinding.name, "The name of the identity binding."); | ||
| @@doc(IdentityBinding.properties, | ||
| "The resource-specific properties for this resource." | ||
| ); | ||
| @@doc(IdentityBindings.createOrUpdate::parameters.resource, | ||
| "The identity binding to create or update." | ||
| ); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.