Пример #1
0
 /// <summary>
 /// Create or update an ComputeType.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.DataFactories.IComputeTypeOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The resource group name of the data factory.
 /// </param>
 /// <param name='dataFactoryName'>
 /// Required. The name of the data factory.
 /// </param>
 /// <param name='parameters'>
 /// Required. The parameters required to create or update an
 /// ComputeType definition.
 /// </param>
 /// <returns>
 /// The create or update ComputeType operation response.
 /// </returns>
 public static Task <ComputeTypeCreateOrUpdateResponse> CreateOrUpdateAsync(
     this IComputeTypeOperations operations,
     string resourceGroupName,
     string dataFactoryName,
     ComputeTypeCreateOrUpdateParameters parameters)
 {
     return(operations.CreateOrUpdateAsync(
                resourceGroupName,
                dataFactoryName,
                parameters,
                CancellationToken.None));
 }
Пример #2
0
 /// <summary>
 /// Create or update an ComputeType.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.DataFactories.IComputeTypeOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The resource group name of the data factory.
 /// </param>
 /// <param name='dataFactoryName'>
 /// Required. The name of the data factory.
 /// </param>
 /// <param name='parameters'>
 /// Required. The parameters required to create or update an
 /// ComputeType definition.
 /// </param>
 /// <returns>
 /// The create or update ComputeType operation response.
 /// </returns>
 public static ComputeTypeCreateOrUpdateResponse CreateOrUpdate(
     this IComputeTypeOperations operations,
     string resourceGroupName,
     string dataFactoryName,
     ComputeTypeCreateOrUpdateParameters parameters)
 {
     return(Task.Factory.StartNew(
                s =>
                ((IComputeTypeOperations)s).CreateOrUpdateAsync(resourceGroupName, dataFactoryName, parameters),
                operations,
                CancellationToken.None,
                TaskCreationOptions.None,
                TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Пример #3
0
        public async Task <ComputeTypeCreateOrUpdateResponse> CreateOrUpdateAsync(
            string resourceGroupName,
            string dataFactoryName,
            ComputeTypeCreateOrUpdateParameters parameters,
            CancellationToken cancellationToken)
        {
            Ensure.IsNotNull(parameters, "parameters");
            Ensure.IsNotNull(parameters.ComputeType, "parameters.ComputeType");

            Core.Registration.Models.ComputeType internalComputeType = this.Converter.ToCoreType(parameters.ComputeType);

            Core.Registration.Models.ComputeTypeCreateOrUpdateResponse response =
                await this.Client.InternalClient.ComputeTypes.CreateOrUpdateAsync(
                    resourceGroupName,
                    dataFactoryName,
                    new Core.Registration.Models.ComputeTypeCreateOrUpdateParameters(internalComputeType));

            return(new ComputeTypeCreateOrUpdateResponse(response, this.Client));
        }