/// <summary> /// Creates or updates a secret resource. /// </summary> /// <remarks> /// Creates a secret resource with the specified name, description and /// properties. If a secret resource with the same name exists, then it is /// updated with the specified description and properties. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Azure resource group name /// </param> /// <param name='secretResourceName'> /// The name of the secret resource. /// </param> /// <param name='secretResourceDescription'> /// Description for creating a secret resource. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <SecretResourceDescription> CreateAsync(this ISecretOperations operations, string resourceGroupName, string secretResourceName, SecretResourceDescription secretResourceDescription, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, secretResourceName, secretResourceDescription, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets a secret /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.KeyVault.Internal.ISecretOperations. /// </param> /// <param name='secretIdentifier'> /// Required. /// </param> /// <returns> /// Represents the response to a secret operation request. /// </returns> public static SecretResponseMessageWithRawJsonContent Get(this ISecretOperations operations, string secretIdentifier) { return(Task.Factory.StartNew((object s) => { return ((ISecretOperations)s).GetAsync(secretIdentifier); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// List the versions of a secret in the specified vault /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.KeyVault.Internal.ISecretOperations. /// </param> /// <param name='vault'> /// Required. /// </param> /// <param name='secretName'> /// Required. /// </param> /// <param name='top'> /// Required. /// </param> /// <returns> /// Represents the response to a secret operation request. /// </returns> public static SecretResponseMessageWithRawJsonContent ListVersions(this ISecretOperations operations, string vault, string secretName, int?top) { return(Task.Factory.StartNew((object s) => { return ((ISecretOperations)s).ListVersionsAsync(vault, secretName, top); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Initializes a new instance of the KeyVaultInternalClient class. /// </summary> /// <param name='httpClient'> /// The Http client /// </param> public KeyVaultInternalClient(HttpClient httpClient) : base(httpClient) { this._keys = new KeyOperations(this); this._secrets = new SecretOperations(this); this._apiVersion = "2015-06-01"; this._longRunningOperationInitialTimeout = -1; this._longRunningOperationRetryTimeout = -1; this.HttpClient.Timeout = TimeSpan.FromSeconds(300); }
/// <summary> /// Delete the specified secret /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.KeyVault.Internal.ISecretOperations. /// </param> /// <param name='secretIdentifier'> /// Required. /// </param> /// <returns> /// Represents the response to a secret operation request. /// </returns> public static Task <SecretResponseMessageWithRawJsonContent> DeleteAsync(this ISecretOperations operations, string secretIdentifier) { return(operations.DeleteAsync(secretIdentifier, CancellationToken.None)); }
/// <summary> /// Update the specified secret /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.KeyVault.Internal.ISecretOperations. /// </param> /// <param name='secretIdentifier'> /// Required. /// </param> /// <param name='request'> /// Required. /// </param> /// <returns> /// Represents the response to a secret operation request. /// </returns> public static Task <SecretResponseMessageWithRawJsonContent> UpdateAsync(this ISecretOperations operations, string secretIdentifier, SecretRequestMessageWithRawJsonContent request) { return(operations.UpdateAsync(secretIdentifier, request, CancellationToken.None)); }
/// <summary> /// List the versions of a secret in the specified vault /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.KeyVault.Internal.ISecretOperations. /// </param> /// <param name='nextLink'> /// Required. /// </param> /// <returns> /// Represents the response to a secret operation request. /// </returns> public static Task <SecretResponseMessageWithRawJsonContent> ListVersionsNextAsync(this ISecretOperations operations, string nextLink) { return(operations.ListVersionsNextAsync(nextLink, CancellationToken.None)); }
/// <summary> /// List the versions of a secret in the specified vault /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.KeyVault.Internal.ISecretOperations. /// </param> /// <param name='vault'> /// Required. /// </param> /// <param name='secretName'> /// Required. /// </param> /// <param name='top'> /// Required. /// </param> /// <returns> /// Represents the response to a secret operation request. /// </returns> public static Task <SecretResponseMessageWithRawJsonContent> ListVersionsAsync(this ISecretOperations operations, string vault, string secretName, int?top) { return(operations.ListVersionsAsync(vault, secretName, top, CancellationToken.None)); }
/// <summary> /// Gets the secret resource with the given name. /// </summary> /// <remarks> /// Gets the information about the secret resource with the given name. The /// information include the description and other properties of the secret. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Azure resource group name /// </param> /// <param name='secretResourceName'> /// The name of the secret resource. /// </param> public static SecretResourceDescription Get(this ISecretOperations operations, string resourceGroupName, string secretResourceName) { return(operations.GetAsync(resourceGroupName, secretResourceName).GetAwaiter().GetResult()); }
/// <summary> /// Gets all the secret resources in a given subscription. /// </summary> /// <remarks> /// Gets the information about all secret resources in a given resource group. /// The information include the description and other properties of the secret. /// </remarks> /// <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 <SecretResourceDescription> > ListBySubscriptionNextAsync(this ISecretOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets all the secret resources in a given subscription. /// </summary> /// <remarks> /// Gets the information about all secret resources in a given resource group. /// The information include the description and other properties of the secret. /// </remarks> /// <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 <SecretResourceDescription> ListBySubscriptionNext(this ISecretOperations operations, string nextPageLink) { return(operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult()); }
/// <summary> /// Gets all the secret resources in a given subscription. /// </summary> /// <remarks> /// Gets the information about all secret resources in a given resource group. /// The information include the description and other properties of the secret. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> public static IPage <SecretResourceDescription> ListBySubscription(this ISecretOperations operations) { return(operations.ListBySubscriptionAsync().GetAwaiter().GetResult()); }
/// <summary> /// Gets all the secret resources in a given resource group. /// </summary> /// <remarks> /// Gets the information about all secret resources in a given resource group. /// The information include the description and other properties of the Secret. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Azure resource group name /// </param> public static IPage <SecretResourceDescription> ListByResourceGroup(this ISecretOperations operations, string resourceGroupName) { return(operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult()); }
/// <summary> /// Deletes the secret resource. /// </summary> /// <remarks> /// Deletes the secret resource identified by the name. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Azure resource group name /// </param> /// <param name='secretResourceName'> /// The name of the secret resource. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task DeleteAsync(this ISecretOperations operations, string resourceGroupName, string secretResourceName, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, secretResourceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Deletes the secret resource. /// </summary> /// <remarks> /// Deletes the secret resource identified by the name. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// Azure resource group name /// </param> /// <param name='secretResourceName'> /// The name of the secret resource. /// </param> public static void Delete(this ISecretOperations operations, string resourceGroupName, string secretResourceName) { operations.DeleteAsync(resourceGroupName, secretResourceName).GetAwaiter().GetResult(); }