TeamsApi.md 7.8 KB

PortainerApi.TeamsApi

All URIs are relative to http://portainer.domain/api

Method HTTP request Description
teamCreate POST /teams Create a new team
teamDelete DELETE /teams/{id} Remove a team
teamInspect GET /teams/{id} Inspect a team
teamList GET /teams List teams
teamMembershipsInspect GET /teams/{id}/memberships Inspect a team memberships
teamUpdate PUT /teams/{id} Update a team

teamCreate

Team teamCreate(body)

Create a new team

Create a new team. Access policy: administrator

Example

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.TeamsApi();

var body = new PortainerApi.TeamCreateRequest(); // TeamCreateRequest | Team details


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.teamCreate(body, callback);

Parameters

Name Type Description Notes
body TeamCreateRequest Team details

Return type

Team

Authorization

jwt

HTTP request headers

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

teamDelete

teamDelete(id)

Remove a team

Remove a team. Access policy: administrator

Example

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.TeamsApi();

var id = 56; // Number | Team identifier


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.teamDelete(id, callback);

Parameters

Name Type Description Notes
id Number Team identifier

Return type

null (empty response body)

Authorization

jwt

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

teamInspect

Team teamInspect(id)

Inspect a team

Retrieve details about a team. Access is only available for administrator and leaders of that team. Access policy: restricted

Example

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.TeamsApi();

var id = 56; // Number | Team identifier


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.teamInspect(id, callback);

Parameters

Name Type Description Notes
id Number Team identifier

Return type

Team

Authorization

jwt

HTTP request headers

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

teamList

TeamListResponse teamList()

List teams

List teams. For non-administrator users, will only list the teams they are member of. Access policy: restricted

Example

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.TeamsApi();

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.teamList(callback);

Parameters

This endpoint does not need any parameter.

Return type

TeamListResponse

Authorization

jwt

HTTP request headers

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

teamMembershipsInspect

TeamMembershipsResponse teamMembershipsInspect(id)

Inspect a team memberships

Inspect a team memberships. Access is only available for administrator and leaders of that team. Access policy: restricted

Example

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.TeamsApi();

var id = 56; // Number | Team identifier


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.teamMembershipsInspect(id, callback);

Parameters

Name Type Description Notes
id Number Team identifier

Return type

TeamMembershipsResponse

Authorization

jwt

HTTP request headers

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

teamUpdate

teamUpdate(id, body)

Update a team

Update a team. Access policy: administrator

Example

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.TeamsApi();

var id = 56; // Number | Team identifier

var body = new PortainerApi.TeamUpdateRequest(); // TeamUpdateRequest | Team details


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.teamUpdate(id, body, callback);

Parameters

Name Type Description Notes
id Number Team identifier
body TeamUpdateRequest Team details

Return type

null (empty response body)

Authorization

jwt

HTTP request headers

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