diff --git a/.ipynb_checkpoints/Element_Create_Update_Delete-checkpoint.ipynb b/.ipynb_checkpoints/Element_Create_Update_Delete-checkpoint.ipynb new file mode 100644 index 0000000..2687891 --- /dev/null +++ b/.ipynb_checkpoints/Element_Create_Update_Delete-checkpoint.ipynb @@ -0,0 +1,763 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "3ee4834f", + "metadata": { + "tags": [] + }, + "source": [ + "# Initializing the SysML v2 API" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "6b5fef59", + "metadata": {}, + "outputs": [], + "source": [ + "from __future__ import print_function\n", + "\n", + "import time\n", + "import requests\n", + "from pprint import pprint\n", + "import pandas as pd\n", + "import json\n", + "from datetime import datetime\n", + "\n", + "#host = \"\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Project NameProject ID
Spacecraft project with Element CRUD - 2022-09-12 12:08:48.8158500659c128-afd5-42a1-912b-962068f1f053
17b-Sequence-Modeling Fri Sep 09 17:37:26 EDT 20220f7045bd-9a1c-4b54-90d9-775c0f642e1b
3a-Function-based Behavior-2 Fri Sep 09 17:26:30 EDT 2022128710cd-978f-4c6f-93ac-8afbbd194185
10c-Fuel Economy Analysis Fri Sep 09 17:30:43 EDT 20222909d482-a659-4307-9803-bdfcbe0a7989
PartTest Fri Sep 09 17:22:13 EDT 20222a2a4d7d-cd9e-41ec-bec0-2bf6fcea6767
15_05-Unification of Expression and Constraint Definition Fri Sep 09 17:35:59 EDT 202239dcf070-668c-4711-a231-c2640b9f7f88
15_19-Materials with Properties Fri Sep 09 17:36:44 EDT 20223bd937e0-ab2e-47a6-8f66-0458df9f29de
14b-Language Extensions Fri Sep 09 17:35:06 EDT 2022431cd401-010c-401f-9101-115240312d24
13b-Safety and Security Features Element Group-1 Fri Sep 09 17:33:37 EDT 202246b226ce-8519-42de-96b4-07ff1045d0dd
Spacecraft project with Element CRUD - 2022-09-12 13:03:26.5685654853c38b-85c5-40e5-9e83-b69c2e73415a
3a-Function-based Behavior-3 Fri Sep 09 17:26:52 EDT 202248f9a623-2451-4150-8b98-58e3b3c515cd
12a-Dependency Fri Sep 09 17:32:29 EDT 202249a60e69-b509-4191-b1c3-240de628110b
7b-Variant Configurations Fri Sep 09 17:28:59 EDT 202259c86238-ef81-434e-a389-5393312ba0d7
17a-Sequence-Modeling Fri Sep 09 17:37:07 EDT 2022653c5173-770d-4ea6-90dc-c173d049258c
13a-Model Containment Fri Sep 09 17:33:03 EDT 20226699f5e0-403b-414a-87c9-46671e702fab
11b-Safety and Security Feature Views Fri Sep 09 17:32:05 EDT 202284f30a8f-f839-4a71-aee9-dff2a2d28dbf
1c-Parts Tree Redefinition Fri Sep 09 17:25:05 EDT 202285d874ae-1f68-4949-9b16-378f1cbc477e
14a-Language Extensions Fri Sep 09 17:34:49 EDT 20228f0bc3b3-a580-40fd-b99b-0e8865984c4f
6-Individual and Snapshots Fri Sep 09 17:28:35 EDT 2022913dab3f-4d5d-482d-9238-7491aead3e1a
PartTest Fri Sep 09 17:21:50 EDT 202291b2be09-16de-4d35-87a4-589f3274ce55
11a-View-Viewpoint Fri Sep 09 17:31:42 EDT 202291fd6db5-4cfa-4970-b115-05010053ec72
13b-Safety and Security Features Element Group Fri Sep 09 17:33:20 EDT 202295bfcea3-8ed7-4bd4-9e98-3d6ed311091e
Spacecraft project with branches and tags - 2022-09-09 17:04:20.838366978d0199-4e44-4090-8cb6-4253fd79e315
3a-Function-based Behavior-1 Fri Sep 09 17:26:05 EDT 20229da34b47-38d0-4630-bcb4-c387d5fac1da
9-Verification-simplified Fri Sep 09 17:29:54 EDT 2022a9a02019-b810-4fcb-9a9c-5cad061db29f
10b-Trade-off Among Alternative Configurations Fri Sep 09 17:30:18 EDT 2022ada6b9b6-3534-43b3-a567-f97092ac26f1
12b-Allocation Fri Sep 09 17:32:45 EDT 2022b4c01f6d-8173-4d43-abd1-596bdb89d6d4
Spacecraft project with Element CRUD - 2022-09-12 12:08:28.268425b67ebee6-b55e-4088-b059-c2f102989ac2
8-Requirements Fri Sep 09 17:29:27 EDT 2022b6a3450b-8624-45c2-8dd9-68d301a439fe
15_10-Primitive Data Types Fri Sep 09 17:36:20 EDT 2022bb65a453-67bc-4e6c-92c7-29734c80bab1
2a-Parts Interconnection Fri Sep 09 17:23:32 EDT 2022c64923aa-79f4-419c-b983-6244fee741d6
5-State-based Behavior-1 Fri Sep 09 17:27:37 EDT 2022c6b1d4d6-a66e-4097-8752-5307ecd9ebaf
2a-Parts Interconnection Fri Sep 09 17:25:35 EDT 2022cb4e467e-772b-4054-849e-26e4b0e1e0c0
10d-Dynamics Analysis Fri Sep 09 17:31:13 EDT 2022cceed28a-64fb-4401-81da-afcadd96d1d6
13b-Safety and Security Features Element Group-2 Fri Sep 09 17:34:08 EDT 2022d4c21bc8-6778-4a97-b389-48b1e7b23260
5-State-based Behavior-1a Fri Sep 09 17:28:06 EDT 2022d63b8882-f41e-40ef-a4a2-cf74fa47f6dc
14c-Language Extensions Fri Sep 09 17:35:25 EDT 2022da4e65b6-460d-447b-8cf9-56a3ad44e514
4a-Functional Allocation Fri Sep 09 17:27:13 EDT 2022e7090e9d-74f0-4b63-a4a6-6dd8647b5bdd
Spacecraft project with Element CRUD - 2022-09-12 12:57:59.306887f8161e56-586e-44ae-ab12-53ad1fc972de
18-Use Case Fri Sep 09 17:37:44 EDT 2022ff0dfcc3-cf11-4d4f-961a-ae42326f6b12
\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "projects_url = f\"{host}/projects\" \n", + "projects_response = requests.get(projects_url)\n", + "\n", + "if projects_response.status_code == 200:\n", + " projects = projects_response.json()\n", + " projects_data = list(map(lambda b: {'Project Name':b['name'], 'Project ID':b['@id']}, projects))\n", + " df = pd.DataFrame.from_records(projects_data).style.hide(axis='index')\n", + " # if len(projects_data) > 0:\n", + " # df = df.style.sort_values(by='Project Name')\n", + " display(df)\n", + "else:\n", + " pprint(\"Problem in fetching projects\")" + ] + }, + { + "cell_type": "markdown", + "id": "77345839-9d8f-409f-9131-440d1b30cbea", + "metadata": {}, + "source": [ + "# Create a new project" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "6d2ba2fc-157a-4ac8-b8f3-876bbd3a21ea", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'@id': 'f0594c9c-55ef-49f6-9591-d27d12cc0afb',\n", + " '@type': 'Project',\n", + " 'defaultBranch': {'@id': 'd84e4540-56c8-485a-bace-f91b3620ada5'},\n", + " 'description': 'Spacecraft project demonstrating Element Create, Update, '\n", + " 'Delete steps',\n", + " 'name': 'Spacecraft project with Element CRUD - 2022-09-12 13:16:03.708730'}\n" + ] + } + ], + "source": [ + "timestamp = datetime.now()\n", + "project_name = f\"Spacecraft project with Element CRUD - {timestamp}\"\n", + "project_data = {\n", + " \"@type\":\"Project\",\n", + " \"name\": project_name,\n", + " \"description\": \"Spacecraft project demonstrating Element Create, Update, Delete steps\"\n", + "}\n", + "\n", + "project_post_url = f\"{host}/projects\" \n", + "\n", + "project_post_response = requests.post(project_post_url, \n", + " headers={\"Content-Type\": \"application/json\"}, \n", + " data=json.dumps(project_data))\n", + "\n", + "project_id = \"\"\n", + "\n", + "if project_post_response.status_code == 200:\n", + " project_response_json = project_post_response.json()\n", + " pprint(project_response_json)\n", + " project_id = project_response_json['@id']\n", + " project_name = project_response_json['name']\n", + "else:\n", + " pprint(f\"Problem in creating a new Spacecraft project at {timestamp}\")\n", + " pprint(project_post_response)" + ] + }, + { + "cell_type": "markdown", + "id": "921efbfd-04a1-4c5c-8e66-b31f0390aa45", + "metadata": {}, + "source": [ + "# Get branches" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "df3e1039-ba51-4653-8897-e98be111078e", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Branch NameBranch IDRef Commit (head)
maind84e4540-56c8-485a-bace-f91b3620ada5None
\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "branches_url = f\"{host}/projects/{project_id}/branches\" \n", + "branches_response = requests.get(branches_url)\n", + "\n", + "if branches_response.status_code == 200:\n", + " branches = branches_response.json()\n", + " branches_data = list(map(lambda b: {'Branch Name':b['name'], 'Branch ID':b['@id'], 'Ref Commit (head)':b['head']}, branches))\n", + "\n", + " df = pd.DataFrame.from_records(branches_data).sort_values(by='Branch Name').style.hide(axis='index')\n", + " display(df)\n", + "else:\n", + " pprint(f\"Problem in fetching branches of Spacecraft project {project_id}\")\n", + " pprint(branches_response)" + ] + }, + { + "cell_type": "markdown", + "id": "569ca8f1-ebf1-41d2-93f3-8795a2439eea", + "metadata": {}, + "source": [ + "# Create 1st Commit on the main (default) branch that creates 2 elements" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "3eed91b9-903b-441f-b1f2-10dbcfafa342", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'@id': '25853b78-df3e-44d3-9a63-c3221743d82d',\n", + " '@type': 'Commit',\n", + " 'owningProject': {'@id': 'f0594c9c-55ef-49f6-9591-d27d12cc0afb'},\n", + " 'previousCommit': None,\n", + " 'timestamp': '2022-09-12T13:16:13.843497-04:00'}\n" + ] + } + ], + "source": [ + "commit_body = {\n", + " \"@type\": \"Commit\",\n", + " \"change\": [\n", + " {\n", + " \"@type\": \"DataVersion\",\n", + " \"payload\": {\n", + " \"@type\": \"PartDefinition\",\n", + " \"name\":\"Spacecraft System\"\n", + " }\n", + " },\n", + " {\n", + " \"@type\": \"DataVersion\",\n", + " \"payload\": {\n", + " \"@type\": \"PartDefinition\",\n", + " \"name\":\"Payload System\"\n", + " }\n", + " }\n", + " ]\n", + "}\n", + "\n", + "commit_post_url = f\"{host}/projects/{project_id}/commits\" \n", + "\n", + "commit_post_response = requests.post(commit_post_url, \n", + " headers={\"Content-Type\": \"application/json\"}, \n", + " data=json.dumps(commit_body))\n", + "\n", + "commit1_id = \"\"\n", + "\n", + "if commit_post_response.status_code == 200:\n", + " commit_response_json = commit_post_response.json()\n", + " pprint(commit_response_json)\n", + " commit1_id = commit_response_json['@id']\n", + "else:\n", + " pprint(f\"Problem in creating a new commit in Spacecraft project {project_id}\")\n", + " pprint(commit_post_response)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "65537f5c-f521-469e-92e4-9a2568afed05", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Element NameElement ID
Payload System1093a5fd-5a5e-47d7-8bfd-b870ede05648
Spacecraft System07a9a21c-2070-4d6b-8818-bb3bca62dfd8
\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "element_get_url = f\"{host}/projects/{project_id}/commits/{commit1_id}/elements\" \n", + "\n", + "element_get_response = requests.get(element_get_url)\n", + "payload_system_element_id = \"\"\n", + "spacecraft_system_element_id = \"\"\n", + "\n", + "if element_get_response.status_code == 200:\n", + " elements = element_get_response.json()\n", + " \n", + " # Gather the id of the Payload System that is created\n", + " payload_system_element = list(filter(lambda e: e['name'] == \"Payload System\", elements))\n", + " if payload_system_element:\n", + " payload_system_element_id = payload_system_element[0]['@id']\n", + " \n", + " # Gather the id of the Spacecraft System that is created\n", + " spacecraft_system_element = list(filter(lambda e: e['name'] == \"Spacecraft System\", elements))\n", + " if spacecraft_system_element:\n", + " spacecraft_system_element_id = spacecraft_system_element[0]['@id']\n", + " \n", + " elements_data = list(map(lambda b: {'Element Name':b['name'], 'Element ID':b['@id']}, elements))\n", + " df = pd.DataFrame.from_records(elements_data).sort_values(by='Element Name').style.hide(axis='index')\n", + " display(df)\n", + "else:\n", + " pprint(f\"Problem in fetching elements in the Spacecraft project {project_id} at commit {commit1_id}.\")\n", + " pprint(element_get_response)" + ] + }, + { + "cell_type": "markdown", + "id": "8e38b288-6517-4a7b-90e5-ae73c5f89df3", + "metadata": {}, + "source": [ + "# Create the 2nd Commit that updates the name of one of the elements" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "76d80cb1-40c8-4f24-aeb5-51e509f4e159", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'@id': 'da8991ce-1124-493b-8f34-a4bb2d0800e1',\n", + " '@type': 'Commit',\n", + " 'owningProject': {'@id': 'f0594c9c-55ef-49f6-9591-d27d12cc0afb'},\n", + " 'previousCommit': {'@id': '25853b78-df3e-44d3-9a63-c3221743d82d'},\n", + " 'timestamp': '2022-09-12T13:16:21.941689-04:00'}\n" + ] + } + ], + "source": [ + "commit_body = {\n", + " \"@type\": \"Commit\",\n", + " \"change\": [\n", + " {\n", + " \"@type\": \"DataVersion\",\n", + " \"payload\": {\n", + " \"@type\": \"PartDefinition\",\n", + " \"name\":\"New Payload System\",\n", + " \"identifier\":payload_system_element_id\n", + " },\n", + " \"identity\": {\n", + " \"@id\": payload_system_element_id\n", + " }\n", + " }\n", + " ],\n", + " \"previousCommit\": {\n", + " \"@id\": commit1_id\n", + " }\n", + "}\n", + "\n", + "commit_post_url = f\"{host}/projects/{project_id}/commits\" \n", + "\n", + "commit_post_response = requests.post(commit_post_url, \n", + " headers={\"Content-Type\": \"application/json\"}, \n", + " data=json.dumps(commit_body))\n", + "\n", + "commit2_id = \"\"\n", + "\n", + "if commit_post_response.status_code == 200:\n", + " commit_response_json = commit_post_response.json()\n", + " pprint(commit_response_json)\n", + " commit2_id = commit_response_json['@id']\n", + "else:\n", + " pprint(f\"Problem in creating a new commit in Spacecraft project {project_id}\")\n", + " pprint(commit_post_response)" + ] + }, + { + "cell_type": "markdown", + "id": "d815e4fe", + "metadata": {}, + "source": [ + "# Get all elements after the 2nd commit (should show 1 element updated)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "eac0a387-e4cf-4fc8-8b47-c64ed2ebff62", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Element NameElement ID
New Payload System1093a5fd-5a5e-47d7-8bfd-b870ede05648
Spacecraft System07a9a21c-2070-4d6b-8818-bb3bca62dfd8
\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "element_get_url = f\"{host}/projects/{project_id}/commits/{commit2_id}/elements\" \n", + "\n", + "element_get_response = requests.get(element_get_url)\n", + "\n", + "if element_get_response.status_code == 200:\n", + " elements = element_get_response.json()\n", + " elements_data = list(map(lambda b: {'Element Name':b['name'], 'Element ID':b['@id']}, elements))\n", + " df = pd.DataFrame.from_records(elements_data).sort_values(by='Element Name').style.hide(axis='index')\n", + " display(df)\n", + "else:\n", + " pprint(f\"Problem in fetching elements in the Spacecraft project {project_id} at commit {commit2_id}.\")\n", + " pprint(element_get_response)" + ] + }, + { + "cell_type": "markdown", + "id": "8dbea034-4180-415f-9604-8e1afb149fdc", + "metadata": {}, + "source": [ + "# Create the 3rd commit that deletes an element (same one whose name was updated)" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "055f42b3-18de-4f94-ae53-43660948493b", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'@id': '00f0b229-7e70-4688-80e8-ae2eafc0ce8e',\n", + " '@type': 'Commit',\n", + " 'owningProject': {'@id': 'f0594c9c-55ef-49f6-9591-d27d12cc0afb'},\n", + " 'previousCommit': {'@id': 'da8991ce-1124-493b-8f34-a4bb2d0800e1'},\n", + " 'timestamp': '2022-09-12T13:16:45.992847-04:00'}\n" + ] + } + ], + "source": [ + "commit_body = {\n", + " \"@type\": \"Commit\",\n", + " \"change\": [\n", + " {\n", + " \"@type\": \"DataVersion\",\n", + " \"payload\":None,\n", + " \"identity\": {\n", + " \"@id\": payload_system_element_id\n", + " }\n", + " }\n", + " ],\n", + " \"previousCommit\": {\n", + " \"@id\": commit2_id\n", + " }\n", + "}\n", + "\n", + "commit_post_url = f\"{host}/projects/{project_id}/commits\" \n", + "\n", + "commit_post_response = requests.post(commit_post_url, \n", + " headers={\"Content-Type\": \"application/json\"}, \n", + " data=json.dumps(commit_body))\n", + "\n", + "commit3_id = \"\"\n", + "\n", + "if commit_post_response.status_code == 200:\n", + " commit_response_json = commit_post_response.json()\n", + " pprint(commit_response_json)\n", + " commit3_id = commit_response_json['@id']\n", + "else:\n", + " pprint(f\"Problem in creating a new commit in Spacecraft project {project_id}\")\n", + " pprint(commit_post_response)" + ] + }, + { + "cell_type": "markdown", + "id": "61cdaecd-44db-4e27-85dd-de5d002648cc", + "metadata": {}, + "source": [ + "# Get all elements after the 3rd commit (should only 1 element)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "86008838-368a-4e58-9d5b-70e9c57442f4", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "'Fetching elements at commit da8991ce-1124-493b-8f34-a4bb2d0800e1'\n" + ] + }, + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Element NameElement ID
Spacecraft System07a9a21c-2070-4d6b-8818-bb3bca62dfd8
\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "pprint(f\"Fetching elements at commit {commit2_id}\")\n", + "element_get_url = f\"{host}/projects/{project_id}/commits/{commit3_id}/elements\" \n", + "\n", + "element_get_response = requests.get(element_get_url)\n", + "\n", + "if element_get_response.status_code == 200:\n", + " elements = element_get_response.json()\n", + " elements_data = list(map(lambda b: {'Element Name':b['name'], 'Element ID':b['@id']}, elements))\n", + " df = pd.DataFrame.from_records(elements_data).sort_values(by='Element Name').style.hide(axis='index')\n", + " display(df)\n", + "else:\n", + " pprint(f\"Problem in fetching elements in the Spacecraft project {project_id} at commit {commit2_id}\")\n", + " pprint(element_get_response)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.13" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/.ipynb_checkpoints/Project_Commit_Branch_Tag_Recipe-checkpoint.ipynb b/.ipynb_checkpoints/Project_Commit_Branch_Tag_Recipe-checkpoint.ipynb new file mode 100644 index 0000000..206c24d --- /dev/null +++ b/.ipynb_checkpoints/Project_Commit_Branch_Tag_Recipe-checkpoint.ipynb @@ -0,0 +1,1202 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "3ee4834f", + "metadata": { + "tags": [] + }, + "source": [ + "# Initializing the SysML v2 API" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "6b5fef59", + "metadata": {}, + "outputs": [], + "source": [ + "from __future__ import print_function\n", + "\n", + "import time\n", + "import requests\n", + "from pprint import pprint\n", + "import pandas as pd\n", + "import json\n", + "from datetime import datetime\n", + "\n", + "#host = \"\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + "
\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "projects_url = f\"{host}/projects\" \n", + "projects_response = requests.get(projects_url)\n", + "\n", + "if projects_response.status_code == 200:\n", + " projects = projects_response.json()\n", + " projects_data = list(map(lambda b: {'Project Name':b['name'], 'Project ID':b['@id']}, projects))\n", + " df = pd.DataFrame.from_records(projects_data).style.hide(axis='index')\n", + " # if len(projects_data) > 0:\n", + " # df = df.style.sort_values(by='Project Name')\n", + " display(df)\n", + "else:\n", + " pprint(\"Problem in fetching projects\")" + ] + }, + { + "cell_type": "markdown", + "id": "77345839-9d8f-409f-9131-440d1b30cbea", + "metadata": {}, + "source": [ + "# Create a new project" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "6d2ba2fc-157a-4ac8-b8f3-876bbd3a21ea", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'@id': '978d0199-4e44-4090-8cb6-4253fd79e315',\n", + " '@type': 'Project',\n", + " 'defaultBranch': {'@id': '3e5d38d1-91e4-4ec2-b2ac-857738731468'},\n", + " 'description': 'Spacecraft project with multiple commits, branches, and tags',\n", + " 'name': 'Spacecraft project with branches and tags - 2022-09-09 '\n", + " '17:04:20.838366'}\n" + ] + } + ], + "source": [ + "timestamp = datetime.now()\n", + "project_name = f\"Spacecraft project with branches and tags - {timestamp}\"\n", + "project_data = {\n", + " \"@type\":\"Project\",\n", + " \"name\": project_name,\n", + " \"description\": \"Spacecraft project with multiple commits, branches, and tags\"\n", + "}\n", + "\n", + "project_post_url = f\"{host}/projects\" \n", + "\n", + "project_post_response = requests.post(project_post_url, \n", + " headers={\"Content-Type\": \"application/json\"}, \n", + " data=json.dumps(project_data))\n", + "\n", + "project_id = \"\"\n", + "\n", + "if project_post_response.status_code == 200:\n", + " project_response_json = project_post_response.json()\n", + " pprint(project_response_json)\n", + " project_id = project_response_json['@id']\n", + " project_name = project_response_json['name']\n", + "else:\n", + " pprint(f\"Problem in creating a new Spacecraft project at {timestamp}\")\n", + " pprint(project_post_response)" + ] + }, + { + "cell_type": "markdown", + "id": "921efbfd-04a1-4c5c-8e66-b31f0390aa45", + "metadata": {}, + "source": [ + "# Get branches" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "df3e1039-ba51-4653-8897-e98be111078e", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Branch NameBranch IDRef Commit (head)
main3e5d38d1-91e4-4ec2-b2ac-857738731468None
\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "branches_url = f\"{host}/projects/{project_id}/branches\" \n", + "branches_response = requests.get(branches_url)\n", + "\n", + "if branches_response.status_code == 200:\n", + " branches = branches_response.json()\n", + " branches_data = list(map(lambda b: {'Branch Name':b['name'], 'Branch ID':b['@id'], 'Ref Commit (head)':b['head']}, branches))\n", + "\n", + " df = pd.DataFrame.from_records(branches_data).sort_values(by='Branch Name').style.hide(axis='index')\n", + " display(df)\n", + "else:\n", + " pprint(f\"Problem in fetching branches of Spacecraft project {project_id}\")\n", + " pprint(branches_response)" + ] + }, + { + "cell_type": "markdown", + "id": "5f761af7-0b40-4708-8c8e-217c9b2b6e8a", + "metadata": {}, + "source": [ + "# Get tags" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "65deeb6c-ce34-43c5-ad62-bf145e946f1d", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[]\n" + ] + }, + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + "
\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "tags_url = f\"{host}/projects/{project_id}/tags\" \n", + "tags_response = requests.get(tags_url)\n", + "\n", + "if tags_response.status_code == 200:\n", + " tags = tags_response.json()\n", + " pprint(tags)\n", + " tags_data = list(map(lambda b: {'Tag Name':b['name'], 'Tag ID':b['@id'], 'Tagged Commit':b['taggedCommit']}, tags))\n", + "\n", + " df = pd.DataFrame.from_records(tags_data).style.hide(axis='index')\n", + " display(df)\n", + "else:\n", + " pprint(f\"Problem in fetching tags of Spacecraft project {project_id}\")\n", + " pprint(tags_response)" + ] + }, + { + "cell_type": "markdown", + "id": "569ca8f1-ebf1-41d2-93f3-8795a2439eea", + "metadata": {}, + "source": [ + "# Create 1st Commit" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "3eed91b9-903b-441f-b1f2-10dbcfafa342", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'@id': '227e0d09-bdd2-4812-b818-8d9f737db429',\n", + " '@type': 'Commit',\n", + " 'owningProject': {'@id': '978d0199-4e44-4090-8cb6-4253fd79e315'},\n", + " 'previousCommit': None,\n", + " 'timestamp': '2022-09-09T17:04:27.353806-04:00'}\n" + ] + } + ], + "source": [ + "commit_body = {\n", + " \"@type\": \"Commit\",\n", + " \"change\": [\n", + " {\n", + " \"@type\": \"DataVersion\",\n", + " \"payload\": {\n", + " \"@type\": \"PartDefinition\",\n", + " \"name\":\"Spacecraft System\"\n", + " }\n", + " },\n", + " {\n", + " \"@type\": \"DataVersion\",\n", + " \"payload\": {\n", + " \"@type\": \"PartDefinition\",\n", + " \"name\":\"Payload System\"\n", + " }\n", + " },\n", + " {\n", + " \"@type\": \"DataVersion\",\n", + " \"payload\": {\n", + " \"@type\": \"PartDefinition\",\n", + " \"name\":\"Propulsion System\"\n", + " }\n", + " }\n", + " ]\n", + "}\n", + "\n", + "commit_post_url = f\"{host}/projects/{project_id}/commits\" \n", + "\n", + "commit_post_response = requests.post(commit_post_url, \n", + " headers={\"Content-Type\": \"application/json\"}, \n", + " data=json.dumps(commit_body))\n", + "\n", + "commit1_id = \"\"\n", + "\n", + "if commit_post_response.status_code == 200:\n", + " commit_response_json = commit_post_response.json()\n", + " pprint(commit_response_json)\n", + " commit1_id = commit_response_json['@id']\n", + "else:\n", + " pprint(f\"Problem in creating a new commit in Spacecraft project {project_id}\")\n", + " pprint(commit_post_response)" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "65537f5c-f521-469e-92e4-9a2568afed05", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Element NameElement ID
Payload System5300ff6a-0f1c-487a-a463-1153f9638fcb
Propulsion System6f038f20-a84b-4418-802d-b23a86c01f03
Spacecraft System1de8be3d-e734-47cb-a98b-8feaad078c3d
\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "element_get_url = f\"{host}/projects/{project_id}/commits/{commit1_id}/elements\" \n", + "\n", + "element_get_response = requests.get(element_get_url)\n", + "\n", + "if element_get_response.status_code == 200:\n", + " elements = element_get_response.json()\n", + " elements_data = list(map(lambda b: {'Element Name':b['name'], 'Element ID':b['@id']}, elements))\n", + " df = pd.DataFrame.from_records(elements_data).sort_values(by='Element Name').style.hide(axis='index')\n", + " display(df)\n", + "else:\n", + " pprint(f\"Problem in fetching elements in the Spacecraft project {project_id} at commit {commit1_id}.\")\n", + " pprint(element_get_response)" + ] + }, + { + "cell_type": "markdown", + "id": "8e38b288-6517-4a7b-90e5-ae73c5f89df3", + "metadata": {}, + "source": [ + "# Create 2nd Commit" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "76d80cb1-40c8-4f24-aeb5-51e509f4e159", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'@id': '3a05f9df-16ac-483b-abe4-7a7a104a33fa',\n", + " '@type': 'Commit',\n", + " 'owningProject': {'@id': '978d0199-4e44-4090-8cb6-4253fd79e315'},\n", + " 'previousCommit': {'@id': '227e0d09-bdd2-4812-b818-8d9f737db429'},\n", + " 'timestamp': '2022-09-09T17:04:31.909048-04:00'}\n" + ] + } + ], + "source": [ + "commit_body = {\n", + " \"@type\": \"Commit\",\n", + " \"change\": [\n", + " {\n", + " \"@type\": \"DataVersion\",\n", + " \"payload\": {\n", + " \"@type\": \"PartDefinition\",\n", + " \"name\":\"Avionics System\"\n", + " }\n", + " },\n", + " {\n", + " \"@type\": \"DataVersion\",\n", + " \"payload\": {\n", + " \"@type\": \"PartDefinition\",\n", + " \"name\":\"Power System\"\n", + " }\n", + " }\n", + " ],\n", + " \"previousCommit\": {\n", + " \"@id\": commit1_id\n", + " }\n", + "}\n", + "\n", + "commit_post_url = f\"{host}/projects/{project_id}/commits\" \n", + "\n", + "commit_post_response = requests.post(commit_post_url, \n", + " headers={\"Content-Type\": \"application/json\"}, \n", + " data=json.dumps(commit_body))\n", + "\n", + "commit2_id = \"\"\n", + "\n", + "if commit_post_response.status_code == 200:\n", + " commit_response_json = commit_post_response.json()\n", + " pprint(commit_response_json)\n", + " commit2_id = commit_response_json['@id']\n", + "else:\n", + " pprint(f\"Problem in creating a new commit in Spacecraft project {project_id}\")\n", + " pprint(commit_post_response)" + ] + }, + { + "cell_type": "markdown", + "id": "d815e4fe", + "metadata": {}, + "source": [ + "# Get all elements after the 2nd commit" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "eac0a387-e4cf-4fc8-8b47-c64ed2ebff62", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Element NameElement ID
Avionics Systemff573440-aac6-40cc-a12e-917b20da1233
Payload System5300ff6a-0f1c-487a-a463-1153f9638fcb
Power Systemb833d8d8-ce5e-444b-a6cb-15a2c06aae16
Propulsion System6f038f20-a84b-4418-802d-b23a86c01f03
Spacecraft System1de8be3d-e734-47cb-a98b-8feaad078c3d
\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "element_get_url = f\"{host}/projects/{project_id}/commits/{commit2_id}/elements\" \n", + "\n", + "element_get_response = requests.get(element_get_url)\n", + "\n", + "if element_get_response.status_code == 200:\n", + " elements = element_get_response.json()\n", + " elements_data = list(map(lambda b: {'Element Name':b['name'], 'Element ID':b['@id']}, elements))\n", + " df = pd.DataFrame.from_records(elements_data).sort_values(by='Element Name').style.hide(axis='index')\n", + " display(df)\n", + "else:\n", + " pprint(f\"Problem in fetching elements in the Spacecraft project {project_id} at commit {commit2_id}.\")\n", + " pprint(element_get_response)" + ] + }, + { + "cell_type": "markdown", + "id": "4b841d77-eb20-4f3c-bc64-fe08031d01bc", + "metadata": {}, + "source": [ + "# Create a tag" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "886842cc-c983-424f-9af9-083257a5732c", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'@id': '8b98474b-b4b4-4eff-b52d-251e3b666110',\n", + " '@type': 'Tag',\n", + " 'name': 'Spacecraft Internal Release 0.1',\n", + " 'owningProject': {'@id': '978d0199-4e44-4090-8cb6-4253fd79e315'},\n", + " 'referencedCommit': {'@id': '3a05f9df-16ac-483b-abe4-7a7a104a33fa'},\n", + " 'taggedCommit': {'@id': '3a05f9df-16ac-483b-abe4-7a7a104a33fa'},\n", + " 'timestamp': '2022-09-09T17:04:36.074635-04:00'}\n" + ] + } + ], + "source": [ + "tag_body = {\n", + " \"@type\": \"Tag\",\n", + " \"name\": \"Spacecraft Internal Release 0.1\",\n", + " \"taggedCommit\": {\n", + " \"@id\": commit2_id\n", + " }\n", + "}\n", + "\n", + "tag_post_url = f\"{host}/projects/{project_id}/tags\" \n", + "\n", + "tag_post_response = requests.post(tag_post_url, \n", + " headers={\"Content-Type\": \"application/json\"}, \n", + " data=json.dumps(tag_body))\n", + "\n", + "tag1_id = \"\"\n", + "\n", + "if tag_post_response.status_code == 200:\n", + " tag_response_json = tag_post_response.json()\n", + " pprint(tag_response_json)\n", + " tag1_id = tag_response_json['@id']\n", + "else:\n", + " pprint(f\"Problem in creating a new tag in Spacecraft project {project_id}.\")\n", + " pprint(tag_post_response)" + ] + }, + { + "cell_type": "markdown", + "id": "ec239663-ce0d-4ae6-acd7-5910299dedda", + "metadata": {}, + "source": [ + "# Get Tags" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "id": "bf1ce47b-079d-429f-b43b-491c3aa156c8", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Tag NameTag IDTagged Commit
Spacecraft Internal Release 0.18b98474b-b4b4-4eff-b52d-251e3b666110{'@id': '3a05f9df-16ac-483b-abe4-7a7a104a33fa'}
\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "tags_url = f\"{host}/projects/{project_id}/tags\" \n", + "tags_response = requests.get(tags_url)\n", + "\n", + "if tags_response.status_code == 200:\n", + " tags = tags_response.json()\n", + " tags_data = list(map(lambda b: {'Tag Name':b['name'], 'Tag ID':b['@id'], 'Tagged Commit':b['taggedCommit']}, tags))\n", + "\n", + " df = pd.DataFrame.from_records(tags_data).style.hide(axis='index')\n", + " display(df)\n", + "else:\n", + " pprint(f\"Problem in fetching tags in Spacecraft project {project_id}.\")\n", + " pprint(tag_post_response)" + ] + }, + { + "cell_type": "markdown", + "id": "5a0ec0fa-af50-4944-8401-183f2cb165af", + "metadata": {}, + "source": [ + "# Create a new branch at the second commit (also tagged as 0.1)" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "id": "cc9620df-e407-4a25-8ae4-bd803d1cde32", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'@id': '3557c400-65df-4485-99d2-74df37fff362',\n", + " '@type': 'Branch',\n", + " 'head': {'@id': '3a05f9df-16ac-483b-abe4-7a7a104a33fa'},\n", + " 'name': 'develop',\n", + " 'owningProject': {'@id': '978d0199-4e44-4090-8cb6-4253fd79e315'},\n", + " 'referencedCommit': {'@id': '3a05f9df-16ac-483b-abe4-7a7a104a33fa'},\n", + " 'timestamp': '2022-09-09T17:04:39.14587-04:00'}\n" + ] + } + ], + "source": [ + "branch_body = {\n", + " \"@type\": \"Branch\",\n", + " \"name\": \"develop\",\n", + " \"head\": {\n", + " \"@id\": commit2_id\n", + " }\n", + "}\n", + "\n", + "branch_post_url = f\"{host}/projects/{project_id}/branches\" \n", + "\n", + "branch_post_response = requests.post(branch_post_url, \n", + " headers={\"Content-Type\": \"application/json\"}, \n", + " data=json.dumps(branch_body))\n", + "\n", + "branch_develop_id = \"\"\n", + "\n", + "if branch_post_response.status_code == 200:\n", + " branch_response_json = branch_post_response.json()\n", + " pprint(branch_response_json)\n", + " branch_develop_id = branch_response_json['@id']\n", + "else:\n", + " pprint(f\"Problem in creating a new branch in Spacecraft project {project_id}\")\n", + " pprint(branch_post_response)" + ] + }, + { + "cell_type": "markdown", + "id": "19ba5702-85d2-40ec-b01c-de6f112e8bfa", + "metadata": { + "tags": [] + }, + "source": [ + "# Get branches" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "id": "61faab74-218a-4bf4-832d-2e3a3d70578d", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Branch NameBranch IDRef Commit (head)
develop3557c400-65df-4485-99d2-74df37fff362{'@id': '3a05f9df-16ac-483b-abe4-7a7a104a33fa'}
main3e5d38d1-91e4-4ec2-b2ac-857738731468{'@id': '3a05f9df-16ac-483b-abe4-7a7a104a33fa'}
\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "branches_url = f\"{host}/projects/{project_id}/branches\" \n", + "branches_response = requests.get(branches_url)\n", + "\n", + "if branches_response.status_code == 200:\n", + " branches = branches_response.json()\n", + " branches_data = list(map(lambda b: {'Branch Name':b['name'], 'Branch ID':b['@id'], 'Ref Commit (head)':b['head']}, branches))\n", + "\n", + " df = pd.DataFrame.from_records(branches_data).sort_values(by='Branch Name').style.hide(axis='index')\n", + " display(df)\n", + "else:\n", + " pprint(f\"Problem in fetching branches in Spacecraft project {project_id}\")\n", + " pprint(branches_response)" + ] + }, + { + "cell_type": "markdown", + "id": "8dbea034-4180-415f-9604-8e1afb149fdc", + "metadata": {}, + "source": [ + "# Create a new commit in the develop branch" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "id": "055f42b3-18de-4f94-ae53-43660948493b", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'@id': '044863cd-cc2c-48f5-8ff6-6ec7eae5612c',\n", + " '@type': 'Commit',\n", + " 'owningProject': {'@id': '978d0199-4e44-4090-8cb6-4253fd79e315'},\n", + " 'previousCommit': {'@id': '3a05f9df-16ac-483b-abe4-7a7a104a33fa'},\n", + " 'timestamp': '2022-09-09T17:04:42.398066-04:00'}\n" + ] + } + ], + "source": [ + "commit_body = {\n", + " \"@type\": \"Commit\",\n", + " \"change\": [\n", + " {\n", + " \"@type\": \"DataVersion\",\n", + " \"payload\": {\n", + " \"@type\": \"PartDefinition\",\n", + " \"name\":\"GN & C System\"\n", + " }\n", + " }\n", + " ],\n", + " \"previousCommit\": {\n", + " \"@id\": commit2_id\n", + " }\n", + "}\n", + "\n", + "commit_post_url = f\"{host}/projects/{project_id}/commits\" \n", + "\n", + "commit_post_response = requests.post(commit_post_url, \n", + " headers={\"Content-Type\": \"application/json\"}, \n", + " data=json.dumps(commit_body),\n", + " params={\"branchId\":branch_develop_id})\n", + "\n", + "commit3_id = \"\"\n", + "\n", + "if commit_post_response.status_code == 200:\n", + " commit_response_json = commit_post_response.json()\n", + " pprint(commit_response_json)\n", + " commit3_id = commit_response_json['@id']\n", + "else:\n", + " pprint(f\"Problem in creating a new commit in Spacecraft project {project_id}\")\n", + " pprint(commit_post_response)" + ] + }, + { + "cell_type": "markdown", + "id": "e2ba3c85-db23-460d-b6d4-6afbd6461e7d", + "metadata": {}, + "source": [ + "# Get Branches" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "id": "ead42406-7536-4f47-b0d8-d34a48e9054e", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Branch NameBranch IDRef Commit (head)
develop3557c400-65df-4485-99d2-74df37fff362{'@id': '044863cd-cc2c-48f5-8ff6-6ec7eae5612c'}
main3e5d38d1-91e4-4ec2-b2ac-857738731468{'@id': '3a05f9df-16ac-483b-abe4-7a7a104a33fa'}
\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "branches_url = f\"{host}/projects/{project_id}/branches\" \n", + "branches_response = requests.get(branches_url)\n", + "\n", + "if branches_response.status_code == 200:\n", + " branches = branches_response.json()\n", + " branches_data = list(map(lambda b: {'Branch Name':b['name'], 'Branch ID':b['@id'], 'Ref Commit (head)':b['head']}, branches))\n", + "\n", + " df = pd.DataFrame.from_records(branches_data).sort_values(by='Branch Name').style.hide(axis='index')\n", + " display(df)\n", + "else:\n", + " pprint(f\"Problem in fetching branches in Spacecraft project {project_id}\")\n", + " pprint(commit_post_response)" + ] + }, + { + "cell_type": "markdown", + "id": "61cdaecd-44db-4e27-85dd-de5d002648cc", + "metadata": {}, + "source": [ + "# Get all elements as of the latest commit on main branch" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "id": "86008838-368a-4e58-9d5b-70e9c57442f4", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "'Fetching elements at commit 3a05f9df-16ac-483b-abe4-7a7a104a33fa'\n" + ] + }, + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Element NameElement ID
Avionics Systemff573440-aac6-40cc-a12e-917b20da1233
Payload System5300ff6a-0f1c-487a-a463-1153f9638fcb
Power Systemb833d8d8-ce5e-444b-a6cb-15a2c06aae16
Propulsion System6f038f20-a84b-4418-802d-b23a86c01f03
Spacecraft System1de8be3d-e734-47cb-a98b-8feaad078c3d
\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "pprint(f\"Fetching elements at commit {commit2_id}\")\n", + "element_get_url = f\"{host}/projects/{project_id}/commits/{commit2_id}/elements\" \n", + "\n", + "element_get_response = requests.get(element_get_url)\n", + "\n", + "if element_get_response.status_code == 200:\n", + " elements = element_get_response.json()\n", + " elements_data = list(map(lambda b: {'Element Name':b['name'], 'Element ID':b['@id']}, elements))\n", + " df = pd.DataFrame.from_records(elements_data).sort_values(by='Element Name').style.hide(axis='index')\n", + " display(df)\n", + "else:\n", + " pprint(f\"Problem in fetching elements in the Spacecraft project {project_id} at commit {commit2_id}\")\n", + " pprint(element_get_response)" + ] + }, + { + "cell_type": "markdown", + "id": "24a94903-9a4e-4f2b-b1bf-be21b7e22e48", + "metadata": {}, + "source": [ + "# Get all elements as of the latest commit on develop branch" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "id": "60bf125d-5258-4546-99da-3680de66dd1b", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "'Fetching elements at commit 044863cd-cc2c-48f5-8ff6-6ec7eae5612c'\n" + ] + }, + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Element NameElement ID
Avionics Systemff573440-aac6-40cc-a12e-917b20da1233
GN & C System5cb6557c-85be-413c-ac96-47bfd47199f7
Payload System5300ff6a-0f1c-487a-a463-1153f9638fcb
Power Systemb833d8d8-ce5e-444b-a6cb-15a2c06aae16
Propulsion System6f038f20-a84b-4418-802d-b23a86c01f03
Spacecraft System1de8be3d-e734-47cb-a98b-8feaad078c3d
\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "pprint(f\"Fetching elements at commit {commit3_id}\")\n", + "element_get_url = f\"{host}/projects/{project_id}/commits/{commit3_id}/elements\" \n", + "\n", + "element_get_response = requests.get(element_get_url)\n", + "\n", + "if element_get_response.status_code == 200:\n", + " elements = element_get_response.json()\n", + " elements_data = list(map(lambda b: {'Element Name':b['name'], 'Element ID':b['@id']}, elements))\n", + " df = pd.DataFrame.from_records(elements_data).sort_values(by='Element Name').style.hide(axis='index')\n", + " display(df)\n", + "else:\n", + " pprint(f\"Problem in fetching elements in the Spacecraft project {project_id} at commit {commit3_id}\")\n", + " pprint(element_get_response)" + ] + }, + { + "cell_type": "markdown", + "id": "f162ef4e-3e68-4a66-b8fa-2abde70e867d", + "metadata": {}, + "source": [ + "# Create a tag at the last commit on develop branch" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "id": "b3e26544-b2e4-4370-bb85-9d23aabcc0b5", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'@id': 'b315aac0-a5c0-46c3-8be3-bc69da551050',\n", + " '@type': 'Tag',\n", + " 'name': 'Spacecraft Internal Release 0.2 build 1',\n", + " 'owningProject': {'@id': '978d0199-4e44-4090-8cb6-4253fd79e315'},\n", + " 'referencedCommit': {'@id': '044863cd-cc2c-48f5-8ff6-6ec7eae5612c'},\n", + " 'taggedCommit': {'@id': '044863cd-cc2c-48f5-8ff6-6ec7eae5612c'},\n", + " 'timestamp': '2022-09-09T17:04:48.119181-04:00'}\n" + ] + } + ], + "source": [ + "tag_body = {\n", + " \"@type\": \"Tag\",\n", + " \"name\": \"Spacecraft Internal Release 0.2 build 1\",\n", + " \"taggedCommit\": {\n", + " \"@id\": commit3_id\n", + " }\n", + "}\n", + "\n", + "tag_post_url = f\"{host}/projects/{project_id}/tags\" \n", + "\n", + "tag_post_response = requests.post(tag_post_url, \n", + " headers={\"Content-Type\": \"application/json\"}, \n", + " data=json.dumps(tag_body))\n", + "\n", + "tag1_id = \"\"\n", + "\n", + "if tag_post_response.status_code == 200:\n", + " tag_response_json = tag_post_response.json()\n", + " pprint(tag_response_json)\n", + " tag1_id = tag_response_json['@id']\n", + "else:\n", + " pprint(f\"Problem in creating a new tag in Spacecraft project {project_id}.\")\n", + " pprint(tag_post_response)" + ] + }, + { + "cell_type": "markdown", + "id": "20dfd748-3149-4442-a7e8-fbef247377a7", + "metadata": {}, + "source": [ + "# Get all tags" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "id": "aee7a152-8b4c-476a-8691-4766fc94c240", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Tag NameTag IDTagged Commit
Spacecraft Internal Release 0.18b98474b-b4b4-4eff-b52d-251e3b666110{'@id': '3a05f9df-16ac-483b-abe4-7a7a104a33fa'}
Spacecraft Internal Release 0.2 build 1b315aac0-a5c0-46c3-8be3-bc69da551050{'@id': '044863cd-cc2c-48f5-8ff6-6ec7eae5612c'}
\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "tags_url = f\"{host}/projects/{project_id}/tags\" \n", + "tags_response = requests.get(tags_url)\n", + "\n", + "if tags_response.status_code == 200:\n", + " tags = tags_response.json()\n", + " tags_data = list(map(lambda b: {'Tag Name':b['name'], 'Tag ID':b['@id'], 'Tagged Commit':b['taggedCommit']}, tags))\n", + "\n", + " df = pd.DataFrame.from_records(tags_data).style.hide(axis='index')\n", + " display(df)\n", + "else:\n", + " pprint(f\"Problem in fetching tags in Spacecraft project {project_id}.\")\n", + " pprint(tag_post_response)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6bdbb8ac-22dc-41f7-bd05-3dc857ac6c3c", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fc7a30d3-42a7-4c51-9169-121773c35783", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.13" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/Element_Create_Update_Delete.ipynb b/Element_Create_Update_Delete.ipynb new file mode 100644 index 0000000..2687891 --- /dev/null +++ b/Element_Create_Update_Delete.ipynb @@ -0,0 +1,763 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "3ee4834f", + "metadata": { + "tags": [] + }, + "source": [ + "# Initializing the SysML v2 API" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "6b5fef59", + "metadata": {}, + "outputs": [], + "source": [ + "from __future__ import print_function\n", + "\n", + "import time\n", + "import requests\n", + "from pprint import pprint\n", + "import pandas as pd\n", + "import json\n", + "from datetime import datetime\n", + "\n", + "#host = \"\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Project NameProject ID
Spacecraft project with Element CRUD - 2022-09-12 12:08:48.8158500659c128-afd5-42a1-912b-962068f1f053
17b-Sequence-Modeling Fri Sep 09 17:37:26 EDT 20220f7045bd-9a1c-4b54-90d9-775c0f642e1b
3a-Function-based Behavior-2 Fri Sep 09 17:26:30 EDT 2022128710cd-978f-4c6f-93ac-8afbbd194185
10c-Fuel Economy Analysis Fri Sep 09 17:30:43 EDT 20222909d482-a659-4307-9803-bdfcbe0a7989
PartTest Fri Sep 09 17:22:13 EDT 20222a2a4d7d-cd9e-41ec-bec0-2bf6fcea6767
15_05-Unification of Expression and Constraint Definition Fri Sep 09 17:35:59 EDT 202239dcf070-668c-4711-a231-c2640b9f7f88
15_19-Materials with Properties Fri Sep 09 17:36:44 EDT 20223bd937e0-ab2e-47a6-8f66-0458df9f29de
14b-Language Extensions Fri Sep 09 17:35:06 EDT 2022431cd401-010c-401f-9101-115240312d24
13b-Safety and Security Features Element Group-1 Fri Sep 09 17:33:37 EDT 202246b226ce-8519-42de-96b4-07ff1045d0dd
Spacecraft project with Element CRUD - 2022-09-12 13:03:26.5685654853c38b-85c5-40e5-9e83-b69c2e73415a
3a-Function-based Behavior-3 Fri Sep 09 17:26:52 EDT 202248f9a623-2451-4150-8b98-58e3b3c515cd
12a-Dependency Fri Sep 09 17:32:29 EDT 202249a60e69-b509-4191-b1c3-240de628110b
7b-Variant Configurations Fri Sep 09 17:28:59 EDT 202259c86238-ef81-434e-a389-5393312ba0d7
17a-Sequence-Modeling Fri Sep 09 17:37:07 EDT 2022653c5173-770d-4ea6-90dc-c173d049258c
13a-Model Containment Fri Sep 09 17:33:03 EDT 20226699f5e0-403b-414a-87c9-46671e702fab
11b-Safety and Security Feature Views Fri Sep 09 17:32:05 EDT 202284f30a8f-f839-4a71-aee9-dff2a2d28dbf
1c-Parts Tree Redefinition Fri Sep 09 17:25:05 EDT 202285d874ae-1f68-4949-9b16-378f1cbc477e
14a-Language Extensions Fri Sep 09 17:34:49 EDT 20228f0bc3b3-a580-40fd-b99b-0e8865984c4f
6-Individual and Snapshots Fri Sep 09 17:28:35 EDT 2022913dab3f-4d5d-482d-9238-7491aead3e1a
PartTest Fri Sep 09 17:21:50 EDT 202291b2be09-16de-4d35-87a4-589f3274ce55
11a-View-Viewpoint Fri Sep 09 17:31:42 EDT 202291fd6db5-4cfa-4970-b115-05010053ec72
13b-Safety and Security Features Element Group Fri Sep 09 17:33:20 EDT 202295bfcea3-8ed7-4bd4-9e98-3d6ed311091e
Spacecraft project with branches and tags - 2022-09-09 17:04:20.838366978d0199-4e44-4090-8cb6-4253fd79e315
3a-Function-based Behavior-1 Fri Sep 09 17:26:05 EDT 20229da34b47-38d0-4630-bcb4-c387d5fac1da
9-Verification-simplified Fri Sep 09 17:29:54 EDT 2022a9a02019-b810-4fcb-9a9c-5cad061db29f
10b-Trade-off Among Alternative Configurations Fri Sep 09 17:30:18 EDT 2022ada6b9b6-3534-43b3-a567-f97092ac26f1
12b-Allocation Fri Sep 09 17:32:45 EDT 2022b4c01f6d-8173-4d43-abd1-596bdb89d6d4
Spacecraft project with Element CRUD - 2022-09-12 12:08:28.268425b67ebee6-b55e-4088-b059-c2f102989ac2
8-Requirements Fri Sep 09 17:29:27 EDT 2022b6a3450b-8624-45c2-8dd9-68d301a439fe
15_10-Primitive Data Types Fri Sep 09 17:36:20 EDT 2022bb65a453-67bc-4e6c-92c7-29734c80bab1
2a-Parts Interconnection Fri Sep 09 17:23:32 EDT 2022c64923aa-79f4-419c-b983-6244fee741d6
5-State-based Behavior-1 Fri Sep 09 17:27:37 EDT 2022c6b1d4d6-a66e-4097-8752-5307ecd9ebaf
2a-Parts Interconnection Fri Sep 09 17:25:35 EDT 2022cb4e467e-772b-4054-849e-26e4b0e1e0c0
10d-Dynamics Analysis Fri Sep 09 17:31:13 EDT 2022cceed28a-64fb-4401-81da-afcadd96d1d6
13b-Safety and Security Features Element Group-2 Fri Sep 09 17:34:08 EDT 2022d4c21bc8-6778-4a97-b389-48b1e7b23260
5-State-based Behavior-1a Fri Sep 09 17:28:06 EDT 2022d63b8882-f41e-40ef-a4a2-cf74fa47f6dc
14c-Language Extensions Fri Sep 09 17:35:25 EDT 2022da4e65b6-460d-447b-8cf9-56a3ad44e514
4a-Functional Allocation Fri Sep 09 17:27:13 EDT 2022e7090e9d-74f0-4b63-a4a6-6dd8647b5bdd
Spacecraft project with Element CRUD - 2022-09-12 12:57:59.306887f8161e56-586e-44ae-ab12-53ad1fc972de
18-Use Case Fri Sep 09 17:37:44 EDT 2022ff0dfcc3-cf11-4d4f-961a-ae42326f6b12
\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "projects_url = f\"{host}/projects\" \n", + "projects_response = requests.get(projects_url)\n", + "\n", + "if projects_response.status_code == 200:\n", + " projects = projects_response.json()\n", + " projects_data = list(map(lambda b: {'Project Name':b['name'], 'Project ID':b['@id']}, projects))\n", + " df = pd.DataFrame.from_records(projects_data).style.hide(axis='index')\n", + " # if len(projects_data) > 0:\n", + " # df = df.style.sort_values(by='Project Name')\n", + " display(df)\n", + "else:\n", + " pprint(\"Problem in fetching projects\")" + ] + }, + { + "cell_type": "markdown", + "id": "77345839-9d8f-409f-9131-440d1b30cbea", + "metadata": {}, + "source": [ + "# Create a new project" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "6d2ba2fc-157a-4ac8-b8f3-876bbd3a21ea", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'@id': 'f0594c9c-55ef-49f6-9591-d27d12cc0afb',\n", + " '@type': 'Project',\n", + " 'defaultBranch': {'@id': 'd84e4540-56c8-485a-bace-f91b3620ada5'},\n", + " 'description': 'Spacecraft project demonstrating Element Create, Update, '\n", + " 'Delete steps',\n", + " 'name': 'Spacecraft project with Element CRUD - 2022-09-12 13:16:03.708730'}\n" + ] + } + ], + "source": [ + "timestamp = datetime.now()\n", + "project_name = f\"Spacecraft project with Element CRUD - {timestamp}\"\n", + "project_data = {\n", + " \"@type\":\"Project\",\n", + " \"name\": project_name,\n", + " \"description\": \"Spacecraft project demonstrating Element Create, Update, Delete steps\"\n", + "}\n", + "\n", + "project_post_url = f\"{host}/projects\" \n", + "\n", + "project_post_response = requests.post(project_post_url, \n", + " headers={\"Content-Type\": \"application/json\"}, \n", + " data=json.dumps(project_data))\n", + "\n", + "project_id = \"\"\n", + "\n", + "if project_post_response.status_code == 200:\n", + " project_response_json = project_post_response.json()\n", + " pprint(project_response_json)\n", + " project_id = project_response_json['@id']\n", + " project_name = project_response_json['name']\n", + "else:\n", + " pprint(f\"Problem in creating a new Spacecraft project at {timestamp}\")\n", + " pprint(project_post_response)" + ] + }, + { + "cell_type": "markdown", + "id": "921efbfd-04a1-4c5c-8e66-b31f0390aa45", + "metadata": {}, + "source": [ + "# Get branches" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "df3e1039-ba51-4653-8897-e98be111078e", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Branch NameBranch IDRef Commit (head)
maind84e4540-56c8-485a-bace-f91b3620ada5None
\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "branches_url = f\"{host}/projects/{project_id}/branches\" \n", + "branches_response = requests.get(branches_url)\n", + "\n", + "if branches_response.status_code == 200:\n", + " branches = branches_response.json()\n", + " branches_data = list(map(lambda b: {'Branch Name':b['name'], 'Branch ID':b['@id'], 'Ref Commit (head)':b['head']}, branches))\n", + "\n", + " df = pd.DataFrame.from_records(branches_data).sort_values(by='Branch Name').style.hide(axis='index')\n", + " display(df)\n", + "else:\n", + " pprint(f\"Problem in fetching branches of Spacecraft project {project_id}\")\n", + " pprint(branches_response)" + ] + }, + { + "cell_type": "markdown", + "id": "569ca8f1-ebf1-41d2-93f3-8795a2439eea", + "metadata": {}, + "source": [ + "# Create 1st Commit on the main (default) branch that creates 2 elements" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "3eed91b9-903b-441f-b1f2-10dbcfafa342", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'@id': '25853b78-df3e-44d3-9a63-c3221743d82d',\n", + " '@type': 'Commit',\n", + " 'owningProject': {'@id': 'f0594c9c-55ef-49f6-9591-d27d12cc0afb'},\n", + " 'previousCommit': None,\n", + " 'timestamp': '2022-09-12T13:16:13.843497-04:00'}\n" + ] + } + ], + "source": [ + "commit_body = {\n", + " \"@type\": \"Commit\",\n", + " \"change\": [\n", + " {\n", + " \"@type\": \"DataVersion\",\n", + " \"payload\": {\n", + " \"@type\": \"PartDefinition\",\n", + " \"name\":\"Spacecraft System\"\n", + " }\n", + " },\n", + " {\n", + " \"@type\": \"DataVersion\",\n", + " \"payload\": {\n", + " \"@type\": \"PartDefinition\",\n", + " \"name\":\"Payload System\"\n", + " }\n", + " }\n", + " ]\n", + "}\n", + "\n", + "commit_post_url = f\"{host}/projects/{project_id}/commits\" \n", + "\n", + "commit_post_response = requests.post(commit_post_url, \n", + " headers={\"Content-Type\": \"application/json\"}, \n", + " data=json.dumps(commit_body))\n", + "\n", + "commit1_id = \"\"\n", + "\n", + "if commit_post_response.status_code == 200:\n", + " commit_response_json = commit_post_response.json()\n", + " pprint(commit_response_json)\n", + " commit1_id = commit_response_json['@id']\n", + "else:\n", + " pprint(f\"Problem in creating a new commit in Spacecraft project {project_id}\")\n", + " pprint(commit_post_response)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "65537f5c-f521-469e-92e4-9a2568afed05", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Element NameElement ID
Payload System1093a5fd-5a5e-47d7-8bfd-b870ede05648
Spacecraft System07a9a21c-2070-4d6b-8818-bb3bca62dfd8
\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "element_get_url = f\"{host}/projects/{project_id}/commits/{commit1_id}/elements\" \n", + "\n", + "element_get_response = requests.get(element_get_url)\n", + "payload_system_element_id = \"\"\n", + "spacecraft_system_element_id = \"\"\n", + "\n", + "if element_get_response.status_code == 200:\n", + " elements = element_get_response.json()\n", + " \n", + " # Gather the id of the Payload System that is created\n", + " payload_system_element = list(filter(lambda e: e['name'] == \"Payload System\", elements))\n", + " if payload_system_element:\n", + " payload_system_element_id = payload_system_element[0]['@id']\n", + " \n", + " # Gather the id of the Spacecraft System that is created\n", + " spacecraft_system_element = list(filter(lambda e: e['name'] == \"Spacecraft System\", elements))\n", + " if spacecraft_system_element:\n", + " spacecraft_system_element_id = spacecraft_system_element[0]['@id']\n", + " \n", + " elements_data = list(map(lambda b: {'Element Name':b['name'], 'Element ID':b['@id']}, elements))\n", + " df = pd.DataFrame.from_records(elements_data).sort_values(by='Element Name').style.hide(axis='index')\n", + " display(df)\n", + "else:\n", + " pprint(f\"Problem in fetching elements in the Spacecraft project {project_id} at commit {commit1_id}.\")\n", + " pprint(element_get_response)" + ] + }, + { + "cell_type": "markdown", + "id": "8e38b288-6517-4a7b-90e5-ae73c5f89df3", + "metadata": {}, + "source": [ + "# Create the 2nd Commit that updates the name of one of the elements" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "76d80cb1-40c8-4f24-aeb5-51e509f4e159", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'@id': 'da8991ce-1124-493b-8f34-a4bb2d0800e1',\n", + " '@type': 'Commit',\n", + " 'owningProject': {'@id': 'f0594c9c-55ef-49f6-9591-d27d12cc0afb'},\n", + " 'previousCommit': {'@id': '25853b78-df3e-44d3-9a63-c3221743d82d'},\n", + " 'timestamp': '2022-09-12T13:16:21.941689-04:00'}\n" + ] + } + ], + "source": [ + "commit_body = {\n", + " \"@type\": \"Commit\",\n", + " \"change\": [\n", + " {\n", + " \"@type\": \"DataVersion\",\n", + " \"payload\": {\n", + " \"@type\": \"PartDefinition\",\n", + " \"name\":\"New Payload System\",\n", + " \"identifier\":payload_system_element_id\n", + " },\n", + " \"identity\": {\n", + " \"@id\": payload_system_element_id\n", + " }\n", + " }\n", + " ],\n", + " \"previousCommit\": {\n", + " \"@id\": commit1_id\n", + " }\n", + "}\n", + "\n", + "commit_post_url = f\"{host}/projects/{project_id}/commits\" \n", + "\n", + "commit_post_response = requests.post(commit_post_url, \n", + " headers={\"Content-Type\": \"application/json\"}, \n", + " data=json.dumps(commit_body))\n", + "\n", + "commit2_id = \"\"\n", + "\n", + "if commit_post_response.status_code == 200:\n", + " commit_response_json = commit_post_response.json()\n", + " pprint(commit_response_json)\n", + " commit2_id = commit_response_json['@id']\n", + "else:\n", + " pprint(f\"Problem in creating a new commit in Spacecraft project {project_id}\")\n", + " pprint(commit_post_response)" + ] + }, + { + "cell_type": "markdown", + "id": "d815e4fe", + "metadata": {}, + "source": [ + "# Get all elements after the 2nd commit (should show 1 element updated)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "eac0a387-e4cf-4fc8-8b47-c64ed2ebff62", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Element NameElement ID
New Payload System1093a5fd-5a5e-47d7-8bfd-b870ede05648
Spacecraft System07a9a21c-2070-4d6b-8818-bb3bca62dfd8
\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "element_get_url = f\"{host}/projects/{project_id}/commits/{commit2_id}/elements\" \n", + "\n", + "element_get_response = requests.get(element_get_url)\n", + "\n", + "if element_get_response.status_code == 200:\n", + " elements = element_get_response.json()\n", + " elements_data = list(map(lambda b: {'Element Name':b['name'], 'Element ID':b['@id']}, elements))\n", + " df = pd.DataFrame.from_records(elements_data).sort_values(by='Element Name').style.hide(axis='index')\n", + " display(df)\n", + "else:\n", + " pprint(f\"Problem in fetching elements in the Spacecraft project {project_id} at commit {commit2_id}.\")\n", + " pprint(element_get_response)" + ] + }, + { + "cell_type": "markdown", + "id": "8dbea034-4180-415f-9604-8e1afb149fdc", + "metadata": {}, + "source": [ + "# Create the 3rd commit that deletes an element (same one whose name was updated)" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "055f42b3-18de-4f94-ae53-43660948493b", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'@id': '00f0b229-7e70-4688-80e8-ae2eafc0ce8e',\n", + " '@type': 'Commit',\n", + " 'owningProject': {'@id': 'f0594c9c-55ef-49f6-9591-d27d12cc0afb'},\n", + " 'previousCommit': {'@id': 'da8991ce-1124-493b-8f34-a4bb2d0800e1'},\n", + " 'timestamp': '2022-09-12T13:16:45.992847-04:00'}\n" + ] + } + ], + "source": [ + "commit_body = {\n", + " \"@type\": \"Commit\",\n", + " \"change\": [\n", + " {\n", + " \"@type\": \"DataVersion\",\n", + " \"payload\":None,\n", + " \"identity\": {\n", + " \"@id\": payload_system_element_id\n", + " }\n", + " }\n", + " ],\n", + " \"previousCommit\": {\n", + " \"@id\": commit2_id\n", + " }\n", + "}\n", + "\n", + "commit_post_url = f\"{host}/projects/{project_id}/commits\" \n", + "\n", + "commit_post_response = requests.post(commit_post_url, \n", + " headers={\"Content-Type\": \"application/json\"}, \n", + " data=json.dumps(commit_body))\n", + "\n", + "commit3_id = \"\"\n", + "\n", + "if commit_post_response.status_code == 200:\n", + " commit_response_json = commit_post_response.json()\n", + " pprint(commit_response_json)\n", + " commit3_id = commit_response_json['@id']\n", + "else:\n", + " pprint(f\"Problem in creating a new commit in Spacecraft project {project_id}\")\n", + " pprint(commit_post_response)" + ] + }, + { + "cell_type": "markdown", + "id": "61cdaecd-44db-4e27-85dd-de5d002648cc", + "metadata": {}, + "source": [ + "# Get all elements after the 3rd commit (should only 1 element)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "86008838-368a-4e58-9d5b-70e9c57442f4", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "'Fetching elements at commit da8991ce-1124-493b-8f34-a4bb2d0800e1'\n" + ] + }, + { + "data": { + "text/html": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Element NameElement ID
Spacecraft System07a9a21c-2070-4d6b-8818-bb3bca62dfd8
\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "pprint(f\"Fetching elements at commit {commit2_id}\")\n", + "element_get_url = f\"{host}/projects/{project_id}/commits/{commit3_id}/elements\" \n", + "\n", + "element_get_response = requests.get(element_get_url)\n", + "\n", + "if element_get_response.status_code == 200:\n", + " elements = element_get_response.json()\n", + " elements_data = list(map(lambda b: {'Element Name':b['name'], 'Element ID':b['@id']}, elements))\n", + " df = pd.DataFrame.from_records(elements_data).sort_values(by='Element Name').style.hide(axis='index')\n", + " display(df)\n", + "else:\n", + " pprint(f\"Problem in fetching elements in the Spacecraft project {project_id} at commit {commit2_id}\")\n", + " pprint(element_get_response)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.13" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/Project_Commit_Branch_Tag_Recipe.ipynb b/Project_Commit_Branch_Tag_Recipe.ipynb index f7bf18f..e8a57fc 100644 --- a/Project_Commit_Branch_Tag_Recipe.ipynb +++ b/Project_Commit_Branch_Tag_Recipe.ipynb @@ -12,7 +12,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 24, "id": "6b5fef59", "metadata": {}, "outputs": [], @@ -40,7 +40,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 25, "id": "78788ed9", "metadata": {}, "outputs": [ @@ -49,347 +49,23 @@ "text/html": [ "\n", - "\n", + "
\n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", "
Project NameProject IDProject NameProject ID
4a-Functional Allocation Thu Jun 16 17:18:42 EDT 202202235ab1-46b0-4e88-8781-24876dfb7797
13a-Model Containment Thu Jun 16 17:23:32 EDT 20220606afde-a508-4806-bcd1-92e41e23e60a
18-Use Case Thu Jun 16 17:27:05 EDT 20220b8386f4-97dd-419f-8607-92ca345d4356
14c-Language Extensions Mon Jun 13 13:47:00 EDT 20220bac2595-df17-4edb-901b-373c7a92d729
10b-Trade-off Among Alternative Configurations Mon Jun 13 13:43:06 EDT 2022115117fd-7e7b-454b-a7c6-d30e51ff910e
11a-View-Viewpoint Thu Jun 16 17:22:33 EDT 202211f9c415-0e30-438a-be15-cef64b480ac5
a1234 Mon Jul 11 12:05:47 EDT 2022124c09f1-c639-4eec-964c-1b996dbed1f2
a1234 Mon Jul 11 12:05:53 EDT 202218da0870-4b9e-454d-9db6-9d9c1e292489
15_19-Materials with Properties Thu Jun 16 17:26:15 EDT 20221eb1a5b0-938b-460f-a610-82b784793d28
9-Verification-simplified Mon Jun 13 13:42:46 EDT 2022202b22e1-9a4d-48de-8f7d-d84caa2ca96c
14c-Language Extensions Thu Jun 16 17:25:16 EDT 202221c0894a-b45b-4f15-b578-db3ddaca5bcf
ShapeItems Mon Jun 13 13:52:10 EDT 20222348eb43-22b4-4c3d-8561-9f66ba875bd3
2a-Parts Interconnection Fri Jul 15 19:04:25 EDT 202226fb0747-dffb-422c-ab15-160246c25524
10d-Dynamics Analysis Thu Jun 16 17:22:11 EDT 20222b8b9f26-c00a-41c3-8a78-eaf587ebd39a
14a-Language Extensions Thu Jun 16 17:24:44 EDT 20222cbd42b9-6d46-4be1-9696-53dca8fdfbbe
12a-Dependency Mon Jun 13 13:44:47 EDT 2022311f82b5-bf62-41ce-8199-83cd7ef47794
5-State-based Behavior-1 Mon Jun 13 13:40:44 EDT 202231a060d8-3c6a-448b-84d6-e9d66e1e476e
ShapeItems Mon Jun 13 13:51:19 EDT 202231cd59bc-8862-4016-bf65-c025893dfd1f
11b-Safety and Security Feature Views Mon Jun 13 13:44:29 EDT 2022333c2e1f-8c2b-4aa1-adcf-7248b733cd67
5-State-based Behavior-1a Mon Jun 13 13:41:12 EDT 2022359c94f0-dec1-453f-bc4b-3fcb7cd0e13d
a1234 Mon Jul 11 11:42:42 EDT 202237c93d73-2b86-4f1a-bd72-260ef611955e
10c-Fuel Economy Analysis Mon Jun 13 13:43:25 EDT 20223977a407-ce82-4c77-aa0a-77fb80ef8b0b
a1234 Mon Jul 11 11:31:29 EDT 20223b4c63ff-18ea-4da8-bedd-a9e4c72a6805
7b-Variant Configurations Thu Jun 16 17:20:14 EDT 20223f1ef047-959a-4fb6-819c-e6431b3fc8b4
3a-Function-based Behavior-5 Thu Jun 16 17:18:26 EDT 20224023a9f1-01d7-4840-aa5b-28cd60547496
Spacecraft 2022-06-21 10:15:48.20591347797bc7-cdf1-48a7-883f-62dd238305fc
13b-Safety and Security Features Element Group-2 Thu Jun 16 17:24:19 EDT 2022484bc116-605b-43e3-9a0d-ab32482b689c
5-State-based Behavior-1a Thu Jun 16 17:19:28 EDT 20224af2b2c8-4a7d-4c46-886f-f4941d3be92f
12b-Allocation Thu Jun 16 17:23:20 EDT 20224cf7b13e-4ebb-4f36-beab-450cb0aad4c4
17a-Sequence-Modeling Mon Jun 13 13:48:18 EDT 20224db09ad2-4af3-4c9f-817b-fc74abb24c12
12b-Allocation Mon Jun 13 13:45:00 EDT 20224fd3eb53-9f26-4954-9a11-ed3744d5b66d
18-Use Case Mon Jun 13 13:48:48 EDT 202253337d0c-f0aa-4200-98bf-cc6503b6a70b
3a-Function-based Behavior-5 Fri Jul 15 19:08:20 EDT 202257cffff7-84a8-4e94-88c7-aa293be67eb3
8-Requirements Thu Jun 16 17:20:39 EDT 20225851a10c-76ad-41e9-9562-693dea55cb21
13a-Model Containment Mon Jun 13 13:45:13 EDT 202264d1251d-79e6-4785-8585-9918288abb0c
6-Individual and Snapshots Mon Jun 13 13:41:35 EDT 2022669dc6f5-ddf7-4f09-949e-40b449a2155f
8-Requirements Mon Jun 13 13:42:24 EDT 202267b20369-a5d8-4e1a-92fc-4228cf9777b1
a1234 Mon Jul 11 11:41:22 EDT 20227247df22-8187-4490-adad-d1b22209ba96
14b-Language Extensions Thu Jun 16 17:25:01 EDT 20227566e53d-a163-4ce4-b5b7-0db9207715e1
a1234 Mon Jul 11 11:41:29 EDT 202279027464-c6c6-4717-aca5-255dd98abae1
15_10-Primitive Data Types Mon Jun 13 13:47:44 EDT 20227b17f736-b909-40ce-b7da-34e622db8c0e
10b-Trade-off Among Alternative Configurations Thu Jun 16 17:21:25 EDT 2022818b9a9b-c6cd-4da4-af0e-7a929df7f5d7
15_10-Primitive Data Types Thu Jun 16 17:26:00 EDT 202286cbd86a-8322-4f03-99ce-a46f5edde464
15_19-Materials with Properties Mon Jun 13 13:47:59 EDT 202289922923-e086-4ff6-8034-0f343f3855b4
2a-Parts Interconnection Mon Jun 13 13:39:03 EDT 202289eeacf4-d0fc-42bb-9a9b-c75f9c8188bc
3a-Function-based Behavior-2 Mon Jun 13 13:39:51 EDT 20228a5cfb5f-6b5c-47d1-b352-941825419637
Spacecraft 2022-06-21 08:58:33.2422268aef12b0-9b6c-4e2e-8235-2c3470b0c9f6
13b-Safety and Security Features Element Group Thu Jun 16 17:23:45 EDT 20228ffb1a97-96bd-4794-829f-77a687f1758e
11b-Safety and Security Feature Views Thu Jun 16 17:22:50 EDT 202292a73141-2648-4500-a613-b25462fa511b
12a-Dependency Thu Jun 16 17:23:07 EDT 2022945c21f9-05f0-4541-a219-1a7d90674a7b
4a-Functional Allocation Mon Jun 13 13:40:25 EDT 20229765eb33-4104-461c-a8e7-578a32e8478a
a Thu Jul 07 15:00:49 EDT 2022a66e64e3-5907-413d-bab3-cf87455de7c6
3a-Function-based Behavior-5 Mon Jun 13 13:40:09 EDT 2022ad4f5833-1571-4693-bfe9-9d8dd40d6192
13b-Safety and Security Features Element Group-1 Mon Jun 13 13:45:41 EDT 2022ae7132a0-656d-4ff1-8807-5bb9ecfa8b62
3a-Function-based Behavior-1 Mon Jun 13 13:39:31 EDT 2022b6fd0cb0-6583-4cab-aa31-05b77c00c608
17b-Sequence-Modeling Thu Jun 16 17:26:51 EDT 2022bb6966df-a56a-45f5-a11f-76566887e115
7b-Variant Configurations Mon Jun 13 13:41:55 EDT 2022bc32c76d-af60-48b1-878e-4c91fed1247c
13b-Safety and Security Features Element Group Mon Jun 13 13:45:27 EDT 2022c01bf68b-fd64-496a-8491-850fd4c8b5cf
a1234 Mon Jul 11 12:05:39 EDT 2022c13b41ad-47a5-42fd-a3aa-02058386dd41
1c-Parts Tree Redefinition Mon Jun 13 13:38:32 EDT 2022c2b441ad-a4d2-4101-bea6-4f7d7c03e09d
2a-Parts Interconnection Thu Jun 16 17:17:18 EDT 2022c3c5e7c0-4124-450a-866d-716821f53e5f
9-Verification-simplified Thu Jun 16 17:21:02 EDT 2022c450ca8e-0f48-431d-9702-309a88cfb8ae
a1234 Thu Jul 07 15:01:29 EDT 2022c5c4f3bd-e228-4839-9f14-b8f60673d611
a Wed Jul 06 10:03:47 EDT 2022c95c531c-ee07-4f4e-ba6d-ade906d8c806
1c-Parts Tree Redefinition Thu Jun 16 17:16:42 EDT 2022cb7a45f4-38fd-4778-be4e-78d64b50c439
17a-Sequence-Modeling Thu Jun 16 17:26:36 EDT 2022d50de042-4fb7-4636-8d42-9fbcc46f8223
10d-Dynamics Analysis Mon Jun 13 13:43:50 EDT 2022d6e1b859-d7f0-4ab6-bb75-e3b0b88316a8
10c-Fuel Economy Analysis Thu Jun 16 17:21:43 EDT 2022d9935057-67ce-46a4-97d1-e8c5b5746461
13b-Safety and Security Features Element Group-2 Mon Jun 13 13:46:03 EDT 2022dac6f6e9-108a-43eb-adea-d28e0a117225
17b-Sequence-Modeling Mon Jun 13 13:48:33 EDT 2022de4bb80e-deb3-4c5d-a185-7bffdad0ceb2
a1234 Mon Jul 11 12:09:39 EDT 2022e0041915-4b2f-4a60-9994-20307dbd4d27
14a-Language Extensions Mon Jun 13 13:46:32 EDT 2022e6e8d739-9c01-4e4a-88fb-ffd5297c3979
14b-Language Extensions Mon Jun 13 13:46:46 EDT 2022e710e01f-b7ad-40c1-8a33-6159bc72525b
5-State-based Behavior-1 Thu Jun 16 17:19:02 EDT 2022e8d8ac69-7de7-4c49-b9ce-d2dabb3272a4
3a-Function-based Behavior-1 Thu Jun 16 17:17:46 EDT 2022eb95e9c6-89ce-423c-a8e1-4fb67cd5b003
15_05-Unification of Expression and Constraint Definition Mon Jun 13 13:47:27 EDT 2022ec2e1ad3-d98b-46cd-b038-9c41f5098259
Spacecraft 2022-06-13 13:06:03.158117efa5427e-d1af-4e8e-abfc-d0638d0b4748
13b-Safety and Security Features Element Group-1 Thu Jun 16 17:23:58 EDT 2022f0923bb1-50f7-4c32-8d36-a40d58d40781
6-Individual and Snapshots Thu Jun 16 17:19:53 EDT 2022f3ca279c-fff8-45e1-a96e-a84d6cfa651d
11a-View-Viewpoint Mon Jun 13 13:44:11 EDT 2022f60589e2-06dd-4bcd-9048-63c6dba67663
15_05-Unification of Expression and Constraint Definition Thu Jun 16 17:25:43 EDT 2022f618a491-d542-462e-912c-4b2362c5c228
3a-Function-based Behavior-2 Thu Jun 16 17:18:06 EDT 2022f9133184-53dc-4973-8b22-5be148262179Spacecraft project with branches and tags - 2022-09-09 17:04:20.838366978d0199-4e44-4090-8cb6-4253fd79e315
\n" ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -421,7 +97,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 7, "id": "6d2ba2fc-157a-4ac8-b8f3-876bbd3a21ea", "metadata": {}, "outputs": [ @@ -429,12 +105,12 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'@id': '25616f90-bcb8-46d9-a24c-079f2f99019d',\n", + "{'@id': '978d0199-4e44-4090-8cb6-4253fd79e315',\n", " '@type': 'Project',\n", - " 'defaultBranch': {'@id': 'f146cf01-0523-44f7-bb1a-6fdad0d21851'},\n", + " 'defaultBranch': {'@id': '3e5d38d1-91e4-4ec2-b2ac-857738731468'},\n", " 'description': 'Spacecraft project with multiple commits, branches, and tags',\n", - " 'name': 'Spacecraft project with branches and tags - 2022-07-19 '\n", - " '15:34:59.073337'}\n" + " 'name': 'Spacecraft project with branches and tags - 2022-09-09 '\n", + " '17:04:20.838366'}\n" ] } ], @@ -475,7 +151,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 8, "id": "df3e1039-ba51-4653-8897-e98be111078e", "metadata": {}, "outputs": [ @@ -484,25 +160,25 @@ "text/html": [ "\n", - "\n", + "
\n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", "
Branch NameBranch IDRef Commit (head)Branch NameBranch IDRef Commit (head)
mainf146cf01-0523-44f7-bb1a-6fdad0d21851Nonemain3e5d38d1-91e4-4ec2-b2ac-857738731468None
\n" ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -534,7 +210,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 9, "id": "65deeb6c-ce34-43c5-ad62-bf145e946f1d", "metadata": {}, "outputs": [ @@ -550,7 +226,7 @@ "text/html": [ "\n", - "\n", + "
\n", " \n", " \n", " \n", @@ -558,7 +234,7 @@ "
\n" ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -591,7 +267,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 10, "id": "3eed91b9-903b-441f-b1f2-10dbcfafa342", "metadata": {}, "outputs": [ @@ -599,11 +275,11 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'@id': '022286b4-dcdf-496b-994c-c1d4a2748129',\n", + "{'@id': '227e0d09-bdd2-4812-b818-8d9f737db429',\n", " '@type': 'Commit',\n", - " 'owningProject': {'@id': '25616f90-bcb8-46d9-a24c-079f2f99019d'},\n", + " 'owningProject': {'@id': '978d0199-4e44-4090-8cb6-4253fd79e315'},\n", " 'previousCommit': None,\n", - " 'timestamp': '2022-07-19T15:35:13.438917-04:00'}\n" + " 'timestamp': '2022-09-09T17:04:27.353806-04:00'}\n" ] } ], @@ -654,7 +330,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 11, "id": "65537f5c-f521-469e-92e4-9a2568afed05", "metadata": {}, "outputs": [ @@ -663,31 +339,31 @@ "text/html": [ "\n", - "\n", + "
\n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", "
Element NameElement IDElement NameElement ID
Payload Systemd051e410-9ad2-4101-94ff-a4110e73ec89Payload System5300ff6a-0f1c-487a-a463-1153f9638fcb
Propulsion System957d97ce-41e5-43c1-b772-45cac191565cPropulsion System6f038f20-a84b-4418-802d-b23a86c01f03
Spacecraft System433f4040-ea4c-4ebc-b948-2b45bc8c4a5aSpacecraft System1de8be3d-e734-47cb-a98b-8feaad078c3d
\n" ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -719,7 +395,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 12, "id": "76d80cb1-40c8-4f24-aeb5-51e509f4e159", "metadata": { "tags": [] @@ -729,11 +405,11 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'@id': '38643857-0090-4b81-89b7-b3411f117336',\n", + "{'@id': '3a05f9df-16ac-483b-abe4-7a7a104a33fa',\n", " '@type': 'Commit',\n", - " 'owningProject': {'@id': '25616f90-bcb8-46d9-a24c-079f2f99019d'},\n", - " 'previousCommit': {'@id': '022286b4-dcdf-496b-994c-c1d4a2748129'},\n", - " 'timestamp': '2022-07-19T15:35:17.309787-04:00'}\n" + " 'owningProject': {'@id': '978d0199-4e44-4090-8cb6-4253fd79e315'},\n", + " 'previousCommit': {'@id': '227e0d09-bdd2-4812-b818-8d9f737db429'},\n", + " 'timestamp': '2022-09-09T17:04:31.909048-04:00'}\n" ] } ], @@ -788,7 +464,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 13, "id": "eac0a387-e4cf-4fc8-8b47-c64ed2ebff62", "metadata": {}, "outputs": [ @@ -797,39 +473,39 @@ "text/html": [ "\n", - "\n", + "
\n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", "
Element NameElement IDElement NameElement ID
Avionics System4ff90e5b-2ac9-488c-b2d2-0d017802b121Avionics Systemff573440-aac6-40cc-a12e-917b20da1233
Payload Systemd051e410-9ad2-4101-94ff-a4110e73ec89Payload System5300ff6a-0f1c-487a-a463-1153f9638fcb
Power System256a44f2-4bf8-4ce9-95a5-3a0af661aeb3Power Systemb833d8d8-ce5e-444b-a6cb-15a2c06aae16
Propulsion System957d97ce-41e5-43c1-b772-45cac191565cPropulsion System6f038f20-a84b-4418-802d-b23a86c01f03
Spacecraft System433f4040-ea4c-4ebc-b948-2b45bc8c4a5aSpacecraft System1de8be3d-e734-47cb-a98b-8feaad078c3d
\n" ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -861,7 +537,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 14, "id": "886842cc-c983-424f-9af9-083257a5732c", "metadata": {}, "outputs": [ @@ -869,13 +545,13 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'@id': '758b401a-d6c9-4e9d-89d9-16a3fee3c049',\n", + "{'@id': '8b98474b-b4b4-4eff-b52d-251e3b666110',\n", " '@type': 'Tag',\n", " 'name': 'Spacecraft Internal Release 0.1',\n", - " 'owningProject': {'@id': '25616f90-bcb8-46d9-a24c-079f2f99019d'},\n", - " 'referencedCommit': {'@id': '38643857-0090-4b81-89b7-b3411f117336'},\n", - " 'taggedCommit': {'@id': '38643857-0090-4b81-89b7-b3411f117336'},\n", - " 'timestamp': '2022-07-19T15:35:21.841551-04:00'}\n" + " 'owningProject': {'@id': '978d0199-4e44-4090-8cb6-4253fd79e315'},\n", + " 'referencedCommit': {'@id': '3a05f9df-16ac-483b-abe4-7a7a104a33fa'},\n", + " 'taggedCommit': {'@id': '3a05f9df-16ac-483b-abe4-7a7a104a33fa'},\n", + " 'timestamp': '2022-09-09T17:04:36.074635-04:00'}\n" ] } ], @@ -915,7 +591,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 15, "id": "bf1ce47b-079d-429f-b43b-491c3aa156c8", "metadata": {}, "outputs": [ @@ -924,25 +600,25 @@ "text/html": [ "\n", - "\n", + "
\n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", "
Tag NameTag IDTagged CommitTag NameTag IDTagged Commit
Spacecraft Internal Release 0.1758b401a-d6c9-4e9d-89d9-16a3fee3c049{'@id': '38643857-0090-4b81-89b7-b3411f117336'}Spacecraft Internal Release 0.18b98474b-b4b4-4eff-b52d-251e3b666110{'@id': '3a05f9df-16ac-483b-abe4-7a7a104a33fa'}
\n" ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -974,7 +650,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 16, "id": "cc9620df-e407-4a25-8ae4-bd803d1cde32", "metadata": {}, "outputs": [ @@ -982,13 +658,13 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'@id': 'cb011176-6e8f-46e0-a314-741edae69f26',\n", + "{'@id': '3557c400-65df-4485-99d2-74df37fff362',\n", " '@type': 'Branch',\n", - " 'head': {'@id': '38643857-0090-4b81-89b7-b3411f117336'},\n", + " 'head': {'@id': '3a05f9df-16ac-483b-abe4-7a7a104a33fa'},\n", " 'name': 'develop',\n", - " 'owningProject': {'@id': '25616f90-bcb8-46d9-a24c-079f2f99019d'},\n", - " 'referencedCommit': {'@id': '38643857-0090-4b81-89b7-b3411f117336'},\n", - " 'timestamp': '2022-07-19T15:35:26.061576-04:00'}\n" + " 'owningProject': {'@id': '978d0199-4e44-4090-8cb6-4253fd79e315'},\n", + " 'referencedCommit': {'@id': '3a05f9df-16ac-483b-abe4-7a7a104a33fa'},\n", + " 'timestamp': '2022-09-09T17:04:39.14587-04:00'}\n" ] } ], @@ -1030,7 +706,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 17, "id": "61faab74-218a-4bf4-832d-2e3a3d70578d", "metadata": {}, "outputs": [ @@ -1039,30 +715,30 @@ "text/html": [ "\n", - "\n", + "
\n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", "
Branch NameBranch IDRef Commit (head)Branch NameBranch IDRef Commit (head)
developcb011176-6e8f-46e0-a314-741edae69f26{'@id': '38643857-0090-4b81-89b7-b3411f117336'}develop3557c400-65df-4485-99d2-74df37fff362{'@id': '3a05f9df-16ac-483b-abe4-7a7a104a33fa'}
mainf146cf01-0523-44f7-bb1a-6fdad0d21851{'@id': '38643857-0090-4b81-89b7-b3411f117336'}main3e5d38d1-91e4-4ec2-b2ac-857738731468{'@id': '3a05f9df-16ac-483b-abe4-7a7a104a33fa'}
\n" ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -1094,7 +770,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 18, "id": "055f42b3-18de-4f94-ae53-43660948493b", "metadata": {}, "outputs": [ @@ -1102,11 +778,11 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'@id': '2705a620-834a-421a-a24b-208344aec910',\n", + "{'@id': '044863cd-cc2c-48f5-8ff6-6ec7eae5612c',\n", " '@type': 'Commit',\n", - " 'owningProject': {'@id': '25616f90-bcb8-46d9-a24c-079f2f99019d'},\n", - " 'previousCommit': {'@id': '38643857-0090-4b81-89b7-b3411f117336'},\n", - " 'timestamp': '2022-07-19T15:35:29.750462-04:00'}\n" + " 'owningProject': {'@id': '978d0199-4e44-4090-8cb6-4253fd79e315'},\n", + " 'previousCommit': {'@id': '3a05f9df-16ac-483b-abe4-7a7a104a33fa'},\n", + " 'timestamp': '2022-09-09T17:04:42.398066-04:00'}\n" ] } ], @@ -1155,7 +831,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 19, "id": "ead42406-7536-4f47-b0d8-d34a48e9054e", "metadata": {}, "outputs": [ @@ -1164,30 +840,30 @@ "text/html": [ "\n", - "\n", + "
\n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", "
Branch NameBranch IDRef Commit (head)Branch NameBranch IDRef Commit (head)
developcb011176-6e8f-46e0-a314-741edae69f26{'@id': '2705a620-834a-421a-a24b-208344aec910'}develop3557c400-65df-4485-99d2-74df37fff362{'@id': '044863cd-cc2c-48f5-8ff6-6ec7eae5612c'}
mainf146cf01-0523-44f7-bb1a-6fdad0d21851{'@id': '38643857-0090-4b81-89b7-b3411f117336'}main3e5d38d1-91e4-4ec2-b2ac-857738731468{'@id': '3a05f9df-16ac-483b-abe4-7a7a104a33fa'}
\n" ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -1219,7 +895,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 20, "id": "86008838-368a-4e58-9d5b-70e9c57442f4", "metadata": {}, "outputs": [ @@ -1227,7 +903,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "'Fetching elements at commit 38643857-0090-4b81-89b7-b3411f117336'\n" + "'Fetching elements at commit 3a05f9df-16ac-483b-abe4-7a7a104a33fa'\n" ] }, { @@ -1235,39 +911,39 @@ "text/html": [ "\n", - "\n", + "
\n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", "
Element NameElement IDElement NameElement ID
Avionics System4ff90e5b-2ac9-488c-b2d2-0d017802b121Avionics Systemff573440-aac6-40cc-a12e-917b20da1233
Payload Systemd051e410-9ad2-4101-94ff-a4110e73ec89Payload System5300ff6a-0f1c-487a-a463-1153f9638fcb
Power System256a44f2-4bf8-4ce9-95a5-3a0af661aeb3Power Systemb833d8d8-ce5e-444b-a6cb-15a2c06aae16
Propulsion System957d97ce-41e5-43c1-b772-45cac191565cPropulsion System6f038f20-a84b-4418-802d-b23a86c01f03
Spacecraft System433f4040-ea4c-4ebc-b948-2b45bc8c4a5aSpacecraft System1de8be3d-e734-47cb-a98b-8feaad078c3d
\n" ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -1300,7 +976,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 21, "id": "60bf125d-5258-4546-99da-3680de66dd1b", "metadata": {}, "outputs": [ @@ -1308,7 +984,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "'Fetching elements at commit 2705a620-834a-421a-a24b-208344aec910'\n" + "'Fetching elements at commit 044863cd-cc2c-48f5-8ff6-6ec7eae5612c'\n" ] }, { @@ -1316,43 +992,43 @@ "text/html": [ "\n", - "\n", + "
\n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", + " \n", + " \n", " \n", " \n", "
Element NameElement IDElement NameElement ID
Avionics System4ff90e5b-2ac9-488c-b2d2-0d017802b121Avionics Systemff573440-aac6-40cc-a12e-917b20da1233
GN & C System83fa4826-7df8-4a8f-8227-180be69c79f6GN & C System5cb6557c-85be-413c-ac96-47bfd47199f7
Payload Systemd051e410-9ad2-4101-94ff-a4110e73ec89Payload System5300ff6a-0f1c-487a-a463-1153f9638fcb
Power System256a44f2-4bf8-4ce9-95a5-3a0af661aeb3Power Systemb833d8d8-ce5e-444b-a6cb-15a2c06aae16
Propulsion System957d97ce-41e5-43c1-b772-45cac191565cPropulsion System6f038f20-a84b-4418-802d-b23a86c01f03
Spacecraft System433f4040-ea4c-4ebc-b948-2b45bc8c4a5aSpacecraft System1de8be3d-e734-47cb-a98b-8feaad078c3d
\n" ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -1385,7 +1061,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 22, "id": "b3e26544-b2e4-4370-bb85-9d23aabcc0b5", "metadata": {}, "outputs": [ @@ -1393,13 +1069,13 @@ "name": "stdout", "output_type": "stream", "text": [ - "{'@id': '8721d368-432f-4253-a827-46f01a0f906d',\n", + "{'@id': 'b315aac0-a5c0-46c3-8be3-bc69da551050',\n", " '@type': 'Tag',\n", " 'name': 'Spacecraft Internal Release 0.2 build 1',\n", - " 'owningProject': {'@id': '25616f90-bcb8-46d9-a24c-079f2f99019d'},\n", - " 'referencedCommit': {'@id': '2705a620-834a-421a-a24b-208344aec910'},\n", - " 'taggedCommit': {'@id': '2705a620-834a-421a-a24b-208344aec910'},\n", - " 'timestamp': '2022-07-19T15:58:41.175306-04:00'}\n" + " 'owningProject': {'@id': '978d0199-4e44-4090-8cb6-4253fd79e315'},\n", + " 'referencedCommit': {'@id': '044863cd-cc2c-48f5-8ff6-6ec7eae5612c'},\n", + " 'taggedCommit': {'@id': '044863cd-cc2c-48f5-8ff6-6ec7eae5612c'},\n", + " 'timestamp': '2022-09-09T17:04:48.119181-04:00'}\n" ] } ], @@ -1439,7 +1115,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 23, "id": "aee7a152-8b4c-476a-8691-4766fc94c240", "metadata": {}, "outputs": [ @@ -1448,30 +1124,30 @@ "text/html": [ "\n", - "\n", + "
\n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", " \n", " \n", "
Tag NameTag IDTagged CommitTag NameTag IDTagged Commit
Spacecraft Internal Release 0.1758b401a-d6c9-4e9d-89d9-16a3fee3c049{'@id': '38643857-0090-4b81-89b7-b3411f117336'}Spacecraft Internal Release 0.18b98474b-b4b4-4eff-b52d-251e3b666110{'@id': '3a05f9df-16ac-483b-abe4-7a7a104a33fa'}
Spacecraft Internal Release 0.2 build 18721d368-432f-4253-a827-46f01a0f906d{'@id': '2705a620-834a-421a-a24b-208344aec910'}Spacecraft Internal Release 0.2 build 1b315aac0-a5c0-46c3-8be3-bc69da551050{'@id': '044863cd-cc2c-48f5-8ff6-6ec7eae5612c'}
\n" ], "text/plain": [ - "" + "" ] }, "metadata": {}, @@ -1500,6 +1176,14 @@ "metadata": {}, "outputs": [], "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fc7a30d3-42a7-4c51-9169-121773c35783", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { diff --git a/README.md b/README.md index 90b65e5..2f4451f 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,16 @@ This recipe shows patterns and examples for fetching and creating commits, branc See the Jupyter notebook **Project_Commit_Branch_Tag_Recipe.ipynb** for details. +### Element Create, Update, Delete recipe +This recipe shows patterns and examples for creating, updating, and deleting elements in project commits. + +See the Jupyter notebook **Element_Create_Update_Delete.ipynb** for details. + ### Queries recipe This recipe shows patterns and examples for formulating and executing queries in a project. Examples show queries with multiple constraints. See the Jupyter notebook **Queries.ipynb** for details. + + + +