|
| 1 | +# sysml-v2-api-client |
| 2 | +REST/HTTP binding (PSM) for the SysML v2 standard API. |
| 3 | + |
| 4 | +This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: |
| 5 | + |
| 6 | +- API version: 1.0.0 |
| 7 | +- Package version: 2019-04 |
| 8 | +- Build package: org.openapitools.codegen.languages.PythonClientCodegen |
| 9 | + |
| 10 | +## Requirements. |
| 11 | + |
| 12 | +Python 2.7 and 3.4+ |
| 13 | + |
| 14 | +## Installation & Usage |
| 15 | +### pip install |
| 16 | + |
| 17 | +If the python package is hosted on Github, you can install directly from Github |
| 18 | + |
| 19 | +```sh |
| 20 | +pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git |
| 21 | +``` |
| 22 | +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) |
| 23 | + |
| 24 | +Then import the package: |
| 25 | +```python |
| 26 | +import sysml_v2_api_client |
| 27 | +``` |
| 28 | + |
| 29 | +### Setuptools |
| 30 | + |
| 31 | +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). |
| 32 | + |
| 33 | +```sh |
| 34 | +python setup.py install --user |
| 35 | +``` |
| 36 | +(or `sudo python setup.py install` to install the package for all users) |
| 37 | + |
| 38 | +Then import the package: |
| 39 | +```python |
| 40 | +import sysml_v2_api_client |
| 41 | +``` |
| 42 | + |
| 43 | +## Getting Started |
| 44 | + |
| 45 | +Please follow the [installation procedure](#installation--usage) and then run the following: |
| 46 | + |
| 47 | +```python |
| 48 | +from __future__ import print_function |
| 49 | +import time |
| 50 | +import sysml_v2_api_client |
| 51 | +from sysml_v2_api_client.rest import ApiException |
| 52 | +from pprint import pprint |
| 53 | + |
| 54 | +# create an instance of the API class |
| 55 | +api_instance = sysml_v2_api_client.ElementApi(sysml_v2_api_client.ApiClient(configuration)) |
| 56 | +element = sysml_v2_api_client.Element() # Element | |
| 57 | + |
| 58 | +try: |
| 59 | + # Add a new element |
| 60 | + api_response = api_instance.create_element(element) |
| 61 | + pprint(api_response) |
| 62 | +except ApiException as e: |
| 63 | + print("Exception when calling ElementApi->create_element: %s\n" % e) |
| 64 | + |
| 65 | +``` |
| 66 | + |
| 67 | +## Documentation for API Endpoints |
| 68 | + |
| 69 | +All URIs are relative to *http://localhost* |
| 70 | + |
| 71 | +Class | Method | HTTP request | Description |
| 72 | +------------ | ------------- | ------------- | ------------- |
| 73 | +*ElementApi* | [**create_element**](docs/ElementApi.md#create_element) | **POST** /element | Add a new element |
| 74 | +*ElementApi* | [**get_element**](docs/ElementApi.md#get_element) | **GET** /element/{id} | Get element by its ID |
| 75 | +*ElementApi* | [**get_elements**](docs/ElementApi.md#get_elements) | **GET** /element | Get all elements |
| 76 | +*ElementApi* | [**get_elements_in_model**](docs/ElementApi.md#get_elements_in_model) | **GET** /element/model/{model_id} | Get all elements in the model |
| 77 | +*ModelApi* | [**create_model**](docs/ModelApi.md#create_model) | **POST** /model | Add a new model |
| 78 | +*ModelApi* | [**get_model**](docs/ModelApi.md#get_model) | **GET** /model/{id} | Get model by its ID |
| 79 | +*ModelApi* | [**get_models**](docs/ModelApi.md#get_models) | **GET** /model | Get all models |
| 80 | +*RelationshipApi* | [**create_relationship**](docs/RelationshipApi.md#create_relationship) | **POST** /relationship | Add a new relationship |
| 81 | +*RelationshipApi* | [**get_relationship**](docs/RelationshipApi.md#get_relationship) | **GET** /relationship/{id} | Get relationship by its ID |
| 82 | +*RelationshipApi* | [**get_relationships**](docs/RelationshipApi.md#get_relationships) | **GET** /relationship | Get all relationships |
| 83 | +*RelationshipApi* | [**get_relationships_by_element**](docs/RelationshipApi.md#get_relationships_by_element) | **GET** /relationship/element/{element_id} | Get all relationships with the given element as either source or target |
| 84 | +*RelationshipApi* | [**get_relationships_by_source**](docs/RelationshipApi.md#get_relationships_by_source) | **GET** /relationship/source/{source_id} | Get all relationships with the given element as the source |
| 85 | +*RelationshipApi* | [**get_relationships_by_target**](docs/RelationshipApi.md#get_relationships_by_target) | **GET** /relationship/target/{target_id} | Get all relationships with the given element as the target |
| 86 | + |
| 87 | + |
| 88 | +## Documentation For Models |
| 89 | + |
| 90 | + - [Element](docs/Element.md) |
| 91 | + - [Error](docs/Error.md) |
| 92 | + - [Model](docs/Model.md) |
| 93 | + - [Relationship](docs/Relationship.md) |
| 94 | + |
| 95 | + |
| 96 | +## Documentation For Authorization |
| 97 | + |
| 98 | + All endpoints do not require authorization. |
| 99 | + |
| 100 | + |
| 101 | +## Author |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | + |
0 commit comments