diff --git a/specification/ai/Azure.AI.Projects/common/models.tsp b/specification/ai/Azure.AI.Projects/common/models.tsp index 5b9c8f7e116e..c7f85775143c 100644 --- a/specification/ai/Azure.AI.Projects/common/models.tsp +++ b/specification/ai/Azure.AI.Projects/common/models.tsp @@ -233,11 +233,12 @@ alias AssetBase = { @doc("The name of the resource") @visibility("read") - name?: string; + @key + name: string; @doc("The version of the resource") @visibility("read") - version?: string; + version: string; @doc("The asset description text.") description?: string; @@ -250,11 +251,11 @@ alias AssetBase = { systemData?: SystemData; }; -#suppress "@azure-tools/typespec-providerhub/no-inline-model" "Need to create reponses correctly" +#suppress "@azure-tools/typespec-providerhub/no-inline-model" "Need to create responses correctly" alias ResourceCreatedResponse = TypeSpec.Http.Response<201> & T; -#suppress "@azure-tools/typespec-providerhub/no-inline-model" "Need to create reponses correctly" +#suppress "@azure-tools/typespec-providerhub/no-inline-model" "Need to create responses correctly" alias OkResponse = TypeSpec.Http.Response<200> & T; diff --git a/specification/ai/Azure.AI.Projects/datasets/models.tsp b/specification/ai/Azure.AI.Projects/datasets/models.tsp index 8a5ad927dba5..12bae6a70631 100644 --- a/specification/ai/Azure.AI.Projects/datasets/models.tsp +++ b/specification/ai/Azure.AI.Projects/datasets/models.tsp @@ -29,6 +29,7 @@ union DatasetType { #suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" @doc("DatasetVersion Definition") +@Rest.resource("datasets") @discriminator("type") model DatasetVersion { @doc("[Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330") @@ -61,16 +62,3 @@ model FolderDatasetVersion extends DatasetVersion { @doc("Dataset type") type: DatasetType.uri_folder; } - -@doc("PagedDataVersionBase Definition") -@pagedResult -model PagedDatasetVersion { - @doc("The list of DatasetVersions.") - @extension("x-ms-identifiers", []) - @items - value: DatasetVersion[]; - - @doc("The link to the next page of results, if any.") - @nextLink - nextLink?: string; -} diff --git a/specification/ai/Azure.AI.Projects/datasets/routes.tsp b/specification/ai/Azure.AI.Projects/datasets/routes.tsp index 7ae21d773909..3570aeaf96ed 100644 --- a/specification/ai/Azure.AI.Projects/datasets/routes.tsp +++ b/specification/ai/Azure.AI.Projects/datasets/routes.tsp @@ -4,6 +4,7 @@ import "@typespec/versioning"; import "@azure-tools/typespec-azure-core"; import "../common/models.tsp"; import "./models.tsp"; +import "../servicepatterns.tsp"; using TypeSpec.Http; using TypeSpec.Rest; @@ -14,123 +15,47 @@ using Azure.Core.Foundations; namespace Azure.AI.Projects; -interface Datasets { - #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @doc("List latest version of each dataset in a project.") - @route("/datasets") - @get - listLatestDatasets( - @doc("Continuation token for pagination. This is the nextLink from the previous response.") - @query("$continuationToken") - $continuationToken?: string, - - @doc("View type for including/excluding (for example) archived entities.") - @query("listViewType") - listViewType?: ListViewType, - ): PagedDatasetVersion; - - #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @doc("List dataset versions of a specific dataset") - @route("/datasets/{name}/versions") - @get - listDatasetVersions( - @doc("Container name.") - @pattern("^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$") - @path - name: string, - - @doc("Please choose OrderBy value from ['createdtime', 'modifiedtime']") - @query("$orderBy") - $orderBy?: string, - - @doc("Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned") - @query("$top") - $top?: int32, - - @doc("Continuation token for pagination.") - @query("$skip") - $skip?: string, - - @doc("Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2") - @query("$tags") - $tags?: string, - - @doc("[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities.") - @query("listViewType") - listViewType?: ListViewType, - ): PagedDatasetVersion; - - #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @doc("Delete version.") - @route("/datasets/{name}/versions/{version}") - @delete - deleteVersion( - @doc("Container name.") - @pattern("^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$") - @path - name: string, - - @doc("Version identifier.") - @path - version: string, - ): void; - - #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @doc("Get dataset version.") - @route("/datasets/{name}/versions/{version}") - @get - getVersion( - @doc("Container name.") - @pattern("^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$") - @path - name: string, - - @doc("Version identifier.") - @path - version: string, - ): DatasetVersion; - - #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @doc("Create or update version.") - @route("/datasets/{name}/versions/{version}") - @put - createOrUpdate( - @doc("Container name.") - @pattern("^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$") - @path - name: string, - - @doc("Version identifier.") - @path - version: string, - - @doc("Version entity to create or update.") - @body - datasetVersion: DatasetVersion, - ): DatasetVersion; - - #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @doc("Start pending upload.") - @post - @route("/datasets/{name}/versions/{version}/startPendingUpload") - createOrGetStartPendingUpload( - @doc("Container name.") - @pattern("^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$") - @path - name: string, - - @doc("Version identifier.") - @path - version: string, - - @doc("Pensing upload request.") - @body - pendingUploadRequest: PendingUploadRequest, - ): PendingUploadResponse; +alias ListDatasetVersionsParameters = { + @doc("Please choose OrderBy value from ['createdtime', 'modifiedtime']") + @query("$orderBy") + $orderBy?: string; + + @doc("Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned") + @query("$top") + $top?: int32; + + @doc("Continuation token for pagination.") + @query("$skip") + $skip?: string; + + @doc("Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2") + @query("$tags") + $tags?: string; + + @doc("[ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities.") + @query("listViewType") + listViewType?: ListViewType; +}; + +alias ListLatestDataSetVersionParameters = { + @doc("View type for including/excluding (for example) archived entities.") + @query("listViewType") + listViewType?: ListViewType; +}; + +#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "We are using service specific operation templates" +interface Datasets + extends ServicePatterns.VersionedOperations< + DatasetVersion, + ListLatestDataSetVersionParameters, + ListDatasetVersionsParameters + > { + /** + * Create or start a pending upload of a dataset + */ + startPendingUpload is ServicePatterns.VersionedResourceAction< + DatasetVersion, + PendingUploadRequest, + PendingUploadResponse + >; } diff --git a/specification/ai/Azure.AI.Projects/evaluations/routes.tsp b/specification/ai/Azure.AI.Projects/evaluations/routes.tsp index 149e390f1d38..d56315a30c94 100644 --- a/specification/ai/Azure.AI.Projects/evaluations/routes.tsp +++ b/specification/ai/Azure.AI.Projects/evaluations/routes.tsp @@ -36,7 +36,7 @@ interface Evaluations { @post createRun is Azure.Core.Foundations.Operation< { - @doc("Evalution to be run") + @doc("Evaluation to be run") @body evaluation: Evaluation; }, diff --git a/specification/ai/Azure.AI.Projects/indexes/models.tsp b/specification/ai/Azure.AI.Projects/indexes/models.tsp index 7e192328b51f..a4f289fd4a44 100644 --- a/specification/ai/Azure.AI.Projects/indexes/models.tsp +++ b/specification/ai/Azure.AI.Projects/indexes/models.tsp @@ -16,6 +16,7 @@ namespace Azure.AI.Projects; @doc("Index resource Definition") @discriminator("indexType") +@Rest.resource("indexes") model Index { @doc("Type of index") indexType: IndexType; @@ -23,19 +24,6 @@ model Index { ...AssetBase; } -@doc("Paged collection of Index items.") -@pagedResult -model PagedIndex { - @doc("The list of Indexes.") - @extension("x-ms-identifiers", []) - @items - value: Index[]; - - @doc("The link to the next page of items") - @nextLink - nextLink?: ResourceLocation; -} - @doc("Azure AI Search Index Definition") model AzureAISearchIndex extends Index { @doc("Type of index") diff --git a/specification/ai/Azure.AI.Projects/indexes/routes.tsp b/specification/ai/Azure.AI.Projects/indexes/routes.tsp index 021729279788..e3119bf35698 100644 --- a/specification/ai/Azure.AI.Projects/indexes/routes.tsp +++ b/specification/ai/Azure.AI.Projects/indexes/routes.tsp @@ -3,6 +3,7 @@ import "@azure-tools/typespec-autorest"; import "@typespec/versioning"; import "@azure-tools/typespec-azure-core"; import "./models.tsp"; +import "../servicepatterns.tsp"; using TypeSpec.Http; using TypeSpec.Rest; @@ -13,106 +14,36 @@ using Azure.Core.Foundations; namespace Azure.AI.Projects; -interface Indexes { - #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @doc("List latest version of each dataset in a project.") - @route("/indexes") - @get - listLatestIndexes( - @doc("Continuation token for pagination. This is the nextLink from the previous response.") - @query("$continuationToken") - $continuationToken?: string, - - @doc("View type for including/excluding (for example) archived entities.") - @query("listViewType") - listViewType?: ListViewType, - ): PagedDatasetVersion; - - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Waiting for bug fix: https://github.com/Azure/typespec-azure-pr/issues/3739." - @doc("Get a specific version of an Index.") - @route("/indexes/{name}/versions/{version}") - @get - get is Azure.Core.Foundations.Operation< - { - @doc("Name of the index.") - @pattern("^[a-zA-Z0-9][a-zA-Z0-9-_]*$") - @maxLength(254) - @path - name: string; - - @doc("Version of the index.") - @path - version: string; - }, - Index - >; - - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Waiting for bug fix: https://github.com/Azure/typespec-azure-pr/issues/3739." - @doc("Creates or updates a IndexVersion.") - @route("/indexes/{name}:create") - @post - createIndex is Azure.Core.Foundations.Operation< - { - @doc("Name of the index.") - @pattern("^[a-zA-Z0-9][a-zA-Z0-9-_]*$") - @maxLength(254) - @path - name: string; - - @doc("Properties of an Index Version.") - @bodyRoot - body: Index; - }, - ResourceCreatedOrOkResponse - >; - - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" "Need to use same model in both list calls." - @doc("List the versions of an Index given the name.") - @route("/indexes/{name}/versions") - @get - listIndexVersions is Azure.Core.Foundations.Operation< - { - @doc("Name of the index.") - @pattern("^[a-zA-Z0-9][a-zA-Z0-9-_]*$") - @maxLength(254) - @path - name: string; - - @doc("View type for including/excluding (for example) archived entities.") - @query - listViewType: string = "ActiveOnly"; - - @doc("Ordering of list: Please choose orderby value from ['createdAt', 'lastModifiedAt'].") - @query - orderBy?: string; - - @doc("Ordering of list: Please choose orderby value from ['createdAt', 'lastModifiedAt'].") - @query - orderby?: string; - - @doc("Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2.") - @query - tags?: string; - - ...StandardListQueryParameters; - }, - PagedIndex - >; - - #suppress "@azure-tools/typespec-azure-core/operation-missing-api-version" - #suppress "@azure-tools/typespec-azure-core/use-standard-operations" - @doc("Delete version.") - @route("/indexes/{name}/versions/{version}") - @delete - deleteVersion( - @doc("Container name.") - @pattern("^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$") - @path - name: string, - - @doc("Version identifier.") - @path - version: string, - ): void; -} +alias ListIndexVersionParameters = { + @doc("View type for including/excluding (for example) archived entities.") + @query + listViewType: string = "ActiveOnly"; + + @doc("Ordering of list: Please choose orderby value from ['createdAt', 'lastModifiedAt'].") + @query + orderBy?: string; + + @doc("Ordering of list: Please choose orderby value from ['createdAt', 'lastModifiedAt'].") + @query + orderby?: string; + + @doc("Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2.") + @query + tags?: string; + + ...StandardListQueryParameters; +}; + +alias ListLatestIndexParameters = { + @doc("View type for including/excluding (for example) archived entities.") + @query("listViewType") + listViewType?: ListViewType; +}; + +#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "We are using service specific operation templates" +interface Indexes + extends ServicePatterns.VersionedOperations< + Index, + ListLatestIndexParameters, + ListIndexVersionParameters + > {} diff --git a/specification/ai/Azure.AI.Projects/servicepatterns.tsp b/specification/ai/Azure.AI.Projects/servicepatterns.tsp new file mode 100644 index 000000000000..a873b0f9d3c2 --- /dev/null +++ b/specification/ai/Azure.AI.Projects/servicepatterns.tsp @@ -0,0 +1,121 @@ +import "@typespec/http"; +import "@typespec/rest"; +import "@azure-tools/typespec-azure-core"; + +namespace Azure.AI.Projects.ServicePatterns { + @Rest.autoRoute + interface VersionedOperations< + TEntityType extends Reflection.Model, + TListLatestParameters extends Reflection.Model = {}, + TListVersionsParameters extends Reflection.Model = {} + > { + #suppress "@azure-tools/typespec-azure-core/verb-conflict" "We are using the resource action as a building block." + @doc("List all versions of the given {name}", TEntityType) + @Rest.action("versions") + @Rest.actionSeparator("/") + @Http.get + listVersions is BuildingBlocks.CoreOps.ResourceAction< + TEntityType, + TListVersionsParameters, + Azure.Core.Page + >; + + @doc("List the latest version of each {name}", TEntityType) + @Rest.listsResource(TEntityType) + listLatest is Azure.Core.Foundations.ResourceList< + TEntityType, + TListLatestParameters, + Azure.Core.Page + >; + + @doc("Get the specific version of the {name}", TEntityType) + getVersion is Azure.Core.Foundations.ResourceOperation< + TEntityType, + { + @doc("The specific version id of the {name} to retrieve.", TEntityType) + @Rest.segment("versions") + @Http.path + version: string; + }, + Azure.Core.Foundations.ResourceOkResponse + >; + + @doc("Delete the specific version of the {name}", TEntityType) + @Http.delete + deleteVersion is Azure.Core.Foundations.ResourceOperation< + TEntityType, + { + @doc("The version of the {name} to delete.", TEntityType) + @Rest.segment("versions") + @Http.path + version: string; + }, + Http.NoContentResponse + >; + + @doc( + "Create a new {name}. The version id will be generated by the service.", + TEntityType + ) + @Rest.actionSeparator("/") + versions is BuildingBlocks.RepeatableCoreOps.ResourceAction< + TEntityType, + { + @doc("The definition of the {name} to create", TEntityType) + @Http.bodyRoot + body: TEntityType; + }, + TEntityType + >; + + @doc( + "Create a new or replace an existing {name} with the given version id", + TEntityType + ) + @Http.put + createVersion is Azure.Core.Foundations.ResourceOperation< + TEntityType, + { + @doc( + "The specific version id of the {name} to create or replace.", + TEntityType + ) + @Rest.segment("versions") + @Http.path + version: string; + + @doc("The definition of the {name} to create", TEntityType) + @Http.bodyRoot + body: TEntityType; + }, + Azure.Core.Foundations.ResourceCreatedOrOkResponse + >; + } + + @Rest.action + op VersionedResourceAction< + TEntityType extends Reflection.Model, + TParams, + TResponse + > is Azure.Core.Foundations.ResourceOperation< + TEntityType, + { + @doc("The specific version id of the {name} to operate on.", TEntityType) + @Rest.segment("versions") + @Http.path + version: string; + + @doc("Parameters for the action") + @Http.bodyRoot + body: TParams; + }, + TResponse + >; + + namespace BuildingBlocks { + alias CoreOps = Azure.Core.StandardResourceOperations; + alias RepeatableCoreOps = Azure.Core.ResourceOperations; + } +} diff --git a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json index e02d6a2a20b5..3bf232f14dc2 100644 --- a/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json +++ b/specification/ai/data-plane/Azure.AI.Projects/preview/2025-05-01-preview/azure-ai-projects-1dp.json @@ -488,15 +488,11 @@ }, "/datasets": { "get": { - "operationId": "Datasets_ListLatestDatasets", - "description": "List latest version of each dataset in a project.", + "operationId": "Datasets_ListLatest", + "description": "List the latest version of each DatasetVersion", "parameters": [ { - "name": "$continuationToken", - "in": "query", - "description": "Continuation token for pagination. This is the nextLink from the previous response.", - "required": false, - "type": "string" + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "listViewType", @@ -538,6 +534,18 @@ "schema": { "$ref": "#/definitions/PagedDatasetVersion" } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } } }, "x-ms-pageable": { @@ -547,16 +555,18 @@ }, "/datasets/{name}/versions": { "get": { - "operationId": "Datasets_ListDatasetVersions", - "description": "List dataset versions of a specific dataset", + "operationId": "Datasets_ListVersions", + "description": "List all versions of the given DatasetVersion", "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, { "name": "name", "in": "path", - "description": "Container name.", + "description": "The name of the resource", "required": true, - "type": "string", - "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$" + "type": "string" }, { "name": "$orderBy", @@ -627,30 +637,129 @@ "schema": { "$ref": "#/definitions/PagedDatasetVersion" } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } } }, "x-ms-pageable": { "nextLinkName": "nextLink" } + }, + "post": { + "operationId": "Datasets_Versions", + "description": "Create a new DatasetVersion. The version id will be generated by the service.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "name", + "in": "path", + "description": "The name of the resource", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/Azure.Core.RepeatabilityRequestHeaders.repeatabilityRequestId" + }, + { + "$ref": "#/parameters/Azure.Core.RepeatabilityRequestHeaders.repeatabilityFirstSent" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + }, + { + "name": "body", + "in": "body", + "description": "The definition of the DatasetVersion to create", + "required": true, + "schema": { + "$ref": "#/definitions/DatasetVersion" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/DatasetVersion" + }, + "headers": { + "Repeatability-Result": { + "type": "string", + "description": "Indicates whether the repeatable request was accepted or rejected.", + "enum": [ + "accepted", + "rejected" + ], + "x-ms-enum": { + "name": "RepeatabilityResult", + "modelAsString": false, + "values": [ + { + "name": "accepted", + "value": "accepted", + "description": "If the request was accepted and the server guarantees that the server state reflects a single execution of the operation." + }, + { + "name": "rejected", + "value": "rejected", + "description": "If the request was rejected because the combination of Repeatability-First-Sent and Repeatability-Request-ID were invalid\nor because the Repeatability-First-Sent value was outside the range of values held by the server." + } + ] + } + }, + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } } }, "/datasets/{name}/versions/{version}": { "get": { "operationId": "Datasets_GetVersion", - "description": "Get dataset version.", + "description": "Get the specific version of the DatasetVersion", "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, { "name": "name", "in": "path", - "description": "Container name.", + "description": "The name of the resource", "required": true, - "type": "string", - "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$" + "type": "string" }, { "name": "version", "in": "path", - "description": "Version identifier.", + "description": "The specific version id of the DatasetVersion to retrieve.", "required": true, "type": "string" } @@ -661,32 +770,46 @@ "schema": { "$ref": "#/definitions/DatasetVersion" } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } } } }, "put": { - "operationId": "Datasets_CreateOrUpdate", - "description": "Create or update version.", + "operationId": "Datasets_CreateVersion", + "description": "Create a new or replace an existing DatasetVersion with the given version id", "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, { "name": "name", "in": "path", - "description": "Container name.", + "description": "The name of the resource", "required": true, - "type": "string", - "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$" + "type": "string" }, { "name": "version", "in": "path", - "description": "Version identifier.", + "description": "The specific version id of the DatasetVersion to create or replace.", "required": true, "type": "string" }, { - "name": "datasetVersion", + "name": "body", "in": "body", - "description": "Version entity to create or update.", + "description": "The definition of the DatasetVersion to create", "required": true, "schema": { "$ref": "#/definitions/DatasetVersion" @@ -699,60 +822,94 @@ "schema": { "$ref": "#/definitions/DatasetVersion" } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/DatasetVersion" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } } } }, "delete": { "operationId": "Datasets_DeleteVersion", - "description": "Delete version.", + "description": "Delete the specific version of the DatasetVersion", "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, { "name": "name", "in": "path", - "description": "Container name.", + "description": "The name of the resource", "required": true, - "type": "string", - "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$" + "type": "string" }, { "name": "version", "in": "path", - "description": "Version identifier.", + "description": "The version of the DatasetVersion to delete.", "required": true, "type": "string" } ], "responses": { "204": { - "description": "There is no content to send for this request, but the headers may be useful. " + "description": "There is no content to send for this request, but the headers may be useful." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } } } } }, "/datasets/{name}/versions/{version}/startPendingUpload": { "post": { - "operationId": "Datasets_CreateOrGetStartPendingUpload", - "description": "Start pending upload.", + "operationId": "Datasets_StartPendingUpload", + "description": "Create or start a pending upload of a dataset", "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, { "name": "name", "in": "path", - "description": "Container name.", + "description": "The name of the resource", "required": true, - "type": "string", - "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$" + "type": "string" }, { "name": "version", "in": "path", - "description": "Version identifier.", + "description": "The specific version id of the DatasetVersion to operate on.", "required": true, "type": "string" }, { - "name": "pendingUploadRequest", + "name": "body", "in": "body", - "description": "Pensing upload request.", + "description": "Parameters for the action", "required": true, "schema": { "$ref": "#/definitions/PendingUploadRequest" @@ -765,6 +922,18 @@ "schema": { "$ref": "#/definitions/PendingUploadResponse" } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } } } } @@ -1006,7 +1175,7 @@ { "name": "evaluation", "in": "body", - "description": "Evalution to be run", + "description": "Evaluation to be run", "required": true, "schema": { "$ref": "#/definitions/Evaluation" @@ -1341,15 +1510,11 @@ }, "/indexes": { "get": { - "operationId": "Indexes_ListLatestIndexes", - "description": "List latest version of each dataset in a project.", + "operationId": "Indexes_ListLatest", + "description": "List the latest version of each Index", "parameters": [ { - "name": "$continuationToken", - "in": "query", - "description": "Continuation token for pagination. This is the nextLink from the previous response.", - "required": false, - "type": "string" + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" }, { "name": "listViewType", @@ -1389,53 +1554,7 @@ "200": { "description": "The request has succeeded.", "schema": { - "$ref": "#/definitions/PagedDatasetVersion" - } - } - }, - "x-ms-pageable": { - "nextLinkName": "nextLink" - } - } - }, - "/indexes/{name}:create": { - "post": { - "operationId": "Indexes_CreateIndex", - "description": "Creates or updates a IndexVersion.", - "parameters": [ - { - "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" - }, - { - "name": "name", - "in": "path", - "description": "Name of the index.", - "required": true, - "type": "string", - "maxLength": 254, - "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]*$" - }, - { - "name": "body", - "in": "body", - "description": "Properties of an Index Version.", - "required": true, - "schema": { - "$ref": "#/definitions/Index" - } - } - ], - "responses": { - "200": { - "description": "The request has succeeded.", - "schema": { - "$ref": "#/definitions/Index" - } - }, - "201": { - "description": "The request has succeeded and a new resource has been created as a result.", - "schema": { - "$ref": "#/definitions/Index" + "$ref": "#/definitions/PagedIndex" } }, "default": { @@ -1450,13 +1569,16 @@ } } } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" } } }, "/indexes/{name}/versions": { "get": { - "operationId": "Indexes_ListIndexVersions", - "description": "List the versions of an Index given the name.", + "operationId": "Indexes_ListVersions", + "description": "List all versions of the given Index", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -1464,11 +1586,9 @@ { "name": "name", "in": "path", - "description": "Name of the index.", + "description": "The name of the resource", "required": true, - "type": "string", - "maxLength": 254, - "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]*$" + "type": "string" }, { "name": "listViewType", @@ -1532,12 +1652,97 @@ "x-ms-pageable": { "nextLinkName": "nextLink" } + }, + "post": { + "operationId": "Indexes_Versions", + "description": "Create a new Index. The version id will be generated by the service.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "name", + "in": "path", + "description": "The name of the resource", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/Azure.Core.RepeatabilityRequestHeaders.repeatabilityRequestId" + }, + { + "$ref": "#/parameters/Azure.Core.RepeatabilityRequestHeaders.repeatabilityFirstSent" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + }, + { + "name": "body", + "in": "body", + "description": "The definition of the Index to create", + "required": true, + "schema": { + "$ref": "#/definitions/Index" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Index" + }, + "headers": { + "Repeatability-Result": { + "type": "string", + "description": "Indicates whether the repeatable request was accepted or rejected.", + "enum": [ + "accepted", + "rejected" + ], + "x-ms-enum": { + "name": "RepeatabilityResult", + "modelAsString": false, + "values": [ + { + "name": "accepted", + "value": "accepted", + "description": "If the request was accepted and the server guarantees that the server state reflects a single execution of the operation." + }, + { + "name": "rejected", + "value": "rejected", + "description": "If the request was rejected because the combination of Repeatability-First-Sent and Repeatability-Request-ID were invalid\nor because the Repeatability-First-Sent value was outside the range of values held by the server." + } + ] + } + }, + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } } }, "/indexes/{name}/versions/{version}": { "get": { - "operationId": "Indexes_Get", - "description": "Get a specific version of an Index.", + "operationId": "Indexes_GetVersion", + "description": "Get the specific version of the Index", "parameters": [ { "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" @@ -1545,16 +1750,14 @@ { "name": "name", "in": "path", - "description": "Name of the index.", + "description": "The name of the resource", "required": true, - "type": "string", - "maxLength": 254, - "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]*$" + "type": "string" }, { "name": "version", "in": "path", - "description": "Version of the index.", + "description": "The specific version id of the Index to retrieve.", "required": true, "type": "string" } @@ -1580,29 +1783,101 @@ } } }, + "put": { + "operationId": "Indexes_CreateVersion", + "description": "Create a new or replace an existing Index with the given version id", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "name", + "in": "path", + "description": "The name of the resource", + "required": true, + "type": "string" + }, + { + "name": "version", + "in": "path", + "description": "The specific version id of the Index to create or replace.", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "description": "The definition of the Index to create", + "required": true, + "schema": { + "$ref": "#/definitions/Index" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Index" + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/Index" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + }, "delete": { "operationId": "Indexes_DeleteVersion", - "description": "Delete version.", + "description": "Delete the specific version of the Index", "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, { "name": "name", "in": "path", - "description": "Container name.", + "description": "The name of the resource", "required": true, - "type": "string", - "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$" + "type": "string" }, { "name": "version", "in": "path", - "description": "Version identifier.", + "description": "The version of the Index to delete.", "required": true, "type": "string" } ], "responses": { "204": { - "description": "There is no content to send for this request, but the headers may be useful. " + "description": "There is no content to send for this request, but the headers may be useful." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } } } } @@ -9567,7 +9842,9 @@ "discriminator": "type", "required": [ "datasetUri", - "type" + "type", + "name", + "version" ] }, "Deployment": { @@ -9859,7 +10136,9 @@ }, "discriminator": "indexType", "required": [ - "indexType" + "indexType", + "name", + "version" ] }, "IndexType": { @@ -10065,19 +10344,19 @@ }, "PagedDatasetVersion": { "type": "object", - "description": "PagedDataVersionBase Definition", + "description": "Paged collection of DatasetVersion items", "properties": { "value": { "type": "array", - "description": "The list of DatasetVersions.", + "description": "The DatasetVersion items on this page", "items": { "$ref": "#/definitions/DatasetVersion" - }, - "x-ms-identifiers": [] + } }, "nextLink": { "type": "string", - "description": "The link to the next page of results, if any." + "format": "uri", + "description": "The link to the next page of items" } }, "required": [ @@ -10129,15 +10408,14 @@ }, "PagedIndex": { "type": "object", - "description": "Paged collection of Index items.", + "description": "Paged collection of Index items", "properties": { "value": { "type": "array", - "description": "The list of Indexes.", + "description": "The Index items on this page", "items": { "$ref": "#/definitions/Index" - }, - "x-ms-identifiers": [] + } }, "nextLink": { "type": "string", @@ -10410,6 +10688,25 @@ "format": "int32", "x-ms-parameter-location": "method" }, + "Azure.Core.RepeatabilityRequestHeaders.repeatabilityFirstSent": { + "name": "Repeatability-First-Sent", + "in": "header", + "description": "Specifies the date and time at which the request was first created.", + "required": false, + "type": "string", + "format": "date-time", + "x-ms-parameter-location": "method", + "x-ms-client-name": "repeatabilityFirstSent" + }, + "Azure.Core.RepeatabilityRequestHeaders.repeatabilityRequestId": { + "name": "Repeatability-Request-ID", + "in": "header", + "description": "An opaque, globally-unique, client-generated string identifier for the request.", + "required": false, + "type": "string", + "x-ms-parameter-location": "method", + "x-ms-client-name": "repeatabilityRequestId" + }, "Azure.Core.SkipQueryParameter": { "name": "skip", "in": "query",