C# Class Microsoft.Azure.Commands.Compute.Common.DiagnosticsHelper

Exibir arquivo Open project: Azure/azure-powershell

Public Properties

Property Type Description
DiagnosticMonitorConfigurationElemStr string
DiagnosticsConfigurationElemStr string
EventHubElemStr string
EventHubSharedAccessKeyAttr string
EventHubSharedAccessKeyNameAttr string
EventHubUrlAttr string
MetricsElemStr string
MetricsResourceIdAttr string
PrivConfEndpointAttr string
PrivConfKeyAttr string
PrivConfNameAttr string
PrivateConfigElemStr string
PublicConfigElemStr string
StorageAccountElemStr string
XmlNamespace string

Public Methods

Method Description
GetConfigFileType ( string configurationPath ) : ConfigFileType
GetConfigValueFromPrivateConfig ( string configurationPath, string elementName, string attributeName ) : string

Get the private config value for a specific attribute. The private config looks like this: XML: JSON: "PrivateConfig":{ "storageAccountName":"name", "storageAccountKey":"key", "storageAccountEndPoint":"endpoint", "EventHub":{ "Url":"url", "SharedAccessKeyName":"sasKeyName", "SharedAccessKey":"sasKey" } }

GetConfigurationsFromFiles ( string publicConfigPath, string privateConfigPath, string resourceId, Cmdlet cmdlet, IStorageManagementClient storageClient ) : Hashtable>.Tuple

Parse public and private configurations, and automatically resolve storage key for private configuration.

GetPrivateDiagnosticsConfiguration ( string configurationPath, string storageAccountName, string storageKey, string endpoint ) : Hashtable
GetPublicDiagnosticsConfigurationFromFile ( string configurationPath, string storageAccountName, string resourceId, Cmdlet cmdlet ) : Hashtable
InitializeStorageAccountEndpoint ( string storageAccountName, string storageAccountKey, IStorageManagementClient storageClient, AzureStorageContext storageContext = null, string configurationPath = null, AzureContext defaultContext = null ) : string

Initialize the storage account endpoint if it's not specified. We can get the value from multiple places, we only take the one with higher precedence. And the precedence is: 1. The one get from StorageContext parameter 2. The one get from the storage account 3. The one get from PrivateConfig element in config file 4. The one get from current Azure Environment

InitializeStorageAccountKey ( IStorageManagementClient storageClient, string storageAccountName = null, string configurationPath = null ) : string

Initialize the storage account key if it's not specified. It can be defined in multiple places, we only take the one with higher precedence. And the precedence is: 1. The one we try to resolve within current subscription 2. The one defined in PrivateConfig in the configuration file

InitializeStorageAccountName ( AzureStorageContext storageContext = null, string configurationPath = null ) : string

Initialize the storage account name if it's not specified. It can be defined in multiple places, we only take the one with higher precedence. And the precedence is: 1. The one get from StorageContext parameter 2. The one parsed from the diagnostics configuration file

IsDiagnosticsExtension ( VirtualMachineScaleSetExtension extension ) : bool

Check if a VMSS extension is diagnostics extension.

Private Methods

Method Description
AddEventHubPrivateConfig ( Hashtable privateConfig, string configurationPath ) : void
AutoFillMetricsConfig ( Newtonsoft.Json.Linq.JObject wadCfgObject, string resourceId, Cmdlet cmdlet ) : void
AutoFillMetricsConfig ( System.Xml.Linq.XElement wadCfgElement, string resourceId, Cmdlet cmdlet ) : void
CreateStorageContext ( Uri blobEndpoint, Uri queueEndpoint, Uri tableEndpoint, Uri fileEndpoint, string storageAccountName, string storageAccountKey ) : AzureStorageContext
GetEndpointFromStorageContext ( AzureStorageContext context ) : string
GetPublicConfigFromJsonFile ( string configurationPath, string storageAccountName, string resourceId, Cmdlet cmdlet ) : Hashtable
GetPublicConfigFromXmlFile ( string configurationPath, string storageAccountName, string resourceId, Cmdlet cmdlet ) : Hashtable
GetPublicConfigJObjectFromJsonFile ( string configurationPath ) : Newtonsoft.Json.Linq.JObject
GetPublicConfigXElementFromXmlFile ( string configurationPath ) : System.Xml.Linq.XElement
TryGetStorageAccount ( IStorageManagementClient storageClient, string storageAccountName, Microsoft.Azure.Management.Storage.Models.StorageAccount &storageAccount ) : bool

Method Details

GetConfigFileType() public static method

public static GetConfigFileType ( string configurationPath ) : ConfigFileType
configurationPath string
return ConfigFileType

GetConfigValueFromPrivateConfig() public static method

Get the private config value for a specific attribute. The private config looks like this: XML: JSON: "PrivateConfig":{ "storageAccountName":"name", "storageAccountKey":"key", "storageAccountEndPoint":"endpoint", "EventHub":{ "Url":"url", "SharedAccessKeyName":"sasKeyName", "SharedAccessKey":"sasKey" } }
public static GetConfigValueFromPrivateConfig ( string configurationPath, string elementName, string attributeName ) : string
configurationPath string The path to the configuration file
elementName string The element name of the private config. e.g., StorageAccount, EventHub
attributeName string The attribute name of the element
return string

GetConfigurationsFromFiles() public static method

Parse public and private configurations, and automatically resolve storage key for private configuration.
public static GetConfigurationsFromFiles ( string publicConfigPath, string privateConfigPath, string resourceId, Cmdlet cmdlet, IStorageManagementClient storageClient ) : Hashtable>.Tuple
publicConfigPath string Public configuration file path
privateConfigPath string Private configuration file path, can be empty
resourceId string
cmdlet Cmdlet
storageClient IStorageManagementClient Storage client
return Hashtable>.Tuple

GetPrivateDiagnosticsConfiguration() public static method

public static GetPrivateDiagnosticsConfiguration ( string configurationPath, string storageAccountName, string storageKey, string endpoint ) : Hashtable
configurationPath string
storageAccountName string
storageKey string
endpoint string
return System.Collections.Hashtable

GetPublicDiagnosticsConfigurationFromFile() public static method

public static GetPublicDiagnosticsConfigurationFromFile ( string configurationPath, string storageAccountName, string resourceId, Cmdlet cmdlet ) : Hashtable
configurationPath string
storageAccountName string
resourceId string
cmdlet Cmdlet
return System.Collections.Hashtable

InitializeStorageAccountEndpoint() public static method

Initialize the storage account endpoint if it's not specified. We can get the value from multiple places, we only take the one with higher precedence. And the precedence is: 1. The one get from StorageContext parameter 2. The one get from the storage account 3. The one get from PrivateConfig element in config file 4. The one get from current Azure Environment
public static InitializeStorageAccountEndpoint ( string storageAccountName, string storageAccountKey, IStorageManagementClient storageClient, AzureStorageContext storageContext = null, string configurationPath = null, AzureContext defaultContext = null ) : string
storageAccountName string
storageAccountKey string
storageClient IStorageManagementClient
storageContext Microsoft.WindowsAzure.Commands.Common.Storage.AzureStorageContext
configurationPath string
defaultContext Microsoft.Azure.Commands.Common.Authentication.Models.AzureContext
return string

InitializeStorageAccountKey() public static method

Initialize the storage account key if it's not specified. It can be defined in multiple places, we only take the one with higher precedence. And the precedence is: 1. The one we try to resolve within current subscription 2. The one defined in PrivateConfig in the configuration file
public static InitializeStorageAccountKey ( IStorageManagementClient storageClient, string storageAccountName = null, string configurationPath = null ) : string
storageClient IStorageManagementClient
storageAccountName string
configurationPath string
return string

InitializeStorageAccountName() public static method

Initialize the storage account name if it's not specified. It can be defined in multiple places, we only take the one with higher precedence. And the precedence is: 1. The one get from StorageContext parameter 2. The one parsed from the diagnostics configuration file
public static InitializeStorageAccountName ( AzureStorageContext storageContext = null, string configurationPath = null ) : string
storageContext Microsoft.WindowsAzure.Commands.Common.Storage.AzureStorageContext
configurationPath string
return string

IsDiagnosticsExtension() public static method

Check if a VMSS extension is diagnostics extension.
public static IsDiagnosticsExtension ( VirtualMachineScaleSetExtension extension ) : bool
extension VirtualMachineScaleSetExtension VMSS extension
return bool

Property Details

DiagnosticMonitorConfigurationElemStr public_oe static_oe property

public static string DiagnosticMonitorConfigurationElemStr
return string

DiagnosticsConfigurationElemStr public_oe static_oe property

public static string DiagnosticsConfigurationElemStr
return string

EventHubElemStr public_oe static_oe property

public static string EventHubElemStr
return string

EventHubSharedAccessKeyAttr public_oe static_oe property

public static string EventHubSharedAccessKeyAttr
return string

EventHubSharedAccessKeyNameAttr public_oe static_oe property

public static string EventHubSharedAccessKeyNameAttr
return string

EventHubUrlAttr public_oe static_oe property

public static string EventHubUrlAttr
return string

MetricsElemStr public_oe static_oe property

public static string MetricsElemStr
return string

MetricsResourceIdAttr public_oe static_oe property

public static string MetricsResourceIdAttr
return string

PrivConfEndpointAttr public_oe static_oe property

public static string PrivConfEndpointAttr
return string

PrivConfKeyAttr public_oe static_oe property

public static string PrivConfKeyAttr
return string

PrivConfNameAttr public_oe static_oe property

public static string PrivConfNameAttr
return string

PrivateConfigElemStr public_oe static_oe property

public static string PrivateConfigElemStr
return string

PublicConfigElemStr public_oe static_oe property

public static string PublicConfigElemStr
return string

StorageAccountElemStr public_oe static_oe property

public static string StorageAccountElemStr
return string

XmlNamespace public_oe static_oe property

public static string XmlNamespace
return string