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
The accompanying JAR file sysml-v2-api-client-*-all.jar includes all dependencies required to run it. You can add it to an existing project via Maven, Gradle, sbt, etc. in the standard manner for the tool.
If you are using Java 9+ you can use JShell to quickly interact with the client.
jshell --classpath /path/to/sysml-v2-api-client-*-all.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 |
| RelationshipApi | getRelationshipsByProjectCommitRelatedElement | GET /projects/{projectId}/commits/{commitId}/elements/{relatedElementId}/relationships | Get relationships by project, commit, and related element. |
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.