From 4c51a6ddbe320d1d6db6d9320dadab61e1b7655a Mon Sep 17 00:00:00 2001 From: yifan-zhou922 Date: Mon, 31 May 2021 10:49:27 +0800 Subject: [PATCH 1/2] add browse api --- .../examples/Discovery_Browse_EntityType.json | 34 +++++ .../examples/Discovery_Browse_Path.json | 66 +++++++++ .../2021-05-01-preview/purviewcatalog.json | 140 ++++++++++++++++++ 3 files changed, 240 insertions(+) create mode 100644 specification/purview/data-plane/Azure.Analytics.Purview.Catalog/preview/2021-05-01-preview/examples/Discovery_Browse_EntityType.json create mode 100644 specification/purview/data-plane/Azure.Analytics.Purview.Catalog/preview/2021-05-01-preview/examples/Discovery_Browse_Path.json diff --git a/specification/purview/data-plane/Azure.Analytics.Purview.Catalog/preview/2021-05-01-preview/examples/Discovery_Browse_EntityType.json b/specification/purview/data-plane/Azure.Analytics.Purview.Catalog/preview/2021-05-01-preview/examples/Discovery_Browse_EntityType.json new file mode 100644 index 000000000000..0c39aa278c30 --- /dev/null +++ b/specification/purview/data-plane/Azure.Analytics.Purview.Catalog/preview/2021-05-01-preview/examples/Discovery_Browse_EntityType.json @@ -0,0 +1,34 @@ +{ + "parameters": { + "Endpoint": "{Endpoint}", + "browseRequest": { + "entityType": "azure_data_explorer_cluster", + "limit": 10 + } + }, + "responses": { + "200": { + "body": { + "@search.count": 1, + "value": [ + { + "id": "7afe6da2-4275-4096-90af-e40479cf70e2", + "name": "examplecluster.westus", + "qualifiedName": "https://examplecluster.westus.kusto.windows.net", + "entityType": "azure_data_explorer_cluster", + "path": "/azure_data_explorer_cluster#examplecluster.westus.kusto.windows.net", + "owner": [ + { + "id": "12345678-1234-5678-1234-86b7251e0353", + "displayName": "Example DisplayName", + "mail": "example.displayname@microsoft.com", + "contactType": "Owner" + } + ], + "isLeaf": false + } + ] + } + } + } +} diff --git a/specification/purview/data-plane/Azure.Analytics.Purview.Catalog/preview/2021-05-01-preview/examples/Discovery_Browse_Path.json b/specification/purview/data-plane/Azure.Analytics.Purview.Catalog/preview/2021-05-01-preview/examples/Discovery_Browse_Path.json new file mode 100644 index 000000000000..037f57baf76e --- /dev/null +++ b/specification/purview/data-plane/Azure.Analytics.Purview.Catalog/preview/2021-05-01-preview/examples/Discovery_Browse_Path.json @@ -0,0 +1,66 @@ +{ + "parameters": { + "Endpoint": "{Endpoint}", + "browseRequest": { + "path": "/azure_data_explorer_cluster#examplecluster.westus.kusto.windows.net", + "limit": 10 + } + }, + "responses": { + "200": { + "body": { + "@search.count": 3, + "value": [ + { + "id": "55656c92-7e29-4831-a243-f95bdcdd397b", + "name": "exampledata", + "qualifiedName": "https://examplecluster.westus.kusto.windows.net/exampledata", + "entityType": "azure_data_explorer_database", + "path": "/azure_data_explorer_cluster#examplecluster.westus.kusto.windows.net/azure_data_explorer_database#exampledata", + "owner": [ + { + "id": "12345678-1234-5678-1234-86b7251e0353", + "displayName": "Example DisplayName", + "mail": "example.displayname@microsoft.com", + "contactType": "Owner" + } + ], + "isLeaf": false + }, + { + "id": "940aa60f-36f6-4dcf-8989-2faa49c74462", + "name": "exampledata2", + "qualifiedName": "https://examplecluster.westus.kusto.windows.net/exampledata2", + "entityType": "azure_data_explorer_database", + "path": "/azure_data_explorer_cluster#examplecluster.westus.kusto.windows.net/azure_data_explorer_database#exampledata2", + "owner": [ + { + "id": "12345678-1234-5678-1234-86b7251e0353", + "displayName": "Example DisplayName", + "mail": "example.displayname@microsoft.com", + "contactType": "Owner" + } + ], + "isLeaf": false + }, + { + "id": "19c4a337-840b-442d-ac9c-3df65bb33d69", + "name": "exampledata3", + "qualifiedName": "https://examplecluster.westus.kusto.windows.net/exampledata3", + "entityType": "azure_data_explorer_database", + "path": "/azure_data_explorer_cluster#examplecluster.westus.kusto.windows.net/azure_data_explorer_database#exampledata3", + "owner": [ + { + "id": "12345678-1234-5678-1234-86b7251e0353", + "displayName": "Example DisplayName", + "mail": "example.displayname@microsoft.com", + "contactType": "Owner" + } + ], + "isLeaf": false + } + ] + } + } + } +} diff --git a/specification/purview/data-plane/Azure.Analytics.Purview.Catalog/preview/2021-05-01-preview/purviewcatalog.json b/specification/purview/data-plane/Azure.Analytics.Purview.Catalog/preview/2021-05-01-preview/purviewcatalog.json index af05e128d447..77db25547598 100644 --- a/specification/purview/data-plane/Azure.Analytics.Purview.Catalog/preview/2021-05-01-preview/purviewcatalog.json +++ b/specification/purview/data-plane/Azure.Analytics.Purview.Catalog/preview/2021-05-01-preview/purviewcatalog.json @@ -2193,6 +2193,42 @@ } } }, + "/browse": { + "post": { + "tags": [ + "Discovery" + ], + "description": "Browse entities by path or entity type.", + "operationId": "Discovery_Browse", + "x-ms-examples": { + "Discovery_Browse_Path": { + "$ref": "./examples/Discovery_Browse_Path.json" + }, + "Discovery_Browse_EntityType": { + "$ref": "./examples/Discovery_Browse_EntityType.json" + } + }, + "parameters": [ + { + "in": "body", + "name": "browseRequest", + "description": "An object specifying the browse criteria.", + "required": true, + "schema": { + "$ref": "#/definitions/BrowseRequest" + } + } + ], + "responses": { + "200": { + "description": "OK. On successful get the entities to browse.", + "schema": { + "$ref": "#/definitions/BrowseResult" + } + } + } + } + }, "/search/autocomplete": { "post": { "tags": [ @@ -5367,6 +5403,24 @@ "title": "SuggestResult", "description": "The result item of the search suggest." }, + "BrowseResult": { + "type": "object", + "properties": { + "@search.count": { + "type": "integer", + "format": "int32", + "description": "The total number of browse results." + }, + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/BrowseResultValue" + } + } + }, + "title": "BrowseResult", + "description": "The result item of the browse request." + }, "SuggestResultValue": { "type": "object", "properties": { @@ -5442,6 +5496,67 @@ "title": "SuggestResultValue", "description": "The value item of the search suggest." }, + "BrowseResultValue": { + "type": "object", + "properties": { + "entityType": { + "type": "string", + "description": "The type name of the record." + }, + "id": { + "type": "string", + "description": "The GUID of the record." + }, + "isLeaf": { + "type": "boolean", + "description": "If the record is a leaf entity." + }, + "name": { + "type": "string", + "description": "The name of the record." + }, + "owner": { + "type": "array", + "description": "The owners of the record.", + "items": { + "$ref": "#/definitions/BrowseResultOwner" + } + }, + "path": { + "type": "string", + "description": "The path of the record." + }, + "qualifiedName": { + "type": "string", + "description": "The qualified name of the record." + } + }, + "title": "BrowseResultValue", + "description": "The value item of the browse result." + }, + "BrowseResultOwner": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The GUID of the owner." + }, + "displayName": { + "type": "string", + "description": "The display name of the owner." + }, + "mail": { + "type": "string", + "description": "The mail of the owner." + }, + "contactType": { + "type": "string", + "description": "The contact type of the owner. The value will be Owner." + } + }, + "title": "BrowseResultOwner", + "description": "The value item of the browse owner." + }, "SearchResult": { "type": "object", "properties": { @@ -5830,6 +5945,31 @@ "title": "SearchRequest", "description": "The search query of advanced search request." }, + "BrowseRequest": { + "type": "object", + "properties": { + "entityType": { + "type": "string", + "description": "The entity type to browse as the root level entry point." + }, + "path": { + "type": "string", + "description": "The path to browse the next level child entities." + }, + "limit": { + "type": "integer", + "format": "int32", + "description": "The number of browse items we hope to return." + }, + "offset": { + "type": "integer", + "format": "int32", + "description": "The offset. The default value is 0." + } + }, + "title": "BrowseRequest", + "description": "The criteria of browse request." + }, "SuggestRequest": { "type": "object", "properties": { From 5620f74d6a69be94cb46833f2d4248ba50659348 Mon Sep 17 00:00:00 2001 From: yifan-zhou922 Date: Wed, 2 Jun 2021 15:06:01 +0800 Subject: [PATCH 2/2] add api-version in browse api --- .../examples/Discovery_Browse_EntityType.json | 3 ++- .../2021-05-01-preview/examples/Discovery_Browse_Path.json | 3 ++- .../preview/2021-05-01-preview/purviewcatalog.json | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/specification/purview/data-plane/Azure.Analytics.Purview.Catalog/preview/2021-05-01-preview/examples/Discovery_Browse_EntityType.json b/specification/purview/data-plane/Azure.Analytics.Purview.Catalog/preview/2021-05-01-preview/examples/Discovery_Browse_EntityType.json index 0c39aa278c30..d05e3310e307 100644 --- a/specification/purview/data-plane/Azure.Analytics.Purview.Catalog/preview/2021-05-01-preview/examples/Discovery_Browse_EntityType.json +++ b/specification/purview/data-plane/Azure.Analytics.Purview.Catalog/preview/2021-05-01-preview/examples/Discovery_Browse_EntityType.json @@ -4,7 +4,8 @@ "browseRequest": { "entityType": "azure_data_explorer_cluster", "limit": 10 - } + }, + "api-version": "2021-05-01-preview" }, "responses": { "200": { diff --git a/specification/purview/data-plane/Azure.Analytics.Purview.Catalog/preview/2021-05-01-preview/examples/Discovery_Browse_Path.json b/specification/purview/data-plane/Azure.Analytics.Purview.Catalog/preview/2021-05-01-preview/examples/Discovery_Browse_Path.json index 037f57baf76e..7a3f758a76aa 100644 --- a/specification/purview/data-plane/Azure.Analytics.Purview.Catalog/preview/2021-05-01-preview/examples/Discovery_Browse_Path.json +++ b/specification/purview/data-plane/Azure.Analytics.Purview.Catalog/preview/2021-05-01-preview/examples/Discovery_Browse_Path.json @@ -4,7 +4,8 @@ "browseRequest": { "path": "/azure_data_explorer_cluster#examplecluster.westus.kusto.windows.net", "limit": 10 - } + }, + "api-version": "2021-05-01-preview" }, "responses": { "200": { diff --git a/specification/purview/data-plane/Azure.Analytics.Purview.Catalog/preview/2021-05-01-preview/purviewcatalog.json b/specification/purview/data-plane/Azure.Analytics.Purview.Catalog/preview/2021-05-01-preview/purviewcatalog.json index 77db25547598..423405258447 100644 --- a/specification/purview/data-plane/Azure.Analytics.Purview.Catalog/preview/2021-05-01-preview/purviewcatalog.json +++ b/specification/purview/data-plane/Azure.Analytics.Purview.Catalog/preview/2021-05-01-preview/purviewcatalog.json @@ -2217,6 +2217,9 @@ "schema": { "$ref": "#/definitions/BrowseRequest" } + }, + { + "$ref": "#/parameters/purviewAPIVersion" } ], "responses": {