pub struct VirtualMachineMessage {
pub id: String,
pub argument: Option<Vec<VimAny>>,
pub text: Option<String>,
}Expand description
Message data which is intended to be displayed according to the locale of a client.
A VirtualMachineMessage contains both a formatted, localized version of the text and the data needed to perform localization in conjunction with localization catalogs.
Clients of the VIM API may use SessionManager.SessionManager.SetLocale to cause the server to emit localized VirtualMachineMessage.text, or may perform client-side localization based on message catalogs provided by the LocalizationManager.
Message variables are always integers, e.g. {1} and {2}, which are 1-based indexes into VirtualMachineMessage.argument.
- The corresponding argument may be a recursive lookup:
- VirtualMachineMessage.argument = [“button.cancel”, “msg.revert”]
- CATALOG(locmsg, VirtualMachineMessage.id) = “Select ‘{1}’ to {2}”
- CATALOG(locmsg, button.cancel) = “Cancel”
- CATALOG(locmsg, msg.revert) = “revert”
- ==> VirtualMachineMessage.text = “Select ‘Cancel’ to revert”
- If the recursive lookup fails, the argument is a plain string.
- VirtualMachineMessage.argument = [“127.0.0.1”]
- CATALOG(locmsg, VirtualMachineMessage.id) = “IP address is {1}”
- ==> VirtualMachineMessage.text “IP address is 127.0.0.1”
See also LocalizationManager.
§How to access
VirtualMachine::runtime.question?.message?[*]VirtualMachine::summary.runtime.question?.message?[*]HostSystem::query_host_connection_info().vm?[*].runtime.question?.message?[*]Datacenter::query_connection_info().vm?[*].runtime.question?.message?[*]Datacenter::query_connection_info_via_spec().vm?[*].runtime.question?.message?[*]EnvironmentBrowser::query_config_target().usb?[*].summary?.runtime.question?.message?[*]
Fields§
§id: StringA unique identifier for this particular message.
This field is a key for looking up format strings in the locmsg catalog.
argument: Option<Vec<VimAny>>Substitution arguments for variables in the localized message.
Substitution variables in the format string identified by VirtualMachineMessage.id are 1-based indexes into this array. Substitution variable {1} corresponds to argument[0], etc.
text: Option<String>Text in session locale.
Use SessionManager.SessionManager.SetLocale to change the session locale.