Skip to content

Commit 03c1058

Browse files
committed
Update
1 parent d4b5f08 commit 03c1058

11 files changed

+833
-185
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
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;
23+
using Microsoft.Azure.Commands.Compute.Automation.Models;
24+
using Microsoft.Azure.Management.Compute;
25+
using Microsoft.Azure.Management.Compute.Models;
26+
using System;
27+
using System.Collections.Generic;
28+
using System.Linq;
29+
using System.Management.Automation;
30+
31+
namespace Microsoft.Azure.Commands.Compute.Automation
32+
{
33+
public partial class InvokeAzureComputeMethodCmdlet : ComputeAutomationBaseCmdlet
34+
{
35+
protected object CreateAvailabilitySetCreateOrUpdateDynamicParameters()
36+
{
37+
dynamicParameters = new RuntimeDefinedParameterDictionary();
38+
var pResourceGroupName = new RuntimeDefinedParameter();
39+
pResourceGroupName.Name = "ResourceGroupName";
40+
pResourceGroupName.ParameterType = typeof(string);
41+
pResourceGroupName.Attributes.Add(new ParameterAttribute
42+
{
43+
ParameterSetName = "InvokeByDynamicParameters",
44+
Position = 1,
45+
Mandatory = false
46+
});
47+
pResourceGroupName.Attributes.Add(new AllowNullAttribute());
48+
dynamicParameters.Add("ResourceGroupName", pResourceGroupName);
49+
50+
var pName = new RuntimeDefinedParameter();
51+
pName.Name = "Name";
52+
pName.ParameterType = typeof(string);
53+
pName.Attributes.Add(new ParameterAttribute
54+
{
55+
ParameterSetName = "InvokeByDynamicParameters",
56+
Position = 2,
57+
Mandatory = false
58+
});
59+
pName.Attributes.Add(new AllowNullAttribute());
60+
dynamicParameters.Add("Name", pName);
61+
62+
var pParameters = new RuntimeDefinedParameter();
63+
pParameters.Name = "AvailabilitySetCreateOrUpdateParameter";
64+
pParameters.ParameterType = typeof(AvailabilitySet);
65+
pParameters.Attributes.Add(new ParameterAttribute
66+
{
67+
ParameterSetName = "InvokeByDynamicParameters",
68+
Position = 3,
69+
Mandatory = false
70+
});
71+
pParameters.Attributes.Add(new AllowNullAttribute());
72+
dynamicParameters.Add("AvailabilitySetCreateOrUpdateParameter", pParameters);
73+
74+
var pArgumentList = new RuntimeDefinedParameter();
75+
pArgumentList.Name = "ArgumentList";
76+
pArgumentList.ParameterType = typeof(object[]);
77+
pArgumentList.Attributes.Add(new ParameterAttribute
78+
{
79+
ParameterSetName = "InvokeByStaticParameters",
80+
Position = 4,
81+
Mandatory = true
82+
});
83+
pArgumentList.Attributes.Add(new AllowNullAttribute());
84+
dynamicParameters.Add("ArgumentList", pArgumentList);
85+
86+
return dynamicParameters;
87+
}
88+
89+
protected void ExecuteAvailabilitySetCreateOrUpdateMethod(object[] invokeMethodInputParameters)
90+
{
91+
string resourceGroupName = (string)ParseParameter(invokeMethodInputParameters[0]);
92+
string name = (string)ParseParameter(invokeMethodInputParameters[1]);
93+
AvailabilitySet parameters = (AvailabilitySet)ParseParameter(invokeMethodInputParameters[2]);
94+
95+
var result = AvailabilitySetsClient.CreateOrUpdate(resourceGroupName, name, parameters);
96+
WriteObject(result);
97+
}
98+
}
99+
100+
public partial class NewAzureComputeArgumentListCmdlet : ComputeAutomationBaseCmdlet
101+
{
102+
protected PSArgument[] CreateAvailabilitySetCreateOrUpdateParameters()
103+
{
104+
string resourceGroupName = string.Empty;
105+
string name = string.Empty;
106+
AvailabilitySet parameters = new AvailabilitySet();
107+
108+
return ConvertFromObjectsToArguments(
109+
new string[] { "ResourceGroupName", "Name", "Parameters" },
110+
new object[] { resourceGroupName, name, parameters });
111+
}
112+
}
113+
}
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
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;
23+
using Microsoft.Azure.Commands.Compute.Automation.Models;
24+
using Microsoft.Azure.Management.Compute;
25+
using Microsoft.Azure.Management.Compute.Models;
26+
using System;
27+
using System.Collections.Generic;
28+
using System.Linq;
29+
using System.Management.Automation;
30+
31+
namespace Microsoft.Azure.Commands.Compute.Automation
32+
{
33+
public partial class InvokeAzureComputeMethodCmdlet : ComputeAutomationBaseCmdlet
34+
{
35+
protected object CreateAvailabilitySetDeleteDynamicParameters()
36+
{
37+
dynamicParameters = new RuntimeDefinedParameterDictionary();
38+
var pResourceGroupName = new RuntimeDefinedParameter();
39+
pResourceGroupName.Name = "ResourceGroupName";
40+
pResourceGroupName.ParameterType = typeof(string);
41+
pResourceGroupName.Attributes.Add(new ParameterAttribute
42+
{
43+
ParameterSetName = "InvokeByDynamicParameters",
44+
Position = 1,
45+
Mandatory = false
46+
});
47+
pResourceGroupName.Attributes.Add(new AllowNullAttribute());
48+
dynamicParameters.Add("ResourceGroupName", pResourceGroupName);
49+
50+
var pAvailabilitySetName = new RuntimeDefinedParameter();
51+
pAvailabilitySetName.Name = "AvailabilitySetName";
52+
pAvailabilitySetName.ParameterType = typeof(string);
53+
pAvailabilitySetName.Attributes.Add(new ParameterAttribute
54+
{
55+
ParameterSetName = "InvokeByDynamicParameters",
56+
Position = 2,
57+
Mandatory = false
58+
});
59+
pAvailabilitySetName.Attributes.Add(new AllowNullAttribute());
60+
dynamicParameters.Add("AvailabilitySetName", pAvailabilitySetName);
61+
62+
var pArgumentList = new RuntimeDefinedParameter();
63+
pArgumentList.Name = "ArgumentList";
64+
pArgumentList.ParameterType = typeof(object[]);
65+
pArgumentList.Attributes.Add(new ParameterAttribute
66+
{
67+
ParameterSetName = "InvokeByStaticParameters",
68+
Position = 3,
69+
Mandatory = true
70+
});
71+
pArgumentList.Attributes.Add(new AllowNullAttribute());
72+
dynamicParameters.Add("ArgumentList", pArgumentList);
73+
74+
return dynamicParameters;
75+
}
76+
77+
protected void ExecuteAvailabilitySetDeleteMethod(object[] invokeMethodInputParameters)
78+
{
79+
string resourceGroupName = (string)ParseParameter(invokeMethodInputParameters[0]);
80+
string availabilitySetName = (string)ParseParameter(invokeMethodInputParameters[1]);
81+
82+
AvailabilitySetsClient.Delete(resourceGroupName, availabilitySetName);
83+
}
84+
}
85+
86+
public partial class NewAzureComputeArgumentListCmdlet : ComputeAutomationBaseCmdlet
87+
{
88+
protected PSArgument[] CreateAvailabilitySetDeleteParameters()
89+
{
90+
string resourceGroupName = string.Empty;
91+
string availabilitySetName = string.Empty;
92+
93+
return ConvertFromObjectsToArguments(
94+
new string[] { "ResourceGroupName", "AvailabilitySetName" },
95+
new object[] { resourceGroupName, availabilitySetName });
96+
}
97+
}
98+
}
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
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;
23+
using Microsoft.Azure.Commands.Compute.Automation.Models;
24+
using Microsoft.Azure.Management.Compute;
25+
using Microsoft.Azure.Management.Compute.Models;
26+
using System;
27+
using System.Collections.Generic;
28+
using System.Linq;
29+
using System.Management.Automation;
30+
31+
namespace Microsoft.Azure.Commands.Compute.Automation
32+
{
33+
public partial class InvokeAzureComputeMethodCmdlet : ComputeAutomationBaseCmdlet
34+
{
35+
protected object CreateAvailabilitySetGetDynamicParameters()
36+
{
37+
dynamicParameters = new RuntimeDefinedParameterDictionary();
38+
var pResourceGroupName = new RuntimeDefinedParameter();
39+
pResourceGroupName.Name = "ResourceGroupName";
40+
pResourceGroupName.ParameterType = typeof(string);
41+
pResourceGroupName.Attributes.Add(new ParameterAttribute
42+
{
43+
ParameterSetName = "InvokeByDynamicParameters",
44+
Position = 1,
45+
Mandatory = false
46+
});
47+
pResourceGroupName.Attributes.Add(new AllowNullAttribute());
48+
dynamicParameters.Add("ResourceGroupName", pResourceGroupName);
49+
50+
var pAvailabilitySetName = new RuntimeDefinedParameter();
51+
pAvailabilitySetName.Name = "AvailabilitySetName";
52+
pAvailabilitySetName.ParameterType = typeof(string);
53+
pAvailabilitySetName.Attributes.Add(new ParameterAttribute
54+
{
55+
ParameterSetName = "InvokeByDynamicParameters",
56+
Position = 2,
57+
Mandatory = false
58+
});
59+
pAvailabilitySetName.Attributes.Add(new AllowNullAttribute());
60+
dynamicParameters.Add("AvailabilitySetName", pAvailabilitySetName);
61+
62+
var pArgumentList = new RuntimeDefinedParameter();
63+
pArgumentList.Name = "ArgumentList";
64+
pArgumentList.ParameterType = typeof(object[]);
65+
pArgumentList.Attributes.Add(new ParameterAttribute
66+
{
67+
ParameterSetName = "InvokeByStaticParameters",
68+
Position = 3,
69+
Mandatory = true
70+
});
71+
pArgumentList.Attributes.Add(new AllowNullAttribute());
72+
dynamicParameters.Add("ArgumentList", pArgumentList);
73+
74+
return dynamicParameters;
75+
}
76+
77+
protected void ExecuteAvailabilitySetGetMethod(object[] invokeMethodInputParameters)
78+
{
79+
string resourceGroupName = (string)ParseParameter(invokeMethodInputParameters[0]);
80+
string availabilitySetName = (string)ParseParameter(invokeMethodInputParameters[1]);
81+
82+
if (!string.IsNullOrEmpty(resourceGroupName) && !string.IsNullOrEmpty(availabilitySetName))
83+
{
84+
var result = AvailabilitySetsClient.Get(resourceGroupName, availabilitySetName);
85+
WriteObject(result);
86+
}
87+
else if (!string.IsNullOrEmpty(resourceGroupName))
88+
{
89+
var result = AvailabilitySetsClient.List(resourceGroupName);
90+
WriteObject(result);
91+
}
92+
}
93+
94+
}
95+
96+
public partial class NewAzureComputeArgumentListCmdlet : ComputeAutomationBaseCmdlet
97+
{
98+
protected PSArgument[] CreateAvailabilitySetGetParameters()
99+
{
100+
string resourceGroupName = string.Empty;
101+
string availabilitySetName = string.Empty;
102+
103+
return ConvertFromObjectsToArguments(
104+
new string[] { "ResourceGroupName", "AvailabilitySetName" },
105+
new object[] { resourceGroupName, availabilitySetName });
106+
}
107+
}
108+
}

0 commit comments

Comments
 (0)