/// <summary>
 /// Invoke a command on the website's VM.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.WebSitesExtensions.ICommandsOperations.
 /// </param>
 /// <param name='parameters'>
 /// Required. The invoke command parameters.
 /// </param>
 /// <returns>
 /// The invoke command operation response.
 /// </returns>
 public static InvokeCommandResponse Invoke(this ICommandsOperations operations, InvokeCommandParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((ICommandsOperations)s).InvokeAsync(parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the WebSiteExtensionsClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public WebSiteExtensionsClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._commands          = new CommandsOperations(this);
     this._continuousWebJobs = new ContinuousWebJobOperations(this);
     this._deployments       = new DeploymentOperations(this);
     this._diagnostics       = new DiagnosticOperations(this);
     this._repository        = new RepositoryOperations(this);
     this._settings          = new SettingsOperations(this);
     this._triggeredWebJobs  = new TriggeredWebJobOperations(this);
     this._apiVersion        = "2";
     this._longRunningOperationInitialTimeout = -1;
     this._longRunningOperationRetryTimeout   = -1;
     this.HttpClient.Timeout = TimeSpan.FromSeconds(300);
 }
 /// <summary>
 /// Invoke a command on the website's VM.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.WebSitesExtensions.ICommandsOperations.
 /// </param>
 /// <param name='parameters'>
 /// Required. The invoke command parameters.
 /// </param>
 /// <returns>
 /// The invoke command operation response.
 /// </returns>
 public static Task <InvokeCommandResponse> InvokeAsync(this ICommandsOperations operations, InvokeCommandParameters parameters)
 {
     return(operations.InvokeAsync(parameters, CancellationToken.None));
 }