/// <summary>
 /// Gets the script for template image upload. Pass this script Uri and
 /// SAS obtianed from template image Set or Get operations.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.RemoteApp.ITemplateImageOperations.
 /// </param>
 /// <returns>
 /// Definition for result of GetUploadScript operation.
 /// </returns>
 public static UploadScriptResult GetUploadScript(this ITemplateImageOperations operations)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((ITemplateImageOperations)s).GetUploadScriptAsync();
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Ensures storage is ready for the given region. Call this before
 /// uploading an image.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.RemoteApp.ITemplateImageOperations.
 /// </param>
 /// <param name='region'>
 /// Required. Azure datacenter region.
 /// </param>
 /// <returns>
 /// The response containing the operation tracking id.
 /// </returns>
 public static OperationResultWithTrackingId EnsureStorageInRegion(this ITemplateImageOperations operations, string region)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((ITemplateImageOperations)s).EnsureStorageInRegionAsync(region);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Deletes an existing template image.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.RemoteApp.ITemplateImageOperations.
 /// </param>
 /// <param name='imageName'>
 /// Required. The template image name.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static AzureOperationResponse Delete(this ITemplateImageOperations operations, string imageName)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((ITemplateImageOperations)s).DeleteAsync(imageName);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Sets a template image details.  If the template image already
 /// exists, only the Name can be changed.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.RemoteApp.ITemplateImageOperations.
 /// </param>
 /// <param name='imageDetails'>
 /// Required. Details for the template image to be created or updated.
 /// </param>
 /// <returns>
 /// Operation response for TemplateImageOperations.Get.
 /// </returns>
 public static TemplateImageResult Set(this ITemplateImageOperations operations, TemplateImageDetails imageDetails)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((ITemplateImageOperations)s).SetAsync(imageDetails);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
示例#5
0
 /// <summary>
 /// Migrate the template image of a collection to the specified azure
 /// storage account
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.RemoteApp.ITemplateImageOperations.
 /// </param>
 /// <param name='collectionName'>
 /// Required. The collection name.
 /// </param>
 /// <param name='targetAccountName'>
 /// Required. The destination storage account name
 /// </param>
 /// <param name='targetAccountKey'>
 /// Required. The destination storage account key
 /// </param>
 /// <param name='targetContainerName'>
 /// Required. The destination container name
 /// </param>
 /// <param name='overwriteExistingTemplateImage'>
 /// Required. A flag denoting if the request is to overwrite the
 /// existing template image in the destination storage account
 /// </param>
 /// <returns>
 /// The response containing the operation tracking id.
 /// </returns>
 public static OperationResultWithTrackingId Migrate(this ITemplateImageOperations operations, string collectionName, string targetAccountName, string targetAccountKey, string targetContainerName, bool overwriteExistingTemplateImage)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((ITemplateImageOperations)s).MigrateAsync(collectionName, targetAccountName, targetAccountKey, targetContainerName, overwriteExistingTemplateImage);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Initializes a new instance of the RemoteAppManagementClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public RemoteAppManagementClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._account          = new AccountsOperations(this);
     this._collections      = new CollectionOperations(this);
     this._operationResults = new OperationResultOperations(this);
     this._principals       = new PrincipalOperations(this);
     this._publishing       = new PublishingOperations(this);
     this._templateImages   = new TemplateImageOperations(this);
     this._vNet             = new VNetOperations(this);
     this._rdfeNamespace    = "remoteapp";
     this._apiVersion       = "2014-09-01";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
 /// <summary>
 /// Deletes an existing template image.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.RemoteApp.ITemplateImageOperations.
 /// </param>
 /// <param name='imageName'>
 /// Required. The template image name.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <AzureOperationResponse> DeleteAsync(this ITemplateImageOperations operations, string imageName)
 {
     return(operations.DeleteAsync(imageName, CancellationToken.None));
 }
 /// <summary>
 /// Sets a template image details.  If the template image already
 /// exists, only the Name can be changed.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.RemoteApp.ITemplateImageOperations.
 /// </param>
 /// <param name='imageDetails'>
 /// Required. Details for the template image to be created or updated.
 /// </param>
 /// <returns>
 /// Operation response for TemplateImageOperations.Get.
 /// </returns>
 public static Task <TemplateImageResult> SetAsync(this ITemplateImageOperations operations, TemplateImageDetails imageDetails)
 {
     return(operations.SetAsync(imageDetails, CancellationToken.None));
 }
 /// <summary>
 /// Gets a list of template images for the subscription.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.RemoteApp.ITemplateImageOperations.
 /// </param>
 /// <returns>
 /// Operation response for TemplateImageOperations.List.
 /// </returns>
 public static Task <TemplateImageListResult> ListAsync(this ITemplateImageOperations operations)
 {
     return(operations.ListAsync(CancellationToken.None));
 }
 /// <summary>
 /// Gets the script for template image upload. Pass this script Uri and
 /// SAS obtianed from template image Set or Get operations.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.RemoteApp.ITemplateImageOperations.
 /// </param>
 /// <returns>
 /// Definition for result of GetUploadScript operation.
 /// </returns>
 public static Task <UploadScriptResult> GetUploadScriptAsync(this ITemplateImageOperations operations)
 {
     return(operations.GetUploadScriptAsync(CancellationToken.None));
 }
 /// <summary>
 /// Gets details of a template image for the subscription.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.RemoteApp.ITemplateImageOperations.
 /// </param>
 /// <param name='imageName'>
 /// Required. Name of the template image.
 /// </param>
 /// <returns>
 /// Operation response for TemplateImageOperations.Get.
 /// </returns>
 public static Task <TemplateImageResult> GetAsync(this ITemplateImageOperations operations, string imageName)
 {
     return(operations.GetAsync(imageName, CancellationToken.None));
 }
 /// <summary>
 /// Ensures storage is ready for the given region. Call this before
 /// uploading an image.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.RemoteApp.ITemplateImageOperations.
 /// </param>
 /// <param name='region'>
 /// Required. Azure datacenter region.
 /// </param>
 /// <returns>
 /// The response containing the operation tracking id.
 /// </returns>
 public static Task <OperationResultWithTrackingId> EnsureStorageInRegionAsync(this ITemplateImageOperations operations, string region)
 {
     return(operations.EnsureStorageInRegionAsync(region, CancellationToken.None));
 }
示例#13
0
 /// <summary>
 /// Migrate the template image of a collection to the specified azure
 /// storage account
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.RemoteApp.ITemplateImageOperations.
 /// </param>
 /// <param name='collectionName'>
 /// Required. The collection name.
 /// </param>
 /// <param name='targetAccountName'>
 /// Required. The destination storage account name
 /// </param>
 /// <param name='targetAccountKey'>
 /// Required. The destination storage account key
 /// </param>
 /// <param name='targetContainerName'>
 /// Required. The destination container name
 /// </param>
 /// <param name='overwriteExistingTemplateImage'>
 /// Required. A flag denoting if the request is to overwrite the
 /// existing template image in the destination storage account
 /// </param>
 /// <returns>
 /// The response containing the operation tracking id.
 /// </returns>
 public static Task <OperationResultWithTrackingId> MigrateAsync(this ITemplateImageOperations operations, string collectionName, string targetAccountName, string targetAccountKey, string targetContainerName, bool overwriteExistingTemplateImage)
 {
     return(operations.MigrateAsync(collectionName, targetAccountName, targetAccountKey, targetContainerName, overwriteExistingTemplateImage, CancellationToken.None));
 }