Skip to content

Latest commit

 

History

History
261 lines (168 loc) · 7.63 KB

File metadata and controls

261 lines (168 loc) · 7.63 KB

HyperstackApi.RbacRoleApi

All URIs are relative to https://infrahub-api.nexgencloud.com/v1

Method HTTP request Description
createRBACRole POST /auth/roles Create RBAC Role
deleteRBACRole DELETE /auth/roles/{id} Delete RBAC Role
listRBACRoles GET /auth/roles List RBAC Roles
retrieveRBACRoleDetails GET /auth/roles/{id} Retrieve RBAC Role Details
updateRBACRole PUT /auth/roles/{id} Update RBAC Role

createRBACRole

RbacRoleDetailResponseModel createRBACRole(payload)

Create RBAC Role

Creates an RBAC role that can be assigned to users, granting them access to specific resource actions. Provide the configuration of the RBAC role, including its name, description, and list of permissions and policy IDs in the request body. For additional information on creating RBAC roles, click here.

Example

import HyperstackApi from '@nexgencloud/hyperstack-sdk-javascript';
let defaultClient = HyperstackApi.ApiClient.instance;
// Configure API key authorization: apiKey
let apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

let apiInstance = new HyperstackApi.RbacRoleApi();
let payload = new HyperstackApi.CreateUpdateRbacRolePayload(); // CreateUpdateRbacRolePayload | 
apiInstance.createRBACRole(payload).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
payload CreateUpdateRbacRolePayload

Return type

RbacRoleDetailResponseModel

Authorization

apiKey

HTTP request headers

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

deleteRBACRole

CommonResponseModel deleteRBACRole(id)

Delete RBAC Role

Deletes an RBAC role by providing its ID in the path. For additional information, click here.

Example

import HyperstackApi from '@nexgencloud/hyperstack-sdk-javascript';
let defaultClient = HyperstackApi.ApiClient.instance;
// Configure API key authorization: apiKey
let apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

let apiInstance = new HyperstackApi.RbacRoleApi();
let id = 56; // Number | 
apiInstance.deleteRBACRole(id).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number

Return type

CommonResponseModel

Authorization

apiKey

HTTP request headers

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

listRBACRoles

GetRbacRolesResponseModel listRBACRoles()

List RBAC Roles

Retrieves a list of RBAC roles that can be assigned to the users within an organization. For additional information on RBAC roles, click here.

Example

import HyperstackApi from '@nexgencloud/hyperstack-sdk-javascript';
let defaultClient = HyperstackApi.ApiClient.instance;
// Configure API key authorization: apiKey
let apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

let apiInstance = new HyperstackApi.RbacRoleApi();
apiInstance.listRBACRoles().then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

This endpoint does not need any parameter.

Return type

GetRbacRolesResponseModel

Authorization

apiKey

HTTP request headers

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

retrieveRBACRoleDetails

RbacRoleDetailResponseModelFixed retrieveRBACRoleDetails(id)

Retrieve RBAC Role Details

Retrieves the details of a specified RBAC role by providing the RBAC role ID in the path. For additional information, click here.

Example

import HyperstackApi from '@nexgencloud/hyperstack-sdk-javascript';
let defaultClient = HyperstackApi.ApiClient.instance;
// Configure API key authorization: apiKey
let apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

let apiInstance = new HyperstackApi.RbacRoleApi();
let id = 56; // Number | 
apiInstance.retrieveRBACRoleDetails(id).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number

Return type

RbacRoleDetailResponseModelFixed

Authorization

apiKey

HTTP request headers

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

updateRBACRole

RbacRoleDetailResponseModel updateRBACRole(id, payload)

Update RBAC Role

Updates an RBAC role by providing the role ID in the path and the modified role configuration in the request body, including its name, description, and list of permissions and policy IDs. For additional information, click here.

Example

import HyperstackApi from '@nexgencloud/hyperstack-sdk-javascript';
let defaultClient = HyperstackApi.ApiClient.instance;
// Configure API key authorization: apiKey
let apiKey = defaultClient.authentications['apiKey'];
apiKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apiKey.apiKeyPrefix = 'Token';

let apiInstance = new HyperstackApi.RbacRoleApi();
let id = 56; // Number | 
let payload = new HyperstackApi.CreateUpdateRbacRolePayload(); // CreateUpdateRbacRolePayload | 
apiInstance.updateRBACRole(id, payload).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number
payload CreateUpdateRbacRolePayload

Return type

RbacRoleDetailResponseModel

Authorization

apiKey

HTTP request headers

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