/// <summary> /// Creates or updates the data store/repository in the data manager. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='dataStoreName'> /// The data store/repository name to be created or updated. /// </param> /// <param name='dataStore'> /// The data store/repository object to be created or updated. /// </param> /// <param name='resourceGroupName'> /// The Resource Group Name /// </param> /// <param name='dataManagerName'> /// The name of the DataManager Resource within the specified resource group. /// DataManager names must be between 3 and 24 characters in length and use any /// alphanumeric and underscore only /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <DataStore> BeginCreateOrUpdateAsync(this IDataStoresOperations operations, string dataStoreName, DataStore dataStore, string resourceGroupName, string dataManagerName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(dataStoreName, dataStore, resourceGroupName, dataManagerName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets all the data stores/repositories in the given resource. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <DataStore> > ListByDataManagerNextAsync(this IDataStoresOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByDataManagerNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Get the default Datastore. /// </summary> /// <remarks> /// Get the default Datastore in the workspace. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='subscriptionId'> /// The Azure Subscription ID. /// </param> /// <param name='resourceGroupName'> /// The Name of the resource group in which the workspace is located. /// </param> /// <param name='workspaceName'> /// The name of the workspace. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <DataStore> GetDefaultAsync(this IDataStoresOperations operations, System.Guid subscriptionId, string resourceGroupName, string workspaceName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetDefaultWithHttpMessagesAsync(subscriptionId, resourceGroupName, workspaceName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets all the data stores/repositories in the given resource. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The Resource Group Name /// </param> /// <param name='dataManagerName'> /// The name of the DataManager Resource within the specified resource group. /// DataManager names must be between 3 and 24 characters in length and use any /// alphanumeric and underscore only /// </param> /// <param name='odataQuery'> /// OData parameters to apply to the operation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <DataStore> > ListByDataManagerAsync(this IDataStoresOperations operations, string resourceGroupName, string dataManagerName, ODataQuery <DataStoreFilter> odataQuery = default(ODataQuery <DataStoreFilter>), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByDataManagerWithHttpMessagesAsync(resourceGroupName, dataManagerName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Get Datastores list. /// </summary> /// <remarks> /// Get the list of Datastores attached to the workspace. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='subscriptionId'> /// The Azure Subscription ID. /// </param> /// <param name='resourceGroupName'> /// The Name of the resource group in which the workspace is located. /// </param> /// <param name='workspaceName'> /// The name of the workspace. /// </param> /// <param name='dataStoreNames'> /// List of Datastore names. /// </param> /// <param name='continuationToken'> /// The Continuation Token. /// </param> /// <param name='count'> /// Count of Datastores to be returned. /// </param> /// <param name='includeSecret'> /// Whether to include the datastore secret in the response. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <DataStore> > ListAsync(this IDataStoresOperations operations, System.Guid subscriptionId, string resourceGroupName, string workspaceName, IList <string> dataStoreNames = default(IList <string>), string continuationToken = default(string), int?count = 30, bool?includeSecret = true, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(subscriptionId, resourceGroupName, workspaceName, dataStoreNames, continuationToken, count, includeSecret, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
public static DataStore CreateStorSimpleDataStore(this IDataStoresOperations operations, string subscriptionIdOfDataManager, string subscriptionIdOfStorSimpleDevice, string resourceGroupOfDataManager, string resourceGroupOfStorSimpleDevice, string dataManagerName, string serviceEncryptionKey, string storSimpleDeviceName, HybridDataManagementClient client) { var storSimpleDataStore = new DataStore(); var publicKey = client.PublicKeys.ListByDataManager(resourceGroupOfDataManager, dataManagerName).FirstOrDefault(); storSimpleDataStore.State = State.Enabled; storSimpleDataStore.CustomerSecrets = EncryptStorSimpleCustomerSecrets(serviceEncryptionKey, publicKey); storSimpleDataStore.DataStoreTypeId = string.Format( "/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.HybridData" + "/dataManagers/{2}/dataStoreTypes/StorSimple8000Series", subscriptionIdOfDataManager, resourceGroupOfDataManager, dataManagerName); storSimpleDataStore.RepositoryId = $"/subscriptions/{subscriptionIdOfStorSimpleDevice}/resourceGroups/{resourceGroupOfStorSimpleDevice}" + $"/providers/Microsoft.StorSimple/managers/{storSimpleDeviceName}"; storSimpleDataStore.ExtendedProperties = GetStorSimpleExtendedProperties(storSimpleDataStore.RepositoryId); return(storSimpleDataStore); }
public static DataStore CreateAzureStorageDataStore(this IDataStoresOperations operations, string subscriptionIdOfDataManager, string subscriptionIdOfStorageAccount, string resourceGroupOfDataManager, string resourceGroupOfStorageAccount, string dataManagerName, string storageAccountKey, string azureStorageName, HybridDataManagementClient client) { var azureStorageDataStore = new DataStore(); var publicKey = client.PublicKeys.ListByDataManager(resourceGroupOfDataManager, dataManagerName).FirstOrDefault(); azureStorageDataStore.State = State.Enabled; azureStorageDataStore.CustomerSecrets = EncryptAzureStorageCustomerSecrets(storageAccountKey, publicKey); azureStorageDataStore.DataStoreTypeId = string.Format( "/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.HybridData" + "/dataManagers/{2}/dataStoreTypes/AzureStorageAccount", subscriptionIdOfDataManager, resourceGroupOfDataManager, dataManagerName); azureStorageDataStore.RepositoryId = $"/subscriptions/{subscriptionIdOfStorageAccount}/resourceGroups/{resourceGroupOfStorageAccount}" + $"/providers/Microsoft.Storage/storageAccounts/{azureStorageName}"; azureStorageDataStore.ExtendedProperties = GetAzureStorageExtendedProperties(azureStorageDataStore.RepositoryId); return(azureStorageDataStore); }
/// <summary> /// This method gets the data store/repository by name. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='dataStoreName'> /// The data store/repository name queried. /// </param> /// <param name='resourceGroupName'> /// The Resource Group Name /// </param> /// <param name='dataManagerName'> /// The name of the DataManager Resource within the specified resource group. /// DataManager names must be between 3 and 24 characters in length and use any /// alphanumeric and underscore only /// </param> public static DataStore Get(this IDataStoresOperations operations, string dataStoreName, string resourceGroupName, string dataManagerName) { return(operations.GetAsync(dataStoreName, resourceGroupName, dataManagerName).GetAwaiter().GetResult()); }
/// <summary> /// Update or create a Datastore. /// </summary> /// <remarks> /// Update or create a Datastore in the given workspace. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='subscriptionId'> /// The Azure Subscription ID. /// </param> /// <param name='resourceGroupName'> /// The Name of the resource group in which the workspace is located. /// </param> /// <param name='workspaceName'> /// The name of the workspace. /// </param> /// <param name='name'> /// The Datastore name. /// </param> /// <param name='dto'> /// The Datastore details. /// </param> /// <param name='createIfNotExists'> /// If set to true, the call will create an Datastore if it doesn't exist. /// </param> /// <param name='skipValidation'> /// If set to true, the call will skip Datastore validation. /// </param> public static void Update(this IDataStoresOperations operations, System.Guid subscriptionId, string resourceGroupName, string workspaceName, string name, DataStore dto = default(DataStore), bool?createIfNotExists = false, bool?skipValidation = false) { operations.UpdateAsync(subscriptionId, resourceGroupName, workspaceName, name, dto, createIfNotExists, skipValidation).GetAwaiter().GetResult(); }
/// <summary> /// Gets all the data stores/repositories in the given resource. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The Resource Group Name /// </param> /// <param name='dataManagerName'> /// The name of the DataManager Resource within the specified resource group. /// DataManager names must be between 3 and 24 characters in length and use any /// alphanumeric and underscore only /// </param> /// <param name='odataQuery'> /// OData parameters to apply to the operation. /// </param> public static IPage <DataStore> ListByDataManager(this IDataStoresOperations operations, string resourceGroupName, string dataManagerName, ODataQuery <DataStoreFilter> odataQuery = default(ODataQuery <DataStoreFilter>)) { return(operations.ListByDataManagerAsync(resourceGroupName, dataManagerName, odataQuery).GetAwaiter().GetResult()); }
/// <summary> /// Update or create a Datastore. /// </summary> /// <remarks> /// Update or create a Datastore in the given workspace. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='subscriptionId'> /// The Azure Subscription ID. /// </param> /// <param name='resourceGroupName'> /// The Name of the resource group in which the workspace is located. /// </param> /// <param name='workspaceName'> /// The name of the workspace. /// </param> /// <param name='name'> /// The Datastore name. /// </param> /// <param name='dto'> /// The Datastore details. /// </param> /// <param name='createIfNotExists'> /// If set to true, the call will create an Datastore if it doesn't exist. /// </param> /// <param name='skipValidation'> /// If set to true, the call will skip Datastore validation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task UpdateAsync(this IDataStoresOperations operations, System.Guid subscriptionId, string resourceGroupName, string workspaceName, string name, DataStore dto = default(DataStore), bool?createIfNotExists = false, bool?skipValidation = false, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.UpdateWithHttpMessagesAsync(subscriptionId, resourceGroupName, workspaceName, name, dto, createIfNotExists, skipValidation, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Gets all the data stores/repositories in the given resource. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> public static IPage <DataStore> ListByDataManagerNext(this IDataStoresOperations operations, string nextPageLink) { return(operations.ListByDataManagerNextAsync(nextPageLink).GetAwaiter().GetResult()); }
/// <summary> /// This method deletes the given data store/repository. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='dataStoreName'> /// The data store/repository name to be deleted. /// </param> /// <param name='resourceGroupName'> /// The Resource Group Name /// </param> /// <param name='dataManagerName'> /// The name of the DataManager Resource within the specified resource group. /// DataManager names must be between 3 and 24 characters in length and use any /// alphanumeric and underscore only /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task BeginDeleteAsync(this IDataStoresOperations operations, string dataStoreName, string resourceGroupName, string dataManagerName, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.BeginDeleteWithHttpMessagesAsync(dataStoreName, resourceGroupName, dataManagerName, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// This method deletes the given data store/repository. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='dataStoreName'> /// The data store/repository name to be deleted. /// </param> /// <param name='resourceGroupName'> /// The Resource Group Name /// </param> /// <param name='dataManagerName'> /// The name of the DataManager Resource within the specified resource group. /// DataManager names must be between 3 and 24 characters in length and use any /// alphanumeric and underscore only /// </param> public static void BeginDelete(this IDataStoresOperations operations, string dataStoreName, string resourceGroupName, string dataManagerName) { operations.BeginDeleteAsync(dataStoreName, resourceGroupName, dataManagerName).GetAwaiter().GetResult(); }
/// <summary> /// Delete a Datastore. /// </summary> /// <remarks> /// Delete a Datastore with a specific name. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='subscriptionId'> /// The Azure Subscription ID. /// </param> /// <param name='resourceGroupName'> /// The Name of the resource group in which the workspace is located. /// </param> /// <param name='workspaceName'> /// The name of the workspace. /// </param> /// <param name='name'> /// The Datastore name. /// </param> public static void Delete(this IDataStoresOperations operations, System.Guid subscriptionId, string resourceGroupName, string workspaceName, string name) { operations.DeleteAsync(subscriptionId, resourceGroupName, workspaceName, name).GetAwaiter().GetResult(); }
/// <summary> /// Creates or updates the data store/repository in the data manager. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='dataStoreName'> /// The data store/repository name to be created or updated. /// </param> /// <param name='dataStore'> /// The data store/repository object to be created or updated. /// </param> /// <param name='resourceGroupName'> /// The Resource Group Name /// </param> /// <param name='dataManagerName'> /// The name of the DataManager Resource within the specified resource group. /// DataManager names must be between 3 and 24 characters in length and use any /// alphanumeric and underscore only /// </param> public static DataStore BeginCreateOrUpdate(this IDataStoresOperations operations, string dataStoreName, DataStore dataStore, string resourceGroupName, string dataManagerName) { return(operations.BeginCreateOrUpdateAsync(dataStoreName, dataStore, resourceGroupName, dataManagerName).GetAwaiter().GetResult()); }
/// <summary> /// Get Datastores list. /// </summary> /// <remarks> /// Get the list of Datastores attached to the workspace. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='subscriptionId'> /// The Azure Subscription ID. /// </param> /// <param name='resourceGroupName'> /// The Name of the resource group in which the workspace is located. /// </param> /// <param name='workspaceName'> /// The name of the workspace. /// </param> /// <param name='dataStoreNames'> /// List of Datastore names. /// </param> /// <param name='continuationToken'> /// The Continuation Token. /// </param> /// <param name='count'> /// Count of Datastores to be returned. /// </param> /// <param name='includeSecret'> /// Whether to include the datastore secret in the response. /// </param> public static IPage <DataStore> List(this IDataStoresOperations operations, System.Guid subscriptionId, string resourceGroupName, string workspaceName, IList <string> dataStoreNames = default(IList <string>), string continuationToken = default(string), int?count = 30, bool?includeSecret = true) { return(operations.ListAsync(subscriptionId, resourceGroupName, workspaceName, dataStoreNames, continuationToken, count, includeSecret).GetAwaiter().GetResult()); }
/// <summary> /// Set a default Datastore. /// </summary> /// <remarks> /// Set a default Datastore in the workspace. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='subscriptionId'> /// The Azure Subscription ID. /// </param> /// <param name='resourceGroupName'> /// The Name of the resource group in which the workspace is located. /// </param> /// <param name='workspaceName'> /// The name of the workspace. /// </param> /// <param name='name'> /// The Datastore name. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task SetDefaultAsync(this IDataStoresOperations operations, System.Guid subscriptionId, string resourceGroupName, string workspaceName, string name, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.SetDefaultWithHttpMessagesAsync(subscriptionId, resourceGroupName, workspaceName, name, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Get the default Datastore. /// </summary> /// <remarks> /// Get the default Datastore in the workspace. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='subscriptionId'> /// The Azure Subscription ID. /// </param> /// <param name='resourceGroupName'> /// The Name of the resource group in which the workspace is located. /// </param> /// <param name='workspaceName'> /// The name of the workspace. /// </param> public static DataStore GetDefault(this IDataStoresOperations operations, System.Guid subscriptionId, string resourceGroupName, string workspaceName) { return(operations.GetDefaultAsync(subscriptionId, resourceGroupName, workspaceName).GetAwaiter().GetResult()); }