[comment]: # aside: 1

[comment]: # ({ee4a2645-28092341})
# Oggetto macro utente

I seguenti oggetti sono direttamente correlati all'API `usermacro`.

[comment]: # ({/ee4a2645-28092341})

[comment]: # ({2f5f2156-e654cd12})
### Macro globale

L'oggetto macro globale ha le seguenti proprietà.

|Property|[Type](/manual/api/reference_commentary#data-types)|Description|
|--|--|------|
|globalmacroid|ID|ID della macro globale.<br><br>[Property behavior](/manual/api/reference_commentary#property-behavior):<br>- *sola lettura*<br>- *obbligatorio* per le operazioni di aggiornamento|
|macro|string|Stringa della macro.<br><br>[Property behavior](/manual/api/reference_commentary#property-behavior):<br>- *obbligatorio* per le operazioni di creazione|
|value|string|Valore della macro.<br><br>[Property behavior](/manual/api/reference_commentary#property-behavior):<br>- *solo scrittura* se `type` è impostato su "Secret macro"<br>- *obbligatorio* per le operazioni di creazione|
|type|integer|Tipo di macro.<br><br>Valori possibili:<br>0 - *(predefinito)* Text macro;<br>1 - Secret macro;<br>2 - Vault secret.|
|description|string|Descrizione della macro.|

[comment]: # ({/2f5f2156-e654cd12})

[comment]: # ({c73e8f15-5a3a9f9f})
### Macro host

L'oggetto macro dell'host definisce una macro disponibile su un host, host prototype o template. Ha le seguenti proprietà.

|Property|[Type](/manual/api/reference_commentary#data-types)|Description|
|--|--|------|
|hostmacroid|ID|ID della macro dell'host.<br><br>[Property behavior](/manual/api/reference_commentary#property-behavior):<br>- *read-only*<br>- *required* for update operations|
|hostid|ID|ID dell'host a cui appartiene la macro.<br><br>[Property behavior](/manual/api/reference_commentary#property-behavior):<br>- *constant*<br>- *required* for create operations|
|macro|string|Stringa della macro.<br><br>[Property behavior](/manual/api/reference_commentary#property-behavior):<br>- *required* for create operations|
|value|string|Valore della macro.<br><br>[Property behavior](/manual/api/reference_commentary#property-behavior):<br>- *write-only* if `type` is set to "Secret macro"<br>- *required* for create operations|
|type|integer|Tipo di macro.<br><br>Possible values:<br>0 - *(default)* Text macro;<br>1 - Secret macro;<br>2 - Vault secret.|
|description|string|Descrizione della macro.|
|automatic|integer|Definisce se la macro è controllata da una discovery rule.<br><br>Possible values:<br>0 - *(default)* Macro is managed by user;<br>1 - Macro is managed by discovery rule.<br><br>User is not allowed to create automatic macro.<br>To update automatic macro, it must be [converted to manual](/manual/api/reference/usermacro/update#change-macro-value-that-was-created-by-discovery-rule).|

[comment]: # ({/c73e8f15-5a3a9f9f})
