@shadmanZero/tenantos-api
    Preparing search index...

    Class ServerBMCUsersResource

    Server BMC (Baseboard Management Controller) User Management Resource

    This resource provides comprehensive management of BMC users for a specific server. BMC users are used for out-of-band management operations like power control, console access, and hardware monitoring. This class allows you to create, update, delete, and configure BMC users with appropriate privileges and access controls.

    BMC user management is critical for server administration as it provides:

    • Remote power management capabilities
    • Console access for troubleshooting
    • Hardware monitoring and alerting
    • Secure out-of-band management
    const bmcUsers = client.servers.bmcUsers(123);

    // List all BMC users
    const users = await bmcUsers.listUsers();

    // Create a new BMC user with specific privileges
    const newUser = await bmcUsers.createUserWithPasswordAndPrivilege({
    username: 'admin-user',
    password: 'secure-password',
    privilege: 'administrator'
    });

    // Update user privileges
    await bmcUsers.setUserPrivilege(newUser.id, 'operator');

    // Enable/disable user
    await bmcUsers.enableUser(newUser.id);
    await bmcUsers.disableUser(newUser.id);

    Hierarchy

    • BaseResource
      • ServerBMCUsersResource
    Index

    Constructors

    • Creates a new ServerBMCUsersResource instance

      Parameters

      • client: any

        The TenantOS client instance

      • serverId: number

        The ID of the server to manage BMC users for

      Returns ServerBMCUsersResource

    Properties

    Methods

    • Parameters

      • userId: number
      • data: any

      Returns Promise<void>

    • Create a new BMC user

      Creates a new BMC user with the provided configuration. Note that this method creates a basic user - use createUserWithPasswordAndPrivilege() for a more complete user setup.

      Parameters

      • data: Partial<BMCUser>

        Partial BMC user data

      Returns Promise<BMCUser>

      Promise that resolves to the created BMC user

      If the creation fails

      const user = await bmcUsers.createUser({
      username: 'monitoring-user',
      enabled: true
      });
    • Create a BMC user with password and privilege in one operation

      This is the recommended method for creating BMC users as it sets up the username, password, and privilege level in a single atomic operation. This ensures the user is immediately usable for BMC operations.

      Parameters

      • data: { password: string; privilege: string; username: string }

        User creation data including username, password, and privilege

      Returns Promise<BMCUser>

      Promise that resolves to the created BMC user

      If the creation fails

      const adminUser = await bmcUsers.createUserWithPasswordAndPrivilege({
      username: 'admin',
      password: 'secure-password-123',
      privilege: 'administrator'
      });

      const operatorUser = await bmcUsers.createUserWithPasswordAndPrivilege({
      username: 'operator',
      password: 'operator-password',
      privilege: 'operator'
      });
    • Parameters

      • userId: number

      Returns Promise<void>

    • Parameters

      • userId: number

      Returns Promise<void>

    • Parameters

      • userId: number

      Returns Promise<void>

    • List all BMC users for the server

      Retrieves a list of all BMC users configured on the server's baseboard management controller. This includes both active and inactive users.

      Returns Promise<BMCUser[]>

      Promise that resolves to an array of BMC users

      If the request fails

      const users = await bmcUsers.listUsers();
      console.log(`Found ${users.length} BMC users`);
      users.forEach(user => {
      console.log(`${user.username}: ${user.privilege} (${user.enabled ? 'enabled' : 'disabled'})`);
      });
    • Parameters

      • userId: number
      • password: string

      Returns Promise<void>

    • Parameters

      • userId: number
      • privilege: string

      Returns Promise<void>

    • Validate that an ID is a positive integer

      Parameters

      • id: number
      • resourceName: string = 'Resource'

      Returns void

    • Validate required string field

      Parameters

      • value: string
      • fieldName: string

      Returns void