MaintenanceModeState SetMaintenanceMode(MbId tMb, MaintenanceModeState tArg)
tMb. Moniker of opened repository connection.
tArg. Operation execution parameters.
The SetMaintenanceMode operation changes maintenance mode status in the repository.
To execute the operation in the tMb field specify moniker of opened repository connection, and in the tArg.active field specify set maintenance mode:
True. Maintenance mode is enabled.
False. Maintenance mode is not enabled.
The moniker can be obtained on executing the OpenMetabase operation.
The operation results in information about maintenance mode status: enabled or not enabled.
Below is the example of enabling maintenance mode in the repository. The request contains moniker of opened repository connection and determines whether maintenance mode should be enabled. The response contains information about maintenance mode status.
{
"SetMaintenanceMode" :
{
"tMb" :
{
"id" : "NEJOFNHNBNFGGOAEGABOLMDNHJDHEPEEHIDONAKOKJMGBMEK!M"
},
"tArg" :
{
"active" : "true"
}
}
}
{
"SetMaintenanceModeResult" :
{
"active" : "1"
}
}
public static MaintenanceModeState SetMaintenanceMode(string moniker, bool maintenanceMode)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tSet = new SetMaintenanceMode()
{
tArg = new MaintenanceModeState() { active = maintenanceMode },
tMb = new MbId() { id = moniker }
};
// Change maintenance mode status
var result = somClient.SetMaintenanceMode(tSet);
return result;
}
See also: