@@ -16,13 +16,53 @@ $ infrahubctl object [OPTIONS] COMMAND [ARGS]...
1616
1717** Commands** :
1818
19+ * ` get ` : Query and display Infrahub objects.
1920* ` create ` : Create a new object in Infrahub.
21+ * ` update ` : Update an existing object in Infrahub.
2022* ` delete ` : Delete an Infrahub object.
21- * ` get ` : Query and display Infrahub objects.
2223* ` load ` : Load one or multiple objects files into...
23- * ` update ` : Update an existing object in Infrahub.
2424* ` validate ` : Validate one or multiple objects files.
2525
26+ ## ` infrahubctl object get `
27+
28+ Query and display Infrahub objects.
29+
30+ When IDENTIFIER is omitted the command lists all objects of the given
31+ KIND. When IDENTIFIER is provided it displays a single object in
32+ detail view. Empty columns are hidden by default (use --all-columns).
33+
34+ Examples:
35+ infrahubctl object get InfraDevice
36+ infrahubctl object get InfraDevice spine01
37+ infrahubctl object get InfraDevice --filter name__ value=spine01
38+ infrahubctl object get InfraDevice --output json
39+ infrahubctl object get InfraDevice --output yaml > ; backup.yml
40+
41+ Exit codes: 0 = results found, 1 = error (including not found in detail
42+ mode), 80 = list query succeeded but returned zero objects.
43+
44+ ** Usage** :
45+
46+ ``` console
47+ $ infrahubctl object get [OPTIONS] KIND [IDENTIFIER]
48+ ```
49+
50+ ** Arguments** :
51+
52+ * ` KIND ` : Infrahub schema kind to query [ required]
53+ * ` [IDENTIFIER] ` : UUID, name, or HFID (use / for multi-part, for example: Cisco/NX-OS)
54+
55+ ** Options** :
56+
57+ * ` --filter TEXT ` : Filter in attr__ value=x format
58+ * ` -o, --output [table|json|csv|yaml] ` : Output format
59+ * ` -b, --branch TEXT ` : Target branch
60+ * ` --limit INTEGER ` : Maximum results
61+ * ` --offset INTEGER ` : Skip first N results
62+ * ` --all-columns ` : Show all columns including empty ones
63+ * ` --config-file TEXT ` : [ env var: INFRAHUBCTL_CONFIG; default: infrahubctl.toml]
64+ * ` --help ` : Show this message and exit.
65+
2666## ` infrahubctl object create `
2767
2868Create a new object in Infrahub.
@@ -53,21 +93,22 @@ $ infrahubctl object create [OPTIONS] KIND
5393* ` --config-file TEXT ` : [ env var: INFRAHUBCTL_CONFIG; default: infrahubctl.toml]
5494* ` --help ` : Show this message and exit.
5595
56- ## ` infrahubctl object delete `
96+ ## ` infrahubctl object update `
5797
58- Delete an Infrahub object.
98+ Update an existing object in Infrahub .
5999
60- Fetches the object by KIND and IDENTIFIER, then deletes it.
61- Unless --yes is provided, a confirmation prompt is shown first .
100+ Fetches the object by KIND and IDENTIFIER, applies the requested
101+ changes, and saves back to the server. Use --set or --file .
62102
63103Examples:
64- infrahubctl object delete InfraDevice spine01
65- infrahubctl object delete InfraDevice spine01 --yes
104+ infrahubctl object update InfraDevice spine01 --set status=active
105+ infrahubctl object update InfraDevice spine01 --set location=DC1
106+ infrahubctl object update InfraDevice spine01 --file updates.yml
66107
67108** Usage** :
68109
69110``` console
70- $ infrahubctl object delete [OPTIONS] KIND IDENTIFIER
111+ $ infrahubctl object update [OPTIONS] KIND IDENTIFIER
71112```
72113
73114** Arguments** :
@@ -77,48 +118,38 @@ $ infrahubctl object delete [OPTIONS] KIND IDENTIFIER
77118
78119** Options** :
79120
80- * ` -y, --yes ` : Skip confirmation prompt
121+ * ` --set TEXT ` : Field value in key=value format
122+ * ` -f, --file PATH ` : JSON or YAML file with update data
81123* ` -b, --branch TEXT ` : Target branch
82124* ` --config-file TEXT ` : [ env var: INFRAHUBCTL_CONFIG; default: infrahubctl.toml]
83125* ` --help ` : Show this message and exit.
84126
85- ## ` infrahubctl object get `
127+ ## ` infrahubctl object delete `
86128
87- Query and display Infrahub objects .
129+ Delete an Infrahub object .
88130
89- When IDENTIFIER is omitted the command lists all objects of the given
90- KIND. When IDENTIFIER is provided it displays a single object in
91- detail view. Empty columns are hidden by default (use --all-columns).
131+ Fetches the object by KIND and IDENTIFIER, then deletes it.
132+ Unless --yes is provided, a confirmation prompt is shown first.
92133
93134Examples:
94- infrahubctl object get InfraDevice
95- infrahubctl object get InfraDevice spine01
96- infrahubctl object get InfraDevice --filter name__ value=spine01
97- infrahubctl object get InfraDevice --output json
98- infrahubctl object get InfraDevice --output yaml > backup.yml
99-
100- Exit codes: 0 = results found, 1 = error (including not found in detail
101- mode), 80 = list query succeeded but returned zero objects.
135+ infrahubctl object delete InfraDevice spine01
136+ infrahubctl object delete InfraDevice spine01 --yes
102137
103138** Usage** :
104139
105140``` console
106- $ infrahubctl object get [OPTIONS] KIND [ IDENTIFIER]
141+ $ infrahubctl object delete [OPTIONS] KIND IDENTIFIER
107142```
108143
109144** Arguments** :
110145
111- * ` KIND ` : Infrahub schema kind to query [ required]
112- * ` [ IDENTIFIER] ` : UUID, name, or HFID (use / for multi-part, for example: Cisco/NX-OS)
146+ * ` KIND ` : Infrahub schema kind [ required]
147+ * ` IDENTIFIER ` : UUID, name, or HFID (use / for multi-part, for example: Cisco/NX-OS) [ required ]
113148
114149** Options** :
115150
116- * ` --filter TEXT ` : Filter in attr__ value=x format
117- * ` -o, --output [table|json|csv|yaml] ` : Output format
151+ * ` -y, --yes ` : Skip confirmation prompt
118152* ` -b, --branch TEXT ` : Target branch
119- * ` --limit INTEGER ` : Maximum results
120- * ` --offset INTEGER ` : Skip first N results
121- * ` --all-columns ` : Show all columns including empty ones
122153* ` --config-file TEXT ` : [ env var: INFRAHUBCTL_CONFIG; default: infrahubctl.toml]
123154* ` --help ` : Show this message and exit.
124155
@@ -143,37 +174,6 @@ $ infrahubctl object load [OPTIONS] PATHS...
143174* ` --config-file TEXT ` : [ env var: INFRAHUBCTL_CONFIG; default: infrahubctl.toml]
144175* ` --help ` : Show this message and exit.
145176
146- ## ` infrahubctl object update `
147-
148- Update an existing object in Infrahub.
149-
150- Fetches the object by KIND and IDENTIFIER, applies the requested
151- changes, and saves back to the server. Use --set or --file.
152-
153- Examples:
154- infrahubctl object update InfraDevice spine01 --set status=active
155- infrahubctl object update InfraDevice spine01 --set location=DC1
156- infrahubctl object update InfraDevice spine01 --file updates.yml
157-
158- ** Usage** :
159-
160- ``` console
161- $ infrahubctl object update [OPTIONS] KIND IDENTIFIER
162- ```
163-
164- ** Arguments** :
165-
166- * ` KIND ` : Infrahub schema kind [ required]
167- * ` IDENTIFIER ` : UUID, name, or HFID (use / for multi-part, for example: Cisco/NX-OS) [ required]
168-
169- ** Options** :
170-
171- * ` --set TEXT ` : Field value in key=value format
172- * ` -f, --file PATH ` : JSON or YAML file with update data
173- * ` -b, --branch TEXT ` : Target branch
174- * ` --config-file TEXT ` : [ env var: INFRAHUBCTL_CONFIG; default: infrahubctl.toml]
175- * ` --help ` : Show this message and exit.
176-
177177## ` infrahubctl object validate `
178178
179179Validate one or multiple objects files.
0 commit comments