diff --git a/DataManagement/glossary/postman/glossary/terms-use-cases/terms-use-case.postman_collection.json b/DataManagement/glossary/postman/glossary/terms-use-cases/terms-use-case.postman_collection.json index af77a31..d467c9d 100644 --- a/DataManagement/glossary/postman/glossary/terms-use-cases/terms-use-case.postman_collection.json +++ b/DataManagement/glossary/postman/glossary/terms-use-cases/terms-use-case.postman_collection.json @@ -15,15 +15,12 @@ "exec": [ "if(pm.response.to.have.status(200)){", " console.log(\"0. Authenticated successfully.\");", - " var jsonData = JSON.parse(responseBody);", - " postman.setEnvironmentVariable(\"bearerToken\", jsonData.access_token);", - " postman.setEnvironmentVariable(\"access_token\", jsonData.access_token);", + " var jsonData = pm.response.json();", + " pm.environment.set(\"bearerToken\", jsonData.access_token);", "}", " else {", " console.log(\"0. Failed with status: \" + pm.response.status);", - "}", - "", - "" + "}" ], "type": "text/javascript", "packages": {} @@ -161,8 +158,7 @@ " console.log(\"2. Successfully created term.\");", " var jsonData = pm.response.json();", " pm.environment.set(\"parentId\", jsonData.id);", - " var responseHeader = JSON.stringify(pm.response.headers);", - " pm.environment.set(\"parentEtag\", JSON.parse(responseHeader)[6].value);", + " pm.environment.set(\"parentEtag\", pm.response.headers.get(\"etag\"));", "} ", "else {", " console.log(\"2. Failed with status: \" + pm.response.status);", @@ -244,7 +240,7 @@ " console.log(\"3. Successfully created term.\");", " var jsonData = pm.response.json();", " pm.environment.set(\"childTermId\", jsonData.id);", - " var responseHeader = JSON.stringify(pm.response.headers);", + " pm.environment.set(\"childEtag\", pm.response.headers.get(\"etag\"));", "} ", "else {", " console.log(\"3. Failed with status: \" + pm.response.status);", @@ -314,7 +310,6 @@ "exec": [ "if(pm.response.to.have.status(200)){\r", " console.log(\"4. Successfully retrieved term.\");\r", - " var jsonData = JSON.parse(responseBody);\r", "} else {\r", " console.log(\"4. Failed with status: \" + pm.response.status);\r", "}" @@ -376,7 +371,6 @@ "exec": [ "if(pm.response.to.have.status(200)){", " console.log(\"5. Successfully retrieved term.\");", - " var jsonData = JSON.parse(responseBody);", "} else {", " console.log(\"5. Failed with status: \" + pm.response.status);", "}" @@ -441,7 +435,6 @@ "exec": [ "if(pm.response.to.have.status(200)){\r", " console.log(\"6. Successfully updated term.\");\r", - " var jsonData = JSON.parse(responseBody);\r", "} else {\r", " console.log(\"6. Failed with status: \" + pm.response.status);\r", "}" @@ -509,8 +502,6 @@ "exec": [ "if(pm.response.code === 200) {", " console.log(\"7. Successfully patched term.\");", - " var jsonData = pm.response.json();", - " pm.environment.set('grandchildEtag', pm.response.headers.get('Etag'));", "} else {", " console.log(\"7. Failed with status: \" + pm.response.status);", "}" @@ -548,13 +539,13 @@ }, { "key": "If-Match", - "value": "{{parentEtag}}", + "value": "{{childEtag}}", "type": "text" } ], "body": { "mode": "raw", - "raw": "[\n {\n \"op\": \"add\",\n \"path\": \"/parentId\",\n \"value\": \"\"\n }\n]", + "raw": "[\n {\n \"op\": \"remove\",\n \"path\": \"/parentId\"\n }\n]", "options": { "raw": { "language": "json" @@ -584,7 +575,6 @@ "exec": [ "if(pm.response.to.have.status(200)){\r", " console.log(\"8. Successfully retrieved term.\");\r", - " var jsonData = JSON.parse(responseBody);\r", "} else {\r", " console.log(\"8. Failed with status: \" + pm.response.status);\r", "}" @@ -650,8 +640,7 @@ "if(pm.response.to.have.status(201)){", " console.log(\"9a. Successfully created instance.\");", " var jsonData = pm.response.json();", - " const rs = pm.response.json();", - " pm.environment.set(\"tableId\", rs.id);", + " pm.environment.set(\"tableId\", jsonData.id);", "}", "else {", " console.log(\"9a. Failed with status: \" + pm.response.status);", @@ -660,25 +649,6 @@ "type": "text/javascript", "packages": {} } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "function randomString(length=1) {", - " let randomString = \"\";", - " for (let i = 0; i < length; i++){", - " randomString += pm.variables.replaceIn(\"{{$randomAlphaNumeric}}\");", - " }", - " return randomString;", - "}", - "", - "STRING_LEN = 4", - "pm.variables.set('randomString', randomString(STRING_LEN));" - ], - "type": "text/javascript", - "packages": {} - } } ], "request": { @@ -736,8 +706,7 @@ "if(pm.response.to.have.status(201)){", " console.log(\"9b. Successfully created instance.\");", " var jsonData = pm.response.json();", - " const rs = pm.response.json();", - " pm.environment.set(\"columnId\", rs.id);", + " pm.environment.set(\"columnId\", jsonData.id);", "}", "else {", " console.log(\"9b. Failed with status: \" + pm.response.status);", @@ -746,25 +715,6 @@ "type": "text/javascript", "packages": {} } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "function randomString(length=1) {", - " let randomString = \"\";", - " for (let i = 0; i < length; i++){", - " randomString += pm.variables.replaceIn(\"{{$randomAlphaNumeric}}\");", - " }", - " return randomString;", - "}", - "", - "STRING_LEN = 4", - "pm.variables.set('randomString', randomString(STRING_LEN));" - ], - "type": "text/javascript", - "packages": {} - } } ], "request": { @@ -822,8 +772,7 @@ "if(pm.response.to.have.status(201)){", " console.log(\"9c. Successfully created relationship.\");", " var jsonData = pm.response.json();", - " const rs = pm.response.json();", - " pm.environment.set(\"tabColId\", rs.id);", + " pm.environment.set(\"tabColId\", jsonData.id);", "}", "else {", " console.log(\"9c. Failed with status: \" + pm.response.status);", @@ -832,25 +781,6 @@ "type": "text/javascript", "packages": {} } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "function randomString(length=1) {", - " let randomString = \"\";", - " for (let i = 0; i < length; i++){", - " randomString += pm.variables.replaceIn(\"{{$randomAlphaNumeric}}\");", - " }", - " return randomString;", - "}", - "", - "STRING_LEN = 4", - "pm.variables.set('randomString', randomString(STRING_LEN));" - ], - "type": "text/javascript", - "packages": {} - } } ], "request": { @@ -898,19 +828,17 @@ "response": [] }, { - "name": "9d. Create termAsset relationship", + "name": "9d. Retrieve term entity", "event": [ { "listen": "test", "script": { "exec": [ - "if(pm.response.to.have.status(201)){", - " console.log(\"9d. Successfully created relationship.\");", + "if(pm.response.to.have.status(200)){", + " console.log(\"9d. Successfully retrieved term entity.\");", " var jsonData = pm.response.json();", - " const rs = pm.response.json();", - " pm.environment.set(\"termAssetId\", rs.id);", - "}", - "else {", + " pm.environment.set(\"termEntityId\", jsonData.items[0].id);", + "} else {", " console.log(\"9d. Failed with status: \" + pm.response.status);", "}" ], @@ -922,22 +850,18 @@ "listen": "prerequest", "script": { "exec": [ - "function randomString(length=1) {", - " let randomString = \"\";", - " for (let i = 0; i < length; i++){", - " randomString += pm.variables.replaceIn(\"{{$randomAlphaNumeric}}\");", - " }", - " return randomString;", - "}", - "", - "STRING_LEN = 4", - "pm.variables.set('randomString', randomString(STRING_LEN));" + "" ], "type": "text/javascript", "packages": {} } } ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "accept": true + } + }, "request": { "auth": { "type": "bearer", @@ -949,52 +873,45 @@ } ] }, - "method": "POST", + "method": "GET", "header": [ { "key": "Accept", - "value": "application/vnd.sas.metadata.instance.relationship+json" - }, - { - "key": "Content-Type", - "value": "application/vnd.sas.metadata.instance.relationship+json" + "value": "application/vnd.sas.collection+json" } ], - "body": { - "mode": "raw", - "raw": "{\r\n \"name\": \"{{prefix}} Term And Column Relationship\",\r\n \"label\": \"Term And Column Relationship\",\r\n \"description\": \"Term And Column Relationship\",\r\n \"instanceType\": \"relationship\",\r\n \"endpoint1Id\": \"{{parentId}}\",\r\n \"endpoint2Id\": \"{{columnId}}\",\r\n \"definition\": \"termAsset\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, "url": { - "raw": "{{sasserver}}/catalog/instances", + "raw": "{{sasserver}}/catalog/instances?filter=eq(resourceId,'/glossary/terms/{{parentId}}')", "host": [ "{{sasserver}}" ], "path": [ "catalog", "instances" + ], + "query": [ + { + "key": "filter", + "value": "eq(resourceId,'/glossary/terms/{{parentId}}')" + } ] } }, "response": [] }, { - "name": "9e. Get relationship instance", + "name": "9e. Create glossaryTermAsset relationship", "event": [ { "listen": "test", "script": { "exec": [ - "if(pm.response.to.have.status(200)){", - " console.log(\"9e. Successfully retrieved term.\");", - " var jsonData = JSON.parse(responseBody);", - " const rs = pm.response.json();", - " pm.environment.set(\"relInstId\", rs.id);", - "} else {", + "if(pm.response.to.have.status(201)){", + " console.log(\"9e. Successfully created relationship.\");", + " var jsonData = pm.response.json();", + " pm.environment.set(\"termAssetId\", jsonData.id);", + "}", + "else {", " console.log(\"9e. Failed with status: \" + pm.response.status);", "}" ], @@ -1003,9 +920,6 @@ } } ], - "protocolProfileBehavior": { - "disableBodyPruning": true - }, "request": { "auth": { "type": "bearer", @@ -1017,16 +931,20 @@ } ] }, - "method": "GET", + "method": "POST", "header": [ { "key": "Accept", "value": "application/vnd.sas.metadata.instance.relationship+json" + }, + { + "key": "Content-Type", + "value": "application/vnd.sas.metadata.instance.relationship+json" } ], "body": { "mode": "raw", - "raw": "", + "raw": "{\r\n \"name\": \"{{prefix}} Term And Asset Relationship\",\r\n \"label\": \"Term And Asset Relationship\",\r\n \"description\": \"Term And Asset Relationship\",\r\n \"instanceType\": \"relationship\",\r\n \"endpoint1Id\": \"{{termEntityId}}\",\r\n \"endpoint2Id\": \"{{columnId}}\",\r\n \"definition\": \"glossaryTermAsset\"\r\n}", "options": { "raw": { "language": "json" @@ -1034,14 +952,13 @@ } }, "url": { - "raw": "{{sasserver}}/catalog/instances/{{termAssetId}}", + "raw": "{{sasserver}}/catalog/instances", "host": [ "{{sasserver}}" ], "path": [ "catalog", - "instances", - "{{termAssetId}}" + "instances" ] } }, @@ -1056,7 +973,6 @@ "exec": [ "if(pm.response.to.have.status(200)){\r", " console.log(\"10. Successfully retrieved asset.\");\r", - " var jsonData = JSON.parse(responseBody);\r", "} else {\r", " console.log(\"10. Failed with status: \" + pm.response.status);\r", "}" @@ -1124,39 +1040,8 @@ "listen": "test", "script": { "exec": [ - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", - "", - " var jsonData = JSON.parse(responseBody);", - " if (jsonData.count > 0) {", - " pm.environment.set(\"instId\", jsonData.items[0].id);", - " pm.environment.set(\"instUri\", jsonData.items[0].resourceId);", - " pm.environment.set(\"defnId\", jsonData.items[0].definitionId);", - " }", - "", - " if (pm.response.to.have.status(200)) {", - " // Retrieve the response JSON", - " var jsonData = pm.response.json();", - "", - " // Create an empty array to store the ids", - " var idList = [];", - "", - " // Check if there are any items in the response", - " if (jsonData.count > 0) {", - " // Iterate through each item and extract the id", - " jsonData.items.forEach(function(item) {", - " idList.push('\"' + item.id + '\"');", - " });", - " }", - "", - " // Set the idList as an environment variable", - " pm.environment.set(\"idList\", idList);", - " }", - "});", - "", - "if(pm.response.to.have.status(200)){", - " console.log(\"11. Successfully retrieved asset.\");", - " var jsonData = JSON.parse(responseBody);", + "if (pm.response.to.have.status(200)) {", + " console.log(\"11. Successfully retrieved terms.\");", "} else {", " console.log(\"11. Failed with status: \" + pm.response.status);", "}" @@ -1185,7 +1070,7 @@ } ], "url": { - "raw": "{{sasserver}}/catalog/instances?limit=10&filter=contains(name, \"Term And Column Relationship\")", + "raw": "{{sasserver}}/catalog/instances?limit=10&filter=contains(name, \"Term And Asset Relationship\")", "host": [ "{{sasserver}}" ], @@ -1200,7 +1085,7 @@ }, { "key": "filter", - "value": "contains(name, \"Term And Column Relationship\")" + "value": "contains(name, \"Term And Asset Relationship\")" } ] } @@ -1223,29 +1108,6 @@ "type": "text/javascript", "packages": {} } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "// This will make a GET request before deleting the instance, allowing the body information to be found in the console.", - "pm.sendRequest({", - " url: pm.environment.replaceIn(\"{{saserver}}/catalog/instances/{{instId}}\"), ", - " method: 'GET',", - " header: {", - " 'Authorization': pm.environment.replaceIn(\"Bearer {{bearerToken}}\"),", - " 'Accept': pm.environment.replaceIn(\"{{INSTANCE_RELATIONSHIP_JSON}}\")", - " }", - " }, function (err, res) {", - " if (err) {", - " console.log(err)", - " }", - " console.log(res)", - "});" - ], - "type": "text/javascript", - "packages": {} - } } ], "request": { @@ -1276,14 +1138,14 @@ "response": [] }, { - "name": "13. Delete term", + "name": "13. Delete child term", "event": [ { "listen": "test", "script": { "exec": [ "if(pm.response.to.have.status(204)){\r", - " console.log(\"13. Successfully deleted term.\");\r", + " console.log(\"13. Successfully deleted child term.\");\r", "} else {\r", " console.log(\"13. Failed with status: \" + pm.response.status);\r", "}" @@ -1326,45 +1188,17 @@ "response": [] }, { - "name": "14. Get and delete instances", + "name": "14. Delete parent term", "event": [ { "listen": "test", "script": { "exec": [ - "let host=pm.environment.get(\"sasserver\");", - "let token=pm.environment.get(\"access_token\");", - "let items = pm.response.json().items;", - "", - "function deleteTerms(index) {", - " if (index >= items.length) {", - " console.log('14. All terms have been processed.');", - " return;", - " }", - "", - " aTerm=items[index]", - " ", - " delLink = aTerm.links.find(link=>link.rel===\"delete\").href;", - "", - " delRequest = {", - " url: host + delLink,", - " method: 'DELETE',", - " header: 'Authorization: bearer ' + token", - " };", - "", - " pm.sendRequest(delRequest, function (err, response) {", - " if (err) {", - " console.error('14. Error deleting term:', err);", - " } else {", - " console.log('14. Deleted term with id:', aTerm.id);", - " }", - " deleteTerms(index + 1); // Proceed to the next item after the current one is processed", - " });", - "}", - "", - "// Start the deletion process from the first item", - "deleteTerms(0);", - "" + "if(pm.response.to.have.status(204)){\r", + " console.log(\"14. Successfully deleted parent term.\");\r", + "} else {\r", + " console.log(\"14. Failed with status: \" + pm.response.status);\r", + "}" ], "type": "text/javascript", "packages": {} @@ -1387,40 +1221,17 @@ } ] }, - "method": "GET", - "header": [ - { - "key": "Accept", - "value": "application/vnd.sas.collection+json" - }, - { - "key": "Accept-Item", - "value": "application/vnd.sas.glossary.term+json", - "disabled": true - } - ], + "method": "DELETE", + "header": [], "url": { - "raw": "{{sasserver}}/catalog/instances?filter=startsWith(name,'{{prefix}}')&limit=20&sortBy=creationTimeStamp:descending", + "raw": "{{sasserver}}/glossary/terms/{{parentId}}", "host": [ "{{sasserver}}" ], "path": [ - "catalog", - "instances" - ], - "query": [ - { - "key": "filter", - "value": "startsWith(name,'{{prefix}}')" - }, - { - "key": "limit", - "value": "20" - }, - { - "key": "sortBy", - "value": "creationTimeStamp:descending" - } + "glossary", + "terms", + "{{parentId}}" ] } }, @@ -1480,6 +1291,56 @@ } }, "response": [] + }, + { + "name": "16. Delete table and related instances", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "if(pm.response.to.have.status(204)){\r", + " console.log(\"16. Successfully deleted table and related instances.\");\r", + "} else {\r", + " console.log(\"16. Failed with status: \" + pm.response.status);\r", + "}" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "protocolProfileBehavior": { + "disabledSystemHeaders": { + "accept": true + } + }, + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{bearerToken}}", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [], + "url": { + "raw": "{{sasserver}}/catalog/instances/{{tableId}}", + "host": [ + "{{sasserver}}" + ], + "path": [ + "catalog", + "instances", + "{{tableId}}" + ] + } + }, + "response": [] } ] } \ No newline at end of file diff --git a/DataManagement/glossary/python/glossary/terms-use-cases/terms_use_cases.ipynb b/DataManagement/glossary/python/glossary/terms-use-cases/terms_use_cases.ipynb index 65529f4..26708eb 100644 --- a/DataManagement/glossary/python/glossary/terms-use-cases/terms_use_cases.ipynb +++ b/DataManagement/glossary/python/glossary/terms-use-cases/terms_use_cases.ipynb @@ -419,9 +419,8 @@ "\n", "payload = json.dumps([\n", " {\n", - " \"op\": \"add\",\n", + " \"op\": \"remove\",\n", " \"path\": \"/parentId\",\n", - " \"value\": \"\"\n", " }\n", "])\n", "headers = {\n", @@ -617,6 +616,41 @@ " f\"Error. Here is the response:\\n{json.dumps(response.json(), indent=2)}\")" ] }, + { + "cell_type": "markdown", + "id": "597b37ee", + "metadata": {}, + "source": [ + "##### Retrieving a term entity\n", + "This use case retrieves a glossary term's entity to be used when assigning the term to an asset." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e3005b26", + "metadata": {}, + "outputs": [], + "source": [ + "url = sasserver + \"/catalog/instances?filter=eq(resourceId,'/glossary/terms/\" + parentId + \"')\"\n", + "\n", + "payload = {}\n", + "headers = {\n", + " 'Accept': 'application/vnd.sas.collection+json',\n", + " 'Authorization': 'Bearer ' + access_token\n", + "}\n", + "\n", + "response = requests.request(\"GET\", url, headers=headers, data=payload, verify=False)\n", + "if response.status_code == 200:\n", + " print(\"Successfully retrieved term entity.\")\n", + " response = response.json()\n", + " print(json.dumps(response, indent=2))\n", + " termEntityId = response.get(\"items\", [{}])[0].get(\"id\", \"\")\n", + "else:\n", + " print(f\"Error retrieving term entity ID. Here is the response:\\n{json.dumps(response.json(), indent=2)}\")\n", + " termEntityId = \"\"" + ] + }, { "cell_type": "markdown", "id": "6e08595f", @@ -636,13 +670,13 @@ "url = sasserver + \"/catalog/instances\"\n", "\n", "payload = json.dumps({\n", - " \"name\": prefix + \" Term And Column Relationship\",\n", - " \"label\": \"Term And Column Relationship\",\n", - " \"description\": \"Term And Column Relationship\",\n", + " \"name\": prefix + \" Term And Asset Relationship\",\n", + " \"label\": \"Term And Asset Relationship\",\n", + " \"description\": \"Term And Asset Relationship\",\n", " \"instanceType\": \"relationship\",\n", - " \"endpoint1Id\": parentId,\n", + " \"endpoint1Id\": termEntityId,\n", " \"endpoint2Id\": columnId,\n", - " \"definition\": \"termAsset\"\n", + " \"definition\": \"glossaryTermAsset\"\n", "})\n", "headers = {\n", " 'Accept': 'application/vnd.sas.metadata.instance.relationship+json',\n", @@ -713,7 +747,7 @@ "metadata": {}, "outputs": [], "source": [ - "url = sasserver + \"/catalog/instances?limit=10&filter=contains(name, \\\"\" + prefix + \" Term And Column Relationship\\\")\"\n", + "url = sasserver + \"/catalog/instances?limit=10&filter=contains(name, \\\"\" + prefix + \" Term And Asset Relationship\\\")\"\n", "\n", "payload = {}\n", "headers = {\n", @@ -803,7 +837,7 @@ "metadata": {}, "source": [ "##### Clean up\n", - "This use case deletes terms and term types that were created by these examples." + "This deletes terms, term types, and instances that were created by these examples." ] }, { @@ -813,63 +847,50 @@ "metadata": {}, "outputs": [], "source": [ - "# Getting All Terms\n", - "url = sasserver + \"/catalog/instances?filter=startsWith(name,\" + prefix + \")&limit=20&sortBy=creationTimeStamp:descending\"\n", + "# Delete parent term\n", + "url = sasserver + \"/glossary/terms/\" + parentId\n", "\n", "headers = {\n", - " 'Accept': 'application/vnd.sas.collection+json',\n", - " 'Authorization': 'Bearer ' + access_token\n", + " 'Authorization': 'Bearer ' + access_token\n", "}\n", "\n", - "response = requests.request(\"GET\", url, headers=headers, data=payload, verify=False)\n", - "\n", - "if response.status_code == 200:\n", - " instances = response.json().get('items', [])\n", - "\n", - " host = sasserver\n", - " token = access_token\n", + "response = requests.request(\"DELETE\", url, headers=headers, data=payload, verify=False)\n", "\n", - " # Deleting Terms\n", - " for index, a_term in enumerate(instances):\n", - " del_link = next(link['href'] for link in a_term['links'] if link['rel'] == 'delete')\n", + "if response.status_code == 204:\n", + " print(\"Successfully deleted term.\")\n", "\n", - " del_request_url = host + del_link\n", - " del_request_headers = {'Authorization': 'Bearer ' + token}\n", + "else:\n", + " print(\n", + " f\"Error. Here is the response:\\n{json.dumps(response.json(), indent=2)}\")\n", "\n", - " response = requests.delete(del_request_url, headers=del_request_headers, verify=False)\n", - " if response.status_code == 204:\n", - " print('Deleted term with id:', a_term['id'])\n", - " else:\n", - " print('Error deleting term:', response.text)\n", + "# Delete Term Type\n", + "url = sasserver + \"/glossary/termTypes/\" + termTypeId\n", + "response = requests.request(\"DELETE\", url, headers=headers, data=payload, verify=False)\n", "\n", - " print('All terms have been processed.')\n", + "if response.status_code == 204:\n", + " print(\"Successfully deleted term type.\")\n", "\n", "else:\n", - " print(f\"Error retrieving terms:\\n{json.dumps(response.json(), indent=2)}\")\n", + " print(\n", + " f\"Error. Here is the response:\\n{json.dumps(response.json(), indent=2)}\")\n", "\n", - "# Deleting Term Types\n", - "url = sasserver + \"/glossary/termTypes/\" + termTypeId\n", - "\n", - "payload = {}\n", - "headers = {\n", - " 'Accept': 'application/vnd.sas.glossary.term.type+json',\n", - " 'Authorization': 'Bearer ' + access_token\n", - "}\n", + "# Delete table, column, and relationship instances\n", + "url = sasserver + \"/catalog/instances/\" + tableId\n", "\n", "response = requests.request(\"DELETE\", url, headers=headers, data=payload, verify=False)\n", "\n", "if response.status_code == 204:\n", - " print(\"Successfully deleted term type.\")\n", + " print(\"Successfully deleted instances. Relationships and columns are deleted automatically with the table.\")\n", "\n", "else:\n", " print(\n", - " f\"Error. Here is the response:\\n{json.dumps(response.json(), indent=2)}\")" + " f\"Error. Here is the response:\\n{json.dumps(response.json(), indent=2)}\")\n" ] } ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -883,7 +904,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.6" + "version": "3.14.2" } }, "nbformat": 4,