-
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
Merged
Merged
New SDK - SchemaRegistry #13657
Changes from 26 commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
63045ea
Generated the SchemaRegistry SDK. Set up project and custom client. F…
MiYanni ce5b15c
Merge branch 'master' into schemaregistry-new-sdk
MiYanni 6b44ba3
Update to latest swagger with description fixes.
MiYanni e0b8961
Merge branch 'master' into schemaregistry-new-sdk
MiYanni 4c7a288
Fixed changlog. Regen surface.
MiYanni 202090a
Regen with correct swagger.
MiYanni 96e42d3
Started adding client methods.
MiYanni 66a4426
Update SchemaId to be struct. Regen api.
MiYanni aa5b5cb
Merge branch 'master' into schemaregistry-new-sdk
MiYanni 86932ac
Initial attempt of serializer.
MiYanni 7ff033c
Update swagger version. Regenerate rest client. Update public surface…
MiYanni ba0addd
Added happy path tests for each client method. Added recordings.
MiYanni 3c8e1b1
Move serialization stuff into the Azure.Data.SchemaRegistry.Avro proj…
MiYanni 3853114
Modify SchemaProperties to have smaller set of properties. Rerun and …
MiYanni 1b5999c
Still attempting to get Avro library usable functionality. Some refle…
MiYanni eaec4d9
Initial serializer implementation. Only does specific records.
MiYanni 8ca6a68
Merge branch 'master' into schemaregistry-new-sdk
MiYanni af23793
Fixed issues with specific record schema de/serialization.
MiYanni 8d04053
Got GenericRecord working. Needs cleanup.
MiYanni 306fa4f
Code cleanup begins!
MiYanni d65d746
:-) Cleaned up code for serializers. Wrote proper async implementation.
MiYanni 6daf008
Renamed classes to be more accurate. Removal of commented code.
MiYanni aff9ef7
Moved serializer over to main project. Removed other project and solu…
MiYanni 52220c9
Added 1 test for the serializer.
MiYanni 9940ec4
Merge branch 'master' into schemaregistry-new-sdk
MiYanni 817f11d
Update api.
MiYanni b61cd0e
Added back the separate solution. Named it appropriately.
MiYanni 96887b6
Addressing some changes from API view comments.
MiYanni 7b25995
Added some negative tests. Updated public surface descriptions.
MiYanni 88339c2
In progress writing readmes.
MiYanni 5194247
Fixed position reset in deserialization stream.
MiYanni 0e1122b
Made constants for wire format lengths/positions.
MiYanni a46462b
Updated property description. Made static field for UTF8 encoding.
MiYanni 2d19b51
Removed unused Directory.Build.props.
MiYanni 54f3d48
Removed unused description.
MiYanni 88d46a2
Continuing readme. Started adding snippets.
MiYanni 608ada2
Merge branch 'master' into schemaregistry-new-sdk
MiYanni 7008405
First readme completed.
MiYanni 6317936
Finally! Created readmes and snippets.
MiYanni 713b987
Put credential scope string into a constant.
MiYanni 09adad4
Addressing a couple documentation PR comments and removed a code comm…
MiYanni f331a51
Added global suppressions for namespace name.
MiYanni 747e336
Forgot using for memory streams in tests and snippets.
MiYanni 3f1cd01
Fixed bugged diagnostic scope names. Put scope names into constants.
MiYanni c87bb3b
Updated ci configuration. Removed resources template since resources …
MiYanni e152c57
Added the other package to CI.
MiYanni ff50a0c
Updated sample file names to match convention.
MiYanni 87348be
Added missing readme links.
MiYanni aa78861
Fixed the readme snippets so they don't format oddly.
MiYanni 7d9a67f
Updated schema components descriptions.
MiYanni 03d9a62
Fixed command to acquire packages.
MiYanni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
sdk/schemaregistry/Azure.Data.SchemaRegistry/Azure.Data.SchemaRegistry.sln
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # Release History | ||
|
|
||
| ## 1.0.0-preview.1 (2020-08-05) | ||
| - Started changelog to capture release notes. |
6 changes: 6 additions & 0 deletions
6
sdk/schemaregistry/Azure.Data.SchemaRegistry/Directory.Build.props
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <!-- | ||
| Add any shared properties you want for the projects under this package directory that need to be set before the auto imported Directory.Build.props | ||
| --> | ||
| <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" /> | ||
| </Project> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| # README.md template | ||
MiYanni marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Use the guidelines in each section of this template to ensure consistency and readability of your README. The README resides in your package's GitHub repository at the root of its directory within the repo. It's also used as the package distribution page (NuGet, PyPi, npm, etc.) and as a Quickstart on docs.microsoft.com. See [README-EXAMPLE.md](README-EXAMPLE.md) for an example following this template. | ||
|
|
||
| **Title**: The H1 of your README should be in the format: `# [Product Name] client library for [Language]` | ||
|
|
||
| * All headings, including the H1, should use **sentence-style capitalization**. Refer to the [Microsoft Style Guide][style-guide-msft] and [Microsoft Cloud Style Guide][style-guide-cloud] for more information. | ||
| * Example: `# Azure Batch client library for Python` | ||
|
|
||
| # Azure Template client library for .NET | ||
|
|
||
| **Introduction**: The introduction appears directly under the title (H1) of your README. | ||
|
|
||
| * **DO NOT** use an "Introduction" or "Overview" heading (H2) for this section. | ||
| * First sentence: **Describe the service** briefly. You can usually use the first line of the service's docs landing page for this (Example: [Cosmos DB docs landing page](https://docs.microsoft.com/azure/cosmos-db/)). | ||
| * Next, add a **bulleted list** of the **most common tasks** supported by the package or library, prefaced with "Use the client library for [Product Name] to:". Then, provide code snippets for these tasks in the [Examples](#examples) section later in the document. Keep the task list short but include those tasks most developers need to perform with your package. | ||
| * Include this single line of links targeting your product's content at the bottom of the introduction, making any adjustments as necessary (for example, NuGet instead of PyPi): | ||
|
|
||
| [Source code](https://github.com/Azure/azure-sdk-for-python/tree/master/azure-batch) | [Package (PyPi)](https://pypi.org/project/azure-batch/) | [API reference documentation](https://docs.microsoft.com/python/api/overview/azure/batch?view=azure-python) | [Product documentation](https://docs.microsoft.com/azure/batch/) | ||
|
|
||
| > TIP: Your README should be as **brief** as possible but **no more brief** than necessary to get a developer new to Azure, the service, or the package up and running quickly. Keep it brief, but include everything a developer needs to make their first API call successfully. | ||
|
|
||
| ## Getting started | ||
|
|
||
| This section should include everything a developer needs to do to install and create their first client connection *very quickly*. | ||
|
|
||
| ### Install the package | ||
|
|
||
| First, provide instruction for obtaining and installing the package or library. This section might include only a single line of code, like `pip install package-name`, but should enable a developer to successfully install the package from NuGet, pip, npm, Maven, or even cloning a GitHub repository. | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| Include a section after the install command that details any requirements that must be satisfied before a developer can [authenticate](#authenticate-the-client) and test all of the snippets in the [Examples](#examples) section. For example, for Cosmos DB: | ||
|
|
||
| > You must have an [Azure subscription](https://azure.microsoft.com/free/), [Cosmos DB account](https://docs.microsoft.com/azure/cosmos-db/account-overview) (SQL API), and [Python 3.6+](https://www.python.org/downloads/) to use this package. | ||
|
|
||
| ### 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 | ||
|
|
||
| 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 --> | ||
| [style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization | ||
| [style-guide-cloud]: https://worldready.cloudapp.net/Styleguide/Read?id=2696&topicid=25357 | ||
|
|
||
|  | ||
65 changes: 65 additions & 0 deletions
65
sdk/schemaregistry/Azure.Data.SchemaRegistry/api/Azure.Data.SchemaRegistry.netstandard2.0.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| 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.Models.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.Models.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.Models.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.Models.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 = 0, | ||
MiYanni marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
MiYanni marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
| } | ||
| namespace Azure.Data.SchemaRegistry.Avro | ||
| { | ||
| public partial class SchemaRegistryAvroObjectSerializer : Azure.Core.Serialization.ObjectSerializer | ||
| { | ||
| public SchemaRegistryAvroObjectSerializer(Azure.Data.SchemaRegistry.SchemaRegistryClient client, string groupName, Azure.Data.SchemaRegistry.Avro.SchemaRegistryAvroObjectSerializerOptions options = null) { } | ||
| public override object Deserialize(System.IO.Stream stream, System.Type returnType, System.Threading.CancellationToken cancellationToken) { throw null; } | ||
| public override System.Threading.Tasks.ValueTask<object> DeserializeAsync(System.IO.Stream stream, System.Type returnType, System.Threading.CancellationToken cancellationToken) { throw null; } | ||
| public override void Serialize(System.IO.Stream stream, object value, System.Type inputType, System.Threading.CancellationToken cancellationToken) { } | ||
| public override System.Threading.Tasks.ValueTask SerializeAsync(System.IO.Stream stream, object value, System.Type inputType, System.Threading.CancellationToken cancellationToken) { throw null; } | ||
| } | ||
| public partial class SchemaRegistryAvroObjectSerializerOptions | ||
| { | ||
| public SchemaRegistryAvroObjectSerializerOptions() { } | ||
| public bool AutoRegisterSchemas { get { throw null; } set { } } | ||
| } | ||
| } | ||
| namespace Azure.Data.SchemaRegistry.Models | ||
| { | ||
| [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] | ||
| public readonly partial struct SerializationType : System.IEquatable<Azure.Data.SchemaRegistry.Models.SerializationType> | ||
| { | ||
| private readonly object _dummy; | ||
| private readonly int _dummyPrimitive; | ||
| public SerializationType(string value) { throw null; } | ||
| public static Azure.Data.SchemaRegistry.Models.SerializationType Avro { get { throw null; } } | ||
| public bool Equals(Azure.Data.SchemaRegistry.Models.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.Models.SerializationType left, Azure.Data.SchemaRegistry.Models.SerializationType right) { throw null; } | ||
| public static implicit operator Azure.Data.SchemaRegistry.Models.SerializationType (string value) { throw null; } | ||
| public static bool operator !=(Azure.Data.SchemaRegistry.Models.SerializationType left, Azure.Data.SchemaRegistry.Models.SerializationType right) { throw null; } | ||
| public override string ToString() { throw null; } | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.