/// <summary> /// Get the API Key for this key id. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='resourceName'> /// The name of the Application Insights component resource. /// </param> /// <param name='keyId'> /// The API Key ID. This is unique within a Application Insights component. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <ApplicationInsightsComponentAPIKey> GetAsync(this IAPIKeysOperations operations, string resourceGroupName, string resourceName, string keyId, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, resourceName, keyId, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Create an API Key of an Application Insights component. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='resourceName'> /// The name of the Application Insights component resource. /// </param> /// <param name='aPIKeyProperties'> /// Properties that need to be specified to create an API key of a Application /// Insights component. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <ApplicationInsightsComponentAPIKey> CreateAsync(this IAPIKeysOperations operations, string resourceGroupName, string resourceName, APIKeyRequest aPIKeyProperties, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, resourceName, aPIKeyProperties, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { Operations = new Operations(this); Components = new ComponentsOperations(this); WebTests = new WebTestsOperations(this); ExportConfigurations = new ExportConfigurationsOperations(this); ComponentCurrentBillingFeatures = new ComponentCurrentBillingFeaturesOperations(this); ComponentQuotaStatus = new ComponentQuotaStatusOperations(this); APIKeys = new APIKeysOperations(this); BaseUri = new System.Uri("https://management.azure.com"); ApiVersion = "2015-05-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; SerializationSettings = new JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; SerializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings = new JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; CustomInitialize(); DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); }
/// <summary> /// Create an API Key of an Application Insights component. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='resourceName'> /// The name of the Application Insights component resource. /// </param> /// <param name='aPIKeyProperties'> /// Properties that need to be specified to create an API key of a Application /// Insights component. /// </param> public static ApplicationInsightsComponentAPIKey Create(this IAPIKeysOperations operations, string resourceGroupName, string resourceName, APIKeyRequest aPIKeyProperties) { return(operations.CreateAsync(resourceGroupName, resourceName, aPIKeyProperties).GetAwaiter().GetResult()); }
/// <summary> /// Gets a list of API keys of an Application Insights component. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='resourceName'> /// The name of the Application Insights component resource. /// </param> public static IEnumerable <ApplicationInsightsComponentAPIKey> List(this IAPIKeysOperations operations, string resourceGroupName, string resourceName) { return(operations.ListAsync(resourceGroupName, resourceName).GetAwaiter().GetResult()); }
/// <summary> /// Get the API Key for this key id. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='resourceName'> /// The name of the Application Insights component resource. /// </param> /// <param name='keyId'> /// The API Key ID. This is unique within a Application Insights component. /// </param> public static ApplicationInsightsComponentAPIKey Get(this IAPIKeysOperations operations, string resourceGroupName, string resourceName, string keyId) { return(operations.GetAsync(resourceGroupName, resourceName, keyId).GetAwaiter().GetResult()); }