Skip to content

Files

Latest commit

 

History

History
348 lines (264 loc) · 14.1 KB

PluginApi.md

File metadata and controls

348 lines (264 loc) · 14.1 KB

PluginApi

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

Method HTTP request Description
changePluginConfig POST /plugin/{plugin}/config Change plugin configs
getPlugin GET /plugin/{plugin} Get a plugin
getPluginConfig GET /plugin/{plugin}/config Get plugin configs
listPlugins GET /plugin List plugins
togglePlugin PUT /plugin/{plugin} Toggle a plugin

changePluginConfig

Map<String, Object> changePluginConfig(plugin, body, details, accept, pretty)

Change plugin configs

Allows changing the config files of plugin. Send a map from config filename to file contents. This does not reload the plugin, you can do that with `sponge plugins reload`, but not all plugins implement the reload event. Required permissions: - plugin.config.modify - plugin.config.modify.[plugin]

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.PluginApi;

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");

PluginApi apiInstance = new PluginApi();
String plugin = "plugin_example"; // String | The id of the plugin
Object body = null; // Object | 
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, Object> result = apiInstance.changePluginConfig(plugin, body, details, accept, pretty);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling PluginApi#changePluginConfig");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
plugin String The id of the plugin
body Object [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

Map<String, Object>

Authorization

ApiKeyHeader, ApiKeyQuery

HTTP request headers

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

getPlugin

PluginContainer getPlugin(plugin, details, accept, pretty)

Get a plugin

Gets detailed information about a plugin. Required permissions: - plugin.one

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.PluginApi;

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");

PluginApi apiInstance = new PluginApi();
String plugin = "plugin_example"; // String | The id of the plugin
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 {
    PluginContainer result = apiInstance.getPlugin(plugin, details, accept, pretty);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling PluginApi#getPlugin");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
plugin String The id of the plugin
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

PluginContainer

Authorization

ApiKeyHeader, ApiKeyQuery

HTTP request headers

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

getPluginConfig

Map<String, Object> getPluginConfig(plugin, details, accept, pretty)

Get plugin configs

Gets a map containing the plugin config file names as keys, and their config file contents as their values. Required permissions: - plugin.config.get

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.PluginApi;

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");

PluginApi apiInstance = new PluginApi();
String plugin = "plugin_example"; // String | The id of the plugin
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, Object> result = apiInstance.getPluginConfig(plugin, details, accept, pretty);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling PluginApi#getPluginConfig");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
plugin String The id of the plugin
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, Object>

Authorization

ApiKeyHeader, ApiKeyQuery

HTTP request headers

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

listPlugins

List<PluginContainer> listPlugins(details, accept, pretty)

List plugins

Get a list of all the plugins running on the server. Required permissions: - plugin.list

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.PluginApi;

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");

PluginApi apiInstance = new PluginApi();
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 {
    List<PluginContainer> result = apiInstance.listPlugins(details, accept, pretty);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling PluginApi#listPlugins");
    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

List<PluginContainer>

Authorization

ApiKeyHeader, ApiKeyQuery

HTTP request headers

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

togglePlugin

PluginContainer togglePlugin(plugin, details, accept, pretty)

Toggle a plugin

Allows enabling/disabling a plugin/mod. Requires a server restart. Required permissions: - plugin.toggle

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.PluginApi;

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");

PluginApi apiInstance = new PluginApi();
String plugin = "plugin_example"; // String | The id of the plugin
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 {
    PluginContainer result = apiInstance.togglePlugin(plugin, details, accept, pretty);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling PluginApi#togglePlugin");
    e.printStackTrace();
}

Parameters

Name Type Description Notes
plugin String The id of the plugin
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

PluginContainer

Authorization

ApiKeyHeader, ApiKeyQuery

HTTP request headers

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