Skip to content

Commit

Permalink
Update connector to be compatible with Netbox v3.7
Browse files Browse the repository at this point in the history
Model has been regenerated to be compatible with Netbox v3.7 (2023-12-29).
Note that we drop compatibility for older versions of Netbox.
  • Loading branch information
matthieugouel committed Jun 24, 2024
1 parent 6aee22c commit 8313231
Show file tree
Hide file tree
Showing 153 changed files with 389 additions and 3,850 deletions.
2 changes: 1 addition & 1 deletion pkg/connector/netbox/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ func (db *database) getTags(contentTypeID uint) ([]model.ExtrasTaggeditem, error
tagsMapping := make([]model.ExtrasTaggeditem, 0)
err := db.pgdb.Model(&tagsMapping).Relation("Tag").Where("content_type_id = ?", contentTypeID).Select()
if err != nil {
return nil, fmt.Errorf("Select failed: %v", err)
return nil, fmt.Errorf("select failed: %v", err)
}

return tagsMapping, nil
Expand Down
36 changes: 21 additions & 15 deletions pkg/connector/netbox/model/circuits_circuit.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 20 additions & 16 deletions pkg/connector/netbox/model/circuits_circuittermination.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pkg/connector/netbox/model/circuits_circuittype.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 6 additions & 10 deletions pkg/connector/netbox/model/circuits_provider.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 19 additions & 18 deletions pkg/connector/netbox/model/dcim_cable.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions pkg/connector/netbox/model/dcim_cabletermination.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 29 additions & 26 deletions pkg/connector/netbox/model/dcim_device.gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,36 @@ const TableNameDcimDevice = "dcim_device"

// DcimDevice mapped from table <dcim_device>
type DcimDevice struct {
// Created time.Time `gorm:"column:created" json:"created"`
// LastUpdated time.Time `gorm:"column:last_updated" json:"last_updated"`
// CustomFieldData string `gorm:"column:custom_field_data;not null" json:"custom_field_data"`
ID int64 `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
//LocalContextData string `gorm:"column:local_context_data" json:"local_context_data"`
Name string `gorm:"column:name" json:"name"`
Serial string `gorm:"column:serial;not null" json:"serial"`
AssetTag string `gorm:"column:asset_tag" json:"asset_tag"`
Position int16 `gorm:"column:position" json:"position"`
// Face string `gorm:"column:face;not null" json:"face"`
Status string `gorm:"column:status;not null" json:"status"`
// VcPosition int16 `gorm:"column:vc_position" json:"vc_position"`
// VcPriority int16 `gorm:"column:vc_priority" json:"vc_priority"`
Comments string `gorm:"column:comments;not null" json:"comments"`
// ClusterID int64 `gorm:"column:cluster_id" json:"cluster_id"`
DeviceRoleID int64 `gorm:"column:device_role_id;not null" json:"device_role_id"`
DeviceTypeID int64 `gorm:"column:device_type_id;not null" json:"device_type_id"`
LocationID int64 `gorm:"column:location_id" json:"location_id"`
PlatformID int64 `gorm:"column:platform_id" json:"platform_id"`
PrimaryIp4ID int64 `gorm:"column:primary_ip4_id" json:"primary_ip4_id" sql:"primary_ip4_id"`
PrimaryIp6ID int64 `gorm:"column:primary_ip6_id" json:"primary_ip6_id" sql:"primary_ip6_id"`
RackID int64 `gorm:"column:rack_id" json:"rack_id"`
SiteID int64 `gorm:"column:site_id;not null" json:"site_id"`
TenantID int64 `gorm:"column:tenant_id" json:"tenant_id"`
// VirtualChassisID int64 `gorm:"column:virtual_chassis_id" json:"virtual_chassis_id"`
// Airflow string `gorm:"column:airflow;not null" json:"airflow"`
DeviceRole DcimDevicerole `pg:"fk:device_role_id"`
// Created time.Time `gorm:"column:created" json:"created"`
// LastUpdated time.Time `gorm:"column:last_updated" json:"last_updated"`
Name string `gorm:"column:name" json:"name"`
Serial string `gorm:"column:serial;not null" json:"serial"`
Position float64 `gorm:"column:position" json:"position"`
// Face string `gorm:"column:face;not null" json:"face"`
Status string `gorm:"column:status;not null" json:"status"`
Comments string `gorm:"column:comments;not null" json:"comments"`
RoleID int64 `gorm:"column:role_id;not null" json:"role_id"`
DeviceTypeID int64 `gorm:"column:device_type_id;not null" json:"device_type_id"`
PlatformID int64 `gorm:"column:platform_id" json:"platform_id"`
RackID int64 `gorm:"column:rack_id" json:"rack_id"`
PrimaryIp4ID int64 `gorm:"column:primary_ip4_id" json:"primary_ip4_id" sql:"primary_ip4_id"`
PrimaryIp6ID int64 `gorm:"column:primary_ip6_id" json:"primary_ip6_id" sql:"primary_ip6_id"`
TenantID int64 `gorm:"column:tenant_id" json:"tenant_id"`
AssetTag string `gorm:"column:asset_tag" json:"asset_tag"`
SiteID int64 `gorm:"column:site_id;not null" json:"site_id"`
// ClusterID int64 `gorm:"column:cluster_id" json:"cluster_id"`
// VirtualChassisID int64 `gorm:"column:virtual_chassis_id" json:"virtual_chassis_id"`
// VcPosition int16 `gorm:"column:vc_position" json:"vc_position"`
// VcPriority int16 `gorm:"column:vc_priority" json:"vc_priority"`
// LocalContextData string `gorm:"column:local_context_data" json:"local_context_data"`
// Name string `gorm:"column:_name" json:"_name"`
//CustomFieldData string `gorm:"column:custom_field_data;not null" json:"custom_field_data"`
LocationID int64 `gorm:"column:location_id" json:"location_id"`
// Airflow string `gorm:"column:airflow;not null" json:"airflow"`
// Description string `gorm:"column:description;not null" json:"description"`
// ConfigTemplateID int64 `gorm:"column:config_template_id" json:"config_template_id"`
DeviceRole DcimDevicerole `pg:"fk:role_id"`
DeviceType DcimDevicetype `pg:"fk:device_type_id"`
Site DcimSite `pg:"fk:site_id"`
Tags []string `sql:"-"`
Expand Down
21 changes: 11 additions & 10 deletions pkg/connector/netbox/model/dcim_devicerole.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8313231

Please sign in to comment.