Exemplo n.º 1
0
 /// <summary>
 /// Gets a list of accounts with administrator privileges that are not
 /// associated with an existing workspace.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.OperationalInsights.IWorkspaceOperations.
 /// </param>
 /// <returns>
 /// The list workspace link targets operation response.
 /// </returns>
 public static WorkspaceListLinkTargetsResponse ListLinkTargets(this IWorkspaceOperations operations)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IWorkspaceOperations)s).ListLinkTargetsAsync();
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Enables an intelligence back for a given workspace.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.OperationalInsights.IWorkspaceOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The resource group name of the workspace.
 /// </param>
 /// <param name='workspaceName'>
 /// Required. A unique workspace instance name.
 /// </param>
 /// <param name='intelligencePackName'>
 /// Required. The name of the intelligence pack to be enabled.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static AzureOperationResponse EnableIntelligencePack(this IWorkspaceOperations operations, string resourceGroupName, string workspaceName, string intelligencePackName)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IWorkspaceOperations)s).EnableIntelligencePackAsync(resourceGroupName, workspaceName, intelligencePackName);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemplo n.º 3
0
 /// <summary>
 /// Create or update a workspace.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.OperationalInsights.IWorkspaceOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The resource group name of the workspace.
 /// </param>
 /// <param name='parameters'>
 /// Required. The parameters required to create or update a workspace.
 /// </param>
 /// <returns>
 /// The create or update workspace operation response.
 /// </returns>
 public static WorkspaceCreateOrUpdateResponse CreateOrUpdate(this IWorkspaceOperations operations, string resourceGroupName, WorkspaceCreateOrUpdateParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IWorkspaceOperations)s).CreateOrUpdateAsync(resourceGroupName, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemplo n.º 4
0
 /// <summary>
 /// The Get Operation Status operation returns the status of the
 /// specified operation. After calling an asynchronous operation, you
 /// can call Get Operation Status to determine whether the operation
 /// has succeeded, failed, or is still in progress.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.OperationalInsights.IWorkspaceOperations.
 /// </param>
 /// <param name='operationStatusLink'>
 /// Required. Location value returned by the BeginCreateOrUpdate
 /// operation.
 /// </param>
 /// <returns>
 /// The create or update workspace operation response.
 /// </returns>
 public static WorkspaceCreateOrUpdateResponse GetCreateOrUpdateStatus(this IWorkspaceOperations operations, string operationStatusLink)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IWorkspaceOperations)s).GetCreateOrUpdateStatusAsync(operationStatusLink);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemplo n.º 5
0
 /// <summary>
 /// Gets a list of usage metrics for a workspace.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.OperationalInsights.IWorkspaceOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The resource group name of the workspace.
 /// </param>
 /// <param name='workspaceName'>
 /// Required. The name of the workspace.
 /// </param>
 /// <returns>
 /// The list workspace usages operation response.
 /// </returns>
 public static WorkspaceListUsagesResponse ListUsages(this IWorkspaceOperations operations, string resourceGroupName, string workspaceName)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IWorkspaceOperations)s).ListUsagesAsync(resourceGroupName, workspaceName);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemplo n.º 6
0
 /// <summary>
 /// Gets the next page of management groups with the link to the next
 /// page.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.OperationalInsights.IWorkspaceOperations.
 /// </param>
 /// <param name='nextLink'>
 /// Required. The url to the next management groups page.
 /// </param>
 /// <returns>
 /// The list workspace managmement groups operation response.
 /// </returns>
 public static WorkspaceListManagementGroupsResponse ListNextManagementGroups(this IWorkspaceOperations operations, string nextLink)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IWorkspaceOperations)s).ListNextManagementGroupsAsync(nextLink);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Initializes a new instance of the
 /// OperationalInsightsManagementClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public OperationalInsightsManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._storageInsights = new StorageInsightOperations(this);
     this._workspaces      = new WorkspaceOperations(this);
     this._apiVersion      = "2015-03-20";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(120);
 }
Exemplo n.º 8
0
 /// <summary>
 /// Initializes a new instance of the
 /// OperationalInsightsManagementClient class.
 /// </summary>
 public OperationalInsightsManagementClient()
     : base()
 {
     this._dataSources     = new DataSourceOperations(this);
     this._linkedServices  = new LinkedServiceOperations(this);
     this._search          = new SearchOperations(this);
     this._storageInsights = new StorageInsightOperations(this);
     this._workspaces      = new WorkspaceOperations(this);
     this._apiVersion      = "2015-03-20";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(120);
 }
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     Workspaces     = new WorkspacesOperations(this);
     Offerings      = new OfferingsOperations(this);
     Operations     = new Operations(this);
     Workspace      = new WorkspaceOperations(this);
     BaseUri        = new System.Uri("https://management.azure.com");
     ApiVersion     = "2019-11-04-preview";
     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());
 }
Exemplo n.º 10
0
 /// <summary>
 /// Create or update a workspace.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.OperationalInsights.IWorkspaceOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The resource group name of the workspace.
 /// </param>
 /// <param name='parameters'>
 /// Required. The parameters required to create or update a workspace.
 /// </param>
 /// <returns>
 /// The create or update workspace operation response.
 /// </returns>
 public static Task <WorkspaceCreateOrUpdateResponse> BeginCreateOrUpdateAsync(this IWorkspaceOperations operations, string resourceGroupName, WorkspaceCreateOrUpdateParameters parameters)
 {
     return(operations.BeginCreateOrUpdateAsync(resourceGroupName, parameters, CancellationToken.None));
 }
Exemplo n.º 11
0
 /// <summary>
 /// Gets a list of usage metrics for a workspace.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.OperationalInsights.IWorkspaceOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The resource group name of the workspace.
 /// </param>
 /// <param name='workspaceName'>
 /// Required. The name of the workspace.
 /// </param>
 /// <returns>
 /// The list workspace usages operation response.
 /// </returns>
 public static Task <WorkspaceListUsagesResponse> ListUsagesAsync(this IWorkspaceOperations operations, string resourceGroupName, string workspaceName)
 {
     return(operations.ListUsagesAsync(resourceGroupName, workspaceName, CancellationToken.None));
 }
Exemplo n.º 12
0
 /// <summary>
 /// Gets the next page of management groups with the link to the next
 /// page.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.OperationalInsights.IWorkspaceOperations.
 /// </param>
 /// <param name='nextLink'>
 /// Required. The url to the next management groups page.
 /// </param>
 /// <returns>
 /// The list workspace managmement groups operation response.
 /// </returns>
 public static Task <WorkspaceListManagementGroupsResponse> ListNextManagementGroupsAsync(this IWorkspaceOperations operations, string nextLink)
 {
     return(operations.ListNextManagementGroupsAsync(nextLink, CancellationToken.None));
 }
Exemplo n.º 13
0
 /// <summary>
 /// Check the availability of the resource name.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='locationName'>
 /// Location.
 /// </param>
 /// <param name='checkNameAvailabilityParameters'>
 /// The name and type of the resource.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <CheckNameAvailabilityResult> CheckNameAvailabilityAsync(this IWorkspaceOperations operations, string locationName, CheckNameAvailabilityParameters checkNameAvailabilityParameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CheckNameAvailabilityWithHttpMessagesAsync(locationName, checkNameAvailabilityParameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Enables an intelligence back for a given workspace.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.OperationalInsights.IWorkspaceOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The resource group name of the workspace.
 /// </param>
 /// <param name='workspaceName'>
 /// Required. A unique workspace instance name.
 /// </param>
 /// <param name='intelligencePackName'>
 /// Required. The name of the intelligence pack to be enabled.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <AzureOperationResponse> EnableIntelligencePackAsync(this IWorkspaceOperations operations, string resourceGroupName, string workspaceName, string intelligencePackName)
 {
     return(operations.EnableIntelligencePackAsync(resourceGroupName, workspaceName, intelligencePackName, CancellationToken.None));
 }
Exemplo n.º 15
0
 /// <summary>
 /// Gets the first page of workspace instances in a subscription with
 /// the link to the next page.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.OperationalInsights.IWorkspaceOperations.
 /// </param>
 /// <returns>
 /// The list workspaces operation response.
 /// </returns>
 public static Task <WorkspaceListResponse> ListInSubscriptionAsync(this IWorkspaceOperations operations)
 {
     return(operations.ListInSubscriptionAsync(CancellationToken.None));
 }
Exemplo n.º 16
0
 /// <summary>
 /// Gets the shared keys for a workspace.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.OperationalInsights.IWorkspaceOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The resource group name of the workspace.
 /// </param>
 /// <param name='workspaceName'>
 /// Required. A unique workspace name.
 /// </param>
 /// <returns>
 /// The get workspace shared keys operation response.
 /// </returns>
 public static Task <WorkspaceGetSharedKeysResponse> GetSharedKeysAsync(this IWorkspaceOperations operations, string resourceGroupName, string workspaceName)
 {
     return(operations.GetSharedKeysAsync(resourceGroupName, workspaceName, CancellationToken.None));
 }
Exemplo n.º 17
0
 /// <summary>
 /// The Get Operation Status operation returns the status of the
 /// specified operation. After calling an asynchronous operation, you
 /// can call Get Operation Status to determine whether the operation
 /// has succeeded, failed, or is still in progress.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.OperationalInsights.IWorkspaceOperations.
 /// </param>
 /// <param name='operationStatusLink'>
 /// Required. Location value returned by the BeginCreateOrUpdate
 /// operation.
 /// </param>
 /// <returns>
 /// The create or update workspace operation response.
 /// </returns>
 public static Task <WorkspaceCreateOrUpdateResponse> GetCreateOrUpdateStatusAsync(this IWorkspaceOperations operations, string operationStatusLink)
 {
     return(operations.GetCreateOrUpdateStatusAsync(operationStatusLink, CancellationToken.None));
 }
Exemplo n.º 18
0
 /// <summary>
 /// Deletes a workspace instance.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.OperationalInsights.IWorkspaceOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The resource group name of the workspace.
 /// </param>
 /// <param name='workspaceName'>
 /// Required. A unique workspace instance name.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <AzureOperationResponse> DeleteAsync(this IWorkspaceOperations operations, string resourceGroupName, string workspaceName)
 {
     return(operations.DeleteAsync(resourceGroupName, workspaceName, CancellationToken.None));
 }
Exemplo n.º 19
0
 /// <summary>
 /// Gets a list of accounts with administrator privileges that are not
 /// associated with an existing workspace.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.OperationalInsights.IWorkspaceOperations.
 /// </param>
 /// <returns>
 /// The list workspace link targets operation response.
 /// </returns>
 public static Task <WorkspaceListLinkTargetsResponse> ListLinkTargetsAsync(this IWorkspaceOperations operations)
 {
     return(operations.ListLinkTargetsAsync(CancellationToken.None));
 }
Exemplo n.º 20
0
 /// <summary>
 /// Check the availability of the resource name.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='locationName'>
 /// Location.
 /// </param>
 /// <param name='checkNameAvailabilityParameters'>
 /// The name and type of the resource.
 /// </param>
 public static CheckNameAvailabilityResult CheckNameAvailability(this IWorkspaceOperations operations, string locationName, CheckNameAvailabilityParameters checkNameAvailabilityParameters)
 {
     return(operations.CheckNameAvailabilityAsync(locationName, checkNameAvailabilityParameters).GetAwaiter().GetResult());
 }