Extras¶
Replace Role Related Models with Generic Role Model¶
- Narrowly defined role models including
dcim.DeviceRole
,dcim.RackRole
andipam.Role
are replaced by a genericextras.Role
model. - If any of your models are using the replaced role models, it is required for you to remove the
role
field from your model and add eithernautobot.extras.models.roles.RoleModelMixin
ornautobot.extras.models.roles.RoleRequiredRoleModelMixin
to your model class definition.RoleModelMixin
adds a nullablerole
field whereasRoleRequiredRoleModelMixin
adds a requiredrole
field. - Please go here to check out how the
extras.Role
model works in v2.0.
Updates to Job and Job related models¶
Job Model Changes¶
See details about the fundamental changes to Job
Model here
Job Logging Changes¶
- Job logging is now handled by a logger off the Job itself and has a function for each level to send the message (info, warning, debug, etc).
JobResult.log
no longer accepts alogger
arg and app/job authors should transition to using the Job's logger methods instead of directly callingJobResult.log
.- There is no longer a
log_success
orlog_failure
function. Checkout the changes in detail here
JobResult Model Changes¶
JobResult
no longer needs a job_id
, user
, or obj_type
passed to it. It now needs a name
, task_name
, and a worker
. See here for details.
Update CustomField, ComputedField, and Relationship¶
- In accordance with the removal of
slug
field in Nautobot v2.0,CustomField
,ComputeField
andRelationship
'sslug
field is replaced by thekey
field which contains a GraphQL-safe string that is used exclusively in the API and GraphQL. - Removed
name
field fromCustomField
model and renamedname
field tolabel
onRelationship
model. - Their
label
fields are now used for display purposes only in the UI. - Please go to their respective documentations for more information CustomField, ComputedField, and Relationship.