/// <summary> /// Creates or updates a service unit under the service in the service /// topology. /// </summary> /// <remarks> /// This is an asynchronous operation and can be polled to completion using the /// operation resource returned by this operation. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='serviceTopologyName'> /// The name of the service topology . /// </param> /// <param name='serviceName'> /// The name of the service resource. /// </param> /// <param name='serviceUnitName'> /// The name of the service unit resource. /// </param> /// <param name='serviceUnitInfo'> /// The service unit resource object. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <ServiceUnitResource> CreateOrUpdateAsync(this IServiceUnitsOperations operations, string resourceGroupName, string serviceTopologyName, string serviceName, string serviceUnitName, ServiceUnitResource serviceUnitInfo, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceTopologyName, serviceName, serviceUnitName, serviceUnitInfo, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Creates or updates a service unit under the service in the service /// topology. /// </summary> /// <remarks> /// This is an asynchronous operation and can be polled to completion using the /// operation resource returned by this operation. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='serviceTopologyName'> /// The name of the service topology . /// </param> /// <param name='serviceName'> /// The name of the service resource. /// </param> /// <param name='serviceUnitName'> /// The name of the service unit resource. /// </param> /// <param name='serviceUnitInfo'> /// The service unit resource object. /// </param> public static ServiceUnitResource CreateOrUpdate(this IServiceUnitsOperations operations, string resourceGroupName, string serviceTopologyName, string serviceName, string serviceUnitName, ServiceUnitResource serviceUnitInfo) { return(operations.CreateOrUpdateAsync(resourceGroupName, serviceTopologyName, serviceName, serviceUnitName, serviceUnitInfo).GetAwaiter().GetResult()); }
/// <summary> /// Deletes the service unit. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='serviceTopologyName'> /// The name of the service topology . /// </param> /// <param name='serviceName'> /// The name of the service resource. /// </param> /// <param name='serviceUnitName'> /// The name of the service unit resource. /// </param> public static void Delete(this IServiceUnitsOperations operations, string resourceGroupName, string serviceTopologyName, string serviceName, string serviceUnitName) { operations.DeleteAsync(resourceGroupName, serviceTopologyName, serviceName, serviceUnitName).GetAwaiter().GetResult(); }
/// <summary> /// Deletes the service unit. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='serviceTopologyName'> /// The name of the service topology . /// </param> /// <param name='serviceName'> /// The name of the service resource. /// </param> /// <param name='serviceUnitName'> /// The name of the service unit resource. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task DeleteAsync(this IServiceUnitsOperations operations, string resourceGroupName, string serviceTopologyName, string serviceName, string serviceUnitName, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serviceTopologyName, serviceName, serviceUnitName, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Gets the service unit. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='serviceTopologyName'> /// The name of the service topology . /// </param> /// <param name='serviceName'> /// The name of the service resource. /// </param> /// <param name='serviceUnitName'> /// The name of the service unit resource. /// </param> public static ServiceUnitResource Get(this IServiceUnitsOperations operations, string resourceGroupName, string serviceTopologyName, string serviceName, string serviceUnitName) { return(operations.GetAsync(resourceGroupName, serviceTopologyName, serviceName, serviceUnitName).GetAwaiter().GetResult()); }