// 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 ( // NetworkZone type is a representation of a shared group of devices that // have the same management and monitoring ACLs NetworkZone struct { NetworkZoneID string `xmlrpc:"NetworkZoneID"` Title string `xmlrpc:"Title"` Description string `xmlrpc:"Description"` LocationTitle string `xmlrpc:"LocationTitle"` LocationID string `xmlrpc:"LocationID"` WhoCreatedName string `xmlrpc:"WhoCreatedName"` WhoLastModifiedName string `xmlrpc:"WhoLastModifiedName"` DateLastModified string `xmlrpc:"DateLastModified"` DateCreated string `xmlrpc:"DateCreated"` } ) // GetNetworkZone method uses the *mydp.Client to invoke an XMLRPC call to the // Service: mydatapipe.NetworkZone.Get func (c *Client) GetNetworkZone(networkZoneID int) (*NetworkZone, error) { client, err := xmlrpc.NewClient(c.url("xmlrpc/NetworkZone.php"), nil) if err != nil { return nil, err } var result NetworkZone err = client.Call("mydatapipe.NetworkZone.Get", networkZoneID, &result) return &result, err } // NetworkZoneList method uses the *mydp.Client to invoke an XMLRPC call to the // Service: mydatapipe.NetworkZone.List func (c *Client) NetworkZoneList() ([]NetworkZone, error) { client, err := xmlrpc.NewClient(c.url("xmlrpc/NetworkZone.php"), nil) if err != nil { return nil, err } var result []NetworkZone err = client.Call("mydatapipe.NetworkZone.List", nil, &result) return result, err }