/// <summary> /// Gets the virtual machine details /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='userName'> /// The name of the user. /// </param> /// <param name='environmentOperationsPayload'> /// Represents payload for any Environment operations like get, start, stop, /// connect /// </param> /// <param name='expand'> /// Specify the $expand query. Example: 'properties($expand=environment)' /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <GetEnvironmentResponse> GetEnvironmentAsync(this IGlobalUsersOperations operations, string userName, EnvironmentOperationsPayload environmentOperationsPayload, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetEnvironmentWithHttpMessagesAsync(userName, environmentOperationsPayload, expand, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Stops an environment by stopping all resources inside the environment This /// operation can take a while to complete /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='userName'> /// The name of the user. /// </param> /// <param name='environmentOperationsPayload'> /// Represents payload for any Environment operations like get, start, stop, /// connect /// </param> public static void BeginStopEnvironment(this IGlobalUsersOperations operations, string userName, EnvironmentOperationsPayload environmentOperationsPayload) { operations.BeginStopEnvironmentAsync(userName, environmentOperationsPayload).GetAwaiter().GetResult(); }
/// <summary> /// Stops an environment by stopping all resources inside the environment This /// operation can take a while to complete /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='userName'> /// The name of the user. /// </param> /// <param name='environmentOperationsPayload'> /// Represents payload for any Environment operations like get, start, stop, /// connect /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task BeginStopEnvironmentAsync(this IGlobalUsersOperations operations, string userName, EnvironmentOperationsPayload environmentOperationsPayload, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.BeginStopEnvironmentWithHttpMessagesAsync(userName, environmentOperationsPayload, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Gets the virtual machine details /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='userName'> /// The name of the user. /// </param> /// <param name='environmentOperationsPayload'> /// Represents payload for any Environment operations like get, start, stop, /// connect /// </param> /// <param name='expand'> /// Specify the $expand query. Example: 'properties($expand=environment)' /// </param> public static GetEnvironmentResponse GetEnvironment(this IGlobalUsersOperations operations, string userName, EnvironmentOperationsPayload environmentOperationsPayload, string expand = default(string)) { return(operations.GetEnvironmentAsync(userName, environmentOperationsPayload, expand).GetAwaiter().GetResult()); }