CreatePool() public method

Creates a new pool.
public CreatePool ( NewPoolParameters parameters ) : void
parameters NewPoolParameters The parameters to use when creating the pool.
return void
Exemplo n.º 1
0
        /// <summary>
        /// Creates a test pool for use in Scenario tests.
        /// </summary>
        public static void CreateTestPool(BatchController controller, BatchAccountContext context, string poolId, int targetDedicated,
                                          CertificateReference certReference = null, StartTask startTask = null)
        {
            BatchClient client = new BatchClient(controller.BatchManagementClient, controller.ResourceManagementClient);

            PSCertificateReference[] certReferences = null;
            if (certReference != null)
            {
                certReferences = new PSCertificateReference[] { new PSCertificateReference(certReference) };
            }
            PSStartTask psStartTask = null;

            if (startTask != null)
            {
                psStartTask = new PSStartTask(startTask);
            }

            PSCloudServiceConfiguration paasConfiguration = new PSCloudServiceConfiguration("4", "*");

            NewPoolParameters parameters = new NewPoolParameters(context, poolId)
            {
                VirtualMachineSize        = "small",
                CloudServiceConfiguration = paasConfiguration,
                TargetDedicated           = targetDedicated,
                CertificateReferences     = certReferences,
                StartTask = psStartTask,
                InterComputeNodeCommunicationEnabled = true
            };

            client.CreatePool(parameters);
        }
        /// <summary>
        /// Creates a test pool for use in Scenario tests.
        /// </summary>
        public static void CreateTestPool(BatchController controller, BatchAccountContext context, string poolName)
        {
            YieldInjectionInterceptor interceptor = CreateHttpRecordingInterceptor();

            BatchClientBehavior[] behaviors = new BatchClientBehavior[] { interceptor };
            BatchClient           client    = new BatchClient(controller.BatchManagementClient, controller.ResourceManagementClient);

            NewPoolParameters parameters = new NewPoolParameters(context, poolName, behaviors)
            {
                OSFamily        = "4",
                TargetOSVersion = "*",
                TargetDedicated = 1
            };

            client.CreatePool(parameters);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Creates a test pool for use in Scenario tests.
        /// </summary>
        public static void CreateTestPool(BatchController controller, BatchAccountContext context, string poolId, int targetDedicated)
        {
            RequestInterceptor interceptor = CreateHttpRecordingInterceptor();

            BatchClientBehavior[] behaviors = new BatchClientBehavior[] { interceptor };
            BatchClient           client    = new BatchClient(controller.BatchManagementClient, controller.ResourceManagementClient);

            NewPoolParameters parameters = new NewPoolParameters(context, poolId, behaviors)
            {
                VirtualMachineSize = "small",
                OSFamily           = "4",
                TargetOSVersion    = "*",
                TargetDedicated    = targetDedicated,
            };

            client.CreatePool(parameters);
        }
Exemplo n.º 4
0
        public static void CreatePoolIfNotExists(
            BatchController controller,
            NewPoolParameters poolParameters)
        {
            BatchClient client = new BatchClient(controller.BatchManagementClient, controller.ResourceManagementClient);

            try
            {
                client.CreatePool(poolParameters);
            }
            catch (BatchException e)
            {
                if (e.RequestInformation.BatchError.Code != "PoolAlreadyExists")
                {
                    throw;
                }
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Creates a test pool for use in Scenario tests.
        /// </summary>
        public static void CreateTestPool(BatchController controller, BatchAccountContext context, string poolId, int targetDedicated, CertificateReference certReference = null)
        {
            BatchClient client = new BatchClient(controller.BatchManagementClient, controller.ResourceManagementClient);

            PSCertificateReference[] certReferences = null;
            if (certReference != null)
            {
                certReferences = new PSCertificateReference[] { new PSCertificateReference(certReference) };
            }

            NewPoolParameters parameters = new NewPoolParameters(context, poolId)
            {
                VirtualMachineSize    = "small",
                OSFamily              = "4",
                TargetOSVersion       = "*",
                TargetDedicated       = targetDedicated,
                CertificateReferences = certReferences,
            };

            client.CreatePool(parameters);
        }
        /// <summary>
        /// Creates a test pool for use in Scenario tests.
        /// </summary>
        public static void CreateTestPool(BatchController controller, BatchAccountContext context, string poolId, int targetDedicated)
        {
            RequestInterceptor interceptor = CreateHttpRecordingInterceptor();
            BatchClientBehavior[] behaviors = new BatchClientBehavior[] { interceptor };
            BatchClient client = new BatchClient(controller.BatchManagementClient, controller.ResourceManagementClient);

            NewPoolParameters parameters = new NewPoolParameters(context, poolId, behaviors)
            {
                VirtualMachineSize = "small",
                OSFamily = "4",
                TargetOSVersion = "*",
                TargetDedicated = targetDedicated,
            };

            client.CreatePool(parameters);
        }
        /// <summary>
        /// Creates a test pool for use in Scenario tests.
        /// </summary>
        public static void CreateTestPool(BatchController controller, BatchAccountContext context, string poolName)
        {
            YieldInjectionInterceptor interceptor = CreateHttpRecordingInterceptor();
            BatchClientBehavior[] behaviors = new BatchClientBehavior[] { interceptor };
            BatchClient client = new BatchClient(controller.BatchManagementClient, controller.ResourceManagementClient);

            NewPoolParameters parameters = new NewPoolParameters(context, poolName, behaviors)
            {
                OSFamily = "4",
                TargetOSVersion = "*",
                TargetDedicated = 1
            };

            client.CreatePool(parameters);
        }
        /// <summary>
        /// Creates a test pool for use in Scenario tests.
        /// </summary>
        public static void CreateTestPool(BatchController controller, BatchAccountContext context, string poolId, int targetDedicated, CertificateReference certReference = null)
        {
            BatchClient client = new BatchClient(controller.BatchManagementClient, controller.ResourceManagementClient);

            PSCertificateReference[] certReferences = null;
            if (certReference != null)
            {
                certReferences = new PSCertificateReference[] { new PSCertificateReference(certReference) };
            }

            NewPoolParameters parameters = new NewPoolParameters(context, poolId)
            {
                VirtualMachineSize = "small",
                OSFamily = "4",
                TargetOSVersion = "*",
                TargetDedicated = targetDedicated,
                CertificateReferences = certReferences,
            };

            client.CreatePool(parameters);
        }
        /// <summary>
        /// Creates a test pool for use in Scenario tests.
        /// </summary>
        public static void CreateTestPool(BatchController controller, BatchAccountContext context, string poolId, int targetDedicated,
            CertificateReference certReference = null, StartTask startTask = null)
        {
            BatchClient client = new BatchClient(controller.BatchManagementClient, controller.ResourceManagementClient);

            PSCertificateReference[] certReferences = null;
            if (certReference != null)
            {
                certReferences = new PSCertificateReference[] { new PSCertificateReference(certReference) };
            }
            PSStartTask psStartTask = null;
            if (startTask != null)
            {
                psStartTask = new PSStartTask(startTask);
            }

            PSCloudServiceConfiguration paasConfiguration = new PSCloudServiceConfiguration("4", "*");

            NewPoolParameters parameters = new NewPoolParameters(context, poolId)
            {
                VirtualMachineSize = "small",
                CloudServiceConfiguration = paasConfiguration,
                TargetDedicated = targetDedicated,
                CertificateReferences = certReferences,
                StartTask = psStartTask,
                InterComputeNodeCommunicationEnabled = true
            };

            client.CreatePool(parameters);
        }