Skip to content
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

Merge feature/digitaltwins with master. #12398

Merged
merged 2 commits into from
Jun 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sdk/digitaltwins/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.config.json
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a need to have an overriding .gitignore file in your sub-directories? If not I'd suggest sticking with the one in the root.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've contributed to the repo root .gitignore file. We've added files specific to our solution to this one. I wouldn't feel safe making these exclusions at the root level.

Also, it seems as if our config.json files will be going away with a recent feature added by Pavel.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK if we expect them to go away soon I'm not worried about it but in general we are trying to drive a level of consistency across all the SDK's and we do that by trying to avoid special cases for some libraries so if we it is something interesting for you then I'd like to put it in the root version and only if we need an exceptional case do we override here.

!*common.config.json
!*common.test.assets.config.json
*.etl
4 changes: 4 additions & 0 deletions sdk/digitaltwins/Azure.DigitalTwins.Core/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
launchSettings.json
*.config.json
!*common.config.json
!*common.test.assets.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29806.167
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.DigitalTwins.Core", "src\Azure.DigitalTwins.Core.csproj", "{E33D09D9-D809-472C-82E6-6A26BDB86FC2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.DigitalTwins.Core.Tests", "tests\Azure.DigitalTwins.Core.Tests.csproj", "{4F476D56-DDE7-43D3-8CB4-BA1E77F5A300}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DigitalTwinsClientSample", "samples\DigitalTwinsClientSample\DigitalTwinsClientSample.csproj", "{293475B6-4D30-4033-95A0-FA94F168CC63}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C8218152-0AC8-4EB8-A501-A721109D37BF}"
ProjectSection(SolutionItems) = preProject
api\Azure.DigitalTwins.Core.netstandard2.0.cs = api\Azure.DigitalTwins.Core.netstandard2.0.cs
..\ci.yml = ..\ci.yml
..\Export-AdtApis.ps1 = ..\Export-AdtApis.ps1
..\remove-test-resources-pre.ps1 = ..\remove-test-resources-pre.ps1
..\test-resources.json = ..\test-resources.json
..\tests.yml = ..\tests.yml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{1FC8A3EA-3C0D-4DDF-B710-A7091F2CEBB1}"
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
{293475B6-4D30-4033-95A0-FA94F168CC63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{293475B6-4D30-4033-95A0-FA94F168CC63}.Debug|Any CPU.Build.0 = Debug|Any CPU
{293475B6-4D30-4033-95A0-FA94F168CC63}.Release|Any CPU.ActiveCfg = Release|Any CPU
{293475B6-4D30-4033-95A0-FA94F168CC63}.Release|Any CPU.Build.0 = Release|Any CPU
{1FC8A3EA-3C0D-4DDF-B710-A7091F2CEBB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1FC8A3EA-3C0D-4DDF-B710-A7091F2CEBB1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1FC8A3EA-3C0D-4DDF-B710-A7091F2CEBB1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1FC8A3EA-3C0D-4DDF-B710-A7091F2CEBB1}.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
3 changes: 3 additions & 0 deletions sdk/digitaltwins/Azure.DigitalTwins.Core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Release History

## 1.0.0-preview.1 (Unreleased)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Capturing Traces

## Windows
On Windows logman or PerfView can be used to collect traces. For more information please see https://github.com/dotnet/runtime/blob/master/docs/workflow/debugging/libraries/windows-instructions.md#traces

## Linux
On Linux and OSX LTTNG and perfcollect can be used to collect traces. For more information please see https://github.com/dotnet/runtime/blob/master/docs/project/linux-performance-tracing.md

## Azure providers

* `*Azure-Core {44cbc7c6-6776-5f3c-36c1-75cd3ef19ea9}`: Http Pipeline related traces.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"{44cbc7c6-6776-5f3c-36c1-75cd3ef19ea9}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
logman create trace DigitalTwinsTrace -o digitaltwins.etl -pf digitaltwins_providers.txt
logman start DigitalTwinsTrace
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
logman stop DigitalTwinsTrace
logman delete DigitalTwinsTrace
41 changes: 41 additions & 0 deletions sdk/digitaltwins/Azure.DigitalTwins.Core/CodeMaid.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="SteveCadwallader.CodeMaid.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</sectionGroup>
</configSections>
<userSettings>
<SteveCadwallader.CodeMaid.Properties.Settings>
<setting name="Cleaning_AutoCleanupOnFileSave" serializeAs="String">
<value>True</value>
</setting>
<setting name="Formatting_CommentXmlSpaceSingleTags" serializeAs="String">
<value>True</value>
</setting>
<setting name="Cleaning_InsertEndOfFileTrailingNewLine" serializeAs="String">
<value>True</value>
</setting>
<setting name="Formatting_CommentWrapColumn" serializeAs="String">
<value>120</value>
</setting>
<setting name="Formatting_CommentRunDuringCleanup" serializeAs="String">
<value>False</value>
</setting>
<setting name="Cleaning_UpdateFileHeaderCSharp" serializeAs="String">
<value>// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
</value>
</setting>
<setting name="Reorganizing_PrimaryOrderByAccessLevel" serializeAs="String">
<value>True</value>
</setting>
<setting name="Cleaning_PerformPartialCleanupOnExternal" serializeAs="String">
<value>1</value>
</setting>
<setting name="Progressing_ShowBuildProgressOnBuildStart" serializeAs="String">
<value>False</value>
</setting>
</SteveCadwallader.CodeMaid.Properties.Settings>
</userSettings>
</configuration>
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>
78 changes: 78 additions & 0 deletions sdk/digitaltwins/Azure.DigitalTwins.Core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Azure IoT Digital Twin client library for .NET

This library provides access to the Azure Digital Twins service for managing twins, models, relationships, etc.

[Source code][source] | [Package (nuget)][package]

## Getting started

### Authenticate the Client

### Install the package

Install the Azure Digital Twins client library for .NET with [NuGet][nuget]:

```PowerShell
Install-Package Azure.DigitalTwins.Core
```
### Prerequisites

* An [Azure subscription][azure_sub].

## Key concepts

## Examples

## Developer guide

### Source code folder structure

### /src
The digital twins public client `DigitalTwinsClient` and the additional configuration options that can be sent to the digital twins service `DigitalTwinsClientOptions`.

### /src/swagger
The swagger file that defines the structure of the REST APIs used by the digital twins client library.

To generate the code, run the powershell script present [here](./src/generate.ps1).

### /src/Generated
The code generated by autorest using the swagger file defined under /src/swagger.

### /src/Customized
The customzied code written to override the following behavior of auto-generated code:
- Rename some of the generated types, eg. [GetModelsOptions](./src/Customized/Models/GetModelsOptions.cs)
- Declare some of the generated types as **internal**, instead of the autorest default of **public**.
- Declare some methods to accept input parameters as **strings** instead of **objects**.
- Declare some methods to return the response as **strings** instead of **objects**.

### /src/Models
Constants useful for use with the digital twins client.

### /src/Properties
Assembly properties required for running unit tests against signed assemblies in Debug mode.

### /src/Serialization
Serialization helpers provided to help serialize/deseralize commonly used types within the digital twins service.

Any time the client library code is updated, you will need to run the script [here](./../Export-AdtApis.ps1), which will update the corresponding API surface.

## Troubleshooting

## Next steps

## Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the [Microsoft Open Source Code of Conduct][code_of_conduct]. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

<!-- LINKS -->
[azure_cli]: https://docs.microsoft.com/cli/azure
[azure_sub]: https://azure.microsoft.com/free/
[source]: https://github.com/Azure/azure-sdk-for-net/tree/master/sdk/iot/adt
[package]: https://www.nuget.org/packages/Azure.IoT.DigitalTwins
[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
[nuget]: https://www.nuget.org/
[azure_core_library]: https://github.com/Azure/azure-sdk-for-net/tree/master/sdk/core/Azure.Core
Loading