Os valores do tipo SysChoice são adicionados ao “sys_choice”, a entidade solicita os seguintes atributos para realizar um registro:

Mapeando a classe no arquivo de configuração:
{
"searchBy": [
"name",
"value"
],
"name": "sys_choice",
"fields": [
{
"type": "string",
"name": "element",
"mappingType": "Data",
"mappingName": null,
"isRequired": true,
"classReference": null
},
{
"type": "string",
"name": "name",
"mappingType": "Data",
"mappingName": null,
"isRequired": true,
"classReference": null
},
{
"type": "string",
"name": "value",
"mappingType": "Mapper",
"mappingName": null,
"isRequired": false,
"classReference": null
},
{
"type": "string",
"name": "label",
"mappingType": "Mapper",
"mappingName": null,
"isRequired": false,
"classReference": null
}
]
}
Para adicionar esses valores às nossas configurações, o “valor” e “rótulo” eles são os únicos que são retirados do dispositivo; Os outros atributos são registrados em “dataReference”,
{
"dataReference": [
{
"name": "OperatingSystemReferenced",
"fields": [
{
"value": "os",
"fieldCMDB": "lement",
"classDevice": [
"Laptop",
"Desktop"
]
},
{
"value": "cmdb_ci_computer",
"fieldCMDB": "name",
"classDevice": [
"Laptop",
"Desktop"
]
}
]
}
],
"mapper": [
{
"name": "OperatingSystemReferenced",
"fields": [
{
"fieldDevice": "operatingSystem",
"fieldCMDB": "os"
},
{
"fieldDevice": "operatingSystem",
"fieldCMDB": "label"
}
]
}
],
"classCMDB": [
{
"searchBy": [
"object_id"
],
"name": "cmdb_ci_computer",
"fields": [
{
"type": "string",
"name": "os",
"mappingType": "SysChoice",
"mappingName": "OperatingSystemReferenced",
"isRequired": false,
"classReference": "sys_choice"
}
]
}
]
}
Onde:
“fieldCMDB”: “nome”: o atributo “name” refere-se à classe à qual “sys_choice” estará relacionado
“fieldCMDB”: “elemento”: O atributo “elemento” assumirá o valor do campo ao qual se refere, porque o campo de referência é “OS” da classe “cmdb_ci_computer”, atribua seu valor como “os”

Exibir mapeamento de classe Ci ↪