-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dcim{,_related-connections}: update to support change from netbox-com…
- Loading branch information
Allan Liu
committed
Jul 29, 2016
1 parent
f2becec
commit dcf391c
Showing
8 changed files
with
244 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright 2016 The go-netbox Authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package netbox | ||
|
||
// ConsolePort represents a console port object. | ||
// | ||
// At this time, the ConsolePort type type is not implemented. | ||
type ConsolePort struct { | ||
ID int `json:"id"` | ||
Device *DeviceIdentifier `json:"device"` | ||
Name string `json:"name"` | ||
CSPort *ConsoleServerPort `json:"cs_port"` | ||
ConnectionStatus bool `json:"connection_status"` | ||
} | ||
|
||
// ConsoleServerPort represents a console server port object. | ||
type ConsoleServerPort struct { | ||
ID int `json:"id"` | ||
Device *DeviceIdentifier `json:"device"` | ||
Name string `json:"name"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Copyright 2016 The go-netbox Authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package netbox | ||
|
||
// Interface represents an interface object. | ||
// | ||
// At this time, the Interface type is not implemented. | ||
type Interface struct { | ||
ID int `json:"id"` | ||
Name string `json:"name"` | ||
FormFactor string `json:"form_factor"` | ||
MacAddress string `json:"mac_address"` | ||
MgmtOnly bool `json:"mgmt_only"` | ||
Description string `json:"description"` | ||
IsConnected bool `json:"is_connected"` | ||
ConnectedInterface *InterfaceDetail `json:"connected_interface"` | ||
} | ||
|
||
// InterfaceDetail represents an interface-detail object. | ||
type InterfaceDetail struct { | ||
ID int `json:"id"` | ||
Device *DeviceIdentifier `json:"device"` | ||
Name string `json:"name"` | ||
FormFactor string `json:"form_factor"` | ||
MacAddress string `json:"mac_address"` | ||
MgmtOnly bool `json:"mgmt_only"` | ||
Description string `json:"description"` | ||
IsConnected bool `json:"is_connected"` | ||
} | ||
|
||
// An InterfaceIdentifier is a reduced version of an Interface, returned as a | ||
// nested object in some top-level objects. It contains information which can | ||
// be used in subsequent API calls to identify and retrieve a full Interface. | ||
type InterfaceIdentifier struct { | ||
ID int `json:"id"` | ||
Device *DeviceIdentifier `json:"device"` | ||
Name string `json:"name"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright 2016 The go-netbox Authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package netbox | ||
|
||
// PowerOutletIdentifier represents a reduced version of a power outlet object. | ||
// | ||
// At this time, the PowerOutlet type is not implemented. | ||
type PowerOutletIdentifier struct { | ||
ID int `json:"id"` | ||
Device *DeviceIdentifier `json:"device"` | ||
Name string `json:"name"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2016 The go-netbox Authors. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package netbox | ||
|
||
// PowerPort represents a power port object. | ||
// | ||
// At this time, the PowerPort type is not implemented. | ||
type PowerPort struct { | ||
ID int `json:"id"` | ||
Name string `json:"name"` | ||
PowerOutlet *PowerOutletIdentifier `json:"power_outlet"` | ||
ConnectionStatus bool `json:"connection_status"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters