Exemplo n.º 1
0
        /// <inheritdoc />
        public async Task <string> Create(InstancePoolAttributes poolAttributes, CancellationToken cancellationToken = default)
        {
            var poolIdentifier =
                await HttpPost <InstancePoolAttributes, dynamic>(
                    this.HttpClient,
                    "instance-pools/create",
                    poolAttributes, cancellationToken).ConfigureAwait(false);

            return(poolIdentifier.instance_pool_id.ToObject <string>());
        }
        /// <inheritdoc />
        public async Task Edit(string poolId, InstancePoolAttributes poolAttributes)
        {
            var pool = new InstancePoolInfo
            {
                PoolId           = poolId,
                PoolName         = poolAttributes.PoolName,
                NodeTypeId       = poolAttributes.NodeTypeId,
                MinIdleInstances = poolAttributes.MinIdleInstances,
                MaxCapacity      = poolAttributes.MaxCapacity,
                IdleInstanceAutoTerminationMinutes = poolAttributes.IdleInstanceAutoTerminationMinutes
            };

            await HttpPost(this.HttpClient, "instance-pools/edit", pool).ConfigureAwait(false);
        }