Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/AzurePowershell.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.30723.0
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8531411A-0137-4E27-9C5E-49E07C245048}"
ProjectSection(SolutionItems) = preProject
Expand Down Expand Up @@ -163,6 +163,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Insights", "Resour
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Insights.Test", "ResourceManager\Insights\Commands.Insights.Test\Commands.Insights.Test.csproj", "{469F20E0-9D40-41AD-94C3-B47AD15A4C00}"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you remove this project?

EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Websites", "ResourceManager\Websites\Commands.Websites\Commands.Websites.csproj", "{80A92297-7C92-456B-8EE7-9FB6CE30149D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -397,6 +399,10 @@ Global
{469F20E0-9D40-41AD-94C3-B47AD15A4C00}.Debug|Any CPU.Build.0 = Debug|Any CPU
{469F20E0-9D40-41AD-94C3-B47AD15A4C00}.Release|Any CPU.ActiveCfg = Release|Any CPU
{469F20E0-9D40-41AD-94C3-B47AD15A4C00}.Release|Any CPU.Build.0 = Release|Any CPU
{80A92297-7C92-456B-8EE7-9FB6CE30149D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{80A92297-7C92-456B-8EE7-9FB6CE30149D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{80A92297-7C92-456B-8EE7-9FB6CE30149D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{80A92297-7C92-456B-8EE7-9FB6CE30149D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ NestedModules = @(
'.\Batch\Microsoft.Azure.Commands.Batch.dll',
'.\KeyVault\Microsoft.Azure.Commands.KeyVault.dll',
'.\StreamAnalytics\Microsoft.Azure.Commands.StreamAnalytics.dll',
'.\Insights\Microsoft.Azure.Commands.Insights.dll'
'.\Insights\Microsoft.Azure.Commands.Insights.dll',
'.\Websites\Microsoft.Azure.Commands.Websites.dll'
)

# Functions to export from this module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@
<Project>{F49A314A-A235-47D3-A654-1EC19ACA366C}</Project>
<Name>Commands.StreamAnalytics</Name>
</ProjectReference>
<ProjectReference Include="..\..\Websites\Commands.Websites\Commands.Websites.csproj">
<Project>{80a92297-7c92-456b-8ee7-9fb6ce30149d}</Project>
<Name>Commands.Websites</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Microsoft.Azure.Commands.Resources.dll-Help.xml">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// ----------------------------------------------------------------------------------
//
// 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.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Management.Automation;
using Microsoft.Azure.Management.WebSites.Models;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.Commands.Utilities.CloudService;
using Microsoft.Azure.Commands.Websites;
using Microsoft.Azure.Management.WebSites;
using System.Net.Http;
using System.Threading;
using Microsoft.IdentityModel.Clients.ActiveDirectory;
using System.Net;
using Microsoft.Azure;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Microsoft.Azure.Commands.Websites.Utilities;


Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you have some extra \n throughout

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

namespace Microsoft.Azure.Commands.Websites.Cmdlets
{
/// <summary>
/// this commandlet will let you create a new Azure Websites using ARM APIs
/// </summary>
[Cmdlet(VerbsCommon.New, "AzureWebsite")]
public class NewAzureWebsiteCmdlet : WebsiteBaseCmdlet
{

[Parameter(Position = 2, Mandatory = false, HelpMessage = "The name of the website slot.")]
[ValidateNotNullOrEmptyAttribute]
public string SlotName { get; set; }

[Parameter(Position = 3, Mandatory = true, HelpMessage = "The Location of the Website eg: West US.")]
public string Location { get; set; }

[Parameter(Position = 4, Mandatory = true, HelpMessage = "The name of the web hosting plan eg: Default1.")]
public string WebHostingPlan { get; set; }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens when the web hosting plan doesnt exist?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whatever error I get from API that is returned.


Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra \n

public override void ExecuteCmdlet()
{
WriteObject(WebsitesClient.CreateWebsite(ResourceGroupName, WebsiteName, SlotName, Location, WebHostingPlan));

}

}
}



Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@

// ----------------------------------------------------------------------------------
//
// 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.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Management.Automation;
using Microsoft.Azure.Management.WebSites.Models;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.Commands.Utilities.CloudService;
using Microsoft.Azure.Commands.Websites;
using Microsoft.Azure.Management.WebSites;
using System.Net.Http;
using System.Threading;
using Microsoft.IdentityModel.Clients.ActiveDirectory;
using System.Net;
using Microsoft.Azure;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Microsoft.Azure.Commands.Websites.Utilities;
using Microsoft.WindowsAzure.Commands.Utilities.Properties;


namespace Microsoft.Azure.Commands.Websites.Cmdlets
{
/// <summary>
/// this commandlet will let you delete an Azure website
/// </summary>
[Cmdlet(VerbsCommon.Remove, "AzureWebsite")]
public class RemoveAzureWebsiteCmdlet : WebsiteBaseCmdlet
{

//always delete the slots,
private bool deleteSlotsByDefault = true;

// leave behind the empty webhosting plan
private bool deleteEmptyServerFarmByDefault = false;

//always delete the metrics
private bool deleteMetricsByDefault = true;

[Parameter(Mandatory = false, HelpMessage = "Do not ask for confirmation.")]
public SwitchParameter Force { get; set; }

public override void ExecuteCmdlet()
{
string slotName = null;

ConfirmAction(
Force.IsPresent,
string.Format(Resources.RemoveWebsiteWarning, WebsiteName),
Resources.RemoveWebsiteMessage,
WebsiteName,
() => WebsitesClient.RemoveWebsite(ResourceGroupName, WebsiteName, slotName, deleteEmptyServerFarmByDefault, deleteMetricsByDefault, deleteSlotsByDefault));
}

}
}



Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@

// ----------------------------------------------------------------------------------
//
// 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.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Management.Automation;
using Microsoft.Azure.Management.WebSites.Models;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.Commands.Utilities.CloudService;
using Microsoft.Azure.Commands.Websites;
using Microsoft.Azure.Management.WebSites;
using System.Net.Http;
using System.Threading;
using Microsoft.IdentityModel.Clients.ActiveDirectory;
using System.Net;
using Microsoft.Azure;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Microsoft.Azure.Commands.Websites.Utilities;


namespace Microsoft.Azure.Commands.Websites.Cmdlets
{
/// <summary>
/// this commandlet will let you restart an Azure Website
/// </summary>
[Cmdlet(VerbsLifecycle.Restart, "AzureWebsite")]
public class RestartAzureWebsiteCmdlet : WebsiteBaseCmdlet
{

[Parameter(Position = 2, Mandatory = false, HelpMessage = "The name of the website slot.")]
[ValidateNotNullOrEmptyAttribute]
public string SlotName { get; set; }

public override void ExecuteCmdlet()
{
WriteObject(WebsitesClient.RestartWebsite(ResourceGroupName, WebsiteName, SlotName));
}

}
}




Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@

// ----------------------------------------------------------------------------------
//
// 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.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Management.Automation;
using Microsoft.Azure.Management.WebSites.Models;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.Commands.Utilities.CloudService;
using Microsoft.Azure.Commands.Websites;
using Microsoft.Azure.Management.WebSites;
using System.Net.Http;
using System.Threading;
using Microsoft.IdentityModel.Clients.ActiveDirectory;
using System.Net;
using Microsoft.Azure;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Microsoft.Azure.Commands.Websites.Utilities;


namespace Microsoft.Azure.Commands.Websites.Cmdlets
{
/// <summary>
/// this commandlet will let you Start an Azure Website
/// </summary>
[Cmdlet(VerbsLifecycle.Start, "AzureWebsite")]
public class StartAzureWebsiteCmdlet : WebsiteBaseCmdlet
{

[Parameter(Position = 2, Mandatory = false, HelpMessage = "The name of the website slot.")]
[ValidateNotNullOrEmptyAttribute]
public string SlotName { get; set; }

public override void ExecuteCmdlet()
{
WriteObject(WebsitesClient.StartWebsite(ResourceGroupName, WebsiteName, SlotName));

}

}
}



Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@

// ----------------------------------------------------------------------------------
//
// 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.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Management.Automation;
using Microsoft.Azure.Management.WebSites.Models;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.Commands.Utilities.CloudService;
using Microsoft.Azure.Commands.Websites;
using Microsoft.Azure.Management.WebSites;
using System.Net.Http;
using System.Threading;
using Microsoft.IdentityModel.Clients.ActiveDirectory;
using System.Net;
using Microsoft.Azure;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using Microsoft.Azure.Commands.Websites.Utilities;


namespace Microsoft.Azure.Commands.Websites.Cmdlets
{
/// <summary>
/// this commandlet will let you stop an Azure Website
/// </summary>
[Cmdlet(VerbsLifecycle.Stop, "AzureWebsite")]
public class StopAzureWebsiteCmdlet : WebsiteBaseCmdlet
{

[Parameter(Position = 2, Mandatory = false, HelpMessage = "The name of the website slot.")]
[ValidateNotNullOrEmptyAttribute]
public string SlotName { get; set; }

public override void ExecuteCmdlet()
{
WriteObject(WebsitesClient.StopWebsite(ResourceGroupName, WebsiteName, SlotName));
}

}
}



Loading