Skip to content

Commit c30ba0d

Browse files
committed
Generate Container Service cmdlets
1 parent c2f8716 commit c30ba0d

12 files changed

+3110
-188
lines changed

src/ResourceManager/Compute/Commands.Compute/Generated/ComputeAutomationBaseCmdlet.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ protected static object[] ConvertFromArgumentsToObjects(object[] arguments)
7373
return objects;
7474
}
7575

76+
public IContainerServiceOperations ContainerServiceClient
77+
{
78+
get
79+
{
80+
return ComputeClient.ComputeManagementClient.ContainerService;
81+
}
82+
}
83+
7684
public IVirtualMachineScaleSetsOperations VirtualMachineScaleSetsClient
7785
{
7886
get
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
//
2+
// Copyright (c) Microsoft and contributors. All rights reserved.
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
//
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
//
16+
17+
// Warning: This code was generated by a tool.
18+
//
19+
// Changes to this file may cause incorrect behavior and will be lost if the
20+
// code is regenerated.
21+
22+
using Microsoft.Azure.Management.Compute.Models;
23+
using System;
24+
using System.Collections;
25+
using System.Collections.Generic;
26+
using System.Linq;
27+
using System.Management.Automation;
28+
29+
namespace Microsoft.Azure.Commands.Compute.Automation
30+
{
31+
[Cmdlet("Add", "AzureRmContainerServiceAgentPoolProfile")]
32+
[OutputType(typeof(ContainerService))]
33+
public class AddAzureRmContainerServiceAgentPoolProfileCommand : Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet
34+
{
35+
[Parameter(
36+
Mandatory = true,
37+
Position = 0,
38+
ValueFromPipeline = true,
39+
ValueFromPipelineByPropertyName = true)]
40+
public ContainerService ContainerService { get; set; }
41+
42+
[Parameter(
43+
Mandatory = false,
44+
Position = 1,
45+
ValueFromPipelineByPropertyName = true)]
46+
public string Name { get; set; }
47+
48+
[Parameter(
49+
Mandatory = false,
50+
Position = 2,
51+
ValueFromPipelineByPropertyName = true)]
52+
public int? Count { get; set; }
53+
54+
[Parameter(
55+
Mandatory = false,
56+
Position = 3,
57+
ValueFromPipelineByPropertyName = true)]
58+
public string VmSize { get; set; }
59+
60+
[Parameter(
61+
Mandatory = false,
62+
Position = 4,
63+
ValueFromPipelineByPropertyName = true)]
64+
public string DnsPrefix { get; set; }
65+
66+
protected override void ProcessRecord()
67+
{
68+
// AgentPoolProfiles
69+
if (this.ContainerService.AgentPoolProfiles == null)
70+
{
71+
this.ContainerService.AgentPoolProfiles = new List<Microsoft.Azure.Management.Compute.Models.ContainerServiceAgentPoolProfile>();
72+
}
73+
74+
var vAgentPoolProfiles = new Microsoft.Azure.Management.Compute.Models.ContainerServiceAgentPoolProfile();
75+
76+
vAgentPoolProfiles.Name = this.Name;
77+
vAgentPoolProfiles.Count = this.Count;
78+
vAgentPoolProfiles.VmSize = this.VmSize;
79+
vAgentPoolProfiles.DnsPrefix = this.DnsPrefix;
80+
this.ContainerService.AgentPoolProfiles.Add(vAgentPoolProfiles);
81+
WriteObject(this.ContainerService);
82+
}
83+
}
84+
}
85+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
//
2+
// Copyright (c) Microsoft and contributors. All rights reserved.
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
//
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
//
16+
17+
// Warning: This code was generated by a tool.
18+
//
19+
// Changes to this file may cause incorrect behavior and will be lost if the
20+
// code is regenerated.
21+
22+
using Microsoft.Azure.Management.Compute.Models;
23+
using System;
24+
using System.Collections;
25+
using System.Collections.Generic;
26+
using System.Linq;
27+
using System.Management.Automation;
28+
29+
namespace Microsoft.Azure.Commands.Compute.Automation
30+
{
31+
[Cmdlet("New", "AzureRmContainerServiceConfig")]
32+
[OutputType(typeof(ContainerService))]
33+
public class NewAzureRmContainerServiceConfigCommand : Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet
34+
{
35+
[Parameter(
36+
Mandatory = false,
37+
Position = 0,
38+
ValueFromPipelineByPropertyName = true)]
39+
public string Location { get; set; }
40+
41+
[Parameter(
42+
Mandatory = false,
43+
Position = 1,
44+
ValueFromPipelineByPropertyName = true)]
45+
public Hashtable Tag { get; set; }
46+
47+
[Parameter(
48+
Mandatory = false,
49+
Position = 2,
50+
ValueFromPipelineByPropertyName = true)]
51+
public ContainerServiceOchestratorTypes? OrchestratorProfileOrchestratorType { get; set; }
52+
53+
[Parameter(
54+
Mandatory = false,
55+
Position = 3,
56+
ValueFromPipelineByPropertyName = true)]
57+
public int? MasterProfileCount { get; set; }
58+
59+
[Parameter(
60+
Mandatory = false,
61+
Position = 4,
62+
ValueFromPipelineByPropertyName = true)]
63+
public string MasterProfileDnsPrefix { get; set; }
64+
65+
[Parameter(
66+
Mandatory = false,
67+
Position = 5,
68+
ValueFromPipelineByPropertyName = true)]
69+
public ContainerServiceAgentPoolProfile [] AgentPoolProfile { get; set; }
70+
71+
[Parameter(
72+
Mandatory = false,
73+
Position = 6,
74+
ValueFromPipelineByPropertyName = true)]
75+
public string WindowsProfileAdminUsername { get; set; }
76+
77+
[Parameter(
78+
Mandatory = false,
79+
Position = 7,
80+
ValueFromPipelineByPropertyName = true)]
81+
public string WindowsProfileAdminPassword { get; set; }
82+
83+
[Parameter(
84+
Mandatory = false,
85+
Position = 8,
86+
ValueFromPipelineByPropertyName = true)]
87+
public string AdminUsername { get; set; }
88+
89+
[Parameter(
90+
Mandatory = false,
91+
Position = 9,
92+
ValueFromPipelineByPropertyName = true)]
93+
public string [] Ssh { get; set; }
94+
95+
[Parameter(
96+
Mandatory = false,
97+
Position = 10,
98+
ValueFromPipelineByPropertyName = true)]
99+
public bool? VmDiagnosticsEnabled { get; set; }
100+
101+
protected override void ProcessRecord()
102+
{
103+
// OrchestratorProfile
104+
Microsoft.Azure.Management.Compute.Models.ContainerServiceOrchestratorProfile vOrchestratorProfile = null;
105+
106+
// MasterProfile
107+
Microsoft.Azure.Management.Compute.Models.ContainerServiceMasterProfile vMasterProfile = null;
108+
109+
// WindowsProfile
110+
Microsoft.Azure.Management.Compute.Models.ContainerServiceWindowsProfile vWindowsProfile = null;
111+
112+
// LinuxProfile
113+
Microsoft.Azure.Management.Compute.Models.ContainerServiceLinuxProfile vLinuxProfile = null;
114+
115+
// DiagnosticsProfile
116+
Microsoft.Azure.Management.Compute.Models.ContainerServiceDiagnosticsProfile vDiagnosticsProfile = null;
117+
118+
if (this.OrchestratorProfileOrchestratorType != null)
119+
{
120+
if (vOrchestratorProfile == null)
121+
{
122+
vOrchestratorProfile = new Microsoft.Azure.Management.Compute.Models.ContainerServiceOrchestratorProfile();
123+
}
124+
vOrchestratorProfile.OrchestratorType = this.OrchestratorProfileOrchestratorType;
125+
}
126+
127+
if (this.MasterProfileCount != null)
128+
{
129+
if (vMasterProfile == null)
130+
{
131+
vMasterProfile = new Microsoft.Azure.Management.Compute.Models.ContainerServiceMasterProfile();
132+
}
133+
vMasterProfile.Count = this.MasterProfileCount;
134+
}
135+
136+
if (this.MasterProfileDnsPrefix != null)
137+
{
138+
if (vMasterProfile == null)
139+
{
140+
vMasterProfile = new Microsoft.Azure.Management.Compute.Models.ContainerServiceMasterProfile();
141+
}
142+
vMasterProfile.DnsPrefix = this.MasterProfileDnsPrefix;
143+
}
144+
145+
if (this.WindowsProfileAdminUsername != null)
146+
{
147+
if (vWindowsProfile == null)
148+
{
149+
vWindowsProfile = new Microsoft.Azure.Management.Compute.Models.ContainerServiceWindowsProfile();
150+
}
151+
vWindowsProfile.AdminUsername = this.WindowsProfileAdminUsername;
152+
}
153+
154+
if (this.WindowsProfileAdminPassword != null)
155+
{
156+
if (vWindowsProfile == null)
157+
{
158+
vWindowsProfile = new Microsoft.Azure.Management.Compute.Models.ContainerServiceWindowsProfile();
159+
}
160+
vWindowsProfile.AdminPassword = this.WindowsProfileAdminPassword;
161+
}
162+
163+
if (this.AdminUsername != null)
164+
{
165+
if (vLinuxProfile == null)
166+
{
167+
vLinuxProfile = new Microsoft.Azure.Management.Compute.Models.ContainerServiceLinuxProfile();
168+
}
169+
vLinuxProfile.AdminUsername = this.AdminUsername;
170+
}
171+
172+
173+
if (this.Ssh != null)
174+
{
175+
if (vLinuxProfile == null)
176+
{
177+
vLinuxProfile = new Microsoft.Azure.Management.Compute.Models.ContainerServiceLinuxProfile();
178+
}
179+
if (vLinuxProfile.Ssh == null)
180+
{
181+
vLinuxProfile.Ssh = new Microsoft.Azure.Management.Compute.Models.ContainerServiceSshConfiguration();
182+
}
183+
if (vLinuxProfile.Ssh.PublicKeys == null)
184+
{
185+
vLinuxProfile.Ssh.PublicKeys = new List<Microsoft.Azure.Management.Compute.Models.ContainerServiceSshPublicKey>();
186+
}
187+
foreach (var element in this.Ssh)
188+
{
189+
var vPublicKeys = new Microsoft.Azure.Management.Compute.Models.ContainerServiceSshPublicKey();
190+
vPublicKeys.KeyData = element;
191+
vLinuxProfile.Ssh.PublicKeys.Add(vPublicKeys);
192+
}
193+
}
194+
195+
if (this.VmDiagnosticsEnabled != null)
196+
{
197+
if (vDiagnosticsProfile == null)
198+
{
199+
vDiagnosticsProfile = new Microsoft.Azure.Management.Compute.Models.ContainerServiceDiagnosticsProfile();
200+
}
201+
if (vDiagnosticsProfile.VmDiagnostics == null)
202+
{
203+
vDiagnosticsProfile.VmDiagnostics = new Microsoft.Azure.Management.Compute.Models.ContainerServiceVMDiagnostics();
204+
}
205+
vDiagnosticsProfile.VmDiagnostics.Enabled = this.VmDiagnosticsEnabled;
206+
}
207+
208+
209+
var vContainerService = new ContainerService
210+
{
211+
Location = this.Location,
212+
Tags = (this.Tag == null) ? null : this.Tag.Cast<DictionaryEntry>().ToDictionary(ht => (string)ht.Key, ht => (string)ht.Value),
213+
AgentPoolProfiles = this.AgentPoolProfile,
214+
OrchestratorProfile = vOrchestratorProfile,
215+
MasterProfile = vMasterProfile,
216+
WindowsProfile = vWindowsProfile,
217+
LinuxProfile = vLinuxProfile,
218+
DiagnosticsProfile = vDiagnosticsProfile,
219+
};
220+
221+
WriteObject(vContainerService);
222+
}
223+
}
224+
}
225+

0 commit comments

Comments
 (0)