-
Notifications
You must be signed in to change notification settings - Fork 5.7k
1DP Azure AI Projects Typespec #33130
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
Changes from all commits
Commits
Show all changes
165 commits
Select commit
Hold shift + click to select a range
d47ca64
Draft of Unified AI Data Plane TypeSpec
needuv 3b16f0c
fix errors
needuv 7e3de07
add indexes to typespec
needuv c25ceb6
fix import
needuv c23d2ef
fix namespace
needuv de47def
clean up dataset and add in connections
needuv 7bc8b83
fix type discriminator and some bad references
needuv d752776
fix a typo in UriFileDatasetVersion
needuv bf7ac9a
remove body from DatasetContainer
needuv f8a1d4f
fix import
needuv a19baec
remove creds from connection
needuv 3f424dc
update index to match latest PR
needuv 25b8531
add credentials back to connection
needuv 538face
add getWithSecrets
needuv eca12fc
fix thing
needuv b916218
update connection based on spec feedback
needuv 3f26160
add fields to model typespec
needuv 51b3511
add query parameters
needuv efc3eaf
clean up evals namespace
needuv 464cf9b
change evaluations/create to evaluations:create
needuv 3daf517
fix typo
needuv fa63ef1
clean up common/models.tsp and add inference APIs
needuv 813f207
fix some errors and rename file
needuv 6c83724
Merge branch 'main' of https://github.com/Azure/azure-rest-api-specs …
needuv c1fd302
update with latest PR
needuv 7bd9414
make functiondefinition a common model
needuv bdfd6a3
fix a missing ;
needuv 23d5e2b
Asset contract changes (#32833)
adyada da96e87
fix some comments
needuv 37f9a36
fix some more comments
needuv 1eeebba
fix some more comments
needuv 82ca70a
fix up pending upload request names
needuv 6547b93
fix dataset route for pending upload
needuv 0d1be7a
attempt to move to azure core operations for connection only
needuv 71c492d
fix connections based on errors
needuv 39e24ae
attempt to fix credentials
needuv 6140053
fix connections list with secrets route
needuv b42737c
remove @route decorator
needuv 07026b8
make models into a resource
needuv c7ab298
remove connection paged response
needuv b717a1f
fix up some issues
needuv 23361ff
update index with latest spec
needuv 459530a
fix duped names
needuv cf4b9b8
fix thing
needuv 6a6c061
connection id is optional for embedding
needuv ef6206d
change index create to POST, add cosmosdb as connection type
needuv cf6afcb
fix tsp error
needuv 9c7951a
First
dargilco 8c827c0
Run `npx tsp format **\*.tsp` (#33117)
dargilco ddcad33
Merge branch 'feature/azure-ai-projects-1dp' of https://github.com/Az…
dargilco 6da4036
separate deployments from models
needuv b112157
Merge branch 'feature/azure-ai-projects-1dp' of https://github.com/Az…
needuv b0c8c8f
make asset base an alias
needuv 620252d
fix up some errors in tsp
needuv e02c662
Run `npx tsp format **\*.tsp` again
dargilco 1470b01
Revert change to client.tsp that got in prematurely. I'll send a PR f…
dargilco c156acc
Fix all compilation errors (#33143)
dargilco 025e612
Rename root folder to Azure.AI.Projects
needuv 7f74f9d
delete azure.ai.unified dir
needuv 91621e8
clean up connections
needuv 28ee55a
remove inference routes from tsp
needuv c83b455
Additional changes to support SDK emitters (#33184)
dargilco 3bde64e
update evaluations operations
needuv 4200597
Merge branch 'feature/azure-ai-projects-1dp' of https://github.com/Az…
needuv dd26409
fix id being optional
needuv 2d2713e
align to old naming
needuv 423cfa7
Rename package and folder to azure-ai-projects-dp1 (#33195)
dargilco eba4829
add visibility param to key
needuv 5afee09
Update ConnectionType enum (#33224)
dargilco 7afc1fc
Remove Extraneous Fields from Connection and Deployment (#33245)
needuv 94a064d
Dataset Review Feedback (#33252)
needuv 72c43a5
Add service pattern templates for 1dp azure ai projects (#33235)
johanste 18ae7d3
Change Name of Autoincrement API (#33353)
needuv 224e34e
Incorporate Index Feedback (#33243)
needuv 259fd62
Version-less Pending Upload API (#33399)
needuv 8e92721
Rename folder and namespace from Agents to Assistants (#33452)
dargilco 0358d69
Merge remote-tracking branch 'origin/main' into feature/azure-ai-proj…
dargilco 7ef8a1b
Fix some of the build breaks due to new TypeSpec tools
dargilco 7636ae6
Merge remote-tracking branch 'origin/main' into feature/azure-ai-proj…
dargilco 38a557e
Fix error due to new tools: `error deprecated: Deprecated: Implicit m…
dargilco 99c2ba2
Remove $ from query param, remove system data, align list/listLatest …
needuv 0ff89ea
Fix formt after running `npx tsp format **\*.tsp`
dargilco 44bd943
Bring over latest Agent typespec files from branch feature/azure-ai-p…
dargilco 253f637
Remove all $ from query params (#33512)
needuv b54a5bf
Add API key auth via the header `Authorization: Bearer <key>` (#33516)
dargilco ee7434e
Change connectionName to name (#33534)
needuv c6f364f
Fix startPendingUploadAutoIncrement (#33525)
dargilco a42d770
Merge remote-tracking branch 'origin/main' into feature/azure-ai-proj…
dargilco 8f4b306
Address some additional TypeSpec issues (#33566)
dargilco 6aa7a83
Azure ai projects eval result asset (#33544)
kseager a2cf44d
[Eval Service Team] Red Team Cloud 1DP (#33287)
kseager a7ebee8
Merge remote-tracking branch 'origin/main' into feature/azure-ai-proj…
dargilco 87ded34
Merge remote-tracking branch 'origin/main' into feature/azure-ai-proj…
dargilco fb20a8a
Remove credentials folder and fix some route names (#33587)
needuv 59765e4
Create a separate TypeSpec project for Assistants (#33586)
dargilco 146de83
Remove Azure.AI.Assistant TypeSpec from this branch
dargilco ec313e9
Add API Versions to Projects TypeSpec (#33631)
needuv b3f7bb6
Fix Spellcheck Gate for Projects TypeSpec (#33636)
needuv 7d7d9c1
Set the api-version used by emitted SDKs (#33642)
dargilco 7c15876
Fix output folder structure in emitted Python code
dargilco 0e94eff
Fix startPendingUpload path for versioned API (#33710)
needuv 942a952
Make sure this TypeSpec PR is green with regards to Python SDK emitte…
dargilco d88cedd
Fix C# SdkTspConfigValidation validation failures
dargilco 64e1df4
remove eval result from public (#33729)
kseager 34fb652
regenerate swagger (#33739)
needuv f5cc96a
Another round of updates to /connections, /datasets & /indexes operat…
dargilco 124f9c4
Update swagger files
dargilco 6808e70
Get download sas API (#33845)
andscho-msft 158c805
updated swaggers (#33898)
needuv ee66023
Users/singankit/evaluation create return 201 (#33946)
singankit 5281df4
Merge remote-tracking branch 'origin/main' into feature/azure-ai-proj…
dargilco cfbfe4a
Add connection operations with credentials (#33929)
dargilco ad7c697
Add PATCH for Asset Create/Update (#34021)
needuv fb7f51d
RedTeam Updates from implementation (#34023)
kseager b348cf3
Merge branch 'feature/azure-ai-projects-1dp' of https://github.com/Az…
dargilco d167b37
Merge remote-tracking branch 'origin/main' into feature/azure-ai-proj…
dargilco e18c2b3
Remove api-key auth (#34097)
dargilco 3daea95
Remove Asset PUT (#34133)
needuv 1826d5d
Update comment from `Assistants` to `Agents`, since we decided to use…
dargilco 3cad6f7
API for create agent evaluation run (#34034)
YusakuNo1 85bc07f
Fix TypeSpec compile errors from previous commit
dargilco 6c65932
Red-Team Target API Definition (#34144)
kseager 18ac3fe
fix spell check gate (#34181)
needuv 0f4d35b
Remove listing connections with credentials (#34148)
dargilco 8e6db4e
Switch AppInsights connection string to be mandatory for SDKs and add…
YusakuNo1 ca3a9a1
Merge remote-tracking branch 'origin/main' into feature/azure-ai-proj…
dargilco 0f04d88
Drop the 'onedp' name in emitted Python SDK package and folder
dargilco 1de9b3d
Update swagger
dargilco 88f1797
Auto fix to file red-teams/models.tsp after running `npx tsv .`
dargilco 6e1b668
Add Type Filter to Deployment List (#34247)
needuv cffd345
Fix SdkTspConfigValidation issues (#34248)
dargilco fc0e897
Merge branch 'feature/azure-ai-projects-1dp' of https://github.com/Az…
dargilco a7c428f
Add examples and readme.md for Azure.AI.Projects (#34220)
needuv c4cc5cf
fix spell check (#34253)
needuv eddee22
Merge remote-tracking branch 'origin/main' into feature/azure-ai-proj…
dargilco 791e17a
Fix Java language failure
dargilco 12693f9
Rename latest api version to v1 (#34288)
needuv 45d9ebe
Merge remote-tracking branch 'origin/main' into feature/azure-ai-proj…
dargilco 8a44a2e
Users/singankit/update evaluation name (#34301)
singankit 7169a24
Fix all Java, Go & Python issues in SdkTspConfigValidation when runni…
dargilco ae3b04f
Suppress JS emitter errors related to package and dir name missing th…
dargilco 364bf26
Merge remote-tracking branch 'origin/main' into feature/azure-ai-proj…
dargilco 1ada3b6
Address comments from SDK review meeting (#34273)
dargilco a1a907a
asset contract changes. (#34197)
adyada 8bd4f87
Fix Dataset Swagger Validation (#34339)
needuv 287eea2
Additional round of updates (#34333)
dargilco ef6f829
Merge remote-tracking branch 'origin/main' into feature/azure-ai-proj…
dargilco 9f83acd
Add continuationToken decorator for dataset/index list (#34372)
needuv dfb5351
Update scope
dargilco cef2df3
Usesr/singankit/evaluation review feedback (#34427)
singankit 6955430
Fix typo in doc string
dargilco e4c203f
Fix Swagger Avocado
dargilco 8de48d8
Merge remote-tracking branch 'origin/main' into feature/azure-ai-proj…
dargilco 57e9831
Add evaluation Id (#34391)
YusakuNo1 2ba3e2e
Merge remote-tracking branch 'origin/main' into feature/azure-ai-proj…
dargilco be01be1
Add missing connection id (#34434)
dargilco b12cfaa
[Red Team] clean-up contract details (#34444)
kseager 11c4578
Make PATCH Content-Type Header application/merge-patch+json (#34449)
needuv 6f9fde3
Remove List Query Parameters and Dataset Credentials Body (#34471)
needuv a5177ca
Add Index Field Mapping (#34476)
needuv 04f19c9
Merge remote-tracking branch 'origin/main' into feature/azure-ai-proj…
dargilco 0075ada
Remove pagination query params from the /connection list operation (#…
dargilco 8c6ed71
Merge remote-tracking branch 'origin/main' into feature/azure-ai-proj…
dargilco 101e4e0
Add optional connectionName to DatasetVersion (#34521)
dargilco 07a63ad
Fix TypeSpec Validation and Address Minor Feedback (#34536)
needuv 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import "@azure-tools/typespec-client-generator-core"; | ||
| import "./main.tsp"; | ||
|
|
||
| using Azure.ClientGenerator.Core; | ||
|
|
||
| @@clientName(Azure.AI.Projects, "AIProjectClient"); | ||
|
|
||
| // Shorter method names for SDK datasets operations | ||
| @@clientName(Azure.AI.Projects.Datasets.listLatest, "list"); | ||
| @@clientName(Azure.AI.Projects.Datasets.getVersion, "get"); | ||
| @@clientName(Azure.AI.Projects.Datasets.deleteVersion, "delete"); | ||
| @@clientName(Azure.AI.Projects.Datasets.createOrUpdateVersion, | ||
| "createOrUpdate" | ||
| ); | ||
| @@clientName(Azure.AI.Projects.Datasets.startPendingUploadVersion, | ||
| "pendingUpload" | ||
| ); | ||
|
|
||
| // Shorter method names for SDK Index operations | ||
| @@clientName(Azure.AI.Projects.Indexes.listLatest, "list"); | ||
| @@clientName(Azure.AI.Projects.Indexes.getVersion, "get"); | ||
| @@clientName(Azure.AI.Projects.Indexes.deleteVersion, "delete"); | ||
| @@clientName(Azure.AI.Projects.Indexes.createOrUpdateVersion, "createOrUpdate"); | ||
|
|
||
| // In Python, the emitter changes "keys" to "keys_property", since there is already | ||
| // a "keys" method in the generated code due to usage of MutableMapping. Call it credential_keys instead. | ||
| @@clientName(Azure.AI.Projects.CustomCredential.keys, | ||
| "credential_keys", | ||
| "python" | ||
| ); | ||
|
|
||
| // Make these two internal, since all SDKs hand-write a single public method with boolean "includeCredentials" | ||
| // input parameter that calls either on these two. | ||
| @@access(Azure.AI.Projects.Connections.get, Access.internal); | ||
| @@access(Azure.AI.Projects.Connections.getWithCredentials, Access.internal); | ||
|
|
||
| // For some reason for Python the emitter creates an empty ServicePatternsOperations operation | ||
| // class. Mark it as internal here. Apply to all languages just in case. | ||
| //@@access(Azure.AI.Projects.ServicePatterns, Access.internal); <== this did not work. It makes all methods internal. |
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,117 @@ | ||
| import "@typespec/rest"; | ||
| import "@typespec/versioning"; | ||
| import "@azure-tools/typespec-azure-core"; | ||
| import "@azure-tools/typespec-azure-resource-manager"; | ||
|
|
||
| namespace Azure.AI.Projects; | ||
|
|
||
| alias AssetBase = { | ||
| @doc("Asset ID, a unique identifier for the asset") | ||
| @visibility(Lifecycle.Read) | ||
| id?: string; | ||
|
|
||
| @doc("The name of the resource") | ||
| @visibility(Lifecycle.Read) | ||
| @key | ||
| name: string; | ||
|
|
||
| @doc("The version of the resource") | ||
| @visibility(Lifecycle.Read) | ||
| version: string; | ||
|
|
||
| @doc("The asset description text.") | ||
| @visibility(Lifecycle.Create, Lifecycle.Update) | ||
| description?: string; | ||
|
|
||
| @doc("Tag dictionary. Tags can be added, removed, and updated.") | ||
| @visibility(Lifecycle.Create, Lifecycle.Update) | ||
| tags?: Record<string>; | ||
| }; | ||
|
|
||
| #suppress "@azure-tools/typespec-providerhub/no-inline-model" "Need to create responses correctly" | ||
| alias ResourceCreatedResponse<T extends TypeSpec.Reflection.Model> = TypeSpec.Http.Response<201> & | ||
| T; | ||
|
|
||
| #suppress "@azure-tools/typespec-providerhub/no-inline-model" "Need to create responses correctly" | ||
| alias OkResponse<T extends TypeSpec.Reflection.Model> = TypeSpec.Http.Response<200> & | ||
| T; | ||
|
|
||
| // Pending upload spec | ||
|
|
||
| // Define a URI alias for clarity. | ||
| alias Uri = string; | ||
|
|
||
| @doc("The type of pending upload.") | ||
| union PendingUploadType { | ||
| string, | ||
|
|
||
| @doc("No pending upload.") | ||
| none: "None", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't use Pascal case in the API. |
||
|
|
||
| @doc("Blob Reference is the only supported type.") | ||
| BlobReference: "BlobReference", | ||
| } | ||
|
|
||
| @doc("The type of credential used to access the storage account.") | ||
| union PendingUploadCredentialType { | ||
| string, | ||
|
|
||
| @doc("SAS credential type.") | ||
| sas: "SAS", | ||
| } | ||
|
|
||
| @doc("Represents a request for a pending upload.") | ||
| model PendingUploadRequest { | ||
| @doc("If PendingUploadId is not provided, a random GUID will be used.") | ||
| pendingUploadId?: string; | ||
|
|
||
| @doc("Azure Storage Account connection name to use for generating temporary SAS token") | ||
| connectionName?: string; | ||
|
|
||
| @doc("BlobReference is the only supported type.") | ||
| pendingUploadType: PendingUploadType.BlobReference; | ||
| } | ||
|
|
||
| @doc("Represents the response for a pending upload request") | ||
| model PendingUploadResponse { | ||
| @doc("Container-level read, write, list SAS.") | ||
| blobReference: BlobReference; | ||
|
|
||
| @doc("ID for this upload request.") | ||
| pendingUploadId: string; | ||
|
|
||
| @doc("Version of asset to be created if user did not specify version when initially creating upload") | ||
| version?: string; | ||
|
|
||
| @doc("BlobReference is the only supported type") | ||
| pendingUploadType: PendingUploadType.BlobReference; | ||
| } | ||
|
|
||
| @doc("SAS Credential definition") | ||
| model SasCredential { | ||
| @doc("SAS uri") | ||
| @visibility(Lifecycle.Read) | ||
| sasUri: string; | ||
|
|
||
| @visibility(Lifecycle.Read) | ||
| @doc("Type of credential") | ||
| type: "SAS"; | ||
| } | ||
|
|
||
| @doc("Blob reference details.") | ||
| model BlobReference { | ||
| @doc("Blob URI path for client to upload data. Example: https://blob.windows.core.net/Container/Path") | ||
| blobUri: Uri; | ||
|
|
||
| @doc("ARM ID of the storage account to use.") | ||
| storageAccountArmId: string; | ||
|
|
||
| @doc("Credential info to access the storage account.") | ||
| credential: SasCredential; | ||
| } | ||
|
|
||
| @doc("Represents a reference to a blob for consumption") | ||
| model AssetCredentialResponse { | ||
| @doc("Credential info to access the storage account.") | ||
| blobReference: BlobReference; | ||
| } | ||
157 changes: 157 additions & 0 deletions
157
specification/ai/Azure.AI.Projects/connections/models.tsp
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,157 @@ | ||
| import "@typespec/rest"; | ||
| import "@azure-tools/typespec-autorest"; | ||
| import "@typespec/versioning"; | ||
| import "@azure-tools/typespec-azure-core"; | ||
| import "@typespec/openapi"; | ||
| import "@typespec/versioning"; | ||
|
|
||
| using TypeSpec.Rest; | ||
| using TypeSpec.Versioning; | ||
|
|
||
| namespace Azure.AI.Projects; | ||
|
|
||
| @doc("Response from the list and get connections operations") | ||
| @resource("connections") | ||
| @added(Versions.v2025_05_01) | ||
| model Connection { | ||
dargilco marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| @doc("The friendly name of the connection, provided by the user.") | ||
| @visibility(Lifecycle.Read) | ||
| @key("name") | ||
| name: string; | ||
|
|
||
| @doc("A unique identifier for the connection, generated by the service") | ||
| @visibility(Lifecycle.Read) | ||
| id: string; | ||
|
|
||
| @doc("Category of the connection") | ||
| @visibility(Lifecycle.Read) | ||
| type: ConnectionType; | ||
|
|
||
| @doc("The connection URL to be used for this service") | ||
| @visibility(Lifecycle.Read) | ||
| target: string; | ||
|
|
||
| @doc("Whether the connection is tagged as the default connection of its type") | ||
| @visibility(Lifecycle.Read) | ||
| isDefault: boolean; | ||
|
|
||
| @doc("The credentials used by the connection") | ||
| @visibility(Lifecycle.Read) | ||
| credentials: BaseCredentials; | ||
|
|
||
| @doc("Metadata of the connection") | ||
| @visibility(Lifecycle.Read) | ||
| metadata: Record<string>; | ||
| } | ||
|
|
||
| @doc("A base class for connection credentials") | ||
| @discriminator("type") | ||
| model BaseCredentials { | ||
| @doc("The type of credential used by the connection") | ||
| @visibility(Lifecycle.Read) | ||
| type: CredentialType; | ||
| } | ||
|
|
||
| @doc("API Key Credential definition") | ||
| model ApiKeyCredentials extends BaseCredentials { | ||
| @doc("The credential type") | ||
| @visibility(Lifecycle.Read) | ||
| type: CredentialType.apiKey; | ||
|
|
||
| @doc("API Key") | ||
| @visibility(Lifecycle.Read) | ||
| @encodedName("application/json", "key") | ||
| apiKey?: string; | ||
| } | ||
|
|
||
| #suppress "@azure-tools/typespec-azure-core/casing-style" | ||
| @doc("Entra ID credential definition") | ||
| model EntraIDCredentials extends BaseCredentials { | ||
| @doc("The credential type") | ||
| @visibility(Lifecycle.Read) | ||
| type: CredentialType.entraId; | ||
| } | ||
|
|
||
| @doc("Custom credential definition") | ||
| model CustomCredential extends BaseCredentials { | ||
| @doc("The credential type") | ||
| @visibility(Lifecycle.Read) | ||
| type: CredentialType.custom; | ||
|
|
||
| @doc("The credential type") | ||
| @visibility(Lifecycle.Read) | ||
| keys: Record<string>; | ||
| } | ||
|
|
||
| #suppress "@azure-tools/typespec-azure-core/casing-style" | ||
| @doc("Shared Access Signature (SAS) credential definition") | ||
| model SASCredentials extends BaseCredentials { | ||
| @doc("The credential type") | ||
| @visibility(Lifecycle.Read) | ||
| type: CredentialType.SAS; | ||
|
|
||
| @doc("SAS token") | ||
| @visibility(Lifecycle.Read) | ||
| @encodedName("application/json", "SAS") | ||
| sasToken?: string; | ||
| } | ||
|
|
||
| @doc("Credentials that do not require authentication") | ||
| model NoAuthenticationCredentials extends BaseCredentials { | ||
| @doc("The credential type ") | ||
| @visibility(Lifecycle.Read) | ||
| type: CredentialType.None; | ||
| } | ||
|
|
||
| // https://learn.microsoft.com/rest/api/azureml/workspace-connections/list-secrets?view=rest-azureml-2024-04-01&tabs=HTTP#ConnectionType | ||
| @doc("The Type (or category) of the connection") | ||
| union ConnectionType { | ||
dargilco marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| string, | ||
|
|
||
| @doc("Azure OpenAI Service") | ||
| AzureOpenAI: "AzureOpenAI", //TODO: In Python this results in .AZURE_OPEN_AI. How do I make it .AZURE_OPENAI? | ||
|
|
||
| @doc("Azure Blob Storage, with specified container") | ||
| AzureBlobStorage: "AzureBlob", | ||
|
|
||
| @doc("Azure Blob Storage, with container not specified (used by Agents)") | ||
| AzureStorageAccount: "AzureStorageAccount", | ||
|
|
||
| @doc("Azure AI Search") | ||
| AzureAISearch: "CognitiveSearch", | ||
|
|
||
| @doc("CosmosDB") | ||
| CosmosDB: "CosmosDB", | ||
|
|
||
| @doc("Generic connection that uses API Key authentication") | ||
| APIKey: "ApiKey", | ||
|
|
||
| @doc("Application Configuration") | ||
| ApplicationConfiguration: "AppConfig", | ||
|
|
||
| @doc("Application Insights") | ||
| ApplicationInsights: "AppInsights", | ||
|
|
||
| @doc("Custom Keys") | ||
| Custom: "CustomKeys", | ||
| } | ||
|
|
||
| @doc("The credential type used by the connection") | ||
| union CredentialType { | ||
| string, | ||
|
|
||
| @doc("API Key credential") | ||
| apiKey: "ApiKey", | ||
|
|
||
| @doc("Entra ID credential (formerly known as AAD)") | ||
| entraId: "AAD", | ||
|
|
||
| @doc("Shared Access Signature (SAS) credential") | ||
| SAS: "SAS", | ||
|
|
||
| @doc("Custom credential") | ||
| custom: "CustomKeys", | ||
|
|
||
| @doc("No credential") | ||
| None: "None", | ||
| } | ||
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,47 @@ | ||
| import "@typespec/rest"; | ||
| import "@azure-tools/typespec-autorest"; | ||
| import "@typespec/versioning"; | ||
| import "@azure-tools/typespec-azure-core"; | ||
| import "./models.tsp"; | ||
|
|
||
| using TypeSpec.Http; | ||
| using Azure.Core.Traits; | ||
| using TypeSpec.Versioning; | ||
|
|
||
| namespace Azure.AI.Projects; | ||
|
|
||
| alias ConnectionServiceTraits = SupportsClientRequestId & | ||
| NoRepeatableRequests & | ||
| NoConditionalRequests; | ||
|
|
||
| alias ConnectionOperations = Azure.Core.ResourceOperations<ConnectionServiceTraits>; | ||
|
|
||
| @added(Versions.v2025_05_01) | ||
| interface Connections { | ||
| @doc("Get a connection by name, without populating connection credentials") | ||
| get is ConnectionOperations.ResourceRead<Connection>; | ||
dargilco marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| @doc("Get a connection by name, with its connection credentials") | ||
| @TypeSpec.Http.post | ||
| @Rest.actionSeparator("/") | ||
| @Rest.action("getConnectionWithCredentials") | ||
| getWithCredentials is ConnectionOperations.ResourceAction< | ||
| Connection, | ||
| {}, | ||
| Connection | ||
| >; | ||
|
|
||
| @doc("List all connections in the project, without populating connection credentials") | ||
| list is ConnectionOperations.ResourceList< | ||
| Connection, | ||
| ListQueryParametersTrait<{ | ||
| @doc("List connections of this specific type") | ||
| @query("connectionType") | ||
| connectionType?: ConnectionType; | ||
|
|
||
| @doc("List connections that are default connections") | ||
| @query("defaultConnection") | ||
| defaultConnection?: boolean; | ||
| }> | ||
| >; | ||
| } | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When would an asset not have an ID?