Documentation ¶
Index ¶
- Variables
- func ApplyNodes(baseUrl string, token interface{}, nodeattrs interface{}) (string, int, string)
- func CheckHTTPResponseStatusCode(resp *http.Response) error
- func CheckTokenValidate(baseUrl string, token interface{}) (string, int, string)
- func Contains(a []string, x string) bool
- func FormatResponse(resp interface{}, err error) (interface{}, int, string)
- func Intf2Map(v interface{}) map[string]string
- func ListNodeDetail(node string, baseUrl string, token interface{}) (string, int, string)
- func ListNodePowerStatus(node string, baseUrl string, token interface{}) (string, int, string)
- func ListNodeStatus(node string, baseUrl string, token interface{}) (string, int, string)
- func Login(baseUrl string, username string, password string) (string, int, string)
- func MapConvInt2Str(data map[string]interface{}) map[string]string
- func NodeInv2Res(myjson string, d *schema.ResourceData, node string, status string) int
- func Provider() terraform.ResourceProvider
- func ProvisionNode(node string, baseUrl string, token interface{}, osimage string) (string, int, string)
- func ReleaseNode(node string, baseUrl string, token interface{}) (string, int, string)
- func Res2DefAttr(resattr string) string
- func SetPowerStatus(node string, baseUrl string, token interface{}, status string) (string, int, string)
- type Config
- type HttpClient
- func (s *HttpClient) Delete(url string, params *url.Values, token interface{}, body interface{}, ...) (interface{}, error)
- func (s *HttpClient) Do(req *http.Request) (*http.Response, error)
- func (s *HttpClient) Get(url string, params *url.Values, token interface{}, body interface{}, ...) (interface{}, error)
- func (s *HttpClient) Patch(url string, params *url.Values, token interface{}, body interface{}, ...) (interface{}, error)
- func (s *HttpClient) Post(url string, params *url.Values, token interface{}, body interface{}, ...) (interface{}, error)
- func (s *HttpClient) Put(url string, params *url.Values, token interface{}, body interface{}, ...) (interface{}, error)
- func (s *HttpClient) Request(method string, url string, params *url.Values, headers *http.Header, ...) (data interface{}, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var DictRes2Inv = map[string]string{
"machinetype": "device_info.mtm",
"arch": "device_info.arch",
"disksize": "device_info.disksize",
"memory": "device_info.memory",
"cputype": "device_info.cputype",
"cpucount": "device_info.cpucount",
"ip": "network_info.primarynic.ip",
"mac": "network_info.primarynic.mac",
"rack": "position_info.rack",
"unit": "position_info.unit",
"room": "position_info.room",
"height": "position_info.height",
"osimage": "engines.netboot_engine.engine_info.osimage",
"tags": "obj_info.description",
}
View Source
var SelectorOpMaps = map[string][]string{ "disksize": []string{"=", ">", ">=", "<", "<="}, "memory": []string{"=", ">", ">=", "<", "<="}, "cpucount": []string{"=", ">", ">=", "<", "<="}, "cputype": []string{"=", "!=", "!~", "=~"}, "machinetype": []string{"="}, "name": []string{"="}, "rack": []string{"="}, "unit": []string{"="}, "room": []string{"="}, "arch": []string{"="}, "gpu": []string{"="}, "ib": []string{"="}, }
Functions ¶
func ApplyNodes ¶
func CheckTokenValidate ¶
func FormatResponse ¶
If there is error
check whether match known string, if yes return error code 1 and error string or return response code and message
func ListNodeDetail ¶
func ListNodePowerStatus ¶
func ListNodeStatus ¶
func NodeInv2Res ¶
func Provider ¶
func Provider() terraform.ResourceProvider
func ProvisionNode ¶
func ReleaseNode ¶
func Res2DefAttr ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.