예제 #1
0
 /// <summary>
 /// Gets the active diagnostic settings for the specified resource.
 /// **WARNING**: This method will be deprecated in future releases.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceUri'>
 /// The identifier of the resource.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ServiceDiagnosticSettingsResourceInner> GetAsync(this IServiceDiagnosticSettingsOperations operations, string resourceUri, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetWithHttpMessagesAsync(resourceUri, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Gets the active diagnostic settings. To get the diagnostic settings
 /// being applied, use GetStatus.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Insights.IServiceDiagnosticSettingsOperations.
 /// </param>
 /// <param name='resourceUri'>
 /// Required. The resource identifier of the configuration.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static ServiceDiagnosticSettingsGetResponse Get(this IServiceDiagnosticSettingsOperations operations, string resourceUri)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IServiceDiagnosticSettingsOperations)s).GetAsync(resourceUri);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Initializes a new instance of the InsightsManagementClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public InsightsManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._agentDiagnosticSettingsOperations = new AgentDiagnosticSettingsOperations(this);
     this._alertOperations     = new AlertOperations(this);
     this._autoscaleOperations = new AutoscaleOperations(this);
     this._monitoringConfigurationOperations   = new MonitoringConfigurationOperations(this);
     this._serviceDiagnosticSettingsOperations = new ServiceDiagnosticSettingsOperations(this);
     this._storageDiagnosticSettingsOperations = new StorageDiagnosticSettingsOperations(this);
     this._apiVersion = "2014-04-01";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
 /// <summary>
 /// Deletes the diagnostic settings for the specified resource.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Insights.IServiceDiagnosticSettingsOperations.
 /// </param>
 /// <param name='resourceUri'>
 /// Required. The resource identifier of the configuration.
 /// </param>
 /// <returns>
 /// Generic empty response. We only pass it to ensure json error
 /// handling
 /// </returns>
 public static Task <EmptyResponse> DeleteAsync(this IServiceDiagnosticSettingsOperations operations, string resourceUri)
 {
     return(operations.DeleteAsync(resourceUri, CancellationToken.None));
 }
 /// <summary>
 /// Create or update new diagnostic settings for the specified
 /// resource. This operation is long running. Use GetStatus to check
 /// the status of this operation.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Insights.IServiceDiagnosticSettingsOperations.
 /// </param>
 /// <param name='resourceUri'>
 /// Required. The resource identifier of the configuration.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the operation.
 /// </param>
 /// <returns>
 /// Generic empty response. We only pass it to ensure json error
 /// handling
 /// </returns>
 public static Task <EmptyResponse> PutAsync(this IServiceDiagnosticSettingsOperations operations, string resourceUri, ServiceDiagnosticSettingsPutParameters parameters)
 {
     return(operations.PutAsync(resourceUri, parameters, CancellationToken.None));
 }
예제 #6
0
 /// <summary>
 /// Gets the status of the diagnostic settings being applied. Once it
 /// is successfull, it will replace the current diagnostic settings.
 /// To get the active one, use Get.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Insights.IServiceDiagnosticSettingsOperations.
 /// </param>
 /// <param name='resourceUri'>
 /// Required. The resource identifier of the configuration.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <ServiceDiagnosticSettingsGetResponse> GetStatusAsync(this IServiceDiagnosticSettingsOperations operations, string resourceUri)
 {
     return(operations.GetStatusAsync(resourceUri, CancellationToken.None));
 }
예제 #7
0
 /// <summary>
 /// Create or update new diagnostic settings for the specified resource.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceUri'>
 /// The identifier of the resource.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the operation.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async System.Threading.Tasks.Task <ServiceDiagnosticSettingsResource> CreateOrUpdateAsync(this IServiceDiagnosticSettingsOperations operations, string resourceUri, ServiceDiagnosticSettingsResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
 {
     using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceUri, parameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
예제 #8
0
 /// <summary>
 /// Create or update new diagnostic settings for the specified resource.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceUri'>
 /// The identifier of the resource.
 /// </param>
 /// <param name='parameters'>
 /// Parameters supplied to the operation.
 /// </param>
 public static ServiceDiagnosticSettingsResource CreateOrUpdate(this IServiceDiagnosticSettingsOperations operations, string resourceUri, ServiceDiagnosticSettingsResource parameters)
 {
     return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IServiceDiagnosticSettingsOperations)s).CreateOrUpdateAsync(resourceUri, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }