From 8cc6499b58a00292e367ec7366e6e8e64a2fdf7a Mon Sep 17 00:00:00 2001 From: "FAREAST\\chunyu" Date: Wed, 12 Apr 2023 14:41:10 +0800 Subject: [PATCH] add new mgmt service --- .../IndexOperations_CreateOrUpdate.json | 93 +++ .../examples/IndexOperations_Delete.json | 17 + .../examples/IndexOperations_Get.json | 40 ++ .../IndexOperations_ListByResourceGroup.json | 43 ++ .../IndexOperations_ListBySubscription.json | 42 ++ .../examples/IndexOperations_Update.json | 68 ++ .../examples/Operations_List.json | 46 ++ .../CognitiveSearch.Management/main.tsp | 106 +++ .../CognitiveSearch.Management/tspconfig.yaml | 5 + .../IndexOperations_CreateOrUpdate.json | 93 +++ .../examples/IndexOperations_Delete.json | 17 + .../examples/IndexOperations_Get.json | 40 ++ .../IndexOperations_ListByResourceGroup.json | 43 ++ .../IndexOperations_ListBySubscription.json | 42 ++ .../examples/IndexOperations_Update.json | 68 ++ .../examples/Operations_List.json | 46 ++ .../preview/2023-05-01-preview/openapi.json | 628 ++++++++++++++++++ .../resource-manager/readme.md | 72 ++ 18 files changed, 1509 insertions(+) create mode 100644 specification/cognitivesearch/CognitiveSearch.Management/examples/IndexOperations_CreateOrUpdate.json create mode 100644 specification/cognitivesearch/CognitiveSearch.Management/examples/IndexOperations_Delete.json create mode 100644 specification/cognitivesearch/CognitiveSearch.Management/examples/IndexOperations_Get.json create mode 100644 specification/cognitivesearch/CognitiveSearch.Management/examples/IndexOperations_ListByResourceGroup.json create mode 100644 specification/cognitivesearch/CognitiveSearch.Management/examples/IndexOperations_ListBySubscription.json create mode 100644 specification/cognitivesearch/CognitiveSearch.Management/examples/IndexOperations_Update.json create mode 100644 specification/cognitivesearch/CognitiveSearch.Management/examples/Operations_List.json create mode 100644 specification/cognitivesearch/CognitiveSearch.Management/main.tsp create mode 100644 specification/cognitivesearch/CognitiveSearch.Management/tspconfig.yaml create mode 100644 specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/examples/IndexOperations_CreateOrUpdate.json create mode 100644 specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/examples/IndexOperations_Delete.json create mode 100644 specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/examples/IndexOperations_Get.json create mode 100644 specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/examples/IndexOperations_ListByResourceGroup.json create mode 100644 specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/examples/IndexOperations_ListBySubscription.json create mode 100644 specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/examples/IndexOperations_Update.json create mode 100644 specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/examples/Operations_List.json create mode 100644 specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/openapi.json create mode 100644 specification/cognitivesearch/resource-manager/readme.md diff --git a/specification/cognitivesearch/CognitiveSearch.Management/examples/IndexOperations_CreateOrUpdate.json b/specification/cognitivesearch/CognitiveSearch.Management/examples/IndexOperations_CreateOrUpdate.json new file mode 100644 index 000000000000..427a0d858043 --- /dev/null +++ b/specification/cognitivesearch/CognitiveSearch.Management/examples/IndexOperations_CreateOrUpdate.json @@ -0,0 +1,93 @@ +{ + "operationId": "IndexOperations_CreateOrUpdate", + "title": "IndexOperations_CreateOrUpdate", + "parameters": { + "name": "my-index", + "resourceGroupName": "my-rg", + "api-version": "2023-05-01-preview", + "subscriptionId": "my-subscription", + "resource": { + "location": "westus", + "tags": { + "app-name": "My e-commerce app" + }, + "properties": { + "queryCapacity": { + "minVCores": 0.5, + "maxVCores": 16, + "autoPause": { + "type": "Delay", + "duration": "PT5M" + } + }, + "indexingCapacity": { + "minVCores": 1, + "maxVCores": 16, + "autoPause": { + "type": "None" + } + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/my-subscription/resourceGroups/my-rg/providers/Microsoft.CognitiveSearch/indexes/my-index", + "name": "my-index", + "location": "westus", + "type": "Microsoft.CognitiveSearch/indexes", + "tags": { + "app-name": "My e-commerce app" + }, + "properties": { + "endpoint": "https://my-index-a1b2c3d4.zo1.westus.search.azure.com", + "queryCapacity": { + "minVCores": 0.5, + "maxVCores": 16, + "autoPause": { + "type": "Delay", + "duration": "PT5M" + } + }, + "indexingCapacity": { + "minVCores": 16, + "maxVCores": 1, + "autoPause": { + "type": "None" + } + } + } + } + }, + "201": { + "body": { + "id": "/subscriptions/my-subscription/resourceGroups/my-rg/providers/Microsoft.CognitiveSearch/indexes/my-index", + "name": "my-index", + "location": "westus", + "type": "Microsoft.CognitiveSearch/indexes", + "tags": { + "app-name": "My e-commerce app" + }, + "properties": { + "endpoint": "https://my-index-a1b2c3d4.zo1.westus.search.azure.com", + "queryCapacity": { + "minVCores": 0.5, + "maxVCores": 16, + "autoPause": { + "type": "Delay", + "duration": "PT5M" + } + }, + "indexingCapacity": { + "minVCores": 16, + "maxVCores": 1, + "autoPause": { + "type": "None" + } + } + } + } + } + } +} diff --git a/specification/cognitivesearch/CognitiveSearch.Management/examples/IndexOperations_Delete.json b/specification/cognitivesearch/CognitiveSearch.Management/examples/IndexOperations_Delete.json new file mode 100644 index 000000000000..b8c34d1270b6 --- /dev/null +++ b/specification/cognitivesearch/CognitiveSearch.Management/examples/IndexOperations_Delete.json @@ -0,0 +1,17 @@ +{ + "operationId": "IndexOperations_Delete", + "title": "IndexOperations_Delete", + "parameters": { + "name": "my-index", + "resourceGroupName": "my-rg", + "api-version": "2023-05-01-preview", + "subscriptionId": "my-subscription" + }, + "responses": { + "202": { + "headers": { + "Location": "https://management.azure.com/providers/Microsoft.CognitiveSearch/operationResults/{operationId}" + } + } + } +} diff --git a/specification/cognitivesearch/CognitiveSearch.Management/examples/IndexOperations_Get.json b/specification/cognitivesearch/CognitiveSearch.Management/examples/IndexOperations_Get.json new file mode 100644 index 000000000000..4961daa35d97 --- /dev/null +++ b/specification/cognitivesearch/CognitiveSearch.Management/examples/IndexOperations_Get.json @@ -0,0 +1,40 @@ +{ + "operationId": "IndexOperations_Get", + "title": "IndexOperations_Get", + "parameters": { + "subscriptionId": "b55eab7e-f8f9-4ea7-83d4-200c69b8e58c", + "resourceGroupName": "rgName", + "api-version": "2023-05-01-preview", + "name": "my-index" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/b55eab7e-f8f9-4ea7-83d4-200c69b8e58c/resourceGroups/rgName/providers/Microsoft.CognitiveSearch/indexes/my-index", + "name": "my-index", + "type": "Microsoft.CognitiveSearch/indexes", + "location": "West US", + "tags": {}, + "properties": { + "provisioningState": "Succeeded", + "queryCapacity": { + "minVCores": 1, + "maxVCores": 16, + "autoPause": { + "type": "Delay", + "duration": "PT5M" + } + }, + "indexingCapacity": { + "minVCores": 2, + "maxVCores": 8, + "autoPause": { + "type": "None" + } + }, + "endpoint": "https://my-index-a1b2c3d4.zo1.westus.search.azure.com" + } + } + } + } +} diff --git a/specification/cognitivesearch/CognitiveSearch.Management/examples/IndexOperations_ListByResourceGroup.json b/specification/cognitivesearch/CognitiveSearch.Management/examples/IndexOperations_ListByResourceGroup.json new file mode 100644 index 000000000000..3a0dc5d051c3 --- /dev/null +++ b/specification/cognitivesearch/CognitiveSearch.Management/examples/IndexOperations_ListByResourceGroup.json @@ -0,0 +1,43 @@ +{ + "operationId": "IndexOperations_ListByResourceGroup", + "title": "IndexOperations_ListByResourceGroup", + "parameters": { + "subscriptionId": "b55eab7e-f8f9-4ea7-83d4-200c69b8e58c", + "resourceGroupName": "rgName", + "api-version": "2023-05-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/b55eab7e-f8f9-4ea7-83d4-200c69b8e58c/resourceGroups/rgName/providers/Microsoft.CognitiveSearch/indexes/my-index", + "name": "my-index", + "type": "Microsoft.CognitiveSearch/indexes", + "location": "West US", + "tags": {}, + "properties": { + "provisioningState": "Succeeded", + "queryCapacity": { + "minVCores": 1, + "maxVCores": 16, + "autoPause": { + "type": "Delay", + "duration": "PT5M" + } + }, + "indexingCapacity": { + "minVCores": 2, + "maxVCores": 8, + "autoPause": { + "type": "None" + } + }, + "endpoint": "https://my-index-a1b2c3d4.zo1.westus.search.azure.com" + } + } + ] + } + } + } +} diff --git a/specification/cognitivesearch/CognitiveSearch.Management/examples/IndexOperations_ListBySubscription.json b/specification/cognitivesearch/CognitiveSearch.Management/examples/IndexOperations_ListBySubscription.json new file mode 100644 index 000000000000..b54441b3199f --- /dev/null +++ b/specification/cognitivesearch/CognitiveSearch.Management/examples/IndexOperations_ListBySubscription.json @@ -0,0 +1,42 @@ +{ + "operationId": "IndexOperations_ListBySubscription", + "title": "IndexOperations_ListBySubscription", + "parameters": { + "subscriptionId": "b55eab7e-f8f9-4ea7-83d4-200c69b8e58c", + "api-version": "2023-05-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/b55eab7e-f8f9-4ea7-83d4-200c69b8e58c/resourceGroups/rgName/providers/Microsoft.CognitiveSearch/indexes/my-index", + "name": "my-index", + "type": "Microsoft.CognitiveSearch/indexes", + "location": "West US", + "tags": {}, + "properties": { + "provisioningState": "Succeeded", + "queryCapacity": { + "minVCores": 1, + "maxVCores": 16, + "autoPause": { + "type": "Delay", + "duration": "PT5M" + } + }, + "indexingCapacity": { + "minVCores": 2, + "maxVCores": 8, + "autoPause": { + "type": "None" + } + }, + "endpoint": "https://my-index-a1b2c3d4.zo1.westus.search.azure.com" + } + } + ] + } + } + } +} diff --git a/specification/cognitivesearch/CognitiveSearch.Management/examples/IndexOperations_Update.json b/specification/cognitivesearch/CognitiveSearch.Management/examples/IndexOperations_Update.json new file mode 100644 index 000000000000..2eb15fc68b91 --- /dev/null +++ b/specification/cognitivesearch/CognitiveSearch.Management/examples/IndexOperations_Update.json @@ -0,0 +1,68 @@ +{ + "operationId": "IndexOperations_Update", + "title": "IndexOperations_Update", + "parameters": { + "name": "my-index", + "resourceGroupName": "my-rg", + "api-version": "2023-05-01-preview", + "subscriptionId": "my-subscription", + "properties": { + "tags": { + "tag1": "value1" + }, + "properties": { + "queryCapacity": { + "minVCores": 0.5, + "maxVCores": 16, + "autoPause": { + "type": "Delay", + "duration": "PT5M" + } + }, + "indexingCapacity": { + "minVCores": 16, + "maxVCores": 1, + "autoPause": { + "type": "None" + } + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/my-subscription/resourceGroups/my-rg/providers/Microsoft.CognitiveSearch/indexes/my-index", + "name": "my-index", + "location": "westus", + "type": "Microsoft.CognitiveSearch/indexes", + "tags": { + "app-name": "My e-commerce app" + }, + "properties": { + "endpoint": "https://my-index-a1b2c3d4.zo1.westus.search.azure.com", + "queryCapacity": { + "minVCores": 0.5, + "maxVCores": 16, + "autoPause": { + "type": "Delay", + "duration": "PT5M" + } + }, + "indexingCapacity": { + "minVCores": 16, + "maxVCores": 1, + "autoPause": { + "type": "None" + } + } + } + } + }, + "202": { + "headers": { + "Location": "https://management.azure.com/providers/Microsoft.CognitiveSearch/operationResults/{operationId}" + } + } + } +} diff --git a/specification/cognitivesearch/CognitiveSearch.Management/examples/Operations_List.json b/specification/cognitivesearch/CognitiveSearch.Management/examples/Operations_List.json new file mode 100644 index 000000000000..d73aa10d91d7 --- /dev/null +++ b/specification/cognitivesearch/CognitiveSearch.Management/examples/Operations_List.json @@ -0,0 +1,46 @@ +{ + "operationId": "Operations_List", + "title": "Operations_List", + "parameters": { + "api-version": "2023-05-01-preview" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "name": "Microsoft.CognitiveSearch/indexes/read", + "isDataAction": false, + "display": { + "provider": "Microsoft.CognitiveSearch", + "resource": "indexes", + "operation": "IndexOperations_Get", + "description": "Get a Index" + } + }, + { + "name": "Microsoft.CognitiveSearch/indexes/write", + "isDataAction": false, + "display": { + "provider": "Microsoft.CognitiveSearch", + "resource": "indexes", + "operation": "IndexOperations_CreateOrUpdate", + "description": "Create a Index" + } + }, + { + "name": "Microsoft.CognitiveSearch/indexes/delete", + "isDataAction": false, + "display": { + "provider": "Microsoft.CognitiveSearch", + "resource": "indexes", + "operation": "IndexOperations_Delete", + "description": "Delete a Index" + } + } + ] + } + } + } +} diff --git a/specification/cognitivesearch/CognitiveSearch.Management/main.tsp b/specification/cognitivesearch/CognitiveSearch.Management/main.tsp new file mode 100644 index 000000000000..de6060012485 --- /dev/null +++ b/specification/cognitivesearch/CognitiveSearch.Management/main.tsp @@ -0,0 +1,106 @@ +import "@typespec/http"; +import "@typespec/rest"; +import "@typespec/versioning"; +import "@azure-tools/typespec-providerhub"; +import "@azure-tools/typespec-azure-core"; +import "@azure-tools/typespec-azure-resource-manager"; + +using TypeSpec.Http; +using TypeSpec.Rest; +using TypeSpec.Versioning; +using Azure.Core; +using Azure.ResourceManager; + +@armProviderNamespace +@service({ + title: "IndexManagementClient", + version: "2023-05-01-preview", +}) +@doc("CognitiveSearch Resource Provider management API.") +@useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1) +namespace Microsoft.CognitiveSearch; + +interface Operations extends Azure.ResourceManager.Operations {} + +@armResourceOperations +interface IndexOperations { + listByResourceGroup is ArmResourceListByParent; + + listBySubscription is ArmListBySubscription; + + get is ArmResourceRead; + + createOrUpdate is ArmResourceCreateOrUpdateAsync; + + update is ArmResourcePatchAsync; + + delete is ArmResourceDeleteAsync; +} + +@doc("An index resource") +model Index is TrackedResource { + @path + @key("name") + @segment("indexes") + @visibility("read") + @doc("The name of the index resource.") + name: string; + } + + @doc("The properties of the index.") + model IndexProperties { + @visibility("read") + @doc("The current provisioning state of the index.") + provisioningState?: ProvisioningState; + + @visibility("read") + @doc("The endpoint at which the index can be accessed.") + endpoint?: string; + + @doc("The capacity allocated to the index for querying.") + queryCapacity: Capacity; + + @doc("The capacity allocated to the index for indexing documents.") + indexingCapacity: Capacity; + } + + @doc("The capacity will autoscale between the minimum and maximum number of vCores based on the usage of your index.") + model Capacity { + #suppress "@azure-tools/typespec-azure-core/casing-style" "Name is in camel case." + @doc("The minimum number of vCores that the index will consume. Represented with discrete values: 0.2, 0.5. 1, 2, 3, … to 16.") + minVCores: float32; + + #suppress "@azure-tools/typespec-azure-core/casing-style" "Name is in camel case." + @doc("The maximum number of vCores that the index can consume. Represented with discrete values: 0.2, 0.5. 1, 2, 3, … to 16.") + maxVCores: float32; + + @doc("Pausing strategy for the index") + autoPause: Pause; + } + + @discriminator("type") + @doc("Pausing strategy for the index") + model Pause {} + + @doc("When the pause strategy is set to 'Delay', the index will enter a paused state after not being used for a fixed amount of time.") + model DelayPause extends Pause { + @doc("Specifies the type of pausing strategy as 'Delay'.") + type: "Delay"; + + @doc("The interval after which an index is paused if not in use.") + duration: duration; + } + + @doc("When the pause strategy is set to 'None', the index will remain always active.") + model NonePause extends Pause { + @doc("Specifies the type of pausing strategy as 'None'.") + type: "None"; + } + +@lroStatus +enum ProvisioningState { + ...ResourceProvisioningState, + Provisioning, + Deleting, + Accepted, +} \ No newline at end of file diff --git a/specification/cognitivesearch/CognitiveSearch.Management/tspconfig.yaml b/specification/cognitivesearch/CognitiveSearch.Management/tspconfig.yaml new file mode 100644 index 000000000000..79d132af8157 --- /dev/null +++ b/specification/cognitivesearch/CognitiveSearch.Management/tspconfig.yaml @@ -0,0 +1,5 @@ +emitters: + "@azure-tools/typespec-autorest": + output-file: openapi.json + azure-resource-provider-folder: ../resource-manager + examples-directory: ./examples \ No newline at end of file diff --git a/specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/examples/IndexOperations_CreateOrUpdate.json b/specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/examples/IndexOperations_CreateOrUpdate.json new file mode 100644 index 000000000000..427a0d858043 --- /dev/null +++ b/specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/examples/IndexOperations_CreateOrUpdate.json @@ -0,0 +1,93 @@ +{ + "operationId": "IndexOperations_CreateOrUpdate", + "title": "IndexOperations_CreateOrUpdate", + "parameters": { + "name": "my-index", + "resourceGroupName": "my-rg", + "api-version": "2023-05-01-preview", + "subscriptionId": "my-subscription", + "resource": { + "location": "westus", + "tags": { + "app-name": "My e-commerce app" + }, + "properties": { + "queryCapacity": { + "minVCores": 0.5, + "maxVCores": 16, + "autoPause": { + "type": "Delay", + "duration": "PT5M" + } + }, + "indexingCapacity": { + "minVCores": 1, + "maxVCores": 16, + "autoPause": { + "type": "None" + } + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/my-subscription/resourceGroups/my-rg/providers/Microsoft.CognitiveSearch/indexes/my-index", + "name": "my-index", + "location": "westus", + "type": "Microsoft.CognitiveSearch/indexes", + "tags": { + "app-name": "My e-commerce app" + }, + "properties": { + "endpoint": "https://my-index-a1b2c3d4.zo1.westus.search.azure.com", + "queryCapacity": { + "minVCores": 0.5, + "maxVCores": 16, + "autoPause": { + "type": "Delay", + "duration": "PT5M" + } + }, + "indexingCapacity": { + "minVCores": 16, + "maxVCores": 1, + "autoPause": { + "type": "None" + } + } + } + } + }, + "201": { + "body": { + "id": "/subscriptions/my-subscription/resourceGroups/my-rg/providers/Microsoft.CognitiveSearch/indexes/my-index", + "name": "my-index", + "location": "westus", + "type": "Microsoft.CognitiveSearch/indexes", + "tags": { + "app-name": "My e-commerce app" + }, + "properties": { + "endpoint": "https://my-index-a1b2c3d4.zo1.westus.search.azure.com", + "queryCapacity": { + "minVCores": 0.5, + "maxVCores": 16, + "autoPause": { + "type": "Delay", + "duration": "PT5M" + } + }, + "indexingCapacity": { + "minVCores": 16, + "maxVCores": 1, + "autoPause": { + "type": "None" + } + } + } + } + } + } +} diff --git a/specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/examples/IndexOperations_Delete.json b/specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/examples/IndexOperations_Delete.json new file mode 100644 index 000000000000..b8c34d1270b6 --- /dev/null +++ b/specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/examples/IndexOperations_Delete.json @@ -0,0 +1,17 @@ +{ + "operationId": "IndexOperations_Delete", + "title": "IndexOperations_Delete", + "parameters": { + "name": "my-index", + "resourceGroupName": "my-rg", + "api-version": "2023-05-01-preview", + "subscriptionId": "my-subscription" + }, + "responses": { + "202": { + "headers": { + "Location": "https://management.azure.com/providers/Microsoft.CognitiveSearch/operationResults/{operationId}" + } + } + } +} diff --git a/specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/examples/IndexOperations_Get.json b/specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/examples/IndexOperations_Get.json new file mode 100644 index 000000000000..4961daa35d97 --- /dev/null +++ b/specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/examples/IndexOperations_Get.json @@ -0,0 +1,40 @@ +{ + "operationId": "IndexOperations_Get", + "title": "IndexOperations_Get", + "parameters": { + "subscriptionId": "b55eab7e-f8f9-4ea7-83d4-200c69b8e58c", + "resourceGroupName": "rgName", + "api-version": "2023-05-01-preview", + "name": "my-index" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/b55eab7e-f8f9-4ea7-83d4-200c69b8e58c/resourceGroups/rgName/providers/Microsoft.CognitiveSearch/indexes/my-index", + "name": "my-index", + "type": "Microsoft.CognitiveSearch/indexes", + "location": "West US", + "tags": {}, + "properties": { + "provisioningState": "Succeeded", + "queryCapacity": { + "minVCores": 1, + "maxVCores": 16, + "autoPause": { + "type": "Delay", + "duration": "PT5M" + } + }, + "indexingCapacity": { + "minVCores": 2, + "maxVCores": 8, + "autoPause": { + "type": "None" + } + }, + "endpoint": "https://my-index-a1b2c3d4.zo1.westus.search.azure.com" + } + } + } + } +} diff --git a/specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/examples/IndexOperations_ListByResourceGroup.json b/specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/examples/IndexOperations_ListByResourceGroup.json new file mode 100644 index 000000000000..3a0dc5d051c3 --- /dev/null +++ b/specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/examples/IndexOperations_ListByResourceGroup.json @@ -0,0 +1,43 @@ +{ + "operationId": "IndexOperations_ListByResourceGroup", + "title": "IndexOperations_ListByResourceGroup", + "parameters": { + "subscriptionId": "b55eab7e-f8f9-4ea7-83d4-200c69b8e58c", + "resourceGroupName": "rgName", + "api-version": "2023-05-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/b55eab7e-f8f9-4ea7-83d4-200c69b8e58c/resourceGroups/rgName/providers/Microsoft.CognitiveSearch/indexes/my-index", + "name": "my-index", + "type": "Microsoft.CognitiveSearch/indexes", + "location": "West US", + "tags": {}, + "properties": { + "provisioningState": "Succeeded", + "queryCapacity": { + "minVCores": 1, + "maxVCores": 16, + "autoPause": { + "type": "Delay", + "duration": "PT5M" + } + }, + "indexingCapacity": { + "minVCores": 2, + "maxVCores": 8, + "autoPause": { + "type": "None" + } + }, + "endpoint": "https://my-index-a1b2c3d4.zo1.westus.search.azure.com" + } + } + ] + } + } + } +} diff --git a/specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/examples/IndexOperations_ListBySubscription.json b/specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/examples/IndexOperations_ListBySubscription.json new file mode 100644 index 000000000000..b54441b3199f --- /dev/null +++ b/specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/examples/IndexOperations_ListBySubscription.json @@ -0,0 +1,42 @@ +{ + "operationId": "IndexOperations_ListBySubscription", + "title": "IndexOperations_ListBySubscription", + "parameters": { + "subscriptionId": "b55eab7e-f8f9-4ea7-83d4-200c69b8e58c", + "api-version": "2023-05-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/b55eab7e-f8f9-4ea7-83d4-200c69b8e58c/resourceGroups/rgName/providers/Microsoft.CognitiveSearch/indexes/my-index", + "name": "my-index", + "type": "Microsoft.CognitiveSearch/indexes", + "location": "West US", + "tags": {}, + "properties": { + "provisioningState": "Succeeded", + "queryCapacity": { + "minVCores": 1, + "maxVCores": 16, + "autoPause": { + "type": "Delay", + "duration": "PT5M" + } + }, + "indexingCapacity": { + "minVCores": 2, + "maxVCores": 8, + "autoPause": { + "type": "None" + } + }, + "endpoint": "https://my-index-a1b2c3d4.zo1.westus.search.azure.com" + } + } + ] + } + } + } +} diff --git a/specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/examples/IndexOperations_Update.json b/specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/examples/IndexOperations_Update.json new file mode 100644 index 000000000000..2eb15fc68b91 --- /dev/null +++ b/specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/examples/IndexOperations_Update.json @@ -0,0 +1,68 @@ +{ + "operationId": "IndexOperations_Update", + "title": "IndexOperations_Update", + "parameters": { + "name": "my-index", + "resourceGroupName": "my-rg", + "api-version": "2023-05-01-preview", + "subscriptionId": "my-subscription", + "properties": { + "tags": { + "tag1": "value1" + }, + "properties": { + "queryCapacity": { + "minVCores": 0.5, + "maxVCores": 16, + "autoPause": { + "type": "Delay", + "duration": "PT5M" + } + }, + "indexingCapacity": { + "minVCores": 16, + "maxVCores": 1, + "autoPause": { + "type": "None" + } + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/my-subscription/resourceGroups/my-rg/providers/Microsoft.CognitiveSearch/indexes/my-index", + "name": "my-index", + "location": "westus", + "type": "Microsoft.CognitiveSearch/indexes", + "tags": { + "app-name": "My e-commerce app" + }, + "properties": { + "endpoint": "https://my-index-a1b2c3d4.zo1.westus.search.azure.com", + "queryCapacity": { + "minVCores": 0.5, + "maxVCores": 16, + "autoPause": { + "type": "Delay", + "duration": "PT5M" + } + }, + "indexingCapacity": { + "minVCores": 16, + "maxVCores": 1, + "autoPause": { + "type": "None" + } + } + } + } + }, + "202": { + "headers": { + "Location": "https://management.azure.com/providers/Microsoft.CognitiveSearch/operationResults/{operationId}" + } + } + } +} diff --git a/specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/examples/Operations_List.json b/specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/examples/Operations_List.json new file mode 100644 index 000000000000..d73aa10d91d7 --- /dev/null +++ b/specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/examples/Operations_List.json @@ -0,0 +1,46 @@ +{ + "operationId": "Operations_List", + "title": "Operations_List", + "parameters": { + "api-version": "2023-05-01-preview" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "name": "Microsoft.CognitiveSearch/indexes/read", + "isDataAction": false, + "display": { + "provider": "Microsoft.CognitiveSearch", + "resource": "indexes", + "operation": "IndexOperations_Get", + "description": "Get a Index" + } + }, + { + "name": "Microsoft.CognitiveSearch/indexes/write", + "isDataAction": false, + "display": { + "provider": "Microsoft.CognitiveSearch", + "resource": "indexes", + "operation": "IndexOperations_CreateOrUpdate", + "description": "Create a Index" + } + }, + { + "name": "Microsoft.CognitiveSearch/indexes/delete", + "isDataAction": false, + "display": { + "provider": "Microsoft.CognitiveSearch", + "resource": "indexes", + "operation": "IndexOperations_Delete", + "description": "Delete a Index" + } + } + ] + } + } + } +} diff --git a/specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/openapi.json b/specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/openapi.json new file mode 100644 index 000000000000..2eaf5be9bf2c --- /dev/null +++ b/specification/cognitivesearch/resource-manager/Microsoft.CognitiveSearch/preview/2023-05-01-preview/openapi.json @@ -0,0 +1,628 @@ +{ + "swagger": "2.0", + "info": { + "title": "IndexManagementClient", + "version": "2023-05-01-preview", + "description": "CognitiveSearch Resource Provider management API.", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "host": "management.azure.com", + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "description": "Azure Active Directory OAuth2 Flow.", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "tags": [ + { + "name": "Operations" + }, + { + "name": "IndexOperations" + } + ], + "paths": { + "/providers/Microsoft.CognitiveSearch/operations": { + "get": { + "tags": [ + "Operations" + ], + "operationId": "Operations_List", + "description": "List the operations for the provider", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/OperationListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "Operations_List": { + "$ref": "./examples/Operations_List.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveSearch/indexes": { + "get": { + "tags": [ + "IndexOperations" + ], + "operationId": "IndexOperations_ListBySubscription", + "description": "List Index resources by subscription ID", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/IndexListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "IndexOperations_ListBySubscription": { + "$ref": "./examples/IndexOperations_ListBySubscription.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveSearch/indexes": { + "get": { + "tags": [ + "IndexOperations" + ], + "operationId": "IndexOperations_ListByResourceGroup", + "description": "List Index resources by resource group", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/IndexListResult" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "IndexOperations_ListByResourceGroup": { + "$ref": "./examples/IndexOperations_ListByResourceGroup.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveSearch/indexes/{name}": { + "get": { + "tags": [ + "IndexOperations" + ], + "operationId": "IndexOperations_Get", + "description": "Get a Index", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "name", + "in": "path", + "required": true, + "description": "The name of the index resource.", + "type": "string" + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/Index" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "IndexOperations_Get": { + "$ref": "./examples/IndexOperations_Get.json" + } + } + }, + "put": { + "tags": [ + "IndexOperations" + ], + "operationId": "IndexOperations_CreateOrUpdate", + "description": "Create a Index", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "name", + "in": "path", + "required": true, + "description": "The name of the index resource.", + "type": "string" + }, + { + "name": "resource", + "in": "body", + "required": true, + "description": "Resource create parameters.", + "schema": { + "$ref": "#/definitions/Index" + } + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/Index" + } + }, + "201": { + "description": "ARM create operation completed successfully.", + "headers": { + "Retry-After": { + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": "integer", + "format": "int32" + } + }, + "schema": { + "$ref": "#/definitions/Index" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "IndexOperations_createOrUpdate": { + "$ref": "./examples/IndexOperations_CreateOrUpdate.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "azure-async-operation" + }, + "x-ms-long-running-operation": true + }, + "patch": { + "tags": [ + "IndexOperations" + ], + "operationId": "IndexOperations_Update", + "description": "Update a Index", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "name", + "in": "path", + "required": true, + "description": "The name of the index resource.", + "type": "string" + }, + { + "name": "properties", + "in": "body", + "required": true, + "description": "The resource properties to be updated.", + "schema": { + "$ref": "#/definitions/IndexUpdate" + } + } + ], + "responses": { + "200": { + "description": "ARM operation completed successfully.", + "schema": { + "$ref": "#/definitions/Index" + } + }, + "202": { + "description": "Resource update request accepted.", + "headers": { + "Retry-After": { + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": "integer", + "format": "int32" + }, + "Location": { + "description": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": "string" + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "IndexOperations_Update": { + "$ref": "./examples/IndexOperations_Update.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true + }, + "delete": { + "tags": [ + "IndexOperations" + ], + "operationId": "IndexOperations_Delete", + "description": "Delete a Index", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "name", + "in": "path", + "required": true, + "description": "The name of the index resource.", + "type": "string" + } + ], + "responses": { + "200": { + "description": "Resource deleted successfully." + }, + "202": { + "description": "Resource deletion accepted.", + "headers": { + "Retry-After": { + "description": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": "integer", + "format": "int32" + }, + "Location": { + "description": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": "string" + } + } + }, + "204": { + "description": "Resource deleted successfully." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "IndexOperations_Delete": { + "$ref": "./examples/IndexOperations_Delete.json" + } + }, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + }, + "x-ms-long-running-operation": true + } + } + }, + "definitions": { + "Capacity": { + "type": "object", + "properties": { + "minVCores": { + "type": "number", + "format": "float", + "description": "The minimum number of vCores that the index will consume. Represented with discrete values: 0.2, 0.5. 1, 2, 3, … to 16." + }, + "maxVCores": { + "type": "number", + "format": "float", + "description": "The maximum number of vCores that the index can consume. Represented with discrete values: 0.2, 0.5. 1, 2, 3, … to 16." + }, + "autoPause": { + "$ref": "#/definitions/Pause", + "description": "Pausing strategy for the index" + } + }, + "description": "The capacity will autoscale between the minimum and maximum number of vCores based on the usage of your index.", + "required": [ + "minVCores", + "maxVCores", + "autoPause" + ] + }, + "CapacityUpdate": { + "type": "object", + "properties": { + "minVCores": { + "type": "number", + "format": "float", + "description": "The minimum number of vCores that the index will consume. Represented with discrete values: 0.2, 0.5. 1, 2, 3, … to 16." + }, + "maxVCores": { + "type": "number", + "format": "float", + "description": "The maximum number of vCores that the index can consume. Represented with discrete values: 0.2, 0.5. 1, 2, 3, … to 16." + }, + "autoPause": { + "$ref": "#/definitions/Pause", + "description": "Pausing strategy for the index" + } + }, + "description": "The capacity will autoscale between the minimum and maximum number of vCores based on the usage of your index." + }, + "DelayPause": { + "type": "object", + "properties": { + "duration": { + "type": "string", + "format": "duration", + "description": "The interval after which an index is paused if not in use." + } + }, + "description": "When the pause strategy is set to 'Delay', the index will enter a paused state after not being used for a fixed amount of time.", + "required": [ + "duration" + ], + "allOf": [ + { + "$ref": "#/definitions/Pause" + } + ], + "x-ms-discriminator-value": "Delay" + }, + "Index": { + "type": "object", + "properties": { + "properties": { + "$ref": "#/definitions/IndexProperties", + "description": "The resource-specific properties for this resource.", + "x-ms-client-flatten": true, + "x-ms-mutability": [ + "read", + "create" + ] + } + }, + "description": "An index resource", + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/TrackedResource" + } + ] + }, + "IndexListResult": { + "type": "object", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Index" + }, + "x-typespec-name": "Index[]", + "description": "The Index items on this page" + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items", + "x-typespec-name": "Rest.ResourceLocation" + } + }, + "description": "The response of a Index list operation.", + "required": [ + "value" + ] + }, + "IndexProperties": { + "type": "object", + "properties": { + "provisioningState": { + "$ref": "#/definitions/ProvisioningState", + "description": "The current provisioning state of the index.", + "readOnly": true + }, + "endpoint": { + "type": "string", + "description": "The endpoint at which the index can be accessed.", + "readOnly": true + }, + "queryCapacity": { + "$ref": "#/definitions/Capacity", + "description": "The capacity allocated to the index for querying." + }, + "indexingCapacity": { + "$ref": "#/definitions/Capacity", + "description": "The capacity allocated to the index for indexing documents." + } + }, + "description": "The properties of the index.", + "required": [ + "queryCapacity", + "indexingCapacity" + ] + }, + "IndexUpdate": { + "type": "object", + "properties": { + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-typespec-name": "Record", + "description": "Resource tags." + }, + "properties": { + "$ref": "#/definitions/IndexUpdateProperties", + "x-ms-client-flatten": true + } + }, + "description": "The type used for update operations of the Index." + }, + "IndexUpdateProperties": { + "type": "object", + "properties": { + "queryCapacity": { + "$ref": "#/definitions/CapacityUpdate", + "description": "The capacity allocated to the index for querying." + }, + "indexingCapacity": { + "$ref": "#/definitions/CapacityUpdate", + "description": "The capacity allocated to the index for indexing documents." + } + }, + "description": "The updatable properties of the Index." + }, + "NonePause": { + "type": "object", + "properties": {}, + "description": "When the pause strategy is set to 'None', the index will remain always active.", + "allOf": [ + { + "$ref": "#/definitions/Pause" + } + ], + "x-ms-discriminator-value": "None" + }, + "Pause": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Discriminator property for Pause." + } + }, + "description": "Pausing strategy for the index", + "discriminator": "type", + "required": [ + "type" + ] + }, + "ProvisioningState": { + "type": "string", + "enum": [ + "Succeeded", + "Failed", + "Canceled", + "Provisioning", + "Deleting", + "Accepted" + ], + "x-ms-enum": { + "name": "ProvisioningState", + "modelAsString": true + } + } + }, + "parameters": {} +} diff --git a/specification/cognitivesearch/resource-manager/readme.md b/specification/cognitivesearch/resource-manager/readme.md new file mode 100644 index 000000000000..92556f84a5e8 --- /dev/null +++ b/specification/cognitivesearch/resource-manager/readme.md @@ -0,0 +1,72 @@ +# CognitiveSearchManagementClient + +> see https://aka.ms/autorest + +This is the AutoRest configuration file for CognitiveSearchIndexManagementClient. + + + +--- +## Getting Started +To build the SDK for CognitiveSearchIndexManagementClient, simply [Install AutoRest](https://aka.ms/autorest/install) and in this folder, run: + +> `autorest` + +To see additional help and options, run: + +> `autorest --help` +--- + +## Configuration + + + +### Basic Information +These are the global settings for the CognitiveSearchIndexManagementClient API. + +```yaml +openapi-type: arm +openapi-subtype: rpaas +tag: package-2023-05-preview +``` + +### Tag: package-2023-05-preview + +These settings apply only when `--tag=package-2023-05-preview` is specified on the command line. + +``` yaml $(tag) == 'package-2023-05-preview' +input-file: +- Microsoft.CognitiveSearch/preview/2023-05-01-preview/openapi.json +``` +--- +# Code Generation + + +## Swagger to SDK + +This section describes what SDK should be generated by the automatic system. +This is not used by Autorest itself. + +``` yaml $(swagger-to-sdk) +swagger-to-sdk: + - repo: azure-sdk-for-net-track2 + after_scripts: + - bundle install && rake arm:regen_all_profiles['azure_mgmt_CognitiveSearch_index'] + - repo: azure-resource-manager-schemas + - repo: azure-powershell +``` + + +## C# + +These settings apply only when `--csharp` is specified on the command line. +Please also specify `--csharp-sdks-folder=`. + +``` yaml $(csharp) +csharp: + azure-arm: true + license-header: MICROSOFT_MIT_NO_VERSION + namespace: Microsoft.Azure.Management.CognitiveSearch.Index + output-folder: $(csharp-sdks-folder)/cognitivesearch/Microsoft.Azure.Management.CognitiveSearch.Index/src/Generated + clear-output-folder: true +```