// 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 cmdb import "github.rackspace.com/DCM/tools" // Example type represents client references to third-party resources required // for the methods within this package. type Example struct { /* Within this structure will be any type of data needed to pass between methods within this interface implementation. This should hold clients as well as context data. */ } // exampleClient [nameClient] function should exist in every implementation of the Client interface. // This function will create an initialized type that will satisfy the requirements of the Discovery interface. //func exampleClient(key *passkey.Client) (*Example, error) { /* Within this function you would take any initialization of clients that are needed to initialize any data types that are attached to the returning structure. */ // return new(Example), nil //} // Get method takes a cmdb. pointer receiver and serves as the main // entry point into the discovery implementation of this data type. func (c *Example) Get(uniqueID string) (tools.Device, error) { /* This is where we would perform discovery logic. In this function we will do all the things to discover information about a uniqueID using the CMDB system as source, and any gather mechanism to retrieve the information we need to build a device Record type. The end result would be enough information populated to make decisions when calling the Update() method to update DCX tools. */ return tools.Device{}, nil }