Skip to content

Latest commit

 

History

History
488 lines (385 loc) · 15.5 KB

QueryApi.md

File metadata and controls

488 lines (385 loc) · 15.5 KB

QueryApi

All URIs are relative to http://localhost

Method HTTP request Description
deleteQueryByProjectAndId DELETE /projects/{projectId}/queries/{queryId} Delete query by project and ID
getQueriesByProject GET /projects/{projectId}/queries Get queries by project
getQueryByProjectAndId GET /projects/{projectId}/queries/{queryId} Get query by project and ID
getQueryResultsByProjectIdQuery GET /projects/{projectId}/query-results Get query results by project and query definition
getQueryResultsByProjectIdQueryId GET /projects/{projectId}/queries/{queryId}/results Get query results by project and query
getQueryResultsByProjectIdQueryPost POST /projects/{projectId}/query-results Get query results by project and query definition via POST
postQueryByProject POST /projects/{projectId}/queries Create query by project

deleteQueryByProjectAndId

Query deleteQueryByProjectAndId(projectId, queryId)

Delete query by project and ID

Example

// 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.QueryApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");

    QueryApi apiInstance = new QueryApi(defaultClient);
    UUID projectId = new UUID(); // UUID | ID of the project
    UUID queryId = new UUID(); // UUID | ID of the query
    try {
      Query result = apiInstance.deleteQueryByProjectAndId(projectId, queryId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling QueryApi#deleteQueryByProjectAndId");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
projectId UUID ID of the project
queryId UUID ID of the query

Return type

Query

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -

getQueriesByProject

List<Query> getQueriesByProject(projectId, pageAfter, pageBefore, pageSize)

Get queries by project

Example

// 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.QueryApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");

    QueryApi apiInstance = new QueryApi(defaultClient);
    UUID projectId = new UUID(); // UUID | ID of the project
    String pageAfter = "pageAfter_example"; // String | Page after
    String pageBefore = "pageBefore_example"; // String | Page before
    Integer pageSize = 56; // Integer | Page size
    try {
      List<Query> result = apiInstance.getQueriesByProject(projectId, pageAfter, pageBefore, pageSize);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling QueryApi#getQueriesByProject");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
projectId UUID ID of the project
pageAfter String Page after [optional]
pageBefore String Page before [optional]
pageSize Integer Page size [optional]

Return type

List<Query>

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -

getQueryByProjectAndId

Query getQueryByProjectAndId(projectId, queryId)

Get query by project and ID

Example

// 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.QueryApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");

    QueryApi apiInstance = new QueryApi(defaultClient);
    UUID projectId = new UUID(); // UUID | ID of the project
    UUID queryId = new UUID(); // UUID | ID of the query
    try {
      Query result = apiInstance.getQueryByProjectAndId(projectId, queryId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling QueryApi#getQueryByProjectAndId");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
projectId UUID ID of the project
queryId UUID ID of the query

Return type

Query

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -

getQueryResultsByProjectIdQuery

List<Element> getQueryResultsByProjectIdQuery(projectId, body, commitId)

Get query results by project and query definition

Example

// 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.QueryApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");

    QueryApi apiInstance = new QueryApi(defaultClient);
    UUID projectId = new UUID(); // UUID | ID of the project
    Query body = new Query(); // Query | 
    UUID commitId = new UUID(); // UUID | ID of the commit - defaults to head of project
    try {
      List<Element> result = apiInstance.getQueryResultsByProjectIdQuery(projectId, body, commitId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling QueryApi#getQueryResultsByProjectIdQuery");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
projectId UUID ID of the project
body Query
commitId UUID ID of the commit - defaults to head of project [optional]

Return type

List<Element>

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/ld+json

HTTP response details

Status code Description Response headers
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -

getQueryResultsByProjectIdQueryId

List<Element> getQueryResultsByProjectIdQueryId(projectId, queryId, commitId)

Get query results by project and query

Example

// 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.QueryApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");

    QueryApi apiInstance = new QueryApi(defaultClient);
    UUID projectId = new UUID(); // UUID | ID of the project
    UUID queryId = new UUID(); // UUID | ID of the query
    UUID commitId = new UUID(); // UUID | ID of the commit - defaults to head of project
    try {
      List<Element> result = apiInstance.getQueryResultsByProjectIdQueryId(projectId, queryId, commitId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling QueryApi#getQueryResultsByProjectIdQueryId");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
projectId UUID ID of the project
queryId UUID ID of the query
commitId UUID ID of the commit - defaults to head of project [optional]

Return type

List<Element>

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/ld+json

HTTP response details

Status code Description Response headers
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -

getQueryResultsByProjectIdQueryPost

List<Element> getQueryResultsByProjectIdQueryPost(projectId, body, commitId)

Get query results by project and query definition via POST

For compatibility with clients that don't support GET requests with a body

Example

// 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.QueryApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");

    QueryApi apiInstance = new QueryApi(defaultClient);
    UUID projectId = new UUID(); // UUID | ID of the project
    Query body = new Query(); // Query | 
    UUID commitId = new UUID(); // UUID | ID of the commit - defaults to head of project
    try {
      List<Element> result = apiInstance.getQueryResultsByProjectIdQueryPost(projectId, body, commitId);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling QueryApi#getQueryResultsByProjectIdQueryPost");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
projectId UUID ID of the project
body Query
commitId UUID ID of the commit - defaults to head of project [optional]

Return type

List<Element>

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, application/ld+json

HTTP response details

Status code Description Response headers
200 Ok -
404 Not found. -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -

postQueryByProject

Query postQueryByProject(projectId, body)

Create query by project

Example

// 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.QueryApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("http://localhost");

    QueryApi apiInstance = new QueryApi(defaultClient);
    UUID projectId = new UUID(); // UUID | ID of the project
    Query body = new Query(); // Query | 
    try {
      Query result = apiInstance.postQueryByProject(projectId, body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling QueryApi#postQueryByProject");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
projectId UUID ID of the project
body Query

Return type

Query

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Created -
415 The requested content type is not acceptable. -
500 Internal server error. -
0 Unexpected response. -