@@ -61,21 +61,13 @@ class Meta:
61
61
"id" ,
62
62
"url" ,
63
63
"name" ,
64
- "group" ,
65
- "weight" ,
66
- "module_path" ,
67
- "class_name" ,
68
64
"display" ,
69
- "task_queues" ,
70
- "tags" ,
71
- "created" ,
72
- "last_updated" ,
73
65
)
74
66
75
67
76
68
class ScriptExecutionSerializer (NetBoxModelSerializer ):
77
69
url = serializers .HyperlinkedIdentityField (view_name = "plugins-api:netbox_script_manager-api:scriptexecution-detail" )
78
- script_instance = ScriptInstanceSerializer (read_only = True )
70
+ script_instance = NestedScriptInstanceSerializer (read_only = True )
79
71
80
72
class Meta :
81
73
model = ScriptExecution
@@ -94,9 +86,21 @@ class Meta:
94
86
)
95
87
96
88
89
+ class NestedScriptExecutionSerializer (NetBoxModelSerializer ):
90
+ url = serializers .HyperlinkedIdentityField (view_name = "plugins-api:netbox_script_manager-api:scriptexecution-detail" )
91
+
92
+ class Meta :
93
+ model = ScriptExecution
94
+ fields = (
95
+ "id" ,
96
+ "url" ,
97
+ "display" ,
98
+ "status" ,
99
+ )
100
+
101
+
97
102
class ScriptLogLineSerializer (NetBoxModelSerializer ):
98
103
url = serializers .HyperlinkedIdentityField (view_name = "plugins-api:netbox_script_manager-api:scriptlogline-detail" )
99
- script_execution = ScriptExecutionSerializer (read_only = True )
100
104
message_markdown = MarkdownField (source = "message" , read_only = True )
101
105
timestamp_formatted = FormattedDateTimeField (source = "timestamp" , read_only = True )
102
106
@@ -106,7 +110,6 @@ class Meta:
106
110
"id" ,
107
111
"url" ,
108
112
"display" ,
109
- "script_execution" ,
110
113
"level" ,
111
114
"message" ,
112
115
"message_markdown" ,
@@ -134,7 +137,7 @@ class Meta:
134
137
135
138
class ScriptArtifactSerializer (NetBoxModelSerializer ):
136
139
url = serializers .HyperlinkedIdentityField (view_name = "plugins-api:netbox_script_manager-api:scriptartifact-detail" )
137
- script_execution = ScriptExecutionSerializer (read_only = True )
140
+ script_execution = NestedScriptExecutionSerializer (read_only = True )
138
141
139
142
class Meta :
140
143
model = ScriptArtifact
0 commit comments