import "@typespec/rest"; import "@azure-tools/typespec-azure-resource-manager"; import "./helpers.tsp"; using TypeSpec.Http; using TypeSpec.Rest; using TypeSpec.Versioning; using Azure.Core; using Azure.ResourceManager; namespace Microsoft.ContainerService; #suppress "@azure-tools/typespec-azure-core/casing-style" "AIManager is a valid name" @doc("The AI Manager namespace resource.") @resource("namespaces") @parentResource(AIManager) model AIManagerNamespace is ProxyResource { ...ResourceNameParameter< Resource = AIManagerNamespace, KeyName = "namespaceName", SegmentName = "namespaces", NamePattern = "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" >; ...EntityTagProperty; } #suppress "@azure-tools/typespec-azure-core/casing-style" "AIManager is a valid name" @doc("AI Manager namespace properties.") model AIManagerNamespaceProperties { @visibility(Lifecycle.Read) @doc("The status of the last operation.") provisioningState?: AIManagerNamespaceProvisioningState; #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "Records is the most semantically correct choice for this use-case" @doc("Labels applied to the Kubernetes namespace.") labels?: Record; #suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "Records is the most semantically correct choice for this use-case" @doc("Annotations applied to the Kubernetes namespace.") annotations?: Record; } @doc("The provisioning state of the AI Manager namespace resource.") union AIManagerNamespaceProvisioningState { string, ResourceProvisioningState, @doc("The provisioning state of a namespace being created.") Creating: "Creating", @doc("The provisioning state of a namespace being updated.") Updating: "Updating", @doc("The provisioning state of a namespace being deleted.") Deleting: "Deleting", } #suppress "@azure-tools/typespec-azure-core/casing-style" "AIManager is a valid name" @armResourceOperations interface AIManagerNamespaces { get is ArmResourceRead; createOrUpdate is ArmResourceCreateOrUpdateAsync< AIManagerNamespace, Azure.ResourceManager.Foundations.BaseParameters & IfMatchParameters & IfNoneMatchParameters >; delete is ArmResourceDeleteWithoutOkAsync< AIManagerNamespace, Azure.ResourceManager.Foundations.BaseParameters & IfMatchParameters >; #suppress "@azure-tools/typespec-azure-core/casing-style" "AIManager is a valid name" listByAIManager is ArmResourceListByParent; @doc("Lists the credentials of an AI Manager namespace.") @post @action("listCredential") listCredential is ArmResourceActionSync< AIManagerNamespace, void, ArmResponse >; @added(Versions.v2026_05_02_preview) @doc("Returns the namespace-scoped LLM gateway endpoint and the API keys clients use to authenticate against it.") @post @action("listAccessInfo") listAccessInfo is ArmResourceActionSync< AIManagerNamespace, void, ArmResponse >; } @added(Versions.v2026_05_02_preview) @doc("Access information for an AI Manager namespace, including the OpenAI-compatible gateway endpoint and the API keys used to authenticate against it.") model NamespaceAccessInfo { @doc("OpenAI-compatible base URL, e.g. \"https://team-alpha...aksapp.io/v1\".") endpoint: url; @secret @doc("Primary API key. Send as `Authorization: Bearer ` (or `api-key: `, depending on client). Treat as secret; do not log or persist in plaintext.") primaryKey: string; @secret @doc("Secondary API key, for zero-downtime rotation. Same usage as `primaryKey`.") secondaryKey: string; @doc("UTC time the keys were last rotated. Clients can use this to detect rotation and refresh cached credentials.") lastRotatedAt?: utcDateTime; } @@maxLength(AIManagerNamespace.name, 63); @@minLength(AIManagerNamespace.name, 1); @@doc(AIManagerNamespace.name, "The name of the AI Manager namespace resource." );