зеркало из
1
0
Форкнуть 0

Add AzureStack infrastructure and tools to main branch

This commit is contained in:
markcowl 2017-09-11 09:23:57 -07:00
Коммит de4e495605
322 изменённых файлов: 79531 добавлений и 0 удалений

100
AzureRM/AzureRM.psd1 Normal file
Просмотреть файл

@ -0,0 +1,100 @@
#
# Module manifest for module 'AzureRM.Installer'
#
# Generated by: Microsoft Corporation
#
# Generated on: 9/18/2015
#
@{
# Script module or binary module file associated with this manifest.
# Version number of this module.
ModuleVersion = '1.2.11'
# ID used to uniquely identify this module
GUID = 'B433E830-B479-4F7F-9C80-9CC6C28E1B51'
# Author of this module
Author = 'Microsoft Corporation'
# Company or vendor of this module
CompanyName = 'Microsoft Corporation'
# Copyright statement for this module
Copyright = 'Microsoft Corporation. All rights reserved.'
# Description of the functionality provided by this module
Description = 'Azure Resource Manager Module'
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '3.0'
# Name of the Windows PowerShell host required by this module
PowerShellHostName = ''
# Minimum version of the Windows PowerShell host required by this module
PowerShellHostVersion = ''
# Minimum version of the .NET Framework required by this module
DotNetFrameworkVersion = '4.0'
# Minimum version of the common language runtime (CLR) required by this module
CLRVersion='4.0'
# Processor architecture (None, X86, Amd64, IA64) required by this module
ProcessorArchitecture = 'None'
# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @(@{ModuleName="AzureRM.Profile"; RequiredVersion="3.3.2"},
@{ModuleName="Azure.Storage"; RequiredVersion="1.0.5.4"}
@{ModuleName="AzureRM.Compute"; RequiredVersion="3.2.1"},
@{ModuleName="AzureRM.KeyVault"; RequiredVersion="3.3.2"},
@{ModuleName="AzureRM.Network"; RequiredVersion="1.0.5.4"},
@{ModuleName="AzureRM.Resources"; RequiredVersion="4.3.2"},
@{ModuleName="AzureRM.Storage"; RequiredVersion="1.0.5.4"},
@{ModuleName="AzureRM.Tags"; RequiredVersion="3.3.2"},
@{ModuleName="AzureRM.UsageAggregates"; RequiredVersion="3.3.2"})
# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = @()
# Script files (.ps1) that are run in the caller's environment prior to importing this module
ScriptsToProcess = @()
# Type files (.ps1xml) to be loaded when importing this module
TypesToProcess = @(
)
# Format files (.ps1xml) to be loaded when importing this module
FormatsToProcess = @(
)
# Modules to import as nested modules of the module specified in ModuleToProcess
NestedModules = @(
)
# Functions to export from this module
FunctionsToExport = '*'
# Cmdlets to export from this module
CmdletsToExport = '*'
# Variables to export from this module
VariablesToExport = '*'
# Aliases to export from this module
AliasesToExport = @()
# List of all modules packaged with this module
ModuleList = @()
# List of all files packaged with this module
FileList = @()
# Private data to pass to the module specified in ModuleToProcess
PrivateData = ''
}

124
AzureStack/AzureStack.psd1 Normal file
Просмотреть файл

@ -0,0 +1,124 @@
#
# Module manifest for module 'PSGet_AzureStack'
#
# Generated by: Microsoft Corporation
#
# Generated on: 11/14/2016
#
@{
# Version number of this module.
ModuleVersion = '1.2.11'
# ID used to uniquely identify this module
GUID = '65f1e943-5e22-4b21-8350-82c798c958d2'
# Author of this module
Author = 'Microsoft Corporation'
# Company or vendor of this module
CompanyName = 'Microsoft Corporation'
# Copyright statement for this module
Copyright = 'Microsoft Corporation. All rights reserved.'
# Description of the functionality provided by this module
Description = 'Azure Stack Adminisitration Module'
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '3.0'
# Name of the Windows PowerShell host required by this module
# PowerShellHostName = ''
# Minimum version of the Windows PowerShell host required by this module
# PowerShellHostVersion = ''
# Minimum version of Microsoft .NET Framework required by this module
DotNetFrameworkVersion = '4.0'
# Minimum version of the common language runtime (CLR) required by this module
CLRVersion = '4.0'
# Processor architecture (None, X86, Amd64) required by this module
# ProcessorArchitecture = 'None'
# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @(@{ModuleName="AzureRM.Profile"; RequiredVersion="3.3.2"},
@{ModuleName="AzureRM.AzureStackAdmin"; RequiredVersion="0.11.1"},
@{ModuleName="AzureRM.AzureStackStorage"; RequiredVersion="0.10.9"})
# Assemblies that must be loaded prior to importing this module
# RequiredAssemblies = @()
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# ScriptsToProcess = @()
# Type files (.ps1xml) to be loaded when importing this module
# TypesToProcess = @()
# Format files (.ps1xml) to be loaded when importing this module
# FormatsToProcess = @()
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
# NestedModules = @()
# Functions to export from this module
# FunctionsToExport = @()
# Cmdlets to export from this module
# CmdletsToExport = @()
# Variables to export from this module
# VariablesToExport = @()
# Aliases to export from this module
# AliasesToExport = @()
# DSC resources to export from this module
# DscResourcesToExport = @()
# List of all modules packaged with this module
# ModuleList = @()
# List of all files packaged with this module
# FileList = @()
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
PrivateData = @{
PSData = @{
# Tags applied to this module. These help with module discovery in online galleries.
# Tags = @()
# A URL to the license for this module.
LicenseUri = 'https://raw.githubusercontent.com/Azure/azure-powershell/stack-dev/LICENSE.txt'
# A URL to the main website for this project.
ProjectUri = 'https://github.com/Azure/azure-powershell'
# A URL to an icon representing this module.
# IconUri = ''
# ReleaseNotes of this module
ReleaseNotes = '2017.01.11 version 1.2.8
* AzureRM.Keyvault module
* Relaxing data type of ObjectId from Guid to string in Access Policy Entry for a Vault. These changes are required to Support ADFS Identity System.
* Set-AzureRmKeyVaultAccessPolicy cmdlet has an optional parameter BypassObjectIdValidation for supporting ADFS scenarios'
# External dependent modules of this module
# ExternalModuleDependencies = ''
} # End of PSData hashtable
} # End of PrivateData hashtable
# HelpInfo URI of this module
# HelpInfoURI = ''
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''
}

Просмотреть файл

@ -0,0 +1,83 @@
#
# Module manifest for module 'AzureRM.AzureStackAdmin'
#
# Generated by: Microsoft Corporation
#
# Updated on: 10/27/2015
#
@{
# Version number of this module.
ModuleVersion = '0.11.1'
# ID used to uniquely identify this module
GUID = '0e691e0a-ce16-40f2-af84-86fb0d82fb29'
# Author of this module
Author = 'Microsoft Corporation'
# Company or vendor of this module
CompanyName = 'Microsoft Corporation'
# Copyright statement for this module
Copyright = 'Microsoft Corporation. All rights reserved.'
# Description of the functionality provided by this module
Description = 'Microsoft Azure Stack Administration Module'
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '3.0'
# Name of the Windows PowerShell host required by this module
PowerShellHostName = ''
# Minimum version of the Windows PowerShell host required by this module
PowerShellHostVersion = ''
# Minimum version of the .NET Framework required by this module
DotNetFrameworkVersion = '4.5'
# Minimum version of the common language runtime (CLR) required by this module
CLRVersion = '4.0'
# Processor architecture (None, X86, Amd64, IA64) required by this module
ProcessorArchitecture = ''
# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @( @{ ModuleName = 'AzureRM.Profile'; ModuleVersion = '3.3.2'} )
# Assemblies that must be loaded prior to importing this module
# RequiredAssemblies = @()
# Type files (.ps1xml) to be loaded when importing this module
TypesToProcess = @()
# Format files (.ps1xml) to be loaded when importing this module
# FormatsToProcess = @('AzureStackAdmin.format.ps1xml')
# Modules to import as nested modules of the module specified in ModuleToProcess
NestedModules = @('.\Microsoft.AzureStack.Commands.dll')
# Functions to export from this module
FunctionsToExport = '*'
# Cmdlets to export from this module
CmdletsToExport = '*'
# Variables to export from this module
VariablesToExport = '*'
# Aliases to export from this module
AliasesToExport = '*'
# List of all modules packaged with this module
ModuleList = @()
# List of all files packaged with this module
# FileList = @()
# Private data to pass to the module specified in ModuleToProcess
PrivateData = ''
}

Просмотреть файл

@ -0,0 +1,87 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ResourceManager.Common", "..\Common\Commands.ResourceManager.Common\Commands.ResourceManager.Common.csproj", "{3819D8A7-C62C-4C47-8DDD-0332D9CE1252}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.AzureStackAdmin", "Commands.AzureStackAdmin\Commands.AzureStackAdmin.csproj", "{0B02390C-8AA9-4D99-8AA8-2A9D2D39682F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common.Authentication", "..\..\Common\Commands.Common.Authentication\Commands.Common.Authentication.csproj", "{D3804B64-C0D3-48F8-82EC-1F632F833C9E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common.Authentication.Abstractions", "..\..\Common\Commands.Common.Authentication.Abstractions\Commands.Common.Authentication.Abstractions.csproj", "{70527617-7598-4AEF-B5BD-DB9186B8184B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common.Authentication.ResourceManager", "..\Common\Commands.Common.Authentication.ResourceManager\Commands.Common.Authentication.ResourceManager.csproj", "{69C2EB6B-CD63-480A-89A0-C489706E9299}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common.Authorization", "..\..\Common\Commands.Common.Authorization\Commands.Common.Authorization.csproj", "{24508E26-154D-47F1-80EE-439BF0710996}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common.Graph.RBAC", "..\..\Common\Commands.Common.Graph.RBAC\Commands.Common.Graph.RBAC.csproj", "{269ACF73-0A34-42DC-AB9C-4B15931A489D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
ReleaseSigned|Any CPU = ReleaseSigned|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3819D8A7-C62C-4C47-8DDD-0332D9CE1252}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3819D8A7-C62C-4C47-8DDD-0332D9CE1252}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3819D8A7-C62C-4C47-8DDD-0332D9CE1252}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3819D8A7-C62C-4C47-8DDD-0332D9CE1252}.Release|Any CPU.Build.0 = Release|Any CPU
{3819D8A7-C62C-4C47-8DDD-0332D9CE1252}.ReleaseSigned|Any CPU.ActiveCfg = Release|Any CPU
{3819D8A7-C62C-4C47-8DDD-0332D9CE1252}.ReleaseSigned|Any CPU.Build.0 = Release|Any CPU
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.ReleaseSigned|Any CPU.ActiveCfg = Release|Any CPU
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.ReleaseSigned|Any CPU.Build.0 = Release|Any CPU
{5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU
{5EE72C53-1720-4309-B54B-5FB79703195F}.ReleaseSigned|Any CPU.ActiveCfg = Release|Any CPU
{5EE72C53-1720-4309-B54B-5FB79703195F}.ReleaseSigned|Any CPU.Build.0 = Release|Any CPU
{0B02390C-8AA9-4D99-8AA8-2A9D2D39682F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0B02390C-8AA9-4D99-8AA8-2A9D2D39682F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0B02390C-8AA9-4D99-8AA8-2A9D2D39682F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0B02390C-8AA9-4D99-8AA8-2A9D2D39682F}.Release|Any CPU.Build.0 = Release|Any CPU
{0B02390C-8AA9-4D99-8AA8-2A9D2D39682F}.ReleaseSigned|Any CPU.ActiveCfg = Release|Any CPU
{0B02390C-8AA9-4D99-8AA8-2A9D2D39682F}.ReleaseSigned|Any CPU.Build.0 = Release|Any CPU
{D3804B64-C0D3-48F8-82EC-1F632F833C9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D3804B64-C0D3-48F8-82EC-1F632F833C9E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D3804B64-C0D3-48F8-82EC-1F632F833C9E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D3804B64-C0D3-48F8-82EC-1F632F833C9E}.Release|Any CPU.Build.0 = Release|Any CPU
{D3804B64-C0D3-48F8-82EC-1F632F833C9E}.ReleaseSigned|Any CPU.ActiveCfg = Release|Any CPU
{70527617-7598-4AEF-B5BD-DB9186B8184B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{70527617-7598-4AEF-B5BD-DB9186B8184B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{70527617-7598-4AEF-B5BD-DB9186B8184B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{70527617-7598-4AEF-B5BD-DB9186B8184B}.Release|Any CPU.Build.0 = Release|Any CPU
{70527617-7598-4AEF-B5BD-DB9186B8184B}.ReleaseSigned|Any CPU.ActiveCfg = Release|Any CPU
{70527617-7598-4AEF-B5BD-DB9186B8184B}.ReleaseSigned|Any CPU.Build.0 = Release|Any CPU
{69C2EB6B-CD63-480A-89A0-C489706E9299}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{69C2EB6B-CD63-480A-89A0-C489706E9299}.Debug|Any CPU.Build.0 = Debug|Any CPU
{69C2EB6B-CD63-480A-89A0-C489706E9299}.Release|Any CPU.ActiveCfg = Release|Any CPU
{69C2EB6B-CD63-480A-89A0-C489706E9299}.Release|Any CPU.Build.0 = Release|Any CPU
{69C2EB6B-CD63-480A-89A0-C489706E9299}.ReleaseSigned|Any CPU.ActiveCfg = Release|Any CPU
{69C2EB6B-CD63-480A-89A0-C489706E9299}.ReleaseSigned|Any CPU.Build.0 = Release|Any CPU
{24508E26-154D-47F1-80EE-439BF0710996}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{24508E26-154D-47F1-80EE-439BF0710996}.Debug|Any CPU.Build.0 = Debug|Any CPU
{24508E26-154D-47F1-80EE-439BF0710996}.Release|Any CPU.ActiveCfg = Release|Any CPU
{24508E26-154D-47F1-80EE-439BF0710996}.Release|Any CPU.Build.0 = Release|Any CPU
{24508E26-154D-47F1-80EE-439BF0710996}.ReleaseSigned|Any CPU.ActiveCfg = Release|Any CPU
{24508E26-154D-47F1-80EE-439BF0710996}.ReleaseSigned|Any CPU.Build.0 = Release|Any CPU
{269ACF73-0A34-42DC-AB9C-4B15931A489D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{269ACF73-0A34-42DC-AB9C-4B15931A489D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{269ACF73-0A34-42DC-AB9C-4B15931A489D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{269ACF73-0A34-42DC-AB9C-4B15931A489D}.Release|Any CPU.Build.0 = Release|Any CPU
{269ACF73-0A34-42DC-AB9C-4B15931A489D}.ReleaseSigned|Any CPU.ActiveCfg = Release|Any CPU
{269ACF73-0A34-42DC-AB9C-4B15931A489D}.ReleaseSigned|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Просмотреть файл

@ -0,0 +1,102 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ResourceManager.Common", "..\Common\Commands.ResourceManager.Common\Commands.ResourceManager.Common.csproj", "{3819D8A7-C62C-4C47-8DDD-0332D9CE1252}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Profile", "..\Profile\Commands.Profile\Commands.Profile.csproj", "{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common", "..\..\Common\Commands.Common\Commands.Common.csproj", "{5EE72C53-1720-4309-B54B-5FB79703195F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.AzureStackAdmin", "Commands.AzureStackAdmin\Commands.AzureStackAdmin.csproj", "{0B02390C-8AA9-4D99-8AA8-2A9D2D39682F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common.Authentication", "..\..\Common\Commands.Common.Authentication\Commands.Common.Authentication.csproj", "{D3804B64-C0D3-48F8-82EC-1F632F833C9E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{047B121A-8B6F-48C5-9D72-BA3B434E8B72}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.AzureStackAdmin.Test", "Commands.AzureStackAdmin.Test\Commands.AzureStackAdmin.Test.csproj", "{080B0477-7E52-4455-90AB-23BD13D1B1CE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.AzureStackAdmin.Test.Common", "Commands.AzureStackAdmin.Test\Common\Commands.AzureStackAdmin.Test.Common.csproj", "{FE34F78C-E6EC-448C-B675-DF9D9201A4E7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.ScenarioTests.ResourceManager.Common", "..\Common\Commands.ScenarioTests.ResourceManager.Common\Commands.ScenarioTests.ResourceManager.Common.csproj", "{3436A126-EDC9-4060-8952-9A1BE34CDD95}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common.Authentication.Abstractions", "..\..\Common\Commands.Common.Authentication.Abstractions\Commands.Common.Authentication.Abstractions.csproj", "{70527617-7598-4AEF-B5BD-DB9186B8184B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commands.Common.Authentication.ResourceManager", "..\Common\Commands.Common.Authentication.ResourceManager\Commands.Common.Authentication.ResourceManager.csproj", "{69C2EB6B-CD63-480A-89A0-C489706E9299}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
ReleaseSigned|Any CPU = ReleaseSigned|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3819D8A7-C62C-4C47-8DDD-0332D9CE1252}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3819D8A7-C62C-4C47-8DDD-0332D9CE1252}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3819D8A7-C62C-4C47-8DDD-0332D9CE1252}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3819D8A7-C62C-4C47-8DDD-0332D9CE1252}.Release|Any CPU.Build.0 = Release|Any CPU
{3819D8A7-C62C-4C47-8DDD-0332D9CE1252}.ReleaseSigned|Any CPU.ActiveCfg = Release|Any CPU
{3819D8A7-C62C-4C47-8DDD-0332D9CE1252}.ReleaseSigned|Any CPU.Build.0 = Release|Any CPU
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.Release|Any CPU.Build.0 = Release|Any CPU
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.ReleaseSigned|Any CPU.ActiveCfg = Release|Any CPU
{142D7B0B-388A-4CEB-A228-7F6D423C5C2E}.ReleaseSigned|Any CPU.Build.0 = Release|Any CPU
{5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5EE72C53-1720-4309-B54B-5FB79703195F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5EE72C53-1720-4309-B54B-5FB79703195F}.Release|Any CPU.Build.0 = Release|Any CPU
{5EE72C53-1720-4309-B54B-5FB79703195F}.ReleaseSigned|Any CPU.ActiveCfg = Release|Any CPU
{5EE72C53-1720-4309-B54B-5FB79703195F}.ReleaseSigned|Any CPU.Build.0 = Release|Any CPU
{0B02390C-8AA9-4D99-8AA8-2A9D2D39682F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0B02390C-8AA9-4D99-8AA8-2A9D2D39682F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0B02390C-8AA9-4D99-8AA8-2A9D2D39682F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0B02390C-8AA9-4D99-8AA8-2A9D2D39682F}.Release|Any CPU.Build.0 = Release|Any CPU
{0B02390C-8AA9-4D99-8AA8-2A9D2D39682F}.ReleaseSigned|Any CPU.ActiveCfg = Release|Any CPU
{0B02390C-8AA9-4D99-8AA8-2A9D2D39682F}.ReleaseSigned|Any CPU.Build.0 = Release|Any CPU
{D3804B64-C0D3-48F8-82EC-1F632F833C9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D3804B64-C0D3-48F8-82EC-1F632F833C9E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D3804B64-C0D3-48F8-82EC-1F632F833C9E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D3804B64-C0D3-48F8-82EC-1F632F833C9E}.Release|Any CPU.Build.0 = Release|Any CPU
{D3804B64-C0D3-48F8-82EC-1F632F833C9E}.ReleaseSigned|Any CPU.ActiveCfg = Release|Any CPU
{080B0477-7E52-4455-90AB-23BD13D1B1CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{080B0477-7E52-4455-90AB-23BD13D1B1CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{080B0477-7E52-4455-90AB-23BD13D1B1CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{080B0477-7E52-4455-90AB-23BD13D1B1CE}.Release|Any CPU.Build.0 = Release|Any CPU
{080B0477-7E52-4455-90AB-23BD13D1B1CE}.ReleaseSigned|Any CPU.ActiveCfg = Release|Any CPU
{080B0477-7E52-4455-90AB-23BD13D1B1CE}.ReleaseSigned|Any CPU.Build.0 = Release|Any CPU
{FE34F78C-E6EC-448C-B675-DF9D9201A4E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FE34F78C-E6EC-448C-B675-DF9D9201A4E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FE34F78C-E6EC-448C-B675-DF9D9201A4E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FE34F78C-E6EC-448C-B675-DF9D9201A4E7}.Release|Any CPU.Build.0 = Release|Any CPU
{FE34F78C-E6EC-448C-B675-DF9D9201A4E7}.ReleaseSigned|Any CPU.ActiveCfg = Release|Any CPU
{FE34F78C-E6EC-448C-B675-DF9D9201A4E7}.ReleaseSigned|Any CPU.Build.0 = Release|Any CPU
{3436A126-EDC9-4060-8952-9A1BE34CDD95}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3436A126-EDC9-4060-8952-9A1BE34CDD95}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3436A126-EDC9-4060-8952-9A1BE34CDD95}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3436A126-EDC9-4060-8952-9A1BE34CDD95}.Release|Any CPU.Build.0 = Release|Any CPU
{3436A126-EDC9-4060-8952-9A1BE34CDD95}.ReleaseSigned|Any CPU.ActiveCfg = Release|Any CPU
{3436A126-EDC9-4060-8952-9A1BE34CDD95}.ReleaseSigned|Any CPU.Build.0 = Release|Any CPU
{70527617-7598-4AEF-B5BD-DB9186B8184B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{70527617-7598-4AEF-B5BD-DB9186B8184B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{70527617-7598-4AEF-B5BD-DB9186B8184B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{70527617-7598-4AEF-B5BD-DB9186B8184B}.Release|Any CPU.Build.0 = Release|Any CPU
{70527617-7598-4AEF-B5BD-DB9186B8184B}.ReleaseSigned|Any CPU.ActiveCfg = Release|Any CPU
{70527617-7598-4AEF-B5BD-DB9186B8184B}.ReleaseSigned|Any CPU.Build.0 = Release|Any CPU
{69C2EB6B-CD63-480A-89A0-C489706E9299}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{69C2EB6B-CD63-480A-89A0-C489706E9299}.Debug|Any CPU.Build.0 = Debug|Any CPU
{69C2EB6B-CD63-480A-89A0-C489706E9299}.Release|Any CPU.ActiveCfg = Release|Any CPU
{69C2EB6B-CD63-480A-89A0-C489706E9299}.Release|Any CPU.Build.0 = Release|Any CPU
{69C2EB6B-CD63-480A-89A0-C489706E9299}.ReleaseSigned|Any CPU.ActiveCfg = Release|Any CPU
{69C2EB6B-CD63-480A-89A0-C489706E9299}.ReleaseSigned|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{080B0477-7E52-4455-90AB-23BD13D1B1CE} = {047B121A-8B6F-48C5-9D72-BA3B434E8B72}
{FE34F78C-E6EC-448C-B675-DF9D9201A4E7} = {047B121A-8B6F-48C5-9D72-BA3B434E8B72}
{3436A126-EDC9-4060-8952-9A1BE34CDD95} = {047B121A-8B6F-48C5-9D72-BA3B434E8B72}
EndGlobalSection
EndGlobal

Просмотреть файл

@ -0,0 +1,63 @@
// ----------------------------------------------------------------------------------
//
// 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.
// ----------------------------------------------------------------------------------
namespace Microsoft.AzureStack.Commands.Admin.Test
{
using Microsoft.AzureStack.Commands.Admin.Test.Common;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Xunit;
/// <summary>
/// The filename and the class name is expected to be same
/// The filename should also match the file containing the PowerShell cmdlets called except for the extension
/// </summary>
public class AzureStackTests
{
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestResourceGroup()
{
AzStackTestRunner.NewInstance.RunPsTest("Test-ResourceGroup");
}
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestPlan()
{
AzStackTestRunner.NewInstance.RunPsTest("Test-Plan");
}
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestOffer()
{
AzStackTestRunner.NewInstance.RunPsTest("Test-Offer");
}
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestTenantSubscription()
{
AzStackTestRunner.NewInstance.RunPsTest("Test-TenantSubscription");
}
[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestManagedLocation()
{
AzStackTestRunner.NewInstance.RunPsTest("Test-ManagedLocation");
}
}
}

Просмотреть файл

@ -0,0 +1,730 @@
# ----------------------------------------------------------------------------------
#
# 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.
# ----------------------------------------------------------------------------------
<#
.Synopsis
Test the flow of Admin user creates a plan, offer and a tenant subscription for the specified user and deletes the created resources
The plan and offer contains the Subscriptions and Sql services by default.
.EXAMPLE
This example creates the subscription with a new plan and offer. It deletes the created resources as well
Test-TenantSubscription -SubscriptionUser "azurestackmachine\tenantuser1"
.EXAMPLE
This example creates the subscription with a new plan and offer. It does not delete the created resources
Test-TenantSubscription -SubscriptionUser "azurestackmachine\tenantuser1" -DoNotDelete
.EXAMPLE
This example creates the reseller subscription with a new plan and offer. It deletes the created resources as well
Test-TenantSubscription -Services @("Microsoft.Subscriptions")
.NOTES
The function is called only after Ignore-SelfSignedCert and Set-AzureStackEnvironment with the correct parameters
#>
function Test-TenantSubscription
{
param
(
# Specifies the user name for the subscription
[String] $SubscriptionUser="test@waptestad.onmicrosoft.com",
# Preferred Offer Name
[String] $OfferName,
# Preferred Plan Name
[String] $BasePlanName,
# Preferred Resource Group Name
[String] $ResourceGroupName,
# State of the Offer
[ValidateSet("Public", "Private", "Decommissioned")]
[String] $State = "Public",
# Specifies the services included in the plan, offer and subscription
[String[]] $Services=@("Microsoft.Subscriptions"),
# Specifies whether to delete the created resources
[Switch] $DoNotDelete,
# Specifies whether to delete the resource group
[Switch] $DoNotDeleteResourceGroup
)
if (!$OfferName)
{
$OfferName = "TestOffer0-TestTenantSubscription"
}
if (!$BasePlanName)
{
$BasePlanName = "TestPlan0-TestTenantSubscription"
}
if (!$ResourceGroupName)
{
$ResourceGroupName = "TestRG0-TestTenantSubscription"
}
New-ResourceGroup -ResourceGroupName $ResourceGroupName
New-Plan -PlanName $BasePlanName -ResourceGroupName $ResourceGroupName -Services $Services
$plan = Get-Plan -PlanName $BasePlanName -ResourceGroupName $ResourceGroupName
New-Offer -OfferName $offerName -BasePlanIds @($plan.Id) -ResourceGroupName $ResourceGroupName
$offer = Get-Offer -OfferName $offerName -ResourceGroupName $ResourceGroupName
Set-Offer -Offer $offer -ResourceGroup $ResourceGroupName -State $State
$publicOffer = Get-Offer -OfferName $offerName
#
[Microsoft.AzureStack.Commands.NewTenantSubscription]::SubscriptionIds.Enqueue("8E7DD69E-9AB2-44A1-94D8-F7BC8E12645E")
# Creating subscription as an admin
$subscription = New-Subscription -SubscriptionUser $SubscriptionUser -OfferId $offer.Id
if (!$DoNotDelete)
{
Remove-Subscription -TargetSubscriptionId $subscription.SubscriptionId
Remove-Offer -OfferName $offerName -ResourceGroupName $ResourceGroupName
Remove-Plan -PlanName $BasePlanName -ResourceGroupName $ResourceGroupName
if (!$DoNotDeleteResourceGroup)
{
Remove-ResourceGroup -ResourceGroupName $ResourceGroupName
}
}
}
<#
.Synopsis
Acquire token as Tenant user and then subscribe to offer and deletes the created plan, offer, subscription resources
The plan and offer contains the Subscriptions and Sql services by default. For simplicity, the tenant user is assumed to be the same account
.EXAMPLE
This example creates the subscription with a new plan and offer. It deletes the created resources as well
Test-TenantSubscribeToOffer
.EXAMPLE
This example creates the subscription with a new plan and offer. It does not delete the created resources
Test-TenantSubscribeToOffer -DoNotDelete
.EXAMPLE
This example creates the reseller subscription with a new plan and offer. It deletes the created resources as well
Test-TenantSubscribeToOffer -Services @("Microsoft.Subscriptions")
.NOTES
The function is called only after Ignore-SelfSignedCert and Set-AzureStackEnvironment with the correct parameters
#>
function Test-TenantSubscribeToOffer
{
param
(
[String[]] $Services=@("Microsoft.Subscriptions"),
# Preferred Resource Group Name
[String] $ResourceGroupName,
# Specifies whether to register the subscription with resource provider
[Switch] $RegisterWithResourceProvider,
# Specifies whether to delete the created resources
[Switch] $DoNotDelete,
# Specifies whether to delete the Resource Group
[Switch] $DoNotDeleteResourceGroup
)
$offerName = "TestOffer-TenantSubscribeToOffer2"
$planName = "TestPlan-TenantSubscribeToOffer2"
if (!$ResourceGroupName)
{
$ResourceGroupName = "TestRG-TenantSubscribeToOffer2"
}
$subDisplayName = "${TenantUserCredential.UserName} Test Subscription"
New-ResourceGroup -ResourceGroupName $ResourceGroupName
New-Plan -PlanName $planName -ResourceGroupName $ResourceGroupName -Services $Services
$plan = Get-Plan -PlanName $planName -ResourceGroupName $ResourceGroupName
New-Offer -OfferName $offerName -BasePlanIds @($plan.Id) -ResourceGroupName $ResourceGroupName
$offer = Get-Offer -OfferName $offerName -ResourceGroupName $ResourceGroupName
Set-Offer -Offer $offer -ResourceGroup $ResourceGroupName -State "Public"
# Get the created offer as the tenant
$tenantOffer = Get-Offer -OfferName $offerName
[Microsoft.AzureStack.Commands.NewTenantSubscription]::SubscriptionIds.Enqueue("8E7DD69E-9AA2-44A1-94D8-F7BC8E12645E")
# Subscribing to the offer as tenant
$subscription = New-Subscription -OfferId $tenantOffer.Id
$tenantSubscriptionId = $subscription.SubscriptionId
Set-AzureRmContext -SubscriptionId $tenantSubscriptionId
Write-Verbose "Selected subscription ID - $tenantSubscriptionId"
if($RegisterWithResourceProvider)
{
# Register with the resource providers to force subscrintion notification to the RPs
# Otherwise Suscription Notification happens automatically when the first resource is created (Only through templated deployment)
Register-ResourceProvider -Namespaces $Services
}
if (!$DoNotDelete)
{
if($RegisterWithResourceProvider)
{
# UnRegister with the resource providers so that the subscription could be deleted
Unregister-ResourceProvider -Namespaces $Services
}
# Set context to admin suscription so as to remove all the resources
Set-AzureRmContext -SubscriptionID $Global:AzureStackConfig.SubscriptionId
Remove-Subscription -TargetSubscriptionId $subscription.SubscriptionId
Remove-Offer -OfferName $offerName -ResourceGroupName $ResourceGroupName
Remove-Plan -PlanName $planName -ResourceGroupName $ResourceGroupName
if (!$DoNotDeleteResourceGroup)
{
Remove-ResourceGroup -ResourceGroupName $ResourceGroupName
}
}
}
<#
.Synopsis
Acquire token as Tenant user and then subscribe to the created offer, creates a storage account and then deletes the created plan, offer,
subscription, storage account resources
.EXAMPLE
This example creates the subscription with a new plan and offer. It deletes the created resources as well
Test-StorageAccount -TenantUserCredential $credential
#>
function Test-StorageAccount
{
param
(
[Parameter(Mandatory=$true)]
[PSCredential] $TenantUserCredential,
# Preferred Resource Group Name
[String] $ResourceGroupName,
# Specifies whether to delete the created resources
[Switch] $DoNotDelete,
# Specifies whether to delete the Resource Group
[Switch] $DoNotDeleteResourceGroup
)
$offerName = "TestOffer-" + [Guid]::NewGuid().ToString()
$planName = "TestPlan-" + [Guid]::NewGuid().ToString()
if (!$ResourceGroupName)
{
$ResourceGroupName = "TestRG-" + [Guid]::NewGuid().ToString()
}
$storageAccountRG = "TestSaRg-" + [Guid]::NewGuid().ToString()
$storageAccountName = "kataltest"
$services = @("Microsoft.Storage")
$subDisplayName = "$($TenantUserCredential.UserName) Test Subscription"
New-ResourceGroup -ResourceGroupName $ResourceGroupName
New-Plan -PlanName $planName -ResourceGroupName $ResourceGroupName -Services $Services
$plan = Get-Plan -PlanName $planName -ResourceGroupName $ResourceGroupName
New-Offer -OfferName $offerName -BasePlanIds @($plan.Id) -ResourceGroupName $ResourceGroupName
$offer = Get-Offer -OfferName $offerName -ResourceGroupName $ResourceGroupName
Set-Offer -Offer $offer -ResourceGroup $ResourceGroupName -State "Public"
# Login as the subscription user
$environment = Get-AzureRmEnvironment -Name $AzureStackConfig.AzureStackMachineName
Add-AzureRmAccount -Environment $environment -Credential $TenantUserCredential
# Get the created offer as the tenant
$tenantOffer = Get-Offer -OfferName $offerName
# Subscribing to the offer as tenant
$subscription = New-Subscription -OfferId $tenantOffer.Id
$tenantSubscriptionId = $subscription.SubscriptionId
Set-AzureRmContext -SubscriptionId $tenantSubscriptionId
Write-Verbose "Selected subscription ID - $tenantSubscriptionId"
# Register with the resource providers to force subscrintion notification to the RPs
# Otherwise Suscription Notification happens automatically when the first resource is created (Only through templated deployment)
Register-ResourceProvider -Namespaces $Services
New-ResourceGroup -ResourceGroupName $storageAccountRG
New-AzureRmStorageAccount -ResourceGroupName $storageAccountRG -Name $storageAccountName -Location $Global:AzureStackConfig.ArmLocation -Type Standard_LRS
$sa = Get-AzureRmStorageAccount -ResourceGroupName $storageAccountRG -Name $storageAccountName
Assert-NotNull $sa
if (!$DoNotDelete)
{
Remove-AzureRmStorageAccount -ResourceGroupName $storageAccountRG -Name $storageAccountName
Remove-ResourceGroup -ResourceGroupName $storageAccountRG
# UnRegister with the resource providers so that the subscription could be deleted
Unregister-ResourceProvider -Namespaces $Services
# Set context to admin suscription so as to remove all the resources
Set-AzureRmContext -SubscriptionID $Global:AzureStackConfig.SubscriptionId
Remove-Subscription -TargetSubscriptionId $subscription.SubscriptionId
Remove-Offer -OfferName $offerName -ResourceGroupName $ResourceGroupName
Remove-Plan -PlanName $planName -ResourceGroupName $ResourceGroupName
if (!$DoNotDeleteResourceGroup)
{
Remove-ResourceGroup -ResourceGroupName $ResourceGroupName
}
}
}
<#
.Synopsis
Creates and Deletes a new plan. The plan contains the Subscriptions and Sql services by default.
.EXAMPLE
This example creates and deletes a new plan
Test-Plan
.EXAMPLE
This example creates a plan named DefaultPlan and does not delete it
Test-Plan -Services @("Microsoft.Subscriptions") -PlanName DefaultPlan -DoNotDelete
.NOTES
The function is called only after Ignore-SelfSignedCert and Set-AzureStackEnvironment with the correct parameters
#>
function Test-Plan
{
param
(
[Alias("Name")]
[String] $PlanName,
[String[]] $Services=@("Microsoft.Subscriptions"),
# Preferred Resource Group Name
[String] $ResourceGroupName,
[ValidateSet("Public", "Private", "Decommissioned")]
[String] $State = "Public",
[Switch] $DoNotDelete,
# Specifies whether to delete the Resource Group
[Switch] $DoNotDeleteResourceGroup
)
if (!$PlanName)
{
$PlanName = "TestPlan"
}
if (!$ResourceGroupName)
{
$ResourceGroupName = "TestRG-Plan"
}
New-ResourceGroup -ResourceGroupName $ResourceGroupName
New-Plan -PlanName $PlanName -ResourceGroupName $ResourceGroupName -Services $Services
$plan = Get-Plan -PlanName $PlanName -ResourceGroupName $ResourceGroupName
Assert-NotNull $plan
Assert-True { $plan.Properties.DisplayName -eq $PlanName}
$plan.Properties.Description = "Test Description"
Set-Plan -Plan $plan -ResourceGroup $ResourceGroupName
$plan = Get-Plan -PlanName $PlanName -ResourceGroupName $ResourceGroupName
Assert-NotNull $plan
Assert-True { $plan.Properties.Description -eq "Test Description"}
if (!$DoNotDelete)
{
Remove-Plan -PlanName $PlanName -ResourceGroupName $ResourceGroupName
if (!$DoNotDeleteResourceGroup)
{
Remove-ResourceGroup -ResourceGroupName $ResourceGroupName
}
}
}
<#
.Synopsis
Creates and Deletes a new offer and plan. The plan and offer contains the Subscriptions and Sql services by default.
.EXAMPLE
This example creates and deletes a new plan and offer
Test-Offer
.EXAMPLE
This example creates a offer named DefaultOffer, a plan named DefaultPlan and does not delete them
Test-Offer -Services @("Microsoft.Subscriptions") -OfferName DefaultOffer -BasePlanName DefaultPlan -DoNotDelete
.NOTES
The function is called only after Ignore-SelfSignedCert and Set-AzureStackEnvironment with the correct parameters
#>
function Test-Offer
{
param
(
[Alias("Name")]
[String] $OfferName,
[String] $BasePlanName,
[String] $ResourceGroupName,
[String[]] $Services=@("Microsoft.Subscriptions"),
[ValidateSet("Public", "Private", "Decommissioned")]
[String] $State = "Public",
[Switch] $DoNotDelete,
[Switch] $DoNotDeleteResourceGroup
)
if (!$OfferName)
{
$OfferName = "TestOffer"
}
if (!$BasePlanName)
{
$BasePlanName = "TestPlan-TestOffer"
}
if (!$ResourceGroupName)
{
$ResourceGroupName = "TestRG-TestOffer"
}
New-ResourceGroup -ResourceGroupName $ResourceGroupName
$plan = New-Plan -PlanName $BasePlanName -ResourceGroupName $ResourceGroupName -Services $Services
$plan = Get-Plan -PlanName $BasePlanName -ResourceGroupName $ResourceGroupName
Assert-NotNull $plan
Assert-True { $plan.Properties.DisplayName -eq $BasePlanName}
New-Offer -OfferName $OfferName -BasePlanIds @($plan.Id) -ResourceGroupName $ResourceGroupName
$offer = Get-Offer -OfferName $OfferName -ResourceGroupName $ResourceGroupName
Set-Offer -Offer $offer -ResourceGroup $ResourceGroupName -State $State
if (!$DoNotDelete)
{
Remove-Offer -OfferName $OfferName -ResourceGroupName $ResourceGroupName
Remove-Plan -PlanName $BasePlanName -ResourceGroupName $ResourceGroupName
if (!$DoNotDeleteResourceGroup)
{
Remove-ResourceGroup -ResourceGroupName $ResourceGroupName
}
}
}
<#
.Synopsis
Creates an offer having public delegated offers. Creates a subscription for the user
.EXAMPLE
This example creates and deletes a new plan and offer
Test-Offer
.EXAMPLE
This example creates a offer named DefaultOffer, a plan named DefaultPlan and does not delete them
Test-Offer -Services @("Microsoft.Subscriptions") -OfferName DefaultOffer -BasePlanName DefaultPlan -DoNotDelete
.NOTES
The function is called only after Ignore-SelfSignedCert and Set-AzureStackEnvironment with the correct parameters
#>
function Test-DelegatedOffer
{
param
(
[Parameter(Mandatory=$true)]
[PSCredential] $TenantUserCredential,
[String[]] $Services=@("Microsoft.Subscriptions","Microsoft.Sql"),
[Switch] $DoNotDelete
)
$delegatedOfferName = "TestOfferDelegated-" + [Guid]::NewGuid().ToString()
$delegatedPlanName = "TestPlanDelegated-" + [Guid]::NewGuid().ToString()
$offerName = "TestOffer-" + [Guid]::NewGuid().ToString()
$planName = "TestPlan-" + [Guid]::NewGuid().ToString()
$rgName = "TestRG-" + [Guid]::NewGuid().ToString()
New-ResourceGroup -ResourceGroupName $rgName
New-Plan -PlanName $delegatedPlanName -ResourceGroupName $rgName -Services $Services
$delegatedPlan = Get-Plan -PlanName $delegatedPlanName -ResourceGroupName $rgName
Assert-NotNull $delegatedPlan
Assert-True {$delegatedPlan.Properties.DisplayName -eq $delegatedPlanName}
Set-Plan -Plan $delegatedPlan -ResourceGroup $rgName -State "Public"
New-Offer -OfferName $delegatedOfferName -BasePlan $delegatedPlan -ResourceGroupName $rgName
$delegatedOffer = Get-Offer -OfferName $delegatedOfferName -ResourceGroupName $rgName
Assert-NotNull $delegatedOffer
Set-Offer -Offer $delegatedOffer -ResourceGroup $rgName -State "Public"
# Creating a plan having a delegated offer
New-Plan -PlanName $planName -ResourceGroupName $rgName -Services $Services -DelegatedOfferName @($delegatedOfferName)
$plan = Get-Plan -PlanName $planName -ResourceGroupName $rgName
Assert-NotNull $plan
Assert-True {$plan.Properties.DisplayName -eq $planName}
Set-Plan -Plan $plan -ResourceGroup $rgName -State "Public"
New-Offer -OfferName $offerName -BasePlan $plan -ResourceGroupName $rgName
$offer = Get-Offer -OfferName $offerName -ResourceGroupName $rgName
Assert-NotNull $offer
Set-Offer -Offer $offer -ResourceGroup $rgName -State "Public"
$token = Get-EnvironmentSpecificToken -Credential $TenantUserCredential
# Check whether the plan created is visible for the tenant
$tenantOffer = Get-Offer -OfferName $offerName -Token $token
$subDisplayName = "$SubscriptionUser Test Subscription"
# Creating a subscription with Tenant Token
$subscription = New-Subscription -OfferId $tenantOffer.Id -Token $token
# Get the delegated offer, with the reseller token
$resellerViewOffer = Get-Offer -OfferName $delegatedOfferName -Token $token
Assert-NotNull $resellerViewOffer
Assert-True { $resellerViewOffer.DisplayName -eq $delegatedOfferName }
if (!$DoNotDelete)
{
Remove-Subscription -TargetSubscriptionId $subscription.SubscriptionId
Remove-Offer -OfferName $delegatedOfferName -ResourceGroupName $rgName
Remove-Plan -PlanName $delegatedPlanName -ResourceGroupName $rgName
Remove-Offer -OfferName $OfferName -ResourceGroupName $rgName
Remove-Plan -PlanName $PlanName -ResourceGroupName $rgName
if (!$DoNotDeleteResourceGroup)
{
Remove-ResourceGroup -ResourceGroupName $ResourceGroupName
}
}
}
<#
.Synopsis
Creates a new plan with Subscription service, then add a sql service to the plan
.NOTES
The function is called only after Ignore-SelfSignedCert and Set-AzureStackEnvironment with the correct parameters
#>
function Test-AddServiceToPlan
{
param
(
[Parameter(Mandatory=$true)]
[PSCredential] $TenantUserCredential,
[String] $ResourceGroupName,
[Switch] $DoNotDelete,
[Switch] $DoNotDeleteResourceGroup
)
$sqlOfferName = "TestOfferSQL-AddServiceToPlan1"
$sqlPlanName = "TestPlanSQL-AddServiceToPlan1"
$resellerPlanName = "TestPlanReseller-AddServiceToPlan1"
$resellerOfferName = "OfferReseller-AddServiceToPlan1"
$sqlServices= @("Microsoft.Sql")
$subscriptionServices= @("Microsoft.Subscriptions")
if (!$ResourceGroupName)
{
$ResourceGroupName = "TestRG-" + [Guid]::NewGuid().ToString()
}
New-ResourceGroup -ResourceGroupName $ResourceGroupName
New-Plan -PlanName $sqlPlanName -ResourceGroupName $ResourceGroupName -Services $sqlServices
$sqlPlan = Get-Plan -PlanName $sqlPlanName -ResourceGroupName $ResourceGroupName
Assert-NotNull $sqlPlan
Assert-True {$sqlPlan.Properties.DisplayName -eq $sqlPlanName}
New-Offer -OfferName $sqlOfferName -BasePlanIds @($sqlPlan.Id) -ResourceGroupName $ResourceGroupName
$sqlOffer = Get-Offer -OfferName $sqlOfferName -ResourceGroupName $ResourceGroupName
Assert-NotNull $sqlOffer
Set-Offer -Offer $sqlOffer -ResourceGroup $ResourceGroupName -State "Public"
# Creating a reseller plan having a delegated offer
New-Plan -PlanName $resellerPlanName -ResourceGroupName $ResourceGroupName -Services $subscriptionServices
$resellerplan = Get-Plan -PlanName $resellerPlanName -ResourceGroupName $ResourceGroupName
# Create a reseller Offer
New-Offer -OfferName $resellerOfferName -BasePlanIds @($resellerplan.Id) -ResourceGroupName $ResourceGroupName
$resellerOffer = Get-Offer -OfferName $resellerOfferName -ResourceGroupName $ResourceGroupName
Assert-NotNull $resellerOffer
Set-Offer -Offer $resellerOffer -ResourceGroup $ResourceGroupName -State "Public"
$token = Get-EnvironmentSpecificToken -Credential $TenantUserCredential
# Check whether the plan created is visible for the tenant
$tenantOffer = Get-Offer -OfferName $resellerOfferName -Token $token
$subDisplayName = "$SubscriptionUser Test Subscription"
# Creating a subscription with Tenant Token
$subscription = New-Subscription -OfferId $tenantOffer.Id -Token $token
# Add sql service to existing plan
$serviceQuotas = Get-ServiceQuotas -Services $sqlServices
$resellerplan.properties.quotaIds.Add($serviceQuotas)
Set-Plan -Plan $resellerplan -ResourceGroup $ResourceGroupName
$resellerplan = Get-Plan -PlanName $resellerPlanName -ResourceGroupName $ResourceGroupName
Assert-AreEqual -expected "2" -actual $resellerplan.properties.quotaIds.Count
# Get the subscription after adding a sql service to the plan
$updatedSubscription = Get-Subscription -SubscriptionId $subscription.SubscriptionId
if (!$DoNotDelete)
{
Remove-Subscription -TargetSubscriptionId $subscription.SubscriptionId
Remove-Offer -OfferName $resellerOfferName -ResourceGroupName $ResourceGroupName
Remove-Offer -OfferName $sqlOfferName -ResourceGroupName $ResourceGroupName
Remove-Plan -PlanName $sqlPlanName -ResourceGroupName $ResourceGroupName
if (!$DoNotDeleteResourceGroup)
{
Remove-ResourceGroup -PlanName $resellerPlanName -ResourceGroupName $ResourceGroupName
}
}
}
function Test-ManagedLocation
{
param
(
[String] $Location="chicago5"
)
$lattitude = 80.5
$longitude = -45.5
try
{
$loc = New-AzsLocation -Name $Location -DisplayName $Location -Latitude 80.5 -Longitude -45.5
Assert-NotNull $loc
Assert-AreEqual $loc.Name $Location
Assert-AreEqual $loc.Latitude $lattitude
Assert-AreEqual $loc.Longitude $longitude
Assert-AreEqual $loc.DisplayName $Location
$loc2 = Get-AzsLocation -Name $Location
Assert-AreEqual $loc2.Name $Location
Assert-AreEqual $loc2.Latitude $lattitude
Assert-AreEqual $loc2.Longitude $longitude
Assert-AreEqual $loc2.DisplayName $Location
$lattitude = 90.0
$loc2.Latitude = $lattitude
$loc2 | Set-AzsLocation
$loc3 = Get-AzsLocation -Name $Location
Assert-AreEqual $loc3.Name $Location
Assert-AreEqual $loc3.Latitude $lattitude
Assert-AreEqual $loc3.Longitude $longitude
Assert-AreEqual $loc3.DisplayName $Location
}
finally
{
Remove-AzsLocation -Name $Location
Assert-Throws {Get-AzsLocation -Name $Location }
}
}
<#
.Synopsis
Creates and Deletes a new ResourceGroup.
.EXAMPLE
This example creates and deletes a new resource group
Test-ResourceGroup
#>
function Test-ResourceGroup
{
param
(
[String] $ResourceGroupName ="TestRG1",
[Switch] $DoNotDelete
)
New-AzureRmResourceGroup -Name $ResourceGroupName -Location "local"
$rg = Get-AzureRmResourceGroup -Name $ResourceGroupName -Location "local"
Assert-NotNull $rg
if (!$DoNotDelete)
{
Remove-AzureRmResourceGroup -Name $ResourceGroupName -Force
}
}
<#
.Synopsis
Creates and Deletes a new GalleryItem.
#>
function Test-GalleryItem
{
$resourceGroupName = "GalleryItems"
$galleryItemName = "Microsoft.SimpleVMTemplate.1.0.0"
try
{
New-AzureRmResourceGroup -Name $resourceGroupName -Location local -Force
[Microsoft.AzureStack.Commands.AddGalleryItem]::GalleryPackageIds.Enqueue("1988820c-2bcc-4682-9991-bec44e6b8324")
$galleryItem = Add-AzsGalleryItem -ResourceGroupName $resourceGroupName -Name $galleryItemName -Path "Microsoft.SimpleVMTemplate.1.0.0.azpkg" Verbose
Assert-NotNull $galleryItem
$galleryItem = Get-AzsGalleryItem -Name $galleryItemName -ResourceGroupName $resourceGroupName
Assert-AreEqual $galleryItem.Name $galleryItemName
}
finally
{
Remove-AzsGalleryItem -Name $GalleryItemName -ResourceGroupName $resourceGroupName
Remove-ResourceGroup -ResourceGroupName $resourceGroupName
}
}

Просмотреть файл

@ -0,0 +1,189 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\..\packages\xunit.runner.visualstudio.2.1.0-beta4-build1109\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\..\..\packages\xunit.runner.visualstudio.2.1.0-beta4-build1109\build\net20\xunit.runner.visualstudio.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{080B0477-7E52-4455-90AB-23BD13D1B1CE}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.AzureStack.Commands.Admin.Test</RootNamespace>
<AssemblyName>Microsoft.AzureStack.Commands.Admin.Test</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<NuGetPackageImportStamp>8a60455a</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<RunCodeAnalysis>false</RunCodeAnalysis>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;SIGN</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisLogFile>bin\Release\Microsoft.AzureStack.Commands.Admin.Test.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<RunCodeAnalysis>false</RunCodeAnalysis>
<DelaySign>true</DelaySign>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Management.Automation\v4.0_3.0.0.0__31bf3856ad364e35\System.Management.Automation.dll</HintPath>
</Reference>
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Spatial, Version=5.6.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\System.Spatial.5.6.2\lib\net40\System.Spatial.dll</HintPath>
</Reference>
<Reference Include="Hyak.Common">
<HintPath>..\..\..\packages\Hyak.Common.1.0.3\lib\portable-net403+win+wpa81\Hyak.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common">
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common.NetFramework">
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.14-preview\lib\net40\Microsoft.Azure.ResourceManager.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.Edm, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Data.Edm.5.6.4\lib\net40\Microsoft.Data.Edm.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.OData, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Data.OData.5.6.4\lib\net40\Microsoft.Data.OData.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.Services.Client, Version=5.6.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Data.Services.Client.5.6.4\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Rest.ClientRuntime">
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.1.8.2\lib\net45\Microsoft.Rest.ClientRuntime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Threading.Tasks">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions.Desktop, Version=1.0.168.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Configuration">
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.3.2.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Storage, Version=4.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\WindowsAzure.Storage.4.3.0\lib\net40\Microsoft.WindowsAzure.Storage.dll</HintPath>
</Reference>
<Reference Include="Moq, Version=4.2.1402.2112, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Moq.4.2.1402.2112\lib\net40\Moq.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Test.Framework">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.6068.31305-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Test.HttpRecorder">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.6068.31305-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="xunit, Version=1.9.2.1705, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\xunit.1.9.2\lib\net20\xunit.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.extensions, Version=1.9.2.1705, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\xunit.extensions.1.9.2\lib\net20\xunit.extensions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.28.1\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.28.1\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AzureStackTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Common\Commands.Common.Authentication\Commands.Common.Authentication.csproj">
<Project>{d3804b64-c0d3-48f8-82ec-1f632f833c9e}</Project>
<Name>Commands.Common.Authentication</Name>
</ProjectReference>
<ProjectReference Include="..\..\Common\Commands.ScenarioTests.ResourceManager.Common\Commands.ScenarioTests.ResourceManager.Common.csproj">
<Project>{3436a126-edc9-4060-8952-9a1be34cdd95}</Project>
<Name>Commands.ScenarioTests.ResourceManager.Common</Name>
</ProjectReference>
<ProjectReference Include="..\Commands.AzureStackAdmin.Test\Common\Commands.AzureStackAdmin.Test.Common.csproj">
<Project>{fe34f78c-e6ec-448c-b675-df9d9201a4e7}</Project>
<Name>Commands.AzureStackAdmin.Test.Common</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="AzureStackTests.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Microsoft.SimpleVMTemplate.1.0.0.azpkg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
<None Include="SessionRecords\Microsoft.AzureStack.Commands.Admin.Test.AzureStackTests\TestManagedLocation.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.AzureStack.Commands.Admin.Test.AzureStackTests\TestOffer.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.AzureStack.Commands.Admin.Test.AzureStackTests\TestPlan.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.AzureStack.Commands.Admin.Test.AzureStackTests\TestResourceGroup.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="SessionRecords\Microsoft.AzureStack.Commands.Admin.Test.AzureStackTests\TestTenantSubscription.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" />
</Project>

Просмотреть файл

@ -0,0 +1,270 @@
#------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
#------------------------------------------------------------
function New-ResourceGroup
{
param
(
[Alias("Name")]
[Parameter(Mandatory=$true)]
[String] $ResourceGroupName,
[string] $SubscriptionId = $Global:AzureStackConfig.SubscriptionId,
[string] $Token = $Global:AzureStackConfig.Token
)
Write-Verbose "Creating the resource group : $ResourceGroupName"
if ($Global:AzureStackConfig.IsAad)
{
$rgCreated = New-AzureRmResourceGroup -Name $ResourceGroupName -Location $Global:AzureStackConfig.ArmLocation -Force
}
else
{
# Create resource group request
$putResourceGroup = @{
Uri = "{0}subscriptions/{1}/resourcegroups/{2}?api-version={3}" -f $Global:AzureStackConfig.AdminUri, $SubscriptionId, $ResourceGroupName, $Global:AzureStackConfig.ApiVersion
Method = "PUT"
Headers = @{ "Authorization" = "Bearer " + $Token }
ContentType = "application/json"
}
# Create resource group body
$rgBody = [pscustomobject]@{
Name = $ResourceGroupName
location = $Global:AzureStackConfig.ArmLocation
}
# Make the API call
$rgCreated = $rgBody | ConvertTo-Json | Invoke-RestMethod @putResourceGroup
}
Write-Verbose "Created the resource group successfully : $ResourceGroupName"
# TODO: Changes needed when we have tests with reseller' tenant creating resources
$Level = 0
if ($Token -ne $Global:AzureStackConfig.Token)
{
$Level = 1
}
$Global:CreatedResourceGroups += @{
ResourceGroupName = $ResourceGroupName
SubscriptionId = $SubscriptionId
Token = $Token
Level = $Level
}
#ToDo: Get RG and assert to make sure RG is created
return $rgCreated
}
function Remove-ResourceGroup
{
param
(
[Alias("Name")]
[Parameter(Mandatory=$true)]
[String] $ResourceGroupName,
[String] $SubscriptionId = $Global:AzureStackConfig.SubscriptionId,
[String] $Token = $Global:AzureStackConfig.Token
)
Write-Verbose "Deleting the resource group: $ResourceGroupName"
if($Global:AzureStackConfig.IsAad)
{
# Deletes the resources it contains as well
Remove-AzureRmResourceGroup -Name $ResourceGroupName -Force
}
else
{
# Delete resource group request
$deleteResourceGroup = @{
Uri = "{0}subscriptions/{1}/resourcegroups/{2}?api-version={3}" -f $Global:AzureStackConfig.AdminUri, $SubscriptionId, $ResourceGroupName, $Global:AzureStackConfig.ApiVersion
Method = "DELETE"
Headers = @{ "Authorization" = "Bearer " + $Token }
ContentType = "application/json"
}
Invoke-RestMethod @deleteResourceGroup
}
Assert-ResourceGroupDeletion -ResourceGroupName $ResourceGroupName -SubscriptionId $SubscriptionId
Write-Verbose "Deleted the resource group successfully: $ResourceGroupName"
}
function Get-ResourceGroup
{
param
(
[String] $ResourceGroupName,
[String] $SubscriptionId = $Global:AzureStackConfig.SubscriptionId,
[String] $Token = $Global:AzureStackConfig.Token
)
if($ResourceGroupName)
{
Write-Verbose "Getting the resourceGroup $ResourceGroupName"
if($Global:AzureStackConfig.IsAad)
{
return Get-AzureRmResourceGroup -Name $ResourceGroupName
}
$getResourceGroup = @{
Uri = $Global:AzureStackConfig.AdminUri + "subscriptions/{0}/resourcegroups/{1}?api-version={2}&includeDetails=true" -f $SubscriptionId, $ResourceGroupName, $Global:AzureStackConfig.ApiVersion
Method = "GET"
Headers = @{ "Authorization" = "Bearer " + $Token }
ContentType = "application/json"
}
}
else
{
# If resourcegroup name is not specified return all the resource groups under the subscription
Write-Verbose "Getting all the resourceGroups for the subscription $SubscriptionId"
if($Global:AzureStackConfig.IsAad)
{
return Get-AzureRmResourceGroup
}
$getResourceGroup = @{
Uri = $Global:AzureStackConfig.AdminUri + "subscriptions/{0}/resourcegroups?api-version={1}&includeDetails=true" -f $SubscriptionId, $Global:AzureStackConfig.ApiVersion
Method = "GET"
Headers = @{ "Authorization" = "Bearer " + $Token }
ContentType = "application/json"
}
}
$resourceGroups = Invoke-RestMethod @getResourceGroup
return $resourceGroups.value
}
function Get-ResourceGroupDeployments
{
param
(
[Parameter(Mandatory=$true)]
[String] $ResourceGroupName,
[String] $SubscriptionId = $Global:AzureStackConfig.SubscriptionId,
[String] $Token = $Global:AzureStackConfig.Token
)
Write-Verbose "Getting the Deployment details for the resourceGroup $ResourceGroupName"
if($Global:AzureStackConfig.IsAad)
{
#TODO: implement this
}
$getResourceGroupDeployments = @{
Uri = $Global:AzureStackConfig.AdminUri + "subscriptions/{0}/resourcegroups/{1}/deployments?api-version=2014-04-01-preview&includeDetails=true" -f $SubscriptionId, $ResourceGroupName
Method = "GET"
Headers = @{ "Authorization" = "Bearer " + $Token }
ContentType = "application/json"
}
return Invoke-RestMethod @getResourceGroupDeployments
}
function Get-ResourceGroupResources
{
param
(
[Parameter(Mandatory=$true)]
[String] $ResourceGroupName,
[String] $SubscriptionId = $Global:AzureStackConfig.SubscriptionId,
[String] $Token = $Global:AzureStackConfig.Token
)
Write-Verbose "Getting the resource details for the resourceGroup $ResourceGroupName"
if($Global:AzureStackConfig.IsAad)
{
#TODO: implement this
}
$getResources = @{
Uri = $Global:AzureStackConfig.AdminUri + "subscriptions/{0}/resourcegroups/{1}/resources?api-version=2014-04-01-preview" -f $SubscriptionId, $ResourceGroupName
Method = "GET"
Headers = @{ "Authorization" = "Bearer " + $Token }
ContentType = "application/json"
}
return Invoke-RestMethod @getResources
}
function Get-FilterQueryParam
{
param
(
[Parameter(Mandatory=$true)]
[String] $ResourceType,
[Parameter(Mandatory=$true)]
[PsObject[]] $Subscriptions
)
$filterString = "("
for($i=0; $i -le $Subscriptions.Length-2; $i++)
{
$filterString += "subscriptionId eq '"+ $Subscriptions[$i].subscriptionId +"' or "
}
$filterString += "subscriptionId eq '"+ $Subscriptions[$i].subscriptionId +"'"
$filterString += ") and (resourceType eq '"
$filterString += $ResourceType + "')"
$encodedString = [System.Web.HttpUtility]::UrlEncode($filterString)
return $encodedString
}
function Get-AllSusbscriptionsResources
{
param
(
[Parameter(Mandatory=$true)]
[String] $ResourceType,
[Parameter(Mandatory=$true)]
[PsObject[]] $Subscriptions,
[String] $Token = $Global:AzureStackConfig.Token
)
Write-Verbose "Getting the Deployment details for the resourceGroup $ResourceGroupName"
if($Global:AzureStackConfig.IsAad)
{
#TODO: implement this
}
$filterParam = '$filter='
$filterParam += Get-FilterQueryParam -ResourceType $ResourceType -Subscriptions $Subscriptions
$getResourceGroup = @{
Uri = $Global:AzureStackConfig.AdminUri + "resources?api-version=2014-04-01-preview&" + $filterParam
Method = "GET"
Headers = @{ "Authorization" = "Bearer " + $Token }
ContentType = "application/json"
}
return Invoke-RestMethod @getResourceGroup
}

Просмотреть файл

@ -0,0 +1,78 @@
# ----------------------------------------------------------------------------------
#
# 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.
# ----------------------------------------------------------------------------------
<#
.Synopsis
Verify that the resourcegroup is deleted
#>
# TODO: Change this assertion to query on Location resposne of the delete call
function Assert-ResourceGroupDeletion
{
param
(
[Parameter(Mandatory=$true)]
[String] $ResourceGroupName,
[String] $SubscriptionId = $Global:AzureStackConfig.SubscriptionId
)
Assert-Throws {Retry-Function {Get-ResourceGroup -ResourceGroupName $ResourceGroupName -SubscriptionId $SubscriptionId} -maxTries 12 -intervalInSeconds 20}
}
<#
.Synopsis
Verify that the resource is deleted
#>
function Assert-ResourceDeletion
{
param
(
[Parameter(Mandatory=$true)]
[ScriptBlock] $ScriptBlock
)
Assert-ThrowsContains {Retry-Function {&$ScriptBlock} -maxTries 12 -intervalInSeconds 20 } -compare "ResourceNotFound"
}
<#
.Synopsis
Verify that the subscription is deleted
#>
function Assert-SubscriptionDeletion
{
param
(
[Parameter(Mandatory=$true)]
[ScriptBlock] $ScriptBlock
)
Assert-ThrowsContains {Retry-Function {&$ScriptBlock} -maxTries 12 -intervalInSeconds 20 } -compare "SubscriptionNotFound"
}
<#
.Synopsis
Verify that the sqldatabase is deleted
#>
function Assert-SqlDatabaseDeletion
{
param
(
[Parameter(Mandatory=$true)]
[ScriptBlock] $ScriptBlock
)
Assert-Throws {Retry-Function {&$ScriptBlock} -maxTries 12 -intervalInSeconds 20 }
}

Просмотреть файл

@ -0,0 +1,169 @@
function Set-AzureStackEnvironment
{
[CmdletBinding(DefaultParameterSetName="WindowsAuth")]
param
(
[Parameter(Mandatory=$true)]
[String] $AzureStackMachineName,
[Parameter(Mandatory=$true)]
[String] $ArmEndpoint,
[Parameter(Mandatory=$true)]
[String] $GalleryEndpoint,
[Parameter(Mandatory=$false, ParameterSetName="WindowsAuth")]
[String] $WindowsAuthEndpoint,
[Parameter(Mandatory=$true, ParameterSetName="AadEnvironment")]
[String] $AadTenantId,
[Parameter(Mandatory=$true, ParameterSetName="AadEnvironment")]
[String] $AadApplicationId,
[Parameter(Mandatory=$false, ParameterSetName="AadEnvironment")]
[String] $AadGraphUri = "https://graph.windows.net/",
[Parameter(Mandatory=$false, ParameterSetName="AadEnvironment")]
[String] $AadLoginUri = "https://login.windows.net/"
)
ValidateUri -Uri $ArmEndpoint
ValidateUri -Uri $GalleryEndpoint
ValidateUri -Uri $AadGraphUri
ValidateUri -Uri $AadLoginUri
if (-not $WindowsAuthEndpoint)
{
$WindowsAuthEndpoint = "https://{0}:12998" -f $AzureStackMachineName
}
Set-AzureStackWithAadEnvironment -AzureStackMachineName $AzureStackMachineName -ArmEndpoint $ArmEndpoint -GalleryEndpoint $GalleryEndpoint -AadGraphUri $AadGraphUri -AadLoginUri $AadLoginUri -AadTenantId $AadTenantId -AadApplicationId $AadApplicationId
$isAad = $PSCmdlet.ParameterSetName -eq "AadEnvironment"
$azStackPowershellGuid = "1950a258-227b-4e31-a9cf-717495945fc2"
$DebugPreference="Continue"
Write-Debug "Before Get-AzureRMSubscription"
$adminSubscription = Get-AzureRmSubscription -SubscriptionName "Default Provider Subscription"
Write-Debug "After Get-AzureRMSubscription"
$adminSubscriptionId = $adminSubscription.SubscriptionId
Set-AzureRmContext -SubscriptionId $adminSubscriptionId
$location = "local"
$global:AzureStackConfig = [PSCustomObject]@{
AzureStackMachineName = $AzureStackMachineName
ApiVersion = "2015-11-01"
ArmLocation = $location
Token = $token
SubscriptionId = $adminSubscriptionId
AdminUri = $ArmEndpoint
IsAad = $isAad
AadTenantId = $AadTenantId
AzStackPsAadAppGuid = $azStackPowershellGuid
AadApplicationId = $AadApplicationId
AadLoginUri = $AadLoginUri
WindowsAuthEndpoint = $WindowsAuthEndpoint
}
Write-Verbose "Environment Context set for $AzureStackMachineName"
}
function ValidateUri
{
param
(
[Parameter(Mandatory=$true)]
[String] $Uri
)
if (($uri -as [System.URI]) -eq $null)
{
throw "$uri is not a valid URI"
}
if (-not $uri.EndsWith("/"))
{
throw "$uri does not ends with /"
}
}
function Get-EnvironmentSpecificToken
{
param
(
[Parameter(Mandatory=$true)]
[PSCredential] $Credential
)
if ($Global:AzureStackConfig.IsAAD)
{
$authEndPoint="$($Global:AzureStackConfig.AadLoginUri)$($Global:AzureStackConfig.AadTenantId)/oauth2"
return Get-AzureStackToken -Authority $authEndPoint -AadTenantId $Global:AzureStackConfig.AadTenantId -Resource $Global:AzureStackConfig.AadApplicationId -ClientId $Global:AzureStackConfig.AzStackPsAadAppGuid -Credential $Credential -Verbose
}
return Get-AzureStackToken -Authority $Global:AzureStackConfig.WindowsAuthEndpoint -Credential $Credential -ErrorAction Stop
}
function Set-AzureStackWithAadEnvironment
{
param
(
[Parameter(Mandatory=$true)]
[String] $AzureStackMachineName,
[Parameter(Mandatory=$true)]
[String] $ArmEndpoint,
[Parameter(Mandatory=$true)]
[String] $GalleryEndpoint,
[Parameter(Mandatory=$false)]
[String] $AadGraphUri,
[Parameter(Mandatory=$true)]
[String] $AadLoginUri,
[Parameter(Mandatory=$true)]
[String] $AadTenantId,
[Parameter(Mandatory=$true)]
[String] $AadApplicationId
)
$Global:ErrorActionPreference='SilentlyContinue'
Remove-AzureRmEnvironment -Name $AzureStackMachineName -Force -ErrorAction SilentlyContinue
$Global:ErrorActionPreference='Stop'
Add-AzureRmEnvironment -Name $AzureStackMachineName `
-ActiveDirectoryEndpoint ("$AadLoginUri$AadTenantId/") `
-ActiveDirectoryServiceEndpointResourceId $AadApplicationId `
-ResourceManagerEndpoint ($ArmEndpoint) `
-GalleryEndpoint ($GalleryEndpoint) `
-GraphEndpoint $AadGraphUri
$environment = Get-AzureRmEnvironment -Name $AzureStackMachineName
#Login-AzureRmAccount -Environment $environment -Credential $Credential
Get-AzureRmSubscription -SubscriptionName "Default Provider Subscription" | Set-AzureRmContext
}
function Get-DefaultLocation
{
param
(
[Parameter(Mandatory=$true)]
[String] $AdminUri,
[Parameter(Mandatory=$true)]
[String] $SubscriptionId,
[Parameter(Mandatory=$true)]
[String] $Token
)
# TODO: always returning the first region, change if neede
$locations = Get-AzsLocation
return $locations[0].Name
}

Просмотреть файл

@ -0,0 +1,243 @@
// ----------------------------------------------------------------------------------
//
// 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.
// ----------------------------------------------------------------------------------
namespace Microsoft.AzureStack.Commands.Admin.Test.Common
{
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Globalization;
using System.IO;
using System.Linq;
using Microsoft.Azure.Commands.Common.Authentication;
using Microsoft.Azure.Gallery;
using Microsoft.Azure.Management.Authorization;
using Microsoft.Azure.Management.Resources;
using Microsoft.Azure.Subscriptions;
using Microsoft.Azure.Test;
using Microsoft.AzureStack.Management;
using Microsoft.WindowsAzure.Commands.Common.Test.Mocks;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
public sealed class AzStackTestRunner
{
private EnvironmentSetupHelper helper;
private CSMTestEnvironmentFactory armTestEnvironmentFactory;
private const string DefaultApiVersion = "2015-11-01";
public AzureStackClient azureStackClient;
public ResourceManagementClient ResourceManagementClient { get; private set; }
public SubscriptionClient SubscriptionClient { get; private set; }
public GalleryClient GalleryClient { get; private set; }
public string ApiVersion { get; set; }
public AuthorizationManagementClient AuthorizationManagementClient { get; private set; }
public static AzStackTestRunner NewInstance
{
get
{
return new AzStackTestRunner() { ApiVersion = AzStackTestRunner.DefaultApiVersion };
}
}
public AzStackTestRunner()
{
helper = new EnvironmentSetupHelper();
}
public void RunPsTest(string testScript)
{
var callingClassType = TestUtilities.GetCallingClass(2);
var mockName = TestUtilities.GetCurrentMethodName(2);
RunPsTestWorkflow(
() => SetupAzureStackEnvironment(testScript),
// no custom initializer
null,
// no custom cleanup
null,
callingClassType,
mockName);
}
private List<string> SetupCommonModules()
{
List<string> modules = new List<string>();
modules = new List<string>();
bool aadEnvironement = Convert.ToBoolean(ReadAppSettings("AadEnvironment"), CultureInfo.InvariantCulture);
modules.Add(@"AssertResources.psm1");
modules.Add(@"GlobalVariables.psm1");
modules.Add(@"AuthOperations.psm1");
modules.Add(@"CommonOperations.psm1");
modules.Add(@"ArmOperations.psm1");
modules.Add(@"Utilities.psm1");
return modules;
}
private string[] SetupAzureStackEnvironment(string testScript)
{
List<string> scripts =new List<string>();
string azureStackMachine = "azurestack";
bool aadEnvironment = Convert.ToBoolean(ReadAppSettings("AadEnvironment"), CultureInfo.InvariantCulture);
string aadTenantId = ReadAppSettings("AadTenantId", mandatory: false);
string aadApplicationId = ReadAppSettings("AadApiApplicationId", mandatory: false);
string armEndpoint = ReadAppSettings("ArmEndpoint", mandatory: false);
string galleryEndpoint = ReadAppSettings("GalleryEndpoint", mandatory: false);
string aadGraphUri = ReadAppSettings("AadGraphUri", mandatory: false);
string aadLoginuri = ReadAppSettings("AadLoginUri", mandatory: false);
string setupAzureStackEnvironmentPs;
if (aadEnvironment)
{
setupAzureStackEnvironmentPs = string.Format(
CultureInfo.InvariantCulture,
"Set-AzureStackEnvironment -AzureStackMachineName {0} -AadTenantId {1} -AadApplicationId {2} -ArmEndpoint {3} -GalleryEndpoint {4} -AadGraphUri {5} -AadLoginUri {6}",
azureStackMachine,
aadTenantId,
aadApplicationId,
armEndpoint,
galleryEndpoint,
aadGraphUri,
aadLoginuri
);
}
else
{
setupAzureStackEnvironmentPs = "Set-AzureStackEnvironment -AzureStackMachineName " + azureStackMachine;
}
//string selfSignedCertPs = "Ignore-SelfSignedCert";
//scripts.Add(selfSignedCertPs);
scripts.Add(setupAzureStackEnvironmentPs);
scripts.Add(testScript);
return scripts.ToArray();
}
private static string ReadAppSettings(string key, bool mandatory = true)
{
if (ConfigurationManager.AppSettings.AllKeys.Contains(key, StringComparer.OrdinalIgnoreCase))
{
return ConfigurationManager.AppSettings[key];
}
if (mandatory)
{
throw new ConfigurationErrorsException(string.Format(CultureInfo.InvariantCulture, "The app settings key {0} is missing in the settings file", key));
}
return null;
}
private void RunPsTestWorkflow(
Func<string[]> scriptBuilder,
Action<CSMTestEnvironmentFactory> initialize,
Action cleanup,
string callingClassType,
string mockName)
{
using (UndoContext context = UndoContext.Current)
{
context.Start(callingClassType, mockName);
this.armTestEnvironmentFactory = new CSMTestEnvironmentFactory();
if (initialize != null)
{
initialize(this.armTestEnvironmentFactory);
}
helper.SetupEnvironment(AzureModule.AzureResourceManager);
SetupManagementClients();
var callingClassName = callingClassType
.Split(new[] { "." }, StringSplitOptions.RemoveEmptyEntries)
.Last();
List<string> modules = this.SetupCommonModules();
modules.Add(callingClassName + ".ps1");
modules.Add(helper.RMProfileModule);
modules.Add(helper.RMResourceModule);
modules.Add(helper.GetRMModulePath("AzureRM.AzurestackAdmin.psd1"));
helper.SetupModules(AzureModule.AzureResourceManager, modules.ToArray());
try
{
if (scriptBuilder != null)
{
var psScripts = scriptBuilder();
if (psScripts != null)
{
helper.RunPowerShellTest(psScripts);
}
}
}
finally
{
if (cleanup != null)
{
cleanup();
}
}
}
}
private void SetupManagementClients()
{
ResourceManagementClient = GetResourceManagementClient();
SubscriptionClient = GetSubscriptionClient();
GalleryClient = GetGalleryClient();
AuthorizationManagementClient = this.GetAuthorizationManagementClient();
azureStackClient = TestBase.GetServiceClient<AzureStackClient>(this.armTestEnvironmentFactory, this.ApiVersion);
this.SetupManagementClients(ResourceManagementClient, SubscriptionClient, GalleryClient, AuthorizationManagementClient, azureStackClient);
}
private void SetupManagementClients(params object[] initializedManagementClients)
{
AzureSession.ClientFactory = new MockClientFactory(initializedManagementClients);
}
private ResourceManagementClient GetResourceManagementClient()
{
return TestBase.GetServiceClient<ResourceManagementClient>(this.armTestEnvironmentFactory);
}
private GalleryClient GetGalleryClient()
{
return TestBase.GetServiceClient<GalleryClient>(this.armTestEnvironmentFactory);
}
private SubscriptionClient GetSubscriptionClient()
{
return TestBase.GetServiceClient<SubscriptionClient>(this.armTestEnvironmentFactory);
}
private AuthorizationManagementClient GetAuthorizationManagementClient()
{
return TestBase.GetServiceClient<AuthorizationManagementClient>(this.armTestEnvironmentFactory);
}
}
}

Просмотреть файл

@ -0,0 +1,152 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{FE34F78C-E6EC-448C-B675-DF9D9201A4E7}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.AzureStack.Commands.Admin.Test.Common</RootNamespace>
<AssemblyName>Microsoft.AzureStack.Commands.Admin.Test.Common</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<NuGetPackageImportStamp>8a60455a</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<RunCodeAnalysis>false</RunCodeAnalysis>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release</OutputPath>
<DefineConstants>TRACE;SIGN</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisLogFile>bin\Release\Microsoft.AzureStack.Commands.Admin.Test.Common.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<RunCodeAnalysis>false</RunCodeAnalysis>
<DelaySign>true</DelaySign>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Azure.Gallery">
<HintPath>..\..\..\..\packages\Microsoft.Azure.Gallery.2.6.2-preview\lib\net40\Microsoft.Azure.Gallery.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Management.Authorization">
<HintPath>..\..\..\..\packages\Microsoft.Azure.Management.Authorization.2.0.1\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.ResourceManager">
<HintPath>..\..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.14-preview\lib\net40\Microsoft.Azure.ResourceManager.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory">
<HintPath>..\..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.28.1\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms">
<HintPath>..\..\..\..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.2.28.1\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.WindowsForms.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="Microsoft.Azure.Common.NetFramework">
<HintPath>..\..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common">
<HintPath>..\..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AzureStack.Management">
<HintPath>..\..\..\..\packages\Microsoft.AzureStack.Management.0.10.9-preview\lib\net45\Microsoft.AzureStack.Management.dll</HintPath>
</Reference>
<Reference Include="Hyak.Common">
<HintPath>..\..\..\..\packages\Hyak.Common.1.0.3\lib\net40\Hyak.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\..\packages\Microsoft.Rest.ClientRuntime.2.0.1\lib\net45\Microsoft.Rest.ClientRuntime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Threading.Tasks">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Threading.Tasks.Extensions.Desktop, Version=1.0.168.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
</Reference>
<Reference Include="Moq, Version=4.2.1402.2112, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\packages\Moq.4.2.1402.2112\lib\net40\Moq.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Test.Framework">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.6068.31305-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Test.HttpRecorder">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.0.6068.31305-prerelease\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AzStackTestRunner.cs" />
</ItemGroup>
<ItemGroup>
<None Include="ArmOperations.psm1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="AssertResources.psm1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="AuthOperations.psm1">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="CommonOperations.psm1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="GlobalVariables.psm1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
<None Include="Utilities.psm1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\Common\Commands.Common.Authentication\Commands.Common.Authentication.csproj">
<Project>{d3804b64-c0d3-48f8-82ec-1f632f833c9e}</Project>
<Name>Commands.Common.Authentication</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Common\Commands.ScenarioTests.ResourceManager.Common\Commands.ScenarioTests.ResourceManager.Common.csproj">
<Project>{3436a126-edc9-4060-8952-9a1be34cdd95}</Project>
<Name>Commands.ScenarioTests.ResourceManager.Common</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" />
</Project>

Просмотреть файл

@ -0,0 +1,433 @@
#------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
#------------------------------------------------------------
function Get-SqlRpQuotas
{
$getSqlQuota = @{
Uri = "{0}subscriptions/{1}/providers/Microsoft.Sql.Admin/locations/{2}/quotas?api-version=2014-04-01-preview" -f $Global:AzureStackConfig.AdminUri, $Global:AzureStackConfig.SubscriptionId, $Global:AzureStackConfig.ArmLocation
Method = "GET"
Headers = @{ "Authorization" = "Bearer " + $Global:AzureStackConfig.Token }
ContentType = "application/json"
}
$sqlQuota = Invoke-RestMethod @getSqlQuota
Write-Output $sqlQuota.value
}
function Get-SubscriptionsDefaultQuota
{
$defaultQuota = "/subscriptions/{0}/providers/Microsoft.Subscriptions.Admin/locations/local/quotas/delegatedProviderQuota" -f $Global:AzureStackConfig.SubscriptionId
Write-Output $defaultQuota
}
function Get-SqlRpDefaultQuota
{
$sqlQuotas=Get-SqlRpQuotas
return $sqlQuotas[0].id
}
function Get-StorageDefaultQuota
{
# Assumption - RP location is same as ARM
# Idempotent PUT call, creates it if does not exist
$quota = New-StorageQuota -QuotaName "Basic" -Location $Global:AzureStackConfig.ArmLocation
Write-Output $quota.Id
}
function Get-ComputeDefaultQuota
{
# Assumption - RP location is same as ARM
# Idempotent PUT call, creates it if does not exist
$quota = New-ComputeQuota -QuotaName "Basic" -Location $Global:AzureStackConfig.ArmLocation
Write-Output $quota.Id
}
function Get-NetworkDefaultQuota
{
# Assumption - RP location is same as ARM
# Idempotent PUT call, creates it if does not exist
$quota = New-NetworkQuota -QuotaName "Basic" -Location $Global:AzureStackConfig.ArmLocation
Write-Output $quota.Id
}
function Get-KeyvaultDefaultQuota
{
$getKeyvaultQuota = @{
Uri = "{0}subscriptions/{1}/providers/Microsoft.Keyvault.Admin/locations/{2}/quotas?api-version=2014-04-01-preview" -f $Global:AzureStackConfig.AdminUri, $Global:AzureStackConfig.SubscriptionId, $Global:AzureStackConfig.ArmLocation
Method = "GET"
Headers = @{ "Authorization" = "Bearer " + $Global:AzureStackConfig.Token }
ContentType = "application/json"
}
# keyvault Creates only one default quota 'unlimited' as part of the deployment, just get that
$keyvaultQuota = Invoke-RestMethod @getKeyvaultQuota
Write-Output $keyvaultQuota.value.Id
}
function Set-Offer
{
param
(
[Parameter(Mandatory=$true)]
[PSObject] $Offer,
[Parameter(Mandatory=$true)]
[String] $ResourceGroup,
[Parameter(Mandatory=$true)]
[ValidateSet("Public", "Private", "Decommissioned")]
[String] $State
)
$Offer.properties.state = $State
$Offer | Set-AzsOffer -ResourceGroupName $ResourceGroup
Write-Verbose "$Offer state got updated to $State"
}
function Set-Plan
{
param
(
[Parameter(Mandatory=$true)]
[PSObject] $Plan,
[Parameter(Mandatory=$true)]
[String] $ResourceGroup
)
$Plan | Set-AzsPlan -ResourceGroupName $ResourceGroup
Write-Verbose "$Plan state got updated to $State"
}
function Get-ServiceQuotas
{
param
(
[Parameter(Mandatory=$true)]
[String[]] $Services
)
$serviceQuotas = @()
foreach ($service in $Services)
{
switch($service)
{
"Microsoft.Sql" {
$serviceQuotas += Get-SQLRPDefaultQuota
}
"Microsoft.Subscriptions" {
$serviceQuotas += Get-SubscriptionsDefaultQuota
}
"Microsoft.Storage" {
$serviceQuotas += Get-StorageDefaultQuota
}
"Microsoft.Compute" {
$serviceQuotas += Get-ComputeDefaultQuota
}
"Microsoft.Network" {
$serviceQuotas += Get-NetworkDefaultQuota
}
"Microsoft.Keyvault" {
$serviceQuotas += Get-KeyvaultDefaultQuota
}
Default { throw "Wrong service name provided" }
}
}
return $serviceQuotas
}
function New-Plan
{
param
(
[Alias("Name")]
[Parameter(Mandatory=$true)]
[String] $PlanName,
[Parameter(Mandatory=$true)]
[String[]] $Services,
[Parameter(Mandatory=$true)]
[String] $ResourceGroupName
)
Write-Verbose "Creating the plan: $PlanName"
$quotaIds = Get-ServiceQuotas -Services $Services
$plan = New-AzsPlan -Name $PlanName -DisplayName $PlanName -ArmLocation $Global:AzureStackConfig.ArmLocation -ResourceGroupName $ResourceGroupName -QuotaIds $quotaIds
Write-Verbose "Plan created successfully: $PlanName"
$plan = Get-Plan -PlanName $PlanName -ResourceGroupName $ResourceGroupName
Assert-NotNull $plan
Assert-True { $plan.Properties.DisplayName -eq $PlanName}
Write-Output $plan
}
function Remove-Plan
{
param
(
[Alias("Name")]
[Parameter(Mandatory=$true)]
[String] $PlanName,
[Parameter( Mandatory=$true)]
[String] $ResourceGroupName
)
Remove-AzsPlan -Name $PlanName -ResourceGroupName $ResourceGroupName
Assert-ResourceDeletion {Get-Plan -PlanName $PlanName -ResourceGroupName $ResourceGroupName}
Write-Verbose "Deleted the plan successfully: $PlanName"
}
function Get-Plan
{
param
(
[Alias("Name")]
[Parameter(Mandatory=$true)]
[String] $PlanName,
[Parameter(Mandatory=$true)]
[String] $ResourceGroupName
)
return Get-AzsPlan -Name $PlanName -ResourceGroupName $ResourceGroupName
}
function New-Offer
{
param
(
[Alias("Name")]
[Parameter(Mandatory=$false)]
[String] $OfferName,
[Parameter(Mandatory=$false)]
[string[]] $BasePlanIds,
[Parameter(ValueFromPipeline=$true, Mandatory=$true, ValueFromPipelineByPropertyName=$true)]
[String] $ResourceGroupName
)
$offer = New-AzsOffer -Name $OfferName -DisplayName $OfferName -State Private -BasePlanIds $BasePlanIds -ArmLocation $AzureStackConfig.ArmLocation -ResourceGroupName $ResourceGroupName
Assert-NotNull $offer
Assert-True {$offer.Properties.DisplayName -eq $OfferName}
return $offer
}
function Remove-Offer
{
param
(
[Alias("Name")]
[Parameter(Mandatory=$true)]
[String] $OfferName,
[Parameter( Mandatory=$true)]
[String] $ResourceGroupName
)
$offer = Remove-AzsOffer -Name $OfferName -ResourceGroupName $ResourceGroupName
Assert-ResourceDeletion {Get-Offer -OfferName $OfferName -ResourceGroupName $ResourceGroupName}
Write-Verbose "Deleted the offer successfully: $OfferName"
}
function Get-Offer
{
param
(
[Alias("Name")]
[Parameter(Mandatory=$true, ParameterSetName="Admin")]
[Parameter(Mandatory=$true, ParameterSetName="Tenant")]
[String] $OfferName,
[Parameter(Mandatory=$true, ParameterSetName="Admin")]
[String] $ResourceGroupName,
[String] $Token
)
switch ($PsCmdlet.ParameterSetName)
{
"Admin"
{
return Get-AzsManagedOffer -Name $OfferName -ResourceGroupName $ResourceGroupName
}
"Tenant"
{
return Get-AzsOffer -Provider "default" | Where-Object name -eq $OfferName
}
}
}
function New-Subscription
{
param
(
[String] $SubscriptionUser,
[Parameter(Mandatory=$true)]
[String] $OfferId
)
if ($SubscriptionUser)
{
$subDisplayName = "Test User-$SubscriptionUser"
$subscription = New-AzsTenantSubscription -Owner $SubscriptionUser -OfferId $OfferId -DisplayName $subDisplayName
}
else
{
$userName = (Get-AzureRMContext).Account.Id
$subDisplayName = "Test User-$userName"
$subscription = New-AzsSubscription -OfferId $OfferId -DisplayName $subDisplayName
}
Assert-True { $subscription.DisplayName -eq $subDisplayName } | Out-Null
$Global:CreatedSubscriptions += @{
SubscriptionId = $subscription.SubscriptionId
}
if ($SubscriptionUser)
{
Retry-Function -ScriptBlock {
(Get-AzsTenantSubscription -SubscriptionId $subscription.SubscriptionId).State -ieq "Enabled"
} -MaxTries 12 -IntervalInSeconds 5 | Out-Null
}
else
{
Retry-Function -ScriptBlock {
(Get-AzsSubscription)[0].State -ieq "Enabled"
} -MaxTries 12 -IntervalInSeconds 5 | Out-Null
}
Write-Verbose "Successfully created the subscription for user : $SubscriptionUser"
return $subscription
}
function Remove-Subscription
{
param
(
[Parameter(Mandatory=$true)]
[String] $TargetSubscriptionId
)
Write-Verbose "Deleting the subscription : $TargetSubscriptionId"
$subscription = Get-AzsTenantSubscription -SubscriptionId $TargetSubscriptionId
Remove-AzsTenantSubscription -SubscriptionId $TargetSubscriptionId
Assert-SubscriptionDeletion {Get-AzsTenantSubscription -SubscriptionId $TargetSubscriptionId}
Write-Verbose "Successfully deleted the subscription : $TargetSubscriptionId"
}
function Get-TenantPublicOffers
{
param
(
[Parameter(Mandatory=$true)]
[String] $Token
)
return Get-AzsOffer -Provider "default"
}
function Get-Subscriptions
{
param
(
[Parameter( Mandatory=$true)]
[String] $Token
)
$getSubscriptions = @{
Uri = $Global:AzureStackConfig.AdminUri + "subscriptions?api-version=2014-04-01-preview"
Method = "GET"
Headers = @{ "Authorization" = "Bearer " + $Token }
ContentType = "application/json"
}
$subscriptions = Invoke-RestMethod @getSubscriptions
return $subscriptions.value
}
function Get-DeploymentStatus
{
param
(
[Parameter(Mandatory=$true)]
[string] $ResourceType,
[Parameter(Mandatory=$true)]
[string] $ResourceGroupName,
[Parameter(Mandatory=$true)]
[string] $SubscriptionId,
[Parameter(Mandatory=$true)]
[string] $Token
)
$deploymentUri = "{0}subscriptions/{1}/resourcegroups/{2}/deployments/{3}?api-version={4}" -f $Global:AzureStackConfig.AdminUri, $SubscriptionId, $ResourceGroupName, $ResourceType, $Global:AzureStackConfig.ApiVersion
$deploymentHeaders = @{ "Authorization" = "Bearer "+ $Token }
$deploymentContentType = "application/json"
$deploymentResponse = Invoke-RestMethod -Method Get -Uri $deploymentUri -Headers $deploymentHeaders -ContentType $deploymentContentType
return $deploymentResponse.properties.provisioningState
}
function Register-ResourceProvider
{
param
(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string[]] $Namespaces
)
foreach ($namespace in $Namespaces)
{
Register-AzureRmResourceProvider -ProviderNamespace $Namespace -Force
}
}
function Unregister-ResourceProvider
{
param
(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string[]] $Namespaces
)
foreach ($namespace in $Namespaces)
{
Unregister-AzureRmResourceProvider -ProviderNamespace $Namespace -Force
}
}

Просмотреть файл

@ -0,0 +1,19 @@
# ----------------------------------------------------------------------------------
#
# 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.
# ----------------------------------------------------------------------------------
$Global:AzureStackConfig = $null
$Global:CreatedSubscriptions = @()
$Global:CreatedResourceGroups = @()
Export-ModuleMember -Variable * -Function *

Просмотреть файл

@ -0,0 +1,114 @@
# ----------------------------------------------------------------------------------
#
# 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.
# ----------------------------------------------------------------------------------
<#
.SYNOPSIS
All the test methods are executed through this cmdlet. The test common methods are tracking the created resource groups and subscriptions
#>
function Start-Test
{
param(
[ScriptBlock] $Test
)
Write-Verbose "=================================================================="
Write-Verbose "Starting Test- $Test"
Write-Verbose "=================================================================="
try
{
$Global:CreatedResourceGroups.Clear()
$Global:CreatedSubscriptions.Clear()
$exceptionRaised = $false
$startDateTime = Get-Date
& $Test
Write-Verbose "=================================================================="
Write-Verbose "Test Passed - $Test"
Write-Verbose "=================================================================="
}
catch
{
Write-Verbose "=================================================================="
Write-Verbose "Test Failed - $Test"
Write-Verbose "=================================================================="
Write-Verbose "Exception info:" -Verbose
$_
Write-Verbose "InnerException info:" -Verbose
$_.Exception.InnerException
Write-Verbose "Exception stacktrace:" -Verbose
$_.Exception.Stacktrace
$exceptionRaised = $true
throw $_
}
finally
{
# Try cleaning up the created resources in case of error
# The test is expected to do the normal cleanup as part the test
# The following is a best effort to clean up the resources in case of an error in the middle of the test
if ($exceptionRaised)
{
Write-Verbose "Starting cleanup of created resources"
# cleaning up tenant resource groups with resources
$Global:CreatedResourceGroups | where {$_.Level -eq 1} | % {
try { Remove-ResourceGroup -ResourceGroupName $_.ResourceGroupName -SubscriptionId $_.SubscriptionId -Token $_.Token}
catch {}
}
# cleaning up subscriptions
for ( $i=$Global:CreatedSubscriptions.Count -1; $i -ge 0; $i--)
{
try { Remove-Subscription $Global:CreatedSubscriptions[$i].SubscriptionId}
catch {}
}
# cleaning up admin resource groups with subscriptions
$Global:CreatedResourceGroups | where {$_.Level -eq 0} | % {
try { Remove-ResourceGroup -ResourceGroupName $_.ResourceGroupName -SubscriptionId $_.SubscriptionId -Token $_.Token}
catch {}
}
Write-Verbose "Done with the cleanup of resources"
}
$elapsed = (Get-Date) - $startDateTime
Write-Verbose "Test Run Time MM:SS - $($elapsed.Minutes)m : $($elapsed.Seconds)s"
$Global:CreatedSubscriptions.Clear()
$Global:CreatedResourceGroups.Clear()
}
}
<#
.SYNOPSIS
Sets Certificate policy to trust all the certificates. This avoids passing -DisableCertValidataion for each cmdlet call when using self signed certificates
#>
function Ignore-SelfSignedCert
{
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
}
"@
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
Write-Warning -Message "CertificatePolicy set to ignore all server certificate errors"
}

Просмотреть файл

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Hyak.Common" version="1.0.3" targetFramework="net45" />
<package id="Microsoft.Azure.Common" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.18.14-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Test.Framework" version="1.0.6068.31305-prerelease" targetFramework="net45" />
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.0.6025.18429-prerelease" targetFramework="net45" />
<package id="Microsoft.AzureStack.Management" version="0.10.9-preview" targetFramework="net45" />
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net45" />
<package id="Microsoft.Data.Edm" version="5.6.4" targetFramework="net45" />
<package id="Microsoft.Data.OData" version="5.6.4" targetFramework="net45" />
<package id="Microsoft.Data.Services.Client" version="5.6.4" targetFramework="net45" />
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.28.1" targetFramework="net45" />
<package id="Microsoft.Rest.ClientRuntime" version="2.0.1" targetFramework="net45" />
<package id="Moq" version="4.2.1402.2112" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
<package id="System.Spatial" version="5.6.4" targetFramework="net45" />
</packages>

Двоичный файл не отображается.

Просмотреть файл

@ -0,0 +1,32 @@
// ----------------------------------------------------------------------------------
//
// 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.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Microsoft.AzureStack.Commands.Admin.Test")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Microsoft.AzureStack.Commands.Admin.Test")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("CAB9FD4D-EFD0-4455-9980-D66F1997FC9A")]

Просмотреть файл

@ -0,0 +1,689 @@
{
"Entries": [
{
"RequestUri": "/tenants?api-version=2014-04-01-preview",
"EncodedRequestUri": "L3RlbmFudHM/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1wcmV2aWV3",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"User-Agent": [
"Microsoft.Azure.Subscriptions.SubscriptionClient/2.0.0.0"
]
},
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/tenants/4993704a-4e53-4e79-95dd-5f1747eb7554\",\r\n \"tenantId\": \"4993704a-4e53-4e79-95dd-5f1747eb7554\"\r\n }\r\n ]\r\n}",
"ResponseHeaders": {
"Content-Length": [
"116"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-ratelimit-remaining-tenant-reads": [
"14922"
],
"x-ms-request-id": [
"f25df4fa-b38a-4fee-9c05-e5128c603993"
],
"x-ms-correlation-request-id": [
"f25df4fa-b38a-4fee-9c05-e5128c603993"
],
"x-ms-routing-request-id": [
"LOCAL:20160704T223842Z:f25df4fa-b38a-4fee-9c05-e5128c603993"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Mon, 04 Jul 2016 22:38:42 GMT"
]
},
"StatusCode": 200
},
{
"RequestUri": "/tenants?api-version=2014-04-01-preview",
"EncodedRequestUri": "L3RlbmFudHM/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1wcmV2aWV3",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"User-Agent": [
"Microsoft.Azure.Subscriptions.SubscriptionClient/2.0.0.0"
]
},
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/tenants/4993704a-4e53-4e79-95dd-5f1747eb7554\",\r\n \"tenantId\": \"4993704a-4e53-4e79-95dd-5f1747eb7554\"\r\n }\r\n ]\r\n}",
"ResponseHeaders": {
"Content-Length": [
"116"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-ratelimit-remaining-tenant-reads": [
"14919"
],
"x-ms-request-id": [
"da042f65-973b-49b7-8e04-a41f77aec838"
],
"x-ms-correlation-request-id": [
"da042f65-973b-49b7-8e04-a41f77aec838"
],
"x-ms-routing-request-id": [
"LOCAL:20160704T223842Z:da042f65-973b-49b7-8e04-a41f77aec838"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Mon, 04 Jul 2016 22:38:42 GMT"
]
},
"StatusCode": 200
},
{
"RequestUri": "/tenants?api-version=2014-04-01-preview",
"EncodedRequestUri": "L3RlbmFudHM/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1wcmV2aWV3",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"User-Agent": [
"Microsoft.Azure.Subscriptions.SubscriptionClient/2.0.0.0"
]
},
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/tenants/4993704a-4e53-4e79-95dd-5f1747eb7554\",\r\n \"tenantId\": \"4993704a-4e53-4e79-95dd-5f1747eb7554\"\r\n }\r\n ]\r\n}",
"ResponseHeaders": {
"Content-Length": [
"116"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-ratelimit-remaining-tenant-reads": [
"14917"
],
"x-ms-request-id": [
"87e9d410-30ac-4052-8d59-62fa24fe3099"
],
"x-ms-correlation-request-id": [
"87e9d410-30ac-4052-8d59-62fa24fe3099"
],
"x-ms-routing-request-id": [
"LOCAL:20160704T223842Z:87e9d410-30ac-4052-8d59-62fa24fe3099"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Mon, 04 Jul 2016 22:38:42 GMT"
]
},
"StatusCode": 200
},
{
"RequestUri": "/subscriptions?api-version=2014-04-01-preview",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnM/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1wcmV2aWV3",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"User-Agent": [
"Microsoft.Azure.Subscriptions.SubscriptionClient/2.0.0.0"
]
},
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"offerId\": \"/delegatedProviders/default/offers/A01013B1-C402-4116-A88F-0F6B0EA594C1\",\r\n \"id\": \"/subscriptions/67F093AF-0362-44A0-AF64-EC1CE18EF28E\",\r\n \"subscriptionId\": \"67F093AF-0362-44A0-AF64-EC1CE18EF28E\",\r\n \"displayName\": \"Default Provider Subscription\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"AzureStack\"\r\n }\r\n },\r\n {\r\n \"offerId\": \"/delegatedProviders/default/offers/TestOffer-0f911aad-9f36-4159-affe-09a2e8952888\",\r\n \"id\": \"/subscriptions/be389520-e468-4dd9-af94-7bc7aa16f599\",\r\n \"subscriptionId\": \"be389520-e468-4dd9-af94-7bc7aa16f599\",\r\n \"displayName\": \"Test User-\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"AzureStack\"\r\n }\r\n }\r\n ]\r\n}",
"ResponseHeaders": {
"Content-Length": [
"652"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-ratelimit-remaining-tenant-reads": [
"14921"
],
"x-ms-request-id": [
"33077b66-2216-48b3-ba2e-f5dec4d172a8"
],
"x-ms-correlation-request-id": [
"33077b66-2216-48b3-ba2e-f5dec4d172a8"
],
"x-ms-routing-request-id": [
"LOCAL:20160704T223842Z:33077b66-2216-48b3-ba2e-f5dec4d172a8"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Mon, 04 Jul 2016 22:38:42 GMT"
]
},
"StatusCode": 200
},
{
"RequestUri": "/subscriptions?api-version=2014-04-01-preview",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnM/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1wcmV2aWV3",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"User-Agent": [
"Microsoft.Azure.Subscriptions.SubscriptionClient/2.0.0.0"
]
},
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"offerId\": \"/delegatedProviders/default/offers/A01013B1-C402-4116-A88F-0F6B0EA594C1\",\r\n \"id\": \"/subscriptions/67F093AF-0362-44A0-AF64-EC1CE18EF28E\",\r\n \"subscriptionId\": \"67F093AF-0362-44A0-AF64-EC1CE18EF28E\",\r\n \"displayName\": \"Default Provider Subscription\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"AzureStack\"\r\n }\r\n },\r\n {\r\n \"offerId\": \"/delegatedProviders/default/offers/TestOffer-0f911aad-9f36-4159-affe-09a2e8952888\",\r\n \"id\": \"/subscriptions/be389520-e468-4dd9-af94-7bc7aa16f599\",\r\n \"subscriptionId\": \"be389520-e468-4dd9-af94-7bc7aa16f599\",\r\n \"displayName\": \"Test User-\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"AzureStack\"\r\n }\r\n }\r\n ]\r\n}",
"ResponseHeaders": {
"Content-Length": [
"652"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-ratelimit-remaining-tenant-reads": [
"14920"
],
"x-ms-request-id": [
"aa73cbb0-6210-4975-b024-901fc5d4abd9"
],
"x-ms-correlation-request-id": [
"aa73cbb0-6210-4975-b024-901fc5d4abd9"
],
"x-ms-routing-request-id": [
"LOCAL:20160704T223842Z:aa73cbb0-6210-4975-b024-901fc5d4abd9"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Mon, 04 Jul 2016 22:38:42 GMT"
]
},
"StatusCode": 200
},
{
"RequestUri": "/subscriptions?api-version=2014-04-01-preview",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnM/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1wcmV2aWV3",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"User-Agent": [
"Microsoft.Azure.Subscriptions.SubscriptionClient/2.0.0.0"
]
},
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"offerId\": \"/delegatedProviders/default/offers/A01013B1-C402-4116-A88F-0F6B0EA594C1\",\r\n \"id\": \"/subscriptions/67F093AF-0362-44A0-AF64-EC1CE18EF28E\",\r\n \"subscriptionId\": \"67F093AF-0362-44A0-AF64-EC1CE18EF28E\",\r\n \"displayName\": \"Default Provider Subscription\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"AzureStack\"\r\n }\r\n },\r\n {\r\n \"offerId\": \"/delegatedProviders/default/offers/TestOffer-0f911aad-9f36-4159-affe-09a2e8952888\",\r\n \"id\": \"/subscriptions/be389520-e468-4dd9-af94-7bc7aa16f599\",\r\n \"subscriptionId\": \"be389520-e468-4dd9-af94-7bc7aa16f599\",\r\n \"displayName\": \"Test User-\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"AzureStack\"\r\n }\r\n }\r\n ]\r\n}",
"ResponseHeaders": {
"Content-Length": [
"652"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-ratelimit-remaining-tenant-reads": [
"14918"
],
"x-ms-request-id": [
"9397901a-c03a-40f6-a9c7-9ca2089915ab"
],
"x-ms-correlation-request-id": [
"9397901a-c03a-40f6-a9c7-9ca2089915ab"
],
"x-ms-routing-request-id": [
"LOCAL:20160704T223842Z:9397901a-c03a-40f6-a9c7-9ca2089915ab"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Mon, 04 Jul 2016 22:38:42 GMT"
]
},
"StatusCode": 200
},
{
"RequestUri": "/subscriptions?api-version=2014-04-01-preview",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnM/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1wcmV2aWV3",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"User-Agent": [
"Microsoft.Azure.Subscriptions.SubscriptionClient/2.0.0.0"
]
},
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"offerId\": \"/delegatedProviders/default/offers/A01013B1-C402-4116-A88F-0F6B0EA594C1\",\r\n \"id\": \"/subscriptions/67F093AF-0362-44A0-AF64-EC1CE18EF28E\",\r\n \"subscriptionId\": \"67F093AF-0362-44A0-AF64-EC1CE18EF28E\",\r\n \"displayName\": \"Default Provider Subscription\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"AzureStack\"\r\n }\r\n },\r\n {\r\n \"offerId\": \"/delegatedProviders/default/offers/TestOffer-0f911aad-9f36-4159-affe-09a2e8952888\",\r\n \"id\": \"/subscriptions/be389520-e468-4dd9-af94-7bc7aa16f599\",\r\n \"subscriptionId\": \"be389520-e468-4dd9-af94-7bc7aa16f599\",\r\n \"displayName\": \"Test User-\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"AzureStack\"\r\n }\r\n }\r\n ]\r\n}",
"ResponseHeaders": {
"Content-Length": [
"652"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-ratelimit-remaining-tenant-reads": [
"14916"
],
"x-ms-request-id": [
"8ecb4e6f-3981-4613-aab5-3cf3030d8f00"
],
"x-ms-correlation-request-id": [
"8ecb4e6f-3981-4613-aab5-3cf3030d8f00"
],
"x-ms-routing-request-id": [
"LOCAL:20160704T223842Z:8ecb4e6f-3981-4613-aab5-3cf3030d8f00"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Mon, 04 Jul 2016 22:38:42 GMT"
]
},
"StatusCode": 200
},
{
"RequestUri": "/subscriptions/67F093AF-0362-44A0-AF64-EC1CE18EF28E/providers/Microsoft.Subscriptions.Admin/locations?api-version=2015-11-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjdGMDkzQUYtMDM2Mi00NEEwLUFGNjQtRUMxQ0UxOEVGMjhFL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3Vic2NyaXB0aW9ucy5BZG1pbi9sb2NhdGlvbnM/YXBpLXZlcnNpb249MjAxNS0xMS0wMQ==",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"User-Agent": [
"Microsoft.AzureStack.Management.AzureStackClient/0.9.0.0"
]
},
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/subscriptions/67F093AF-0362-44A0-AF64-EC1CE18EF28E/providers/Microsoft.Subscriptions.Admin/locations/local\",\r\n \"name\": \"local\",\r\n \"displayName\": \"local\",\r\n \"latitude\": \"\",\r\n \"longitude\": \"\"\r\n }\r\n ]\r\n}",
"ResponseHeaders": {
"Content-Length": [
"194"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-ratelimit-remaining-subscription-reads": [
"14887"
],
"x-ms-request-id": [
"a30698dd-9768-49be-8046-9eaed0068c21"
],
"x-ms-correlation-request-id": [
"a30698dd-9768-49be-8046-9eaed0068c21"
],
"x-ms-routing-request-id": [
"LOCAL:20160704T223843Z:a30698dd-9768-49be-8046-9eaed0068c21"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Mon, 04 Jul 2016 22:38:42 GMT"
]
},
"StatusCode": 200
},
{
"RequestUri": "/subscriptions/67F093AF-0362-44A0-AF64-EC1CE18EF28E/providers/Microsoft.Subscriptions.Admin/locations/chicago5?api-version=2015-11-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjdGMDkzQUYtMDM2Mi00NEEwLUFGNjQtRUMxQ0UxOEVGMjhFL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3Vic2NyaXB0aW9ucy5BZG1pbi9sb2NhdGlvbnMvY2hpY2FnbzU/YXBpLXZlcnNpb249MjAxNS0xMS0wMQ==",
"RequestMethod": "PUT",
"RequestBody": "{\r\n \"name\": \"chicago5\",\r\n \"displayName\": \"chicago5\",\r\n \"latitude\": \"80.5\",\r\n \"longitude\": \"-45.5\"\r\n}",
"RequestHeaders": {
"Content-Type": [
"application/json; charset=utf-8"
],
"Content-Length": [
"104"
],
"User-Agent": [
"Microsoft.AzureStack.Management.AzureStackClient/0.9.0.0"
]
},
"ResponseBody": "{\r\n \"name\": \"chicago5\",\r\n \"displayName\": \"chicago5\",\r\n \"latitude\": \"80.5\",\r\n \"longitude\": \"-45.5\"\r\n}",
"ResponseHeaders": {
"Content-Length": [
"82"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-ratelimit-remaining-subscription-writes": [
"1169"
],
"x-ms-request-id": [
"510591ea-14f6-449e-95e6-38abfbe3035b"
],
"x-ms-correlation-request-id": [
"510591ea-14f6-449e-95e6-38abfbe3035b"
],
"x-ms-routing-request-id": [
"LOCAL:20160704T223843Z:510591ea-14f6-449e-95e6-38abfbe3035b"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Mon, 04 Jul 2016 22:38:43 GMT"
]
},
"StatusCode": 201
},
{
"RequestUri": "/subscriptions/67F093AF-0362-44A0-AF64-EC1CE18EF28E/providers/Microsoft.Subscriptions.Admin/locations/chicago5?api-version=2015-11-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjdGMDkzQUYtMDM2Mi00NEEwLUFGNjQtRUMxQ0UxOEVGMjhFL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3Vic2NyaXB0aW9ucy5BZG1pbi9sb2NhdGlvbnMvY2hpY2FnbzU/YXBpLXZlcnNpb249MjAxNS0xMS0wMQ==",
"RequestMethod": "PUT",
"RequestBody": "{\r\n \"id\": \"/subscriptions/67F093AF-0362-44A0-AF64-EC1CE18EF28E/providers/Microsoft.Subscriptions.Admin/locations/chicago5\",\r\n \"name\": \"chicago5\",\r\n \"displayName\": \"chicago5\",\r\n \"latitude\": \"90\",\r\n \"longitude\": \"-45.5\"\r\n}",
"RequestHeaders": {
"Content-Type": [
"application/json; charset=utf-8"
],
"Content-Length": [
"225"
],
"User-Agent": [
"Microsoft.AzureStack.Management.AzureStackClient/0.9.0.0"
]
},
"ResponseBody": "{\r\n \"name\": \"chicago5\",\r\n \"displayName\": \"chicago5\",\r\n \"latitude\": \"90\",\r\n \"longitude\": \"-45.5\"\r\n}",
"ResponseHeaders": {
"Content-Length": [
"80"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-ratelimit-remaining-subscription-writes": [
"1168"
],
"x-ms-request-id": [
"7757e33c-dd6f-4c50-aafa-b3f24e0e28ff"
],
"x-ms-correlation-request-id": [
"7757e33c-dd6f-4c50-aafa-b3f24e0e28ff"
],
"x-ms-routing-request-id": [
"LOCAL:20160704T223843Z:7757e33c-dd6f-4c50-aafa-b3f24e0e28ff"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Mon, 04 Jul 2016 22:38:43 GMT"
]
},
"StatusCode": 200
},
{
"RequestUri": "/subscriptions/67F093AF-0362-44A0-AF64-EC1CE18EF28E/providers/Microsoft.Subscriptions.Admin/locations/chicago5?api-version=2015-11-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjdGMDkzQUYtMDM2Mi00NEEwLUFGNjQtRUMxQ0UxOEVGMjhFL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3Vic2NyaXB0aW9ucy5BZG1pbi9sb2NhdGlvbnMvY2hpY2FnbzU/YXBpLXZlcnNpb249MjAxNS0xMS0wMQ==",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"User-Agent": [
"Microsoft.AzureStack.Management.AzureStackClient/0.9.0.0"
]
},
"ResponseBody": "{\r\n \"id\": \"/subscriptions/67F093AF-0362-44A0-AF64-EC1CE18EF28E/providers/Microsoft.Subscriptions.Admin/locations/chicago5\",\r\n \"name\": \"chicago5\",\r\n \"displayName\": \"chicago5\",\r\n \"latitude\": \"80.5\",\r\n \"longitude\": \"-45.5\"\r\n}",
"ResponseHeaders": {
"Content-Length": [
"200"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-ratelimit-remaining-subscription-reads": [
"14886"
],
"x-ms-request-id": [
"56f70c4e-8816-4526-873b-43a0d2ca5812"
],
"x-ms-correlation-request-id": [
"56f70c4e-8816-4526-873b-43a0d2ca5812"
],
"x-ms-routing-request-id": [
"LOCAL:20160704T223843Z:56f70c4e-8816-4526-873b-43a0d2ca5812"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Mon, 04 Jul 2016 22:38:43 GMT"
]
},
"StatusCode": 200
},
{
"RequestUri": "/subscriptions/67F093AF-0362-44A0-AF64-EC1CE18EF28E/providers/Microsoft.Subscriptions.Admin/locations/chicago5?api-version=2015-11-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjdGMDkzQUYtMDM2Mi00NEEwLUFGNjQtRUMxQ0UxOEVGMjhFL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3Vic2NyaXB0aW9ucy5BZG1pbi9sb2NhdGlvbnMvY2hpY2FnbzU/YXBpLXZlcnNpb249MjAxNS0xMS0wMQ==",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"User-Agent": [
"Microsoft.AzureStack.Management.AzureStackClient/0.9.0.0"
]
},
"ResponseBody": "{\r\n \"id\": \"/subscriptions/67F093AF-0362-44A0-AF64-EC1CE18EF28E/providers/Microsoft.Subscriptions.Admin/locations/chicago5\",\r\n \"name\": \"chicago5\",\r\n \"displayName\": \"chicago5\",\r\n \"latitude\": \"90\",\r\n \"longitude\": \"-45.5\"\r\n}",
"ResponseHeaders": {
"Content-Length": [
"198"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-ratelimit-remaining-subscription-reads": [
"14885"
],
"x-ms-request-id": [
"90921414-70f6-4791-bd0f-00406e14fb97"
],
"x-ms-correlation-request-id": [
"90921414-70f6-4791-bd0f-00406e14fb97"
],
"x-ms-routing-request-id": [
"LOCAL:20160704T223844Z:90921414-70f6-4791-bd0f-00406e14fb97"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Mon, 04 Jul 2016 22:38:43 GMT"
]
},
"StatusCode": 200
},
{
"RequestUri": "/subscriptions/67F093AF-0362-44A0-AF64-EC1CE18EF28E/providers/Microsoft.Subscriptions.Admin/locations/chicago5?api-version=2015-11-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjdGMDkzQUYtMDM2Mi00NEEwLUFGNjQtRUMxQ0UxOEVGMjhFL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3Vic2NyaXB0aW9ucy5BZG1pbi9sb2NhdGlvbnMvY2hpY2FnbzU/YXBpLXZlcnNpb249MjAxNS0xMS0wMQ==",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"User-Agent": [
"Microsoft.AzureStack.Management.AzureStackClient/0.9.0.0"
]
},
"ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"LocationNotFound\",\r\n \"message\": \"The location name 'chicago5' could not be found.\"\r\n }\r\n}",
"ResponseHeaders": {
"Content-Length": [
"98"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-ratelimit-remaining-subscription-reads": [
"14884"
],
"x-ms-request-id": [
"6d6a6297-50bb-4e0f-bd84-25517f5a83f4"
],
"x-ms-correlation-request-id": [
"6d6a6297-50bb-4e0f-bd84-25517f5a83f4"
],
"x-ms-routing-request-id": [
"LOCAL:20160704T223844Z:6d6a6297-50bb-4e0f-bd84-25517f5a83f4"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Mon, 04 Jul 2016 22:38:44 GMT"
]
},
"StatusCode": 400
},
{
"RequestUri": "/subscriptions/67F093AF-0362-44A0-AF64-EC1CE18EF28E/providers/Microsoft.Subscriptions.Admin/locations/chicago5?api-version=2015-11-01",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNjdGMDkzQUYtMDM2Mi00NEEwLUFGNjQtRUMxQ0UxOEVGMjhFL3Byb3ZpZGVycy9NaWNyb3NvZnQuU3Vic2NyaXB0aW9ucy5BZG1pbi9sb2NhdGlvbnMvY2hpY2FnbzU/YXBpLXZlcnNpb249MjAxNS0xMS0wMQ==",
"RequestMethod": "DELETE",
"RequestBody": "",
"RequestHeaders": {
"User-Agent": [
"Microsoft.AzureStack.Management.AzureStackClient/0.9.0.0"
]
},
"ResponseBody": "",
"ResponseHeaders": {
"Content-Length": [
"0"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-ratelimit-remaining-subscription-writes": [
"1167"
],
"x-ms-request-id": [
"36b73fb3-de81-44d0-81c7-2271f5f08281"
],
"x-ms-correlation-request-id": [
"36b73fb3-de81-44d0-81c7-2271f5f08281"
],
"x-ms-routing-request-id": [
"LOCAL:20160704T223844Z:36b73fb3-de81-44d0-81c7-2271f5f08281"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Mon, 04 Jul 2016 22:38:43 GMT"
]
},
"StatusCode": 200
}
],
"Names": {},
"Variables": {
"SubscriptionId": "67F093AF-0362-44A0-AF64-EC1CE18EF28E"
}
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,851 @@
{
"Entries": [
{
"RequestUri": "/tenants?api-version=2014-04-01-preview",
"EncodedRequestUri": "L3RlbmFudHM/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1wcmV2aWV3",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"User-Agent": [
"Microsoft.Azure.Subscriptions.SubscriptionClient/2.0.0.0"
]
},
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/tenants/4993704a-4e53-4e79-95dd-5f1747eb7554\",\r\n \"tenantId\": \"4993704a-4e53-4e79-95dd-5f1747eb7554\"\r\n }\r\n ]\r\n}",
"ResponseHeaders": {
"Content-Length": [
"116"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-ratelimit-remaining-tenant-reads": [
"14961"
],
"x-ms-request-id": [
"3119b9bf-03a3-47c5-b97a-1f4b683a85d3"
],
"x-ms-correlation-request-id": [
"3119b9bf-03a3-47c5-b97a-1f4b683a85d3"
],
"x-ms-routing-request-id": [
"LOCAL:20160701T210311Z:3119b9bf-03a3-47c5-b97a-1f4b683a85d3"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Fri, 01 Jul 2016 21:03:11 GMT"
]
},
"StatusCode": 200
},
{
"RequestUri": "/tenants?api-version=2014-04-01-preview",
"EncodedRequestUri": "L3RlbmFudHM/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1wcmV2aWV3",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"User-Agent": [
"Microsoft.Azure.Subscriptions.SubscriptionClient/2.0.0.0"
]
},
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/tenants/4993704a-4e53-4e79-95dd-5f1747eb7554\",\r\n \"tenantId\": \"4993704a-4e53-4e79-95dd-5f1747eb7554\"\r\n }\r\n ]\r\n}",
"ResponseHeaders": {
"Content-Length": [
"116"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-ratelimit-remaining-tenant-reads": [
"14958"
],
"x-ms-request-id": [
"9e8a7e4e-1664-4129-b22f-a41167ebfb67"
],
"x-ms-correlation-request-id": [
"9e8a7e4e-1664-4129-b22f-a41167ebfb67"
],
"x-ms-routing-request-id": [
"LOCAL:20160701T210311Z:9e8a7e4e-1664-4129-b22f-a41167ebfb67"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Fri, 01 Jul 2016 21:03:11 GMT"
]
},
"StatusCode": 200
},
{
"RequestUri": "/tenants?api-version=2014-04-01-preview",
"EncodedRequestUri": "L3RlbmFudHM/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1wcmV2aWV3",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"User-Agent": [
"Microsoft.Azure.Subscriptions.SubscriptionClient/2.0.0.0"
]
},
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"id\": \"/tenants/4993704a-4e53-4e79-95dd-5f1747eb7554\",\r\n \"tenantId\": \"4993704a-4e53-4e79-95dd-5f1747eb7554\"\r\n }\r\n ]\r\n}",
"ResponseHeaders": {
"Content-Length": [
"116"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-ratelimit-remaining-tenant-reads": [
"14956"
],
"x-ms-request-id": [
"685a113c-f15c-4284-aa52-957ffde16d28"
],
"x-ms-correlation-request-id": [
"685a113c-f15c-4284-aa52-957ffde16d28"
],
"x-ms-routing-request-id": [
"LOCAL:20160701T210311Z:685a113c-f15c-4284-aa52-957ffde16d28"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Fri, 01 Jul 2016 21:03:11 GMT"
]
},
"StatusCode": 200
},
{
"RequestUri": "/subscriptions?api-version=2014-04-01-preview",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnM/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1wcmV2aWV3",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"User-Agent": [
"Microsoft.Azure.Subscriptions.SubscriptionClient/2.0.0.0"
]
},
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"offerId\": \"/delegatedProviders/default/offers/A72C2CA0-9191-457E-9CA4-E5D91AEB7141\",\r\n \"id\": \"/subscriptions/0C1274D5-4C85-40ED-BC25-A7F4B7360521\",\r\n \"subscriptionId\": \"0C1274D5-4C85-40ED-BC25-A7F4B7360521\",\r\n \"displayName\": \"Default Provider Subscription\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"AzureStack\"\r\n }\r\n }\r\n ]\r\n}",
"ResponseHeaders": {
"Content-Length": [
"336"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-ratelimit-remaining-tenant-reads": [
"14960"
],
"x-ms-request-id": [
"46df6040-e98a-4393-97a6-2cbcbe47a972"
],
"x-ms-correlation-request-id": [
"46df6040-e98a-4393-97a6-2cbcbe47a972"
],
"x-ms-routing-request-id": [
"LOCAL:20160701T210311Z:46df6040-e98a-4393-97a6-2cbcbe47a972"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Fri, 01 Jul 2016 21:03:11 GMT"
]
},
"StatusCode": 200
},
{
"RequestUri": "/subscriptions?api-version=2014-04-01-preview",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnM/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1wcmV2aWV3",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"User-Agent": [
"Microsoft.Azure.Subscriptions.SubscriptionClient/2.0.0.0"
]
},
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"offerId\": \"/delegatedProviders/default/offers/A72C2CA0-9191-457E-9CA4-E5D91AEB7141\",\r\n \"id\": \"/subscriptions/0C1274D5-4C85-40ED-BC25-A7F4B7360521\",\r\n \"subscriptionId\": \"0C1274D5-4C85-40ED-BC25-A7F4B7360521\",\r\n \"displayName\": \"Default Provider Subscription\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"AzureStack\"\r\n }\r\n }\r\n ]\r\n}",
"ResponseHeaders": {
"Content-Length": [
"336"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-ratelimit-remaining-tenant-reads": [
"14959"
],
"x-ms-request-id": [
"5ded006b-ed54-4855-8059-da61533bb8e1"
],
"x-ms-correlation-request-id": [
"5ded006b-ed54-4855-8059-da61533bb8e1"
],
"x-ms-routing-request-id": [
"LOCAL:20160701T210311Z:5ded006b-ed54-4855-8059-da61533bb8e1"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Fri, 01 Jul 2016 21:03:11 GMT"
]
},
"StatusCode": 200
},
{
"RequestUri": "/subscriptions?api-version=2014-04-01-preview",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnM/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1wcmV2aWV3",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"User-Agent": [
"Microsoft.Azure.Subscriptions.SubscriptionClient/2.0.0.0"
]
},
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"offerId\": \"/delegatedProviders/default/offers/A72C2CA0-9191-457E-9CA4-E5D91AEB7141\",\r\n \"id\": \"/subscriptions/0C1274D5-4C85-40ED-BC25-A7F4B7360521\",\r\n \"subscriptionId\": \"0C1274D5-4C85-40ED-BC25-A7F4B7360521\",\r\n \"displayName\": \"Default Provider Subscription\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"AzureStack\"\r\n }\r\n }\r\n ]\r\n}",
"ResponseHeaders": {
"Content-Length": [
"336"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-ratelimit-remaining-tenant-reads": [
"14957"
],
"x-ms-request-id": [
"ef7172b2-ebd0-4bc3-bbac-90dd16540073"
],
"x-ms-correlation-request-id": [
"ef7172b2-ebd0-4bc3-bbac-90dd16540073"
],
"x-ms-routing-request-id": [
"LOCAL:20160701T210311Z:ef7172b2-ebd0-4bc3-bbac-90dd16540073"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Fri, 01 Jul 2016 21:03:11 GMT"
]
},
"StatusCode": 200
},
{
"RequestUri": "/subscriptions?api-version=2014-04-01-preview",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnM/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1wcmV2aWV3",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"User-Agent": [
"Microsoft.Azure.Subscriptions.SubscriptionClient/2.0.0.0"
]
},
"ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"offerId\": \"/delegatedProviders/default/offers/A72C2CA0-9191-457E-9CA4-E5D91AEB7141\",\r\n \"id\": \"/subscriptions/0C1274D5-4C85-40ED-BC25-A7F4B7360521\",\r\n \"subscriptionId\": \"0C1274D5-4C85-40ED-BC25-A7F4B7360521\",\r\n \"displayName\": \"Default Provider Subscription\",\r\n \"state\": \"Enabled\",\r\n \"subscriptionPolicies\": {\r\n \"locationPlacementId\": \"AzureStack\"\r\n }\r\n }\r\n ]\r\n}",
"ResponseHeaders": {
"Content-Length": [
"336"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-ratelimit-remaining-tenant-reads": [
"14955"
],
"x-ms-request-id": [
"3c5835bf-e235-4f77-833b-98c0b9514d9d"
],
"x-ms-correlation-request-id": [
"3c5835bf-e235-4f77-833b-98c0b9514d9d"
],
"x-ms-routing-request-id": [
"LOCAL:20160701T210311Z:3c5835bf-e235-4f77-833b-98c0b9514d9d"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Fri, 01 Jul 2016 21:03:11 GMT"
]
},
"StatusCode": 200
},
{
"RequestUri": "/subscriptions/0C1274D5-4C85-40ED-BC25-A7F4B7360521/resourcegroups/TestRG1?api-version=2014-04-01-preview",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMEMxMjc0RDUtNEM4NS00MEVELUJDMjUtQTdGNEI3MzYwNTIxL3Jlc291cmNlZ3JvdXBzL1Rlc3RSRzE/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1wcmV2aWV3",
"RequestMethod": "HEAD",
"RequestBody": "",
"RequestHeaders": {
"User-Agent": [
"Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0"
]
},
"ResponseBody": "",
"ResponseHeaders": {
"Content-Length": [
"99"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-failure-cause": [
"gateway"
],
"x-ms-ratelimit-remaining-subscription-reads": [
"14990"
],
"x-ms-request-id": [
"7c0e23e5-ca24-4fb0-9bfb-ee77b568cb69"
],
"x-ms-correlation-request-id": [
"7c0e23e5-ca24-4fb0-9bfb-ee77b568cb69"
],
"x-ms-routing-request-id": [
"LOCAL:20160701T210311Z:7c0e23e5-ca24-4fb0-9bfb-ee77b568cb69"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Fri, 01 Jul 2016 21:03:11 GMT"
]
},
"StatusCode": 404
},
{
"RequestUri": "/subscriptions/0C1274D5-4C85-40ED-BC25-A7F4B7360521/resourcegroups/TestRG1?api-version=2014-04-01-preview",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMEMxMjc0RDUtNEM4NS00MEVELUJDMjUtQTdGNEI3MzYwNTIxL3Jlc291cmNlZ3JvdXBzL1Rlc3RSRzE/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1wcmV2aWV3",
"RequestMethod": "HEAD",
"RequestBody": "",
"RequestHeaders": {
"User-Agent": [
"Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0"
]
},
"ResponseBody": "",
"ResponseHeaders": {
"Content-Length": [
"0"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-ratelimit-remaining-subscription-reads": [
"14987"
],
"x-ms-request-id": [
"a6ec38e3-79e3-476a-a9e7-c12c081b9762"
],
"x-ms-correlation-request-id": [
"a6ec38e3-79e3-476a-a9e7-c12c081b9762"
],
"x-ms-routing-request-id": [
"LOCAL:20160701T210312Z:a6ec38e3-79e3-476a-a9e7-c12c081b9762"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Fri, 01 Jul 2016 21:03:12 GMT"
]
},
"StatusCode": 204
},
{
"RequestUri": "/subscriptions/0C1274D5-4C85-40ED-BC25-A7F4B7360521/resourcegroups/TestRG1?api-version=2014-04-01-preview",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMEMxMjc0RDUtNEM4NS00MEVELUJDMjUtQTdGNEI3MzYwNTIxL3Jlc291cmNlZ3JvdXBzL1Rlc3RSRzE/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1wcmV2aWV3",
"RequestMethod": "PUT",
"RequestBody": "{\r\n \"location\": \"local\"\r\n}",
"RequestHeaders": {
"Content-Type": [
"application/json; charset=utf-8"
],
"Content-Length": [
"27"
],
"User-Agent": [
"Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0"
]
},
"ResponseBody": "{\r\n \"id\": \"/subscriptions/0C1274D5-4C85-40ED-BC25-A7F4B7360521/resourceGroups/TestRG1\",\r\n \"name\": \"TestRG1\",\r\n \"location\": \"local\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}",
"ResponseHeaders": {
"Content-Length": [
"166"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-ratelimit-remaining-subscription-writes": [
"1194"
],
"x-ms-request-id": [
"77fd7e8f-e4b3-417c-8bab-a79aa4310b1f"
],
"x-ms-correlation-request-id": [
"77fd7e8f-e4b3-417c-8bab-a79aa4310b1f"
],
"x-ms-routing-request-id": [
"LOCAL:20160701T210312Z:77fd7e8f-e4b3-417c-8bab-a79aa4310b1f"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Fri, 01 Jul 2016 21:03:11 GMT"
]
},
"StatusCode": 201
},
{
"RequestUri": "/subscriptions/0C1274D5-4C85-40ED-BC25-A7F4B7360521/resourceGroups/TestRG1/resources?api-version=2014-04-01-preview",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMEMxMjc0RDUtNEM4NS00MEVELUJDMjUtQTdGNEI3MzYwNTIxL3Jlc291cmNlR3JvdXBzL1Rlc3RSRzEvcmVzb3VyY2VzP2FwaS12ZXJzaW9uPTIwMTQtMDQtMDEtcHJldmlldw==",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"User-Agent": [
"Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0"
]
},
"ResponseBody": "{\r\n \"value\": []\r\n}",
"ResponseHeaders": {
"Content-Length": [
"12"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-ratelimit-remaining-subscription-reads": [
"14989"
],
"x-ms-request-id": [
"9f753354-adb3-4478-80ed-34764fb0f68f"
],
"x-ms-correlation-request-id": [
"9f753354-adb3-4478-80ed-34764fb0f68f"
],
"x-ms-routing-request-id": [
"LOCAL:20160701T210312Z:9f753354-adb3-4478-80ed-34764fb0f68f"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Fri, 01 Jul 2016 21:03:11 GMT"
]
},
"StatusCode": 200
},
{
"RequestUri": "/subscriptions/0C1274D5-4C85-40ED-BC25-A7F4B7360521/resourcegroups/TestRG1?api-version=2014-04-01-preview",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMEMxMjc0RDUtNEM4NS00MEVELUJDMjUtQTdGNEI3MzYwNTIxL3Jlc291cmNlZ3JvdXBzL1Rlc3RSRzE/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1wcmV2aWV3",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"User-Agent": [
"Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0"
]
},
"ResponseBody": "{\r\n \"id\": \"/subscriptions/0C1274D5-4C85-40ED-BC25-A7F4B7360521/resourceGroups/TestRG1\",\r\n \"name\": \"TestRG1\",\r\n \"location\": \"local\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}",
"ResponseHeaders": {
"Content-Length": [
"166"
],
"Content-Type": [
"application/json; charset=utf-8"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-ratelimit-remaining-subscription-reads": [
"14988"
],
"x-ms-request-id": [
"0fa5d8ce-4446-4a23-9fd4-f4eee5ad5332"
],
"x-ms-correlation-request-id": [
"0fa5d8ce-4446-4a23-9fd4-f4eee5ad5332"
],
"x-ms-routing-request-id": [
"LOCAL:20160701T210312Z:0fa5d8ce-4446-4a23-9fd4-f4eee5ad5332"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Fri, 01 Jul 2016 21:03:12 GMT"
]
},
"StatusCode": 200
},
{
"RequestUri": "/subscriptions/0C1274D5-4C85-40ED-BC25-A7F4B7360521/resourcegroups/TestRG1?api-version=2014-04-01-preview",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMEMxMjc0RDUtNEM4NS00MEVELUJDMjUtQTdGNEI3MzYwNTIxL3Jlc291cmNlZ3JvdXBzL1Rlc3RSRzE/YXBpLXZlcnNpb249MjAxNC0wNC0wMS1wcmV2aWV3",
"RequestMethod": "DELETE",
"RequestBody": "",
"RequestHeaders": {
"User-Agent": [
"Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0"
]
},
"ResponseBody": "",
"ResponseHeaders": {
"Content-Length": [
"0"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"Retry-After": [
"15"
],
"x-ms-ratelimit-remaining-subscription-writes": [
"1193"
],
"x-ms-request-id": [
"8a0938de-fc43-470b-930b-823ac2f82b84"
],
"x-ms-correlation-request-id": [
"8a0938de-fc43-470b-930b-823ac2f82b84"
],
"x-ms-routing-request-id": [
"LOCAL:20160701T210312Z:8a0938de-fc43-470b-930b-823ac2f82b84"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Fri, 01 Jul 2016 21:03:12 GMT"
],
"Location": [
"https://pt-test02:30005/subscriptions/0C1274D5-4C85-40ED-BC25-A7F4B7360521/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1URVNUUkcxLUxPQ0FMIiwiam9iTG9jYXRpb24iOiJsb2NhbCJ9?api-version=2014-04-01-preview"
]
},
"StatusCode": 202
},
{
"RequestUri": "/subscriptions/0C1274D5-4C85-40ED-BC25-A7F4B7360521/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1URVNUUkcxLUxPQ0FMIiwiam9iTG9jYXRpb24iOiJsb2NhbCJ9?api-version=2014-04-01-preview",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMEMxMjc0RDUtNEM4NS00MEVELUJDMjUtQTdGNEI3MzYwNTIxL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFVUlZOVVVrY3hMVXhQUTBGTUlpd2lhbTlpVEc5allYUnBiMjRpT2lKc2IyTmhiQ0o5P2FwaS12ZXJzaW9uPTIwMTQtMDQtMDEtcHJldmlldw==",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"x-ms-version": [
"2014-04-01-preview"
],
"User-Agent": [
"Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0"
]
},
"ResponseBody": "",
"ResponseHeaders": {
"Content-Length": [
"0"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"Retry-After": [
"15"
],
"x-ms-ratelimit-remaining-subscription-reads": [
"14986"
],
"x-ms-request-id": [
"d9fe99fa-0284-482b-b996-8c0b8db8b57f"
],
"x-ms-correlation-request-id": [
"d9fe99fa-0284-482b-b996-8c0b8db8b57f"
],
"x-ms-routing-request-id": [
"LOCAL:20160701T210312Z:d9fe99fa-0284-482b-b996-8c0b8db8b57f"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Fri, 01 Jul 2016 21:03:12 GMT"
],
"Location": [
"https://pt-test02:30005/subscriptions/0C1274D5-4C85-40ED-BC25-A7F4B7360521/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1URVNUUkcxLUxPQ0FMIiwiam9iTG9jYXRpb24iOiJsb2NhbCJ9?api-version=2014-04-01-preview"
]
},
"StatusCode": 202
},
{
"RequestUri": "/subscriptions/0C1274D5-4C85-40ED-BC25-A7F4B7360521/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1URVNUUkcxLUxPQ0FMIiwiam9iTG9jYXRpb24iOiJsb2NhbCJ9?api-version=2014-04-01-preview",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMEMxMjc0RDUtNEM4NS00MEVELUJDMjUtQTdGNEI3MzYwNTIxL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFVUlZOVVVrY3hMVXhQUTBGTUlpd2lhbTlpVEc5allYUnBiMjRpT2lKc2IyTmhiQ0o5P2FwaS12ZXJzaW9uPTIwMTQtMDQtMDEtcHJldmlldw==",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"x-ms-version": [
"2014-04-01-preview"
],
"User-Agent": [
"Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0"
]
},
"ResponseBody": "",
"ResponseHeaders": {
"Content-Length": [
"0"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"Retry-After": [
"15"
],
"x-ms-ratelimit-remaining-subscription-reads": [
"14985"
],
"x-ms-request-id": [
"13283795-90d9-479a-ab1c-9a630ae1898b"
],
"x-ms-correlation-request-id": [
"13283795-90d9-479a-ab1c-9a630ae1898b"
],
"x-ms-routing-request-id": [
"LOCAL:20160701T210328Z:13283795-90d9-479a-ab1c-9a630ae1898b"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Fri, 01 Jul 2016 21:03:28 GMT"
],
"Location": [
"https://pt-test02:30005/subscriptions/0C1274D5-4C85-40ED-BC25-A7F4B7360521/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1URVNUUkcxLUxPQ0FMIiwiam9iTG9jYXRpb24iOiJsb2NhbCJ9?api-version=2014-04-01-preview"
]
},
"StatusCode": 202
},
{
"RequestUri": "/subscriptions/0C1274D5-4C85-40ED-BC25-A7F4B7360521/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1URVNUUkcxLUxPQ0FMIiwiam9iTG9jYXRpb24iOiJsb2NhbCJ9?api-version=2014-04-01-preview",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMEMxMjc0RDUtNEM4NS00MEVELUJDMjUtQTdGNEI3MzYwNTIxL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFVUlZOVVVrY3hMVXhQUTBGTUlpd2lhbTlpVEc5allYUnBiMjRpT2lKc2IyTmhiQ0o5P2FwaS12ZXJzaW9uPTIwMTQtMDQtMDEtcHJldmlldw==",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"x-ms-version": [
"2014-04-01-preview"
],
"User-Agent": [
"Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0"
]
},
"ResponseBody": "",
"ResponseHeaders": {
"Content-Length": [
"0"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"Retry-After": [
"15"
],
"x-ms-ratelimit-remaining-subscription-reads": [
"14984"
],
"x-ms-request-id": [
"76f822d4-ab49-4f06-98f3-db3fcb4bdf7e"
],
"x-ms-correlation-request-id": [
"76f822d4-ab49-4f06-98f3-db3fcb4bdf7e"
],
"x-ms-routing-request-id": [
"LOCAL:20160701T210343Z:76f822d4-ab49-4f06-98f3-db3fcb4bdf7e"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Fri, 01 Jul 2016 21:03:43 GMT"
],
"Location": [
"https://pt-test02:30005/subscriptions/0C1274D5-4C85-40ED-BC25-A7F4B7360521/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1URVNUUkcxLUxPQ0FMIiwiam9iTG9jYXRpb24iOiJsb2NhbCJ9?api-version=2014-04-01-preview"
]
},
"StatusCode": 202
},
{
"RequestUri": "/subscriptions/0C1274D5-4C85-40ED-BC25-A7F4B7360521/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1URVNUUkcxLUxPQ0FMIiwiam9iTG9jYXRpb24iOiJsb2NhbCJ9?api-version=2014-04-01-preview",
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMEMxMjc0RDUtNEM4NS00MEVELUJDMjUtQTdGNEI3MzYwNTIxL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFVUlZOVVVrY3hMVXhQUTBGTUlpd2lhbTlpVEc5allYUnBiMjRpT2lKc2IyTmhiQ0o5P2FwaS12ZXJzaW9uPTIwMTQtMDQtMDEtcHJldmlldw==",
"RequestMethod": "GET",
"RequestBody": "",
"RequestHeaders": {
"x-ms-version": [
"2014-04-01-preview"
],
"User-Agent": [
"Microsoft.Azure.Management.Resources.ResourceManagementClient/2.0.0.0"
]
},
"ResponseBody": "",
"ResponseHeaders": {
"Content-Length": [
"0"
],
"Expires": [
"-1"
],
"Pragma": [
"no-cache"
],
"x-ms-ratelimit-remaining-subscription-reads": [
"14983"
],
"x-ms-request-id": [
"803378b4-b9ee-4a7b-9c6b-43c4cf651dd2"
],
"x-ms-correlation-request-id": [
"803378b4-b9ee-4a7b-9c6b-43c4cf651dd2"
],
"x-ms-routing-request-id": [
"LOCAL:20160701T210358Z:803378b4-b9ee-4a7b-9c6b-43c4cf651dd2"
],
"Strict-Transport-Security": [
"max-age=31536000; includeSubDomains"
],
"Cache-Control": [
"no-cache"
],
"Date": [
"Fri, 01 Jul 2016 21:03:58 GMT"
]
},
"StatusCode": 200
}
],
"Names": {},
"Variables": {
"SubscriptionId": "0C1274D5-4C85-40ED-BC25-A7F4B7360521"
}
}

Просмотреть файл

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Hyak.Common" version="1.0.3" targetFramework="net45" />
<package id="Microsoft.Azure.Common" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.18.14-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Test.Framework" version="1.0.6068.31305-prerelease" targetFramework="net45" />
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.0.6068.31305-prerelease" targetFramework="net45" />
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net45" />
<package id="Microsoft.Data.Edm" version="5.6.4" targetFramework="net45" />
<package id="Microsoft.Data.OData" version="5.6.4" targetFramework="net45" />
<package id="Microsoft.Data.Services.Client" version="5.6.4" targetFramework="net45" />
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.28.1" targetFramework="net45" />
<package id="Microsoft.Rest.ClientRuntime" version="1.8.2" targetFramework="net45" />
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="3.2.0" targetFramework="net45" />
<package id="Moq" version="4.2.1402.2112" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
<package id="System.Spatial" version="5.6.4" targetFramework="net45" />
<package id="WindowsAzure.Storage" version="6.1.0" targetFramework="net45" />
<package id="xunit" version="1.9.2" targetFramework="net45" />
<package id="xunit.extensions" version="1.9.2" targetFramework="net45" />
<package id="xunit.runner.visualstudio" version="2.1.0-beta4-build1109" targetFramework="net45" />
</packages>

Просмотреть файл

@ -0,0 +1,111 @@
// ----------------------------------------------------------------------------------
//
// 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 Microsoft.Azure.Commands.Common.Authentication.Abstractions;
namespace Microsoft.AzureStack.Commands
{
using System;
using System.Linq;
using System.Net;
using Microsoft.Azure.Commands.ResourceManager.Common;
using Microsoft.Azure.Commands.Common.Authentication;
using Microsoft.Azure.Commands.Common.Authentication.Models;
using Microsoft.Azure;
using Microsoft.AzureStack.Management;
/// <summary>
/// Base Admin API cmdlet class
/// </summary>
public abstract class AdminApiCmdlet : AzureRMCmdlet
{
protected const string SubscriptionApiVersion = "2015-11-01";
protected const string GalleryAdminApiVersion = "2015-04-01";
protected const string UsageApiVersion = "2015-06-01-preview";
/// <summary>
/// Gets or sets the API version. Not a parameter that is to bes passed from outside
/// </summary>
protected string ApiVersion { get; set; }
/// <summary>
/// Default constructor
/// </summary>
protected AdminApiCmdlet()
{
this.ApiVersion = SubscriptionApiVersion;
}
/// <summary>
/// Gets the current default context. overriding it here since DefaultContext could be null for Windows Auth/ADFS environments
/// </summary>
protected override IAzureContext DefaultContext
{
get
{
if (DefaultProfile == null)
{
return null;
}
return DefaultProfile.DefaultContext;
}
}
/// <summary>
/// Execute this cmdlet.
/// </summary>
/// <remarks>
/// Descendant classes must override this methods instead of Cmdlet.ProcessRecord, so
/// we can have a unique place where log all errors.
/// </remarks>
protected override void ProcessRecord()
{
var originalValidateCallback = ServicePointManager.ServerCertificateValidationCallback;
if (this.MyInvocation.BoundParameters.Keys.Contains("ResourceGroup", StringComparer.OrdinalIgnoreCase))
{
this.WriteWarning("The parameter alias ResourceGroup will be deprecated in a future release. Please use the parameter ResourceGroupName instead");
}
// Execute the API call(s) for the current cmdlet
this.ExecuteCore();
}
/// <summary>
/// Executes the API call(s) against Azure Resource Management API(s).
/// </summary>
protected abstract void ExecuteCore();
/// <summary>
/// Gets the Azure Stack management client.
/// </summary>
protected AzureStackClient GetAzureStackClient()
{
return GetAzureStackClientThruAzureSession();
}
private AzureStackClient GetAzureStackClientThruAzureSession()
{
var armUri = this.DefaultContext.Environment.GetEndpointAsUri(AzureEnvironment.Endpoint.ResourceManager);
var credentials = AzureSession.Instance.AuthenticationFactory.GetSubscriptionCloudCredentials(this.DefaultContext);
return AzureSession.Instance.ClientFactory.CreateCustomClient<AzureStackClient>(armUri, credentials, this.ApiVersion);
}
}
}

Просмотреть файл

@ -0,0 +1,95 @@
// ----------------------------------------------------------------------------------
//
// 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 Newtonsoft.Json.Linq;
namespace Microsoft.AzureStack.Commands
{
using System;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Argument Validation Methods
/// </summary>
public static class ArgumentValidator
{
/// <summary>
/// Checks if argument is null.
/// </summary>
/// <param name="paramName">Name of the property.</param>
/// <param name="value">The value.</param>
public static void ValidateNotNull(string paramName, object value)
{
if (value == null)
{
throw new ArgumentNullException(paramName);
}
}
/// <summary>
/// Checks if argument is empty.
/// </summary>
/// <param name="paramName">Name of the property.</param>
/// <param name="value">The value.</param>
public static void ValidateNotEmpty(string paramName, string value)
{
if (value == null)
{
throw new ArgumentNullException(paramName);
}
if (string.IsNullOrWhiteSpace(value))
{
throw new ArgumentException(Resources.ExpectedNotEmptyValue, paramName: paramName);
}
}
/// <summary>
/// Checks if argument is null or empty collection.
/// </summary>
/// <typeparam name="T">Type of items in the collection</typeparam>
/// <param name="paramName">Name of the property.</param>
/// <param name="collection">The collection.</param>
public static void ValidateNotEmpty<T>(string paramName, IEnumerable<T> collection)
{
if (collection == null)
{
throw new ArgumentNullException(paramName);
}
if (!collection.Any())
{
throw new ArgumentException(Resources.ExpectedNotEmptyCollection, paramName: paramName);
}
}
/// <summary>
/// Checks if the argument is a valid json string
/// </summary>
/// <param name="paramName">Name of the property</param>
/// <param name="value">The json string</param>
public static void ValidateJson(string paramName, string value)
{
try
{
JObject.Parse(value);
}
catch
{
throw new ArgumentException(Resources.InvalidJson, paramName: paramName);
}
}
}
}

Просмотреть файл

@ -0,0 +1,308 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{0B02390C-8AA9-4D99-8AA8-2A9D2D39682F}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<AssemblyName>Microsoft.AzureStack.Commands</AssemblyName>
<RootNamespace>Microsoft.AzureStack.Commands</RootNamespace>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<CodeAnalysisAdditionalOptions>/assemblyCompareMode:StrongNameIgnoringVersion</CodeAnalysisAdditionalOptions>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\Stack\Debug\ResourceManager\AzureResourceManager\AzureRM.AzureStackAdmin\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<RunCodeAnalysis>true</RunCodeAnalysis>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>..\..\..\Stack\Release\ResourceManager\AzureResourceManager\AzureRM.AzureStackAdmin\</OutputPath>
<DefineConstants>TRACE;SIGN</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisLogFile>bin\Release\Microsoft.AzureStack.Commands.dll.CodeAnalysisLog.xml</CodeAnalysisLogFile>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSetDirectories>;$(ProgramFiles)\Microsoft Visual Studio 12.0\Team Tools\Static Analysis Tools\Rule Sets</CodeAnalysisRuleSetDirectories>
<CodeAnalysisRuleDirectories>;$(ProgramFiles)\Microsoft Visual Studio 12.0\Team Tools\Static Analysis Tools\FxCop\Rules</CodeAnalysisRuleDirectories>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>MSSharedLibKey.snk</AssemblyOriginatorKeyFile>
<DelaySign>true</DelaySign>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<!-- <Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Extensions">
<HintPath>..\..\..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Primitives">
<HintPath>..\..\..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.WebRequest" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Web" />
<Reference Include="System.XML" />
<Reference Include="System.Xml.Linq" /> -->
<Reference Include="System.ServiceModel" />
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory">
<HintPath>$(LibraryNugetPackageFolder)\Microsoft.IdentityModel.Clients.ActiveDirectory.2.28.3\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Common\Commands.Common.Authentication.Abstractions\Commands.Common.Authentication.Abstractions.csproj">
<Project>{70527617-7598-4aef-b5bd-db9186b8184b}</Project>
<Name>Commands.Common.Authentication.Abstractions</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Common\Commands.Common\Commands.Common.csproj">
<Project>{5ee72c53-1720-4309-b54b-5fb79703195f}</Project>
<Name>Commands.Common</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\ResourceManager\Common\Commands.ResourceManager.Common\Commands.ResourceManager.Common.csproj">
<Project>{3819d8a7-c62c-4c47-8ddd-0332d9ce1252}</Project>
<Name>Commands.ResourceManager.Common</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Compile Include="AdminApiCmdlet.cs" />
<Compile Include="ArgumentValidator.cs" />
<Compile Include="Common\AdjustToUniversalIsoDateTimeConverter.cs" />
<Compile Include="Common\CamelCasePropertyNamesWithOverridesContractResolver.cs" />
<Compile Include="Common\JsonExtensions.cs" />
<Compile Include="Common\JsonLineInfo.cs" />
<Compile Include="Common\JsonPreserveCaseDictionaryAttribute.cs" />
<Compile Include="Common\LineInfoJsonConverter.cs" />
<Compile Include="Common\TimeSpanJsonConverter.cs" />
<Compile Include="Generated\AzureStackClient.cs" />
<Compile Include="Generated\AzureStackClientExtensions.cs" />
<Compile Include="Generated\CurationOperations.cs" />
<Compile Include="Generated\CurationOperationsExtensions.cs" />
<Compile Include="Generated\ExtensionMetadataOperations.cs" />
<Compile Include="Generated\ExtensionMetadataOperationsExtensions.cs" />
<Compile Include="Generated\GalleryItemOperations.cs" />
<Compile Include="Generated\GalleryItemOperationsExtensions.cs" />
<Compile Include="Generated\IAzureStackClient.cs" />
<Compile Include="Generated\ICurationOperations.cs" />
<Compile Include="Generated\IExtensionMetadataOperations.cs" />
<Compile Include="Generated\IGalleryItemOperations.cs" />
<Compile Include="Generated\IManagedLocationOperations.cs" />
<Compile Include="Generated\IManagedOfferOperations.cs" />
<Compile Include="Generated\IManagedPlanOperations.cs" />
<Compile Include="Generated\IManagedSubscriptionOperations.cs" />
<Compile Include="Generated\IOfferOperations.cs" />
<Compile Include="Generated\IPlanOperations.cs" />
<Compile Include="Generated\IProviderRegistrationOperations.cs" />
<Compile Include="Generated\IPublicGalleryItemOperations.cs" />
<Compile Include="Generated\IResourceGroupOperations.cs" />
<Compile Include="Generated\ISubscriptionOperations.cs" />
<Compile Include="Generated\ISubscriptionOperationsAsAdmin.cs" />
<Compile Include="Generated\IUsageConnectionsOperations.cs" />
<Compile Include="Generated\ManagedLocationOperations.cs" />
<Compile Include="Generated\ManagedLocationOperationsExtensions.cs" />
<Compile Include="Generated\ManagedOfferOperations.cs" />
<Compile Include="Generated\ManagedOfferOperationsExtensions.cs" />
<Compile Include="Generated\ManagedPlanOperations.cs" />
<Compile Include="Generated\ManagedPlanOperationsExtensions.cs" />
<Compile Include="Generated\ManagedSubscriptionOperations.cs" />
<Compile Include="Generated\ManagedSubscriptionOperationsExtensions.cs" />
<Compile Include="Generated\Models\AccessibilityState.cs" />
<Compile Include="Generated\Models\AddonPlanDefinition.cs" />
<Compile Include="Generated\Models\AdminOfferModel.cs" />
<Compile Include="Generated\Models\AdminOfferPropertiesDefinition.cs" />
<Compile Include="Generated\Models\AdminPlanModel.cs" />
<Compile Include="Generated\Models\AdminPlanPropertiesDefinition.cs" />
<Compile Include="Generated\Models\AdminSubscriptionDefinition.cs" />
<Compile Include="Generated\Models\ApiProfile.cs" />
<Compile Include="Generated\Models\CurationItem.cs" />
<Compile Include="Generated\Models\CurationListResult.cs" />
<Compile Include="Generated\Models\DefinitionTemplates.cs" />
<Compile Include="Generated\Models\ExtensionCollectionDefinition.cs" />
<Compile Include="Generated\Models\ExtensionDefinition.cs" />
<Compile Include="Generated\Models\ExtensionMetadata.cs" />
<Compile Include="Generated\Models\ExtensionMetadataListResult.cs" />
<Compile Include="Generated\Models\ExtensionPropertiesDefinition.cs" />
<Compile Include="Generated\Models\GalleryItem.cs" />
<Compile Include="Generated\Models\GalleryItemCreateOrUpdateParameters.cs" />
<Compile Include="Generated\Models\GalleryItemGetResult.cs" />
<Compile Include="Generated\Models\GalleryItemListResult.cs" />
<Compile Include="Generated\Models\GalleryItemModel.cs" />
<Compile Include="Generated\Models\GalleryItemUriPayload.cs" />
<Compile Include="Generated\Models\IconKind.cs" />
<Compile Include="Generated\Models\LinkProperties.cs" />
<Compile Include="Generated\Models\Location.cs" />
<Compile Include="Generated\Models\ManagedLocationCreateOrUpdateParameters.cs" />
<Compile Include="Generated\Models\ManagedLocationCreateOrUpdateResult.cs" />
<Compile Include="Generated\Models\ManagedLocationGetResult.cs" />
<Compile Include="Generated\Models\ManagedLocationListResult.cs" />
<Compile Include="Generated\Models\ManagedOfferCreateOrUpdateParameters.cs" />
<Compile Include="Generated\Models\ManagedOfferCreateOrUpdateResult.cs" />
<Compile Include="Generated\Models\ManagedOfferGetResult.cs" />
<Compile Include="Generated\Models\ManagedOfferListResult.cs" />
<Compile Include="Generated\Models\ManagedPlanCreateOrUpdateParameters.cs" />
<Compile Include="Generated\Models\ManagedPlanCreateOrUpdateResult.cs" />
<Compile Include="Generated\Models\ManagedPlanGetResult.cs" />
<Compile Include="Generated\Models\ManagedPlanListResult.cs" />
<Compile Include="Generated\Models\ManagedSubscriptionCreateOrUpdateParameters.cs" />
<Compile Include="Generated\Models\ManagedSubscriptionCreateOrUpdateResult.cs" />
<Compile Include="Generated\Models\ManagedSubscriptionGetResult.cs" />
<Compile Include="Generated\Models\ManagedSubscriptionListResult.cs" />
<Compile Include="Generated\Models\ManifestPropertiesDefinition.cs" />
<Compile Include="Generated\Models\MarketplaceType.cs" />
<Compile Include="Generated\Models\OfferDefinition.cs" />
<Compile Include="Generated\Models\OfferGetPriceResult.cs" />
<Compile Include="Generated\Models\OfferGetResult.cs" />
<Compile Include="Generated\Models\OfferListResult.cs" />
<Compile Include="Generated\Models\PlanAvailabilityDefinition.cs" />
<Compile Include="Generated\Models\PlanDefinition.cs" />
<Compile Include="Generated\Models\PlanGetResult.cs" />
<Compile Include="Generated\Models\PlanListResult.cs" />
<Compile Include="Generated\Models\PriceDefinition.cs" />
<Compile Include="Generated\Models\ProviderRegistrationCreateOrUpdateParameters.cs" />
<Compile Include="Generated\Models\ProviderRegistrationCreateOrUpdateResult.cs" />
<Compile Include="Generated\Models\ProviderRegistrationGetResult.cs" />
<Compile Include="Generated\Models\ProviderRegistrationListResult.cs" />
<Compile Include="Generated\Models\ProviderRegistrationModel.cs" />
<Compile Include="Generated\Models\ProvisioningState.cs" />
<Compile Include="Generated\Models\PublicGalleryItemListResult.cs" />
<Compile Include="Generated\Models\ResourceBase.cs" />
<Compile Include="Generated\Models\ResourceDefinition.cs" />
<Compile Include="Generated\Models\ResourceDeletionPolicy.cs" />
<Compile Include="Generated\Models\ResourceGroupCreateOrUpdateParameters.cs" />
<Compile Include="Generated\Models\ResourceGroupCreateOrUpdateResult.cs" />
<Compile Include="Generated\Models\ResourceGroupDefinition.cs" />
<Compile Include="Generated\Models\ResourceGroupGetResult.cs" />
<Compile Include="Generated\Models\ResourceGroupListResourcesResult.cs" />
<Compile Include="Generated\Models\ResourceGroupListResult.cs" />
<Compile Include="Generated\Models\ResourceGroupPropertiesDefinition.cs" />
<Compile Include="Generated\Models\ResourceManagerType.cs" />
<Compile Include="Generated\Models\ResourceProviderAuthorization.cs" />
<Compile Include="Generated\Models\ResourceProviderEndpoint.cs" />
<Compile Include="Generated\Models\ResourceType.cs" />
<Compile Include="Generated\Models\RoutingType.cs" />
<Compile Include="Generated\Models\SubscriptionCreateOrUpdateAsAdminParameters.cs" />
<Compile Include="Generated\Models\SubscriptionCreateOrUpdateAsAdminResult.cs" />
<Compile Include="Generated\Models\SubscriptionCreateOrUpdateParameters.cs" />
<Compile Include="Generated\Models\SubscriptionCreateOrUpdateResult.cs" />
<Compile Include="Generated\Models\SubscriptionDefinition.cs" />
<Compile Include="Generated\Models\SubscriptionGetAsAdminResult.cs" />
<Compile Include="Generated\Models\SubscriptionGetResult.cs" />
<Compile Include="Generated\Models\SubscriptionListAsAdminResult.cs" />
<Compile Include="Generated\Models\SubscriptionListResult.cs" />
<Compile Include="Generated\Models\SubscriptionState.cs" />
<Compile Include="Generated\Models\UsageConnection.cs" />
<Compile Include="Generated\Models\UsageConnectionModel.cs" />
<Compile Include="Generated\Models\UsageConnectionsCreateOrUpdateParameters.cs" />
<Compile Include="Generated\Models\UsageConnectionsCreateOrUpdateResult.cs" />
<Compile Include="Generated\Models\UsageConnectionsGetResult.cs" />
<Compile Include="Generated\Models\UsageConnectionsListResult.cs" />
<Compile Include="Generated\OfferOperations.cs" />
<Compile Include="Generated\OfferOperationsExtensions.cs" />
<Compile Include="Generated\PlanOperations.cs" />
<Compile Include="Generated\PlanOperationsExtensions.cs" />
<Compile Include="Generated\ProviderRegistrationOperations.cs" />
<Compile Include="Generated\ProviderRegistrationOperationsExtensions.cs" />
<Compile Include="Generated\PublicGalleryItemOperations.cs" />
<Compile Include="Generated\PublicGalleryItemOperationsExtensions.cs" />
<Compile Include="Generated\ResourceGroupOperations.cs" />
<Compile Include="Generated\ResourceGroupOperationsExtensions.cs" />
<Compile Include="Generated\SubscriptionOperations.cs" />
<Compile Include="Generated\SubscriptionOperationsAsAdmin.cs" />
<Compile Include="Generated\SubscriptionOperationsAsAdminExtensions.cs" />
<Compile Include="Generated\SubscriptionOperationsExtensions.cs" />
<Compile Include="Generated\UsageConnectionsOperations.cs" />
<Compile Include="Generated\UsageConnectionsOperationsExtensions.cs" />
<Compile Include="Microsoft.Commerce\UsageConnections\AddUsageConnection.cs" />
<Compile Include="Microsoft.Commerce\UsageConnections\GetUsageConnection.cs" />
<Compile Include="Microsoft.Commerce\UsageConnections\RemoveUsageConnection.cs" />
<Compile Include="Microsoft.Subscriptions\Offers\GetManagedOffer.cs" />
<Compile Include="StringExtensions.cs" />
<Compile Include="ValidateAbsoluteUriAttribute.cs" />
<None Include="..\AzureRM.AzureStackAdmin.psd1">
<Link>AzureRM.AzureStackAdmin.psd1</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="Microsoft.AzureStack.Commands.dll-help.psd1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<Compile Include="CommonPSConst.cs" />
<Compile Include="Microsoft.Subscriptions\Locations\GetLocation.cs" />
<Compile Include="Microsoft.Subscriptions\Locations\NewLocation.cs" />
<Compile Include="Microsoft.Subscriptions\Locations\RemoveLocation.cs" />
<Compile Include="Microsoft.Subscriptions\Locations\SetLocation.cs" />
<Compile Include="Microsoft.Gallery\GalleryItems\AddGalleryItem.cs" />
<Compile Include="Microsoft.Gallery\GalleryItems\GetGalleryItem.cs" />
<Compile Include="Microsoft.Gallery\GalleryItems\RemoveGalleryItem.cs" />
<Compile Include="Microsoft.Subscriptions\Offers\GetOffer.cs" />
<Compile Include="Microsoft.Subscriptions\Offers\NewOffer.cs" />
<Compile Include="Microsoft.Subscriptions\Offers\RemoveOffer.cs" />
<Compile Include="Microsoft.Subscriptions\Offers\SetOffer.cs" />
<Compile Include="Microsoft.Subscriptions\Plans\GetPlan.cs" />
<Compile Include="Microsoft.Subscriptions\Plans\NewPlan.cs" />
<Compile Include="Microsoft.Subscriptions\Plans\RemovePlan.cs" />
<Compile Include="Microsoft.Subscriptions\Plans\SetPlan.cs" />
<Compile Include="Microsoft.Subscriptions\ProviderRegistrations\AddResourceProviderRegistration.cs" />
<Compile Include="Microsoft.Subscriptions\ProviderRegistrations\GetResourceProviderRegistration.cs" />
<Compile Include="Microsoft.Subscriptions\ProviderRegistrations\RemoveResourceProviderRegistration.cs" />
<Compile Include="Microsoft.Subscriptions\ProviderRegistrations\SetResourceProviderRegistration.cs" />
<Compile Include="Microsoft.Subscriptions\Subscriptions\GetTenantSubscription.cs" />
<Compile Include="Microsoft.Subscriptions\Subscriptions\GetSubscription.cs" />
<Compile Include="Microsoft.Subscriptions\Subscriptions\NewTenantSubscription.cs" />
<Compile Include="Microsoft.Subscriptions\Subscriptions\NewSubscription.cs" />
<Compile Include="Microsoft.Subscriptions\Subscriptions\RemoveTenantSubscription.cs" />
<Compile Include="Microsoft.Subscriptions\Subscriptions\RemoveSubscription.cs" />
<Compile Include="Microsoft.Subscriptions\Subscriptions\SetTenantSubscription.cs" />
<Compile Include="Microsoft.Subscriptions\Subscriptions\SetSubscription.cs" />
<Compile Include="Nouns.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Token\AuthenticationContextExtensions.cs" />
<Compile Include="Token\GetToken.cs" />
<Compile Include="Token\Shared.Authorization.cs" />
</ItemGroup>
<ItemGroup>
<None Include="MSSharedLibKey.snk" />
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Content Include="Microsoft.AzureStack.Commands.dll-help.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Token\readme.txt" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\..\..\tools\Common.Dependencies.targets" />
</Project>

Просмотреть файл

@ -0,0 +1,34 @@
// ----------------------------------------------------------------------------------
//
// 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.
// ----------------------------------------------------------------------------------
namespace Microsoft.AzureStack.Commands.Common
{
using System.Globalization;
using Newtonsoft.Json.Converters;
/// <summary>
/// The 'AdjustToUniversal' ISO 8601 date time converter.
/// </summary>
internal sealed class AdjustToUniversalIsoDateTimeConverter : IsoDateTimeConverter
{
/// <summary>
/// Initializes a new instance of the <see cref="AdjustToUniversalIsoDateTimeConverter"/> class.
/// </summary>
public AdjustToUniversalIsoDateTimeConverter()
{
this.DateTimeStyles = DateTimeStyles.AdjustToUniversal;
this.Culture = CultureInfo.InvariantCulture;
}
}
}

Просмотреть файл

@ -0,0 +1,45 @@
// ----------------------------------------------------------------------------------
//
// 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.
// ----------------------------------------------------------------------------------
namespace Microsoft.AzureStack.Commands.Common
{
using System;
using System.Linq;
using Newtonsoft.Json.Serialization;
/// <summary>
/// Overrides the default CamelCase resolver to respect property name set in the <c>JsonPropertyAttribute</c>.
/// </summary>
internal class CamelCasePropertyNamesWithOverridesContractResolver : CamelCasePropertyNamesContractResolver
{
/// <summary>
/// Creates dictionary contract
/// </summary>
/// <param name="objectType">The object type.</param>
protected override JsonDictionaryContract CreateDictionaryContract(Type objectType)
{
ArgumentValidator.ValidateNotNull("objectType", objectType);
var contract = base.CreateDictionaryContract(objectType);
var attributes = objectType.GetCustomAttributes(attributeType: typeof(JsonPreserveCaseDictionaryAttribute), inherit: true);
if (attributes.Any())
{
contract.PropertyNameResolver = propertyName => propertyName;
}
return contract;
}
}
}

Просмотреть файл

@ -0,0 +1,81 @@
// ----------------------------------------------------------------------------------
//
// 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.
// ----------------------------------------------------------------------------------
namespace Microsoft.AzureStack.Commands.Common
{
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
/// <summary>
/// The extension methods for managing JSON requests and responses.
/// </summary>
public static class JsonExtensions
{
/// <summary>
/// The json serialization maximum depth
/// </summary>
private const int JsonSerializationMaxDepth = 512;
/// <summary>
/// The serialization settings used for request/response related serialization and deserialization.
/// </summary>
private static readonly JsonSerializerSettings MediaTypeFormatterSettings = CreateMediaTypeSerializerSettings();
/// <summary>
/// The json media type serializer
/// </summary>
private static readonly JsonSerializer JsonMediaTypeSerializer = JsonSerializer.Create(JsonExtensions.MediaTypeFormatterSettings);
/// <summary>
/// The serialization settings used for request/response related serialization and deserialization.
/// </summary>
public static JsonSerializerSettings CreateMediaTypeSerializerSettings()
{
return new JsonSerializerSettings()
{
MaxDepth = JsonSerializationMaxDepth,
TypeNameHandling = TypeNameHandling.None,
DateParseHandling = DateParseHandling.None,
DateTimeZoneHandling = DateTimeZoneHandling.Utc,
NullValueHandling = NullValueHandling.Ignore,
MissingMemberHandling = MissingMemberHandling.Error,
ContractResolver = new CamelCasePropertyNamesWithOverridesContractResolver(),
Converters = new List<JsonConverter>()
{
new LineInfoJsonConverter(),
new TimeSpanJsonConverter(),
new StringEnumConverter()
{
CamelCaseText = false
},
new AdjustToUniversalIsoDateTimeConverter(),
}
};
}
/// <summary>
/// Deserialize object from its JSON representation.
/// </summary>
/// <typeparam name="T">Type of object.</typeparam>
/// <param name="json">The json.</param>
public static T FromJson<T>(this string json)
{
return JsonConvert.DeserializeObject<T>(json, MediaTypeFormatterSettings);
}
}
}

Просмотреть файл

@ -0,0 +1,44 @@
// ----------------------------------------------------------------------------------
//
// 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.
// ----------------------------------------------------------------------------------
namespace Microsoft.AzureStack.Commands.Common
{
using Newtonsoft.Json;
/// <summary>
/// The line info class.
/// </summary>
internal class JsonLineInfo
{
/// <summary>
/// Determines whether object has line information.
/// </summary>
public bool HasLineInfo()
{
return this.LineNumber.HasValue || this.LinePosition.HasValue;
}
/// <summary>
/// Gets or sets the line number.
/// </summary>
[JsonIgnore]
public int? LineNumber { get; set; }
/// <summary>
/// Gets or sets the line position.
/// </summary>
[JsonIgnore]
public int? LinePosition { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,26 @@
// ----------------------------------------------------------------------------------
//
// 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.
// ----------------------------------------------------------------------------------
namespace Microsoft.AzureStack.Commands.Common
{
using System;
/// <summary>
/// The attribute to preserve the letter case for dictionary keys.
/// </summary>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = false)]
public sealed class JsonPreserveCaseDictionaryAttribute : Attribute
{
}
}

Просмотреть файл

@ -0,0 +1,88 @@
// ----------------------------------------------------------------------------------
//
// 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.
// ----------------------------------------------------------------------------------
namespace Microsoft.AzureStack.Commands.Common
{
using System;
using Newtonsoft.Json;
/// <summary>
/// The line info converter.
/// </summary>
internal sealed class LineInfoJsonConverter : JsonConverter
{
/// <summary>
/// Gets a value indicating whether this converter can write JSON.
/// </summary>
public override bool CanWrite
{
get { return false; }
}
/// <summary>
/// Writes the JSON representation of the object.
/// </summary>
/// <param name="writer">The writer.</param>
/// <param name="value">The value.</param>
/// <param name="serializer">The calling serializer.</param>
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
throw new NotImplementedException(message: "Converter is not writable. Method should not be invoked");
}
/// <summary>
/// Determines whether this instance can convert the specified object type.
/// </summary>
/// <param name="objectType">Type of the object.</param>
public override bool CanConvert(Type objectType)
{
return typeof(JsonLineInfo).IsAssignableFrom(objectType);
}
/// <summary>
/// Reads the <c>JSON</c>.
/// </summary>
/// <param name="reader">The reader.</param>
/// <param name="objectType">Type of the object.</param>
/// <param name="existingValue">The existing value.</param>
/// <param name="serializer">The serializer.</param>
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
ArgumentValidator.ValidateNotNull("reader", reader);
ArgumentValidator.ValidateNotNull("serializer", serializer);
if (reader.TokenType == JsonToken.Null)
{
return null;
}
int lineNumber = 0;
int linePosition = 0;
var jsonLineInfo = reader as IJsonLineInfo;
if (jsonLineInfo != null && jsonLineInfo.HasLineInfo())
{
lineNumber = jsonLineInfo.LineNumber;
linePosition = jsonLineInfo.LinePosition;
}
var lineInfoObject = Activator.CreateInstance(objectType) as JsonLineInfo;
serializer.Populate(reader, lineInfoObject);
lineInfoObject.LineNumber = lineNumber;
lineInfoObject.LinePosition = linePosition;
return lineInfoObject;
}
}
}

Просмотреть файл

@ -0,0 +1,63 @@
// ----------------------------------------------------------------------------------
//
// 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.
// ----------------------------------------------------------------------------------
namespace Microsoft.AzureStack.Commands.Common
{
using System;
using System.Xml;
using Newtonsoft.Json;
/// <summary>
/// The TimeSpan converter based on ISO 8601 format.
/// </summary>
internal sealed class TimeSpanJsonConverter : JsonConverter
{
/// <summary>
/// Writes the <c>JSON</c>.
/// </summary>
/// <param name="writer">The writer.</param>
/// <param name="value">The value.</param>
/// <param name="serializer">The serializer.</param>
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
ArgumentValidator.ValidateNotNull("serializer", serializer);
serializer.Serialize(writer, XmlConvert.ToString((TimeSpan)value));
}
/// <summary>
/// Reads the <c>JSON</c>.
/// </summary>
/// <param name="reader">The reader.</param>
/// <param name="objectType">Type of the object.</param>
/// <param name="existingValue">The existing value.</param>
/// <param name="serializer">The serializer.</param>
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
ArgumentValidator.ValidateNotNull("reader", reader);
ArgumentValidator.ValidateNotNull("serializer", serializer);
return reader.TokenType != JsonToken.Null ? (object)XmlConvert.ToTimeSpan(serializer.Deserialize<string>(reader)) : null;
}
/// <summary>
/// Determines whether this instance can convert the specified object type.
/// </summary>
/// <param name="objectType">Type of the object.</param>
public override bool CanConvert(Type objectType)
{
return objectType == typeof(TimeSpan) || objectType == typeof(TimeSpan?);
}
}
}

Просмотреть файл

@ -0,0 +1,38 @@
// ----------------------------------------------------------------------------------
//
// 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.
// ----------------------------------------------------------------------------------
namespace Microsoft.AzureStack.Commands
{
/// <summary>
/// Common constants for all PowerShell modules
/// </summary>
public static class CommonPSConst
{
/// <summary>
/// Parameter set names
/// </summary>
public static class ParameterSet
{
/// <summary>
/// Parameter set for property base parameters.
/// </summary>
public const string ByProperty = "ByProperty";
/// <summary>
/// Parameter set for full object base parameters.
/// </summary>
public const string ByObject = "ByObject";
}
}
}

Просмотреть файл

@ -0,0 +1,389 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using System.Net.Http;
using Hyak.Common;
using Microsoft.Azure;
using Microsoft.AzureStack.Management;
namespace Microsoft.AzureStack.Management
{
public partial class AzureStackClient : ServiceClient<AzureStackClient>, IAzureStackClient
{
private string _apiVersion;
/// <summary>
/// Apiversion of the endpoint
/// </summary>
public string ApiVersion
{
get { return this._apiVersion; }
set { this._apiVersion = value; }
}
private Uri _baseUri;
/// <summary>
/// Resource Manager endpoint
/// </summary>
public Uri BaseUri
{
get { return this._baseUri; }
set { this._baseUri = value; }
}
private SubscriptionCloudCredentials _credentials;
/// <summary>
/// Credentials to access resource manager endpoint
/// </summary>
public SubscriptionCloudCredentials Credentials
{
get { return this._credentials; }
set { this._credentials = value; }
}
private ICurationOperations _curation;
/// <summary>
/// Operations on the curation items (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
public virtual ICurationOperations Curation
{
get { return this._curation; }
}
private IExtensionMetadataOperations _extensionsMetadata;
/// <summary>
/// Operations for extensions metadata. (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
public virtual IExtensionMetadataOperations ExtensionsMetadata
{
get { return this._extensionsMetadata; }
}
private IGalleryItemOperations _galleryItem;
/// <summary>
/// Gallery item operations. (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
public virtual IGalleryItemOperations GalleryItem
{
get { return this._galleryItem; }
}
private IManagedLocationOperations _managedLocations;
/// <summary>
/// Managed locations operations for admin. (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
public virtual IManagedLocationOperations ManagedLocations
{
get { return this._managedLocations; }
}
private IManagedOfferOperations _managedOffers;
/// <summary>
/// Administrator Operations on the offer (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
public virtual IManagedOfferOperations ManagedOffers
{
get { return this._managedOffers; }
}
private IManagedPlanOperations _managedPlans;
/// <summary>
/// Administrator operations on the plan (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
public virtual IManagedPlanOperations ManagedPlans
{
get { return this._managedPlans; }
}
private IManagedSubscriptionOperations _managedSubscriptions;
/// <summary>
/// Administrator Operations on the subscription (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
public virtual IManagedSubscriptionOperations ManagedSubscriptions
{
get { return this._managedSubscriptions; }
}
private IOfferOperations _offers;
/// <summary>
/// Operations on the offer (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
public virtual IOfferOperations Offers
{
get { return this._offers; }
}
private IPlanOperations _plans;
/// <summary>
/// Operations on the plan (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
public virtual IPlanOperations Plans
{
get { return this._plans; }
}
private IProviderRegistrationOperations _providerRegistrations;
/// <summary>
/// Resource provider manifest registration operations (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
public virtual IProviderRegistrationOperations ProviderRegistrations
{
get { return this._providerRegistrations; }
}
private IPublicGalleryItemOperations _publicGalleryItem;
/// <summary>
/// Public gallery items operations. (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
public virtual IPublicGalleryItemOperations PublicGalleryItem
{
get { return this._publicGalleryItem; }
}
private IResourceGroupOperations _resourceGroups;
/// <summary>
/// Operations on the resource group
/// </summary>
public virtual IResourceGroupOperations ResourceGroups
{
get { return this._resourceGroups; }
}
private ISubscriptionOperations _subscriptions;
/// <summary>
/// Operations on the subscription as a tenant (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
public virtual ISubscriptionOperations Subscriptions
{
get { return this._subscriptions; }
}
private ISubscriptionOperationsAsAdmin _tenantSubscriptions;
/// <summary>
/// Administrator Operations on the subscription (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
public virtual ISubscriptionOperationsAsAdmin TenantSubscriptions
{
get { return this._tenantSubscriptions; }
}
private IUsageConnectionsOperations _usageConnections;
/// <summary>
/// Usage connection operations (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
public virtual IUsageConnectionsOperations UsageConnections
{
get { return this._usageConnections; }
}
/// <summary>
/// Initializes a new instance of the AzureStackClient class.
/// </summary>
public AzureStackClient()
: base()
{
this._curation = new CurationOperations(this);
this._extensionsMetadata = new ExtensionMetadataOperations(this);
this._galleryItem = new GalleryItemOperations(this);
this._managedLocations = new ManagedLocationOperations(this);
this._managedOffers = new ManagedOfferOperations(this);
this._managedPlans = new ManagedPlanOperations(this);
this._managedSubscriptions = new ManagedSubscriptionOperations(this);
this._offers = new OfferOperations(this);
this._plans = new PlanOperations(this);
this._providerRegistrations = new ProviderRegistrationOperations(this);
this._publicGalleryItem = new PublicGalleryItemOperations(this);
this._resourceGroups = new ResourceGroupOperations(this);
this._subscriptions = new SubscriptionOperations(this);
this._tenantSubscriptions = new SubscriptionOperationsAsAdmin(this);
this._usageConnections = new UsageConnectionsOperations(this);
this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
}
/// <summary>
/// Initializes a new instance of the AzureStackClient class.
/// </summary>
/// <param name='baseUri'>
/// Required. Resource Manager endpoint
/// </param>
/// <param name='credentials'>
/// Required. Credentials to access resource manager endpoint
/// </param>
/// <param name='apiVersion'>
/// Required. Apiversion of the endpoint
/// </param>
public AzureStackClient(Uri baseUri, SubscriptionCloudCredentials credentials, string apiVersion)
: this()
{
if (baseUri == null)
{
throw new ArgumentNullException("baseUri");
}
if (credentials == null)
{
throw new ArgumentNullException("credentials");
}
if (apiVersion == null)
{
throw new ArgumentNullException("apiVersion");
}
this._baseUri = baseUri;
this._credentials = credentials;
this._apiVersion = apiVersion;
this.Credentials.InitializeServiceClient(this);
}
/// <summary>
/// Initializes a new instance of the AzureStackClient class.
/// </summary>
/// <param name='httpClient'>
/// The Http client
/// </param>
public AzureStackClient(HttpClient httpClient)
: base(httpClient)
{
this._curation = new CurationOperations(this);
this._extensionsMetadata = new ExtensionMetadataOperations(this);
this._galleryItem = new GalleryItemOperations(this);
this._managedLocations = new ManagedLocationOperations(this);
this._managedOffers = new ManagedOfferOperations(this);
this._managedPlans = new ManagedPlanOperations(this);
this._managedSubscriptions = new ManagedSubscriptionOperations(this);
this._offers = new OfferOperations(this);
this._plans = new PlanOperations(this);
this._providerRegistrations = new ProviderRegistrationOperations(this);
this._publicGalleryItem = new PublicGalleryItemOperations(this);
this._resourceGroups = new ResourceGroupOperations(this);
this._subscriptions = new SubscriptionOperations(this);
this._tenantSubscriptions = new SubscriptionOperationsAsAdmin(this);
this._usageConnections = new UsageConnectionsOperations(this);
this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
}
/// <summary>
/// Initializes a new instance of the AzureStackClient class.
/// </summary>
/// <param name='baseUri'>
/// Required. Resource Manager endpoint
/// </param>
/// <param name='credentials'>
/// Required. Credentials to access resource manager endpoint
/// </param>
/// <param name='apiVersion'>
/// Required. Apiversion of the endpoint
/// </param>
/// <param name='httpClient'>
/// The Http client
/// </param>
public AzureStackClient(Uri baseUri, SubscriptionCloudCredentials credentials, string apiVersion, HttpClient httpClient)
: this(httpClient)
{
if (baseUri == null)
{
throw new ArgumentNullException("baseUri");
}
if (credentials == null)
{
throw new ArgumentNullException("credentials");
}
if (apiVersion == null)
{
throw new ArgumentNullException("apiVersion");
}
this._baseUri = baseUri;
this._credentials = credentials;
this._apiVersion = apiVersion;
this.Credentials.InitializeServiceClient(this);
}
/// <summary>
/// Clones properties from current instance to another AzureStackClient
/// instance
/// </summary>
/// <param name='client'>
/// Instance of AzureStackClient to clone to
/// </param>
protected override void Clone(ServiceClient<AzureStackClient> client)
{
base.Clone(client);
if (client is AzureStackClient)
{
AzureStackClient clonedClient = ((AzureStackClient)client);
clonedClient._baseUri = this._baseUri;
clonedClient._credentials = this._credentials;
clonedClient._apiVersion = this._apiVersion;
clonedClient.Credentials.InitializeServiceClient(clonedClient);
}
}
}
}

Просмотреть файл

@ -0,0 +1,30 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
namespace Microsoft.AzureStack.Management
{
public static partial class AzureStackClientExtensions
{
}
}

Просмотреть файл

@ -0,0 +1,224 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Hyak.Common;
using Microsoft.AzureStack.Management;
using Microsoft.AzureStack.Management.Models;
using Newtonsoft.Json.Linq;
namespace Microsoft.AzureStack.Management
{
/// <summary>
/// Operations on the curation items (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
internal partial class CurationOperations : IServiceOperations<AzureStackClient>, ICurationOperations
{
/// <summary>
/// Initializes a new instance of the CurationOperations class.
/// </summary>
/// <param name='client'>
/// Reference to the service client.
/// </param>
internal CurationOperations(AzureStackClient client)
{
this._client = client;
}
private AzureStackClient _client;
/// <summary>
/// Gets a reference to the
/// Microsoft.AzureStack.Management.AzureStackClient.
/// </summary>
public AzureStackClient Client
{
get { return this._client; }
}
/// <summary>
/// Lists the curation results
/// </summary>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result of the curation list operation
/// </returns>
public async Task<CurationListResult> ListAsync(CancellationToken cancellationToken)
{
// Validate
// Tracing
bool shouldTrace = TracingAdapter.IsEnabled;
string invocationId = null;
if (shouldTrace)
{
invocationId = TracingAdapter.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
TracingAdapter.Enter(invocationId, this, "ListAsync", tracingParameters);
}
// Construct URL
string url = "";
url = url + "/providers/Microsoft.Gallery/Curation";
List<string> queryParameters = new List<string>();
queryParameters.Add("api-version=" + Uri.EscapeDataString(this.Client.ApiVersion));
if (queryParameters.Count > 0)
{
url = url + "?" + string.Join("&", queryParameters);
}
string baseUrl = this.Client.BaseUri.AbsoluteUri;
// Trim '/' character from the end of baseUrl and beginning of url.
if (baseUrl[baseUrl.Length - 1] == '/')
{
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
}
if (url[0] == '/')
{
url = url.Substring(1);
}
url = baseUrl + "/" + url;
url = url.Replace(" ", "%20");
// Create HTTP transport objects
HttpRequestMessage httpRequest = null;
try
{
httpRequest = new HttpRequestMessage();
httpRequest.Method = HttpMethod.Get;
httpRequest.RequestUri = new Uri(url);
// Set Headers
// Set Credentials
cancellationToken.ThrowIfCancellationRequested();
await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false);
// Send Request
HttpResponseMessage httpResponse = null;
try
{
if (shouldTrace)
{
TracingAdapter.SendRequest(invocationId, httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
httpResponse = await this.Client.HttpClient.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false);
if (shouldTrace)
{
TracingAdapter.ReceiveResponse(invocationId, httpResponse);
}
HttpStatusCode statusCode = httpResponse.StatusCode;
if (statusCode != HttpStatusCode.OK)
{
cancellationToken.ThrowIfCancellationRequested();
CloudException ex = CloudException.Create(httpRequest, null, httpResponse, await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false));
if (shouldTrace)
{
TracingAdapter.Error(invocationId, ex);
}
throw ex;
}
// Create Result
CurationListResult result = null;
// Deserialize Response
if (statusCode == HttpStatusCode.OK)
{
cancellationToken.ThrowIfCancellationRequested();
string responseContent = await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
result = new CurationListResult();
JToken responseDoc = null;
if (string.IsNullOrEmpty(responseContent) == false)
{
responseDoc = JToken.Parse(responseContent);
}
if (responseDoc != null && responseDoc.Type != JTokenType.Null)
{
JToken curationItemsArray = responseDoc;
if (curationItemsArray != null && curationItemsArray.Type != JTokenType.Null)
{
foreach (JToken curationItemsValue in ((JArray)curationItemsArray))
{
CurationItem curationItemInstance = new CurationItem();
result.CurationItems.Add(curationItemInstance);
JToken identityValue = curationItemsValue["identity"];
if (identityValue != null && identityValue.Type != JTokenType.Null)
{
string identityInstance = ((string)identityValue);
curationItemInstance.Identity = identityInstance;
}
JToken itemUriValue = curationItemsValue["itemUri"];
if (itemUriValue != null && itemUriValue.Type != JTokenType.Null)
{
string itemUriInstance = ((string)itemUriValue);
curationItemInstance.ItemUri = itemUriInstance;
}
JToken isDefaultValue = curationItemsValue["isDefault"];
if (isDefaultValue != null && isDefaultValue.Type != JTokenType.Null)
{
bool isDefaultInstance = ((bool)isDefaultValue);
curationItemInstance.IsDefault = isDefaultInstance;
}
}
}
}
}
result.StatusCode = statusCode;
if (shouldTrace)
{
TracingAdapter.Exit(invocationId, result);
}
return result;
}
finally
{
if (httpResponse != null)
{
httpResponse.Dispose();
}
}
}
finally
{
if (httpRequest != null)
{
httpRequest.Dispose();
}
}
}
}
}

Просмотреть файл

@ -0,0 +1,67 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AzureStack.Management;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management
{
public static partial class CurationOperationsExtensions
{
/// <summary>
/// Lists the curation results
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.ICurationOperations.
/// </param>
/// <returns>
/// Result of the curation list operation
/// </returns>
public static CurationListResult List(this ICurationOperations operations)
{
return Task.Factory.StartNew((object s) =>
{
return ((ICurationOperations)s).ListAsync();
}
, operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// Lists the curation results
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.ICurationOperations.
/// </param>
/// <returns>
/// Result of the curation list operation
/// </returns>
public static Task<CurationListResult> ListAsync(this ICurationOperations operations)
{
return operations.ListAsync(CancellationToken.None);
}
}
}

Просмотреть файл

@ -0,0 +1,233 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Hyak.Common;
using Microsoft.AzureStack.Management;
using Microsoft.AzureStack.Management.Models;
using Newtonsoft.Json.Linq;
namespace Microsoft.AzureStack.Management
{
/// <summary>
/// Operations for extensions metadata. (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
internal partial class ExtensionMetadataOperations : IServiceOperations<AzureStackClient>, IExtensionMetadataOperations
{
/// <summary>
/// Initializes a new instance of the ExtensionMetadataOperations class.
/// </summary>
/// <param name='client'>
/// Reference to the service client.
/// </param>
internal ExtensionMetadataOperations(AzureStackClient client)
{
this._client = client;
}
private AzureStackClient _client;
/// <summary>
/// Gets a reference to the
/// Microsoft.AzureStack.Management.AzureStackClient.
/// </summary>
public AzureStackClient Client
{
get { return this._client; }
}
/// <summary>
/// Returns list of extensions the user has access to
/// </summary>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result containing list of extensions the user has access to.
/// </returns>
public async Task<ExtensionMetadataListResult> ListAsync(CancellationToken cancellationToken)
{
// Validate
// Tracing
bool shouldTrace = TracingAdapter.IsEnabled;
string invocationId = null;
if (shouldTrace)
{
invocationId = TracingAdapter.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
TracingAdapter.Enter(invocationId, this, "ListAsync", tracingParameters);
}
// Construct URL
string url = "";
url = url + "/extensionsMetadata";
List<string> queryParameters = new List<string>();
queryParameters.Add("api-version=" + Uri.EscapeDataString(this.Client.ApiVersion));
if (queryParameters.Count > 0)
{
url = url + "?" + string.Join("&", queryParameters);
}
string baseUrl = this.Client.BaseUri.AbsoluteUri;
// Trim '/' character from the end of baseUrl and beginning of url.
if (baseUrl[baseUrl.Length - 1] == '/')
{
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
}
if (url[0] == '/')
{
url = url.Substring(1);
}
url = baseUrl + "/" + url;
url = url.Replace(" ", "%20");
// Create HTTP transport objects
HttpRequestMessage httpRequest = null;
try
{
httpRequest = new HttpRequestMessage();
httpRequest.Method = HttpMethod.Get;
httpRequest.RequestUri = new Uri(url);
// Set Headers
// Set Credentials
cancellationToken.ThrowIfCancellationRequested();
await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false);
// Send Request
HttpResponseMessage httpResponse = null;
try
{
if (shouldTrace)
{
TracingAdapter.SendRequest(invocationId, httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
httpResponse = await this.Client.HttpClient.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false);
if (shouldTrace)
{
TracingAdapter.ReceiveResponse(invocationId, httpResponse);
}
HttpStatusCode statusCode = httpResponse.StatusCode;
if (statusCode != HttpStatusCode.OK)
{
cancellationToken.ThrowIfCancellationRequested();
CloudException ex = CloudException.Create(httpRequest, null, httpResponse, await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false));
if (shouldTrace)
{
TracingAdapter.Error(invocationId, ex);
}
throw ex;
}
// Create Result
ExtensionMetadataListResult result = null;
// Deserialize Response
if (statusCode == HttpStatusCode.OK)
{
cancellationToken.ThrowIfCancellationRequested();
string responseContent = await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
result = new ExtensionMetadataListResult();
JToken responseDoc = null;
if (string.IsNullOrEmpty(responseContent) == false)
{
responseDoc = JToken.Parse(responseContent);
}
if (responseDoc != null && responseDoc.Type != JTokenType.Null)
{
JToken valueArray = responseDoc["value"];
if (valueArray != null && valueArray.Type != JTokenType.Null)
{
foreach (JToken valueValue in ((JArray)valueArray))
{
ExtensionMetadata extensionMetadataInstance = new ExtensionMetadata();
result.ExtensionsMetadata.Add(extensionMetadataInstance);
JToken namespacesArray = valueValue["namespaces"];
if (namespacesArray != null && namespacesArray.Type != JTokenType.Null)
{
foreach (JToken namespacesValue in ((JArray)namespacesArray))
{
extensionMetadataInstance.Namespaces.Add(((string)namespacesValue));
}
}
JToken locationValue = valueValue["location"];
if (locationValue != null && locationValue.Type != JTokenType.Null)
{
string locationInstance = ((string)locationValue);
extensionMetadataInstance.Location = locationInstance;
}
JToken nameValue = valueValue["name"];
if (nameValue != null && nameValue.Type != JTokenType.Null)
{
string nameInstance = ((string)nameValue);
extensionMetadataInstance.Name = nameInstance;
}
JToken endpointUriValue = valueValue["endpointUri"];
if (endpointUriValue != null && endpointUriValue.Type != JTokenType.Null)
{
string endpointUriInstance = ((string)endpointUriValue);
extensionMetadataInstance.EndpointUri = endpointUriInstance;
}
}
}
}
}
result.StatusCode = statusCode;
if (shouldTrace)
{
TracingAdapter.Exit(invocationId, result);
}
return result;
}
finally
{
if (httpResponse != null)
{
httpResponse.Dispose();
}
}
}
finally
{
if (httpRequest != null)
{
httpRequest.Dispose();
}
}
}
}
}

Просмотреть файл

@ -0,0 +1,67 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AzureStack.Management;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management
{
public static partial class ExtensionMetadataOperationsExtensions
{
/// <summary>
/// Returns list of extensions the user has access to
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IExtensionMetadataOperations.
/// </param>
/// <returns>
/// Result containing list of extensions the user has access to.
/// </returns>
public static ExtensionMetadataListResult List(this IExtensionMetadataOperations operations)
{
return Task.Factory.StartNew((object s) =>
{
return ((IExtensionMetadataOperations)s).ListAsync();
}
, operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// Returns list of extensions the user has access to
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IExtensionMetadataOperations.
/// </param>
/// <returns>
/// Result containing list of extensions the user has access to.
/// </returns>
public static Task<ExtensionMetadataListResult> ListAsync(this IExtensionMetadataOperations operations)
{
return operations.ListAsync(CancellationToken.None);
}
}
}

Просмотреть файл

@ -0,0 +1,935 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Hyak.Common;
using Microsoft.Azure;
using Microsoft.AzureStack.Management;
using Microsoft.AzureStack.Management.Models;
using Newtonsoft.Json.Linq;
namespace Microsoft.AzureStack.Management
{
/// <summary>
/// Gallery item operations. (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
internal partial class GalleryItemOperations : IServiceOperations<AzureStackClient>, IGalleryItemOperations
{
/// <summary>
/// Initializes a new instance of the GalleryItemOperations class.
/// </summary>
/// <param name='client'>
/// Reference to the service client.
/// </param>
internal GalleryItemOperations(AzureStackClient client)
{
this._client = client;
}
private AzureStackClient _client;
/// <summary>
/// Gets a reference to the
/// Microsoft.AzureStack.Management.AzureStackClient.
/// </summary>
public AzureStackClient Client
{
get { return this._client; }
}
/// <summary>
/// Creates or updates the Gallery Item
/// </summary>
/// <param name='parameters'>
/// Required. Gallery item Upload parameters.
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// A standard service response including an HTTP status code and
/// request ID.
/// </returns>
public async Task<AzureOperationResponse> CreateOrUpdateAsync(GalleryItemCreateOrUpdateParameters parameters, CancellationToken cancellationToken)
{
// Validate
if (parameters == null)
{
throw new ArgumentNullException("parameters");
}
if (parameters.GalleryItemUri == null)
{
throw new ArgumentNullException("parameters.GalleryItemUri");
}
// Tracing
bool shouldTrace = TracingAdapter.IsEnabled;
string invocationId = null;
if (shouldTrace)
{
invocationId = TracingAdapter.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("parameters", parameters);
TracingAdapter.Enter(invocationId, this, "CreateOrUpdateAsync", tracingParameters);
}
// Construct URL
string url = "";
url = url + "/subscriptions/";
if (this.Client.Credentials.SubscriptionId != null)
{
url = url + Uri.EscapeDataString(this.Client.Credentials.SubscriptionId);
}
url = url + "/providers/Microsoft.Gallery.Admin/galleryitems";
List<string> queryParameters = new List<string>();
queryParameters.Add("api-version=" + Uri.EscapeDataString(this.Client.ApiVersion));
if (queryParameters.Count > 0)
{
url = url + "?" + string.Join("&", queryParameters);
}
string baseUrl = this.Client.BaseUri.AbsoluteUri;
// Trim '/' character from the end of baseUrl and beginning of url.
if (baseUrl[baseUrl.Length - 1] == '/')
{
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
}
if (url[0] == '/')
{
url = url.Substring(1);
}
url = baseUrl + "/" + url;
url = url.Replace(" ", "%20");
// Create HTTP transport objects
HttpRequestMessage httpRequest = null;
try
{
httpRequest = new HttpRequestMessage();
httpRequest.Method = HttpMethod.Post;
httpRequest.RequestUri = new Uri(url);
// Set Headers
// Set Credentials
cancellationToken.ThrowIfCancellationRequested();
await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false);
// Serialize Request
string requestContent = null;
JToken requestDoc = null;
JObject galleryItemCreateOrUpdateParametersValue = new JObject();
requestDoc = galleryItemCreateOrUpdateParametersValue;
if (parameters.GalleryItemUri.GalleryItemUri != null)
{
galleryItemCreateOrUpdateParametersValue["galleryItemUri"] = parameters.GalleryItemUri.GalleryItemUri;
}
requestContent = requestDoc.ToString(Newtonsoft.Json.Formatting.Indented);
httpRequest.Content = new StringContent(requestContent, Encoding.UTF8);
httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
// Send Request
HttpResponseMessage httpResponse = null;
try
{
if (shouldTrace)
{
TracingAdapter.SendRequest(invocationId, httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
httpResponse = await this.Client.HttpClient.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false);
if (shouldTrace)
{
TracingAdapter.ReceiveResponse(invocationId, httpResponse);
}
HttpStatusCode statusCode = httpResponse.StatusCode;
if (statusCode != HttpStatusCode.OK && statusCode != HttpStatusCode.Created)
{
cancellationToken.ThrowIfCancellationRequested();
CloudException ex = CloudException.Create(httpRequest, requestContent, httpResponse, await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false));
if (shouldTrace)
{
TracingAdapter.Error(invocationId, ex);
}
throw ex;
}
// Create Result
AzureOperationResponse result = null;
// Deserialize Response
result = new AzureOperationResponse();
result.StatusCode = statusCode;
if (shouldTrace)
{
TracingAdapter.Exit(invocationId, result);
}
return result;
}
finally
{
if (httpResponse != null)
{
httpResponse.Dispose();
}
}
}
finally
{
if (httpRequest != null)
{
httpRequest.Dispose();
}
}
}
/// <summary>
/// Gallery item Delete operation.
/// </summary>
/// <param name='galleryItemId'>
/// Required. Gallery item identity.
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// A standard service response including an HTTP status code and
/// request ID.
/// </returns>
public async Task<AzureOperationResponse> DeleteAsync(string galleryItemId, CancellationToken cancellationToken)
{
// Validate
if (galleryItemId == null)
{
throw new ArgumentNullException("galleryItemId");
}
// Tracing
bool shouldTrace = TracingAdapter.IsEnabled;
string invocationId = null;
if (shouldTrace)
{
invocationId = TracingAdapter.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("galleryItemId", galleryItemId);
TracingAdapter.Enter(invocationId, this, "DeleteAsync", tracingParameters);
}
// Construct URL
string url = "";
url = url + "/subscriptions/";
if (this.Client.Credentials.SubscriptionId != null)
{
url = url + Uri.EscapeDataString(this.Client.Credentials.SubscriptionId);
}
url = url + "/providers/Microsoft.Gallery.Admin/galleryitems/";
url = url + Uri.EscapeDataString(galleryItemId);
List<string> queryParameters = new List<string>();
queryParameters.Add("api-version=" + Uri.EscapeDataString(this.Client.ApiVersion));
if (queryParameters.Count > 0)
{
url = url + "?" + string.Join("&", queryParameters);
}
string baseUrl = this.Client.BaseUri.AbsoluteUri;
// Trim '/' character from the end of baseUrl and beginning of url.
if (baseUrl[baseUrl.Length - 1] == '/')
{
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
}
if (url[0] == '/')
{
url = url.Substring(1);
}
url = baseUrl + "/" + url;
url = url.Replace(" ", "%20");
// Create HTTP transport objects
HttpRequestMessage httpRequest = null;
try
{
httpRequest = new HttpRequestMessage();
httpRequest.Method = HttpMethod.Delete;
httpRequest.RequestUri = new Uri(url);
// Set Headers
// Set Credentials
cancellationToken.ThrowIfCancellationRequested();
await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false);
// Send Request
HttpResponseMessage httpResponse = null;
try
{
if (shouldTrace)
{
TracingAdapter.SendRequest(invocationId, httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
httpResponse = await this.Client.HttpClient.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false);
if (shouldTrace)
{
TracingAdapter.ReceiveResponse(invocationId, httpResponse);
}
HttpStatusCode statusCode = httpResponse.StatusCode;
if (statusCode != HttpStatusCode.OK)
{
cancellationToken.ThrowIfCancellationRequested();
CloudException ex = CloudException.Create(httpRequest, null, httpResponse, await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false));
if (shouldTrace)
{
TracingAdapter.Error(invocationId, ex);
}
throw ex;
}
// Create Result
AzureOperationResponse result = null;
// Deserialize Response
result = new AzureOperationResponse();
result.StatusCode = statusCode;
if (shouldTrace)
{
TracingAdapter.Exit(invocationId, result);
}
return result;
}
finally
{
if (httpResponse != null)
{
httpResponse.Dispose();
}
}
}
finally
{
if (httpRequest != null)
{
httpRequest.Dispose();
}
}
}
/// <summary>
/// Gallery item Get operation.
/// </summary>
/// <param name='galleryItemId'>
/// Required. Gallery item identity.
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Gallery item Get operation result.
/// </returns>
public async Task<GalleryItemGetResult> GetAsync(string galleryItemId, CancellationToken cancellationToken)
{
// Validate
if (galleryItemId == null)
{
throw new ArgumentNullException("galleryItemId");
}
// Tracing
bool shouldTrace = TracingAdapter.IsEnabled;
string invocationId = null;
if (shouldTrace)
{
invocationId = TracingAdapter.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("galleryItemId", galleryItemId);
TracingAdapter.Enter(invocationId, this, "GetAsync", tracingParameters);
}
// Construct URL
string url = "";
url = url + "/subscriptions/";
if (this.Client.Credentials.SubscriptionId != null)
{
url = url + Uri.EscapeDataString(this.Client.Credentials.SubscriptionId);
}
url = url + "/providers/Microsoft.Gallery.Admin/galleryitems/";
url = url + Uri.EscapeDataString(galleryItemId);
List<string> queryParameters = new List<string>();
queryParameters.Add("api-version=" + Uri.EscapeDataString(this.Client.ApiVersion));
if (queryParameters.Count > 0)
{
url = url + "?" + string.Join("&", queryParameters);
}
string baseUrl = this.Client.BaseUri.AbsoluteUri;
// Trim '/' character from the end of baseUrl and beginning of url.
if (baseUrl[baseUrl.Length - 1] == '/')
{
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
}
if (url[0] == '/')
{
url = url.Substring(1);
}
url = baseUrl + "/" + url;
url = url.Replace(" ", "%20");
// Create HTTP transport objects
HttpRequestMessage httpRequest = null;
try
{
httpRequest = new HttpRequestMessage();
httpRequest.Method = HttpMethod.Get;
httpRequest.RequestUri = new Uri(url);
// Set Headers
// Set Credentials
cancellationToken.ThrowIfCancellationRequested();
await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false);
// Send Request
HttpResponseMessage httpResponse = null;
try
{
if (shouldTrace)
{
TracingAdapter.SendRequest(invocationId, httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
httpResponse = await this.Client.HttpClient.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false);
if (shouldTrace)
{
TracingAdapter.ReceiveResponse(invocationId, httpResponse);
}
HttpStatusCode statusCode = httpResponse.StatusCode;
if (statusCode != HttpStatusCode.OK)
{
cancellationToken.ThrowIfCancellationRequested();
CloudException ex = CloudException.Create(httpRequest, null, httpResponse, await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false));
if (shouldTrace)
{
TracingAdapter.Error(invocationId, ex);
}
throw ex;
}
// Create Result
GalleryItemGetResult result = null;
// Deserialize Response
if (statusCode == HttpStatusCode.OK)
{
cancellationToken.ThrowIfCancellationRequested();
string responseContent = await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
result = new GalleryItemGetResult();
JToken responseDoc = null;
if (string.IsNullOrEmpty(responseContent) == false)
{
responseDoc = JToken.Parse(responseContent);
}
if (responseDoc != null && responseDoc.Type != JTokenType.Null)
{
GalleryItemModel galleryItemInstance = new GalleryItemModel();
result.GalleryItem = galleryItemInstance;
JToken propertiesValue = responseDoc["properties"];
if (propertiesValue != null && propertiesValue.Type != JTokenType.Null)
{
GalleryItemUriPayload propertiesInstance = new GalleryItemUriPayload();
galleryItemInstance.Properties = propertiesInstance;
JToken galleryItemUriValue = propertiesValue["galleryItemUri"];
if (galleryItemUriValue != null && galleryItemUriValue.Type != JTokenType.Null)
{
string galleryItemUriInstance = ((string)galleryItemUriValue);
propertiesInstance.GalleryItemUri = galleryItemUriInstance;
}
}
JToken idValue = responseDoc["id"];
if (idValue != null && idValue.Type != JTokenType.Null)
{
string idInstance = ((string)idValue);
galleryItemInstance.Id = idInstance;
}
JToken nameValue = responseDoc["name"];
if (nameValue != null && nameValue.Type != JTokenType.Null)
{
string nameInstance = ((string)nameValue);
galleryItemInstance.Name = nameInstance;
}
JToken typeValue = responseDoc["type"];
if (typeValue != null && typeValue.Type != JTokenType.Null)
{
string typeInstance = ((string)typeValue);
galleryItemInstance.Type = typeInstance;
}
JToken locationValue = responseDoc["location"];
if (locationValue != null && locationValue.Type != JTokenType.Null)
{
string locationInstance = ((string)locationValue);
galleryItemInstance.Location = locationInstance;
}
JToken tagsSequenceElement = ((JToken)responseDoc["tags"]);
if (tagsSequenceElement != null && tagsSequenceElement.Type != JTokenType.Null)
{
foreach (JProperty property in tagsSequenceElement)
{
string tagsKey = ((string)property.Name);
string tagsValue = ((string)property.Value);
galleryItemInstance.Tags.Add(tagsKey, tagsValue);
}
}
}
}
result.StatusCode = statusCode;
if (shouldTrace)
{
TracingAdapter.Exit(invocationId, result);
}
return result;
}
finally
{
if (httpResponse != null)
{
httpResponse.Dispose();
}
}
}
finally
{
if (httpRequest != null)
{
httpRequest.Dispose();
}
}
}
/// <summary>
/// Gallery items List operation.
/// </summary>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Gallery item List operation result.
/// </returns>
public async Task<GalleryItemListResult> ListAsync(CancellationToken cancellationToken)
{
// Validate
// Tracing
bool shouldTrace = TracingAdapter.IsEnabled;
string invocationId = null;
if (shouldTrace)
{
invocationId = TracingAdapter.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
TracingAdapter.Enter(invocationId, this, "ListAsync", tracingParameters);
}
// Construct URL
string url = "";
url = url + "/subscriptions/";
if (this.Client.Credentials.SubscriptionId != null)
{
url = url + Uri.EscapeDataString(this.Client.Credentials.SubscriptionId);
}
url = url + "/providers/Microsoft.Gallery.Admin/galleryitems";
List<string> queryParameters = new List<string>();
queryParameters.Add("api-version=" + Uri.EscapeDataString(this.Client.ApiVersion));
if (queryParameters.Count > 0)
{
url = url + "?" + string.Join("&", queryParameters);
}
string baseUrl = this.Client.BaseUri.AbsoluteUri;
// Trim '/' character from the end of baseUrl and beginning of url.
if (baseUrl[baseUrl.Length - 1] == '/')
{
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
}
if (url[0] == '/')
{
url = url.Substring(1);
}
url = baseUrl + "/" + url;
url = url.Replace(" ", "%20");
// Create HTTP transport objects
HttpRequestMessage httpRequest = null;
try
{
httpRequest = new HttpRequestMessage();
httpRequest.Method = HttpMethod.Get;
httpRequest.RequestUri = new Uri(url);
// Set Headers
// Set Credentials
cancellationToken.ThrowIfCancellationRequested();
await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false);
// Send Request
HttpResponseMessage httpResponse = null;
try
{
if (shouldTrace)
{
TracingAdapter.SendRequest(invocationId, httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
httpResponse = await this.Client.HttpClient.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false);
if (shouldTrace)
{
TracingAdapter.ReceiveResponse(invocationId, httpResponse);
}
HttpStatusCode statusCode = httpResponse.StatusCode;
if (statusCode != HttpStatusCode.OK)
{
cancellationToken.ThrowIfCancellationRequested();
CloudException ex = CloudException.Create(httpRequest, null, httpResponse, await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false));
if (shouldTrace)
{
TracingAdapter.Error(invocationId, ex);
}
throw ex;
}
// Create Result
GalleryItemListResult result = null;
// Deserialize Response
if (statusCode == HttpStatusCode.OK)
{
cancellationToken.ThrowIfCancellationRequested();
string responseContent = await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
result = new GalleryItemListResult();
JToken responseDoc = null;
if (string.IsNullOrEmpty(responseContent) == false)
{
responseDoc = JToken.Parse(responseContent);
}
if (responseDoc != null && responseDoc.Type != JTokenType.Null)
{
JToken valueArray = responseDoc["value"];
if (valueArray != null && valueArray.Type != JTokenType.Null)
{
foreach (JToken valueValue in ((JArray)valueArray))
{
GalleryItemModel galleryItemModelInstance = new GalleryItemModel();
result.GalleryItems.Add(galleryItemModelInstance);
JToken propertiesValue = valueValue["properties"];
if (propertiesValue != null && propertiesValue.Type != JTokenType.Null)
{
GalleryItemUriPayload propertiesInstance = new GalleryItemUriPayload();
galleryItemModelInstance.Properties = propertiesInstance;
JToken galleryItemUriValue = propertiesValue["galleryItemUri"];
if (galleryItemUriValue != null && galleryItemUriValue.Type != JTokenType.Null)
{
string galleryItemUriInstance = ((string)galleryItemUriValue);
propertiesInstance.GalleryItemUri = galleryItemUriInstance;
}
}
JToken idValue = valueValue["id"];
if (idValue != null && idValue.Type != JTokenType.Null)
{
string idInstance = ((string)idValue);
galleryItemModelInstance.Id = idInstance;
}
JToken nameValue = valueValue["name"];
if (nameValue != null && nameValue.Type != JTokenType.Null)
{
string nameInstance = ((string)nameValue);
galleryItemModelInstance.Name = nameInstance;
}
JToken typeValue = valueValue["type"];
if (typeValue != null && typeValue.Type != JTokenType.Null)
{
string typeInstance = ((string)typeValue);
galleryItemModelInstance.Type = typeInstance;
}
JToken locationValue = valueValue["location"];
if (locationValue != null && locationValue.Type != JTokenType.Null)
{
string locationInstance = ((string)locationValue);
galleryItemModelInstance.Location = locationInstance;
}
JToken tagsSequenceElement = ((JToken)valueValue["tags"]);
if (tagsSequenceElement != null && tagsSequenceElement.Type != JTokenType.Null)
{
foreach (JProperty property in tagsSequenceElement)
{
string tagsKey = ((string)property.Name);
string tagsValue = ((string)property.Value);
galleryItemModelInstance.Tags.Add(tagsKey, tagsValue);
}
}
}
}
JToken odatanextLinkValue = responseDoc["@odata.nextLink"];
if (odatanextLinkValue != null && odatanextLinkValue.Type != JTokenType.Null)
{
string odatanextLinkInstance = ((string)odatanextLinkValue);
result.NextLink = odatanextLinkInstance;
}
}
}
result.StatusCode = statusCode;
if (shouldTrace)
{
TracingAdapter.Exit(invocationId, result);
}
return result;
}
finally
{
if (httpResponse != null)
{
httpResponse.Dispose();
}
}
}
finally
{
if (httpRequest != null)
{
httpRequest.Dispose();
}
}
}
/// <summary>
/// Gallery items List operation.
/// </summary>
/// <param name='nextLink'>
/// Required. Gets or sets the URL to get the next set of results.
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Gallery item List operation result.
/// </returns>
public async Task<GalleryItemListResult> ListNextAsync(string nextLink, CancellationToken cancellationToken)
{
// Validate
if (nextLink == null)
{
throw new ArgumentNullException("nextLink");
}
// Tracing
bool shouldTrace = TracingAdapter.IsEnabled;
string invocationId = null;
if (shouldTrace)
{
invocationId = TracingAdapter.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("nextLink", nextLink);
TracingAdapter.Enter(invocationId, this, "ListNextAsync", tracingParameters);
}
// Construct URL
string url = "";
url = url + Uri.EscapeDataString(nextLink);
url = url.Replace(" ", "%20");
// Create HTTP transport objects
HttpRequestMessage httpRequest = null;
try
{
httpRequest = new HttpRequestMessage();
httpRequest.Method = HttpMethod.Get;
httpRequest.RequestUri = new Uri(url);
// Set Headers
// Set Credentials
cancellationToken.ThrowIfCancellationRequested();
await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false);
// Send Request
HttpResponseMessage httpResponse = null;
try
{
if (shouldTrace)
{
TracingAdapter.SendRequest(invocationId, httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
httpResponse = await this.Client.HttpClient.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false);
if (shouldTrace)
{
TracingAdapter.ReceiveResponse(invocationId, httpResponse);
}
HttpStatusCode statusCode = httpResponse.StatusCode;
if (statusCode != HttpStatusCode.OK)
{
cancellationToken.ThrowIfCancellationRequested();
CloudException ex = CloudException.Create(httpRequest, null, httpResponse, await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false));
if (shouldTrace)
{
TracingAdapter.Error(invocationId, ex);
}
throw ex;
}
// Create Result
GalleryItemListResult result = null;
// Deserialize Response
if (statusCode == HttpStatusCode.OK)
{
cancellationToken.ThrowIfCancellationRequested();
string responseContent = await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
result = new GalleryItemListResult();
JToken responseDoc = null;
if (string.IsNullOrEmpty(responseContent) == false)
{
responseDoc = JToken.Parse(responseContent);
}
if (responseDoc != null && responseDoc.Type != JTokenType.Null)
{
JToken valueArray = responseDoc["value"];
if (valueArray != null && valueArray.Type != JTokenType.Null)
{
foreach (JToken valueValue in ((JArray)valueArray))
{
GalleryItemModel galleryItemModelInstance = new GalleryItemModel();
result.GalleryItems.Add(galleryItemModelInstance);
JToken propertiesValue = valueValue["properties"];
if (propertiesValue != null && propertiesValue.Type != JTokenType.Null)
{
GalleryItemUriPayload propertiesInstance = new GalleryItemUriPayload();
galleryItemModelInstance.Properties = propertiesInstance;
JToken galleryItemUriValue = propertiesValue["galleryItemUri"];
if (galleryItemUriValue != null && galleryItemUriValue.Type != JTokenType.Null)
{
string galleryItemUriInstance = ((string)galleryItemUriValue);
propertiesInstance.GalleryItemUri = galleryItemUriInstance;
}
}
JToken idValue = valueValue["id"];
if (idValue != null && idValue.Type != JTokenType.Null)
{
string idInstance = ((string)idValue);
galleryItemModelInstance.Id = idInstance;
}
JToken nameValue = valueValue["name"];
if (nameValue != null && nameValue.Type != JTokenType.Null)
{
string nameInstance = ((string)nameValue);
galleryItemModelInstance.Name = nameInstance;
}
JToken typeValue = valueValue["type"];
if (typeValue != null && typeValue.Type != JTokenType.Null)
{
string typeInstance = ((string)typeValue);
galleryItemModelInstance.Type = typeInstance;
}
JToken locationValue = valueValue["location"];
if (locationValue != null && locationValue.Type != JTokenType.Null)
{
string locationInstance = ((string)locationValue);
galleryItemModelInstance.Location = locationInstance;
}
JToken tagsSequenceElement = ((JToken)valueValue["tags"]);
if (tagsSequenceElement != null && tagsSequenceElement.Type != JTokenType.Null)
{
foreach (JProperty property in tagsSequenceElement)
{
string tagsKey = ((string)property.Name);
string tagsValue = ((string)property.Value);
galleryItemModelInstance.Tags.Add(tagsKey, tagsValue);
}
}
}
}
JToken odatanextLinkValue = responseDoc["@odata.nextLink"];
if (odatanextLinkValue != null && odatanextLinkValue.Type != JTokenType.Null)
{
string odatanextLinkInstance = ((string)odatanextLinkValue);
result.NextLink = odatanextLinkInstance;
}
}
}
result.StatusCode = statusCode;
if (shouldTrace)
{
TracingAdapter.Exit(invocationId, result);
}
return result;
}
finally
{
if (httpResponse != null)
{
httpResponse.Dispose();
}
}
}
finally
{
if (httpRequest != null)
{
httpRequest.Dispose();
}
}
}
}
}

Просмотреть файл

@ -0,0 +1,232 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure;
using Microsoft.AzureStack.Management;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management
{
public static partial class GalleryItemOperationsExtensions
{
/// <summary>
/// Creates or updates the Gallery Item
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IGalleryItemOperations.
/// </param>
/// <param name='parameters'>
/// Required. Gallery item Upload parameters.
/// </param>
/// <returns>
/// A standard service response including an HTTP status code and
/// request ID.
/// </returns>
public static AzureOperationResponse CreateOrUpdate(this IGalleryItemOperations operations, GalleryItemCreateOrUpdateParameters parameters)
{
return Task.Factory.StartNew((object s) =>
{
return ((IGalleryItemOperations)s).CreateOrUpdateAsync(parameters);
}
, operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// Creates or updates the Gallery Item
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IGalleryItemOperations.
/// </param>
/// <param name='parameters'>
/// Required. Gallery item Upload parameters.
/// </param>
/// <returns>
/// A standard service response including an HTTP status code and
/// request ID.
/// </returns>
public static Task<AzureOperationResponse> CreateOrUpdateAsync(this IGalleryItemOperations operations, GalleryItemCreateOrUpdateParameters parameters)
{
return operations.CreateOrUpdateAsync(parameters, CancellationToken.None);
}
/// <summary>
/// Gallery item Delete operation.
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IGalleryItemOperations.
/// </param>
/// <param name='galleryItemId'>
/// Required. Gallery item identity.
/// </param>
/// <returns>
/// A standard service response including an HTTP status code and
/// request ID.
/// </returns>
public static AzureOperationResponse Delete(this IGalleryItemOperations operations, string galleryItemId)
{
return Task.Factory.StartNew((object s) =>
{
return ((IGalleryItemOperations)s).DeleteAsync(galleryItemId);
}
, operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// Gallery item Delete operation.
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IGalleryItemOperations.
/// </param>
/// <param name='galleryItemId'>
/// Required. Gallery item identity.
/// </param>
/// <returns>
/// A standard service response including an HTTP status code and
/// request ID.
/// </returns>
public static Task<AzureOperationResponse> DeleteAsync(this IGalleryItemOperations operations, string galleryItemId)
{
return operations.DeleteAsync(galleryItemId, CancellationToken.None);
}
/// <summary>
/// Gallery item Get operation.
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IGalleryItemOperations.
/// </param>
/// <param name='galleryItemId'>
/// Required. Gallery item identity.
/// </param>
/// <returns>
/// Gallery item Get operation result.
/// </returns>
public static GalleryItemGetResult Get(this IGalleryItemOperations operations, string galleryItemId)
{
return Task.Factory.StartNew((object s) =>
{
return ((IGalleryItemOperations)s).GetAsync(galleryItemId);
}
, operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// Gallery item Get operation.
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IGalleryItemOperations.
/// </param>
/// <param name='galleryItemId'>
/// Required. Gallery item identity.
/// </param>
/// <returns>
/// Gallery item Get operation result.
/// </returns>
public static Task<GalleryItemGetResult> GetAsync(this IGalleryItemOperations operations, string galleryItemId)
{
return operations.GetAsync(galleryItemId, CancellationToken.None);
}
/// <summary>
/// Gallery items List operation.
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IGalleryItemOperations.
/// </param>
/// <returns>
/// Gallery item List operation result.
/// </returns>
public static GalleryItemListResult List(this IGalleryItemOperations operations)
{
return Task.Factory.StartNew((object s) =>
{
return ((IGalleryItemOperations)s).ListAsync();
}
, operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// Gallery items List operation.
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IGalleryItemOperations.
/// </param>
/// <returns>
/// Gallery item List operation result.
/// </returns>
public static Task<GalleryItemListResult> ListAsync(this IGalleryItemOperations operations)
{
return operations.ListAsync(CancellationToken.None);
}
/// <summary>
/// Gallery items List operation.
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IGalleryItemOperations.
/// </param>
/// <param name='nextLink'>
/// Required. Gets or sets the URL to get the next set of results.
/// </param>
/// <returns>
/// Gallery item List operation result.
/// </returns>
public static GalleryItemListResult ListNext(this IGalleryItemOperations operations, string nextLink)
{
return Task.Factory.StartNew((object s) =>
{
return ((IGalleryItemOperations)s).ListNextAsync(nextLink);
}
, operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// Gallery items List operation.
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IGalleryItemOperations.
/// </param>
/// <param name='nextLink'>
/// Required. Gets or sets the URL to get the next set of results.
/// </param>
/// <returns>
/// Gallery item List operation result.
/// </returns>
public static Task<GalleryItemListResult> ListNextAsync(this IGalleryItemOperations operations, string nextLink)
{
return operations.ListNextAsync(nextLink, CancellationToken.None);
}
}
}

Просмотреть файл

@ -0,0 +1,203 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using Microsoft.Azure;
using Microsoft.AzureStack.Management;
namespace Microsoft.AzureStack.Management
{
public partial interface IAzureStackClient : IDisposable
{
/// <summary>
/// Apiversion of the endpoint
/// </summary>
string ApiVersion
{
get; set;
}
/// <summary>
/// Resource Manager endpoint
/// </summary>
Uri BaseUri
{
get; set;
}
/// <summary>
/// Credentials to access resource manager endpoint
/// </summary>
SubscriptionCloudCredentials Credentials
{
get; set;
}
/// <summary>
/// Operations on the curation items (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
ICurationOperations Curation
{
get;
}
/// <summary>
/// Operations for extensions metadata. (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
IExtensionMetadataOperations ExtensionsMetadata
{
get;
}
/// <summary>
/// Gallery item operations. (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
IGalleryItemOperations GalleryItem
{
get;
}
/// <summary>
/// Managed locations operations for admin. (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
IManagedLocationOperations ManagedLocations
{
get;
}
/// <summary>
/// Administrator Operations on the offer (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
IManagedOfferOperations ManagedOffers
{
get;
}
/// <summary>
/// Administrator operations on the plan (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
IManagedPlanOperations ManagedPlans
{
get;
}
/// <summary>
/// Administrator Operations on the subscription (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
IManagedSubscriptionOperations ManagedSubscriptions
{
get;
}
/// <summary>
/// Operations on the offer (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
IOfferOperations Offers
{
get;
}
/// <summary>
/// Operations on the plan (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
IPlanOperations Plans
{
get;
}
/// <summary>
/// Resource provider manifest registration operations (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
IProviderRegistrationOperations ProviderRegistrations
{
get;
}
/// <summary>
/// Public gallery items operations. (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
IPublicGalleryItemOperations PublicGalleryItem
{
get;
}
/// <summary>
/// Operations on the resource group
/// </summary>
IResourceGroupOperations ResourceGroups
{
get;
}
/// <summary>
/// Operations on the subscription as a tenant (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
ISubscriptionOperations Subscriptions
{
get;
}
/// <summary>
/// Administrator Operations on the subscription (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
ISubscriptionOperationsAsAdmin TenantSubscriptions
{
get;
}
/// <summary>
/// Usage connection operations (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
IUsageConnectionsOperations UsageConnections
{
get;
}
}
}

Просмотреть файл

@ -0,0 +1,48 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management
{
/// <summary>
/// Operations on the curation items (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
public partial interface ICurationOperations
{
/// <summary>
/// Lists the curation results
/// </summary>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result of the curation list operation
/// </returns>
Task<CurationListResult> ListAsync(CancellationToken cancellationToken);
}
}

Просмотреть файл

@ -0,0 +1,48 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management
{
/// <summary>
/// Operations for extensions metadata. (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
public partial interface IExtensionMetadataOperations
{
/// <summary>
/// Returns list of extensions the user has access to
/// </summary>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result containing list of extensions the user has access to.
/// </returns>
Task<ExtensionMetadataListResult> ListAsync(CancellationToken cancellationToken);
}
}

Просмотреть файл

@ -0,0 +1,107 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management
{
/// <summary>
/// Gallery item operations. (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
public partial interface IGalleryItemOperations
{
/// <summary>
/// Creates or updates the Gallery Item
/// </summary>
/// <param name='parameters'>
/// Gallery item Upload parameters.
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// A standard service response including an HTTP status code and
/// request ID.
/// </returns>
Task<AzureOperationResponse> CreateOrUpdateAsync(GalleryItemCreateOrUpdateParameters parameters, CancellationToken cancellationToken);
/// <summary>
/// Gallery item Delete operation.
/// </summary>
/// <param name='galleryItemId'>
/// Gallery item identity.
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// A standard service response including an HTTP status code and
/// request ID.
/// </returns>
Task<AzureOperationResponse> DeleteAsync(string galleryItemId, CancellationToken cancellationToken);
/// <summary>
/// Gallery item Get operation.
/// </summary>
/// <param name='galleryItemId'>
/// Gallery item identity.
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Gallery item Get operation result.
/// </returns>
Task<GalleryItemGetResult> GetAsync(string galleryItemId, CancellationToken cancellationToken);
/// <summary>
/// Gallery items List operation.
/// </summary>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Gallery item List operation result.
/// </returns>
Task<GalleryItemListResult> ListAsync(CancellationToken cancellationToken);
/// <summary>
/// Gallery items List operation.
/// </summary>
/// <param name='nextLink'>
/// Gets or sets the URL to get the next set of results.
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Gallery item List operation result.
/// </returns>
Task<GalleryItemListResult> ListNextAsync(string nextLink, CancellationToken cancellationToken);
}
}

Просмотреть файл

@ -0,0 +1,106 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management
{
/// <summary>
/// Managed locations operations for admin. (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
public partial interface IManagedLocationOperations
{
/// <summary>
/// Create / Update the location.
/// </summary>
/// <param name='parameters'>
/// Location properties
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// The location update result.
/// </returns>
Task<ManagedLocationCreateOrUpdateResult> CreateOrUpdateAsync(ManagedLocationCreateOrUpdateParameters parameters, CancellationToken cancellationToken);
/// <summary>
/// Delete a location.
/// </summary>
/// <param name='locationName'>
/// Name of location to delete.
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// A standard service response including an HTTP status code and
/// request ID.
/// </returns>
Task<AzureOperationResponse> DeleteAsync(string locationName, CancellationToken cancellationToken);
/// <summary>
/// Get the location.
/// </summary>
/// <param name='locationName'>
/// The location name.
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Location get result.
/// </returns>
Task<ManagedLocationGetResult> GetAsync(string locationName, CancellationToken cancellationToken);
/// <summary>
/// Get locations under subscription.
/// </summary>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// The location list result.
/// </returns>
Task<ManagedLocationListResult> ListAsync(CancellationToken cancellationToken);
/// <summary>
/// Gets locations with the next link.
/// </summary>
/// <param name='nextLink'>
/// The url to get the next set of results.
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// The location list result.
/// </returns>
Task<ManagedLocationListResult> ListNextAsync(string nextLink, CancellationToken cancellationToken);
}
}

Просмотреть файл

@ -0,0 +1,107 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management
{
/// <summary>
/// Administrator Operations on the offer (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
public partial interface IManagedOfferOperations
{
/// <summary>
/// Returns the created or updated offer
/// </summary>
/// <param name='resourceGroupName'>
/// Resource group name
/// </param>
/// <param name='parameters'>
/// Offer properties
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result of the create or update operation of offer
/// </returns>
Task<ManagedOfferCreateOrUpdateResult> CreateOrUpdateAsync(string resourceGroupName, ManagedOfferCreateOrUpdateParameters parameters, CancellationToken cancellationToken);
/// <summary>
/// Delete operation on the offer
/// </summary>
/// <param name='resourceGroupName'>
/// Resource group name
/// </param>
/// <param name='offerId'>
/// Offer name
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// A standard service response including an HTTP status code and
/// request ID.
/// </returns>
Task<AzureOperationResponse> DeleteAsync(string resourceGroupName, string offerId, CancellationToken cancellationToken);
/// <summary>
/// Gets the administrator view of the offer
/// </summary>
/// <param name='resourceGroupName'>
/// Resource group name
/// </param>
/// <param name='offerId'>
/// Offer name
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result of the offer Get operation
/// </returns>
Task<ManagedOfferGetResult> GetAsync(string resourceGroupName, string offerId, CancellationToken cancellationToken);
/// <summary>
/// Lists the offers under the specified resource group
/// </summary>
/// <param name='resourceGroupName'>
/// Resource group name
/// </param>
/// <param name='includeDetails'>
/// Flag to specify whether to include details
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result of the offer list operation
/// </returns>
Task<ManagedOfferListResult> ListAsync(string resourceGroupName, bool includeDetails, CancellationToken cancellationToken);
}
}

Просмотреть файл

@ -0,0 +1,107 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management
{
/// <summary>
/// Administrator operations on the plan (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
public partial interface IManagedPlanOperations
{
/// <summary>
/// Creates or updates the plan
/// </summary>
/// <param name='resourceGroupName'>
/// Resource group name
/// </param>
/// <param name='parameters'>
/// Plan properties
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result for the create or update operation of the plan
/// </returns>
Task<ManagedPlanCreateOrUpdateResult> CreateOrUpdateAsync(string resourceGroupName, ManagedPlanCreateOrUpdateParameters parameters, CancellationToken cancellationToken);
/// <summary>
/// Delete operation on the plan
/// </summary>
/// <param name='resourceGroupName'>
/// Resource group name
/// </param>
/// <param name='planId'>
/// Plan name
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// A standard service response including an HTTP status code and
/// request ID.
/// </returns>
Task<AzureOperationResponse> DeleteAsync(string resourceGroupName, string planId, CancellationToken cancellationToken);
/// <summary>
/// Gets the administrator view of the plan
/// </summary>
/// <param name='resourceGroupName'>
/// Resource group name
/// </param>
/// <param name='planId'>
/// Plan name
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Administrator view of plan for the get operation
/// </returns>
Task<ManagedPlanGetResult> GetAsync(string resourceGroupName, string planId, CancellationToken cancellationToken);
/// <summary>
/// Lists all the plans under the resource group
/// </summary>
/// <param name='resourceGroupName'>
/// Resource group name
/// </param>
/// <param name='includeDetails'>
/// Flag to specify whether to include details
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result of the plan llist operation
/// </returns>
Task<ManagedPlanListResult> ListAsync(string resourceGroupName, bool includeDetails, CancellationToken cancellationToken);
}
}

Просмотреть файл

@ -0,0 +1,106 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management
{
/// <summary>
/// Administrator Operations on the subscription (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
public partial interface IManagedSubscriptionOperations
{
/// <summary>
/// Create or updates the subscription
/// </summary>
/// <param name='parameters'>
/// Subscription update parameters
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result of the create or the update operation of the subscription
/// </returns>
Task<ManagedSubscriptionCreateOrUpdateResult> CreateOrUpdateAsync(ManagedSubscriptionCreateOrUpdateParameters parameters, CancellationToken cancellationToken);
/// <summary>
/// Delete operation of the subscription
/// </summary>
/// <param name='subscriptionId'>
/// Subscription Id
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// A standard service response including an HTTP status code and
/// request ID.
/// </returns>
Task<AzureOperationResponse> DeleteAsync(string subscriptionId, CancellationToken cancellationToken);
/// <summary>
/// Gets the administrator view of the subscription
/// </summary>
/// <param name='subscriptionId'>
/// Subscription Id
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result of the subscription get operation
/// </returns>
Task<ManagedSubscriptionGetResult> GetAsync(string subscriptionId, CancellationToken cancellationToken);
/// <summary>
/// Lists the subscriptions
/// </summary>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result of the list operations
/// </returns>
Task<ManagedSubscriptionListResult> ListAsync(bool includeDetails, CancellationToken cancellationToken);
/// <summary>
/// Lists the subscription with the next link
/// </summary>
/// <param name='nextLink'>
/// The URL pointing to get the next set of subscriptions
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result of the list operations
/// </returns>
Task<ManagedSubscriptionListResult> ListNextAsync(string nextLink, CancellationToken cancellationToken);
}
}

Просмотреть файл

@ -0,0 +1,107 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management
{
/// <summary>
/// Operations on the offer (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
public partial interface IOfferOperations
{
/// <summary>
/// Gets an offer given its Id.
/// </summary>
/// <param name='offerId'>
/// The full offer Id in format
/// /delegatedProviders/{providerId}/offers/{offerName}
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// The offer get result.
/// </returns>
Task<OfferGetResult> GetAsync(string offerId, CancellationToken cancellationToken);
/// <summary>
/// Gets the price of the offer.
/// </summary>
/// <param name='offerId'>
/// the full offer ID /delegatedProviders/{providerId}/offers/{offerId}.
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Offer price result.
/// </returns>
Task<OfferGetPriceResult> GetPriceAsync(string offerId, CancellationToken cancellationToken);
/// <summary>
/// Gets the public offers under the provider which has the given
/// provider identifier
/// </summary>
/// <param name='providerIdentifier'>
/// The provider identifier, we get the public offers under that
/// provider.
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result of the offer
/// </returns>
Task<OfferListResult> ListAsync(string providerIdentifier, CancellationToken cancellationToken);
/// <summary>
/// Lists the offer with the next link
/// </summary>
/// <param name='nextLink'>
/// The URL to get the next set of offers
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result of the offer
/// </returns>
Task<OfferListResult> ListNextAsync(string nextLink, CancellationToken cancellationToken);
/// <summary>
/// Gets the public offers under the zero day (root) provider
/// </summary>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result of the offer
/// </returns>
Task<OfferListResult> ListUnderRootProviderAsync(CancellationToken cancellationToken);
}
}

Просмотреть файл

@ -0,0 +1,62 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management
{
/// <summary>
/// Operations on the plan (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
public partial interface IPlanOperations
{
/// <summary>
/// Gets the plan for a given plan id
/// </summary>
/// <param name='planId'>
/// Id of the plan
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Resul of the plan get operation
/// </returns>
Task<PlanGetResult> GetAsync(string planId, CancellationToken cancellationToken);
/// <summary>
/// Add on plans available for that subscription.
/// </summary>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Plan list result.
/// </returns>
Task<PlanListResult> ListAsync(CancellationToken cancellationToken);
}
}

Просмотреть файл

@ -0,0 +1,105 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management
{
/// <summary>
/// Resource provider manifest registration operations (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
public partial interface IProviderRegistrationOperations
{
/// <summary>
/// Registers a resource provider manifest
/// </summary>
/// <param name='resourceGroupName'>
/// Resource group name
/// </param>
/// <param name='parameters'>
/// Resource provider manifest definition
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result of the create or update of resource provider manifest
/// </returns>
Task<ProviderRegistrationCreateOrUpdateResult> CreateOrUpdateAsync(string resourceGroupName, ProviderRegistrationCreateOrUpdateParameters parameters, CancellationToken cancellationToken);
/// <summary>
/// Deletes the resource provider registration
/// </summary>
/// <param name='resourceGroupName'>
/// Resource group name
/// </param>
/// <param name='providerregistrationId'>
/// Resource provider manifest Id
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// A standard service response including an HTTP status code and
/// request ID.
/// </returns>
Task<AzureOperationResponse> DeleteAsync(string resourceGroupName, string providerregistrationId, CancellationToken cancellationToken);
/// <summary>
/// Gets the manifest registration for the specified manifest
/// registration id
/// </summary>
/// <param name='resourceGroupName'>
/// Resource group name
/// </param>
/// <param name='providerregistrationId'>
/// Resource provider manifest registration Id
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Get result of the resource provider manifest registration
/// </returns>
Task<ProviderRegistrationGetResult> GetAsync(string resourceGroupName, string providerregistrationId, CancellationToken cancellationToken);
/// <summary>
/// Lists the registered provider manifest given a resource group
/// </summary>
/// <param name='resourceGroupName'>
/// Resource group name
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result of the resource provider manifest list operation
/// </returns>
Task<ProviderRegistrationListResult> ListAsync(string resourceGroupName, CancellationToken cancellationToken);
}
}

Просмотреть файл

@ -0,0 +1,48 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management
{
/// <summary>
/// Public gallery items operations. (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
public partial interface IPublicGalleryItemOperations
{
/// <summary>
/// Public gallery items list.
/// </summary>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Public gallery items list result.
/// </returns>
Task<PublicGalleryItemListResult> ListAllAsync(CancellationToken cancellationToken);
}
}

Просмотреть файл

@ -0,0 +1,112 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management
{
/// <summary>
/// Operations on the resource group
/// </summary>
public partial interface IResourceGroupOperations
{
/// <summary>
/// Creates or updates the resourcegroup
/// </summary>
/// <param name='parameters'>
/// Resource group creation or update parameters
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result of resource group create or update operation
/// </returns>
Task<ResourceGroupCreateOrUpdateResult> CreateOrUpdateAsync(ResourceGroupCreateOrUpdateParameters parameters, CancellationToken cancellationToken);
/// <summary>
/// Deletes the given resource group
/// </summary>
/// <param name='resourceGroupName'>
/// Resource group name
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// A standard service response including an HTTP status code and
/// request ID.
/// </returns>
Task<AzureOperationResponse> DeleteAsync(string resourceGroupName, CancellationToken cancellationToken);
/// <summary>
/// Gets the resource group details for the given resource group name
/// </summary>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result of the resource group get operation
/// </returns>
Task<ResourceGroupGetResult> GetAsync(string resourceGroupName, CancellationToken cancellationToken);
/// <summary>
/// Lists the resource group under the subscription
/// </summary>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result of the resource group list operation
/// </returns>
Task<ResourceGroupListResult> ListAsync(CancellationToken cancellationToken);
/// <summary>
/// Lists the next set of resource groups under the subscription
/// </summary>
/// <param name='nextLink'>
/// The URL to get the next set of resource groups
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result of the resource group list operation
/// </returns>
Task<ResourceGroupListResult> ListNextAsync(string nextLink, CancellationToken cancellationToken);
/// <summary>
/// Lists the resources under the given resource group
/// </summary>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result of resources list operation
/// </returns>
Task<ResourceGroupListResourcesResult> ListResourcesAsync(string resourceGroupName, CancellationToken cancellationToken);
}
}

Просмотреть файл

@ -0,0 +1,103 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management
{
/// <summary>
/// Operations on the subscription as a tenant (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
public partial interface ISubscriptionOperations
{
/// <summary>
/// Creates or updates the subscription as a tenant
/// </summary>
/// <param name='parameters'>
/// Parameters for creating or updating the subscription
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Subscription definition object after create or update operation
/// </returns>
Task<SubscriptionCreateOrUpdateResult> CreateOrUpdateAsync(SubscriptionCreateOrUpdateParameters parameters, CancellationToken cancellationToken);
/// <summary>
/// Delete operation of the subscription
/// </summary>
/// <param name='subscriptionId'>
/// Subscription Id
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// A standard service response including an HTTP status code and
/// request ID.
/// </returns>
Task<AzureOperationResponse> DeleteAsync(string subscriptionId, CancellationToken cancellationToken);
/// <summary>
/// Gets the subscription given the id
/// </summary>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result of subscription get operation
/// </returns>
Task<SubscriptionGetResult> GetAsync(string subscriptionId, CancellationToken cancellationToken);
/// <summary>
/// Lists the subscriptions under the user account
/// </summary>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result of subscription list operation
/// </returns>
Task<SubscriptionListResult> ListAsync(bool includeDetails, CancellationToken cancellationToken);
/// <summary>
/// Lists the next set of subscriptions
/// </summary>
/// <param name='nextLink'>
/// URL to get the next set of results
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result of subscription list operation
/// </returns>
Task<SubscriptionListResult> ListNextAsync(string nextLink, CancellationToken cancellationToken);
}
}

Просмотреть файл

@ -0,0 +1,92 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management
{
/// <summary>
/// Administrator Operations on the subscription (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
public partial interface ISubscriptionOperationsAsAdmin
{
/// <summary>
/// Create or updates the subscription
/// </summary>
/// <param name='parameters'>
/// Subscription update parameters
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result of the create or the update operation of the subscription
/// </returns>
Task<SubscriptionCreateOrUpdateAsAdminResult> CreateOrUpdateAsync(SubscriptionCreateOrUpdateAsAdminParameters parameters, CancellationToken cancellationToken);
/// <summary>
/// Delete operation of the subscription
/// </summary>
/// <param name='subscriptionId'>
/// Subscription Id
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// A standard service response including an HTTP status code and
/// request ID.
/// </returns>
Task<AzureOperationResponse> DeleteAsync(string subscriptionId, CancellationToken cancellationToken);
/// <summary>
/// Gets the administrator view of the subscription
/// </summary>
/// <param name='subscriptionId'>
/// Subscription Id
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result of the subscription get operation
/// </returns>
Task<SubscriptionGetAsAdminResult> GetAsync(string subscriptionId, CancellationToken cancellationToken);
/// <summary>
/// Lists the subscriptions
/// </summary>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Result of the list operations
/// </returns>
Task<SubscriptionListAsAdminResult> ListAsync(bool includeDetails, CancellationToken cancellationToken);
}
}

Просмотреть файл

@ -0,0 +1,107 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management
{
/// <summary>
/// Usage connection operations (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
public partial interface IUsageConnectionsOperations
{
/// <summary>
/// Create or updates the usage connection
/// </summary>
/// <param name='resourceGroupName'>
/// Resource Group Name
/// </param>
/// <param name='usageConnectionId'>
/// Usage Connection Id
/// </param>
/// <param name='parameters'>
/// Usage Connections Create or Update Parameters
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// The usage connection create or update result.
/// </returns>
Task<UsageConnectionsCreateOrUpdateResult> CreateOrUpdateAsync(string resourceGroupName, string usageConnectionId, UsageConnectionsCreateOrUpdateParameters parameters, CancellationToken cancellationToken);
/// <summary>
/// Delete operation on the usage connection
/// </summary>
/// <param name='resourceGroupName'>
/// Resource group name
/// </param>
/// <param name='usageConnectionId'>
/// usage connection id
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// A standard service response including an HTTP status code and
/// request ID.
/// </returns>
Task<AzureOperationResponse> DeleteAsync(string resourceGroupName, string usageConnectionId, CancellationToken cancellationToken);
/// <summary>
/// Gets the usage connection details given the id and resource group
/// </summary>
/// <param name='resourceGroupName'>
/// Resource Group name for usage connection information
/// </param>
/// <param name='usageConnectionId'>
/// Usage Connection Id
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Usage Connections Model as result
/// </returns>
Task<UsageConnectionsGetResult> GetAsync(string resourceGroupName, string usageConnectionId, CancellationToken cancellationToken);
/// <summary>
/// Lists the usage connections under a resource group
/// </summary>
/// <param name='resourceGroupName'>
/// Resource group name
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// List of usage connections
/// </returns>
Task<UsageConnectionsListResult> ListAsync(string resourceGroupName, CancellationToken cancellationToken);
}
}

Просмотреть файл

@ -0,0 +1,956 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Hyak.Common;
using Microsoft.Azure;
using Microsoft.AzureStack.Management;
using Microsoft.AzureStack.Management.Models;
using Newtonsoft.Json.Linq;
namespace Microsoft.AzureStack.Management
{
/// <summary>
/// Managed locations operations for admin. (see
/// http://msdn.microsoft.com/en-us/library/windowsazure/XXXX.aspx for
/// more information)
/// </summary>
internal partial class ManagedLocationOperations : IServiceOperations<AzureStackClient>, IManagedLocationOperations
{
/// <summary>
/// Initializes a new instance of the ManagedLocationOperations class.
/// </summary>
/// <param name='client'>
/// Reference to the service client.
/// </param>
internal ManagedLocationOperations(AzureStackClient client)
{
this._client = client;
}
private AzureStackClient _client;
/// <summary>
/// Gets a reference to the
/// Microsoft.AzureStack.Management.AzureStackClient.
/// </summary>
public AzureStackClient Client
{
get { return this._client; }
}
/// <summary>
/// Create / Update the location.
/// </summary>
/// <param name='parameters'>
/// Required. Location properties
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// The location update result.
/// </returns>
public async Task<ManagedLocationCreateOrUpdateResult> CreateOrUpdateAsync(ManagedLocationCreateOrUpdateParameters parameters, CancellationToken cancellationToken)
{
// Validate
if (parameters == null)
{
throw new ArgumentNullException("parameters");
}
if (parameters.Location == null)
{
throw new ArgumentNullException("parameters.Location");
}
// Tracing
bool shouldTrace = TracingAdapter.IsEnabled;
string invocationId = null;
if (shouldTrace)
{
invocationId = TracingAdapter.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("parameters", parameters);
TracingAdapter.Enter(invocationId, this, "CreateOrUpdateAsync", tracingParameters);
}
// Construct URL
string url = "";
url = url + "/subscriptions/";
if (this.Client.Credentials.SubscriptionId != null)
{
url = url + Uri.EscapeDataString(this.Client.Credentials.SubscriptionId);
}
url = url + "/providers/Microsoft.Subscriptions.Admin/locations/";
if (parameters.Location.Name != null)
{
url = url + Uri.EscapeDataString(parameters.Location.Name);
}
List<string> queryParameters = new List<string>();
queryParameters.Add("api-version=" + Uri.EscapeDataString(this.Client.ApiVersion));
if (queryParameters.Count > 0)
{
url = url + "?" + string.Join("&", queryParameters);
}
string baseUrl = this.Client.BaseUri.AbsoluteUri;
// Trim '/' character from the end of baseUrl and beginning of url.
if (baseUrl[baseUrl.Length - 1] == '/')
{
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
}
if (url[0] == '/')
{
url = url.Substring(1);
}
url = baseUrl + "/" + url;
url = url.Replace(" ", "%20");
// Create HTTP transport objects
HttpRequestMessage httpRequest = null;
try
{
httpRequest = new HttpRequestMessage();
httpRequest.Method = HttpMethod.Put;
httpRequest.RequestUri = new Uri(url);
// Set Headers
// Set Credentials
cancellationToken.ThrowIfCancellationRequested();
await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false);
// Serialize Request
string requestContent = null;
JToken requestDoc = null;
JObject managedLocationCreateOrUpdateParametersValue = new JObject();
requestDoc = managedLocationCreateOrUpdateParametersValue;
if (parameters.Location.Id != null)
{
managedLocationCreateOrUpdateParametersValue["id"] = parameters.Location.Id;
}
if (parameters.Location.Name != null)
{
managedLocationCreateOrUpdateParametersValue["name"] = parameters.Location.Name;
}
if (parameters.Location.DisplayName != null)
{
managedLocationCreateOrUpdateParametersValue["displayName"] = parameters.Location.DisplayName;
}
if (parameters.Location.Latitude != null)
{
managedLocationCreateOrUpdateParametersValue["latitude"] = parameters.Location.Latitude;
}
if (parameters.Location.Longitude != null)
{
managedLocationCreateOrUpdateParametersValue["longitude"] = parameters.Location.Longitude;
}
requestContent = requestDoc.ToString(Newtonsoft.Json.Formatting.Indented);
httpRequest.Content = new StringContent(requestContent, Encoding.UTF8);
httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
// Send Request
HttpResponseMessage httpResponse = null;
try
{
if (shouldTrace)
{
TracingAdapter.SendRequest(invocationId, httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
httpResponse = await this.Client.HttpClient.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false);
if (shouldTrace)
{
TracingAdapter.ReceiveResponse(invocationId, httpResponse);
}
HttpStatusCode statusCode = httpResponse.StatusCode;
if (statusCode != HttpStatusCode.OK && statusCode != HttpStatusCode.Created)
{
cancellationToken.ThrowIfCancellationRequested();
CloudException ex = CloudException.Create(httpRequest, requestContent, httpResponse, await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false));
if (shouldTrace)
{
TracingAdapter.Error(invocationId, ex);
}
throw ex;
}
// Create Result
ManagedLocationCreateOrUpdateResult result = null;
// Deserialize Response
if (statusCode == HttpStatusCode.OK || statusCode == HttpStatusCode.Created)
{
cancellationToken.ThrowIfCancellationRequested();
string responseContent = await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
result = new ManagedLocationCreateOrUpdateResult();
JToken responseDoc = null;
if (string.IsNullOrEmpty(responseContent) == false)
{
responseDoc = JToken.Parse(responseContent);
}
if (responseDoc != null && responseDoc.Type != JTokenType.Null)
{
Location locationInstance = new Location();
result.Location = locationInstance;
JToken idValue = responseDoc["id"];
if (idValue != null && idValue.Type != JTokenType.Null)
{
string idInstance = ((string)idValue);
locationInstance.Id = idInstance;
}
JToken nameValue = responseDoc["name"];
if (nameValue != null && nameValue.Type != JTokenType.Null)
{
string nameInstance = ((string)nameValue);
locationInstance.Name = nameInstance;
}
JToken displayNameValue = responseDoc["displayName"];
if (displayNameValue != null && displayNameValue.Type != JTokenType.Null)
{
string displayNameInstance = ((string)displayNameValue);
locationInstance.DisplayName = displayNameInstance;
}
JToken latitudeValue = responseDoc["latitude"];
if (latitudeValue != null && latitudeValue.Type != JTokenType.Null)
{
string latitudeInstance = ((string)latitudeValue);
locationInstance.Latitude = latitudeInstance;
}
JToken longitudeValue = responseDoc["longitude"];
if (longitudeValue != null && longitudeValue.Type != JTokenType.Null)
{
string longitudeInstance = ((string)longitudeValue);
locationInstance.Longitude = longitudeInstance;
}
}
}
result.StatusCode = statusCode;
if (shouldTrace)
{
TracingAdapter.Exit(invocationId, result);
}
return result;
}
finally
{
if (httpResponse != null)
{
httpResponse.Dispose();
}
}
}
finally
{
if (httpRequest != null)
{
httpRequest.Dispose();
}
}
}
/// <summary>
/// Delete a location.
/// </summary>
/// <param name='locationName'>
/// Required. Name of location to delete.
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// A standard service response including an HTTP status code and
/// request ID.
/// </returns>
public async Task<AzureOperationResponse> DeleteAsync(string locationName, CancellationToken cancellationToken)
{
// Validate
if (locationName == null)
{
throw new ArgumentNullException("locationName");
}
// Tracing
bool shouldTrace = TracingAdapter.IsEnabled;
string invocationId = null;
if (shouldTrace)
{
invocationId = TracingAdapter.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("locationName", locationName);
TracingAdapter.Enter(invocationId, this, "DeleteAsync", tracingParameters);
}
// Construct URL
string url = "";
url = url + "/subscriptions/";
if (this.Client.Credentials.SubscriptionId != null)
{
url = url + Uri.EscapeDataString(this.Client.Credentials.SubscriptionId);
}
url = url + "/providers/Microsoft.Subscriptions.Admin/locations/";
url = url + Uri.EscapeDataString(locationName);
List<string> queryParameters = new List<string>();
queryParameters.Add("api-version=" + Uri.EscapeDataString(this.Client.ApiVersion));
if (queryParameters.Count > 0)
{
url = url + "?" + string.Join("&", queryParameters);
}
string baseUrl = this.Client.BaseUri.AbsoluteUri;
// Trim '/' character from the end of baseUrl and beginning of url.
if (baseUrl[baseUrl.Length - 1] == '/')
{
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
}
if (url[0] == '/')
{
url = url.Substring(1);
}
url = baseUrl + "/" + url;
url = url.Replace(" ", "%20");
// Create HTTP transport objects
HttpRequestMessage httpRequest = null;
try
{
httpRequest = new HttpRequestMessage();
httpRequest.Method = HttpMethod.Delete;
httpRequest.RequestUri = new Uri(url);
// Set Headers
// Set Credentials
cancellationToken.ThrowIfCancellationRequested();
await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false);
// Send Request
HttpResponseMessage httpResponse = null;
try
{
if (shouldTrace)
{
TracingAdapter.SendRequest(invocationId, httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
httpResponse = await this.Client.HttpClient.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false);
if (shouldTrace)
{
TracingAdapter.ReceiveResponse(invocationId, httpResponse);
}
HttpStatusCode statusCode = httpResponse.StatusCode;
if (statusCode != HttpStatusCode.OK)
{
cancellationToken.ThrowIfCancellationRequested();
CloudException ex = CloudException.Create(httpRequest, null, httpResponse, await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false));
if (shouldTrace)
{
TracingAdapter.Error(invocationId, ex);
}
throw ex;
}
// Create Result
AzureOperationResponse result = null;
// Deserialize Response
result = new AzureOperationResponse();
result.StatusCode = statusCode;
if (shouldTrace)
{
TracingAdapter.Exit(invocationId, result);
}
return result;
}
finally
{
if (httpResponse != null)
{
httpResponse.Dispose();
}
}
}
finally
{
if (httpRequest != null)
{
httpRequest.Dispose();
}
}
}
/// <summary>
/// Get the location.
/// </summary>
/// <param name='locationName'>
/// Required. The location name.
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// Location get result.
/// </returns>
public async Task<ManagedLocationGetResult> GetAsync(string locationName, CancellationToken cancellationToken)
{
// Validate
if (locationName == null)
{
throw new ArgumentNullException("locationName");
}
// Tracing
bool shouldTrace = TracingAdapter.IsEnabled;
string invocationId = null;
if (shouldTrace)
{
invocationId = TracingAdapter.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("locationName", locationName);
TracingAdapter.Enter(invocationId, this, "GetAsync", tracingParameters);
}
// Construct URL
string url = "";
url = url + "/subscriptions/";
if (this.Client.Credentials.SubscriptionId != null)
{
url = url + Uri.EscapeDataString(this.Client.Credentials.SubscriptionId);
}
url = url + "/providers/Microsoft.Subscriptions.Admin/locations/";
url = url + Uri.EscapeDataString(locationName);
List<string> queryParameters = new List<string>();
queryParameters.Add("api-version=" + Uri.EscapeDataString(this.Client.ApiVersion));
if (queryParameters.Count > 0)
{
url = url + "?" + string.Join("&", queryParameters);
}
string baseUrl = this.Client.BaseUri.AbsoluteUri;
// Trim '/' character from the end of baseUrl and beginning of url.
if (baseUrl[baseUrl.Length - 1] == '/')
{
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
}
if (url[0] == '/')
{
url = url.Substring(1);
}
url = baseUrl + "/" + url;
url = url.Replace(" ", "%20");
// Create HTTP transport objects
HttpRequestMessage httpRequest = null;
try
{
httpRequest = new HttpRequestMessage();
httpRequest.Method = HttpMethod.Get;
httpRequest.RequestUri = new Uri(url);
// Set Headers
// Set Credentials
cancellationToken.ThrowIfCancellationRequested();
await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false);
// Send Request
HttpResponseMessage httpResponse = null;
try
{
if (shouldTrace)
{
TracingAdapter.SendRequest(invocationId, httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
httpResponse = await this.Client.HttpClient.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false);
if (shouldTrace)
{
TracingAdapter.ReceiveResponse(invocationId, httpResponse);
}
HttpStatusCode statusCode = httpResponse.StatusCode;
if (statusCode != HttpStatusCode.OK)
{
cancellationToken.ThrowIfCancellationRequested();
CloudException ex = CloudException.Create(httpRequest, null, httpResponse, await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false));
if (shouldTrace)
{
TracingAdapter.Error(invocationId, ex);
}
throw ex;
}
// Create Result
ManagedLocationGetResult result = null;
// Deserialize Response
if (statusCode == HttpStatusCode.OK)
{
cancellationToken.ThrowIfCancellationRequested();
string responseContent = await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
result = new ManagedLocationGetResult();
JToken responseDoc = null;
if (string.IsNullOrEmpty(responseContent) == false)
{
responseDoc = JToken.Parse(responseContent);
}
if (responseDoc != null && responseDoc.Type != JTokenType.Null)
{
Location locationInstance = new Location();
result.Location = locationInstance;
JToken idValue = responseDoc["id"];
if (idValue != null && idValue.Type != JTokenType.Null)
{
string idInstance = ((string)idValue);
locationInstance.Id = idInstance;
}
JToken nameValue = responseDoc["name"];
if (nameValue != null && nameValue.Type != JTokenType.Null)
{
string nameInstance = ((string)nameValue);
locationInstance.Name = nameInstance;
}
JToken displayNameValue = responseDoc["displayName"];
if (displayNameValue != null && displayNameValue.Type != JTokenType.Null)
{
string displayNameInstance = ((string)displayNameValue);
locationInstance.DisplayName = displayNameInstance;
}
JToken latitudeValue = responseDoc["latitude"];
if (latitudeValue != null && latitudeValue.Type != JTokenType.Null)
{
string latitudeInstance = ((string)latitudeValue);
locationInstance.Latitude = latitudeInstance;
}
JToken longitudeValue = responseDoc["longitude"];
if (longitudeValue != null && longitudeValue.Type != JTokenType.Null)
{
string longitudeInstance = ((string)longitudeValue);
locationInstance.Longitude = longitudeInstance;
}
}
}
result.StatusCode = statusCode;
if (shouldTrace)
{
TracingAdapter.Exit(invocationId, result);
}
return result;
}
finally
{
if (httpResponse != null)
{
httpResponse.Dispose();
}
}
}
finally
{
if (httpRequest != null)
{
httpRequest.Dispose();
}
}
}
/// <summary>
/// Get locations under subscription.
/// </summary>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// The location list result.
/// </returns>
public async Task<ManagedLocationListResult> ListAsync(CancellationToken cancellationToken)
{
// Validate
// Tracing
bool shouldTrace = TracingAdapter.IsEnabled;
string invocationId = null;
if (shouldTrace)
{
invocationId = TracingAdapter.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
TracingAdapter.Enter(invocationId, this, "ListAsync", tracingParameters);
}
// Construct URL
string url = "";
url = url + "/subscriptions/";
if (this.Client.Credentials.SubscriptionId != null)
{
url = url + Uri.EscapeDataString(this.Client.Credentials.SubscriptionId);
}
url = url + "/providers/Microsoft.Subscriptions.Admin/locations";
List<string> queryParameters = new List<string>();
queryParameters.Add("api-version=" + Uri.EscapeDataString(this.Client.ApiVersion));
if (queryParameters.Count > 0)
{
url = url + "?" + string.Join("&", queryParameters);
}
string baseUrl = this.Client.BaseUri.AbsoluteUri;
// Trim '/' character from the end of baseUrl and beginning of url.
if (baseUrl[baseUrl.Length - 1] == '/')
{
baseUrl = baseUrl.Substring(0, baseUrl.Length - 1);
}
if (url[0] == '/')
{
url = url.Substring(1);
}
url = baseUrl + "/" + url;
url = url.Replace(" ", "%20");
// Create HTTP transport objects
HttpRequestMessage httpRequest = null;
try
{
httpRequest = new HttpRequestMessage();
httpRequest.Method = HttpMethod.Get;
httpRequest.RequestUri = new Uri(url);
// Set Headers
// Set Credentials
cancellationToken.ThrowIfCancellationRequested();
await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false);
// Send Request
HttpResponseMessage httpResponse = null;
try
{
if (shouldTrace)
{
TracingAdapter.SendRequest(invocationId, httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
httpResponse = await this.Client.HttpClient.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false);
if (shouldTrace)
{
TracingAdapter.ReceiveResponse(invocationId, httpResponse);
}
HttpStatusCode statusCode = httpResponse.StatusCode;
if (statusCode != HttpStatusCode.OK)
{
cancellationToken.ThrowIfCancellationRequested();
CloudException ex = CloudException.Create(httpRequest, null, httpResponse, await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false));
if (shouldTrace)
{
TracingAdapter.Error(invocationId, ex);
}
throw ex;
}
// Create Result
ManagedLocationListResult result = null;
// Deserialize Response
if (statusCode == HttpStatusCode.OK)
{
cancellationToken.ThrowIfCancellationRequested();
string responseContent = await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
result = new ManagedLocationListResult();
JToken responseDoc = null;
if (string.IsNullOrEmpty(responseContent) == false)
{
responseDoc = JToken.Parse(responseContent);
}
if (responseDoc != null && responseDoc.Type != JTokenType.Null)
{
JToken valueArray = responseDoc["value"];
if (valueArray != null && valueArray.Type != JTokenType.Null)
{
foreach (JToken valueValue in ((JArray)valueArray))
{
Location locationInstance = new Location();
result.Locations.Add(locationInstance);
JToken idValue = valueValue["id"];
if (idValue != null && idValue.Type != JTokenType.Null)
{
string idInstance = ((string)idValue);
locationInstance.Id = idInstance;
}
JToken nameValue = valueValue["name"];
if (nameValue != null && nameValue.Type != JTokenType.Null)
{
string nameInstance = ((string)nameValue);
locationInstance.Name = nameInstance;
}
JToken displayNameValue = valueValue["displayName"];
if (displayNameValue != null && displayNameValue.Type != JTokenType.Null)
{
string displayNameInstance = ((string)displayNameValue);
locationInstance.DisplayName = displayNameInstance;
}
JToken latitudeValue = valueValue["latitude"];
if (latitudeValue != null && latitudeValue.Type != JTokenType.Null)
{
string latitudeInstance = ((string)latitudeValue);
locationInstance.Latitude = latitudeInstance;
}
JToken longitudeValue = valueValue["longitude"];
if (longitudeValue != null && longitudeValue.Type != JTokenType.Null)
{
string longitudeInstance = ((string)longitudeValue);
locationInstance.Longitude = longitudeInstance;
}
}
}
JToken odatanextLinkValue = responseDoc["@odata.nextLink"];
if (odatanextLinkValue != null && odatanextLinkValue.Type != JTokenType.Null)
{
string odatanextLinkInstance = ((string)odatanextLinkValue);
result.NextLink = odatanextLinkInstance;
}
}
}
result.StatusCode = statusCode;
if (shouldTrace)
{
TracingAdapter.Exit(invocationId, result);
}
return result;
}
finally
{
if (httpResponse != null)
{
httpResponse.Dispose();
}
}
}
finally
{
if (httpRequest != null)
{
httpRequest.Dispose();
}
}
}
/// <summary>
/// Gets locations with the next link.
/// </summary>
/// <param name='nextLink'>
/// Required. The url to get the next set of results.
/// </param>
/// <param name='cancellationToken'>
/// Cancellation token.
/// </param>
/// <returns>
/// The location list result.
/// </returns>
public async Task<ManagedLocationListResult> ListNextAsync(string nextLink, CancellationToken cancellationToken)
{
// Validate
if (nextLink == null)
{
throw new ArgumentNullException("nextLink");
}
// Tracing
bool shouldTrace = TracingAdapter.IsEnabled;
string invocationId = null;
if (shouldTrace)
{
invocationId = TracingAdapter.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("nextLink", nextLink);
TracingAdapter.Enter(invocationId, this, "ListNextAsync", tracingParameters);
}
// Construct URL
string url = "";
url = url + Uri.EscapeDataString(nextLink);
url = url.Replace(" ", "%20");
// Create HTTP transport objects
HttpRequestMessage httpRequest = null;
try
{
httpRequest = new HttpRequestMessage();
httpRequest.Method = HttpMethod.Get;
httpRequest.RequestUri = new Uri(url);
// Set Headers
// Set Credentials
cancellationToken.ThrowIfCancellationRequested();
await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false);
// Send Request
HttpResponseMessage httpResponse = null;
try
{
if (shouldTrace)
{
TracingAdapter.SendRequest(invocationId, httpRequest);
}
cancellationToken.ThrowIfCancellationRequested();
httpResponse = await this.Client.HttpClient.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false);
if (shouldTrace)
{
TracingAdapter.ReceiveResponse(invocationId, httpResponse);
}
HttpStatusCode statusCode = httpResponse.StatusCode;
if (statusCode != HttpStatusCode.OK)
{
cancellationToken.ThrowIfCancellationRequested();
CloudException ex = CloudException.Create(httpRequest, null, httpResponse, await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false));
if (shouldTrace)
{
TracingAdapter.Error(invocationId, ex);
}
throw ex;
}
// Create Result
ManagedLocationListResult result = null;
// Deserialize Response
if (statusCode == HttpStatusCode.OK)
{
cancellationToken.ThrowIfCancellationRequested();
string responseContent = await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
result = new ManagedLocationListResult();
JToken responseDoc = null;
if (string.IsNullOrEmpty(responseContent) == false)
{
responseDoc = JToken.Parse(responseContent);
}
if (responseDoc != null && responseDoc.Type != JTokenType.Null)
{
JToken valueArray = responseDoc["value"];
if (valueArray != null && valueArray.Type != JTokenType.Null)
{
foreach (JToken valueValue in ((JArray)valueArray))
{
Location locationInstance = new Location();
result.Locations.Add(locationInstance);
JToken idValue = valueValue["id"];
if (idValue != null && idValue.Type != JTokenType.Null)
{
string idInstance = ((string)idValue);
locationInstance.Id = idInstance;
}
JToken nameValue = valueValue["name"];
if (nameValue != null && nameValue.Type != JTokenType.Null)
{
string nameInstance = ((string)nameValue);
locationInstance.Name = nameInstance;
}
JToken displayNameValue = valueValue["displayName"];
if (displayNameValue != null && displayNameValue.Type != JTokenType.Null)
{
string displayNameInstance = ((string)displayNameValue);
locationInstance.DisplayName = displayNameInstance;
}
JToken latitudeValue = valueValue["latitude"];
if (latitudeValue != null && latitudeValue.Type != JTokenType.Null)
{
string latitudeInstance = ((string)latitudeValue);
locationInstance.Latitude = latitudeInstance;
}
JToken longitudeValue = valueValue["longitude"];
if (longitudeValue != null && longitudeValue.Type != JTokenType.Null)
{
string longitudeInstance = ((string)longitudeValue);
locationInstance.Longitude = longitudeInstance;
}
}
}
JToken odatanextLinkValue = responseDoc["@odata.nextLink"];
if (odatanextLinkValue != null && odatanextLinkValue.Type != JTokenType.Null)
{
string odatanextLinkInstance = ((string)odatanextLinkValue);
result.NextLink = odatanextLinkInstance;
}
}
}
result.StatusCode = statusCode;
if (shouldTrace)
{
TracingAdapter.Exit(invocationId, result);
}
return result;
}
finally
{
if (httpResponse != null)
{
httpResponse.Dispose();
}
}
}
finally
{
if (httpRequest != null)
{
httpRequest.Dispose();
}
}
}
}
}

Просмотреть файл

@ -0,0 +1,230 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure;
using Microsoft.AzureStack.Management;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management
{
public static partial class ManagedLocationOperationsExtensions
{
/// <summary>
/// Create / Update the location.
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedLocationOperations.
/// </param>
/// <param name='parameters'>
/// Required. Location properties
/// </param>
/// <returns>
/// The location update result.
/// </returns>
public static ManagedLocationCreateOrUpdateResult CreateOrUpdate(this IManagedLocationOperations operations, ManagedLocationCreateOrUpdateParameters parameters)
{
return Task.Factory.StartNew((object s) =>
{
return ((IManagedLocationOperations)s).CreateOrUpdateAsync(parameters);
}
, operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// Create / Update the location.
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedLocationOperations.
/// </param>
/// <param name='parameters'>
/// Required. Location properties
/// </param>
/// <returns>
/// The location update result.
/// </returns>
public static Task<ManagedLocationCreateOrUpdateResult> CreateOrUpdateAsync(this IManagedLocationOperations operations, ManagedLocationCreateOrUpdateParameters parameters)
{
return operations.CreateOrUpdateAsync(parameters, CancellationToken.None);
}
/// <summary>
/// Delete a location.
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedLocationOperations.
/// </param>
/// <param name='locationName'>
/// Required. Name of location to delete.
/// </param>
/// <returns>
/// A standard service response including an HTTP status code and
/// request ID.
/// </returns>
public static AzureOperationResponse Delete(this IManagedLocationOperations operations, string locationName)
{
return Task.Factory.StartNew((object s) =>
{
return ((IManagedLocationOperations)s).DeleteAsync(locationName);
}
, operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// Delete a location.
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedLocationOperations.
/// </param>
/// <param name='locationName'>
/// Required. Name of location to delete.
/// </param>
/// <returns>
/// A standard service response including an HTTP status code and
/// request ID.
/// </returns>
public static Task<AzureOperationResponse> DeleteAsync(this IManagedLocationOperations operations, string locationName)
{
return operations.DeleteAsync(locationName, CancellationToken.None);
}
/// <summary>
/// Get the location.
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedLocationOperations.
/// </param>
/// <param name='locationName'>
/// Required. The location name.
/// </param>
/// <returns>
/// Location get result.
/// </returns>
public static ManagedLocationGetResult Get(this IManagedLocationOperations operations, string locationName)
{
return Task.Factory.StartNew((object s) =>
{
return ((IManagedLocationOperations)s).GetAsync(locationName);
}
, operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// Get the location.
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedLocationOperations.
/// </param>
/// <param name='locationName'>
/// Required. The location name.
/// </param>
/// <returns>
/// Location get result.
/// </returns>
public static Task<ManagedLocationGetResult> GetAsync(this IManagedLocationOperations operations, string locationName)
{
return operations.GetAsync(locationName, CancellationToken.None);
}
/// <summary>
/// Get locations under subscription.
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedLocationOperations.
/// </param>
/// <returns>
/// The location list result.
/// </returns>
public static ManagedLocationListResult List(this IManagedLocationOperations operations)
{
return Task.Factory.StartNew((object s) =>
{
return ((IManagedLocationOperations)s).ListAsync();
}
, operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// Get locations under subscription.
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedLocationOperations.
/// </param>
/// <returns>
/// The location list result.
/// </returns>
public static Task<ManagedLocationListResult> ListAsync(this IManagedLocationOperations operations)
{
return operations.ListAsync(CancellationToken.None);
}
/// <summary>
/// Gets locations with the next link.
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedLocationOperations.
/// </param>
/// <param name='nextLink'>
/// Required. The url to get the next set of results.
/// </param>
/// <returns>
/// The location list result.
/// </returns>
public static ManagedLocationListResult ListNext(this IManagedLocationOperations operations, string nextLink)
{
return Task.Factory.StartNew((object s) =>
{
return ((IManagedLocationOperations)s).ListNextAsync(nextLink);
}
, operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// Gets locations with the next link.
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedLocationOperations.
/// </param>
/// <param name='nextLink'>
/// Required. The url to get the next set of results.
/// </param>
/// <returns>
/// The location list result.
/// </returns>
public static Task<ManagedLocationListResult> ListNextAsync(this IManagedLocationOperations operations, string nextLink)
{
return operations.ListNextAsync(nextLink, CancellationToken.None);
}
}
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,220 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure;
using Microsoft.AzureStack.Management;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management
{
public static partial class ManagedOfferOperationsExtensions
{
/// <summary>
/// Returns the created or updated offer
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedOfferOperations.
/// </param>
/// <param name='resourceGroupName'>
/// Required. Resource group name
/// </param>
/// <param name='parameters'>
/// Required. Offer properties
/// </param>
/// <returns>
/// Result of the create or update operation of offer
/// </returns>
public static ManagedOfferCreateOrUpdateResult CreateOrUpdate(this IManagedOfferOperations operations, string resourceGroupName, ManagedOfferCreateOrUpdateParameters parameters)
{
return Task.Factory.StartNew((object s) =>
{
return ((IManagedOfferOperations)s).CreateOrUpdateAsync(resourceGroupName, parameters);
}
, operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// Returns the created or updated offer
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedOfferOperations.
/// </param>
/// <param name='resourceGroupName'>
/// Required. Resource group name
/// </param>
/// <param name='parameters'>
/// Required. Offer properties
/// </param>
/// <returns>
/// Result of the create or update operation of offer
/// </returns>
public static Task<ManagedOfferCreateOrUpdateResult> CreateOrUpdateAsync(this IManagedOfferOperations operations, string resourceGroupName, ManagedOfferCreateOrUpdateParameters parameters)
{
return operations.CreateOrUpdateAsync(resourceGroupName, parameters, CancellationToken.None);
}
/// <summary>
/// Delete operation on the offer
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedOfferOperations.
/// </param>
/// <param name='resourceGroupName'>
/// Required. Resource group name
/// </param>
/// <param name='offerId'>
/// Required. Offer name
/// </param>
/// <returns>
/// A standard service response including an HTTP status code and
/// request ID.
/// </returns>
public static AzureOperationResponse Delete(this IManagedOfferOperations operations, string resourceGroupName, string offerId)
{
return Task.Factory.StartNew((object s) =>
{
return ((IManagedOfferOperations)s).DeleteAsync(resourceGroupName, offerId);
}
, operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// Delete operation on the offer
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedOfferOperations.
/// </param>
/// <param name='resourceGroupName'>
/// Required. Resource group name
/// </param>
/// <param name='offerId'>
/// Required. Offer name
/// </param>
/// <returns>
/// A standard service response including an HTTP status code and
/// request ID.
/// </returns>
public static Task<AzureOperationResponse> DeleteAsync(this IManagedOfferOperations operations, string resourceGroupName, string offerId)
{
return operations.DeleteAsync(resourceGroupName, offerId, CancellationToken.None);
}
/// <summary>
/// Gets the administrator view of the offer
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedOfferOperations.
/// </param>
/// <param name='resourceGroupName'>
/// Required. Resource group name
/// </param>
/// <param name='offerId'>
/// Required. Offer name
/// </param>
/// <returns>
/// Result of the offer Get operation
/// </returns>
public static ManagedOfferGetResult Get(this IManagedOfferOperations operations, string resourceGroupName, string offerId)
{
return Task.Factory.StartNew((object s) =>
{
return ((IManagedOfferOperations)s).GetAsync(resourceGroupName, offerId);
}
, operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// Gets the administrator view of the offer
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedOfferOperations.
/// </param>
/// <param name='resourceGroupName'>
/// Required. Resource group name
/// </param>
/// <param name='offerId'>
/// Required. Offer name
/// </param>
/// <returns>
/// Result of the offer Get operation
/// </returns>
public static Task<ManagedOfferGetResult> GetAsync(this IManagedOfferOperations operations, string resourceGroupName, string offerId)
{
return operations.GetAsync(resourceGroupName, offerId, CancellationToken.None);
}
/// <summary>
/// Lists the offers under the specified resource group
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedOfferOperations.
/// </param>
/// <param name='resourceGroupName'>
/// Required. Resource group name
/// </param>
/// <param name='includeDetails'>
/// Required. Flag to specify whether to include details
/// </param>
/// <returns>
/// Result of the offer list operation
/// </returns>
public static ManagedOfferListResult List(this IManagedOfferOperations operations, string resourceGroupName, bool includeDetails)
{
return Task.Factory.StartNew((object s) =>
{
return ((IManagedOfferOperations)s).ListAsync(resourceGroupName, includeDetails);
}
, operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// Lists the offers under the specified resource group
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedOfferOperations.
/// </param>
/// <param name='resourceGroupName'>
/// Required. Resource group name
/// </param>
/// <param name='includeDetails'>
/// Required. Flag to specify whether to include details
/// </param>
/// <returns>
/// Result of the offer list operation
/// </returns>
public static Task<ManagedOfferListResult> ListAsync(this IManagedOfferOperations operations, string resourceGroupName, bool includeDetails)
{
return operations.ListAsync(resourceGroupName, includeDetails, CancellationToken.None);
}
}
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,220 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure;
using Microsoft.AzureStack.Management;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management
{
public static partial class ManagedPlanOperationsExtensions
{
/// <summary>
/// Creates or updates the plan
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedPlanOperations.
/// </param>
/// <param name='resourceGroupName'>
/// Required. Resource group name
/// </param>
/// <param name='parameters'>
/// Required. Plan properties
/// </param>
/// <returns>
/// Result for the create or update operation of the plan
/// </returns>
public static ManagedPlanCreateOrUpdateResult CreateOrUpdate(this IManagedPlanOperations operations, string resourceGroupName, ManagedPlanCreateOrUpdateParameters parameters)
{
return Task.Factory.StartNew((object s) =>
{
return ((IManagedPlanOperations)s).CreateOrUpdateAsync(resourceGroupName, parameters);
}
, operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// Creates or updates the plan
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedPlanOperations.
/// </param>
/// <param name='resourceGroupName'>
/// Required. Resource group name
/// </param>
/// <param name='parameters'>
/// Required. Plan properties
/// </param>
/// <returns>
/// Result for the create or update operation of the plan
/// </returns>
public static Task<ManagedPlanCreateOrUpdateResult> CreateOrUpdateAsync(this IManagedPlanOperations operations, string resourceGroupName, ManagedPlanCreateOrUpdateParameters parameters)
{
return operations.CreateOrUpdateAsync(resourceGroupName, parameters, CancellationToken.None);
}
/// <summary>
/// Delete operation on the plan
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedPlanOperations.
/// </param>
/// <param name='resourceGroupName'>
/// Required. Resource group name
/// </param>
/// <param name='planId'>
/// Required. Plan name
/// </param>
/// <returns>
/// A standard service response including an HTTP status code and
/// request ID.
/// </returns>
public static AzureOperationResponse Delete(this IManagedPlanOperations operations, string resourceGroupName, string planId)
{
return Task.Factory.StartNew((object s) =>
{
return ((IManagedPlanOperations)s).DeleteAsync(resourceGroupName, planId);
}
, operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// Delete operation on the plan
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedPlanOperations.
/// </param>
/// <param name='resourceGroupName'>
/// Required. Resource group name
/// </param>
/// <param name='planId'>
/// Required. Plan name
/// </param>
/// <returns>
/// A standard service response including an HTTP status code and
/// request ID.
/// </returns>
public static Task<AzureOperationResponse> DeleteAsync(this IManagedPlanOperations operations, string resourceGroupName, string planId)
{
return operations.DeleteAsync(resourceGroupName, planId, CancellationToken.None);
}
/// <summary>
/// Gets the administrator view of the plan
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedPlanOperations.
/// </param>
/// <param name='resourceGroupName'>
/// Required. Resource group name
/// </param>
/// <param name='planId'>
/// Required. Plan name
/// </param>
/// <returns>
/// Administrator view of plan for the get operation
/// </returns>
public static ManagedPlanGetResult Get(this IManagedPlanOperations operations, string resourceGroupName, string planId)
{
return Task.Factory.StartNew((object s) =>
{
return ((IManagedPlanOperations)s).GetAsync(resourceGroupName, planId);
}
, operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// Gets the administrator view of the plan
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedPlanOperations.
/// </param>
/// <param name='resourceGroupName'>
/// Required. Resource group name
/// </param>
/// <param name='planId'>
/// Required. Plan name
/// </param>
/// <returns>
/// Administrator view of plan for the get operation
/// </returns>
public static Task<ManagedPlanGetResult> GetAsync(this IManagedPlanOperations operations, string resourceGroupName, string planId)
{
return operations.GetAsync(resourceGroupName, planId, CancellationToken.None);
}
/// <summary>
/// Lists all the plans under the resource group
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedPlanOperations.
/// </param>
/// <param name='resourceGroupName'>
/// Required. Resource group name
/// </param>
/// <param name='includeDetails'>
/// Required. Flag to specify whether to include details
/// </param>
/// <returns>
/// Result of the plan llist operation
/// </returns>
public static ManagedPlanListResult List(this IManagedPlanOperations operations, string resourceGroupName, bool includeDetails)
{
return Task.Factory.StartNew((object s) =>
{
return ((IManagedPlanOperations)s).ListAsync(resourceGroupName, includeDetails);
}
, operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// Lists all the plans under the resource group
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedPlanOperations.
/// </param>
/// <param name='resourceGroupName'>
/// Required. Resource group name
/// </param>
/// <param name='includeDetails'>
/// Required. Flag to specify whether to include details
/// </param>
/// <returns>
/// Result of the plan llist operation
/// </returns>
public static Task<ManagedPlanListResult> ListAsync(this IManagedPlanOperations operations, string resourceGroupName, bool includeDetails)
{
return operations.ListAsync(resourceGroupName, includeDetails, CancellationToken.None);
}
}
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,236 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure;
using Microsoft.AzureStack.Management;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management
{
public static partial class ManagedSubscriptionOperationsExtensions
{
/// <summary>
/// Create or updates the subscription
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedSubscriptionOperations.
/// </param>
/// <param name='parameters'>
/// Required. Subscription update parameters
/// </param>
/// <returns>
/// Result of the create or the update operation of the subscription
/// </returns>
public static ManagedSubscriptionCreateOrUpdateResult CreateOrUpdate(this IManagedSubscriptionOperations operations, ManagedSubscriptionCreateOrUpdateParameters parameters)
{
return Task.Factory.StartNew((object s) =>
{
return ((IManagedSubscriptionOperations)s).CreateOrUpdateAsync(parameters);
}
, operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// Create or updates the subscription
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedSubscriptionOperations.
/// </param>
/// <param name='parameters'>
/// Required. Subscription update parameters
/// </param>
/// <returns>
/// Result of the create or the update operation of the subscription
/// </returns>
public static Task<ManagedSubscriptionCreateOrUpdateResult> CreateOrUpdateAsync(this IManagedSubscriptionOperations operations, ManagedSubscriptionCreateOrUpdateParameters parameters)
{
return operations.CreateOrUpdateAsync(parameters, CancellationToken.None);
}
/// <summary>
/// Delete operation of the subscription
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedSubscriptionOperations.
/// </param>
/// <param name='subscriptionId'>
/// Required. Subscription Id
/// </param>
/// <returns>
/// A standard service response including an HTTP status code and
/// request ID.
/// </returns>
public static AzureOperationResponse Delete(this IManagedSubscriptionOperations operations, string subscriptionId)
{
return Task.Factory.StartNew((object s) =>
{
return ((IManagedSubscriptionOperations)s).DeleteAsync(subscriptionId);
}
, operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// Delete operation of the subscription
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedSubscriptionOperations.
/// </param>
/// <param name='subscriptionId'>
/// Required. Subscription Id
/// </param>
/// <returns>
/// A standard service response including an HTTP status code and
/// request ID.
/// </returns>
public static Task<AzureOperationResponse> DeleteAsync(this IManagedSubscriptionOperations operations, string subscriptionId)
{
return operations.DeleteAsync(subscriptionId, CancellationToken.None);
}
/// <summary>
/// Gets the administrator view of the subscription
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedSubscriptionOperations.
/// </param>
/// <param name='subscriptionId'>
/// Required. Subscription Id
/// </param>
/// <returns>
/// Result of the subscription get operation
/// </returns>
public static ManagedSubscriptionGetResult Get(this IManagedSubscriptionOperations operations, string subscriptionId)
{
return Task.Factory.StartNew((object s) =>
{
return ((IManagedSubscriptionOperations)s).GetAsync(subscriptionId);
}
, operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// Gets the administrator view of the subscription
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedSubscriptionOperations.
/// </param>
/// <param name='subscriptionId'>
/// Required. Subscription Id
/// </param>
/// <returns>
/// Result of the subscription get operation
/// </returns>
public static Task<ManagedSubscriptionGetResult> GetAsync(this IManagedSubscriptionOperations operations, string subscriptionId)
{
return operations.GetAsync(subscriptionId, CancellationToken.None);
}
/// <summary>
/// Lists the subscriptions
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedSubscriptionOperations.
/// </param>
/// <param name='includeDetails'>
/// Required.
/// </param>
/// <returns>
/// Result of the list operations
/// </returns>
public static ManagedSubscriptionListResult List(this IManagedSubscriptionOperations operations, bool includeDetails)
{
return Task.Factory.StartNew((object s) =>
{
return ((IManagedSubscriptionOperations)s).ListAsync(includeDetails);
}
, operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// Lists the subscriptions
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedSubscriptionOperations.
/// </param>
/// <param name='includeDetails'>
/// Required.
/// </param>
/// <returns>
/// Result of the list operations
/// </returns>
public static Task<ManagedSubscriptionListResult> ListAsync(this IManagedSubscriptionOperations operations, bool includeDetails)
{
return operations.ListAsync(includeDetails, CancellationToken.None);
}
/// <summary>
/// Lists the subscription with the next link
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedSubscriptionOperations.
/// </param>
/// <param name='nextLink'>
/// Required. The URL pointing to get the next set of subscriptions
/// </param>
/// <returns>
/// Result of the list operations
/// </returns>
public static ManagedSubscriptionListResult ListNext(this IManagedSubscriptionOperations operations, string nextLink)
{
return Task.Factory.StartNew((object s) =>
{
return ((IManagedSubscriptionOperations)s).ListNextAsync(nextLink);
}
, operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
}
/// <summary>
/// Lists the subscription with the next link
/// </summary>
/// <param name='operations'>
/// Reference to the
/// Microsoft.AzureStack.Management.IManagedSubscriptionOperations.
/// </param>
/// <param name='nextLink'>
/// Required. The URL pointing to get the next set of subscriptions
/// </param>
/// <returns>
/// Result of the list operations
/// </returns>
public static Task<ManagedSubscriptionListResult> ListNextAsync(this IManagedSubscriptionOperations operations, string nextLink)
{
return operations.ListNextAsync(nextLink, CancellationToken.None);
}
}
}

Просмотреть файл

@ -0,0 +1,38 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// Plan accessibility states
/// </summary>
public enum AccessibilityState
{
Private = 0,
Public = 1,
Decommissioned = 2,
}
}

Просмотреть файл

@ -0,0 +1,63 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// Contains the name of the desired plan to be linked or unlinked from an
/// offer.
/// </summary>
public partial class AddonPlanDefinition
{
private int? _maxAcquisitionCount;
/// <summary>
/// Optional. Gets or sets the maximum number of instances that can be
/// acquired by a single subscription.
/// </summary>
public int? MaxAcquisitionCount
{
get { return this._maxAcquisitionCount; }
set { this._maxAcquisitionCount = value; }
}
private string _planId;
/// <summary>
/// Optional. Gets or sets the plan identifier.
/// </summary>
public string PlanId
{
get { return this._planId; }
set { this._planId = value; }
}
/// <summary>
/// Initializes a new instance of the AddonPlanDefinition class.
/// </summary>
public AddonPlanDefinition()
{
}
}
}

Просмотреть файл

@ -0,0 +1,51 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// Admin view of the offer
/// </summary>
public partial class AdminOfferModel : ResourceBase
{
private AdminOfferPropertiesDefinition _properties;
/// <summary>
/// Optional. Admin offer properties
/// </summary>
public AdminOfferPropertiesDefinition Properties
{
get { return this._properties; }
set { this._properties = value; }
}
/// <summary>
/// Initializes a new instance of the AdminOfferModel class.
/// </summary>
public AdminOfferModel()
{
}
}
}

Просмотреть файл

@ -0,0 +1,146 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Collections.Generic;
using System.Linq;
using Hyak.Common;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// An offer represents a billing service agreement for a subscription
/// </summary>
public partial class AdminOfferPropertiesDefinition
{
private IList<AddonPlanDefinition> _addonPlans;
/// <summary>
/// Optional. Gets or sets the references to add-on plans that a tenant
/// can optionally acquire as a part of the offer.
/// </summary>
public IList<AddonPlanDefinition> AddonPlans
{
get { return this._addonPlans; }
set { this._addonPlans = value; }
}
private IList<string> _basePlanIds;
/// <summary>
/// Optional. Gets or sets the identifiers of the base plans that
/// become available to tenant.
/// </summary>
public IList<string> BasePlanIds
{
get { return this._basePlanIds; }
set { this._basePlanIds = value; }
}
private string _description;
/// <summary>
/// Optional. Description of the offer.
/// </summary>
public string Description
{
get { return this._description; }
set { this._description = value; }
}
private string _displayName;
/// <summary>
/// Optional. Display name of the offer.
/// </summary>
public string DisplayName
{
get { return this._displayName; }
set { this._displayName = value; }
}
private string _externalReferenceId;
/// <summary>
/// Optional. The external reference identifier.
/// </summary>
public string ExternalReferenceId
{
get { return this._externalReferenceId; }
set { this._externalReferenceId = value; }
}
private int? _maxSubscriptionsPerAccount;
/// <summary>
/// Optional. Gets or sets the maximum subscriptions per account.
/// </summary>
public int? MaxSubscriptionsPerAccount
{
get { return this._maxSubscriptionsPerAccount; }
set { this._maxSubscriptionsPerAccount = value; }
}
private string _name;
/// <summary>
/// Optional. Name of the offer.
/// </summary>
public string Name
{
get { return this._name; }
set { this._name = value; }
}
private AccessibilityState _state;
/// <summary>
/// Optional. State of the offer.
/// </summary>
public AccessibilityState State
{
get { return this._state; }
set { this._state = value; }
}
private int? _subscriptionCount;
/// <summary>
/// Optional. Subscription count assoicated with the offer
/// </summary>
public int? SubscriptionCount
{
get { return this._subscriptionCount; }
set { this._subscriptionCount = value; }
}
/// <summary>
/// Initializes a new instance of the AdminOfferPropertiesDefinition
/// class.
/// </summary>
public AdminOfferPropertiesDefinition()
{
this.AddonPlans = new LazyList<AddonPlanDefinition>();
this.BasePlanIds = new LazyList<string>();
}
}
}

Просмотреть файл

@ -0,0 +1,51 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// Administrator view of the plan
/// </summary>
public partial class AdminPlanModel : ResourceBase
{
private AdminPlanPropertiesDefinition _properties;
/// <summary>
/// Optional. Plan properties in Administrator view
/// </summary>
public AdminPlanPropertiesDefinition Properties
{
get { return this._properties; }
set { this._properties = value; }
}
/// <summary>
/// Initializes a new instance of the AdminPlanModel class.
/// </summary>
public AdminPlanModel()
{
}
}
}

Просмотреть файл

@ -0,0 +1,122 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Collections.Generic;
using System.Linq;
using Hyak.Common;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// A plan represents a package of quotas and capabilities that are offered
/// tenants
/// </summary>
public partial class AdminPlanPropertiesDefinition
{
private string _description;
/// <summary>
/// Optional. Description of the plan
/// </summary>
public string Description
{
get { return this._description; }
set { this._description = value; }
}
private string _displayName;
/// <summary>
/// Optional. Display name of the plan
/// </summary>
public string DisplayName
{
get { return this._displayName; }
set { this._displayName = value; }
}
private string _externalReferenceId;
/// <summary>
/// Optional. The external reference identifier
/// </summary>
public string ExternalReferenceId
{
get { return this._externalReferenceId; }
set { this._externalReferenceId = value; }
}
private string _name;
/// <summary>
/// Optional. Name of the plan
/// </summary>
public string Name
{
get { return this._name; }
set { this._name = value; }
}
private IList<string> _quotaIds;
/// <summary>
/// Optional. Quota Ids associated with the plan
/// </summary>
public IList<string> QuotaIds
{
get { return this._quotaIds; }
set { this._quotaIds = value; }
}
private IList<string> _skuIds;
/// <summary>
/// Optional. SKU Ids associated with the plan
/// </summary>
public IList<string> SkuIds
{
get { return this._skuIds; }
set { this._skuIds = value; }
}
private int? _subscriptionCount;
/// <summary>
/// Optional. The number of subscriptions associated with the plan
/// </summary>
public int? SubscriptionCount
{
get { return this._subscriptionCount; }
set { this._subscriptionCount = value; }
}
/// <summary>
/// Initializes a new instance of the AdminPlanPropertiesDefinition
/// class.
/// </summary>
public AdminPlanPropertiesDefinition()
{
this.QuotaIds = new LazyList<string>();
this.SkuIds = new LazyList<string>();
}
}
}

Просмотреть файл

@ -0,0 +1,151 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// The subscription definition object.
/// </summary>
public partial class AdminSubscriptionDefinition
{
private string _delegatedProviderSubscriptionId;
/// <summary>
/// Optional. Gets or sets the parent reseller subscription identifier.
/// </summary>
public string DelegatedProviderSubscriptionId
{
get { return this._delegatedProviderSubscriptionId; }
set { this._delegatedProviderSubscriptionId = value; }
}
private string _displayName;
/// <summary>
/// Optional. Gets or sets the subscription name.
/// </summary>
public string DisplayName
{
get { return this._displayName; }
set { this._displayName = value; }
}
private string _externalReferenceId;
/// <summary>
/// Optional. Gets or sets the external reference identifier.
/// </summary>
public string ExternalReferenceId
{
get { return this._externalReferenceId; }
set { this._externalReferenceId = value; }
}
private string _id;
/// <summary>
/// Optional. Gets or sets the fully qualified identifier.
/// </summary>
public string Id
{
get { return this._id; }
set { this._id = value; }
}
private string _offerId;
/// <summary>
/// Optional. Gets or sets the identifier of the offer under the scope
/// of a delegated provider.
/// </summary>
public string OfferId
{
get { return this._offerId; }
set { this._offerId = value; }
}
private string _owner;
/// <summary>
/// Optional. Gets or sets the subscription owner.
/// </summary>
public string Owner
{
get { return this._owner; }
set { this._owner = value; }
}
private ResourceManagerType _routingResourceManagerType;
/// <summary>
/// Optional. Gets or sets the resource manager type.
/// </summary>
public ResourceManagerType RoutingResourceManagerType
{
get { return this._routingResourceManagerType; }
set { this._routingResourceManagerType = value; }
}
private Microsoft.AzureStack.Management.Models.SubscriptionState? _state;
/// <summary>
/// Optional. Gets or sets the subscription state.
/// </summary>
public Microsoft.AzureStack.Management.Models.SubscriptionState? State
{
get { return this._state; }
set { this._state = value; }
}
private string _subscriptionId;
/// <summary>
/// Optional. Gets or sets the subscription identifier.
/// </summary>
public string SubscriptionId
{
get { return this._subscriptionId; }
set { this._subscriptionId = value; }
}
private string _tenantId;
/// <summary>
/// Optional. Gets or sets the directory tenant identifier.
/// </summary>
public string TenantId
{
get { return this._tenantId; }
set { this._tenantId = value; }
}
/// <summary>
/// Initializes a new instance of the AdminSubscriptionDefinition class.
/// </summary>
public AdminSubscriptionDefinition()
{
}
}
}

Просмотреть файл

@ -0,0 +1,61 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// Represents the API profile.
/// </summary>
public partial class ApiProfile
{
private string _apiVersion;
/// <summary>
/// Optional. Gets or sets the API version
/// </summary>
public string ApiVersion
{
get { return this._apiVersion; }
set { this._apiVersion = value; }
}
private string _profileVersion;
/// <summary>
/// Optional. Gets or sets the profiel version.
/// </summary>
public string ProfileVersion
{
get { return this._profileVersion; }
set { this._profileVersion = value; }
}
/// <summary>
/// Initializes a new instance of the ApiProfile class.
/// </summary>
public ApiProfile()
{
}
}
}

Просмотреть файл

@ -0,0 +1,72 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// Gallery curation item model.
/// </summary>
public partial class CurationItem
{
private string _identity;
/// <summary>
/// Optional. Identity of the curation item.
/// </summary>
public string Identity
{
get { return this._identity; }
set { this._identity = value; }
}
private bool _isDefault;
/// <summary>
/// Optional. If the curation is default for the Identity.
/// </summary>
public bool IsDefault
{
get { return this._isDefault; }
set { this._isDefault = value; }
}
private string _itemUri;
/// <summary>
/// Optional. Uri of the curation.
/// </summary>
public string ItemUri
{
get { return this._itemUri; }
set { this._itemUri = value; }
}
/// <summary>
/// Initializes a new instance of the CurationItem class.
/// </summary>
public CurationItem()
{
}
}
}

Просмотреть файл

@ -0,0 +1,55 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Collections.Generic;
using System.Linq;
using Hyak.Common;
using Microsoft.Azure;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// Result of the curation list operation
/// </summary>
public partial class CurationListResult : AzureOperationResponse
{
private IList<CurationItem> _curationItems;
/// <summary>
/// Optional. List of curation item
/// </summary>
public IList<CurationItem> CurationItems
{
get { return this._curationItems; }
set { this._curationItems = value; }
}
/// <summary>
/// Initializes a new instance of the CurationListResult class.
/// </summary>
public CurationListResult()
{
this.CurationItems = new LazyList<CurationItem>();
}
}
}

Просмотреть файл

@ -0,0 +1,87 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Collections.Generic;
using System.Linq;
using Hyak.Common;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// Definition template.
/// </summary>
public partial class DefinitionTemplates
{
private string _defaultDeploymentTemplateId;
/// <summary>
/// Optional. Default deployment template identity.
/// </summary>
public string DefaultDeploymentTemplateId
{
get { return this._defaultDeploymentTemplateId; }
set { this._defaultDeploymentTemplateId = value; }
}
private IDictionary<string, string> _deploymentFragmentFileUris;
/// <summary>
/// Optional. Deployment fragment file uris.
/// </summary>
public IDictionary<string, string> DeploymentFragmentFileUris
{
get { return this._deploymentFragmentFileUris; }
set { this._deploymentFragmentFileUris = value; }
}
private IDictionary<string, string> _deploymentTemplateFileUris;
/// <summary>
/// Optional. Deployment template file uris.
/// </summary>
public IDictionary<string, string> DeploymentTemplateFileUris
{
get { return this._deploymentTemplateFileUris; }
set { this._deploymentTemplateFileUris = value; }
}
private string _uiDefinitionFileUri;
/// <summary>
/// Optional. UiDefinition file uri.
/// </summary>
public string UiDefinitionFileUri
{
get { return this._uiDefinitionFileUri; }
set { this._uiDefinitionFileUri = value; }
}
/// <summary>
/// Initializes a new instance of the DefinitionTemplates class.
/// </summary>
public DefinitionTemplates()
{
this.DeploymentFragmentFileUris = new LazyDictionary<string, string>();
this.DeploymentTemplateFileUris = new LazyDictionary<string, string>();
}
}
}

Просмотреть файл

@ -0,0 +1,66 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Collections.Generic;
using System.Linq;
using Hyak.Common;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// The manifest extension collection definition.
/// </summary>
public partial class ExtensionCollectionDefinition
{
private IList<ExtensionDefinition> _extensions;
/// <summary>
/// Optional. Gets or sets the extensions.
/// </summary>
public IList<ExtensionDefinition> Extensions
{
get { return this._extensions; }
set { this._extensions = value; }
}
private string _version;
/// <summary>
/// Optional. Gets or sets the version.
/// </summary>
public string Version
{
get { return this._version; }
set { this._version = value; }
}
/// <summary>
/// Initializes a new instance of the ExtensionCollectionDefinition
/// class.
/// </summary>
public ExtensionCollectionDefinition()
{
this.Extensions = new LazyList<ExtensionDefinition>();
}
}
}

Просмотреть файл

@ -0,0 +1,73 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// The resource provider extension.
/// </summary>
public partial class ExtensionDefinition
{
private string _name;
/// <summary>
/// Optional. Gets or sets the name.
/// </summary>
public string Name
{
get { return this._name; }
set { this._name = value; }
}
private ExtensionPropertiesDefinition _properties;
/// <summary>
/// Optional. Gets or sets the extension properties.
/// </summary>
public ExtensionPropertiesDefinition Properties
{
get { return this._properties; }
set { this._properties = value; }
}
private string _uri;
/// <summary>
/// Optional. Gets or sets the Uri.
/// </summary>
public string Uri
{
get { return this._uri; }
set { this._uri = value; }
}
/// <summary>
/// Initializes a new instance of the ExtensionDefinition class.
/// </summary>
public ExtensionDefinition()
{
}
}
}

Просмотреть файл

@ -0,0 +1,86 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Collections.Generic;
using System.Linq;
using Hyak.Common;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// Extension Metadata
/// </summary>
public partial class ExtensionMetadata
{
private string _endpointUri;
/// <summary>
/// Optional. Gets or sets the endpoint Uri
/// </summary>
public string EndpointUri
{
get { return this._endpointUri; }
set { this._endpointUri = value; }
}
private string _location;
/// <summary>
/// Optional. Gets or sets the location of the extension
/// </summary>
public string Location
{
get { return this._location; }
set { this._location = value; }
}
private string _name;
/// <summary>
/// Optional. Gets or sets the name of the extension
/// </summary>
public string Name
{
get { return this._name; }
set { this._name = value; }
}
private IList<string> _namespaces;
/// <summary>
/// Optional. Gets or sets the list of Namespaces
/// </summary>
public IList<string> Namespaces
{
get { return this._namespaces; }
set { this._namespaces = value; }
}
/// <summary>
/// Initializes a new instance of the ExtensionMetadata class.
/// </summary>
public ExtensionMetadata()
{
this.Namespaces = new LazyList<string>();
}
}
}

Просмотреть файл

@ -0,0 +1,55 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Collections.Generic;
using System.Linq;
using Hyak.Common;
using Microsoft.Azure;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// Result containing list of extensions the user has access to.
/// </summary>
public partial class ExtensionMetadataListResult : AzureOperationResponse
{
private IList<ExtensionMetadata> _extensionsMetadata;
/// <summary>
/// Optional. Enumerable of extensions the user has access to.
/// </summary>
public IList<ExtensionMetadata> ExtensionsMetadata
{
get { return this._extensionsMetadata; }
set { this._extensionsMetadata = value; }
}
/// <summary>
/// Initializes a new instance of the ExtensionMetadataListResult class.
/// </summary>
public ExtensionMetadataListResult()
{
this.ExtensionsMetadata = new LazyList<ExtensionMetadata>();
}
}
}

Просмотреть файл

@ -0,0 +1,62 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// The extension properties definition.
/// </summary>
public partial class ExtensionPropertiesDefinition
{
private string _quotaCreateBladeName;
/// <summary>
/// Optional. Gets or sets the quota create blade name.
/// </summary>
public string QuotaCreateBladeName
{
get { return this._quotaCreateBladeName; }
set { this._quotaCreateBladeName = value; }
}
private string _resourceProviderDashboardBladeName;
/// <summary>
/// Optional. Gets or sets the resource provider dashboard blade name.
/// </summary>
public string ResourceProviderDashboardBladeName
{
get { return this._resourceProviderDashboardBladeName; }
set { this._resourceProviderDashboardBladeName = value; }
}
/// <summary>
/// Initializes a new instance of the ExtensionPropertiesDefinition
/// class.
/// </summary>
public ExtensionPropertiesDefinition()
{
}
}
}

Просмотреть файл

@ -0,0 +1,223 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Collections.Generic;
using System.Linq;
using Hyak.Common;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// Gallery item model.
/// </summary>
public partial class GalleryItem
{
private IDictionary<string, string> _additionalProperties;
/// <summary>
/// Optional. Additional properties.
/// </summary>
public IDictionary<string, string> AdditionalProperties
{
get { return this._additionalProperties; }
set { this._additionalProperties = value; }
}
private IList<string> _categoryIds;
/// <summary>
/// Optional. Category identities.
/// </summary>
public IList<string> CategoryIds
{
get { return this._categoryIds; }
set { this._categoryIds = value; }
}
private DefinitionTemplates _definitionTemplates;
/// <summary>
/// Optional. Definition templates.
/// </summary>
public DefinitionTemplates DefinitionTemplates
{
get { return this._definitionTemplates; }
set { this._definitionTemplates = value; }
}
private string _description;
/// <summary>
/// Optional. Description.
/// </summary>
public string Description
{
get { return this._description; }
set { this._description = value; }
}
private IDictionary<IconKind, string> _iconFileUris;
/// <summary>
/// Optional. Icon file Uris.
/// </summary>
public IDictionary<IconKind, string> IconFileUris
{
get { return this._iconFileUris; }
set { this._iconFileUris = value; }
}
private string _identity;
/// <summary>
/// Optional. Identity.
/// </summary>
public string Identity
{
get { return this._identity; }
set { this._identity = value; }
}
private string _itemDisplayName;
/// <summary>
/// Optional. Item display name.
/// </summary>
public string ItemDisplayName
{
get { return this._itemDisplayName; }
set { this._itemDisplayName = value; }
}
private string _itemName;
/// <summary>
/// Optional. Item name.
/// </summary>
public string ItemName
{
get { return this._itemName; }
set { this._itemName = value; }
}
private IList<LinkProperties> _links;
/// <summary>
/// Optional. Links.
/// </summary>
public IList<LinkProperties> Links
{
get { return this._links; }
set { this._links = value; }
}
private string _longSummary;
/// <summary>
/// Optional. Long summary.
/// </summary>
public string LongSummary
{
get { return this._longSummary; }
set { this._longSummary = value; }
}
private string _publisher;
/// <summary>
/// Optional. Publisher.
/// </summary>
public string Publisher
{
get { return this._publisher; }
set { this._publisher = value; }
}
private string _publisherDisplayName;
/// <summary>
/// Optional. Publisher display name.
/// </summary>
public string PublisherDisplayName
{
get { return this._publisherDisplayName; }
set { this._publisherDisplayName = value; }
}
private string _resourceGroupName;
/// <summary>
/// Optional. Resource group name.
/// </summary>
public string ResourceGroupName
{
get { return this._resourceGroupName; }
set { this._resourceGroupName = value; }
}
private IList<string> _screenshotUris;
/// <summary>
/// Optional. Screenshot Uris.
/// </summary>
public IList<string> ScreenshotUris
{
get { return this._screenshotUris; }
set { this._screenshotUris = value; }
}
private string _summary;
/// <summary>
/// Optional. Summary.
/// </summary>
public string Summary
{
get { return this._summary; }
set { this._summary = value; }
}
private string _version;
/// <summary>
/// Optional. Version.
/// </summary>
public string Version
{
get { return this._version; }
set { this._version = value; }
}
/// <summary>
/// Initializes a new instance of the GalleryItem class.
/// </summary>
public GalleryItem()
{
this.AdditionalProperties = new LazyDictionary<string, string>();
this.CategoryIds = new LazyList<string>();
this.IconFileUris = new LazyDictionary<IconKind, string>();
this.Links = new LazyList<LinkProperties>();
this.ScreenshotUris = new LazyList<string>();
}
}
}

Просмотреть файл

@ -0,0 +1,67 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// Gallery item Upload parameters.
/// </summary>
public partial class GalleryItemCreateOrUpdateParameters
{
private GalleryItemUriPayload _galleryItemUri;
/// <summary>
/// Required. Gallery item Uri referenced to a public storage from
/// where the gallery item package will be uploaded.
/// </summary>
public GalleryItemUriPayload GalleryItemUri
{
get { return this._galleryItemUri; }
set { this._galleryItemUri = value; }
}
/// <summary>
/// Initializes a new instance of the
/// GalleryItemCreateOrUpdateParameters class.
/// </summary>
public GalleryItemCreateOrUpdateParameters()
{
}
/// <summary>
/// Initializes a new instance of the
/// GalleryItemCreateOrUpdateParameters class with required arguments.
/// </summary>
public GalleryItemCreateOrUpdateParameters(GalleryItemUriPayload galleryItemUri)
: this()
{
if (galleryItemUri == null)
{
throw new ArgumentNullException("galleryItemUri");
}
this.GalleryItemUri = galleryItemUri;
}
}
}

Просмотреть файл

@ -0,0 +1,53 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using Microsoft.Azure;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// Gallery item Get operation result.
/// </summary>
public partial class GalleryItemGetResult : AzureOperationResponse
{
private GalleryItemModel _galleryItem;
/// <summary>
/// Optional. Gallery item set of the parameters including
/// GalleryItemUri.
/// </summary>
public GalleryItemModel GalleryItem
{
get { return this._galleryItem; }
set { this._galleryItem = value; }
}
/// <summary>
/// Initializes a new instance of the GalleryItemGetResult class.
/// </summary>
public GalleryItemGetResult()
{
}
}
}

Просмотреть файл

@ -0,0 +1,80 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Collections.Generic;
using System.Linq;
using Hyak.Common;
using Microsoft.Azure;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// Gallery item List operation result.
/// </summary>
public partial class GalleryItemListResult : AzureOperationResponse
{
private IList<GalleryItemModel> _galleryItems;
/// <summary>
/// Optional. List of gallery items.
/// </summary>
public IList<GalleryItemModel> GalleryItems
{
get { return this._galleryItems; }
set { this._galleryItems = value; }
}
private string _nextLink;
/// <summary>
/// Required. Gets or sets the URL to get the next set of results.
/// </summary>
public string NextLink
{
get { return this._nextLink; }
set { this._nextLink = value; }
}
/// <summary>
/// Initializes a new instance of the GalleryItemListResult class.
/// </summary>
public GalleryItemListResult()
{
this.GalleryItems = new LazyList<GalleryItemModel>();
}
/// <summary>
/// Initializes a new instance of the GalleryItemListResult class with
/// required arguments.
/// </summary>
public GalleryItemListResult(string nextLink)
: this()
{
if (nextLink == null)
{
throw new ArgumentNullException("nextLink");
}
this.NextLink = nextLink;
}
}
}

Просмотреть файл

@ -0,0 +1,52 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// Gallery item set of the parameters including GalleryItemUri.
/// </summary>
public partial class GalleryItemModel : ResourceBase
{
private GalleryItemUriPayload _properties;
/// <summary>
/// Optional. Gallery item Uri referenced to a public storage from
/// where the gallery item package will be uploaded.
/// </summary>
public GalleryItemUriPayload Properties
{
get { return this._properties; }
set { this._properties = value; }
}
/// <summary>
/// Initializes a new instance of the GalleryItemModel class.
/// </summary>
public GalleryItemModel()
{
}
}
}

Просмотреть файл

@ -0,0 +1,52 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// Gallery item Uri referenced to a public storage from where the gallery
/// item package will be uploaded.
/// </summary>
public partial class GalleryItemUriPayload
{
private string _galleryItemUri;
/// <summary>
/// Optional. Gallery item Uri referenced to a public storage from
/// where the gallery item package will be uploaded.
/// </summary>
public string GalleryItemUri
{
get { return this._galleryItemUri; }
set { this._galleryItemUri = value; }
}
/// <summary>
/// Initializes a new instance of the GalleryItemUriPayload class.
/// </summary>
public GalleryItemUriPayload()
{
}
}
}

Просмотреть файл

@ -0,0 +1,42 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// Icon kind.
/// </summary>
public enum IconKind
{
Small = 0,
Medium = 1,
Large = 2,
Wide = 3,
Hero = 4,
}
}

Просмотреть файл

@ -0,0 +1,72 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// Link properties.
/// </summary>
public partial class LinkProperties
{
private string _displayName;
/// <summary>
/// Optional. Display name.
/// </summary>
public string DisplayName
{
get { return this._displayName; }
set { this._displayName = value; }
}
private string _id;
/// <summary>
/// Optional. Identity.
/// </summary>
public string Id
{
get { return this._id; }
set { this._id = value; }
}
private string _uri;
/// <summary>
/// Optional. Link Uri.
/// </summary>
public string Uri
{
get { return this._uri; }
set { this._uri = value; }
}
/// <summary>
/// Initializes a new instance of the LinkProperties class.
/// </summary>
public LinkProperties()
{
}
}
}

Просмотреть файл

@ -0,0 +1,94 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// Location.
/// </summary>
public partial class Location
{
private string _displayName;
/// <summary>
/// Optional. Display name of location.
/// </summary>
public string DisplayName
{
get { return this._displayName; }
set { this._displayName = value; }
}
private string _id;
/// <summary>
/// Optional. Id of location.
/// </summary>
public string Id
{
get { return this._id; }
set { this._id = value; }
}
private string _latitude;
/// <summary>
/// Optional. The latitude of location.
/// </summary>
public string Latitude
{
get { return this._latitude; }
set { this._latitude = value; }
}
private string _longitude;
/// <summary>
/// Optional. The longitude of location.
/// </summary>
public string Longitude
{
get { return this._longitude; }
set { this._longitude = value; }
}
private string _name;
/// <summary>
/// Optional. Name of location.
/// </summary>
public string Name
{
get { return this._name; }
set { this._name = value; }
}
/// <summary>
/// Initializes a new instance of the Location class.
/// </summary>
public Location()
{
}
}
}

Просмотреть файл

@ -0,0 +1,67 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// The location create / update parameters.
/// </summary>
public partial class ManagedLocationCreateOrUpdateParameters
{
private Location _location;
/// <summary>
/// Required. The location.
/// </summary>
public Location Location
{
get { return this._location; }
set { this._location = value; }
}
/// <summary>
/// Initializes a new instance of the
/// ManagedLocationCreateOrUpdateParameters class.
/// </summary>
public ManagedLocationCreateOrUpdateParameters()
{
}
/// <summary>
/// Initializes a new instance of the
/// ManagedLocationCreateOrUpdateParameters class with required
/// arguments.
/// </summary>
public ManagedLocationCreateOrUpdateParameters(Location location)
: this()
{
if (location == null)
{
throw new ArgumentNullException("location");
}
this.Location = location;
}
}
}

Просмотреть файл

@ -0,0 +1,53 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using Microsoft.Azure;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// The location update result.
/// </summary>
public partial class ManagedLocationCreateOrUpdateResult : AzureOperationResponse
{
private Location _location;
/// <summary>
/// Optional. The location.
/// </summary>
public Location Location
{
get { return this._location; }
set { this._location = value; }
}
/// <summary>
/// Initializes a new instance of the
/// ManagedLocationCreateOrUpdateResult class.
/// </summary>
public ManagedLocationCreateOrUpdateResult()
{
}
}
}

Просмотреть файл

@ -0,0 +1,52 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using Microsoft.Azure;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// Location get result.
/// </summary>
public partial class ManagedLocationGetResult : AzureOperationResponse
{
private Location _location;
/// <summary>
/// Optional. Location.
/// </summary>
public Location Location
{
get { return this._location; }
set { this._location = value; }
}
/// <summary>
/// Initializes a new instance of the ManagedLocationGetResult class.
/// </summary>
public ManagedLocationGetResult()
{
}
}
}

Просмотреть файл

@ -0,0 +1,80 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Collections.Generic;
using System.Linq;
using Hyak.Common;
using Microsoft.Azure;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// The location list result.
/// </summary>
public partial class ManagedLocationListResult : AzureOperationResponse
{
private IList<Location> _locations;
/// <summary>
/// Optional. The locations.
/// </summary>
public IList<Location> Locations
{
get { return this._locations; }
set { this._locations = value; }
}
private string _nextLink;
/// <summary>
/// Required. Gets or sets the URL to get the next set of results.
/// </summary>
public string NextLink
{
get { return this._nextLink; }
set { this._nextLink = value; }
}
/// <summary>
/// Initializes a new instance of the ManagedLocationListResult class.
/// </summary>
public ManagedLocationListResult()
{
this.Locations = new LazyList<Location>();
}
/// <summary>
/// Initializes a new instance of the ManagedLocationListResult class
/// with required arguments.
/// </summary>
public ManagedLocationListResult(string nextLink)
: this()
{
if (nextLink == null)
{
throw new ArgumentNullException("nextLink");
}
this.NextLink = nextLink;
}
}
}

Просмотреть файл

@ -0,0 +1,66 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// Administratior view of offer parameters
/// </summary>
public partial class ManagedOfferCreateOrUpdateParameters
{
private AdminOfferModel _offer;
/// <summary>
/// Required. Administrator view of offer properties
/// </summary>
public AdminOfferModel Offer
{
get { return this._offer; }
set { this._offer = value; }
}
/// <summary>
/// Initializes a new instance of the
/// ManagedOfferCreateOrUpdateParameters class.
/// </summary>
public ManagedOfferCreateOrUpdateParameters()
{
}
/// <summary>
/// Initializes a new instance of the
/// ManagedOfferCreateOrUpdateParameters class with required arguments.
/// </summary>
public ManagedOfferCreateOrUpdateParameters(AdminOfferModel offer)
: this()
{
if (offer == null)
{
throw new ArgumentNullException("offer");
}
this.Offer = offer;
}
}
}

Просмотреть файл

@ -0,0 +1,53 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using Microsoft.Azure;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// Result of the create or update operation of offer
/// </summary>
public partial class ManagedOfferCreateOrUpdateResult : AzureOperationResponse
{
private AdminOfferModel _offer;
/// <summary>
/// Optional. Administrator view of offer properties
/// </summary>
public AdminOfferModel Offer
{
get { return this._offer; }
set { this._offer = value; }
}
/// <summary>
/// Initializes a new instance of the ManagedOfferCreateOrUpdateResult
/// class.
/// </summary>
public ManagedOfferCreateOrUpdateResult()
{
}
}
}

Просмотреть файл

@ -0,0 +1,52 @@
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// 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.
//
// Warning: This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if the
// code is regenerated.
using System;
using System.Linq;
using Microsoft.Azure;
using Microsoft.AzureStack.Management.Models;
namespace Microsoft.AzureStack.Management.Models
{
/// <summary>
/// Result of the offer Get operation
/// </summary>
public partial class ManagedOfferGetResult : AzureOperationResponse
{
private AdminOfferModel _offer;
/// <summary>
/// Optional. Administrator view of the offer
/// </summary>
public AdminOfferModel Offer
{
get { return this._offer; }
set { this._offer = value; }
}
/// <summary>
/// Initializes a new instance of the ManagedOfferGetResult class.
/// </summary>
public ManagedOfferGetResult()
{
}
}
}

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше