SysML v2 API and Services
- API version: 1.0.0
REST/HTTP binding (PSM) for the SysML v2 standard API.
Automatically generated by the OpenAPI Generator
Building the API client library requires:
- Java 1.7+
- Maven/Gradle
To install the API client library to your local Maven repository, simply execute:
mvn clean install
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn clean deploy
Refer to the OSSRH Guide for more information.
Add this dependency to your project's POM:
<dependency> <groupId>org.omg.sysml</groupId> <artifactId>sysml-v2-api-client</artifactId> <version>2020-09</version> <scope>compile</scope> </dependency>
Add this dependency to your project's build file:
compile "org.omg.sysml:sysml-v2-api-client:2020-09"
At first generate the JAR by executing:
mvn clean package
Then manually install the following JARs:
target/sysml-v2-api-client-2020-09.jar
target/lib/*.jar
Please follow the installation instruction and execute the following Java code:
// Import classes: import org.omg.sysml.ApiClient; import org.omg.sysml.ApiException; import org.omg.sysml.Configuration; import org.omg.sysml.models.*; import org.omg.sysml.api.CommitApi; public class Example { public static void main(String[] args) { ApiClient defaultClient = Configuration.getDefaultApiClient(); defaultClient.setBasePath("http://localhost"); CommitApi apiInstance = new CommitApi(defaultClient); UUID projectId = new UUID(); // UUID | ID of the project UUID commitId = new UUID(); // UUID | ID of the commit try { Commit result = apiInstance.getCommitByProjectAndId(projectId, commitId); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling CommitApi#getCommitByProjectAndId"); System.err.println("Status code: " + e.getCode()); System.err.println("Reason: " + e.getResponseBody()); System.err.println("Response headers: " + e.getResponseHeaders()); e.printStackTrace(); } } }
All URIs are relative to http://localhost
Class | Method | HTTP request | Description |
---|---|---|---|
CommitApi | getCommitByProjectAndId | GET /projects/{projectId}/commits/{commitId} | Get commit by project and ID |
CommitApi | getCommitsByProject | GET /projects/{projectId}/commits | Get commits by project |
CommitApi | getHeadCommitByProject | GET /projects/{projectId}/head | Get head commit by project |
CommitApi | postCommitByProject | POST /projects/{projectId}/commits | Create commit by project |
ElementApi | getElementByProjectCommitId | GET /projects/{projectId}/commits/{commitId}/elements/{elementId} | Get element by project, commit and ID |
ElementApi | getElementsByProjectCommit | GET /projects/{projectId}/commits/{commitId}/elements | Get elements by project and commit |
ElementApi | getRootsByProjectCommit | GET /projects/{projectId}/commits/{commitId}/roots | Get root elements by project and commit |
ProjectApi | getProjectById | GET /projects/{projectId} | Get project by ID |
ProjectApi | getProjects | GET /projects | Get projects |
ProjectApi | postProject | POST /projects | Create project |
QueryApi | getQueriesByProject | GET /projects/{projectId}/queries | Get queries by project |
QueryApi | getQueryByProjectAndId | GET /projects/{projectId}/queries/{queryId} | Get query by project and ID |
QueryApi | getQueryResultsByProjectIdQuery | GET /projects/{projectId}/query-results | Get query results by project and query definition |
QueryApi | getQueryResultsByProjectIdQueryId | GET /projects/{projectId}/queries/{queryId}/results | Get query results by project and query |
QueryApi | getQueryResultsByProjectIdQueryPost | POST /projects/{projectId}/query-results | Get query results by project and query definition via POST |
QueryApi | postQueryByProject | POST /projects/{projectId}/queries | Create query by project |
RelationshipApi | getRelationshipsByProjectCommitRelatedElement | GET /projects/{projectId}/commits/{commitId}/elements/{relatedElementId}/relationships | Get relationships by project, commit, and related element |
- Commit
- CommitContainingProject
- CompositeConstraint
- Constraint
- Element
- ElementIdentity
- ElementVersion
- Error
- Identified
- PrimitiveConstraint
- Project
- Query
- Record
- Relationship
All endpoints do not require authorization. Authentication schemes defined for the API:
It's recommended to create an instance of ApiClient
per thread in a multithreaded environment to avoid any potential issues.