Skip to content

Latest commit

 

History

History
340 lines (238 loc) · 9.44 KB

GroupApi.md

File metadata and controls

340 lines (238 loc) · 9.44 KB

RoleBasedAccessControl.GroupApi

All URIs are relative to http://localhost/r/insights/platform/rbac/v1

Method HTTP request Description
addPrincipalToGroup POST /groups/{uuid}/principals/ Add a principal to a group in the tenant
createGroup POST /groups/ Create a group in a tenant
deleteGroup DELETE /groups/{uuid}/ Delete a group in the tenant
deletePrincipalFromGroup DELETE /groups/{uuid}/principals/ Remove a principal from a group in the tenant
getGroup GET /groups/{uuid}/ Get a group in the tenant
listGroups GET /groups/ List the groups for a tenant
updateGroup PUT /groups/{uuid}/ Udate a group in the tenant

addPrincipalToGroup

GroupWithPrincipals addPrincipalToGroup(uuid, groupPrincipalIn)

Add a principal to a group in the tenant

Example

import RoleBasedAccessControl from 'role_based_access_control';
let defaultClient = RoleBasedAccessControl.ApiClient.instance;

// Configure HTTP basic authorization: basic_auth
let basic_auth = defaultClient.authentications['basic_auth'];
basic_auth.username = 'YOUR USERNAME';
basic_auth.password = 'YOUR PASSWORD';

let apiInstance = new RoleBasedAccessControl.GroupApi();
let uuid = null; // String | ID of group to update
let groupPrincipalIn = new RoleBasedAccessControl.GroupPrincipalIn(); // GroupPrincipalIn | Principal to add to a group
apiInstance.addPrincipalToGroup(uuid, groupPrincipalIn).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
uuid String ID of group to update
groupPrincipalIn GroupPrincipalIn Principal to add to a group

Return type

GroupWithPrincipals

Authorization

basic_auth

HTTP request headers

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

createGroup

GroupOut createGroup(group)

Create a group in a tenant

Example

import RoleBasedAccessControl from 'role_based_access_control';
let defaultClient = RoleBasedAccessControl.ApiClient.instance;

// Configure HTTP basic authorization: basic_auth
let basic_auth = defaultClient.authentications['basic_auth'];
basic_auth.username = 'YOUR USERNAME';
basic_auth.password = 'YOUR PASSWORD';

let apiInstance = new RoleBasedAccessControl.GroupApi();
let group = new RoleBasedAccessControl.Group(); // Group | Group to create in tenant
apiInstance.createGroup(group).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
group Group Group to create in tenant

Return type

GroupOut

Authorization

basic_auth

HTTP request headers

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

deleteGroup

deleteGroup(uuid)

Delete a group in the tenant

Example

import RoleBasedAccessControl from 'role_based_access_control';
let defaultClient = RoleBasedAccessControl.ApiClient.instance;

// Configure HTTP basic authorization: basic_auth
let basic_auth = defaultClient.authentications['basic_auth'];
basic_auth.username = 'YOUR USERNAME';
basic_auth.password = 'YOUR PASSWORD';

let apiInstance = new RoleBasedAccessControl.GroupApi();
let uuid = null; // String | ID of group to delete
apiInstance.deleteGroup(uuid).then(() => {
  console.log('API called successfully.');
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
uuid String ID of group to delete

Return type

null (empty response body)

Authorization

basic_auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

deletePrincipalFromGroup

deletePrincipalFromGroup(uuid, usernames)

Remove a principal from a group in the tenant

Example

import RoleBasedAccessControl from 'role_based_access_control';
let defaultClient = RoleBasedAccessControl.ApiClient.instance;

// Configure HTTP basic authorization: basic_auth
let basic_auth = defaultClient.authentications['basic_auth'];
basic_auth.username = 'YOUR USERNAME';
basic_auth.password = 'YOUR PASSWORD';

let apiInstance = new RoleBasedAccessControl.GroupApi();
let uuid = null; // String | ID of group to update
let usernames = "usernames_example"; // String | A comma separated list of usernames for principals to remove from the group
apiInstance.deletePrincipalFromGroup(uuid, usernames).then(() => {
  console.log('API called successfully.');
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
uuid String ID of group to update
usernames String A comma separated list of usernames for principals to remove from the group

Return type

null (empty response body)

Authorization

basic_auth

HTTP request headers

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

getGroup

GroupWithPrincipals getGroup(uuid)

Get a group in the tenant

Example

import RoleBasedAccessControl from 'role_based_access_control';
let defaultClient = RoleBasedAccessControl.ApiClient.instance;

// Configure HTTP basic authorization: basic_auth
let basic_auth = defaultClient.authentications['basic_auth'];
basic_auth.username = 'YOUR USERNAME';
basic_auth.password = 'YOUR PASSWORD';

let apiInstance = new RoleBasedAccessControl.GroupApi();
let uuid = null; // String | ID of group to get
apiInstance.getGroup(uuid).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
uuid String ID of group to get

Return type

GroupWithPrincipals

Authorization

basic_auth

HTTP request headers

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

listGroups

GroupPagination listGroups(opts)

List the groups for a tenant

Example

import RoleBasedAccessControl from 'role_based_access_control';
let defaultClient = RoleBasedAccessControl.ApiClient.instance;

// Configure HTTP basic authorization: basic_auth
let basic_auth = defaultClient.authentications['basic_auth'];
basic_auth.username = 'YOUR USERNAME';
basic_auth.password = 'YOUR PASSWORD';

let apiInstance = new RoleBasedAccessControl.GroupApi();
let opts = {
  'pageSize': 10, // Number | Parameter for selecting the amount of data in a page.
  'page': 1 // Number | Parameter for selecting the page of data.
};
apiInstance.listGroups(opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
pageSize Number Parameter for selecting the amount of data in a page. [optional] [default to 10]
page Number Parameter for selecting the page of data. [optional] [default to 1]

Return type

GroupPagination

Authorization

basic_auth

HTTP request headers

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

updateGroup

GroupOut updateGroup(uuid, group)

Udate a group in the tenant

Example

import RoleBasedAccessControl from 'role_based_access_control';
let defaultClient = RoleBasedAccessControl.ApiClient.instance;

// Configure HTTP basic authorization: basic_auth
let basic_auth = defaultClient.authentications['basic_auth'];
basic_auth.username = 'YOUR USERNAME';
basic_auth.password = 'YOUR PASSWORD';

let apiInstance = new RoleBasedAccessControl.GroupApi();
let uuid = null; // String | ID of group to update
let group = new RoleBasedAccessControl.Group(); // Group | Group to update in tenant
apiInstance.updateGroup(uuid, group).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
uuid String ID of group to update
group Group Group to update in tenant

Return type

GroupOut

Authorization

basic_auth

HTTP request headers

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