-
Notifications
You must be signed in to change notification settings - Fork 5k
Planetarycomputer dotnet sdk public #50909
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
Open
shaktichetan23
wants to merge
40
commits into
main
Choose a base branch
from
planetarycomputer_dotnet_sdk_public
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
71516c5
add planetary computer sdk for dotnet
7052dfa
Update sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/…
shaktichetan23 4e370cc
Update sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/…
shaktichetan23 924bd2c
readme update
2ea9d94
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-net int…
27c8887
Merge branch 'planetarycomputer_dotnet_sdk' of https://github.com/Azu…
e87c14a
fix checks
b291f58
fix checks
9bb6c0a
fix recorded tests
0dd75c2
fix readme
18f94a0
fix readme 2
3f3f78b
fix readme 3
c44f01e
fix readme 4
540cc34
fix readme 5
63bd0a4
fix readme 6
8607be2
fix readme 7
4cc3354
ignore spell check for the word spatio
2d3ffa4
add planetary computer sdk for dotnet
9fd6464
readme update
bdc0f9e
Update sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/…
shaktichetan23 9c5b029
Update sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/…
shaktichetan23 e353f01
fix checks
66d8282
fix checks
7a59c22
fix recorded tests
9526fad
fix readme
459cde2
fix readme 2
25615cc
fix readme 3
79d46df
fix readme 4
b0dd914
fix readme 5
941855a
fix readme 6
af000b5
fix readme 7
fa44ba8
ignore spell check for the word spatio
c165a18
Merge branch 'planetarycomputer_dotnet_sdk' of https://github.com/Azu…
a9bb61b
change tsp location config
050ae1f
Update API surface files after code generation
3f086a6
Update sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/…
shaktichetan23 0f2d540
add codeowner
f8781b8
add codeowners
3888d8d
fix codeowners
3f9ef4c
fix codeowners
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
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
56 changes: 56 additions & 0 deletions
56
...puter/Azure.ResourceManager.PlanetaryComputer/Azure.ResourceManager.PlanetaryComputer.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,56 @@ | ||
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.ResourceManager.PlanetaryComputer.Samples", "samples\Azure.ResourceManager.PlanetaryComputer.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.PlanetaryComputer", "src\Azure.ResourceManager.PlanetaryComputer.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.PlanetaryComputer.Tests", "tests\Azure.ResourceManager.PlanetaryComputer.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.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 |
11 changes: 11 additions & 0 deletions
11
sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/CHANGELOG.md
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,11 @@ | ||
# Release History | ||
|
||
## 1.0.0-beta.1 (Unreleased) | ||
|
||
### Features Added | ||
|
||
### Breaking Changes | ||
|
||
### Bugs Fixed | ||
|
||
### Other Changes |
6 changes: 6 additions & 0 deletions
6
sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/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> |
174 changes: 174 additions & 0 deletions
174
sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer/README.md
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,174 @@ | ||
## Microsoft Azure PlanetaryComputer client library for .NET | ||
|
||
The `Azure.ResourceManager.PlanetaryComputer` SDK is the **.NET Management Plane SDK** for working with `GeoCatalog` resources under the **PlanetaryComputer** service. | ||
|
||
It supports full **CRUD operations**, as well as **recorded** and **playback testing** using the Azure SDK's standard test framework. | ||
|
||
--- | ||
|
||
## Project Structure | ||
|
||
``` | ||
sdk/ | ||
└── planetarycomputer/ | ||
└── Azure.ResourceManager.PlanetaryComputer/ | ||
├── src/ # Generated SDK source code | ||
├── tests/ | ||
│ ├── Scenario/ | ||
│ │ └── GeoCatalogCollectionTests.cs # Main scenario tests | ||
│ ├── PlanetaryComputerManagementTestBase.cs # Base test infrastructure | ||
│ └── PlanetaryComputerManagementTestEnvironment.cs | ||
├── Azure.ResourceManager.PlanetaryComputer.csproj | ||
├── Azure.ResourceManager.PlanetaryComputer.Tests.csproj | ||
└── assets.json # Required for test recording/playback | ||
``` | ||
|
||
--- | ||
|
||
## Getting started | ||
|
||
### Install the Package | ||
|
||
Install the package via [NuGet](https://www.nuget.org/): | ||
|
||
```bash | ||
dotnet add package Azure.ResourceManager.PlanetaryComputer --prerelease | ||
``` | ||
|
||
--- | ||
|
||
### Prerequisites | ||
|
||
- [.NET SDK 8.0+](https://dotnet.microsoft.com/download) | ||
- [Azure SDK Test Proxy](https://github.com/Azure/azure-sdk-tools/blob/main/tools/test-proxy/Azure.Sdk.Tools.TestProxy/README.md) | ||
```bash | ||
dotnet tool install --global Azure.Sdk.Tools.TestProxy | ||
``` | ||
- Logged in to Azure CLI: | ||
```bash | ||
az login | ||
``` | ||
- Set the following environment variables for test execution: | ||
|
||
```bash | ||
$env:AZURE_SUBSCRIPTION_ID = "<your-subscription-id>" | ||
$env:AZURE_TEST_MODE = "Record" # or "Playback" | ||
$env:AZURE_AUTHORITY_HOST = "https://login.microsoftonline.com" | ||
``` | ||
--- | ||
|
||
### Authenticate the Client | ||
|
||
To authenticate the client, use the `DefaultAzureCredential` from the Azure.Identity library. Ensure your environment is set up with the necessary Azure credentials. | ||
|
||
```csharp | ||
using Azure.Identity; | ||
using Azure.ResourceManager.PlanetaryComputer; | ||
|
||
var credential = new DefaultAzureCredential(); | ||
var client = new PlanetaryComputerManagementClient(credential); | ||
``` | ||
|
||
## Supported Tests | ||
|
||
| Test Name | Description | | ||
|----------------------------------|---------------------------------------------| | ||
| `CreateGeoCatalog` | Creates a GeoCatalog | | ||
| `UpdateGeoCatalog` | Updates an existing GeoCatalog | | ||
| `DeleteGeoCatalog` | Deletes a GeoCatalog | | ||
| `GetGeoCatalog` | Retrieves a specific GeoCatalog | | ||
| `ListGeoCatalogsInResourceGroup`| Lists GeoCatalogs in a resource group | | ||
| `ListGeoCatalogsBySubscription` | Lists GeoCatalogs under a subscription | | ||
| `CreateUpdateDeleteGeoCatalog` | Full CRUD scenario combined | | ||
|
||
--- | ||
|
||
## Running Tests | ||
|
||
### Record Mode (Live with Azure) | ||
|
||
1. Start the test proxy: | ||
```bash | ||
test-proxy | ||
``` | ||
2. Set mode: | ||
```bash | ||
$env:AZURE_TEST_MODE = "Record" | ||
``` | ||
3. Run a specific test: | ||
```bash | ||
dotnet test -f net8.0 --filter "Name=CreateUpdateDeleteGeoCatalog" | ||
``` | ||
4. Recordings are saved to: | ||
``` | ||
.azure-sdk-for-net/.assets/<hash>/net/sdk/PlanetaryComputer/Azure.ResourceManager.PlanetaryComputer/tests/SessionRecords | ||
``` | ||
|
||
--- | ||
|
||
### Playback Mode (Offline Testing) | ||
|
||
1. Set mode: | ||
```bash | ||
$env:AZURE_TEST_MODE = "Playback" | ||
``` | ||
2. (Optional) Restore recordings: | ||
```bash | ||
test-proxy restore -a ./assets.json | ||
``` | ||
3. Run test: | ||
```bash | ||
dotnet test -f net8.0 --filter "Name=CreateUpdateDeleteGeoCatalog" | ||
``` | ||
|
||
--- | ||
|
||
|
||
## Key concepts | ||
|
||
The PlanetaryComputer SDK provides management capabilities for GeoCatalog resources. Key concepts include: | ||
- **GeoCatalog**: Represents a catalog of geospatial data. | ||
- **CRUD Operations**: Create, Read, Update, and Delete operations for GeoCatalog resources. | ||
- **Authentication**: Uses Azure Active Directory for secure access. | ||
|
||
## Examples | ||
|
||
### Create a GeoCatalog | ||
|
||
```csharp | ||
var geoCatalogData = new GeoCatalogData(new AzureLocation("uksouth")) | ||
{ | ||
Properties = new GeoCatalogProperties | ||
{ | ||
Tier = CatalogTier.Basic | ||
} | ||
}; | ||
|
||
var geoCatalog = await client.GeoCatalogs.CreateOrUpdateAsync("resourceGroupName", "geoCatalogName", geoCatalogData); | ||
``` | ||
|
||
### List GeoCatalogs | ||
|
||
```csharp | ||
var geoCatalogs = await client.GeoCatalogs.ListAsync("resourceGroupName"); | ||
foreach (var catalog in geoCatalogs) | ||
{ | ||
Console.WriteLine(catalog.Name); | ||
} | ||
``` | ||
|
||
## Troubleshooting | ||
|
||
If you encounter issues, check the following: | ||
- Ensure Azure CLI is logged in (`az login`). | ||
- Verify the subscription and resource group names. | ||
- Check for network connectivity issues. | ||
|
||
## Next steps | ||
|
||
Explore additional features of the PlanetaryComputer SDK: | ||
- [Samples Repository](https://github.com/Azure/azure-sdk-for-net) | ||
|
||
## Contributing | ||
|
||
We welcome contributions! Please see our [Contributing Guide](https://github.com/Azure/azure-sdk-for-net/blob/main/CONTRIBUTING.md) for details on how to get started. |
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.