Skip to content

Commit a1c2a33

Browse files
Fixes #698: Add render config to virtualization model (#702)
* Update virtualization.py feat: add render-config capability to virtual machines * Update example --------- Co-authored-by: mike-715 <168500849+mike-715@users.noreply.github.com> Co-authored-by: Jason Novinger <jnovinger@gmail.com>
1 parent 97f1e8b commit a1c2a33

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

pynetbox/models/virtualization.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
limitations under the License.
1515
"""
1616

17+
from pynetbox.core.endpoint import DetailEndpoint
1718
from pynetbox.core.response import JsonField, Record
1819
from pynetbox.models.ipam import IpAddresses
1920

@@ -23,3 +24,20 @@ class VirtualMachines(Record):
2324
primary_ip4 = IpAddresses
2425
primary_ip6 = IpAddresses
2526
config_context = JsonField
27+
28+
@property
29+
def render_config(self):
30+
"""
31+
Represents the ``render-config`` detail endpoint.
32+
33+
Returns a DetailEndpoint object that is the interface for
34+
viewing response from the render-config endpoint.
35+
36+
:returns: :py:class:`.DetailEndpoint`
37+
38+
:Examples:
39+
40+
>>> vm = nb.virtualization.virtual_machines.get(123)
41+
>>> vm.render_config.create()
42+
"""
43+
return DetailEndpoint(self, "render-config")

0 commit comments

Comments
 (0)