// 2020 Rackspace, Inc. // // 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 mydp import ( "github.com/kolo/xmlrpc" ) type ( // F5 is a specific device type for BIG-IP F5 devices, and contains // specific information about the device. F5 struct { DeviceID string `xmlrpc:"DeviceID"` DevicePrimaryIP string `xmlrpc:"Device_PrimaryIP"` LocationTitle string `xmlrpc:"Location_Title"` RackTitle string `xmlrpc:"RackTitle"` RackID string `xmlrpc:"RackID"` RackU string `xmlrpc:"RackU"` CustomerID string `xmlrpc:"CustomerID"` DeviceName string `xmlrpc:"Device_Name"` AXDeviceID string `xmlrpc:"AXDeviceID"` ERPDeviceID string `xmlrpc:"ERPDeviceID"` NetworkZoneTitle string `xmlrpc:"NetworkZoneTitle"` NetworkZoneID string `xmlrpc:"NetworkZoneID"` OSVersion string `xmlrpc:"OSVersion"` Model string `xmlrpc:"Model"` FailoverPartnerID string `xmlrpc:"FailoverPartnerID"` PartnerName string `xmlrpc:"Partner_Name"` Serial string `xmlrpc:"serial"` FirewallID string `xmlrpc:"FirewallID"` FirewallName string `xmlrpc:"firewall_Name"` AdaptSysid string `xmlrpc:"AdaptSysid"` StartSupportContract string `xmlrpc:"StartSupportContract"` EndSupportContract string `xmlrpc:"EndSupportContract"` ContractNotes string `xmlrpc:"ContractNotes"` } ) // GetF5 method uses the *mydp.Client to invoke an XMLRPC call to the // Service: mydatapipe.f5.GetF5 func (c *Client) GetF5(f5ID int) (*F5, error) { client, err := xmlrpc.NewClient(c.url("xmlrpc/f5.php"), nil) if err != nil { return nil, err } var result F5 err = client.Call("mydatapipe.f5.Get", f5ID, &result) return &result, err } // F5List method uses the *mydp.Client to invoke an XMLRPC call to the // Service: mydatapipe.f5.F5List func (c *Client) F5List(offset int) ([]F5, error) { client, err := xmlrpc.NewClient(c.url("xmlrpc/f5.php"), nil) if err != nil { return nil, err } var result []F5 err = client.Call("mydatapipe.f5.List", offset, &result) return result, err }