-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New SDK - SchemaRegistry #13657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New SDK - SchemaRegistry #13657
Changes from 35 commits
63045ea
ce5b15c
6b44ba3
e0b8961
4c7a288
202090a
96e42d3
66a4426
aa5b5cb
86932ac
7ff033c
ba0addd
3c8e1b1
3853114
1b5999c
eaec4d9
8ca6a68
af23793
8d04053
306fa4f
d65d746
6daf008
aff9ef7
52220c9
9940ec4
817f11d
b61cd0e
96887b6
7b25995
88339c2
5194247
0e1122b
a46462b
2d19b51
54f3d48
88d46a2
608ada2
7008405
6317936
713b987
09adad4
f331a51
747e336
3f1cd01
c87bb3b
e152c57
ff50a0c
87348be
aa78861
7d9a67f
03d9a62
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| | ||
| Microsoft Visual Studio Solution File, Format Version 12.00 | ||
| # Visual Studio Version 16 | ||
| VisualStudioVersion = 16.0.29709.97 | ||
| MinimumVisualStudioVersion = 10.0.40219.1 | ||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Data.SchemaRegistry", "src\Azure.Data.SchemaRegistry.csproj", "{E33D09D9-D809-472C-82E6-6A26BDB86FC2}" | ||
| EndProject | ||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Data.SchemaRegistry.Tests", "tests\Azure.Data.SchemaRegistry.Tests.csproj", "{4F476D56-DDE7-43D3-8CB4-BA1E77F5A300}" | ||
| EndProject | ||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{8052009B-2126-44A3-88CD-4F3B17894C64}" | ||
| EndProject | ||
| Global | ||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| Debug|Any CPU = Debug|Any CPU | ||
| Release|Any CPU = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
| {E33D09D9-D809-472C-82E6-6A26BDB86FC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {E33D09D9-D809-472C-82E6-6A26BDB86FC2}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {E33D09D9-D809-472C-82E6-6A26BDB86FC2}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {E33D09D9-D809-472C-82E6-6A26BDB86FC2}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {4F476D56-DDE7-43D3-8CB4-BA1E77F5A300}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {4F476D56-DDE7-43D3-8CB4-BA1E77F5A300}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {4F476D56-DDE7-43D3-8CB4-BA1E77F5A300}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {4F476D56-DDE7-43D3-8CB4-BA1E77F5A300}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {8052009B-2126-44A3-88CD-4F3B17894C64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {8052009B-2126-44A3-88CD-4F3B17894C64}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {8052009B-2126-44A3-88CD-4F3B17894C64}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {8052009B-2126-44A3-88CD-4F3B17894C64}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(SolutionProperties) = preSolution | ||
| HideSolutionNode = FALSE | ||
| EndGlobalSection | ||
| GlobalSection(ExtensibilityGlobals) = postSolution | ||
| SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} | ||
| EndGlobalSection | ||
| EndGlobal |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # Release History | ||
|
|
||
| ## 1.0.0-beta.1 (2020-09-08) | ||
| - Added SchemaRegistryClient with 3 operations: | ||
| - RegisterSchema | ||
| - GetSchemaId | ||
| - GetSchema |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| # Azure Schema Registry client library for .NET | ||
|
|
||
| The Azure Schema Registry service allows developers to provide and retrieve data schemas from a centralized repository for use in messaging systems. | ||
|
|
||
| ## Getting started | ||
|
|
||
| ### Install the package | ||
|
|
||
| Install the Azure Schema Registry client library for .NET with [NuGet][nuget]: | ||
|
|
||
| ```PowerShell | ||
| Install-Package Azure.Data.SchemaRegistry | ||
| ``` | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| * An [Azure subscription][azure_sub]. | ||
| * An [Event Hubs namespace][event_hubs_namespace] | ||
|
|
||
| If you need to [create an Event Hubs namespace][create_event_hubs_namespace], you can use the Azure Portal or [Azure PowerShell][azure_powershell]. | ||
|
|
||
| You can use Azure PowerShell to create the Event Hubs namespace with the following command: | ||
|
|
||
| ```PowerShell | ||
| New-AzEventHubNamespace -ResourceGroupName myResourceGroup -NamespaceName namespace_name -Location eastus | ||
| ``` | ||
|
|
||
| ### Authenticate the client | ||
|
|
||
| If your library requires authentication for use, such as for Azure services, include instructions and example code needed for initializing and authenticating. | ||
|
|
||
| For example, include details on obtaining an account key and endpoint URI, setting environment variables for each, and initializing the client object. | ||
|
|
||
| ## Key concepts | ||
|
|
||
| The *Key concepts* section should describe the functionality of the main classes. Point out the most important and useful classes in the package (with links to their reference pages) and explain how those classes work together. Feel free to use bulleted lists, tables, code blocks, or even diagrams for clarity. | ||
|
|
||
| ## Examples | ||
|
|
||
|
|
||
| * [Register a schema][azconfig_setting_concepts] | ||
| * [Retrieve a schema ID][azconfig_asof_snapshot] | ||
| * [Retrieve a schema][azconfig_asof_snapshot] | ||
|
|
||
|
|
||
|
|
||
|
|
||
| Include code snippets and short descriptions for each task you listed in the [Introduction](#introduction) (the bulleted list). Briefly explain each operation, but include enough clarity to explain complex or otherwise tricky operations. | ||
|
|
||
| If possible, use the same example snippets that your in-code documentation uses. For example, use the snippets in your `examples.py` that Sphinx ingests via its [literalinclude](https://www.sphinx-doc.org/en/1.5/markup/code.html?highlight=code%20examples#includes) directive. The `examples.py` file containing the snippets should reside alongside your package's code, and should be tested in an automated fashion. | ||
|
|
||
| Each example in the *Examples* section starts with an H3 that describes the example. At the top of this section, just under the *Examples* H2, add a bulleted list linking to each example H3. Each example should deep-link to the types and/or members used in the example. | ||
|
|
||
| * [Create the thing](#create-the-thing) | ||
| * [Get the thing](#get-the-thing) | ||
| * [List the things](#list-the-things) | ||
|
|
||
| ### Create the thing | ||
|
|
||
| Use the [create_thing](not-valid-link) method to create a Thing reference; this method does not make a network call. To persist the Thing in the service, call [Thing.save](not-valid-link). | ||
|
|
||
| ```Python | ||
| thing = client.create_thing(id, name) | ||
| thing.save() | ||
| ``` | ||
|
|
||
| ### Get the thing | ||
|
|
||
| The [get_thing](not-valid-link) method retrieves a Thing from the service. The `id` parameter is the unique ID of the Thing, not its "name" property. | ||
|
|
||
| ```C# Snippet:GetSecret | ||
| var client = new MiniSecretClient(new Uri(endpoint), new DefaultAzureCredential()); | ||
|
|
||
| SecretBundle secret = client.GetSecret("TestSecret"); | ||
|
|
||
| Console.WriteLine(secret.Value); | ||
| ```Python | ||
| things = client.list_things() | ||
| ``` | ||
|
|
||
MiYanni marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ## Troubleshooting | ||
|
|
||
| Describe common errors and exceptions, how to "unpack" them if necessary, and include guidance for graceful handling and recovery. | ||
|
|
||
| Provide information to help developers avoid throttling or other service-enforced errors they might encounter. For example, provide guidance and examples for using retry or connection policies in the API. | ||
|
|
||
| If the package or a related package supports it, include tips for logging or enabling instrumentation to help them debug their code. | ||
|
|
||
| ## Next steps | ||
|
|
||
| * Provide a link to additional code examples, ideally to those sitting alongside the README in the package's `/samples` directory. | ||
| * If appropriate, point users to other packages that might be useful. | ||
| * If you think there's a good chance that developers might stumble across your package in error (because they're searching for specific functionality and mistakenly think the package provides that functionality), point them to the packages they might be looking for. | ||
|
|
||
| ## Contributing | ||
|
|
||
| This is a template, but your SDK readme should include details on how to contribute code to the repo/package. | ||
|
|
||
|  | ||
|
|
||
| <!-- LINKS --> | ||
| [nuget]: https://www.nuget.org/ | ||
| [event_hubs_namespace]: https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-about | ||
| [azure_powershell]: https://docs.microsoft.com/en-us/powershell/azure/ | ||
| [create_event_hubs_namespace]: https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-quickstart-powershell#create-an-event-hubs-namespace | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| namespace Azure.Data.SchemaRegistry | ||
| { | ||
| public partial class SchemaProperties | ||
| { | ||
| internal SchemaProperties() { } | ||
| public string Content { get { throw null; } } | ||
| public string Id { get { throw null; } } | ||
| } | ||
| public partial class SchemaRegistryClient | ||
| { | ||
| protected SchemaRegistryClient() { } | ||
| public SchemaRegistryClient(string endpoint, Azure.Core.TokenCredential credential) { } | ||
| public SchemaRegistryClient(string endpoint, Azure.Core.TokenCredential credential, Azure.Data.SchemaRegistry.SchemaRegistryClientOptions options) { } | ||
| public virtual Azure.Response<Azure.Data.SchemaRegistry.SchemaProperties> GetSchema(string schemaId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } | ||
| public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Data.SchemaRegistry.SchemaProperties>> GetSchemaAsync(string schemaId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } | ||
| public virtual Azure.Response<Azure.Data.SchemaRegistry.SchemaProperties> GetSchemaId(string groupName, string schemaName, Azure.Data.SchemaRegistry.SerializationType serializationType, string schemaContent, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } | ||
| public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Data.SchemaRegistry.SchemaProperties>> GetSchemaIdAsync(string groupName, string schemaName, Azure.Data.SchemaRegistry.SerializationType serializationType, string schemaContent, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } | ||
| public virtual Azure.Response<Azure.Data.SchemaRegistry.SchemaProperties> RegisterSchema(string groupName, string schemaName, Azure.Data.SchemaRegistry.SerializationType serializationType, string schemaContent, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } | ||
| public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Data.SchemaRegistry.SchemaProperties>> RegisterSchemaAsync(string groupName, string schemaName, Azure.Data.SchemaRegistry.SerializationType serializationType, string schemaContent, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } | ||
| } | ||
| public partial class SchemaRegistryClientOptions : Azure.Core.ClientOptions | ||
| { | ||
| public SchemaRegistryClientOptions(Azure.Data.SchemaRegistry.SchemaRegistryClientOptions.ServiceVersion version = Azure.Data.SchemaRegistry.SchemaRegistryClientOptions.ServiceVersion.V2017_04) { } | ||
| public enum ServiceVersion | ||
| { | ||
| V2017_04 = 1, | ||
| } | ||
| } | ||
| [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] | ||
| public readonly partial struct SerializationType : System.IEquatable<Azure.Data.SchemaRegistry.SerializationType> | ||
| { | ||
| private readonly object _dummy; | ||
| private readonly int _dummyPrimitive; | ||
| public SerializationType(string value) { throw null; } | ||
| public static Azure.Data.SchemaRegistry.SerializationType Avro { get { throw null; } } | ||
| public bool Equals(Azure.Data.SchemaRegistry.SerializationType other) { throw null; } | ||
| [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] | ||
| public override bool Equals(object obj) { throw null; } | ||
| [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] | ||
| public override int GetHashCode() { throw null; } | ||
| public static bool operator ==(Azure.Data.SchemaRegistry.SerializationType left, Azure.Data.SchemaRegistry.SerializationType right) { throw null; } | ||
| public static implicit operator Azure.Data.SchemaRegistry.SerializationType (string value) { throw null; } | ||
| public static bool operator !=(Azure.Data.SchemaRegistry.SerializationType left, Azure.Data.SchemaRegistry.SerializationType right) { throw null; } | ||
| public override string ToString() { throw null; } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
| <PropertyGroup> | ||
| <Description>Azure Schema Registry SDK</Description> | ||
| <AssemblyTitle>Azure Schema Registry SDK</AssemblyTitle> | ||
| <Version>1.0.0-beta.1</Version> | ||
| <PackageTags>Azure;Schema Registry;SchemaRegistry;.NET;Data;$(PackageCommonTags)</PackageTags> | ||
| <TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Apache.Avro" VersionOverride="1.10.0" /> | ||
| </ItemGroup> | ||
|
|
||
| <!-- Shared source from Azure.Core --> | ||
| <ItemGroup> | ||
| <Compile Include="$(AzureCoreSharedSources)ArrayBufferWriter.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
| <Compile Include="$(AzureCoreSharedSources)ClientDiagnostics.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
| <Compile Include="$(AzureCoreSharedSources)ContentTypeUtilities.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
| <Compile Include="$(AzureCoreSharedSources)DiagnosticScope.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
| <Compile Include="$(AzureCoreSharedSources)DiagnosticScopeFactory.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
| <Compile Include="$(AzureCoreSharedSources)HttpMessageSanitizer.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
| <Compile Include="$(AzureCoreSharedSources)TaskExtensions.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
| <Compile Include="$(AzureCoreSharedSources)OperationHelpers.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
| <Compile Include="$(AzureCoreSharedSources)Argument.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
| </ItemGroup> | ||
|
|
||
| <Import Project="$(MSBuildThisFileDirectory)..\..\..\core\Azure.Core\src\Azure.Core.props" /> | ||
|
|
||
| </Project> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.