From fa0471ff2b4d233d2bb9f98c1d715b61a4563183 Mon Sep 17 00:00:00 2001 From: Stefano Lottini <236640031+sl-at-ibm@users.noreply.github.com> Date: Thu, 2 Jul 2026 16:01:11 +0200 Subject: [PATCH 01/11] pcu group descriptor classes + deser unit tests --- .../Admin/PCUGroup.cs | 204 ++++++++++++++++++ .../PCUGroupDeserializationTests.cs | 140 ++++++++++++ 2 files changed, 344 insertions(+) create mode 100644 src/DataStax.AstraDB.DataApi/Admin/PCUGroup.cs create mode 100644 test/DataStax.AstraDB.DataApi.UnitTests/PCUGroupDeserializationTests.cs diff --git a/src/DataStax.AstraDB.DataApi/Admin/PCUGroup.cs b/src/DataStax.AstraDB.DataApi/Admin/PCUGroup.cs new file mode 100644 index 00000000..091fc710 --- /dev/null +++ b/src/DataStax.AstraDB.DataApi/Admin/PCUGroup.cs @@ -0,0 +1,204 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using DataStax.AstraDB.DataApi.Core; +using System; +using System.Text.Json.Serialization; + +namespace DataStax.AstraDB.DataApi.Admin; + +/// +/// The specifications for a PCU (Provisioned Capacity Unit) group, +/// such as the ones returned when querying the DevOps API for PCU groups. +/// +public class PCUGroup +{ + /// + /// The unique identifier for the PCU group (a UUID as a string). + /// + [JsonPropertyName("uuid")] + public string Id { get; set; } + + /// + /// The organization ID this PCU group belongs to. + /// + [JsonPropertyName("orgId")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string OrgId { get; set; } + + /// + /// The title (name) of the PCU group. + /// + [JsonPropertyName("title")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string Title { get; set; } + + /// + /// The cloud provider for this PCU group (e.g. 'AWS'). + /// + [JsonPropertyName("cloudProvider")] + [JsonConverter(typeof(JsonStringEnumConverter))] + public AstraDatabaseCloudProvider? CloudProvider { get; set; } + + /// + /// The region this PCU group is ascribed to. + /// + [JsonPropertyName("region")] + public string Region { get; set; } + + /// + /// The instance type for this PCU group. + /// + [JsonPropertyName("instanceType")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string InstanceType { get; set; } + + /// + /// The PCU type descriptor. + /// + [JsonPropertyName("pcuType")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public PCUType PCUType { get; set; } + + /// + /// The provisioning type (e.g. 'shared'). + /// + [JsonPropertyName("provisionType")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string ProvisionType { get; set; } + + /// + /// The minimum shared hourly PCUs in the group. + /// + [JsonPropertyName("min")] + public int Min { get; set; } + + /// + /// The maximum shared hourly PCUs in the group. + /// + [JsonPropertyName("max")] + public int Max { get; set; } + + /// + /// The absolute required PCUs in the group. + /// + [JsonPropertyName("reserved")] + public int Reserved { get; set; } + + /// + /// A description of the PCU group. + /// + [JsonPropertyName("description")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string Description { get; set; } + + /// + /// Creation time of the PCU group. + /// + [JsonPropertyName("createdAt")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public DateTime? CreatedAt { get; set; } + + /// + /// Update time of the PCU group. + /// + [JsonPropertyName("updatedAt")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public DateTime? UpdatedAt { get; set; } + + /// + /// Identifier of the user who created the PCU group. + /// + [JsonPropertyName("createdBy")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string CreatedBy { get; set; } + + /// + /// Identifier of the user who updated the PCU group. + /// + [JsonPropertyName("updatedBy")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string UpdatedBy { get; set; } + + /// + /// The current status of the PCU group (e.g. 'INITIALIZING'). + /// + [JsonPropertyName("status")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string Status { get; set; } +} + +/// +/// A PCU (Provisioned Capacity Unit) group type descriptor, +/// describing a specific PCU configuration available in a region. +/// +public class PCUType +{ + /// + /// The type of PCU group (e.g. 'standard'). + /// + [JsonPropertyName("type")] + public string Type { get; set; } + + /// + /// The region where this PCU type is available. + /// + [JsonPropertyName("region")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string Region { get; set; } + + /// + /// The cloud provider for this PCU type (e.g. 'AWS'). + /// + [JsonPropertyName("provider")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [JsonConverter(typeof(JsonStringEnumConverter))] + public AstraDatabaseCloudProvider? CloudProvider { get; set; } + + /// + /// Hardware specifications for this PCU type. + /// + [JsonPropertyName("details")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public PCUTypeDetails Details { get; set; } +} + +/// +/// The details of a PCU (Provisioned Capacity Unit) group type, +/// describing the hardware specifications for a particular PCU configuration. +/// +public class PCUTypeDetails +{ + /// + /// The number of virtual CPUs for this PCU type. + /// + [JsonPropertyName("vCPU")] + public int VCpu { get; set; } + + /// + /// The amount of memory for this PCU type. + /// + [JsonPropertyName("memory")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string Memory { get; set; } + + /// + /// The amount of disk cache for this PCU type. + /// + [JsonPropertyName("disk_cache")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string DiskCache { get; set; } +} diff --git a/test/DataStax.AstraDB.DataApi.UnitTests/PCUGroupDeserializationTests.cs b/test/DataStax.AstraDB.DataApi.UnitTests/PCUGroupDeserializationTests.cs new file mode 100644 index 00000000..32e206b8 --- /dev/null +++ b/test/DataStax.AstraDB.DataApi.UnitTests/PCUGroupDeserializationTests.cs @@ -0,0 +1,140 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using DataStax.AstraDB.DataApi.Admin; +using DataStax.AstraDB.DataApi.Core; +using DataStax.AstraDB.DataApi.Core.Commands; +using Xunit; + +namespace DataStax.AstraDB.DataApi.UnitTests; + + +public class PCUGroupDeserializationTests +{ + [Fact] + public void FullPCUGroupDeserializationTest() + { + var json = """ + [ + { + "uuid": "9aaddbb5-4622-447c-9bc5-b036bb9d7ed8", + "orgId": "org-id", + "title": "some title", + "cloudProvider": "AWS", + "region": "us-east-1", + "instanceType": "standard", + "pcuType": { + "type": "standard", + "region": "eu-west-1", + "provider": "aws", + "details": { + "vCPU": 0, + "memory": "mstring", + "disk_cache": "dcstring" + } + }, + "provisionType": "shared", + "min": 1, + "max": 1, + "reserved": 1, + "description": "some description", + "createdAt": "2021-06-01T12:00:00.000Z", + "updatedAt": "2021-06-01T12:00:00.000Z", + "createdBy": "user", + "updatedBy": "user", + "status": "INITIALIZING" + } + ] + """; + + // same deserialization setup as in the devops for AstraDatabasesAdmin: + var devOpsOptions = new CommandOptions { SerializeDateAsDollarDate = false }; + var command = new Command("test", new DataAPIClient(), new[] { devOpsOptions }, null); + + var groups = command.Deserialize>(json); + Assert.Single(groups); + + var group = groups[0]; + Assert.IsType(group); + Assert.Equal("org-id", group.OrgId); + Assert.Equal(1, group.Min); + Assert.Equal(new DateTime(2021, 6, 1, 12, 0, 0, DateTimeKind.Utc), group.CreatedAt); + Assert.Equal(AstraDatabaseCloudProvider.AWS, group.CloudProvider); + + var pcutype = group.PCUType; + Assert.IsType(pcutype); + Assert.Equal("eu-west-1", pcutype.Region); + Assert.Equal(AstraDatabaseCloudProvider.AWS, pcutype.CloudProvider); + + var details = pcutype.Details; + Assert.IsType(details); + Assert.Equal(0, details.VCpu); + Assert.Equal("mstring", details.Memory); + } + + [Fact] + public void IncompleteNoDetailsPCUGroupDeserializationTest() + { + var json = """ + [ + { + "uuid": "9aaddbb5-4622-447c-9bc5-b036bb9d7ed8", + "cloudProvider": "AWS", + "region": "us-east-1", + "pcuType": { + "type": "standard", + "region": "eu-west-1", + "provider": "aws" + } + } + ] + """; + + // same deserialization setup as in the devops for AstraDatabasesAdmin: + var devOpsOptions = new CommandOptions { SerializeDateAsDollarDate = false }; + var command = new Command("test", new DataAPIClient(), new[] { devOpsOptions }, null); + + var groups = command.Deserialize>(json); + Assert.Single(groups); + + var pcutype = groups[0].PCUType; + Assert.Null(pcutype.Details); + } + + [Fact] + public void IncompleteNoTypePCUGroupDeserializationTest() + { + var json = """ + [ + { + "uuid": "9aaddbb5-4622-447c-9bc5-b036bb9d7ed8", + "cloudProvider": "AWS", + "region": "us-east-1" + } + ] + """; + + // same deserialization setup as in the devops for AstraDatabasesAdmin: + var devOpsOptions = new CommandOptions { SerializeDateAsDollarDate = false }; + var command = new Command("test", new DataAPIClient(), new[] { devOpsOptions }, null); + + var groups = command.Deserialize>(json); + Assert.Single(groups); + + var pcutype = groups[0].PCUType; + Assert.Null(pcutype); + } +} From 36e556d62af309110898f6641f960528f64da2e3 Mon Sep 17 00:00:00 2001 From: Stefano Lottini <236640031+sl-at-ibm@users.noreply.github.com> Date: Thu, 2 Jul 2026 16:14:36 +0200 Subject: [PATCH 02/11] moved RegionInfo to Core namespace; add pcu_type to FindAvailableRegions, + tests --- .../{Core => Admin}/RegionInfo.cs | 12 +++++++++--- .../Tests/AdminTests.cs | 7 +++++++ 2 files changed, 16 insertions(+), 3 deletions(-) rename src/DataStax.AstraDB.DataApi/{Core => Admin}/RegionInfo.cs (87%) diff --git a/src/DataStax.AstraDB.DataApi/Core/RegionInfo.cs b/src/DataStax.AstraDB.DataApi/Admin/RegionInfo.cs similarity index 87% rename from src/DataStax.AstraDB.DataApi/Core/RegionInfo.cs rename to src/DataStax.AstraDB.DataApi/Admin/RegionInfo.cs index 50330d73..7e3325f5 100644 --- a/src/DataStax.AstraDB.DataApi/Core/RegionInfo.cs +++ b/src/DataStax.AstraDB.DataApi/Admin/RegionInfo.cs @@ -14,12 +14,12 @@ * limitations under the License. */ -using DataStax.AstraDB.DataApi.Admin; +using DataStax.AstraDB.DataApi.Core; using System; using System.Collections.Generic; using System.Text.Json.Serialization; -namespace DataStax.AstraDB.DataApi.Core; +namespace DataStax.AstraDB.DataApi.Admin; /// /// The metadata information for a region. @@ -73,4 +73,10 @@ public class RegionInfo /// [JsonPropertyName("zone")] public string Zone { get; set; } -} \ No newline at end of file + + /// + /// The types of PCU (Provisioned Capacity Units) available for this region. + /// + [JsonPropertyName("pcu_types")] + public List PCUTypes { get; set; } +} diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdminTests.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdminTests.cs index 2437d9a0..1a0a7414 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdminTests.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdminTests.cs @@ -546,6 +546,13 @@ public async Task DatabaseAdminAstra_GetRegions() Assert.NotEmpty(regionsAll); Assert.True(regionsAll.Count >= regionsOnly.Count); + + // region PCU information checks + Assert.NotEmpty(regionsDefault[0].PCUTypes); + var pcu_type = regionsDefault[0].PCUTypes[0]; + Assert.IsType(pcu_type); + Assert.IsType(pcu_type.Type); + Assert.IsType(pcu_type.Details); } [SkipWhenNotAstra] From 54732f4ee32ad2e296ac1599caadb7410391237e Mon Sep 17 00:00:00 2001 From: Stefano Lottini <236640031+sl-at-ibm@users.noreply.github.com> Date: Thu, 2 Jul 2026 18:54:42 +0200 Subject: [PATCH 03/11] AstraDatabasesAdmin: ListPCUGroups/Async method + tests --- .../Admin/AstraDatabasesAdmin.cs | 43 +++++++++++++++++++ .../Admin/ListPCUGroupsOptions.cs | 39 +++++++++++++++++ .../Tests/AdminTests.cs | 31 +++++++++++++ 3 files changed, 113 insertions(+) create mode 100644 src/DataStax.AstraDB.DataApi/Admin/ListPCUGroupsOptions.cs diff --git a/src/DataStax.AstraDB.DataApi/Admin/AstraDatabasesAdmin.cs b/src/DataStax.AstraDB.DataApi/Admin/AstraDatabasesAdmin.cs index 5e6d4174..fdbd15ba 100644 --- a/src/DataStax.AstraDB.DataApi/Admin/AstraDatabasesAdmin.cs +++ b/src/DataStax.AstraDB.DataApi/Admin/AstraDatabasesAdmin.cs @@ -407,6 +407,49 @@ internal async Task> FindAvailableRegionsAsync(FindAvailableReg return response; } + /// + /// Synchronous version of + /// + /// + public List ListPCUGroups(ListPCUGroupsOptions options = null) + { + return ListPCUGroupsAsync(options, true).ResultSync(); + } + + /// + /// List the PCU (Provisioned Capacity Units) Groups pertaining to the current org. + /// + /// Additional options to the DevOps API query, such as cloud provider/region filters and general request execution parameters. + /// A list of the PCU Groups according to the requested filtering. + public Task> ListPCUGroupsAsync(ListPCUGroupsOptions options = null) + { + return ListPCUGroupsAsync(options, false); + } + + internal async Task> ListPCUGroupsAsync(ListPCUGroupsOptions options, bool runSynchronously) + { + if (options != null && (options.CloudProvider == null) != (options.Region == null)) + throw new ArgumentException( + "Either both or none of CloudProvider and Region must be set for filtering PCU Groups.", + nameof(options)); + + var command = CreateCommand() + .AddUrlPath("pcus/actions/get") + .WithPayload(new Dictionary()) + .WithTimeoutManager(new DatabaseAdminTimeoutManager()) + .AddCommandOptions(options); + + var response = await command.RunAsyncRaw>(HttpMethod.Post, runSynchronously); + // apply cloud/region filter if required: + if (options?.CloudProvider == null) + { + return response; + } + return response + .Where(group => group.CloudProvider == options.CloudProvider && group.Region == options.Region) + .ToList(); + } + private DatabaseAdminAstra GetDatabaseAdmin(DatabaseInfo dbInfo, GetDatabaseAdminOptions options = null) { var commandOptions = CommandOptions.Merge(new CommandOptions[] {_adminOptions, options}); diff --git a/src/DataStax.AstraDB.DataApi/Admin/ListPCUGroupsOptions.cs b/src/DataStax.AstraDB.DataApi/Admin/ListPCUGroupsOptions.cs new file mode 100644 index 00000000..34426857 --- /dev/null +++ b/src/DataStax.AstraDB.DataApi/Admin/ListPCUGroupsOptions.cs @@ -0,0 +1,39 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using DataStax.AstraDB.DataApi.Core; + +namespace DataStax.AstraDB.DataApi.Admin; + +/// +/// Options for AstraDatabasesAdmin's ListPCUGroups command. +/// +public class ListPCUGroupsOptions : CommandOptions +{ + + /// + /// If set, filters results to this cloud provider only. + /// Either both or none of CloudProvider and Region must be set + /// + public AstraDatabaseCloudProvider? CloudProvider { get; set; } + + /// + /// If set, filters results to this region only. + /// Either both or none of CloudProvider and Region must be set + /// + public string Region { get; set; } + +} diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdminTests.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdminTests.cs index 1a0a7414..d5332066 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdminTests.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdminTests.cs @@ -555,6 +555,37 @@ public async Task DatabaseAdminAstra_GetRegions() Assert.IsType(pcu_type.Details); } + [SkipWhenNotAstra] + [Fact(Skip="Run manually when an ORG ADMIN token is used, or this endpoint will error")] + public async Task DatabaseAdminAstra_GetPCUGroups() + { + var admin = fixture.Client.GetAstraDatabasesAdmin(); + + var pcuGroupsFull = await admin.ListPCUGroupsAsync(); + Assert.NotNull(pcuGroupsFull); + + var pcuGroupsFiltered = await admin.ListPCUGroupsAsync(new ListPCUGroupsOptions { + CloudProvider = AstraDatabaseCloudProvider.AWS, + Region = "us-west-1" + }); + Assert.NotNull(pcuGroupsFiltered); + + Assert.True(pcuGroupsFull.Count >= pcuGroupsFiltered.Count); + + // bad filtering patterns + await Assert.ThrowsAsync( + () => admin.ListPCUGroupsAsync(new ListPCUGroupsOptions { + Region = "us-west-1" + }) + ); + await Assert.ThrowsAsync( + () => admin.ListPCUGroupsAsync(new ListPCUGroupsOptions { + CloudProvider = AstraDatabaseCloudProvider.GCP + }) + ); + + } + [SkipWhenNotAstra] [Fact()] public void CreateDatabaseMissingParameters() From 1f5a9b618873311fc92b09cce78ebd84eafd3dec Mon Sep 17 00:00:00 2001 From: Stefano Lottini <236640031+sl-at-ibm@users.noreply.github.com> Date: Thu, 2 Jul 2026 22:26:31 +0200 Subject: [PATCH 04/11] added Tier,CapacityUnits,DBType,PCUGroupId to CreateDatabaseOptions --- .../Admin/CreateDatabaseOptions.cs | 36 ++++++++++++++++--- .../Tests/AdminTests.cs | 4 +-- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/src/DataStax.AstraDB.DataApi/Admin/CreateDatabaseOptions.cs b/src/DataStax.AstraDB.DataApi/Admin/CreateDatabaseOptions.cs index 58e98927..7c9f23d4 100644 --- a/src/DataStax.AstraDB.DataApi/Admin/CreateDatabaseOptions.cs +++ b/src/DataStax.AstraDB.DataApi/Admin/CreateDatabaseOptions.cs @@ -25,6 +25,10 @@ namespace DataStax.AstraDB.DataApi.Admin; /// public class CreateDatabaseOptions : BlockingCommandOptions { + private const string DefaultTier = "serverless"; + private const int DefaultCapacityUnits = 1; + private const string DefaultDbType = "vector"; + /// /// Name of the database to be created. /// @@ -49,15 +53,33 @@ public class CreateDatabaseOptions : BlockingCommandOptions set => base.Keyspace = value; } + /// + /// Database tier (defaults to "serverless"). + /// + public string Tier { get; set; } = DefaultTier; + + /// + /// Capacity units for the database (defaults to 1). + /// + public int CapacityUnits { get; set; } = DefaultCapacityUnits; + + /// + /// Database type (defaults to "vector"). + /// + public string DBType { get; set; } = DefaultDbType; + + /// + /// PCU group ID to use for provisioning the database. Optional. + /// + public string PCUGroupId { get; set; } = null; + internal object ToPayload() { var payload = new Dictionary(); - // hardcoded properties - payload["tier"] = "serverless"; - payload["capacityUnits"] = 1; - payload["dbType"] = "vector"; - // specified properties + payload["tier"] = Tier; + payload["capacityUnits"] = CapacityUnits; + payload["dbType"] = DBType; if ( Name != null ) { payload["name"] = Name; @@ -74,6 +96,10 @@ internal object ToPayload() { payload["keyspace"] = Keyspace; } + if ( PCUGroupId != null ) + { + payload["pcuGroupUUID"] = PCUGroupId; + } return payload; } diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdminTests.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdminTests.cs index d5332066..51ffcdeb 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdminTests.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdminTests.cs @@ -647,8 +647,8 @@ public async Task CreateDatabaseNonblockingSync() var admin = fixture.Client.GetAstraDatabasesAdmin().CreateDatabase( new (){ Name = dbName, - CloudProvider = CloudProviderType.GCP, - Region = "europe-west4", + CloudProvider = CloudProviderType.AWS, + Region = "us-west-2", Keyspace = "fedault_seykpace", waitForCompletion = false, } From 17d065e6dbb2f6e062723a0cfb919414ebea1764 Mon Sep 17 00:00:00 2001 From: Stefano Lottini <236640031+sl-at-ibm@users.noreply.github.com> Date: Fri, 3 Jul 2026 12:03:24 +0200 Subject: [PATCH 05/11] pcu group id checks in CreateDatabase, WIP --- .../Admin/AstraDatabasesAdmin.cs | 46 +++++++++++++++++++ .../Admin/ListPCUGroupsOptions.cs | 21 +++++++++ 2 files changed, 67 insertions(+) diff --git a/src/DataStax.AstraDB.DataApi/Admin/AstraDatabasesAdmin.cs b/src/DataStax.AstraDB.DataApi/Admin/AstraDatabasesAdmin.cs index fdbd15ba..6d4cfa93 100644 --- a/src/DataStax.AstraDB.DataApi/Admin/AstraDatabasesAdmin.cs +++ b/src/DataStax.AstraDB.DataApi/Admin/AstraDatabasesAdmin.cs @@ -17,6 +17,7 @@ using DataStax.AstraDB.DataApi.Core; using DataStax.AstraDB.DataApi.Core.Commands; using DataStax.AstraDB.DataApi.Utils; +using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using System.Linq; @@ -37,6 +38,7 @@ public class AstraDatabasesAdmin { private readonly CommandOptions _adminOptions; private readonly DataAPIClient _client; + private readonly ILogger _logger; private CommandOptions[] OptionsTree => new CommandOptions[] { _client.ClientOptions, _adminOptions }; @@ -57,6 +59,7 @@ internal AstraDatabasesAdmin(DataAPIClient client, CommandOptions adminOptions) Guard.NotNull(client, nameof(client)); _client = client; _adminOptions = adminOptions; + _logger = client.Logger; } internal string DevOpsAPISuffix(DBEnvironment? environment) => environment switch @@ -166,6 +169,49 @@ internal async Task CreateDatabaseAsync(CreateDatabaseOption Guard.NotNullOrEmpty(options.Name, nameof(options.Name)); Guard.NotNull(options.CloudProvider, nameof(options.CloudProvider)); Guard.NotNullOrEmpty(options.Region, nameof(options.Region)); + + if (options.PCUGroupId != null) + { + _logger.LogDebug("PCUGroupId specified ({PCUGroupId}): validating against available PCU groups.", options.PCUGroupId); + var listPCUOptions = ListPCUGroupsOptions.FromCommandOptions(options); + List pcuGroups = null; + try + { + pcuGroups = await ListPCUGroupsAsync(listPCUOptions, runSynchronously).ConfigureAwait(false); + } + catch (Exception ex) + { + _logger.LogWarning(ex, "Failed to retrieve PCU groups; skipping PCU group validation."); + } + + if (pcuGroups != null) + { + _logger.LogDebug("Retrieved {Count} PCU group(s); searching for id={PCUGroupId}.", pcuGroups.Count, options.PCUGroupId); + var matchedGroup = pcuGroups.FirstOrDefault(g => + string.Equals(g.Id, options.PCUGroupId, StringComparison.OrdinalIgnoreCase)); + + if (matchedGroup == null) + { + throw new InvalidOperationException( + $"No PCU group with id '{options.PCUGroupId}' was found."); + } + + _logger.LogDebug("Found PCU group '{PCUGroupId}': cloudProvider={CloudProvider}, region={Region}.", matchedGroup.Id, matchedGroup.CloudProvider, matchedGroup.Region); + + bool cloudProviderMatches = matchedGroup.CloudProvider == options.CloudProvider; + bool regionMatches = string.Equals(matchedGroup.Region, options.Region, StringComparison.OrdinalIgnoreCase); + + if (!cloudProviderMatches || !regionMatches) + { + throw new InvalidOperationException( + $"PCU group '{options.PCUGroupId}' is in cloudProvider={matchedGroup.CloudProvider}, region={matchedGroup.Region}, " + + $"which does not match the requested cloudProvider={options.CloudProvider}, region={options.Region}."); + } + + _logger.LogDebug("PCU group '{PCUGroupId}' validated successfully; proceeding with database creation.", options.PCUGroupId); + } + } + Command command = CreateCommand() .AddUrlPath("databases") .WithPayload(options.ToPayload()) diff --git a/src/DataStax.AstraDB.DataApi/Admin/ListPCUGroupsOptions.cs b/src/DataStax.AstraDB.DataApi/Admin/ListPCUGroupsOptions.cs index 34426857..c6a3c2bb 100644 --- a/src/DataStax.AstraDB.DataApi/Admin/ListPCUGroupsOptions.cs +++ b/src/DataStax.AstraDB.DataApi/Admin/ListPCUGroupsOptions.cs @@ -36,4 +36,25 @@ public class ListPCUGroupsOptions : CommandOptions /// public string Region { get; set; } + internal ListPCUGroupsOptions(CommandOptions source) : base(source) + { + } + + /// + /// Creates a new instance of with default values. + /// + public ListPCUGroupsOptions() : base() + { + } + + static internal ListPCUGroupsOptions FromCommandOptions( + CommandOptions options, AstraDatabaseCloudProvider? cloudProvider = null, string region = null + ) + { + if (options == null) return null; + return new ListPCUGroupsOptions(options) { + CloudProvider = cloudProvider, Region = region + }; + } + } From f5395a5ede3b4e411cce3f177e51a0ad4cd37b04 Mon Sep 17 00:00:00 2001 From: Stefano Lottini <236640031+sl-at-ibm@users.noreply.github.com> Date: Fri, 3 Jul 2026 12:39:50 +0200 Subject: [PATCH 06/11] removing duplicate class AstraDatabaseCloudProvider entirely and using CloudProviderType consistently everywhere --- .../Admin/CloudProviderType.cs | 32 +++++++++++++++++-- .../Admin/ListPCUGroupsOptions.cs | 4 +-- .../Admin/PCUGroup.cs | 5 ++- .../Core/DatabaseInfo.cs | 17 ++-------- .../Tests/AdminTests.cs | 4 +-- .../PCUGroupDeserializationTests.cs | 4 +-- 6 files changed, 39 insertions(+), 27 deletions(-) diff --git a/src/DataStax.AstraDB.DataApi/Admin/CloudProviderType.cs b/src/DataStax.AstraDB.DataApi/Admin/CloudProviderType.cs index 7aabc0c9..793f395f 100644 --- a/src/DataStax.AstraDB.DataApi/Admin/CloudProviderType.cs +++ b/src/DataStax.AstraDB.DataApi/Admin/CloudProviderType.cs @@ -14,6 +14,8 @@ * limitations under the License. */ +// using System; +// using System.Text.Json; using System.Text.Json.Serialization; namespace DataStax.AstraDB.DataApi.Admin; @@ -21,7 +23,7 @@ namespace DataStax.AstraDB.DataApi.Admin; /// /// Specifies the cloud provider on which an Astra DB database is deployed. /// -[JsonConverter(typeof(JsonStringEnumConverter))] +// [JsonConverter(typeof(CloudProviderTypeConverter))] public enum CloudProviderType { /// Amazon Web Services. @@ -32,5 +34,29 @@ public enum CloudProviderType GCP, /// Microsoft Azure. [JsonStringEnumMemberName("azure")] - Azure -} \ No newline at end of file + AZURE +} + +// internal sealed class CloudProviderTypeConverter : JsonConverter +// { +// public override CloudProviderType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) +// { +// var value = reader.GetString(); +// if (string.Equals(value, "aws", StringComparison.OrdinalIgnoreCase)) return CloudProviderType.AWS; +// if (string.Equals(value, "gcp", StringComparison.OrdinalIgnoreCase)) return CloudProviderType.GCP; +// if (string.Equals(value, "azure", StringComparison.OrdinalIgnoreCase)) return CloudProviderType.AZURE; +// throw new JsonException($"Unknown CloudProviderType value: '{value}'"); +// } + +// public override void Write(Utf8JsonWriter writer, CloudProviderType value, JsonSerializerOptions options) +// { +// var serialized = value switch +// { +// CloudProviderType.AWS => "aws", +// CloudProviderType.GCP => "gcp", +// CloudProviderType.AZURE => "azure", +// _ => throw new JsonException($"Unknown CloudProviderType value: '{value}'") +// }; +// writer.WriteStringValue(serialized); +// } +// } \ No newline at end of file diff --git a/src/DataStax.AstraDB.DataApi/Admin/ListPCUGroupsOptions.cs b/src/DataStax.AstraDB.DataApi/Admin/ListPCUGroupsOptions.cs index c6a3c2bb..3e9c7ff7 100644 --- a/src/DataStax.AstraDB.DataApi/Admin/ListPCUGroupsOptions.cs +++ b/src/DataStax.AstraDB.DataApi/Admin/ListPCUGroupsOptions.cs @@ -28,7 +28,7 @@ public class ListPCUGroupsOptions : CommandOptions /// If set, filters results to this cloud provider only. /// Either both or none of CloudProvider and Region must be set /// - public AstraDatabaseCloudProvider? CloudProvider { get; set; } + public CloudProviderType? CloudProvider { get; set; } /// /// If set, filters results to this region only. @@ -48,7 +48,7 @@ public ListPCUGroupsOptions() : base() } static internal ListPCUGroupsOptions FromCommandOptions( - CommandOptions options, AstraDatabaseCloudProvider? cloudProvider = null, string region = null + CommandOptions options, CloudProviderType? cloudProvider = null, string region = null ) { if (options == null) return null; diff --git a/src/DataStax.AstraDB.DataApi/Admin/PCUGroup.cs b/src/DataStax.AstraDB.DataApi/Admin/PCUGroup.cs index 091fc710..a84278f5 100644 --- a/src/DataStax.AstraDB.DataApi/Admin/PCUGroup.cs +++ b/src/DataStax.AstraDB.DataApi/Admin/PCUGroup.cs @@ -14,7 +14,6 @@ * limitations under the License. */ -using DataStax.AstraDB.DataApi.Core; using System; using System.Text.Json.Serialization; @@ -51,7 +50,7 @@ public class PCUGroup /// [JsonPropertyName("cloudProvider")] [JsonConverter(typeof(JsonStringEnumConverter))] - public AstraDatabaseCloudProvider? CloudProvider { get; set; } + public CloudProviderType? CloudProvider { get; set; } /// /// The region this PCU group is ascribed to. @@ -166,7 +165,7 @@ public class PCUType [JsonPropertyName("provider")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] [JsonConverter(typeof(JsonStringEnumConverter))] - public AstraDatabaseCloudProvider? CloudProvider { get; set; } + public CloudProviderType? CloudProvider { get; set; } /// /// Hardware specifications for this PCU type. diff --git a/src/DataStax.AstraDB.DataApi/Core/DatabaseInfo.cs b/src/DataStax.AstraDB.DataApi/Core/DatabaseInfo.cs index f9b947df..efd41abe 100644 --- a/src/DataStax.AstraDB.DataApi/Core/DatabaseInfo.cs +++ b/src/DataStax.AstraDB.DataApi/Core/DatabaseInfo.cs @@ -32,7 +32,7 @@ internal DatabaseInfo(RawDatabaseInfo rawInfo) OrgId = rawInfo.OrgId; OwnerId = rawInfo.OwnerId; Status = Enum.TryParse(rawInfo.Status, true, out var status) ? status : AstraDatabaseStatus.UNKNOWN; - CloudProvider = Enum.TryParse(rawInfo.Info.CloudProvider, true, out var cloudProvider) ? cloudProvider : AstraDatabaseCloudProvider.AWS; + CloudProvider = Enum.TryParse(rawInfo.Info.CloudProvider, true, out var cloudProvider) ? cloudProvider : CloudProviderType.AWS; CreatedAt = rawInfo.CreationTime; LastUsed = rawInfo.LastUsageTime; Keyspaces = rawInfo.Info.Keyspaces; @@ -51,7 +51,7 @@ internal DatabaseInfo(RawDatabaseInfo rawInfo) /// The current lifecycle status of the database. public AstraDatabaseStatus Status { get; set; } /// The cloud provider where the database is deployed. - public AstraDatabaseCloudProvider CloudProvider { get; set; } + public CloudProviderType CloudProvider { get; set; } /// The date and time when the database was created. public DateTime CreatedAt { get; set; } /// The date and time when the database was last used. @@ -79,19 +79,6 @@ public class AstraDatabaseRegionInfo public string Name { get; set; } } -/// -/// The cloud provider where an Astra database is deployed. -/// -public enum AstraDatabaseCloudProvider -{ - /// Amazon Web Services. - AWS, - /// Google Cloud Platform. - GCP, - /// Microsoft Azure. - AZURE -} - /// /// The lifecycle status of an Astra database. /// diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdminTests.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdminTests.cs index 51ffcdeb..71d3f7d1 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdminTests.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdminTests.cs @@ -565,7 +565,7 @@ public async Task DatabaseAdminAstra_GetPCUGroups() Assert.NotNull(pcuGroupsFull); var pcuGroupsFiltered = await admin.ListPCUGroupsAsync(new ListPCUGroupsOptions { - CloudProvider = AstraDatabaseCloudProvider.AWS, + CloudProvider = CloudProviderType.AWS, Region = "us-west-1" }); Assert.NotNull(pcuGroupsFiltered); @@ -580,7 +580,7 @@ await Assert.ThrowsAsync( ); await Assert.ThrowsAsync( () => admin.ListPCUGroupsAsync(new ListPCUGroupsOptions { - CloudProvider = AstraDatabaseCloudProvider.GCP + CloudProvider = CloudProviderType.GCP }) ); diff --git a/test/DataStax.AstraDB.DataApi.UnitTests/PCUGroupDeserializationTests.cs b/test/DataStax.AstraDB.DataApi.UnitTests/PCUGroupDeserializationTests.cs index 32e206b8..9e148267 100644 --- a/test/DataStax.AstraDB.DataApi.UnitTests/PCUGroupDeserializationTests.cs +++ b/test/DataStax.AstraDB.DataApi.UnitTests/PCUGroupDeserializationTests.cs @@ -72,12 +72,12 @@ public void FullPCUGroupDeserializationTest() Assert.Equal("org-id", group.OrgId); Assert.Equal(1, group.Min); Assert.Equal(new DateTime(2021, 6, 1, 12, 0, 0, DateTimeKind.Utc), group.CreatedAt); - Assert.Equal(AstraDatabaseCloudProvider.AWS, group.CloudProvider); + Assert.Equal(CloudProviderType.AWS, group.CloudProvider); var pcutype = group.PCUType; Assert.IsType(pcutype); Assert.Equal("eu-west-1", pcutype.Region); - Assert.Equal(AstraDatabaseCloudProvider.AWS, pcutype.CloudProvider); + Assert.Equal(CloudProviderType.AWS, pcutype.CloudProvider); var details = pcutype.Details; Assert.IsType(details); From a5b0b9e9b9b3de7a57265b2e2cb0bd49bd0f1cc4 Mon Sep 17 00:00:00 2001 From: Stefano Lottini <236640031+sl-at-ibm@users.noreply.github.com> Date: Fri, 3 Jul 2026 13:02:11 +0200 Subject: [PATCH 07/11] fix case-insensitive CloudProviderType deserialization| --- .../Admin/CloudProviderType.cs | 27 ------- .../Admin/PCUGroup.cs | 5 +- .../Core/Commands/Command.cs | 2 + .../SerDes/CloudProviderTypeConverter.cs | 78 +++++++++++++++++++ 4 files changed, 83 insertions(+), 29 deletions(-) create mode 100644 src/DataStax.AstraDB.DataApi/SerDes/CloudProviderTypeConverter.cs diff --git a/src/DataStax.AstraDB.DataApi/Admin/CloudProviderType.cs b/src/DataStax.AstraDB.DataApi/Admin/CloudProviderType.cs index 793f395f..1f127ff0 100644 --- a/src/DataStax.AstraDB.DataApi/Admin/CloudProviderType.cs +++ b/src/DataStax.AstraDB.DataApi/Admin/CloudProviderType.cs @@ -14,8 +14,6 @@ * limitations under the License. */ -// using System; -// using System.Text.Json; using System.Text.Json.Serialization; namespace DataStax.AstraDB.DataApi.Admin; @@ -23,7 +21,6 @@ namespace DataStax.AstraDB.DataApi.Admin; /// /// Specifies the cloud provider on which an Astra DB database is deployed. /// -// [JsonConverter(typeof(CloudProviderTypeConverter))] public enum CloudProviderType { /// Amazon Web Services. @@ -36,27 +33,3 @@ public enum CloudProviderType [JsonStringEnumMemberName("azure")] AZURE } - -// internal sealed class CloudProviderTypeConverter : JsonConverter -// { -// public override CloudProviderType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) -// { -// var value = reader.GetString(); -// if (string.Equals(value, "aws", StringComparison.OrdinalIgnoreCase)) return CloudProviderType.AWS; -// if (string.Equals(value, "gcp", StringComparison.OrdinalIgnoreCase)) return CloudProviderType.GCP; -// if (string.Equals(value, "azure", StringComparison.OrdinalIgnoreCase)) return CloudProviderType.AZURE; -// throw new JsonException($"Unknown CloudProviderType value: '{value}'"); -// } - -// public override void Write(Utf8JsonWriter writer, CloudProviderType value, JsonSerializerOptions options) -// { -// var serialized = value switch -// { -// CloudProviderType.AWS => "aws", -// CloudProviderType.GCP => "gcp", -// CloudProviderType.AZURE => "azure", -// _ => throw new JsonException($"Unknown CloudProviderType value: '{value}'") -// }; -// writer.WriteStringValue(serialized); -// } -// } \ No newline at end of file diff --git a/src/DataStax.AstraDB.DataApi/Admin/PCUGroup.cs b/src/DataStax.AstraDB.DataApi/Admin/PCUGroup.cs index a84278f5..a77cefeb 100644 --- a/src/DataStax.AstraDB.DataApi/Admin/PCUGroup.cs +++ b/src/DataStax.AstraDB.DataApi/Admin/PCUGroup.cs @@ -16,6 +16,7 @@ using System; using System.Text.Json.Serialization; +using DataStax.AstraDB.DataApi.SerDes; namespace DataStax.AstraDB.DataApi.Admin; @@ -49,7 +50,7 @@ public class PCUGroup /// The cloud provider for this PCU group (e.g. 'AWS'). /// [JsonPropertyName("cloudProvider")] - [JsonConverter(typeof(JsonStringEnumConverter))] + [JsonConverter(typeof(CloudProviderTypeConverter))] public CloudProviderType? CloudProvider { get; set; } /// @@ -164,7 +165,7 @@ public class PCUType /// [JsonPropertyName("provider")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - [JsonConverter(typeof(JsonStringEnumConverter))] + [JsonConverter(typeof(CloudProviderTypeConverter))] public CloudProviderType? CloudProvider { get; set; } /// diff --git a/src/DataStax.AstraDB.DataApi/Core/Commands/Command.cs b/src/DataStax.AstraDB.DataApi/Core/Commands/Command.cs index 5ac6c64d..e4e81287 100644 --- a/src/DataStax.AstraDB.DataApi/Core/Commands/Command.cs +++ b/src/DataStax.AstraDB.DataApi/Core/Commands/Command.cs @@ -294,6 +294,8 @@ internal T Deserialize(string input) { deserializeOptions.Converters.Add(new SimpleDictionaryConverter()); } + deserializeOptions.Converters.Add(new CloudProviderTypeConverter()); + deserializeOptions.Converters.Add(new CloudProviderTypeNullableConverter()); deserializeOptions.Converters.Add(new IpAddressConverter()); deserializeOptions.Converters.Add(new AnalyzerOptionsConverter()); diff --git a/src/DataStax.AstraDB.DataApi/SerDes/CloudProviderTypeConverter.cs b/src/DataStax.AstraDB.DataApi/SerDes/CloudProviderTypeConverter.cs new file mode 100644 index 00000000..89f65aeb --- /dev/null +++ b/src/DataStax.AstraDB.DataApi/SerDes/CloudProviderTypeConverter.cs @@ -0,0 +1,78 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using DataStax.AstraDB.DataApi.Admin; +using System; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace DataStax.AstraDB.DataApi.SerDes; + + +/// +/// JSON converter for , with case-insensitive deserialization logic. +/// +public class CloudProviderTypeConverter : JsonConverter +{ + /// + /// Reads and converts values into a , case-insensitively. + /// + public override CloudProviderType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + var value = reader.GetString(); + if (string.Equals(value, "aws", StringComparison.OrdinalIgnoreCase)) return CloudProviderType.AWS; + if (string.Equals(value, "gcp", StringComparison.OrdinalIgnoreCase)) return CloudProviderType.GCP; + if (string.Equals(value, "azure", StringComparison.OrdinalIgnoreCase)) return CloudProviderType.AZURE; + throw new JsonException($"Unknown CloudProviderType value: '{value}'"); + } + + /// + /// Writes an value as string. + /// + public override void Write(Utf8JsonWriter writer, CloudProviderType value, JsonSerializerOptions options) + { + var serialized = value switch + { + CloudProviderType.AWS => "aws", + CloudProviderType.GCP => "gcp", + CloudProviderType.AZURE => "azure", + _ => throw new JsonException($"Unknown CloudProviderType value: '{value}'") + }; + writer.WriteStringValue(serialized); + } +} + +/// +/// JSON converter for ?, with case-insensitive deserialization logic. +/// +public class CloudProviderTypeNullableConverter : JsonConverter +{ + private static readonly CloudProviderTypeConverter _inner = new(); + + /// + public override CloudProviderType? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType == JsonTokenType.Null) return null; + return _inner.Read(ref reader, typeof(CloudProviderType), options); + } + + /// + public override void Write(Utf8JsonWriter writer, CloudProviderType? value, JsonSerializerOptions options) + { + if (value is null) { writer.WriteNullValue(); return; } + _inner.Write(writer, value.Value, options); + } +} From 997a6e89a155d78557ec95a4218551ad3b58b71b Mon Sep 17 00:00:00 2001 From: Stefano Lottini <236640031+sl-at-ibm@users.noreply.github.com> Date: Fri, 3 Jul 2026 13:03:51 +0200 Subject: [PATCH 08/11] removed serdes detail from pcugroup class attributes --- src/DataStax.AstraDB.DataApi/Admin/PCUGroup.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/DataStax.AstraDB.DataApi/Admin/PCUGroup.cs b/src/DataStax.AstraDB.DataApi/Admin/PCUGroup.cs index a77cefeb..37384050 100644 --- a/src/DataStax.AstraDB.DataApi/Admin/PCUGroup.cs +++ b/src/DataStax.AstraDB.DataApi/Admin/PCUGroup.cs @@ -16,7 +16,6 @@ using System; using System.Text.Json.Serialization; -using DataStax.AstraDB.DataApi.SerDes; namespace DataStax.AstraDB.DataApi.Admin; @@ -50,7 +49,6 @@ public class PCUGroup /// The cloud provider for this PCU group (e.g. 'AWS'). /// [JsonPropertyName("cloudProvider")] - [JsonConverter(typeof(CloudProviderTypeConverter))] public CloudProviderType? CloudProvider { get; set; } /// @@ -165,7 +163,6 @@ public class PCUType /// [JsonPropertyName("provider")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] - [JsonConverter(typeof(CloudProviderTypeConverter))] public CloudProviderType? CloudProvider { get; set; } /// From 62837591ec229f3182062c90dc29dcf2c5f1d102 Mon Sep 17 00:00:00 2001 From: Stefano Lottini <236640031+sl-at-ibm@users.noreply.github.com> Date: Fri, 3 Jul 2026 13:25:13 +0200 Subject: [PATCH 09/11] move some option classes to Admin namespace: CreateKeyspaceOptions, DoesKeyspaceExistOptions, DropKeyspaceOptions, ListKeyspacesOptions --- .../{Core => Admin}/CreateKeyspaceOptions.cs | 4 +++- .../{Core => Admin}/DoesKeyspaceExistOptions.cs | 4 +++- .../{Core => Admin}/DropKeyspaceOptions.cs | 4 +++- .../{Core => Admin}/ListKeyspacesOptions.cs | 4 ++-- 4 files changed, 11 insertions(+), 5 deletions(-) rename src/DataStax.AstraDB.DataApi/{Core => Admin}/CreateKeyspaceOptions.cs (92%) rename src/DataStax.AstraDB.DataApi/{Core => Admin}/DoesKeyspaceExistOptions.cs (93%) rename src/DataStax.AstraDB.DataApi/{Core => Admin}/DropKeyspaceOptions.cs (90%) rename src/DataStax.AstraDB.DataApi/{Core => Admin}/ListKeyspacesOptions.cs (93%) diff --git a/src/DataStax.AstraDB.DataApi/Core/CreateKeyspaceOptions.cs b/src/DataStax.AstraDB.DataApi/Admin/CreateKeyspaceOptions.cs similarity index 92% rename from src/DataStax.AstraDB.DataApi/Core/CreateKeyspaceOptions.cs rename to src/DataStax.AstraDB.DataApi/Admin/CreateKeyspaceOptions.cs index 226ce0d2..d61bc2be 100644 --- a/src/DataStax.AstraDB.DataApi/Core/CreateKeyspaceOptions.cs +++ b/src/DataStax.AstraDB.DataApi/Admin/CreateKeyspaceOptions.cs @@ -14,7 +14,9 @@ * limitations under the License. */ -namespace DataStax.AstraDB.DataApi.Core; +using DataStax.AstraDB.DataApi.Core; + +namespace DataStax.AstraDB.DataApi.Admin; /// /// Options specific to the database admin command to create a keyspace. diff --git a/src/DataStax.AstraDB.DataApi/Core/DoesKeyspaceExistOptions.cs b/src/DataStax.AstraDB.DataApi/Admin/DoesKeyspaceExistOptions.cs similarity index 93% rename from src/DataStax.AstraDB.DataApi/Core/DoesKeyspaceExistOptions.cs rename to src/DataStax.AstraDB.DataApi/Admin/DoesKeyspaceExistOptions.cs index d0b12b6f..81448021 100644 --- a/src/DataStax.AstraDB.DataApi/Core/DoesKeyspaceExistOptions.cs +++ b/src/DataStax.AstraDB.DataApi/Admin/DoesKeyspaceExistOptions.cs @@ -14,7 +14,9 @@ * limitations under the License. */ -namespace DataStax.AstraDB.DataApi.Core; +using DataStax.AstraDB.DataApi.Core; + +namespace DataStax.AstraDB.DataApi.Admin; /// /// Command options specific to the database admin's DoesKeyspaceExist methods. diff --git a/src/DataStax.AstraDB.DataApi/Core/DropKeyspaceOptions.cs b/src/DataStax.AstraDB.DataApi/Admin/DropKeyspaceOptions.cs similarity index 90% rename from src/DataStax.AstraDB.DataApi/Core/DropKeyspaceOptions.cs rename to src/DataStax.AstraDB.DataApi/Admin/DropKeyspaceOptions.cs index 11a1a30f..e857a051 100644 --- a/src/DataStax.AstraDB.DataApi/Core/DropKeyspaceOptions.cs +++ b/src/DataStax.AstraDB.DataApi/Admin/DropKeyspaceOptions.cs @@ -14,7 +14,9 @@ * limitations under the License. */ -namespace DataStax.AstraDB.DataApi.Core; +using DataStax.AstraDB.DataApi.Core; + +namespace DataStax.AstraDB.DataApi.Admin; /// /// Options specific to the database admin command to drop a keyspace. diff --git a/src/DataStax.AstraDB.DataApi/Core/ListKeyspacesOptions.cs b/src/DataStax.AstraDB.DataApi/Admin/ListKeyspacesOptions.cs similarity index 93% rename from src/DataStax.AstraDB.DataApi/Core/ListKeyspacesOptions.cs rename to src/DataStax.AstraDB.DataApi/Admin/ListKeyspacesOptions.cs index 405f8b54..6787766f 100644 --- a/src/DataStax.AstraDB.DataApi/Core/ListKeyspacesOptions.cs +++ b/src/DataStax.AstraDB.DataApi/Admin/ListKeyspacesOptions.cs @@ -14,9 +14,9 @@ * limitations under the License. */ -using DataStax.AstraDB.DataApi.Admin; +using DataStax.AstraDB.DataApi.Core; -namespace DataStax.AstraDB.DataApi.Core; +namespace DataStax.AstraDB.DataApi.Admin; /// /// Command options specific to the database admin's ListKeyspaces methods. From 060fa2259878b6656d21f062eebed0bed3cfa89a Mon Sep 17 00:00:00 2001 From: Stefano Lottini <236640031+sl-at-ibm@users.noreply.github.com> Date: Fri, 3 Jul 2026 16:34:58 +0200 Subject: [PATCH 10/11] Final touches and full (manual) testing for the PCU-aware CreateDatabase --- .../Admin/AstraDatabasesAdmin.cs | 10 ++- .../Tests/AdminTests.cs | 76 +++++++++++++++++++ .../Tests/DatabaseTests.cs | 17 +++++ 3 files changed, 99 insertions(+), 4 deletions(-) diff --git a/src/DataStax.AstraDB.DataApi/Admin/AstraDatabasesAdmin.cs b/src/DataStax.AstraDB.DataApi/Admin/AstraDatabasesAdmin.cs index 6d4cfa93..7f1fb619 100644 --- a/src/DataStax.AstraDB.DataApi/Admin/AstraDatabasesAdmin.cs +++ b/src/DataStax.AstraDB.DataApi/Admin/AstraDatabasesAdmin.cs @@ -172,7 +172,7 @@ internal async Task CreateDatabaseAsync(CreateDatabaseOption if (options.PCUGroupId != null) { - _logger.LogDebug("PCUGroupId specified ({PCUGroupId}): validating against available PCU groups.", options.PCUGroupId); + _logger.LogInformation("PCUGroupId specified ({PCUGroupId}): validating against available PCU groups.", options.PCUGroupId); var listPCUOptions = ListPCUGroupsOptions.FromCommandOptions(options); List pcuGroups = null; try @@ -186,29 +186,31 @@ internal async Task CreateDatabaseAsync(CreateDatabaseOption if (pcuGroups != null) { - _logger.LogDebug("Retrieved {Count} PCU group(s); searching for id={PCUGroupId}.", pcuGroups.Count, options.PCUGroupId); + _logger.LogInformation("Retrieved {Count} PCU group(s); searching for id={PCUGroupId}.", pcuGroups.Count, options.PCUGroupId); var matchedGroup = pcuGroups.FirstOrDefault(g => string.Equals(g.Id, options.PCUGroupId, StringComparison.OrdinalIgnoreCase)); if (matchedGroup == null) { + _logger.LogInformation("PCU group '{PCUGroupId}' was not found: aborting database creation.", options.PCUGroupId); throw new InvalidOperationException( $"No PCU group with id '{options.PCUGroupId}' was found."); } - _logger.LogDebug("Found PCU group '{PCUGroupId}': cloudProvider={CloudProvider}, region={Region}.", matchedGroup.Id, matchedGroup.CloudProvider, matchedGroup.Region); + _logger.LogInformation("Found PCU group '{PCUGroupId}': cloudProvider={CloudProvider}, region={Region}.", matchedGroup.Id, matchedGroup.CloudProvider, matchedGroup.Region); bool cloudProviderMatches = matchedGroup.CloudProvider == options.CloudProvider; bool regionMatches = string.Equals(matchedGroup.Region, options.Region, StringComparison.OrdinalIgnoreCase); if (!cloudProviderMatches || !regionMatches) { + _logger.LogInformation("PCU group '{PCUGroupId}' was found in a different region: aborting database creation.", matchedGroup.Id); throw new InvalidOperationException( $"PCU group '{options.PCUGroupId}' is in cloudProvider={matchedGroup.CloudProvider}, region={matchedGroup.Region}, " + $"which does not match the requested cloudProvider={options.CloudProvider}, region={options.Region}."); } - _logger.LogDebug("PCU group '{PCUGroupId}' validated successfully; proceeding with database creation.", options.PCUGroupId); + _logger.LogInformation("PCU group '{PCUGroupId}' validated successfully; proceeding with database creation.", options.PCUGroupId); } } diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdminTests.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdminTests.cs index 71d3f7d1..bd9e7ccd 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdminTests.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdminTests.cs @@ -728,6 +728,82 @@ public async Task CreateDatabaseBlockingAsync() Assert.NotNull(tableNames); } + // dotnet test --filter FullyQualifiedName=DataStax.AstraDB.DataApi.IntegrationTests.AdminTests.CreateDatabaseBadPCUGroupNonblockingAsync + // ENSURE THE TOKEN CAN READ PCU GROUPS FOR THIS TEST (else you'll get another failure and test will fail) + [Fact(Skip = AdminCollection.SkipMessage)] + public async Task CreateDatabaseBadPCUGroupNonblockingAsync() + { + var dbName = "test-db-badpcugroup-create-async-x"; + var creationOptions = new CreateDatabaseOptions() { + Name = dbName, + CloudProvider = CloudProviderType.AWS, + Region = "us-west-2", + waitForCompletion = false, + PCUGroupId = "bad_group_id", + }; + + var astraAdmin = fixture.Client.GetAstraDatabasesAdmin(); + + await Assert.ThrowsAsync(async () => + { + await astraAdmin.CreateDatabaseAsync(creationOptions); + }); + } + + // dotnet test --filter FullyQualifiedName=DataStax.AstraDB.DataApi.IntegrationTests.AdminTests.CreateDatabaseMisplacedPCUGroupNonblockingAsync + // ENSURE THE TOKEN CAN READ PCU GROUPS FOR THIS TEST (else you'll get another failure and test will fail) + [Fact(Skip = AdminCollection.SkipMessage)] + public async Task CreateDatabaseMisplacedPCUGroupNonblockingAsync() + { + var dbName = "test-db-misplacedpcugroup-create-async-x"; + // Manually ensure the PCU Group ID exists, but for another provider/region! + var creationOptions = new CreateDatabaseOptions() { + Name = dbName, + CloudProvider = CloudProviderType.GCP, + Region = "us-east1", + waitForCompletion = false, + PCUGroupId = "8424aa7c-a26b-44cc-8ae3-c65aec7a184f", + }; + + var astraAdmin = fixture.Client.GetAstraDatabasesAdmin(); + + await Assert.ThrowsAsync(async () => + { + await astraAdmin.CreateDatabaseAsync(creationOptions); + }); + } + + // dotnet test --filter FullyQualifiedName=DataStax.AstraDB.DataApi.IntegrationTests.AdminTests.CreateDatabaseCorrectPCUGroupNonblockingAsync + // ENSURE THE TOKEN CAN READ PCU GROUPS FOR THIS TEST (else you'll get another failure and test will fail) + [Fact(Skip = AdminCollection.SkipMessage)] + public async Task CreateDatabaseCorrectPCUGroupNonblockingAsync() + { + var dbName = "test-db-correctpcugroup-create-async-x"; + // Manually ensure the PCU Group ID exists, but for another provider/region! + var creationOptions = new CreateDatabaseOptions() { + Name = dbName, + CloudProvider = CloudProviderType.AWS, + Region = "us-west-2", + waitForCompletion = false, + PCUGroupId = "8424aa7c-a26b-44cc-8ae3-c65aec7a184f", + }; + + var astraAdmin = fixture.Client.GetAstraDatabasesAdmin(); + + var dbAdmin = await astraAdmin.CreateDatabaseAsync(creationOptions); + + var dbStatus = await astraAdmin.GetDatabaseStatusAsync(dbAdmin.Id); + Assert.True(dbStatus == AstraDatabaseStatus.ASSOCIATING + || dbStatus == AstraDatabaseStatus.INITIALIZING + || dbStatus == AstraDatabaseStatus.PENDING); + + var dbAdmin2 = astraAdmin.GetDatabaseAdmin(dbAdmin.GetAPIEndpoint()); + var dbStatus2 = await astraAdmin.GetDatabaseStatusAsync(dbAdmin2.Id); + Assert.True(dbStatus2 == AstraDatabaseStatus.ASSOCIATING + || dbStatus2 == AstraDatabaseStatus.INITIALIZING + || dbStatus2 == AstraDatabaseStatus.PENDING); + } + // dotnet test --filter FullyQualifiedName=DataStax.AstraDB.DataApi.IntegrationTests.AdminTests.DropDatabaseNonblockingSync [Fact(Skip = AdminCollection.SkipMessage)] public void DropDatabaseNonblockingSync() diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/DatabaseTests.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/DatabaseTests.cs index 3c4657de..45ae0971 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/DatabaseTests.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/DatabaseTests.cs @@ -1,3 +1,20 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using DataStax.AstraDB.DataApi.Admin; using DataStax.AstraDB.DataApi.Collections; using DataStax.AstraDB.DataApi.Core; using DataStax.AstraDB.DataApi.Core.Commands; From 5a08316ff6cd944a08a517afa3caec9f3cc1f71e Mon Sep 17 00:00:00 2001 From: Stefano Lottini <236640031+sl-at-ibm@users.noreply.github.com> Date: Fri, 3 Jul 2026 16:46:58 +0200 Subject: [PATCH 11/11] chore: add copyright header to all files still without it --- .../Core/UserDefinedTypeField.cs | 16 ++++++++++++++++ .../Tables/DropUserDefinedTypeRequest.cs | 16 ++++++++++++++++ .../Utils/DeserializationUtils.cs | 15 +++++++++++++++ .../Utils/TypeUtilities.cs | 16 +++++++++++++++- .../AssemblyInfo.cs | 16 ++++++++++++++++ .../Constants.cs | 15 +++++++++++++++ .../FileLogger.cs | 16 ++++++++++++++++ .../Fixtures/AdminFixture.cs | 16 ++++++++++++++++ .../Fixtures/AssemblyFixture.cs | 16 ++++++++++++++++ .../Fixtures/BaseFixture.cs | 16 ++++++++++++++++ .../Fixtures/CollectionCursorFixture.cs | 16 ++++++++++++++++ .../Fixtures/CollectionFARRCursorFixture.cs | 16 ++++++++++++++++ .../Fixtures/CollectionsFixture.cs | 16 ++++++++++++++++ .../Fixtures/DatabaseFixture.cs | 16 ++++++++++++++++ .../Fixtures/FindAndUpdateFixture.cs | 16 ++++++++++++++++ .../Fixtures/ReplaceAndDeleteFixture.cs | 16 ++++++++++++++++ .../Fixtures/SkipWhenAstraAttribute.cs | 16 ++++++++++++++++ .../Fixtures/SkipWhenNotAstraAttribute.cs | 16 ++++++++++++++++ .../Fixtures/TableAlterFixture.cs | 16 ++++++++++++++++ .../Fixtures/TableIndexesFixture.cs | 16 ++++++++++++++++ .../Fixtures/TablesFixture.cs | 16 ++++++++++++++++ .../Fixtures/UpdatesFixture.cs | 16 ++++++++++++++++ .../Fixtures/UserDefinedTypesFixture.cs | 16 ++++++++++++++++ .../TestObjects.cs | 16 ++++++++++++++++ .../Tests/AdditionalCollectionTests.cs | 16 ++++++++++++++++ .../Tests/AdditionalTableTests.cs | 16 ++++++++++++++++ .../Tests/AdminTests.cs | 16 ++++++++++++++++ .../Tests/CollectionCursorTests.cs | 16 ++++++++++++++++ .../Tests/CollectionFARRCursorTests.cs | 16 ++++++++++++++++ .../Tests/CollectionTests.cs | 16 ++++++++++++++++ .../Tests/ExamplesTests.cs | 16 ++++++++++++++++ .../Tests/FindAndUpdateTests.cs | 16 ++++++++++++++++ .../Tests/ReplaceAndDeleteTests.cs | 16 ++++++++++++++++ .../Tests/SearchTests.cs | 16 ++++++++++++++++ .../Tests/SerializationTests.cs | 16 ++++++++++++++++ .../Tests/TableAlterTests.cs | 16 ++++++++++++++++ .../Tests/TableIndexesTests.cs | 16 ++++++++++++++++ .../Tests/TableTests.cs | 16 ++++++++++++++++ .../Tests/UpdateTests.cs | 16 ++++++++++++++++ .../Tests/UserDefinedTypesTests.cs | 16 ++++++++++++++++ .../CollectionFindAndRerankOptionsTests.cs | 16 ++++++++++++++++ .../CommandOptionsTests.cs | 16 ++++++++++++++++ 42 files changed, 669 insertions(+), 1 deletion(-) diff --git a/src/DataStax.AstraDB.DataApi/Core/UserDefinedTypeField.cs b/src/DataStax.AstraDB.DataApi/Core/UserDefinedTypeField.cs index 56cc86ae..c0092beb 100644 --- a/src/DataStax.AstraDB.DataApi/Core/UserDefinedTypeField.cs +++ b/src/DataStax.AstraDB.DataApi/Core/UserDefinedTypeField.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + namespace DataStax.AstraDB.DataApi.Core; /// diff --git a/src/DataStax.AstraDB.DataApi/Tables/DropUserDefinedTypeRequest.cs b/src/DataStax.AstraDB.DataApi/Tables/DropUserDefinedTypeRequest.cs index 49113c9f..2d7e8fe3 100644 --- a/src/DataStax.AstraDB.DataApi/Tables/DropUserDefinedTypeRequest.cs +++ b/src/DataStax.AstraDB.DataApi/Tables/DropUserDefinedTypeRequest.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System.Collections.Generic; using System.Text.Json.Serialization; diff --git a/src/DataStax.AstraDB.DataApi/Utils/DeserializationUtils.cs b/src/DataStax.AstraDB.DataApi/Utils/DeserializationUtils.cs index abb39d61..f0203bf6 100644 --- a/src/DataStax.AstraDB.DataApi/Utils/DeserializationUtils.cs +++ b/src/DataStax.AstraDB.DataApi/Utils/DeserializationUtils.cs @@ -1,3 +1,18 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ using System.Linq; using System.Text.Json; diff --git a/src/DataStax.AstraDB.DataApi/Utils/TypeUtilities.cs b/src/DataStax.AstraDB.DataApi/Utils/TypeUtilities.cs index 3f9a7575..293e28e2 100644 --- a/src/DataStax.AstraDB.DataApi/Utils/TypeUtilities.cs +++ b/src/DataStax.AstraDB.DataApi/Utils/TypeUtilities.cs @@ -1,4 +1,18 @@ - +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ using DataStax.AstraDB.DataApi.Core; using DataStax.AstraDB.DataApi.Tables; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/AssemblyInfo.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/AssemblyInfo.cs index bc1b946c..fb5c44e1 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/AssemblyInfo.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/AssemblyInfo.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using Xunit; [assembly: CollectionBehavior(DisableTestParallelization = true)] diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Constants.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Constants.cs index 87b5f349..47716091 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Constants.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Constants.cs @@ -1,3 +1,18 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ namespace DataStax.AstraDB.DataApi.IntegrationTests; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/FileLogger.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/FileLogger.cs index 4acefb88..8ded5cef 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/FileLogger.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/FileLogger.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using Microsoft.Extensions.Logging; namespace DataStax.AstraDB.DataApi.IntegrationTests; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/AdminFixture.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/AdminFixture.cs index 77102828..ac5fab1e 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/AdminFixture.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/AdminFixture.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Admin; using DataStax.AstraDB.DataApi.Core; using System.Text.RegularExpressions; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/AssemblyFixture.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/AssemblyFixture.cs index 858ac2da..27517119 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/AssemblyFixture.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/AssemblyFixture.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Admin; using DataStax.AstraDB.DataApi.Core; using Microsoft.Extensions.Configuration; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/BaseFixture.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/BaseFixture.cs index a22f927b..bad8e4f8 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/BaseFixture.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/BaseFixture.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Core; using Microsoft.Extensions.Logging; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/CollectionCursorFixture.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/CollectionCursorFixture.cs index 4f7ab639..cecccfb8 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/CollectionCursorFixture.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/CollectionCursorFixture.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Collections; using DataStax.AstraDB.DataApi.Core; using DataStax.AstraDB.DataApi.Core.Query; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/CollectionFARRCursorFixture.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/CollectionFARRCursorFixture.cs index 1f2f863c..7f2ead58 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/CollectionFARRCursorFixture.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/CollectionFARRCursorFixture.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Collections; using DataStax.AstraDB.DataApi.Core; using DataStax.AstraDB.DataApi.Core.Query; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/CollectionsFixture.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/CollectionsFixture.cs index a7fd7083..f07d4cc4 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/CollectionsFixture.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/CollectionsFixture.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Collections; using DataStax.AstraDB.DataApi.Core; using Xunit; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/DatabaseFixture.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/DatabaseFixture.cs index e96f0e64..23cb2002 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/DatabaseFixture.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/DatabaseFixture.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Core; using Xunit; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/FindAndUpdateFixture.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/FindAndUpdateFixture.cs index 1713eb24..191ce83a 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/FindAndUpdateFixture.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/FindAndUpdateFixture.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Collections; using DataStax.AstraDB.DataApi.Core; using Xunit; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/ReplaceAndDeleteFixture.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/ReplaceAndDeleteFixture.cs index 5d3e39da..a22a9b9c 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/ReplaceAndDeleteFixture.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/ReplaceAndDeleteFixture.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Collections; using DataStax.AstraDB.DataApi.Core; using Xunit; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/SkipWhenAstraAttribute.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/SkipWhenAstraAttribute.cs index 1bc8edde..21ab3734 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/SkipWhenAstraAttribute.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/SkipWhenAstraAttribute.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using Microsoft.Extensions.Configuration; using System.Reflection; using Xunit.v3; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/SkipWhenNotAstraAttribute.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/SkipWhenNotAstraAttribute.cs index 73afb1d1..818e9c53 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/SkipWhenNotAstraAttribute.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/SkipWhenNotAstraAttribute.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using Microsoft.Extensions.Configuration; using System.Reflection; using Xunit.v3; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/TableAlterFixture.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/TableAlterFixture.cs index 3805e989..9a03093d 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/TableAlterFixture.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/TableAlterFixture.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Core; using DataStax.AstraDB.DataApi.Tables; using Xunit; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/TableIndexesFixture.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/TableIndexesFixture.cs index bce1ed60..c0ccb3ac 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/TableIndexesFixture.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/TableIndexesFixture.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Core; using DataStax.AstraDB.DataApi.Tables; using Xunit; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/TablesFixture.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/TablesFixture.cs index 7989070d..cea2308a 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/TablesFixture.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/TablesFixture.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Core; using DataStax.AstraDB.DataApi.Tables; using DataStax.AstraDB.DataApi.Utils; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/UpdatesFixture.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/UpdatesFixture.cs index be3abe07..407456dc 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/UpdatesFixture.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/UpdatesFixture.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Collections; using DataStax.AstraDB.DataApi.Core; using Xunit; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/UserDefinedTypesFixture.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/UserDefinedTypesFixture.cs index 55251595..53d0f58b 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/UserDefinedTypesFixture.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Fixtures/UserDefinedTypesFixture.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Core; using DataStax.AstraDB.DataApi.Tables; using Xunit; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/TestObjects.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/TestObjects.cs index 725d2205..ec05dd7c 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/TestObjects.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/TestObjects.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Collections; using DataStax.AstraDB.DataApi.Core; using DataStax.AstraDB.DataApi.SerDes; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdditionalCollectionTests.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdditionalCollectionTests.cs index 06f68780..08be05ee 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdditionalCollectionTests.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdditionalCollectionTests.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Collections; using DataStax.AstraDB.DataApi.Core; using DataStax.AstraDB.DataApi.Core.Query; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdditionalTableTests.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdditionalTableTests.cs index dc487ed5..c80c9cc6 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdditionalTableTests.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdditionalTableTests.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Core; using DataStax.AstraDB.DataApi.Core.Commands; using DataStax.AstraDB.DataApi.Core.Query; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdminTests.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdminTests.cs index bd9e7ccd..5f50ebec 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdminTests.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/AdminTests.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Admin; using DataStax.AstraDB.DataApi.Core; using DataStax.AstraDB.DataApi.Core.Results; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/CollectionCursorTests.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/CollectionCursorTests.cs index 808985c7..d0c0e5d5 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/CollectionCursorTests.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/CollectionCursorTests.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Collections; using DataStax.AstraDB.DataApi.Core; using DataStax.AstraDB.DataApi.Core.Commands; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/CollectionFARRCursorTests.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/CollectionFARRCursorTests.cs index 64cb40a3..06980b84 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/CollectionFARRCursorTests.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/CollectionFARRCursorTests.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Collections; using DataStax.AstraDB.DataApi.Core; using DataStax.AstraDB.DataApi.Core.Commands; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/CollectionTests.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/CollectionTests.cs index 02e36960..42c527a2 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/CollectionTests.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/CollectionTests.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Collections; using DataStax.AstraDB.DataApi.Core; using DataStax.AstraDB.DataApi.Core.Commands; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/ExamplesTests.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/ExamplesTests.cs index 12cd96a2..8b517da9 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/ExamplesTests.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/ExamplesTests.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Collections; using DataStax.AstraDB.DataApi.Core; using DataStax.AstraDB.DataApi.IntegrationTests.Fixtures; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/FindAndUpdateTests.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/FindAndUpdateTests.cs index f0abf7fd..c0da2e68 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/FindAndUpdateTests.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/FindAndUpdateTests.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Core; using DataStax.AstraDB.DataApi.Core.Query; using DataStax.AstraDB.DataApi.IntegrationTests.Fixtures; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/ReplaceAndDeleteTests.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/ReplaceAndDeleteTests.cs index c1657dd3..40806065 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/ReplaceAndDeleteTests.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/ReplaceAndDeleteTests.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Collections; using DataStax.AstraDB.DataApi.Core; using DataStax.AstraDB.DataApi.Core.Query; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/SearchTests.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/SearchTests.cs index e36f3628..62349b4b 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/SearchTests.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/SearchTests.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Collections; using DataStax.AstraDB.DataApi.Core; using DataStax.AstraDB.DataApi.Core.Query; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/SerializationTests.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/SerializationTests.cs index 3114f7b7..257d3f41 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/SerializationTests.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/SerializationTests.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Collections; using DataStax.AstraDB.DataApi.Core; using DataStax.AstraDB.DataApi.Core.Commands; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/TableAlterTests.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/TableAlterTests.cs index e7566553..b43ec118 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/TableAlterTests.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/TableAlterTests.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Core; using DataStax.AstraDB.DataApi.IntegrationTests.Fixtures; using DataStax.AstraDB.DataApi.Tables; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/TableIndexesTests.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/TableIndexesTests.cs index f9074edf..d6d6ecfa 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/TableIndexesTests.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/TableIndexesTests.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Collections; using DataStax.AstraDB.DataApi.Core; using DataStax.AstraDB.DataApi.Core.Commands; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/TableTests.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/TableTests.cs index 7f867ef3..47e21694 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/TableTests.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/TableTests.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Core; using DataStax.AstraDB.DataApi.Core.Query; using DataStax.AstraDB.DataApi.Core.Results; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/UpdateTests.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/UpdateTests.cs index ed766064..952e1883 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/UpdateTests.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/UpdateTests.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Collections; using DataStax.AstraDB.DataApi.Core; using DataStax.AstraDB.DataApi.Core.Query; diff --git a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/UserDefinedTypesTests.cs b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/UserDefinedTypesTests.cs index c4cbd264..f8d224cd 100644 --- a/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/UserDefinedTypesTests.cs +++ b/test/DataStax.AstraDB.DataApi.IntegrationTests/Tests/UserDefinedTypesTests.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Core; using DataStax.AstraDB.DataApi.Core.Query; using DataStax.AstraDB.DataApi.IntegrationTests.Fixtures; diff --git a/test/DataStax.AstraDB.DataApi.UnitTests/CollectionFindAndRerankOptionsTests.cs b/test/DataStax.AstraDB.DataApi.UnitTests/CollectionFindAndRerankOptionsTests.cs index db57b6db..f43c99b2 100644 --- a/test/DataStax.AstraDB.DataApi.UnitTests/CollectionFindAndRerankOptionsTests.cs +++ b/test/DataStax.AstraDB.DataApi.UnitTests/CollectionFindAndRerankOptionsTests.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Core; using DataStax.AstraDB.DataApi.Collections; using DataStax.AstraDB.DataApi.Core.Query; diff --git a/test/DataStax.AstraDB.DataApi.UnitTests/CommandOptionsTests.cs b/test/DataStax.AstraDB.DataApi.UnitTests/CommandOptionsTests.cs index 737cc655..204fd637 100644 --- a/test/DataStax.AstraDB.DataApi.UnitTests/CommandOptionsTests.cs +++ b/test/DataStax.AstraDB.DataApi.UnitTests/CommandOptionsTests.cs @@ -1,3 +1,19 @@ +/* + * Copyright DataStax, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using DataStax.AstraDB.DataApi.Core; namespace DataStax.AstraDB.DataApi.Tests;