{
"Resources": [
{
"Uri": "/cli/v1/user",
"Interfaces": [
{
"Type": "Patch",
"Description": "Operate with user"
}
]
},
{
"Uri": "/cli/v1/user/addpublickey",
"Interfaces": [
{
"Type": "Patch",
"Description": "Add SSH public key",
"Usage": "ipmcset -t user -d addpublickey -v <username> <localpath/URL>",
"Authentication": {
"Description": "Input your password:",
"Condition": true
},
"ReqBody": {
"Type": "object",
"Required": true,
"Properties": {
"username": {
"Type": "string",
"Required": true,
"Validator": [
{
"Type": "Regex",
"Formula": "^(?!.*[<>&,'/\\%:\" ])(?=[A-Za-z0-9`~!@#$%^&*()_+-={};[\\]?.|])(?!#)(?!\\+)(?!-)([A-Za-z0-9`~!@#$%^&*()_+-={};[\\]?.|]{1,16})$"
}
],
"Description": "\n Contain any digits, letters, or characters except (:,\\<>&\"'/%) and space.\n User name's length is limitted to 1-16.\n User name cannot start with character \"#\" \"+\" or \"-\".\r\n User name cannot be just a dot (.) or two consecutive dots (..).\r\n"
},
"localpath": {
"Type": "string",
"Required": true,
"Sensitive": true,
"Description": " e.g.: /tmp/key.pub\nURL : protocol://[username:password@]IP[:port]/directory/filename\n The parameters in the URL are described as follows:\n The protocol must be https,sftp,cifs,scp or nfs.\n The URL can contain only letters, digits, and special characters. The directory or file name cannot contain @.\n Use double quotation marks (\") to enclose the URL that contains a space or double quotation marks (\"). Escape the double quotation marks (\") and back slash (\\) contained in the URL.\n For example, if you want to enter:\n a b\\cd\"\n Enter:\n \"a b\\\\cd\\\"\""
}
}
},
"RspBody": {
"IsLocalFile": "${Statements/IsLocalFile()}"
},
"Statements": {
"IsLocalFile": {
"Steps": [
{
"Type": "Script",
"Formula": "return string.sub(ReqBody.localpath, 1, 1) == '/'"
}
]
},
"IsImportActionPermitted": {
"Steps": [
{
"Type": "Plugin",
"Formula": "orchestrator.utils.is_import_permitted('URI', ReqBody.localpath, 'pub', 'Content', ProcessingFlow[2].Destination.Result)"
}
]
},
"is_allow_operate": {
"Steps": [
{
"Type": "Plugin",
"Formula": "orchestrator.account.is_allow_operate(ProcessingFlow[1].Destination.AccountId, ReqBody.username, true)"
}
]
}
},
"ProcessingFlow": [
{
"Type": "Method",
"Path": "/bmc/kepler/AccountService/Accounts",
"Interface": "bmc.kepler.AccountService.ManagerAccounts",
"Name": "GetIdByUserName",
"Params": [
"${ReqBody/username}"
],
"Destination": {
"AccountId": "AccountId"
}
},
{
"Type": "Method",
"Path": "/bmc/kepler/Managers/1/Security/File",
"Interface": "bmc.kepler.Managers.Security.File",
"Name": "IsPermitted",
"Params": [
"${ReqBody/localpath}",
"rw"
],
"Destination": {
"Result": "Result"
},
"CallIf": {
"${Statements/IsLocalFile()}": true
}
},
{
"Type": "Method",
"Path": "/bmc/kepler/AccountService/Accounts/${ProcessingFlow[1]/Destination/AccountId}",
"Interface": "bmc.kepler.AccountService.ManagerAccount",
"Name": "ImportSSHPublicKey",
"Params": [
"URI",
"${ReqBody/localpath}"
],
"CallIf": {
"${Statements/IsLocalFile()}": true,
"${Statements/IsImportActionPermitted()}": true,
"${Statements/is_allow_operate()}": true
}
},
{
"Type": "Task",
"Path": "/bmc/kepler/AccountService/Accounts/${ProcessingFlow[1]/Destination/AccountId}",
"Interface": "bmc.kepler.AccountService.ManagerAccount",
"Name": "ImportSSHPublicKey",
"Params": [
"URI",
"${ReqBody/localpath}"
],
"Destination": {
"TaskId": "TaskId"
},
"CallIf": {
"${Statements/IsLocalFile()}": false,
"${Statements/is_allow_operate()}": true
}
}
],
"Echoes": [
"ipmcset/user_addpublickey",
""
]
}
]
},
{
"Uri": "/cli/v1/user/delpublickey",
"Interfaces": [
{
"Type": "Patch",
"Description": "Delete SSH public key",
"Usage": "ipmcset -t user -d delpublickey -v <username>",
"Authentication": {
"Description": "Input your password:",
"Condition": true
},
"ReqBody": {
"Type": "object",
"Required": true,
"Properties": {
"username": {
"Type": "string",
"Required": true,
"Validator": [
{
"Type": "Regex",
"Formula": "^(?!.*[<>&,'/\\%:\" ])(?=[A-Za-z0-9`~!@#$%^&*()_+-={};[\\]?.|])(?!#)(?!\\+)(?!-)([A-Za-z0-9`~!@#$%^&*()_+-={};[\\]?.|]{1,16})$"
}
],
"Description": "\n Contain any digits, letters, or characters except (:,\\<>&\"'/%) and space.\n User name's length is limitted to 1-16.\n User name cannot start with character \"#\" \"+\" or \"-\".\r\n User name cannot be just a dot (.) or two consecutive dots (..).\r\n"
}
}
},
"Statements": {
"UserExist": {
"Steps": [
{
"Type": "Plugin",
"Formula": "orchestrator.account.is_allow_operate(ProcessingFlow[1].Destination.AccountId, ReqBody.username, true)"
}
]
}
},
"ProcessingFlow": [
{
"Type": "Method",
"Path": "/bmc/kepler/AccountService/Accounts",
"Interface": "bmc.kepler.AccountService.ManagerAccounts",
"Name": "GetIdByUserName",
"Params": [
"${ReqBody/username}"
],
"Destination": {
"AccountId": "AccountId"
}
},
{
"Type": "Method",
"Path": "/bmc/kepler/AccountService/Accounts/${ProcessingFlow[1]/Destination/AccountId}",
"Interface": "bmc.kepler.AccountService.ManagerAccount",
"Name": "DeleteSSHPublicKey",
"CallIf": {
"${Statements/UserExist()}": true
}
}
],
"Echoes": [
"ipmcset/user_delpublickey",
""
]
}
]
},
{
"Uri": "/cli/v1/user/firstloginpolicy",
"Interfaces": [
{
"Type": "Patch",
"Description": "Set user first login password reset policy",
"Usage": "ipmcset -t user -d firstloginpolicy -v <username> <option>",
"ReqBody": {
"Type": "object",
"Required": true,
"Properties": {
"username": {
"Type": "string",
"Required": true,
"Validator": [
{
"Type": "Regex",
"Formula": "^(?!.*[<>&,'/\\%:\" ])(?=[A-Za-z0-9`~!@#$%^&*()_+-={};[\\]?.|])(?!#)(?!\\+)(?!-)([A-Za-z0-9`~!@#$%^&*()_+-={};[\\]?.|]{1,16})$"
}
],
"Description": "\n Contain any digits, letters, or characters except (:,\\<>&\"'/%) and space.\n User name's length is limitted to 1-16.\n User name cannot start with character \"#\" \"+\" or \"-\".\r\n User name cannot be just a dot (.) or two consecutive dots (..).\r\n"
},
"option": {
"Required": true,
"Type": "integer",
"Description": "\n 1 : PromptPasswordReset\n 2 : ForcePasswordReset",
"Validator": [
{
"Type": "Enum",
"Formula": [
1,
2
]
}
]
}
}
},
"RspBody": {
"username": "${ReqBody/username}",
"option": "${Statements/option_str()}"
},
"Statements": {
"user_exist": {
"Steps": [
{
"Type": "Plugin",
"Formula": "orchestrator.account.is_allow_operate(ProcessingFlow[1].Destination.AccountId, ReqBody.username, true)"
}
]
},
"option_str": {
"Input": "${ReqBody/option}",
"Steps": [
{
"Type": "Switch",
"Formula": [
{
"Case": 1,
"To": "prompt"
},
{
"Case": 2,
"To": "force"
}
]
}
]
}
},
"ProcessingFlow": [
{
"Type": "Method",
"Path": "/bmc/kepler/AccountService/Accounts",
"Interface": "bmc.kepler.AccountService.ManagerAccounts",
"Name": "GetIdByUserName",
"Params": [
"${ReqBody/username}"
],
"Destination": {
"AccountId": "AccountId"
}
},
{
"Type": "Property",
"Path": "/bmc/kepler/AccountService/Accounts/${ProcessingFlow[1]/Destination/AccountId}",
"Interface": "bmc.kepler.AccountService.ManagerAccount",
"Source": {
"FirstLoginPolicy": "${ReqBody/option}"
},
"CallIf": {
"${Statements/user_exist()}": true
}
}
],
"Echoes": [
"ipmcset/user_firstloginpolicy",
""
]
}
]
},
{
"Uri": "/cli/v1/user/lock",
"Interfaces": [
{
"Type": "Patch",
"Description": "Set user lock state",
"Usage": "ipmcset -t user -d lock -v <username>",
"Authentication": {
"Condition": true,
"Description": "You need to log in again after modifying your attributes.\n Input your password:"
},
"ReqBody": {
"Type": "object",
"Required": true,
"Properties": {
"username": {
"Type": "string",
"Required": true,
"Validator": [
{
"Type": "Regex",
"Formula": "^(?!.*[<>&,'/\\%:\" ])(?=[A-Za-z0-9`~!@#$%^&*()_+-={};[\\]?.|])(?!#)(?!\\+)(?!-)([A-Za-z0-9`~!@#$%^&*()_+-={};[\\]?.|]{1,16})$"
}
],
"Description": "\n Contain any digits, letters, or characters except (:,\\<>&\"'/%) and space.\n User name's length is limitted to 1-16.\n User name cannot start with character \"#\" \"+\" or \"-\".\r\n User name cannot be just a dot (.) or two consecutive dots (..).\r\n"
}
}
},
"RspBody": {
"UserIsNotSelf": "${Statements/UserIsNotSelf()}",
"username": "${ReqBody/username}"
},
"Statements": {
"UserExist": {
"Steps": [
{
"Type": "Plugin",
"Formula": "orchestrator.account.is_allow_operate(ProcessingFlow[1].Destination.AccountId, ReqBody.username, true)"
}
]
},
"UserNameAdjust": {
"Input": "${ReqBody/username}",
"Steps": [
{
"Type": "Convert",
"Formula": "NumberToString"
}
]
},
"UserIsNotSelf": {
"Steps": [
{
"Type": "Script",
"Formula": "return Context.UserName ~= ReqBody.username"
}
]
}
},
"ProcessingFlow": [
{
"Type": "Method",
"Path": "/bmc/kepler/AccountService/Accounts",
"Interface": "bmc.kepler.AccountService.ManagerAccounts",
"Name": "GetIdByUserName",
"Params": [
"${ReqBody/username}"
],
"Destination": {
"AccountId": "AccountId"
}
},
{
"Type": "Method",
"Path": "/bmc/kepler/AccountService/Accounts",
"Interface": "bmc.kepler.AccountService.ManagerAccounts",
"Name": "SetAccountLockState",
"Params": [
"${ProcessingFlow[1]/Destination/AccountId}",
true
],
"CallIf": {
"${Statements/UserExist()}": true,
"${Statements/UserIsNotSelf()}": true
}
}
],
"Echoes": [
"ipmcset/user_lock",
""
]
}
]
},
{
"Uri": "/cli/v1/user/privilege",
"Interfaces": [
{
"Type": "Patch",
"Description": "Set user privilege",
"Usage": "ipmcset -t user -d privilege -v <username> <privilege>",
"Authentication": {
"Description": "You need to log in again after modifying your attributes.\n Input your password:",
"Condition": true
},
"ReqBody": {
"Type": "object",
"Required": true,
"Properties": {
"username": {
"Type": "string",
"Required": true,
"Validator": [
{
"Type": "Regex",
"Formula": "^(?!.*[<>&,'/\\%:\" ])(?=[A-Za-z0-9`~!@#$%^&*()_+-={};[\\]?.|])(?!#)(?!\\+)(?!-)([A-Za-z0-9`~!@#$%^&*()_+-={};[\\]?.|]{1,16})$"
}
],
"Description": "\n Contain any digits, letters, or characters except (:,\\<>&\"'/%) and space.\n User name's length is limitted to 1-16.\n User name cannot start with character \"#\" \"+\" or \"-\".\r\n User name cannot be just a dot (.) or two consecutive dots (..).\r\n"
},
"privilege": {
"Required": true,
"Type": "integer",
"Description": "\n 15 No Access\n 2 User\n 3 Operator\n 4 Administrator\n 5 Custom Role1\n 6 Custom Role2\n 7 Custom Role3\n 8 Custom Role4",
"Validator": [
{
"Type": "Enum",
"Formula": [
15,
2,
3,
4,
5,
6,
7,
8
]
}
]
}
}
},
"Statements": {
"UserExist": {
"Steps": [
{
"Type": "Plugin",
"Formula": "orchestrator.account.is_allow_operate(ProcessingFlow[1].Destination.AccountId, ReqBody.username, true)"
}
]
},
"Privilege": {
"Input": "${ReqBody/privilege}",
"Steps": [
{
"Type": "Switch",
"Formula": [
{
"Case": 15,
"To": 0
}
]
}
]
}
},
"ProcessingFlow": [
{
"Type": "Method",
"Path": "/bmc/kepler/AccountService/Accounts",
"Interface": "bmc.kepler.AccountService.ManagerAccounts",
"Name": "GetIdByUserName",
"Params": [
"${ReqBody/username}"
],
"Destination": {
"AccountId": "AccountId"
}
},
{
"Type": "Property",
"Path": "/bmc/kepler/AccountService/Accounts/${ProcessingFlow[1]/Destination/AccountId}",
"Interface": "bmc.kepler.AccountService.ManagerAccount",
"Source": {
"RoleId": "${Statements/Privilege()}"
},
"CallIf": {
"${Statements/UserExist()}": true
}
}
],
"Echoes": [
"ipmcset/user_privilege",
""
]
}
]
},
{
"Uri": "/cli/v1/_/privilege",
"Interfaces": [
{
"Type": "Patch",
"Description": "Set user privilege",
"Usage": "ipmcset -d privilege -v <username> <privilege>",
"Authentication": {
"Description": "You need to log in again after modifying your attributes.\n Input your password:",
"Condition": true
},
"ReqBody": {
"Type": "object",
"Required": true,
"Properties": {
"username": {
"Type": "string",
"Required": true,
"Validator": [
{
"Type": "Regex",
"Formula": "^(?!.*[<>&,'/\\%:\" ])(?=[A-Za-z0-9`~!@#$%^&*()_+-={};[\\]?.|])(?!#)(?!\\+)(?!-)([A-Za-z0-9`~!@#$%^&*()_+-={};[\\]?.|]{1,16})$"
}
],
"Description": "\n Contain any digits, letters, or characters except (:,\\<>&\"'/%) and space.\n User name's length is limitted to 1-16.\n User name cannot start with character \"#\" \"+\" or \"-\".\r\n User name cannot be just a dot (.) or two consecutive dots (..).\r\n"
},
"privilege": {
"Required": true,
"Type": "integer",
"Description": "\n 15 No Access\n 2 User\n 3 Operator\n 4 Administrator\n 5 Custom Role1\n 6 Custom Role2\n 7 Custom Role3\n 8 Custom Role4",
"Validator": [
{
"Type": "Enum",
"Formula": [
15,
2,
3,
4,
5,
6,
7,
8
]
}
]
}
}
},
"Statements": {
"UserExist": {
"Steps": [
{
"Type": "Plugin",
"Formula": "orchestrator.account.is_allow_operate(ProcessingFlow[1].Destination.AccountId, ReqBody.username, true)"
}
]
},
"Privilege": {
"Input": "${ReqBody/privilege}",
"Steps": [
{
"Type": "Switch",
"Formula": [
{
"Case": 15,
"To": 0
}
]
}
]
}
},
"ProcessingFlow": [
{
"Type": "Method",
"Path": "/bmc/kepler/AccountService/Accounts",
"Interface": "bmc.kepler.AccountService.ManagerAccounts",
"Name": "GetIdByUserName",
"Params": [
"${ReqBody/username}"
],
"Destination": {
"AccountId": "AccountId"
}
},
{
"Type": "Property",
"Path": "/bmc/kepler/AccountService/Accounts/${ProcessingFlow[1]/Destination/AccountId}",
"Interface": "bmc.kepler.AccountService.ManagerAccount",
"Source": {
"RoleId": "${Statements/Privilege()}"
},
"CallIf": {
"${Statements/UserExist()}": true
}
}
],
"Echoes": [
"ipmcset/user_privilege",
""
]
}
]
},
{
"Uri": "/cli/v1/user/sshpasswordauthentication",
"Interfaces": [
{
"Type": "Patch",
"Description": "Set SSH password authentication state",
"Usage": "ipmcset -d sshpasswordauthentication -v <enabled|disabled>",
"ReqBody": {
"Type": "object",
"Required": true,
"Properties": {
"state": {
"Type": "string",
"Required": true,
"Validator": [
{
"Type": "Enum",
"Formula": [
"enabled",
"disabled"
]
}
]
}
}
},
"Statements": {
"GetState": {
"Input": "${ReqBody/state}",
"Steps": [
{
"Type": "Switch",
"Formula": [
{
"Case": "enabled",
"To": true
},
{
"Case": "disabled",
"To": false
}
]
}
]
}
},
"ProcessingFlow": [
{
"Type": "Property",
"Path": "/bmc/kepler/Managers/1/NetworkProtocol/SSH",
"Interface": "bmc.kepler.Managers.NetworkProtocol.SSH",
"Source": {
"PasswordAuthEnabled": "${Statements/GetState()}"
}
}
],
"Echoes": [
"ipmcset/user_sshpasswordauthentication",
""
]
}
]
},
{
"Uri": "/cli/v1/user/state",
"Interfaces": [
{
"Type": "Patch",
"Usage": "ipmcset -t user -d state -v <username> [enabled|disabled]",
"Description": "Enable/Disable user",
"Authentication": {
"Description": "You need to log in again after modifying your attributes.\n Input your password:",
"Condition": true
},
"ReqBody": {
"Type": "object",
"Required": true,
"Properties": {
"username": {
"Type": "string",
"Required": true,
"Validator": [
{
"Type": "Regex",
"Formula": "^(?!.*[<>&,'/\\%:\" ])(?=[A-Za-z0-9`~!@#$%^&*()_+-={};[\\]?.|])(?!#)(?!\\+)(?!-)([A-Za-z0-9`~!@#$%^&*()_+-={};[\\]?.|]{1,16})$"
}
],
"Description": "\n Contain any digits, letters, or characters except (:,\\<>&\"'/%) and space.\n User name's length is limitted to 1-16.\n User name cannot start with character \"#\" \"+\" or \"-\".\r\n User name cannot be just a dot (.) or two consecutive dots (..).\r\n"
},
"state": {
"Required": true,
"Type": "string",
"Validator": [
{
"Type": "Enum",
"Formula": [
"enabled",
"disabled"
]
}
]
}
}
},
"Statements": {
"state_bool": {
"Input": "${ReqBody/state}",
"Steps": [
{
"Type": "Switch",
"Formula": [
{
"Case": "enabled",
"To": true
},
{
"Case": "disabled",
"To": false
}
]
}
]
},
"state_str": {
"Input": "${ReqBody/state}",
"Steps": [
{
"Type": "Switch",
"Formula": [
{
"Case": "enabled",
"To": "Enable"
},
{
"Case": "disabled",
"To": "Disable"
}
]
}
]
},
"is_allow_operate": {
"Steps": [
{
"Type": "Plugin",
"Formula": "orchestrator.account.is_allow_operate(ProcessingFlow[1].Destination.Id, ReqBody.username, true)"
}
]
}
},
"RspBody": {
"State": "${Statements/state_str()}",
"UserName": "${ReqBody/username}"
},
"ProcessingFlow": [
{
"Type": "Method",
"Path": "/bmc/kepler/AccountService/Accounts",
"Interface": "bmc.kepler.AccountService.ManagerAccounts",
"Name": "GetIdByUserName",
"Params": [
"${ReqBody/username}"
],
"Destination": {
"AccountId": "Id"
}
},
{
"Type": "Property",
"Path": "/bmc/kepler/AccountService/Accounts/${ProcessingFlow[1]/Destination/Id}",
"Interface": "bmc.kepler.AccountService.ManagerAccount",
"Source": {
"Enabled": "${Statements/state_bool()}"
},
"CallIf": {
"${ProcessingFlow[1]/Destination/Id}": "#WITH",
"${Statements/is_allow_operate()}": true
}
}
],
"Echoes": [
"ipmcset/user_state",
""
]
}
]
},
{
"Uri": "/cli/v1/user/passwordcomplexity",
"Interfaces": [
{
"Type": "Patch",
"Description": "Set password complexity check enable state",
"Usage": "ipmcset -t user -d passwordcomplexity -v <state>",
"Confirm": {
"Condition": "${Statements/condition()}",
"Description": "WARNING: Disabling the complexity checking function may reduce the system security.\nDo you want to continue?[Y/N]:"
},
"ReqBody": {
"Type": "object",
"Required": true,
"Properties": {
"option": {
"Type": "string",
"Required": true,
"Validator": [
{
"Type": "Enum",
"Formula": [
"enabled",
"disabled"
]
}
]
}
}
},
"RspBody": {
"option": "${ReqBody/option}"
},
"Statements": {
"option": {
"Input": "${ReqBody/option}",
"Steps": [
{
"Type": "Switch",
"Formula": [
{
"Case": "enabled",
"To": true
},
{
"Case": "disabled",
"To": false
}
]
}
]
},
"condition": {
"Input": "${ReqBody/option}",
"Steps": [
{
"Type": "Switch",
"Formula": [
{
"Case": "disabled",
"To": true
},
{
"To": false
}
]
}
]
}
},
"ProcessingFlow": [
{
"Type": "Property",
"Path": "/bmc/kepler/AccountService",
"Interface": "bmc.kepler.AccountService",
"Source": {
"PasswordComplexityEnable": "${Statements/option()}"
}
}
],
"Echoes": [
"ipmcset/user_passwordcomplexity",
""
]
}
]
},
{
"Uri": "/cli/v1/_/passwordcomplexity",
"Interfaces": [
{
"Type": "Patch",
"Description": "Set password complexity check enable state",
"Usage": "ipmcset -d passwordcomplexity -v <enabled|disabled>",
"Confirm": {
"Condition": "${Statements/condition()}",
"Description": "WARNING: Disabling the complexity checking function may reduce the system security.\nDo you want to continue?[Y/N]:"
},
"ReqBody": {
"Type": "object",
"Required": true,
"Properties": {
"option": {
"Type": "string",
"Required": true,
"Validator": [
{
"Type": "Enum",
"Formula": [
"enabled",
"disabled"
]
}
]
}
}
},
"RspBody": {
"option": "${ReqBody/option}"
},
"Statements": {
"option": {
"Input": "${ReqBody/option}",
"Steps": [
{
"Type": "Switch",
"Formula": [
{
"Case": "enabled",
"To": true
},
{
"Case": "disabled",
"To": false
}
]
}
]
},
"condition": {
"Input": "${ReqBody/option}",
"Steps": [
{
"Type": "Switch",
"Formula": [
{
"Case": "disabled",
"To": true
},
{
"To": false
}
]
}
]
}
},
"ProcessingFlow": [
{
"Type": "Property",
"Path": "/bmc/kepler/AccountService",
"Interface": "bmc.kepler.AccountService",
"Source": {
"PasswordComplexityEnable": "${Statements/option()}"
}
}
],
"Echoes": [
"ipmcset/user_passwordcomplexity",
""
]
}
]
},
{
"Uri": "/cli/v1/user/unlock",
"Interfaces": [
{
"Type": "Patch",
"Description": "Set user unlock state",
"Usage": "ipmcset -t user -d unlock -v <username>",
"Authentication": {
"Description": "Input your password:",
"Condition": true
},
"ReqBody": {
"Type": "object",
"Required": true,
"Properties": {
"username": {
"Type": "string",
"Required": true,
"Validator": [
{
"Type": "Regex",
"Formula": "^(?!.*[<>&,'/\\%:\" ])(?=[A-Za-z0-9`~!@#$%^&*()_+-={};[\\]?.|])(?!#)(?!\\+)(?!-)([A-Za-z0-9`~!@#$%^&*()_+-={};[\\]?.|]{1,16})$"
}
],
"Description": "\n Contain any digits, letters, or characters except (:,\\<>&\"'/%) and space.\n User name's length is limitted to 1-16.\n User name cannot start with character \"#\" \"+\" or \"-\".\r\n User name cannot be just a dot (.) or two consecutive dots (..).\r\n"
}
}
},
"RspBody": {
"username": "${ReqBody/username}"
},
"Statements": {
"UserExist": {
"Steps": [
{
"Type": "Plugin",
"Formula": "orchestrator.account.is_allow_operate(ProcessingFlow[1].Destination.AccountId, ReqBody.username, true)"
}
]
}
},
"ProcessingFlow": [
{
"Type": "Method",
"Path": "/bmc/kepler/AccountService/Accounts",
"Interface": "bmc.kepler.AccountService.ManagerAccounts",
"Name": "GetIdByUserName",
"Params": [
"${ReqBody/username}"
],
"Destination": {
"AccountId": "AccountId"
}
},
{
"Type": "Method",
"Path": "/bmc/kepler/AccountService/Accounts",
"Interface": "bmc.kepler.AccountService.ManagerAccounts",
"Name": "SetAccountLockState",
"Params": [
"${ProcessingFlow[1]/Destination/AccountId}",
false
],
"CallIf": {
"${Statements/UserExist()}": true
}
}
],
"Echoes": [
"ipmcset/user_unlock",
""
]
}
]
},
{
"Uri": "/cli/v1/user/osadminprivilege",
"Interfaces": [
{
"Type": "Patch",
"Description": "Set the host side administrator privilege enable status",
"Usage": "ipmcset -t user -d osadminprivilege -v <option>",
"ReqBody": {
"Type": "object",
"Required": true,
"Properties": {
"option": {
"Required": true,
"Type": "integer",
"Description": "\n 0 Disable execution of administrator-only commands on the host side\n 1 Enable execution of administrator-only commands on the host side",
"Validator": [
{
"Type": "Enum",
"Formula": [
0,
1
]
}
]
}
}
},
"RspBody": {
"option": "${ReqBody/option}"
},
"Statements": {
"GetOption": {
"Input": "${ReqBody/option}",
"Steps": [
{
"Type": "Switch",
"Formula": [
{
"Case": 0,
"To": false
},
{
"Case": 1,
"To": true
}
]
}
]
}
},
"ProcessingFlow": [
{
"Type": "Property",
"Path": "/bmc/kepler/AccountService",
"Interface": "bmc.kepler.AccountService",
"Source": {
"OSAdministratorPrivilegeEnabled": "${Statements/GetOption()}"
}
}
],
"Echoes": [
"ipmcset/user_osadminprivilege",
""
]
}
]
},
{
"Uri": "/cli/v1/user/usermgmtbyhost",
"Interfaces": [
{
"Type": "Patch",
"Description": "Set user management function on the host side",
"Usage": "ipmcset -t user -d usermgmtbyhost -v <option>",
"ReqBody": {
"Type": "object",
"Required": true,
"Properties": {
"option": {
"Required": true,
"Type": "integer",
"Description": "\n 0 Disable the BMC user management function on the host side\n 1 Enable the BMC user management function on the host side",
"Validator": [
{
"Type": "Enum",
"Formula": [
0,
1
]
}
]
}
}
},
"RspBody": {
"option": "${ReqBody/option}"
},
"Statements": {
"GetOption": {
"Input": "${ReqBody/option}",
"Steps": [
{
"Type": "Switch",
"Formula": [
{
"Case": 0,
"To": false
},
{
"Case": 1,
"To": true
}
]
}
]
}
},
"ProcessingFlow": [
{
"Type": "Property",
"Path": "/bmc/kepler/AccountService",
"Interface": "bmc.kepler.AccountService",
"Source": {
"HostUserManagementEnabled": "${Statements/GetOption()}"
}
}
],
"Echoes": [
"ipmcset/user_usermgmtbyhost",
""
]
}
]
},
{
"Uri": "/cli/v1/user/weakpwddic",
"Interfaces": [
{
"Type": "Patch",
"Description": "Manage weak password dictionary",
"Usage": "ipmcset -t user -d weakpwddic -v <option> [localpath/URL]",
"Example": [
"ipmcset -t user -d weakpwddic -v enabled",
"ipmcset -t user -d weakpwddic -v disabled",
"ipmcset -t user -d weakpwddic -v import UrlAddress",
"ipmcset -t user -d weakpwddic -v export UrlAddress"
],
"ReqBody": {
"Type": "object",
"Required": true,
"Properties": {
"option": {
"Description": "\n enabled Enable weak password dictionary check.\n disabled Disable weak password dictionary check.\n import <localpath/URL> Import weak password dictionary.\n export [localpath/URL] Export weak password dictionary.\nLocalpath e.g.:/tmp/weakdictionary\nURL :protocol://[username:password@]IP[:port]/directory/filename\n The parameters in the URL are described as follows:\n The protocol must be https,sftp,cifs,scp or nfs.\n The URL can contain only letters, digits, and special characters. The directory or file name cannot contain @.\n Use double quotation marks (\") to enclose the URL that contains a space or double quotation marks (\"). Escape the double quotation marks (\") and back slash (\\) contained in the URL.\n For example, if you want to enter:\n a b\\cd\"\n Enter:\n \"a b\\\\cd\\\"\"",
"Validator": [
{
"Type": "Enum",
"Formula": [
"enabled",
"disabled",
"import",
"export"
]
}
],
"Required": true
},
"value": {
"Validator": [
{
"Type": "Regex",
"Formula": "^((https|sftp|nfs|cifs|scp)://.{1,1000}|/tmp/.{1,246})$"
}
],
"Sensitive": true,
"Required": false
}
}
},
"RspBody": {
"Option": "${ReqBody/option}",
"IsLocalFile": "${Statements/IsLocalFile()}"
},
"Statements": {
"value": {
"Input": "${ReqBody/option}",
"Steps": [
{
"Type": "Switch",
"Formula": [
{
"Case": "enabled",
"To": true
},
{
"Case": "disabled",
"To": false
}
]
}
]
},
"GetPath": {
"Steps": [
{
"Type": "Script",
"Formula": "return ReqBody.value or ''"
}
]
},
"IsLocalFile": {
"Steps": [
{
"Type": "Script",
"Formula": "if not ReqBody.value then return true end return string.sub(ReqBody.value, 1, 1) == '/'"
}
]
},
"IsImportActionPermitted": {
"Input": "${Statements/GetPath()}",
"Steps": [
{
"Type": "Plugin",
"Formula": "orchestrator.utils.is_import_permitted('URI', Input, 'weakpwddic', 'Import Path', ProcessingFlow[3].Destination.Result)"
}
]
}
},
"ProcessingFlow": [
{
"Type": "Property",
"Path": "/bmc/kepler/AccountService",
"Interface": "bmc.kepler.AccountService",
"CallIf": {
"${ReqBody/option}": "enabled",
"${ReqBody/value}": "#WITHOUT"
},
"Source": {
"WeakPasswordDictionaryEnabled": "${Statements/value()}"
}
},
{
"Type": "Property",
"Path": "/bmc/kepler/AccountService",
"Interface": "bmc.kepler.AccountService",
"CallIf": {
"${ReqBody/option}": "disabled",
"${ReqBody/value}": "#WITHOUT"
},
"Source": {
"WeakPasswordDictionaryEnabled": "${Statements/value()}"
}
},
{
"Type": "Method",
"Path": "/bmc/kepler/Managers/1/Security/File",
"Interface": "bmc.kepler.Managers.Security.File",
"Name": "IsPermitted",
"Params": [
"${Statements/GetPath()}",
"rw"
],
"Destination": {
"Result": "Result"
},
"CallIf": {
"${ReqBody/option}": "import",
"${Statements/IsLocalFile()}": true
}
},
{
"Type": "Method",
"Path": "/bmc/kepler/AccountService",
"Interface": "bmc.kepler.AccountService",
"Name": "ImportWeakPasswordDictionary",
"Params": [
"${Statements/GetPath()}"
],
"CallIf": {
"${ReqBody/option}": "import",
"${Statements/IsLocalFile()}": true,
"${Statements/IsImportActionPermitted()}": true
}
},
{
"Type": "Method",
"Path": "/bmc/kepler/AccountService",
"Interface": "bmc.kepler.AccountService",
"Name": "ExportWeakPasswordDictionary",
"Params": [
"${Statements/GetPath()}"
],
"CallIf": {
"${ReqBody/option}": "export",
"${Statements/IsLocalFile()}": true
}
},
{
"Type": "Task",
"Path": "/bmc/kepler/AccountService",
"Interface": "bmc.kepler.AccountService",
"Name": "ImportWeakPasswordDictionary",
"Params": [
"${ReqBody/value}"
],
"Destination": {
"TaskId": "TaskId"
},
"CallIf": {
"${ReqBody/option}": "import",
"${Statements/IsLocalFile()}": false
}
},
{
"Type": "Task",
"Path": "/bmc/kepler/AccountService",
"Interface": "bmc.kepler.AccountService",
"Name": "ExportWeakPasswordDictionary",
"Params": [
"${ReqBody/value}"
],
"Destination": {
"TaskId": "TaskId"
},
"CallIf": {
"${ReqBody/option}": "export",
"${Statements/IsLocalFile()}": false
}
},
{
"Type": "Method",
"Path": "/bmc/kepler/Managers/1/Security/File",
"Interface": "bmc.kepler.Managers.Security.File",
"Name": "ChangeOwner",
"Params": [
"${ReqBody/value}"
],
"CallIf": {
"${ReqBody/option}": "export"
}
}
],
"Echoes": [
"ipmcset/user_weakpwddic",
""
]
}
]
},
{
"Uri": "/cli/v1/user/interface",
"Interfaces": [
{
"Type": "Patch",
"Description": "Set user login interface",
"Usage": "ipmcset -t user -d interface -v <username> <enabled/disabled> <option1 option2 ...>\nOptions are:\n\t1 Web\n\t2 SNMP\n\t3 IPMI\n\t4 SSH\n\t5 SFTP\n\t7 Local\n\t8 Redfish",
"Authentication": {
"Description": "You need to log in again after modifying your attributes.\n Input your password:",
"Condition": true
},
"ReqBody": {
"Type": "object",
"Required": true,
"Properties": {
"username": {
"Type": "string",
"Required": true,
"Validator": [
{
"Type": "Regex",
"Formula": "^(?!.*[<>&,'/\\%:\" ])(?=[A-Za-z0-9`~!@#$%^&*()_+-={};[\\]?.|])(?!#)(?!\\+)(?!-)([A-Za-z0-9`~!@#$%^&*()_+-={};[\\]?.|]{1,16})$"
}
],
"Description": "\n Contain any digits, letters, or characters except (:,\\<>&\"'/%) and space.\n User name's length is limitted to 1-16.\n User name cannot start with character \"#\" \"+\" or \"-\".\r\n User name cannot be just a dot (.) or two consecutive dots (..).\r\n"
},
"enabled": {
"Required": true,
"Validator": [
{
"Type": "Enum",
"Formula": [
"enabled",
"disabled"
]
}
]
},
"option1": {
"Required": true,
"Type": "integer",
"Validator": [
{
"Type": "Enum",
"Formula": [
1,
2,
3,
4,
5,
7,
8
]
}
]
},
"option2": {
"Required": false,
"Type": "integer",
"Validator": [
{
"Type": "Enum",
"Formula": [
1,
2,
3,
4,
5,
7,
8
]
}
]
},
"option3": {
"Required": false,
"Type": "integer",
"Validator": [
{
"Type": "Enum",
"Formula": [
1,
2,
3,
4,
5,
7,
8
]
}
]
},
"option4": {
"Required": false,
"Type": "integer",
"Validator": [
{
"Type": "Enum",
"Formula": [
1,
2,
3,
4,
5,
7,
8
]
}
]
},
"option5": {
"Required": false,
"Type": "integer",
"Validator": [
{
"Type": "Enum",
"Formula": [
1,
2,
3,
4,
5,
7,
8
]
}
]
},
"option6": {
"Required": false,
"Type": "integer",
"Validator": [
{
"Type": "Enum",
"Formula": [
1,
2,
3,
4,
5,
7,
8
]
}
]
},
"option7": {
"Required": false,
"Type": "integer",
"Validator": [
{
"Type": "Enum",
"Formula": [
1,
2,
3,
4,
5,
7,
8
]
}
]
}
}
},
"RspBody": {
"UserName": "${ReqBody/username}",
"PwdValid": "${Statements/ResetPwd()}",
"GetUserExist": "${Statements/UserExistNoError()}",
"GetLoginInterfaces": "${Statements/GetLoginInterfaces()}"
},
"Statements": {
"GetLoginInterfaces": {
"Steps": [
{
"Type": "Script",
"Formula": "get_login_interfaces.lua"
}
]
},
"UserExist": {
"Steps": [
{
"Type": "Plugin",
"Formula": "orchestrator.account.is_allow_operate(ProcessingFlow[1].Destination.AccountId, ReqBody.username, true)"
}
]
},
"UserExistNoError": {
"Steps": [
{
"Type": "Plugin",
"Formula": "orchestrator.account.is_allow_operate(ProcessingFlow[1].Destination.AccountId, ReqBody.username, false)"
}
]
},
"ResetPwd": {
"Input": "${Statements/GetLoginInterfaces()[1]}",
"Steps": [
{
"Type": "Plugin",
"Formula": "orchestrator.account.reset_pwd(Input, ReqBody.username)"
}
]
}
},
"ProcessingFlow": [
{
"Type": "Method",
"Path": "/bmc/kepler/AccountService/Accounts",
"Interface": "bmc.kepler.AccountService.ManagerAccounts",
"Name": "GetIdByUserName",
"Params": [
"${ReqBody/username}"
],
"Destination": {
"AccountId": "AccountId"
}
},
{
"Type": "Property",
"Path": "/bmc/kepler/AccountService/Accounts/${ProcessingFlow[1]/Destination/AccountId}",
"Interface": "bmc.kepler.AccountService.ManagerAccount",
"Destination": {
"LoginInterface": "LoginInterface"
},
"CallIf": {
"${Statements/UserExist()}": true
}
},
{
"Type": "Method",
"Path": "/bmc/kepler/AccountService/Accounts/${ProcessingFlow[1]/Destination/AccountId}",
"Interface": "bmc.kepler.AccountService.ManagerAccount",
"Name": "ChangePwd",
"Params": [
"${Statements/ResetPwd()[2]}"
],
"CallIf": {
"${Statements/UserExistNoError()}": true,
"${Statements/GetLoginInterfaces()[1]}": true,
"${Statements/ResetPwd()[1]}": 0
}
},
{
"Type": "Property",
"Path": "/bmc/kepler/AccountService/Accounts/${ProcessingFlow[1]/Destination/AccountId}",
"Interface": "bmc.kepler.AccountService.ManagerAccount",
"Source": {
"LoginInterface": "${Statements/GetLoginInterfaces()[2]}"
},
"CallIf": {
"${Statements/UserExistNoError()}": true,
"${Statements/ResetPwd()[1]}": 0
}
}
],
"Echoes": [
"ipmcset/user_interface"
]
}
]
},
{
"Uri": "/cli/v1/user/snmpprivacypassword",
"Interfaces": [
{
"Type": "Patch",
"Description": "Set snmp privacy password",
"Usage": "ipmcset -t user -d snmpprivacypassword -v <username>",
"Authentication": {
"Description": "Input your password:",
"Condition": true
},
"ReqBody": {
"Type": "object",
"Required": true,
"Properties": {
"username": {
"Type": "string",
"Required": true,
"Validator": [
{
"Type": "Regex",
"Formula": "^(?!.*[<>&,'/\\%:\" ])(?=[A-Za-z0-9`~!@#$%^&*()_+-={};[\\]?.|])(?!#)(?!\\+)(?!-)([A-Za-z0-9`~!@#$%^&*()_+-={};[\\]?.|]{1,16})$"
}
],
"Description": "\n Contain any digits, letters, or characters except (:,\\<>&\"'/%) and space.\n User name's length is limitted to 1-16.\n User name cannot start with character \"#\" \"+\" or \"-\".\r\n User name cannot be just a dot (.) or two consecutive dots (..).\r\n"
}
}
},
"RspBody": {
"uasername": "${ReqBody/username}",
"GetUserExist": "${Statements/UserExist()}",
"GetPwd": "${Statements/GetPwd()}"
},
"Statements": {
"UserExist": {
"Steps": [
{
"Type": "Plugin",
"Formula": "orchestrator.account.is_allow_operate(ProcessingFlow[1].Destination.AccountId, ReqBody.username, true)"
}
]
},
"GetPwd": {
"Steps": [
{
"Type": "Plugin",
"Formula": "orchestrator.account.get_pwd()"
}
]
}
},
"ProcessingFlow": [
{
"Type": "Method",
"Path": "/bmc/kepler/AccountService/Accounts",
"Interface": "bmc.kepler.AccountService.ManagerAccounts",
"Name": "GetIdByUserName",
"Params": [
"${ReqBody/username}"
],
"Destination": {
"AccountId": "AccountId"
}
},
{
"Type": "Method",
"Path": "/bmc/kepler/AccountService/Accounts/${ProcessingFlow[1]/Destination/AccountId}",
"Interface": "bmc.kepler.AccountService.ManagerAccount",
"Name": "ChangeSnmpPwd",
"Params": [
"${Statements/GetPwd()[2]}"
],
"CallIf": {
"${Statements/UserExist()}": true,
"${Statements/GetPwd()[1]}": 0
}
}
],
"Echoes": [
"ipmcset/user_snmpprivacypassword"
]
}
]
},
{
"Uri": "/cli/v1/user/passwordrulepolicy",
"Interfaces": [
{
"Type": "Patch",
"Description": "Set the password complexity check mode",
"Usage": "ipmcset -t user -d passwordrulepolicy -v <AccountType> <Policy>",
"ReqBody": {
"Type": "object",
"Required": true,
"Properties": {
"AccountType": {
"Type": "integer",
"Required": true,
"Validator": [
{
"Type": "Enum",
"Formula": [
0,
1,
2
]
}
],
"Description": "\n 0 Local Account.\n 1 Snmp Community.\n 2 VNC."
},
"Policy": {
"Type": "string",
"Required": true,
"Validator": [
{
"Type": "Enum",
"Formula": [
"Default",
"Customized",
"Hybrid"
]
}
],
"Description": "\n Default Use default password complexity to check password.\n Customized Use customized regex pattern to check password.\n Hybrid Use default password complexity and customized regex pattern to check password."
}
}
},
"RspBody": {
"PasswordRulePolicy": "${ReqBody/Policy}"
},
"Statements": {
"GetPath": {
"Input": "${ReqBody/AccountType}",
"Steps": [
{
"Type": "Switch",
"Formula": [
{
"Case": 0,
"To": "Local"
},
{
"Case": 1,
"To": "SnmpCommunity"
},
{
"Case": 2,
"To": "VNC"
}
]
},
{
"Type": "Script",
"Formula": "return '/bmc/kepler/AccountService/PasswordPolicys/' .. Input"
}
]
},
"ParseRulePolicy": {
"Input": "${ReqBody/Policy}",
"Steps": [
{
"Type": "Switch",
"Formula": [
{
"Case": "Default",
"To": 1
},
{
"Case": "Customized",
"To": 2
},
{
"Case": "Hybrid",
"To": 3
},
{
"To": null
}
]
}
]
}
},
"ProcessingFlow": [
{
"Type": "Property",
"Path": "${Statements/GetPath()}",
"Interface": "bmc.kepler.AccountService.PasswordPolicy",
"Source": {
"Policy": "${Statements/ParseRulePolicy()}"
}
}
],
"Echoes": [
"ipmcset/user_passwordrulepolicy",
""
]
}
]
},
{
"Uri": "/cli/v1/user/passwordpattern",
"Interfaces": [
{
"Type": "Patch",
"Description": "Set the regular expression for checking password complexity",
"Usage": "ipmcset -t user -d passwordpattern -v <AccountType> <Pattern>",
"ReqBody": {
"Type": "object",
"Required": true,
"Properties": {
"AccountType": {
"Type": "integer",
"Required": true,
"Validator": [
{
"Type": "Enum",
"Formula": [
0,
1,
2
]
}
],
"Description": "\n 0 Local Account.\n 1 Snmp Community.\n 2 VNC."
},
"Pattern": {
"Type": "string",
"Required": true,
"Validator": [
{
"Type": "Length",
"Formula": [
0,
255
]
}
],
"Description": "\n Regular expression for checking password complexity."
}
}
},
"RspBody": {
"PasswordPattern": "${ReqBody/Pattern}"
},
"Statements": {
"GetPath": {
"Input": "${ReqBody/AccountType}",
"Steps": [
{
"Type": "Switch",
"Formula": [
{
"Case": 0,
"To": "Local"
},
{
"Case": 1,
"To": "SnmpCommunity"
},
{
"Case": 2,
"To": "VNC"
}
]
},
{
"Type": "Script",
"Formula": "return '/bmc/kepler/AccountService/PasswordPolicys/' .. Input"
}
]
}
},
"ProcessingFlow": [
{
"Type": "Property",
"Path": "${Statements/GetPath()}",
"Interface": "bmc.kepler.AccountService.PasswordPolicy",
"Source": {
"Pattern": "${ReqBody/Pattern}"
}
}
],
"Echoes": [
"ipmcset/user_passwordpattern",
""
]
}
]
}
]
}