Skip to content

Files

Latest commit

author
Marco (Valandur)
May 14, 2018
5d422c1 · May 14, 2018

History

History
208 lines (156 loc) · 7.89 KB

InfoApi.md

File metadata and controls

208 lines (156 loc) · 7.89 KB

InfoApi

All URIs are relative to https://localhost/api/v5

Method HTTP request Description
getInfo GET /info Server info
getStats GET /info/stats Server stats
listServlets GET /info/servlets List servlets

getInfo

ServerInfo getInfo(details, accept, pretty)

Server info

Get general information about the Minecraft server. Required permissions: - info.info

Example

// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.InfoApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: ApiKeyHeader
ApiKeyAuth ApiKeyHeader = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyHeader");
ApiKeyHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyHeader.setApiKeyPrefix("Token");

// Configure API key authorization: ApiKeyQuery
ApiKeyAuth ApiKeyQuery = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyQuery");
ApiKeyQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyQuery.setApiKeyPrefix("Token");

InfoApi apiInstance = new InfoApi();
Boolean details = true; // Boolean | Add to include additional details, omit or false otherwise
String accept = "accept_example"; // String | Override the 'Accept' request header (useful for debugging your requests)
Boolean pretty = true; // Boolean | Add to make the Web-API pretty print the response (useful for debugging your requests)
try {
    ServerInfo result = apiInstance.getInfo(details, accept, pretty);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling InfoApi#getInfo");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
details Boolean Add to include additional details, omit or false otherwise [optional]
accept String Override the 'Accept' request header (useful for debugging your requests) [optional] [enum: json, xml]
pretty Boolean Add to make the Web-API pretty print the response (useful for debugging your requests) [optional]

Return type

ServerInfo

Authorization

ApiKeyHeader, ApiKeyQuery

HTTP request headers

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

getStats

ServerStats getStats(limit, details, accept, pretty)

Server stats

Get statistical information about the server, such as player count, cpu and memory usage over time. Required permissions: - info.stats

Example

// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.InfoApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: ApiKeyHeader
ApiKeyAuth ApiKeyHeader = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyHeader");
ApiKeyHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyHeader.setApiKeyPrefix("Token");

// Configure API key authorization: ApiKeyQuery
ApiKeyAuth ApiKeyQuery = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyQuery");
ApiKeyQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyQuery.setApiKeyPrefix("Token");

InfoApi apiInstance = new InfoApi();
Integer limit = 56; // Integer | 
Boolean details = true; // Boolean | Add to include additional details, omit or false otherwise
String accept = "accept_example"; // String | Override the 'Accept' request header (useful for debugging your requests)
Boolean pretty = true; // Boolean | Add to make the Web-API pretty print the response (useful for debugging your requests)
try {
    ServerStats result = apiInstance.getStats(limit, details, accept, pretty);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling InfoApi#getStats");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
limit Integer [optional]
details Boolean Add to include additional details, omit or false otherwise [optional]
accept String Override the 'Accept' request header (useful for debugging your requests) [optional] [enum: json, xml]
pretty Boolean Add to make the Web-API pretty print the response (useful for debugging your requests) [optional]

Return type

ServerStats

Authorization

ApiKeyHeader, ApiKeyQuery

HTTP request headers

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

listServlets

Map<String, String> listServlets(details, accept, pretty)

List servlets

Lists all the active servlets running in the Web-API Required permissions: - info.servlets

Example

// Import classes:
//import io.swagger.client.ApiClient;
//import io.swagger.client.ApiException;
//import io.swagger.client.Configuration;
//import io.swagger.client.auth.*;
//import io.swagger.client.api.InfoApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: ApiKeyHeader
ApiKeyAuth ApiKeyHeader = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyHeader");
ApiKeyHeader.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyHeader.setApiKeyPrefix("Token");

// Configure API key authorization: ApiKeyQuery
ApiKeyAuth ApiKeyQuery = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyQuery");
ApiKeyQuery.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//ApiKeyQuery.setApiKeyPrefix("Token");

InfoApi apiInstance = new InfoApi();
Boolean details = true; // Boolean | Add to include additional details, omit or false otherwise
String accept = "accept_example"; // String | Override the 'Accept' request header (useful for debugging your requests)
Boolean pretty = true; // Boolean | Add to make the Web-API pretty print the response (useful for debugging your requests)
try {
    Map<String, String> result = apiInstance.listServlets(details, accept, pretty);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling InfoApi#listServlets");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
details Boolean Add to include additional details, omit or false otherwise [optional]
accept String Override the 'Accept' request header (useful for debugging your requests) [optional] [enum: json, xml]
pretty Boolean Add to make the Web-API pretty print the response (useful for debugging your requests) [optional]

Return type

Map<String, String>

Authorization

ApiKeyHeader, ApiKeyQuery

HTTP request headers

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