Skip to content

Commit

Permalink
Add collection APIs (Azure#15221)
Browse files Browse the repository at this point in the history
* add collection APIs

* Update purviewcatalog.json

* Add default error response

* Update purviewcatalog.json

* Revert "Update purviewcatalog.json"

This reverts commit 97dcdea6b2cd51893d4903f9f068a6a6da3890e4.

* Revert "Add default error response"

This reverts commit 37a50df89ed98f05b411d036ea84caf6bb098dd6.

* fix api-version
  • Loading branch information
yifan-zhou922 authored Sep 9, 2021
1 parent a2ff0f7 commit 7ba7687
Show file tree
Hide file tree
Showing 4 changed files with 282 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"parameters": {
"Endpoint": "{Endpoint}",
"collection": "ExampleCollection",
"api-version": "2021-05-01-preview",
"entity": {
"referredEntities": {},
"entity": {
"typeName": "azure_storage_account",
"attributes": {
"name": "exampleaccount",
"qualifiedName": "https://exampleaccount.core.windows.net"
}
}
}
},
"responses": {
"200": {
"body": {
"mutatedEntities": {
"CREATE": [
{
"typeName": "azure_storage_account",
"attributes": {
"qualifiedName": "https://exampleaccount.core.windows.net"
},
"lastModifiedTS": "1",
"guid": "38d3c41f-300c-434e-8dad-0b1a7cb5efd6",
"status": "ACTIVE"
}
]
},
"guidAssignments": {
"-9514774903018162": "38d3c41f-300c-434e-8dad-0b1a7cb5efd6"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"parameters": {
"Endpoint": "{Endpoint}",
"collection": "ExampleCollection",
"api-version": "2021-05-01-preview",
"entities": {
"referredEntities": {},
"entities": [
{
"typeName": "azure_storage_account",
"attributes": {
"qualifiedName": "exampleaccount",
"name": "exampleaccount",
"description": "Example Description"
}
},
{
"typeName": "azure_storage_account",
"attributes": {
"qualifiedName": "exampleaccount2",
"name": "exampleaccount2"
}
}
]
}
},
"responses": {
"200": {
"body": {
"mutatedEntities": {
"UPDATE": [
{
"typeName": "azure_storage_account",
"attributes": {
"qualifiedName": "exampleaccount"
},
"lastModifiedTS": "2",
"guid": "b2f9c306-cf65-4bb0-878e-cfaafde156b1",
"status": "ACTIVE"
}
],
"CREATE": [
{
"typeName": "azure_storage_account",
"attributes": {
"qualifiedName": "exampleaccount2"
},
"lastModifiedTS": "1",
"guid": "321493e3-3fb7-4b3e-9df7-3b69154174c2",
"status": "ACTIVE"
}
]
},
"guidAssignments": {
"-9514774903018192": "321493e3-3fb7-4b3e-9df7-3b69154174c2",
"-9514774903018193": "b2f9c306-cf65-4bb0-878e-cfaafde156b1"
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"parameters": {
"Endpoint": "{Endpoint}",
"collection": "ExampleNewCollection",
"api-version": "2021-05-01-preview",
"moveEntitiesRequest": {
"entityGuids": [
"321493e3-3fb7-4b3e-9df7-3b69154174c2",
"b2f9c306-cf65-4bb0-878e-cfaafde156b1"
]
}
},
"responses": {
"200": {
"body": {
"mutatedEntities": {
"UPDATE": [
{
"typeName": "azure_storage_account",
"attributes": {
"qualifiedName": "exampleaccount"
},
"lastModifiedTS": "3",
"guid": "b2f9c306-cf65-4bb0-878e-cfaafde156b1",
"status": "ACTIVE"
},
{
"typeName": "azure_storage_account",
"attributes": {
"qualifiedName": "exampleaccount2"
},
"lastModifiedTS": "2",
"guid": "321493e3-3fb7-4b3e-9df7-3b69154174c2",
"status": "ACTIVE"
}
]
},
"guidAssignments": {
"-9514774903018192": "321493e3-3fb7-4b3e-9df7-3b69154174c2",
"-9514774903018193": "b2f9c306-cf65-4bb0-878e-cfaafde156b1"
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3033,6 +3033,123 @@
}
}
}
},
"/collections/{collection}/entity": {
"post": {
"tags": [
"CatalogCollection"
],
"description": "Creates or updates an entity to a collection.\nExisting entity is matched using its unique guid if supplied or by its unique attributes eg: qualifiedName.\nMap and array of collections are not well supported. E.g., array<array<int>>, array<map<string, int>>.",
"operationId": "CatalogCollection_createOrUpdate",
"x-ms-examples": {
"CatalogCollection_createOrUpdate": {
"$ref": "./examples/CatalogCollection_createOrUpdate.json"
}
},
"parameters": [
{
"$ref": "#/parameters/collection"
},
{
"$ref": "#/parameters/purviewAPIVersion"
},
{
"in": "body",
"name": "entity",
"description": "Atlas entity with extended information.",
"required": true,
"schema": {
"$ref": "#/definitions/AtlasEntityWithExtInfo"
}
}
],
"responses": {
"200": {
"description": "Created with EntityMutationResponse.",
"schema": {
"$ref": "#/definitions/EntityMutationResponse"
}
}
}
}
},
"/collections/{collection}/entity/bulk": {
"post": {
"tags": [
"CatalogCollection"
],
"description": "Creates or updates entities in bulk to a collection.\nExisting entity is matched using its unique guid if supplied or by its unique attributes eg: qualifiedName.\nMap and array of collections are not well supported. E.g., array<array<int>>, array<map<string, int>>.",
"operationId": "CatalogCollection_createOrUpdateBulk",
"x-ms-examples": {
"CatalogCollection_createOrUpdateBulk": {
"$ref": "./examples/CatalogCollection_createOrUpdateBulk.json"
}
},
"parameters": [
{
"$ref": "#/parameters/collection"
},
{
"$ref": "#/parameters/purviewAPIVersion"
},
{
"in": "body",
"name": "entities",
"description": "Atlas entities with extended information.",
"required": true,
"schema": {
"$ref": "#/definitions/AtlasEntitiesWithExtInfo"
}
}
],
"responses": {
"200": {
"description": "Created with EntityMutationResponse.",
"schema": {
"$ref": "#/definitions/EntityMutationResponse"
}
}
}
}
},
"/collections/{collection}/entity/moveHere": {
"post": {
"tags": [
"CatalogCollection"
],
"description": "Move existing entities to the target collection.",
"operationId": "CatalogCollection_moveEntitiesToCollection",
"x-ms-examples": {
"CatalogCollection_moveEntitiesToCollection": {
"$ref": "./examples/CatalogCollection_moveEntitiesToCollection.json"
}
},
"parameters": [
{
"$ref": "#/parameters/collection"
},
{
"$ref": "#/parameters/purviewAPIVersion"
},
{
"in": "body",
"name": "moveEntitiesRequest",
"description": "Entity guids to be moved to target collection.",
"required": true,
"schema": {
"$ref": "#/definitions/MoveEntitiesRequest"
}
}
],
"responses": {
"200": {
"description": "Created with EntityMutationResponse.",
"schema": {
"$ref": "#/definitions/EntityMutationResponse"
}
}
}
}
}
},
"definitions": {
Expand Down Expand Up @@ -4664,6 +4781,18 @@
"title": "ClassificationAssociateRequest",
"description": "The request for classification association."
},
"MoveEntitiesRequest": {
"type": "object",
"properties": {
"entityGuids": {
"type": "array",
"description": "An array of entity guids to be moved to target collection.",
"items": {
"type": "string"
}
}
}
},
"DateFormat": {
"type": "object",
"title": "DateFormat",
Expand Down Expand Up @@ -6124,6 +6253,14 @@
"modelAsString": true
},
"x-ms-parameter-location": "method"
},
"collection": {
"name": "collection",
"description": "the collection unique name",
"in": "path",
"required": true,
"type": "string",
"x-ms-parameter-location": "method"
}
}
}

0 comments on commit 7ba7687

Please sign in to comment.