]> granicus.if.org Git - icinga2/commitdiff
Set zone attribute to no_user_modify for API POST requests
authorMichael Friedrich <michael.friedrich@icinga.com>
Wed, 12 Apr 2017 07:25:28 +0000 (09:25 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Wed, 12 Apr 2017 07:25:28 +0000 (09:25 +0200)
fixes #5166

doc/12-icinga2-api.md
lib/base/configobject.ti

index c35b02fb2bbe03f874fc307746ebdf59834a4ffb..481ae809bfec35a442d5f64f169def0c0a1adb59 100644 (file)
@@ -623,12 +623,16 @@ parameters need to be passed inside the JSON body:
 
 In addition to these parameters a [filter](12-icinga2-api.md#icinga2-api-filters) should be provided.
 
-**Note**: Modified attributes do not trigger a re-evaluation of existing
-static [apply rules](3-monitoring-basics.md#using-apply) and [group assignments](3-monitoring-basics.md#group-assign-intro).
-Delete and re-create the objects if you require such changes.
-Furthermore you cannot modify templates which have already been resolved
-during [object creation](12-icinga2-api.md#icinga2-api-config-objects-create).
-
+> **Note**:
+>
+> Modified attributes do not trigger a re-evaluation of existing
+> static [apply rules](3-monitoring-basics.md#using-apply) and [group assignments](3-monitoring-basics.md#group-assign-intro).
+> Delete and re-create the objects if you require such changes.
+>
+> Furthermore you cannot modify templates which have already been resolved
+> during [object creation](12-icinga2-api.md#icinga2-api-config-objects-create).
+> There are attributes which can only be set for [PUT requests](12-icinga2-api.md#icinga2-api-config-objects-create) such as `groups`
+> or `zone`. A complete list of `no_user_modify` attributes can be fetched from the [types](12-icinga2-api.md#icinga2-api-types) URL endpoint.
 
 If attributes are of the Dictionary type, you can also use the indexer format:
 
index 950dcdef2fca606adb0970009fc76a4dacb55c8a..a9892417fee63595ff43eec7d08e5cfa93b346aa 100644 (file)
@@ -82,7 +82,7 @@ abstract class ConfigObject : ConfigObjectBase < ConfigType
                                return m_ShortName;
                }}}
        };
-       [config] name(Zone) zone (ZoneName);
+       [config, no_user_modify] name(Zone) zone (ZoneName);
        [config, no_user_modify] String package;
        [config, get_protected, no_user_modify] Array::Ptr templates;
        [get_protected, no_user_modify] bool active;