/// <summary> /// Creates or updates the storage domain. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='storageDomainName'> /// The storage domain name. /// </param> /// <param name='storageDomain'> /// The storageDomain. /// </param> /// <param name='resourceGroupName'> /// The resource group name /// </param> /// <param name='managerName'> /// The manager name /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <StorageDomain> BeginCreateOrUpdateAsync(this IStorageDomainsOperations operations, string storageDomainName, StorageDomain storageDomain, string resourceGroupName, string managerName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(storageDomainName, storageDomain, resourceGroupName, managerName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Retrieves all the storage domains in a manager. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The resource group name /// </param> /// <param name='managerName'> /// The manager name /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IEnumerable <StorageDomain> > ListByManagerAsync(this IStorageDomainsOperations operations, string resourceGroupName, string managerName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByManagerWithHttpMessagesAsync(resourceGroupName, managerName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { Managers = new ManagersOperations(this); AvailableProviderOperations = new AvailableProviderOperationsOperations(this); AccessControlRecords = new AccessControlRecordsOperations(this); Alerts = new AlertsOperations(this); Backups = new BackupsOperations(this); Devices = new DevicesOperations(this); BackupScheduleGroups = new BackupScheduleGroupsOperations(this); ChapSettings = new ChapSettingsOperations(this); IscsiDisks = new IscsiDisksOperations(this); FileServers = new FileServersOperations(this); FileShares = new FileSharesOperations(this); IscsiServers = new IscsiServersOperations(this); Jobs = new JobsOperations(this); StorageAccountCredentials = new StorageAccountCredentialsOperations(this); StorageDomains = new StorageDomainsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); ApiVersion = "2016-10-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> /// Returns the properties of the specified storage domain name. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='storageDomainName'> /// The storage domain name. /// </param> /// <param name='resourceGroupName'> /// The resource group name /// </param> /// <param name='managerName'> /// The manager name /// </param> public static StorageDomain Get(this IStorageDomainsOperations operations, string storageDomainName, string resourceGroupName, string managerName) { return(operations.GetAsync(storageDomainName, resourceGroupName, managerName).GetAwaiter().GetResult()); }
/// <summary> /// Retrieves all the storage domains in a manager. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The resource group name /// </param> /// <param name='managerName'> /// The manager name /// </param> public static IEnumerable <StorageDomain> ListByManager(this IStorageDomainsOperations operations, string resourceGroupName, string managerName) { return(operations.ListByManagerAsync(resourceGroupName, managerName).GetAwaiter().GetResult()); }
/// <summary> /// Deletes the storage domain. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='storageDomainName'> /// The storage domain name. /// </param> /// <param name='resourceGroupName'> /// The resource group name /// </param> /// <param name='managerName'> /// The manager name /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task BeginDeleteAsync(this IStorageDomainsOperations operations, string storageDomainName, string resourceGroupName, string managerName, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.BeginDeleteWithHttpMessagesAsync(storageDomainName, resourceGroupName, managerName, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Deletes the storage domain. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='storageDomainName'> /// The storage domain name. /// </param> /// <param name='resourceGroupName'> /// The resource group name /// </param> /// <param name='managerName'> /// The manager name /// </param> public static void BeginDelete(this IStorageDomainsOperations operations, string storageDomainName, string resourceGroupName, string managerName) { operations.BeginDeleteAsync(storageDomainName, resourceGroupName, managerName).GetAwaiter().GetResult(); }
/// <summary> /// Creates or updates the storage domain. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='storageDomainName'> /// The storage domain name. /// </param> /// <param name='storageDomain'> /// The storageDomain. /// </param> /// <param name='resourceGroupName'> /// The resource group name /// </param> /// <param name='managerName'> /// The manager name /// </param> public static StorageDomain BeginCreateOrUpdate(this IStorageDomainsOperations operations, string storageDomainName, StorageDomain storageDomain, string resourceGroupName, string managerName) { return(operations.BeginCreateOrUpdateAsync(storageDomainName, storageDomain, resourceGroupName, managerName).GetAwaiter().GetResult()); }