/// <summary> /// Fetches all the resources of the specified type in the subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <Vault> > ListBySubscriptionIdAsync(this IVaultsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListBySubscriptionIdWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Retrieve a list of Vaults. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group where the recovery services vault is /// present. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <Vault> > ListByResourceGroupAsync(this IVaultsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Updates the vault. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group where the recovery services vault is /// present. /// </param> /// <param name='vaultName'> /// The name of the recovery services vault. /// </param> /// <param name='vault'> /// Recovery Services Vault to be created. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Vault> BeginUpdateAsync(this IVaultsOperations operations, string resourceGroupName, string vaultName, PatchVault vault, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, vaultName, vault, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// The List operation gets information about the vaults associated with the /// subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='top'> /// Maximum number of results to return. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <Resource> > ListAsync(this IVaultsOperations operations, int?top = default(int?), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(top, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// The List operation gets information about the vaults associated with the /// subscription. /// </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 <VaultInner> > ListNextAsync(this IVaultsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Create or update a key vault in the specified subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the Resource Group to which the server belongs. /// </param> /// <param name='vaultName'> /// Name of the vault /// </param> /// <param name='parameters'> /// Parameters to create or update the vault /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <VaultInner> CreateOrUpdateAsync(this IVaultsOperations operations, string resourceGroupName, string vaultName, VaultCreateOrUpdateParametersInner parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vaultName, parameters, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets the deleted Azure key vault. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='vaultName'> /// The name of the vault. /// </param> /// <param name='location'> /// The location of the deleted vault. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <DeletedVaultInner> GetDeletedAsync(this IVaultsOperations operations, string vaultName, string location, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetDeletedWithHttpMessagesAsync(vaultName, location, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { Operations = new Operations(this); NetAppResource = new NetAppResourceOperations(this); Accounts = new AccountsOperations(this); Pools = new PoolsOperations(this); Volumes = new VolumesOperations(this); Snapshots = new SnapshotsOperations(this); SnapshotPolicies = new SnapshotPoliciesOperations(this); VolumeBackupStatus = new VolumeBackupStatusOperations(this); AccountBackups = new AccountBackupsOperations(this); Backups = new BackupsOperations(this); BackupPolicies = new BackupPoliciesOperations(this); Vaults = new VaultsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); ApiVersion = "2020-12-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> /// Initializes client properties. /// </summary> private void Initialize() { this.Vaults = new VaultsOperations(this); this.BaseUri = new Uri("https://management.azure.com"); this.ApiVersion = "2015-06-01"; this.AcceptLanguage = "en-US"; this.LongRunningOperationRetryTimeout = 30; this.GenerateClientRequestId = true; SerializationSettings = new JsonSerializerSettings { Formatting = Formatting.Indented, DateFormatHandling = DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = DateTimeZoneHandling.Utc, NullValueHandling = NullValueHandling.Ignore, ReferenceLoopHandling = ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; DeserializationSettings = new JsonSerializerSettings { DateFormatHandling = DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = DateTimeZoneHandling.Utc, NullValueHandling = NullValueHandling.Ignore, ReferenceLoopHandling = ReferenceLoopHandling.Serialize, ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new List <JsonConverter> { new Iso8601TimeSpanConverter() } }; CustomInitialize(); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); }
/// <summary> /// List vaults /// </summary> /// <remarks> /// List vaults for a Netapp Account /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='accountName'> /// The name of the NetApp account /// </param> public static IEnumerable <Vault> List(this IVaultsOperations operations, string resourceGroupName, string accountName) { return(operations.ListAsync(resourceGroupName, accountName).GetAwaiter().GetResult()); }
/// <summary> /// The List operation gets information about the vaults associated with the /// subscription. /// </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 <Microsoft.Azure.Management.ResourceManager.Fluent.Resource> > ListNextAsync(this IVaultsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Update a key vault in the specified subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the Resource Group to which the server belongs. /// </param> /// <param name='vaultName'> /// Name of the vault /// </param> /// <param name='parameters'> /// Parameters to patch the vault /// </param> public static Vault Update(this IVaultsOperations operations, string resourceGroupName, string vaultName, VaultPatchParameters parameters) { return(operations.UpdateAsync(resourceGroupName, vaultName, parameters).GetAwaiter().GetResult()); }
/// <summary> /// Updates the vault. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group where the recovery services vault is /// present. /// </param> /// <param name='vaultName'> /// The name of the recovery services vault. /// </param> /// <param name='vault'> /// Recovery Services Vault to be created. /// </param> public static Vault BeginUpdate(this IVaultsOperations operations, string resourceGroupName, string vaultName, PatchVault vault) { return(operations.BeginUpdateAsync(resourceGroupName, vaultName, vault).GetAwaiter().GetResult()); }
/// <summary> /// Deletes a vault. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group where the recovery services vault is /// present. /// </param> /// <param name='vaultName'> /// The name of the recovery services vault. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task DeleteAsync(this IVaultsOperations operations, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vaultName, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Update access policies in a key vault in the specified subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the Resource Group to which the vault belongs. /// </param> /// <param name='vaultName'> /// Name of the vault /// </param> /// <param name='operationKind'> /// Name of the operation. Possible values include: 'add', 'replace', 'remove' /// </param> /// <param name='properties'> /// Properties of the access policy /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <VaultAccessPolicyParametersInner> UpdateAccessPolicyAsync(this IVaultsOperations operations, string resourceGroupName, string vaultName, AccessPolicyUpdateKind operationKind, VaultAccessPolicyPropertiesInner properties, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UpdateAccessPolicyWithHttpMessagesAsync(resourceGroupName, vaultName, operationKind, properties, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Deletes the specified Azure key vault. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the Resource Group to which the vault belongs. /// </param> /// <param name='vaultName'> /// The name of the vault to delete /// </param> public static void Delete(this IVaultsOperations operations, string resourceGroupName, string vaultName) { Task.Factory.StartNew(s => ((IVaultsOperations)s).DeleteAsync(resourceGroupName, vaultName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); }
/// <summary> /// Create or update a key vault in the specified subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the Resource Group to which the server belongs. /// </param> /// <param name='vaultName'> /// Name of the vault /// </param> /// <param name='parameters'> /// Parameters to create or update the vault /// </param> public static Vault CreateOrUpdate(this IVaultsOperations operations, string resourceGroupName, string vaultName, VaultCreateOrUpdateParameters parameters) { return(Task.Factory.StartNew(s => ((IVaultsOperations)s).CreateOrUpdateAsync(resourceGroupName, vaultName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// The List operation gets information about the vaults associated with the /// subscription. /// </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 <Vault> ListNext(this IVaultsOperations operations, string nextPageLink) { return(Task.Factory.StartNew(s => ((IVaultsOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// The List operation gets information about the vaults associated with the /// subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='top'> /// Maximum number of results to return. /// </param> public static IPage <Vault> List(this IVaultsOperations operations, int?top = default(int?)) { return(Task.Factory.StartNew(s => ((IVaultsOperations)s).ListAsync(top), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Get the Vault details. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group where the recovery services vault is /// present. /// </param> /// <param name='vaultName'> /// The name of the recovery services vault. /// </param> public static Vault Get(this IVaultsOperations operations, string resourceGroupName, string vaultName) { return(operations.GetAsync(resourceGroupName, vaultName).GetAwaiter().GetResult()); }
/// <summary> /// Deletes a vault. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group where the recovery services vault is /// present. /// </param> /// <param name='vaultName'> /// The name of the recovery services vault. /// </param> public static void Delete(this IVaultsOperations operations, string resourceGroupName, string vaultName) { operations.DeleteAsync(resourceGroupName, vaultName).GetAwaiter().GetResult(); }
/// <summary> /// Retrieve a list of Vaults. /// </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 <Vault> ListByResourceGroupNext(this IVaultsOperations operations, string nextPageLink) { return(operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult()); }
/// <summary> /// Fetches all the resources of the specified type in the subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> public static IPage <Vault> ListBySubscriptionId(this IVaultsOperations operations) { return(operations.ListBySubscriptionIdAsync().GetAwaiter().GetResult()); }
/// <summary> /// Permanently deletes the specified vault. aka Purges the deleted Azure key /// vault. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='vaultName'> /// The name of the soft-deleted vault. /// </param> /// <param name='location'> /// The location of the soft-deleted vault. /// </param> public static void BeginPurgeDeleted(this IVaultsOperations operations, string vaultName, string location) { operations.BeginPurgeDeletedAsync(vaultName, location).GetAwaiter().GetResult(); }
/// <summary> /// Retrieve a list of Vaults. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group where the recovery services vault is /// present. /// </param> public static IPage <Vault> ListByResourceGroup(this IVaultsOperations operations, string resourceGroupName) { return(operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult()); }
/// <summary> /// Gets information about the deleted vaults in a subscription. /// </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 <DeletedVault> ListDeletedNext(this IVaultsOperations operations, string nextPageLink) { return(operations.ListDeletedNextAsync(nextPageLink).GetAwaiter().GetResult()); }
/// <summary> /// Checks that the vault name is valid and is not already in use. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='name'> /// The vault name. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <CheckNameAvailabilityResultInner> CheckNameAvailabilityAsync(this IVaultsOperations operations, string name, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CheckNameAvailabilityWithHttpMessagesAsync(name, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Checks that the vault name is valid and is not already in use. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='vaultName'> /// The name of the vault. /// </param> public static CheckNameAvailabilityResult CheckNameAvailability(this IVaultsOperations operations, VaultCheckNameAvailabilityParameters vaultName) { return(operations.CheckNameAvailabilityAsync(vaultName).GetAwaiter().GetResult()); }
/// <summary> /// Permanently deletes the specified vault. aka Purges the deleted Azure key /// vault. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='vaultName'> /// The name of the soft-deleted vault. /// </param> /// <param name='location'> /// The location of the soft-deleted vault. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task BeginPurgeDeletedAsync(this IVaultsOperations operations, string vaultName, string location, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.BeginPurgeDeletedWithHttpMessagesAsync(vaultName, location, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// The List operation gets information about the vaults associated with the /// subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='top'> /// Maximum number of results to return. /// </param> public static IPage <Resource> List(this IVaultsOperations operations, int?top = default(int?)) { return(operations.ListAsync(top).GetAwaiter().GetResult()); }