-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New CrossConnection commandlets and additional parameters to BgpPeering commandlets #403
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
Changes from 6 commits
bc9e8b8
7d08c4f
684ef3a
6ebdab8
cdab3eb
5415967
3c5fe48
4369a37
834f6bb
7071e98
6e8e47e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| // ---------------------------------------------------------------------------------- | ||
| // | ||
| // Copyright Microsoft Corporation | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
| // ---------------------------------------------------------------------------------- | ||
|
|
||
|
|
||
| using System.Collections.Generic; | ||
| using System.Management.Automation; | ||
| using Microsoft.WindowsAzure.Management.ExpressRoute.Models; | ||
|
|
||
| namespace Microsoft.WindowsAzure.Commands.ExpressRoute | ||
| { | ||
| [Cmdlet(VerbsCommon.Get, "AzureCrossConnection"), OutputType(typeof(AzureCrossConnection), typeof(IEnumerable<AzureCrossConnection>))] | ||
| public class GetAzureCrossConnectionCommand : ExpressRouteBaseCmdlet | ||
| { | ||
| [Parameter(Position = 0, Mandatory = false, ValueFromPipelineByPropertyName = true, | ||
| HelpMessage = "Service Key representing the Dedicated Circuit")] | ||
| [ValidateGuid] | ||
| [ValidateNotNullOrEmpty] | ||
| public string ServiceKey { get; set; } | ||
|
|
||
| public override void ExecuteCmdlet() | ||
| { | ||
| if (!string.IsNullOrEmpty(ServiceKey)) | ||
| { | ||
| GetByServiceKey(); | ||
| } | ||
| else | ||
| { | ||
| GetNoServiceKey(); | ||
| } | ||
| } | ||
|
|
||
| private void GetByServiceKey() | ||
| { | ||
| var crossConnection = ExpressRouteClient.GetAzureCrossConnection(ServiceKey); | ||
| WriteObject(crossConnection); | ||
| } | ||
|
|
||
| private void GetNoServiceKey() | ||
| { | ||
| var crossConnections = ExpressRouteClient.ListAzureCrossConnections(); | ||
| WriteObject(crossConnections, true); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| // ---------------------------------------------------------------------------------- | ||
| // | ||
| // Copyright Microsoft Corporation | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
| // ---------------------------------------------------------------------------------- | ||
|
|
||
| using System; | ||
| using System.Management.Automation; | ||
| using Microsoft.WindowsAzure.Commands.ExpressRoute.Properties; | ||
| using Microsoft.WindowsAzure.Management.ExpressRoute.Models; | ||
|
|
||
| namespace Microsoft.WindowsAzure.Commands.ExpressRoute | ||
| { | ||
| [Cmdlet(VerbsCommon.New, "AzureCrossConnection"), OutputType(typeof(AzureCrossConnection))] | ||
| public class NewAzureCrossConnectionCommand : ExpressRouteBaseCmdlet | ||
| { | ||
| [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, | ||
| HelpMessage = "Dedicated Circuit Service Key")] | ||
| [ValidateGuid] | ||
| [ValidateNotNullOrEmpty] | ||
| public string ServiceKey { get; set; } | ||
|
|
||
| [Parameter(HelpMessage = "Do not confirm Azure Cross Connection creation")] | ||
| public SwitchParameter Force { get; set; } | ||
|
|
||
| public override void ExecuteCmdlet() | ||
| { | ||
| ConfirmAction( | ||
| Force.IsPresent, | ||
| string.Format(Resources.NewAzureCrossConnectionWarning, ServiceKey), | ||
| string.Format(Resources.NewAzureCrossConnectionMessage, ServiceKey), | ||
| ServiceKey, | ||
| () => | ||
| { | ||
| var crossConnection = ExpressRouteClient.NewAzureCrossConnection(ServiceKey); | ||
| WriteVerboseWithTimestamp(Resources.NewAzureCrossConnectionSucceeded); | ||
| WriteObject(crossConnection); | ||
| }); | ||
|
|
||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| // ---------------------------------------------------------------------------------- | ||
| // | ||
| // Copyright Microsoft Corporation | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
| // ---------------------------------------------------------------------------------- | ||
|
|
||
| using System; | ||
| using System.ComponentModel; | ||
| using System.Management.Automation; | ||
| using Microsoft.WindowsAzure.Commands.ExpressRoute.Properties; | ||
| using Microsoft.WindowsAzure.Management.ExpressRoute.Models; | ||
|
|
||
| namespace Microsoft.WindowsAzure.Commands.ExpressRoute | ||
| { | ||
|
|
||
| [Cmdlet(VerbsCommon.Set, "AzureCrossConnection"), OutputType(typeof(AzureCrossConnection))] | ||
| public class SetAzureCrossConnectionCommand : ExpressRouteBaseCmdlet | ||
| { | ||
| [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Service Key representing Azure Circuit for which BGP peering needs to be created/modified")] | ||
| [ValidateGuid] | ||
| [ValidateNotNullOrEmpty] | ||
| public string ServiceKey { get; set; } | ||
|
|
||
| [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Notification Operation to perform. NotifyCrossConnectionProvisioned or NotifyCrossConnectionNotProvisioned")] | ||
| [ValidateNotNullOrEmpty] | ||
| public UpdateCrossConnectionOperation Operation { get; set; } | ||
|
|
||
| [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Provisioning Error Message")] | ||
| public string ProvisioningError { get; set; } | ||
|
|
||
| [Parameter(Mandatory = false)] | ||
| public SwitchParameter PassThru { get; set; } | ||
|
|
||
| public override void ExecuteCmdlet() | ||
| { | ||
| var crossConnection = ExpressRouteClient.SetAzureCrossConnection(ServiceKey, | ||
| new CrossConnectionUpdateParameters() {Operation = Operation, ProvisioningError = ProvisioningError}); | ||
| if(PassThru.IsPresent) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: fix alignment
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
||
| { | ||
| WriteObject(crossConnection); | ||
| } | ||
| } | ||
| } | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -318,6 +318,7 @@ | |
| <SubType>Designer</SubType> | ||
| <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
| </Content> | ||
| <None Include="app.config" /> | ||
|
||
| <None Include="MSSharedLibKey.snk" /> | ||
| <Content Include="Resources\MyWebTemplateFolder\web.cloud.config"> | ||
| <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may consider making this of type Guid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed throughout