All URIs are relative to http://portainer.domain/api
| Method | HTTP request | Description |
|---|---|---|
| templateCreate | POST /templates | Create a new template |
| templateDelete | DELETE /templates/{id} | Remove a template |
| templateInspect | GET /templates/{id} | Inspect a template |
| templateList | GET /templates | List available templates |
| templateUpdate | PUT /templates/{id} | Update a template |
Template templateCreate(body)
Create a new template
Create a new template. Access policy: administrator
var PortainerApi = require('portainer_api');
var defaultClient = PortainerApi.ApiClient.instance;
// Configure API key authorization: jwt
var jwt = defaultClient.authentications['jwt'];
jwt.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//jwt.apiKeyPrefix = 'Token';
var apiInstance = new PortainerApi.TemplatesApi();
var body = new PortainerApi.TemplateCreateRequest(); // TemplateCreateRequest | Template details
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.templateCreate(body, callback);
| Name | Type | Description | Notes |
|---|---|---|---|
| body | TemplateCreateRequest | Template details |
templateDelete(id)
Remove a template
Remove a template. Access policy: administrator
var PortainerApi = require('portainer_api');
var defaultClient = PortainerApi.ApiClient.instance;
// Configure API key authorization: jwt
var jwt = defaultClient.authentications['jwt'];
jwt.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//jwt.apiKeyPrefix = 'Token';
var apiInstance = new PortainerApi.TemplatesApi();
var id = 56; // Number | Template identifier
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
apiInstance.templateDelete(id, callback);
| Name | Type | Description | Notes |
|---|---|---|---|
| id | Number | Template identifier |
null (empty response body)
Template templateInspect(id)
Inspect a template
Retrieve details about a template. Access policy: administrator
var PortainerApi = require('portainer_api');
var defaultClient = PortainerApi.ApiClient.instance;
// Configure API key authorization: jwt
var jwt = defaultClient.authentications['jwt'];
jwt.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//jwt.apiKeyPrefix = 'Token';
var apiInstance = new PortainerApi.TemplatesApi();
var id = 56; // Number | Template identifier
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.templateInspect(id, callback);
| Name | Type | Description | Notes |
|---|---|---|---|
| id | Number | Template identifier |
TemplateListResponse templateList()
List available templates
List available templates. Administrator templates will not be listed for non-administrator users. Access policy: restricted
var PortainerApi = require('portainer_api');
var defaultClient = PortainerApi.ApiClient.instance;
// Configure API key authorization: jwt
var jwt = defaultClient.authentications['jwt'];
jwt.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//jwt.apiKeyPrefix = 'Token';
var apiInstance = new PortainerApi.TemplatesApi();
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.templateList(callback);
This endpoint does not need any parameter.
templateUpdate(id, body)
Update a template
Update a template. Access policy: administrator
var PortainerApi = require('portainer_api');
var defaultClient = PortainerApi.ApiClient.instance;
// Configure API key authorization: jwt
var jwt = defaultClient.authentications['jwt'];
jwt.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//jwt.apiKeyPrefix = 'Token';
var apiInstance = new PortainerApi.TemplatesApi();
var id = 56; // Number | Template identifier
var body = new PortainerApi.TemplateUpdateRequest(); // TemplateUpdateRequest | Template details
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully.');
}
};
apiInstance.templateUpdate(id, body, callback);
| Name | Type | Description | Notes |
|---|---|---|---|
| id | Number | Template identifier | |
| body | TemplateUpdateRequest | Template details |
null (empty response body)