libchorizo

package
v0.0.0-...-ee5d75e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2015 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APICronfilePoll

func APICronfilePoll(HOSTNAME string, API_URL string, CRONFILE string)

func APIGetSystemId

func APIGetSystemId(url string, hostname string) (int, error)

func APILogCapture

func APILogCapture(url string, system_id int, system_update_id int, log_object *logobject.LogObject) bool

LogCapture sends the log update to the centralized API

func CreateSytemUpdate

func CreateSytemUpdate(url string, system_id int) (int, error)

CreateSystemUpdate starts the update process with the api Example json output from REST API: ****************

{
  "id": 557,
  "limit": 1,
  "offset": 0,
  "total_count": 1
}

****************

func FinishSystemUpdate

func FinishSystemUpdate(url string, system_id int) (bool, error)

func ValidateCronExpr

func ValidateCronExpr(expr string) bool

CreateClient creates a napping takes the REST API endpoint and the system hostname returns a bool of the success of creating the database file. Example json output from REST API: ************************************************

{
  "limit": 1,
  "offset": 0,
  "system": {
    "created_at": "Tue, 16 Sep 2014 11:49:01 GMT",
    "hostname": "localhost.localdomain",
    "id": 14
  },
  "total_count": 1
}

*************************************************

func WriteCronFile

func WriteCronFile(cronfile_path string, cronfile_contents string) (err error)

Types

type CreateSystemUpdateResp

type CreateSystemUpdateResp struct {
	TotalCount int `json: "total_count"`
	Limit      int `json: "limit"`
	Offset     int `json: "offset"`
	Id         int `json: "id"`
}

type GetSystemIdResp

type GetSystemIdResp struct {
	TotalCount int          `json: "total_count"`
	Limit      int          `json: "limit"`
	Offset     int          `json: "offset"`
	System     SystemIdResp `json: "system"`
}

type SystemIdResp

type SystemIdResp struct {
	Createdat string `json: "created_at"`
	Hostname  string `json: "hostname"`
	Cronfile  string `json: "cronfile"`
	Id        int    `json: "id"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL