Skip to content

Commit 7c9a9fb

Browse files
azure-pipelines[bot]azure-powershell-botLei jin
authored
Migrate ConnectedKubernetes from generation to main (#26128)
* Move ConnectedKubernetes to main * Add changelog and suppress the signature error --------- Co-authored-by: azure-powershell-bot <[email protected]> Co-authored-by: Lei jin <[email protected]>
1 parent dc9bfed commit 7c9a9fb

File tree

187 files changed

+18477
-2414
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+18477
-2414
lines changed

src/ConnectedKubernetes/ConnectedKubernetes.Autorest/Az.ConnectedKubernetes.format.ps1xml

Lines changed: 338 additions & 28 deletions
Large diffs are not rendered by default.

src/ConnectedKubernetes/ConnectedKubernetes.Autorest/Az.ConnectedKubernetes.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
DotNetFrameworkVersion = '4.7.2'
1212
RequiredAssemblies = './bin/Az.ConnectedKubernetes.private.dll'
1313
FormatsToProcess = './Az.ConnectedKubernetes.format.ps1xml'
14-
FunctionsToExport = 'Get-AzConnectedKubernetes', 'Get-AzConnectedKubernetesUserCredential', 'New-AzConnectedKubernetes', 'Remove-AzConnectedKubernetes', 'Update-AzConnectedKubernetes', '*'
14+
FunctionsToExport = 'Get-AzConnectedKubernetes', 'Get-AzConnectedKubernetesUserCredential', 'New-AzConnectedKubernetes', 'Remove-AzConnectedKubernetes', 'Set-AzConnectedKubernetes', 'Update-AzConnectedKubernetes', '*'
1515
AliasesToExport = '*'
1616
PrivateData = @{
1717
PSData = @{

src/ConnectedKubernetes/ConnectedKubernetes.Autorest/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ In this directory, run AutoRest:
4444
> see https://aka.ms/autorest
4545
4646
``` yaml
47-
commit: ac6324d13863e8157f4b392ef0ceef1e86eea935
47+
commit: b67274cc1916170502f17ffabac0b46c4620918e
4848
require:
4949
- $(this-folder)/../../readme.azure.noprofile.md
5050
input-file:
51-
- $(repo)/specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2022-10-01-preview/connectedClusters.json
51+
- $(repo)/specification/hybridkubernetes/resource-manager/Microsoft.Kubernetes/preview/2024-07-15-preview/connectedClusters.json
5252

5353
title: ConnectedKubernetes
5454
module-version: 0.1.0
@@ -82,8 +82,7 @@ directive:
8282
parameter-name: Property
8383
hide: true
8484
- where:
85-
verb: New|Update|Remove
85+
verb: New|Update|Remove|Set
8686
subject-prefix: ConnectedKubernetes
8787
hide: true
88-
8988
```

src/ConnectedKubernetes/ConnectedKubernetes.Autorest/UX/Microsoft.Kubernetes/connectedClusters.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "connectedClusters",
3-
"apiVersion": "2022-10-01-preview",
3+
"apiVersion": "2024-07-15-preview",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.connectedkubernetes"
66
},

src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/New-AzConnectedKubernetes.ps1

Lines changed: 374 additions & 178 deletions
Large diffs are not rendered by default.

src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/Set-AzConnectedKubernetes.ps1

Lines changed: 786 additions & 0 deletions
Large diffs are not rendered by default.

src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/Update-AzConnectedKubernetes.ps1

Lines changed: 110 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Get-AzConnectedKubernetes -ClusterName azps_test_cluster -ResourceGroupName azps
2727
.Inputs
2828
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.IConnectedKubernetesIdentity
2929
.Outputs
30-
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20221001Preview.IConnectedCluster
30+
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20240715Preview.IConnectedCluster
3131
.Notes
3232
COMPLEX PARAMETER PROPERTIES
3333
@@ -42,115 +42,115 @@ INPUTOBJECT <IConnectedKubernetesIdentity>: Identity Parameter
4242
https://learn.microsoft.com/powershell/module/az.connectedkubernetes/update-azconnectedkubernetes
4343
#>
4444
function Update-AzConnectedKubernetes {
45-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20221001Preview.IConnectedCluster])]
46-
[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
47-
param(
48-
[Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
49-
[Alias('Name')]
50-
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Path')]
51-
[System.String]
52-
# The name of the Kubernetes cluster on which get is called.
53-
${ClusterName},
54-
55-
[Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
56-
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Path')]
57-
[System.String]
58-
# The name of the resource group.
59-
# The name is case insensitive.
60-
${ResourceGroupName},
61-
62-
[Parameter(ParameterSetName='UpdateExpanded')]
63-
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Path')]
64-
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
65-
[System.String]
66-
# The ID of the target subscription.
67-
${SubscriptionId},
68-
69-
[Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)]
70-
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Path')]
71-
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.IConnectedKubernetesIdentity]
72-
# Identity Parameter
73-
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
74-
${InputObject},
75-
76-
[Parameter()]
77-
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Support.AzureHybridBenefit])]
78-
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Body')]
79-
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Support.AzureHybridBenefit]
80-
# Indicates whether Azure Hybrid Benefit is opted in
81-
${AzureHybridBenefit},
82-
83-
[Parameter()]
84-
[System.Management.Automation.SwitchParameter]
85-
# Accept EULA of ConnectedKubernetes, legal term will pop up without this parameter provided
86-
${AcceptEULA},
87-
88-
[Parameter()]
89-
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Body')]
90-
[System.String]
91-
# Represents the distribution of the connected cluster
92-
${Distribution},
93-
94-
[Parameter()]
95-
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Body')]
96-
[System.String]
97-
# Represents the Kubernetes distribution version on this connected cluster.
98-
${DistributionVersion},
99-
100-
[Parameter()]
101-
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Body')]
102-
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20221001Preview.IConnectedClusterPatchTags]))]
103-
[System.Collections.Hashtable]
104-
# Resource tags.
105-
${Tag},
106-
107-
[Parameter()]
108-
[Alias('AzureRMContext', 'AzureCredential')]
109-
[ValidateNotNull()]
110-
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Azure')]
111-
[System.Management.Automation.PSObject]
112-
# The credentials, account, tenant, and subscription used for communication with Azure.
113-
${DefaultProfile},
114-
115-
[Parameter(DontShow)]
116-
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Runtime')]
117-
[System.Management.Automation.SwitchParameter]
118-
# Wait for .NET debugger to attach
119-
${Break},
120-
121-
[Parameter(DontShow)]
122-
[ValidateNotNull()]
123-
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Runtime')]
124-
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.SendAsyncStep[]]
125-
# SendAsync Pipeline Steps to be appended to the front of the pipeline
126-
${HttpPipelineAppend},
127-
128-
[Parameter(DontShow)]
129-
[ValidateNotNull()]
130-
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Runtime')]
131-
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.SendAsyncStep[]]
132-
# SendAsync Pipeline Steps to be prepended to the front of the pipeline
133-
${HttpPipelinePrepend},
134-
135-
[Parameter(DontShow)]
136-
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Runtime')]
137-
[System.Uri]
138-
# The URI for the proxy server to use
139-
${Proxy},
140-
141-
[Parameter(DontShow)]
142-
[ValidateNotNull()]
143-
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Runtime')]
144-
[System.Management.Automation.PSCredential]
145-
# Credentials for a proxy server to use for the remote call
146-
${ProxyCredential},
147-
148-
[Parameter(DontShow)]
149-
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Runtime')]
150-
[System.Management.Automation.SwitchParameter]
151-
# Use the default credentials for the proxy
152-
${ProxyUseDefaultCredentials}
153-
)
45+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20240715Preview.IConnectedCluster])]
46+
[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
47+
param(
48+
[Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
49+
[Alias('Name')]
50+
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Path')]
51+
[System.String]
52+
# The name of the Kubernetes cluster on which get is called.
53+
${ClusterName},
54+
55+
[Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
56+
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Path')]
57+
[System.String]
58+
# The name of the resource group.
59+
# The name is case insensitive.
60+
${ResourceGroupName},
61+
62+
[Parameter(ParameterSetName='UpdateExpanded')]
63+
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Path')]
64+
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
65+
[System.String]
66+
# The ID of the target subscription.
67+
${SubscriptionId},
68+
69+
[Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)]
70+
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Path')]
71+
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.IConnectedKubernetesIdentity]
72+
# Identity Parameter
73+
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
74+
${InputObject},
75+
76+
[Parameter()]
77+
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Support.AzureHybridBenefit])]
78+
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Body')]
79+
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Support.AzureHybridBenefit]
80+
# Indicates whether Azure Hybrid Benefit is opted in
81+
${AzureHybridBenefit},
82+
83+
[Parameter()]
84+
[System.Management.Automation.SwitchParameter]
85+
# Accept EULA of ConnectedKubernetes, legal term will pop up without this parameter provided
86+
${AcceptEULA},
87+
88+
[Parameter()]
89+
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Body')]
90+
[System.String]
91+
# Represents the distribution of the connected cluster
92+
${Distribution},
93+
94+
[Parameter()]
95+
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Body')]
96+
[System.String]
97+
# Represents the Kubernetes distribution version on this connected cluster.
98+
${DistributionVersion},
99+
100+
[Parameter()]
101+
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Body')]
102+
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20240715Preview.IConnectedClusterPatchTags]))]
103+
[System.Collections.Hashtable]
104+
# Resource tags.
105+
${Tag},
106+
107+
[Parameter()]
108+
[Alias('AzureRMContext', 'AzureCredential')]
109+
[ValidateNotNull()]
110+
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Azure')]
111+
[System.Management.Automation.PSObject]
112+
# The credentials, account, tenant, and subscription used for communication with Azure.
113+
${DefaultProfile},
114+
115+
[Parameter(DontShow)]
116+
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Runtime')]
117+
[System.Management.Automation.SwitchParameter]
118+
# Wait for .NET debugger to attach
119+
${Break},
120+
121+
[Parameter(DontShow)]
122+
[ValidateNotNull()]
123+
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Runtime')]
124+
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.SendAsyncStep[]]
125+
# SendAsync Pipeline Steps to be appended to the front of the pipeline
126+
${HttpPipelineAppend},
127+
128+
[Parameter(DontShow)]
129+
[ValidateNotNull()]
130+
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Runtime')]
131+
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.SendAsyncStep[]]
132+
# SendAsync Pipeline Steps to be prepended to the front of the pipeline
133+
${HttpPipelinePrepend},
134+
135+
[Parameter(DontShow)]
136+
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Runtime')]
137+
[System.Uri]
138+
# The URI for the proxy server to use
139+
${Proxy},
140+
141+
[Parameter(DontShow)]
142+
[ValidateNotNull()]
143+
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Runtime')]
144+
[System.Management.Automation.PSCredential]
145+
# Credentials for a proxy server to use for the remote call
146+
${ProxyCredential},
147+
148+
[Parameter(DontShow)]
149+
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Runtime')]
150+
[System.Management.Automation.SwitchParameter]
151+
# Use the default credentials for the proxy
152+
${ProxyUseDefaultCredentials}
153+
)
154154

155155
process {
156156
if($AzureHybridBenefit){
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseSingularNouns', '',
2+
Justification = 'MetaData is a recognised term', Scope = 'Function', Target = 'Get-AzCloudMetaData')]
3+
param()
4+
5+
function Get-AZCloudMetadataResourceId {
6+
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.DoNotExport()]
7+
param (
8+
[Parameter(Mandatory = $true)]
9+
[PSCustomObject]$cloudMetadata
10+
)
11+
12+
# Search the $armMetadata hash for the entry where the "name" parameter matches
13+
# $cloud and then find the login endpoint, from which we can discern the
14+
# appropriate "cloud based domain ending".
15+
Write-Debug -Message "cloudMetaData in: $($cloudMetaData | ConvertTo-Json -Depth 10)."
16+
return $cloudMetadata.ResourceManagerUrl
17+
}
18+
19+
Function Get-AzCloudMetadata {
20+
# The current cloud in use is set by the user so query it and then we can use
21+
# it to index into the ARM Metadata.
22+
$context = $null
23+
try {
24+
$context = Get-AzContext
25+
}
26+
catch {
27+
throw "Failed to get the current Azure context. Error: $_"
28+
}
29+
$cloudName = $context.Environment.Name
30+
31+
try {
32+
# $Response = Invoke-RestMethod -Uri $MetadataEndpoint -Method Get -StatusCodeVariable StatusCode
33+
$cloud = Get-AzureEnvironment -Name $cloudName
34+
}
35+
catch {
36+
Write-Error "Failed to request ARM metadata. Error: $_"
37+
}
38+
Write-Debug -Message "cloudMetaData out: $($cloud | ConvertTo-Json -Depth 10)."
39+
40+
return $cloud
41+
}

0 commit comments

Comments
 (0)