/// <summary> /// gets tab completion values for a command. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The resource group name uniquely identifies the resource group within the /// user subscriptionId. /// </param> /// <param name='nodeName'> /// The node name (256 characters maximum). /// </param> /// <param name='session'> /// The sessionId from the user /// </param> /// <param name='pssession'> /// The PowerShell sessionId from the user /// </param> /// <param name='command'> /// Command to get tab completion for. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <PowerShellTabCompletionResults> TabCompletionAsync(this IPowerShellOperations operations, string resourceGroupName, string nodeName, string session, string pssession, string command = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.TabCompletionWithHttpMessagesAsync(resourceGroupName, nodeName, session, pssession, command, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets a list of the active sessions. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The resource group name uniquely identifies the resource group within the /// user subscriptionId. /// </param> /// <param name='nodeName'> /// The node name (256 characters maximum). /// </param> /// <param name='session'> /// The sessionId from the user /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <PowerShellSessionResources> ListSessionAsync(this IPowerShellOperations operations, string resourceGroupName, string nodeName, string session, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListSessionWithHttpMessagesAsync(resourceGroupName, nodeName, session, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// updates a running PowerShell command with more data. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The resource group name uniquely identifies the resource group within the /// user subscriptionId. /// </param> /// <param name='nodeName'> /// The node name (256 characters maximum). /// </param> /// <param name='session'> /// The sessionId from the user /// </param> /// <param name='pssession'> /// The PowerShell sessionId from the user /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <PowerShellCommandResults> BeginUpdateCommandAsync(this IPowerShellOperations operations, string resourceGroupName, string nodeName, string session, string pssession, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginUpdateCommandWithHttpMessagesAsync(resourceGroupName, nodeName, session, pssession, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets the status of a command. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The resource group name uniquely identifies the resource group within the /// user subscriptionId. /// </param> /// <param name='nodeName'> /// The node name (256 characters maximum). /// </param> /// <param name='session'> /// The sessionId from the user /// </param> /// <param name='pssession'> /// The PowerShell sessionId from the user /// </param> /// <param name='expand'> /// Gets current output from an ongoing call. Possible values include: 'output' /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <PowerShellCommandStatus> GetCommandStatusAsync(this IPowerShellOperations operations, string resourceGroupName, string nodeName, string session, string pssession, PowerShellExpandOption?expand = default(PowerShellExpandOption?), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetCommandStatusWithHttpMessagesAsync(resourceGroupName, nodeName, session, pssession, expand, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Initializes client properties. /// </summary> private void Initialize() { this.Gateway = new GatewayOperations(this); this.Node = new NodeOperations(this); this.Session = new SessionOperations(this); this.PowerShell = new PowerShellOperations(this); this.BaseUri = new System.Uri("https://management.azure.com"); this.ApiVersion = "2016-07-01-preview"; this.AcceptLanguage = "en-US"; this.LongRunningOperationRetryTimeout = 30; this.GenerateClientRequestId = true; SerializationSettings = new Newtonsoft.Json.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 Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), Converters = new System.Collections.Generic.List <Newtonsoft.Json.JsonConverter> { new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), Converters = new System.Collections.Generic.List <Newtonsoft.Json.JsonConverter> { new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; CustomInitialize(); DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); }
/// <summary> /// Creates a PowerShell session /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The resource group name uniquely identifies the resource group within the /// user subscriptionId. /// </param> /// <param name='nodeName'> /// The node name (256 characters maximum). /// </param> /// <param name='session'> /// The sessionId from the user /// </param> /// <param name='pssession'> /// The PowerShell sessionId from the user /// </param> public static PowerShellSessionResource CreateSession(this IPowerShellOperations operations, string resourceGroupName, string nodeName, string session, string pssession) { return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IPowerShellOperations)s).CreateSessionAsync(resourceGroupName, nodeName, session, pssession), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Creates a PowerShell script and invokes it. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The resource group name uniquely identifies the resource group within the /// user subscriptionId. /// </param> /// <param name='nodeName'> /// The node name (256 characters maximum). /// </param> /// <param name='session'> /// The sessionId from the user /// </param> /// <param name='pssession'> /// The PowerShell sessionId from the user /// </param> /// <param name='command'> /// Script to execute /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async System.Threading.Tasks.Task <PowerShellCommandResults> BeginInvokeCommandAsync(this IPowerShellOperations operations, string resourceGroupName, string nodeName, string session, string pssession, string command = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.BeginInvokeCommandWithHttpMessagesAsync(resourceGroupName, nodeName, session, pssession, command, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Creates a PowerShell script and invokes it. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The resource group name uniquely identifies the resource group within the /// user subscriptionId. /// </param> /// <param name='nodeName'> /// The node name (256 characters maximum). /// </param> /// <param name='session'> /// The sessionId from the user /// </param> /// <param name='pssession'> /// The PowerShell sessionId from the user /// </param> /// <param name='command'> /// Script to execute /// </param> public static PowerShellCommandResults BeginInvokeCommand(this IPowerShellOperations operations, string resourceGroupName, string nodeName, string session, string pssession, string command = default(string)) { return(System.Threading.Tasks.Task.Factory.StartNew(s => ((IPowerShellOperations)s).BeginInvokeCommandAsync(resourceGroupName, nodeName, session, pssession, command), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Creates a PowerShell session /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The resource group name uniquely identifies the resource group within the /// user subscriptionId. /// </param> /// <param name='nodeName'> /// The node name (256 characters maximum). /// </param> /// <param name='session'> /// The sessionId from the user /// </param> /// <param name='pssession'> /// The PowerShell sessionId from the user /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async System.Threading.Tasks.Task <PowerShellSessionResource> CreateSessionAsync(this IPowerShellOperations operations, string resourceGroupName, string nodeName, string session, string pssession, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { using (var _result = await operations.CreateSessionWithHttpMessagesAsync(resourceGroupName, nodeName, session, pssession, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// gets tab completion values for a command. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The resource group name uniquely identifies the resource group within the /// user subscriptionId. /// </param> /// <param name='nodeName'> /// The node name (256 characters maximum). /// </param> /// <param name='session'> /// The sessionId from the user /// </param> /// <param name='pssession'> /// The PowerShell sessionId from the user /// </param> /// <param name='command'> /// Command to get tab completion for. /// </param> public static PowerShellTabCompletionResults TabCompletion(this IPowerShellOperations operations, string resourceGroupName, string nodeName, string session, string pssession, string command = default(string)) { return(Task.Factory.StartNew(s => ((IPowerShellOperations)s).TabCompletionAsync(resourceGroupName, nodeName, session, pssession, command), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Cancels a PowerShell command. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The resource group name uniquely identifies the resource group within the /// user subscriptionId. /// </param> /// <param name='nodeName'> /// The node name (256 characters maximum). /// </param> /// <param name='session'> /// The sessionId from the user /// </param> /// <param name='pssession'> /// The PowerShell sessionId from the user /// </param> public static PowerShellCommandResults BeginCancelCommand(this IPowerShellOperations operations, string resourceGroupName, string nodeName, string session, string pssession) { return(Task.Factory.StartNew(s => ((IPowerShellOperations)s).BeginCancelCommandAsync(resourceGroupName, nodeName, session, pssession), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Gets the status of a command. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The resource group name uniquely identifies the resource group within the /// user subscriptionId. /// </param> /// <param name='nodeName'> /// The node name (256 characters maximum). /// </param> /// <param name='session'> /// The sessionId from the user /// </param> /// <param name='pssession'> /// The PowerShell sessionId from the user /// </param> /// <param name='expand'> /// Gets current output from an ongoing call. Possible values include: 'output' /// </param> public static PowerShellCommandStatus GetCommandStatus(this IPowerShellOperations operations, string resourceGroupName, string nodeName, string session, string pssession, PowerShellExpandOption?expand = default(PowerShellExpandOption?)) { return(Task.Factory.StartNew(s => ((IPowerShellOperations)s).GetCommandStatusAsync(resourceGroupName, nodeName, session, pssession, expand), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }