Exemplo n.º 1
0
 /// <summary>
 /// Determines whether or not the given data source exists in the Azure Search service.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.Azure.Search.IDataSourceOperations.
 /// </param>
 /// <param name="dataSourceName">
 /// The name of the data source.
 /// </param>
 /// <returns>
 /// <c>true</c> if the data source exists; <c>false</c> otherwise.
 /// </returns>
 public static bool Exists(this IDataSourceOperations operations, string dataSourceName)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IDataSourceOperations)s).ExistsAsync(dataSourceName);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Gets the next page of data source instances with the link to the
 /// next page.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.OperationalInsights.IDataSourceOperations.
 /// </param>
 /// <param name='nextLink'>
 /// Required. The url to the next data source page.
 /// </param>
 /// <returns>
 /// The list data source operation response.
 /// </returns>
 public static DataSourceListResponse ListNext(this IDataSourceOperations operations, string nextLink)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IDataSourceOperations)s).ListNextAsync(nextLink);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Creates a new Azure Search datasource.  (see
 /// https://msdn.microsoft.com/library/azure/dn946876.aspx for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.Azure.Search.IDataSourceOperations.
 /// </param>
 /// <param name='dataSource'>
 /// Required. The definition of the datasource to create.
 /// </param>
 /// <returns>
 /// Response from a Create, Update, or Get DataSource request. If
 /// successful, it includes the full definition of the datasource that
 /// was created, updated, or retrieved.
 /// </returns>
 public static DataSourceDefinitionResponse Create(this IDataSourceOperations operations, DataSource dataSource)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IDataSourceOperations)s).CreateAsync(dataSource);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Create or update a data source.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.OperationalInsights.IDataSourceOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The resource group name of the data source.
 /// </param>
 /// <param name='workspaceName'>
 /// Required. The name of the parent workspace that will contain the
 /// data source
 /// </param>
 /// <param name='parameters'>
 /// Required. The parameters required to create or update a data source.
 /// </param>
 /// <returns>
 /// The create or update data source operation response.
 /// </returns>
 public static DataSourceCreateOrUpdateResponse CreateOrUpdate(this IDataSourceOperations operations, string resourceGroupName, string workspaceName, DataSourceCreateOrUpdateParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IDataSourceOperations)s).CreateOrUpdateAsync(resourceGroupName, workspaceName, parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemplo n.º 5
0
 /// <summary>
 /// Get the list of all Datasources.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.BackupServices.IDataSourceOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required.
 /// </param>
 /// <param name='resourceName'>
 /// Required.
 /// </param>
 /// <param name='csmparameters'>
 /// Optional. DataSource query parameter.
 /// </param>
 /// <param name='customRequestHeaders'>
 /// Optional. Request header parameters.
 /// </param>
 /// <returns>
 /// The definition of a CSMProtectedItemListOperationResponse.
 /// </returns>
 public static CSMProtectedItemListOperationResponse ListCSM(this IDataSourceOperations operations, string resourceGroupName, string resourceName, CSMProtectedItemQueryObject csmparameters, CustomRequestHeaders customRequestHeaders)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IDataSourceOperations)s).ListCSMAsync(resourceGroupName, resourceName, csmparameters, customRequestHeaders);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemplo n.º 6
0
 /// <summary>
 /// Disable protection for given item
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.BackupServices.IDataSourceOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required.
 /// </param>
 /// <param name='resourceName'>
 /// Required.
 /// </param>
 /// <param name='customRequestHeaders'>
 /// Optional. Request header parameters.
 /// </param>
 /// <param name='containerName'>
 /// Required. containerName.
 /// </param>
 /// <param name='itemName'>
 /// Required. itemName.
 /// </param>
 /// <returns>
 /// The definition of a Operation Response.
 /// </returns>
 public static OperationResponse DisableProtectionCSM(this IDataSourceOperations operations, string resourceGroupName, string resourceName, CustomRequestHeaders customRequestHeaders, string containerName, string itemName)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IDataSourceOperations)s).DisableProtectionCSMAsync(resourceGroupName, resourceName, customRequestHeaders, containerName, itemName);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Gets the first page of data source instances in a workspace with
 /// the link to the next page.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.OperationalInsights.IDataSourceOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The resource group name of the data sources.
 /// </param>
 /// <param name='workspaceName'>
 /// Required. The workspace that contains the data sources.
 /// </param>
 /// <param name='kind'>
 /// Required. Filter data sources by Kind.
 /// </param>
 /// <param name='skiptoken'>
 /// Optional. Token for paging support.
 /// </param>
 /// <returns>
 /// The list data source operation response.
 /// </returns>
 public static DataSourceListResponse ListInWorkspace(this IDataSourceOperations operations, string resourceGroupName, string workspaceName, string kind, string skiptoken)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IDataSourceOperations)s).ListInWorkspaceAsync(resourceGroupName, workspaceName, kind, skiptoken);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Initializes a new instance of the SearchServiceClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 private SearchServiceClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._dataSources       = new DataSourceOperations(this);
     this._indexers          = new IndexerOperations(this);
     this._indexes           = new IndexOperations(this);
     this._apiVersion        = "2015-02-28";
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
Exemplo n.º 9
0
 /// <summary>
 /// Initializes a new instance of the
 /// OperationalInsightsManagementClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public OperationalInsightsManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._dataSources     = new DataSourceOperations(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 a new instance of the BackupServicesManagementClient
 /// class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public BackupServicesManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._backUp              = new BackUpOperations(this);
     this._container           = new ContainerOperations(this);
     this._cSMProtectionPolicy = new CSMProtectionPolicyOperations(this);
     this._dataSource          = new DataSourceOperations(this);
     this._job               = new JobOperations(this);
     this._operationStatus   = new OperationStatus(this);
     this._protectableObject = new ProtectableObjectOperations(this);
     this._recoveryPoint     = new RecoveryPointOperations(this);
     this._restore           = new RestoreOperations(this);
     this._apiVersion        = "2013-03-01";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
 /// <summary>
 /// Gets the first page of data source instances in a workspace with
 /// the link to the next page.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.OperationalInsights.IDataSourceOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The resource group name of the data sources.
 /// </param>
 /// <param name='workspaceName'>
 /// Required. The workspace that contains the data sources.
 /// </param>
 /// <param name='kind'>
 /// Required. Filter data sources by Kind.
 /// </param>
 /// <param name='skiptoken'>
 /// Optional. Token for paging support.
 /// </param>
 /// <returns>
 /// The list data source operation response.
 /// </returns>
 public static Task <DataSourceListResponse> ListInWorkspaceAsync(this IDataSourceOperations operations, string resourceGroupName, string workspaceName, string kind, string skiptoken)
 {
     return(operations.ListInWorkspaceAsync(resourceGroupName, workspaceName, kind, skiptoken, CancellationToken.None));
 }
Exemplo n.º 12
0
 /// <summary>
 /// Disable protection for given item
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.BackupServices.IDataSourceOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required.
 /// </param>
 /// <param name='resourceName'>
 /// Required.
 /// </param>
 /// <param name='customRequestHeaders'>
 /// Optional. Request header parameters.
 /// </param>
 /// <param name='containerName'>
 /// Required. containerName.
 /// </param>
 /// <param name='itemName'>
 /// Required. itemName.
 /// </param>
 /// <returns>
 /// The definition of a Operation Response.
 /// </returns>
 public static Task <OperationResponse> DisableProtectionCSMAsync(this IDataSourceOperations operations, string resourceGroupName, string resourceName, CustomRequestHeaders customRequestHeaders, string containerName, string itemName)
 {
     return(operations.DisableProtectionCSMAsync(resourceGroupName, resourceName, customRequestHeaders, containerName, itemName, CancellationToken.None));
 }
Exemplo n.º 13
0
 /// <summary>
 /// Determines whether or not the given data source exists in the Azure Search service.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.Azure.Search.IDataSourceOperations.
 /// </param>
 /// <param name="dataSourceName">
 /// The name of the data source.
 /// </param>
 /// <returns>
 /// <c>true</c> if the data source exists; <c>false</c> otherwise.
 /// </returns>
 public static Task <bool> ExistsAsync(this IDataSourceOperations operations, string dataSourceName)
 {
     return(operations.ExistsAsync(dataSourceName, CancellationToken.None));
 }
Exemplo n.º 14
0
 /// <summary>
 /// Get the list of all Datasources.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.BackupServices.IDataSourceOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required.
 /// </param>
 /// <param name='resourceName'>
 /// Required.
 /// </param>
 /// <param name='csmparameters'>
 /// Optional. DataSource query parameter.
 /// </param>
 /// <param name='customRequestHeaders'>
 /// Optional. Request header parameters.
 /// </param>
 /// <returns>
 /// The definition of a CSMProtectedItemListOperationResponse.
 /// </returns>
 public static Task <CSMProtectedItemListOperationResponse> ListCSMAsync(this IDataSourceOperations operations, string resourceGroupName, string resourceName, CSMProtectedItemQueryObject csmparameters, CustomRequestHeaders customRequestHeaders)
 {
     return(operations.ListCSMAsync(resourceGroupName, resourceName, csmparameters, customRequestHeaders, CancellationToken.None));
 }
 /// <summary>
 /// Deletes an Azure Search datasource.  (see
 /// https://msdn.microsoft.com/library/azure/dn946881.aspx for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.Azure.Search.IDataSourceOperations.
 /// </param>
 /// <param name='dataSourceName'>
 /// Required. The name of the datasource to delete.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <AzureOperationResponse> DeleteAsync(this IDataSourceOperations operations, string dataSourceName)
 {
     return(operations.DeleteAsync(dataSourceName, CancellationToken.None));
 }
 /// <summary>
 /// Create or update a data source.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.OperationalInsights.IDataSourceOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The resource group name of the data source.
 /// </param>
 /// <param name='workspaceName'>
 /// Required. The name of the parent workspace that will contain the
 /// data source
 /// </param>
 /// <param name='parameters'>
 /// Required. The parameters required to create or update a data source.
 /// </param>
 /// <returns>
 /// The create or update data source operation response.
 /// </returns>
 public static Task <DataSourceCreateOrUpdateResponse> CreateOrUpdateAsync(this IDataSourceOperations operations, string resourceGroupName, string workspaceName, DataSourceCreateOrUpdateParameters parameters)
 {
     return(operations.CreateOrUpdateAsync(resourceGroupName, workspaceName, parameters, CancellationToken.None));
 }
 /// <summary>
 /// Retrieves a datasource definition from Azure Search.  (see
 /// https://msdn.microsoft.com/library/azure/dn946893.aspx for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.Azure.Search.IDataSourceOperations.
 /// </param>
 /// <param name='dataSourceName'>
 /// Required. The name of the datasource to retrieve.
 /// </param>
 /// <returns>
 /// Response from a Create, Update, or Get DataSource request. If
 /// successful, it includes the full definition of the datasource that
 /// was created, updated, or retrieved.
 /// </returns>
 public static Task <DataSourceDefinitionResponse> GetAsync(this IDataSourceOperations operations, string dataSourceName)
 {
     return(operations.GetAsync(dataSourceName, CancellationToken.None));
 }
 /// <summary>
 /// Gets the next page of data source instances with the link to the
 /// next page.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.OperationalInsights.IDataSourceOperations.
 /// </param>
 /// <param name='nextLink'>
 /// Required. The url to the next data source page.
 /// </param>
 /// <returns>
 /// The list data source operation response.
 /// </returns>
 public static Task <DataSourceListResponse> ListNextAsync(this IDataSourceOperations operations, string nextLink)
 {
     return(operations.ListNextAsync(nextLink, CancellationToken.None));
 }
 /// <summary>
 /// Lists all datasources available for an Azure Search service.  (see
 /// https://msdn.microsoft.com/library/azure/dn946878.aspx for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.Azure.Search.IDataSourceOperations.
 /// </param>
 /// <returns>
 /// Response from a List Datasources request. If successful, it
 /// includes the full definitions of all datasources.
 /// </returns>
 public static Task <DataSourceListResponse> ListAsync(this IDataSourceOperations operations)
 {
     return(operations.ListAsync(CancellationToken.None));
 }
 /// <summary>
 /// Creates a new Azure Search datasource.  (see
 /// https://msdn.microsoft.com/library/azure/dn946876.aspx for more
 /// information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.Azure.Search.IDataSourceOperations.
 /// </param>
 /// <param name='dataSource'>
 /// Required. The definition of the datasource to create.
 /// </param>
 /// <returns>
 /// Response from a Create, Update, or Get DataSource request. If
 /// successful, it includes the full definition of the datasource that
 /// was created, updated, or retrieved.
 /// </returns>
 public static Task <DataSourceDefinitionResponse> CreateAsync(this IDataSourceOperations operations, DataSource dataSource)
 {
     return(operations.CreateAsync(dataSource, CancellationToken.None));
 }
 /// <summary>
 /// Gets a data source instance.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.OperationalInsights.IDataSourceOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The resource group name of the data source.
 /// </param>
 /// <param name='workspaceName'>
 /// Required. The name of the workspace that contains the data source.
 /// </param>
 /// <param name='dataSourceName'>
 /// Required. Name of the data source
 /// </param>
 /// <returns>
 /// The get data source operation response.
 /// </returns>
 public static Task <DataSourceGetResponse> GetAsync(this IDataSourceOperations operations, string resourceGroupName, string workspaceName, string dataSourceName)
 {
     return(operations.GetAsync(resourceGroupName, workspaceName, dataSourceName, CancellationToken.None));
 }