|
| 1 | +# sysml-api-client |
| 2 | + |
| 3 | +SysML v2 API and Services |
| 4 | +- API version: 1.0.0 |
| 5 | + |
| 6 | +REST/HTTP binding (PSM) for the SysML v2 standard API. |
| 7 | + |
| 8 | + |
| 9 | +*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)* |
| 10 | + |
| 11 | + |
| 12 | +## Requirements |
| 13 | + |
| 14 | +Building the API client library requires: |
| 15 | +1. Java 1.7+ |
| 16 | +2. Maven/Gradle |
| 17 | + |
| 18 | +## Installation |
| 19 | + |
| 20 | +To install the API client library to your local Maven repository, simply execute: |
| 21 | + |
| 22 | +```shell |
| 23 | +mvn clean install |
| 24 | +``` |
| 25 | + |
| 26 | +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: |
| 27 | + |
| 28 | +```shell |
| 29 | +mvn clean deploy |
| 30 | +``` |
| 31 | + |
| 32 | +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. |
| 33 | + |
| 34 | +### Maven users |
| 35 | + |
| 36 | +Add this dependency to your project's POM: |
| 37 | + |
| 38 | +```xml |
| 39 | +<dependency> |
| 40 | + <groupId>org.omg.sysml</groupId> |
| 41 | + <artifactId>sysml-api-client</artifactId> |
| 42 | + <version>0.1.0</version> |
| 43 | + <scope>compile</scope> |
| 44 | +</dependency> |
| 45 | +``` |
| 46 | + |
| 47 | +### Gradle users |
| 48 | + |
| 49 | +Add this dependency to your project's build file: |
| 50 | + |
| 51 | +```groovy |
| 52 | +compile "org.omg.sysml:sysml-api-client:0.1.0" |
| 53 | +``` |
| 54 | + |
| 55 | +### Others |
| 56 | + |
| 57 | +At first generate the JAR by executing: |
| 58 | + |
| 59 | +```shell |
| 60 | +mvn clean package |
| 61 | +``` |
| 62 | + |
| 63 | +Then manually install the following JARs: |
| 64 | + |
| 65 | +* `target/sysml-api-client-0.1.0.jar` |
| 66 | +* `target/lib/*.jar` |
| 67 | + |
| 68 | +## Getting Started |
| 69 | + |
| 70 | +Please follow the [installation](#installation) instruction and execute the following Java code: |
| 71 | + |
| 72 | +```java |
| 73 | + |
| 74 | +import org.omg.sysml.*; |
| 75 | +import org.omg.sysml.auth.*; |
| 76 | +import org.omg.sysml.model.*; |
| 77 | +import org.omg.sysml.api.ElementApi; |
| 78 | + |
| 79 | +import java.io.File; |
| 80 | +import java.util.*; |
| 81 | + |
| 82 | +public class ElementApiExample { |
| 83 | + |
| 84 | + public static void main(String[] args) { |
| 85 | + |
| 86 | + ElementApi apiInstance = new ElementApi(); |
| 87 | + Element element = new Element(); // Element | |
| 88 | + try { |
| 89 | + Element result = apiInstance.createElement(element); |
| 90 | + System.out.println(result); |
| 91 | + } catch (ApiException e) { |
| 92 | + System.err.println("Exception when calling ElementApi#createElement"); |
| 93 | + e.printStackTrace(); |
| 94 | + } |
| 95 | + } |
| 96 | +} |
| 97 | + |
| 98 | +``` |
| 99 | + |
| 100 | +## Documentation for API Endpoints |
| 101 | + |
| 102 | +All URIs are relative to *http://localhost* |
| 103 | + |
| 104 | +Class | Method | HTTP request | Description |
| 105 | +------------ | ------------- | ------------- | ------------- |
| 106 | +*ElementApi* | [**createElement**](docs/ElementApi.md#createElement) | **POST** /element | Add a new element |
| 107 | +*ElementApi* | [**getElement**](docs/ElementApi.md#getElement) | **GET** /element/{id} | Get element by its ID |
| 108 | +*ElementApi* | [**getElements**](docs/ElementApi.md#getElements) | **GET** /element | Get all elements |
| 109 | +*ElementApi* | [**getElementsInModel**](docs/ElementApi.md#getElementsInModel) | **GET** /element/model/{model_id} | Get all elements in the model |
| 110 | +*ModelApi* | [**createModel**](docs/ModelApi.md#createModel) | **POST** /model | Add a new model |
| 111 | +*ModelApi* | [**getModel**](docs/ModelApi.md#getModel) | **GET** /model/{id} | Get model by its ID |
| 112 | +*ModelApi* | [**getModels**](docs/ModelApi.md#getModels) | **GET** /model | Get all models |
| 113 | +*RelationshipApi* | [**createRelationship**](docs/RelationshipApi.md#createRelationship) | **POST** /relationship | Add a new relationship |
| 114 | +*RelationshipApi* | [**getRelationship**](docs/RelationshipApi.md#getRelationship) | **GET** /relationship/{id} | Get relationship by its ID |
| 115 | +*RelationshipApi* | [**getRelationships**](docs/RelationshipApi.md#getRelationships) | **GET** /relationship | Get all relationships |
| 116 | +*RelationshipApi* | [**getRelationshipsByElement**](docs/RelationshipApi.md#getRelationshipsByElement) | **GET** /relationship/element/{element_id} | Get all relationships with the given element as either source or target |
| 117 | +*RelationshipApi* | [**getRelationshipsBySource**](docs/RelationshipApi.md#getRelationshipsBySource) | **GET** /relationship/source/{source_id} | Get all relationships with the given element as the source |
| 118 | +*RelationshipApi* | [**getRelationshipsByTarget**](docs/RelationshipApi.md#getRelationshipsByTarget) | **GET** /relationship/target/{target_id} | Get all relationships with the given element as the target |
| 119 | + |
| 120 | + |
| 121 | +## Documentation for Models |
| 122 | + |
| 123 | + - [Element](docs/Element.md) |
| 124 | + - [Error](docs/Error.md) |
| 125 | + - [Model](docs/Model.md) |
| 126 | + - [Relationship](docs/Relationship.md) |
| 127 | + |
| 128 | + |
| 129 | +## Documentation for Authorization |
| 130 | + |
| 131 | +All endpoints do not require authorization. |
| 132 | +Authentication schemes defined for the API: |
| 133 | + |
| 134 | +## Recommendation |
| 135 | + |
| 136 | +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. |
| 137 | + |
| 138 | +## Author |
| 139 | + |
| 140 | + |
| 141 | + |
0 commit comments