omp

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

README

openvas-golang-lib

Documentation

Index

Constants

View Source
const (
	StatusOK int = 200
)

OMP Response Status .

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Text string `xml:",chardata"`
	ID   string `xml:"id,attr,omitempty"`
	Name string `xml:"name,omitempty"`
}

Config .

type Connector

type Connector struct {
	// contains filtered or unexported fields
}

Connector .

func (*Connector) Auth

func (c *Connector) Auth(username, password string) error

Auth .

func (*Connector) CreateConfig

func (conn *Connector) CreateConfig(id string, name string) (string, error)

CreateConfig .

func (*Connector) CreateCredential

func (conn *Connector) CreateCredential(cred Credential) (string, error)

CreateCredential .

func (*Connector) CreateScanner

func (c *Connector) CreateScanner(s *Scanner, credID string) (string, error)

CreateScanner .

func (*Connector) CreateTarget

func (c *Connector) CreateTarget(t *Target) (string, error)

CreateTarget .

func (*Connector) CreateTask

func (c *Connector) CreateTask(t *Task) (string, error)

CreateTask .

func (*Connector) DeleteTarget

func (c *Connector) DeleteTarget(id string) error

DeleteTarget .

func (*Connector) DeleteTask

func (c *Connector) DeleteTask(id string) error

DeleteTask .

func (*Connector) GetConfigs

func (conn *Connector) GetConfigs() ([]Config, error)

GetConfigs .

func (*Connector) GetCredentials

func (conn *Connector) GetCredentials() ([]Credential, error)

GetCredentials .

func (*Connector) GetResults

func (c *Connector) GetResults(r *Result, taskID string, filter ...string) ([]Result, error)

GetResults .

func (*Connector) GetScanners

func (c *Connector) GetScanners() ([]Scanner, error)

GetScanners .

func (*Connector) GetTargets

func (c *Connector) GetTargets() ([]OMPtarget, error)

GetTargets .

func (*Connector) GetTasks

func (c *Connector) GetTasks(id string) ([]Task, error)

GetTasks .

func (*Connector) GetVersion

func (c *Connector) GetVersion() (string, error)

GetVersion .

func (*Connector) ModifyTarget

func (c *Connector) ModifyTarget(t *Target) error

ModifyTarget .

func (*Connector) ModifyTask

func (c *Connector) ModifyTask(t *Task) error

ModifyTask .

func (*Connector) Ping

func (c *Connector) Ping()

Ping .

func (*Connector) StartTask

func (c *Connector) StartTask(id string) (string, error)

StartTask .

func (*Connector) StopTask

func (c *Connector) StopTask(t *Task) error

StopTask .

type CreateConfig

type CreateConfig struct {
	XMLName xml.Name `xml:"create_config"`
	Text    string   `xml:",chardata"`
	Copy    string   `xml:"copy,omitempty"`
	Name    string   `xml:"name,omitempty"`
	// contains filtered or unexported fields
}

CreateConfig .

type CreateConfigResponse

type CreateConfigResponse struct {
	XMLName xml.Name `xml:"create_config_response"`
	Text    string   `xml:",chardata"`
	ID      string   `xml:"id,attr,omitempty"`
	// contains filtered or unexported fields
}

CreateConfigResponse .

func (*CreateConfigResponse) GetStatus

func (r *CreateConfigResponse) GetStatus() int

func (*CreateConfigResponse) GetStatusText

func (r *CreateConfigResponse) GetStatusText() string

type CreateCredential

type CreateCredential struct {
	XMLName  xml.Name `xml:"create_credential"`
	Text     string   `xml:",chardata"`
	Name     string   `xml:"name,omitempty"`
	Login    string   `xml:"login,omitempty"`
	Password string   `xml:"password,omitempty"`
	Comment  string   `xml:"comment,omitempty"`
	// contains filtered or unexported fields
}

CreateCredential .

type CreateCredentialResponse

type CreateCredentialResponse struct {
	XMLName xml.Name `xml:"create_credential_response"`
	Text    string   `xml:",chardata"`
	ID      string   `xml:"id,attr,omitempty"`
	// contains filtered or unexported fields
}

CreateCredentialResponse .

func (*CreateCredentialResponse) GetStatus

func (r *CreateCredentialResponse) GetStatus() int

func (*CreateCredentialResponse) GetStatusText

func (r *CreateCredentialResponse) GetStatusText() string

type CreateScanner

type CreateScanner struct {
	XMLName    xml.Name    `xml:"create_scanner"`
	Text       string      `xml:",chardata"`
	Name       string      `xml:"name,omitempty"`
	Host       string      `xml:"host,omitempty"`
	Port       string      `xml:"port,omitempty"`
	Type       string      `xml:"type,omitempty"`
	CaPub      string      `xml:"ca_pub,omitempty"`
	Credential *Credential `xml:"credential,omitempty"`
	// contains filtered or unexported fields
}

CreateScanner .

type CreateScannerResponse

type CreateScannerResponse struct {
	XMLName xml.Name `xml:"create_scanner_response"`
	Text    string   `xml:",chardata"`
	ID      string   `xml:"id,attr,omitempty"`
	// contains filtered or unexported fields
}

CreateScannerResponse .

func (*CreateScannerResponse) GetStatus

func (r *CreateScannerResponse) GetStatus() int

func (*CreateScannerResponse) GetStatusText

func (r *CreateScannerResponse) GetStatusText() string

type CreateTarget

type CreateTarget struct {
	XMLName xml.Name `xml:"create_target"`
	Name    string   `xml:"name,omitempty"`
	Hosts   string   `xml:"hosts,omitempty"`
	// contains filtered or unexported fields
}

CreateTarget .

type CreateTask

type CreateTask struct {
	XMLName xml.Name `xml:"create_task"`
	Text    string   `xml:",chardata"`
	Name    string   `xml:"name,omitempty"`
	Comment string   `xml:"comment,omitempty"`
	Config  *Config  `xml:"config,omitempty"`
	Target  *Target  `xml:"target,omitempty"`
	Scanner *Scanner `xml:"scanner,omitempty"`
}

CreateTask .

type CreateTaskResponse

type CreateTaskResponse struct {
	XMLName xml.Name `xml:"create_task_response"`
	Text    string   `xml:",chardata"`
	ID      string   `xml:"id,attr,omitempty"`
	// contains filtered or unexported fields
}

CreateTaskResponse .

func (*CreateTaskResponse) GetStatus

func (r *CreateTaskResponse) GetStatus() int

func (*CreateTaskResponse) GetStatusText

func (r *CreateTaskResponse) GetStatusText() string

type Credential

type Credential struct {
	Text             string    `xml:",chardata"`
	Password         string    `xml:"password,omitempty"`
	ID               string    `xml:"id,attr,omitempty"`
	Name             string    `xml:"name,omitempty"`
	Login            string    `xml:"login,omitempty"`
	Comment          string    `xml:"comment,omitempty"`
	CreationTime     string    `xml:"creation_time,omitempty"`
	ModificationTime string    `xml:"modification_time,omitempty"`
	Writable         string    `xml:"writable,omitempty"`
	InUse            string    `xml:"in_use,omitempty"`
	UserTags         *UserTags `xml:"user_tags,omitempty"`
	Type             string    `xml:"type,omitempty"`
	FullType         string    `xml:"full_type,omitempty"`
}

Credential .

type DeleteTarget

type DeleteTarget struct {
	XMLName xml.Name `xml:"delete_target"`
	ID      string   `xml:"target_id,attr,omitempty"`
	// contains filtered or unexported fields
}

DeleteTarget .

type DeleteTask

type DeleteTask struct {
	XMLName xml.Name `xml:"delete_task"`
	Text    string   `xml:",chardata"`
	TaskID  string   `xml:"task_id,attr,omitempty"`
}

DeleteTask .

type DeleteTaskResponse

type DeleteTaskResponse struct {
	XMLName xml.Name `xml:"delete_task_response"`
	Text    string   `xml:",chardata"`
	// contains filtered or unexported fields
}

DeleteTaskResponse .

func (*DeleteTaskResponse) GetStatus

func (r *DeleteTaskResponse) GetStatus() int

func (*DeleteTaskResponse) GetStatusText

func (r *DeleteTaskResponse) GetStatusText() string

type GetConfigs

type GetConfigs struct {
	XMLName xml.Name `xml:"get_configs"`
	// contains filtered or unexported fields
}

GetConfigs .

type GetConfigsResponse

type GetConfigsResponse struct {
	XMLName xml.Name `xml:"get_configs_response"`
	Text    string   `xml:",chardata"`
	Config  []struct {
		Text             string `xml:",chardata"`
		ID               string `xml:"id,attr,omitempty"`
		Name             string `xml:"name,omitempty"`
		Comment          string `xml:"comment,omitempty"`
		CreationTime     string `xml:"creation_time,omitempty"`
		ModificationTime string `xml:"modification_time,omitempty"`
		FamilyCount      *struct {
			Text    string `xml:",chardata"`
			Growing string `xml:"growing,omitempty"`
		} `xml:"family_count,omitempty"`
		NvtCount *struct {
			Text    string `xml:",chardata"`
			Growing string `xml:"growing,omitempty"`
		} `xml:"nvt_count,omitempty"`
		InUse    string    `xml:"in_use,omitempty"`
		Writable string    `xml:"writable,omitempty"`
		UserTags *UserTags `xml:"user_tags,omitempty"`
	} `xml:"config,omitempty"`
	// contains filtered or unexported fields
}

GetConfigsResponse .

func (*GetConfigsResponse) GetStatus

func (r *GetConfigsResponse) GetStatus() int

func (*GetConfigsResponse) GetStatusText

func (r *GetConfigsResponse) GetStatusText() string

type GetCredentials

type GetCredentials struct {
	XMLName      xml.Name `xml:"get_credentials"`
	Text         string   `xml:",chardata"`
	CredentialID string   `xml:"credential_id,attr,omitempty"`
	Format       string   `xml:"format,attr,omitempty"`
	Targets      string   `xml:"targets,attr,omitempty"`
	// contains filtered or unexported fields
}

GetCredentials .

type GetCredentialsResponse

type GetCredentialsResponse struct {
	XMLName    xml.Name     `xml:"get_credentials_response"`
	Text       string       `xml:",chardata"`
	Credential []Credential `xml:"credential,omitempty"`
	// contains filtered or unexported fields
}

GetCredentialsResponse .

func (*GetCredentialsResponse) GetStatus

func (r *GetCredentialsResponse) GetStatus() int

func (*GetCredentialsResponse) GetStatusText

func (r *GetCredentialsResponse) GetStatusText() string

type GetResults

type GetResults struct {
	XMLName  xml.Name `xml:"get_results"`
	Text     string   `xml:",chardata"`
	ResultID string   `xml:"result_id,attr,omitempty"`
	TaskID   string   `xml:"task_id,attr,omitempty"`
	Filter   string   `xml:"filter,attr,omitempty"`
	// contains filtered or unexported fields
}

GetResults .

func (*GetResults) GetStatus

func (r *GetResults) GetStatus() int

func (*GetResults) GetStatusText

func (r *GetResults) GetStatusText() string

type GetResultsResponse

type GetResultsResponse struct {
	XMLName xml.Name `xml:"get_results_response"`
	Text    string   `xml:",chardata"`
	Result  []Result `xml:"result,omitempty"`
	Filters *struct {
		Text     string `xml:",chardata"`
		ID       string `xml:"id,attr,omitempty"`
		Term     string `xml:"term,omitempty"`
		Keywords *struct {
			Text    string `xml:",chardata"`
			Keyword *struct {
				Text     string `xml:",chardata"`
				Column   string `xml:"column,omitempty"`
				Relation string `xml:"relation,omitempty"`
				Value    string `xml:"value,omitempty"`
			} `xml:"keyword,omitempty"`
		} `xml:"keywords,omitempty"`
	} `xml:"filters,omitempty"`
	Sort *struct {
		Text  string `xml:",chardata"`
		Field *struct {
			Text  string `xml:",chardata"`
			Order string `xml:"order,omitempty"`
		} `xml:"field,omitempty"`
	} `xml:"sort,omitempty"`
	Results *struct {
		Text  string `xml:",chardata"`
		Max   string `xml:"max,attr,omitempty"`
		Start string `xml:"start,attr,omitempty"`
	} `xml:"results,omitempty"`
	ResultCount *struct {
		Text     string `xml:",chardata"`
		Filtered string `xml:"filtered,omitempty"`
		Page     string `xml:"page,omitempty"`
	} `xml:"result_count,omitempty"`
	// contains filtered or unexported fields
}

GetResultsResponse .

func (*GetResultsResponse) GetStatus

func (r *GetResultsResponse) GetStatus() int

func (*GetResultsResponse) GetStatusText

func (r *GetResultsResponse) GetStatusText() string

type GetScanners

type GetScanners struct {
	XMLName   xml.Name `xml:"get_scanners"`
	Text      string   `xml:",chardata"`
	Details   string   `xml:"details,attr,omitempty"`
	ScannerID string   `xml:"scanner_id,attr,omitempty"`
	// contains filtered or unexported fields
}

GetScanners .

type GetScannersResponse

type GetScannersResponse struct {
	XMLName  xml.Name  `xml:"get_scanners_response"`
	Text     string    `xml:",chardata"`
	Scanner  []Scanner `xml:"scanner,omitempty"`
	Truncate string    `xml:"truncate,omitempty"`
	// contains filtered or unexported fields
}

GetScannersResponse .

func (*GetScannersResponse) GetStatus

func (r *GetScannersResponse) GetStatus() int

func (*GetScannersResponse) GetStatusText

func (r *GetScannersResponse) GetStatusText() string

type GetTargets

type GetTargets struct {
	XMLName xml.Name `xml:"get_targets"`
	// contains filtered or unexported fields
}

GetTargets .

type GetTargetsResponse

type GetTargetsResponse struct {
	XMLName xml.Name    `xml:"get_targets_response"`
	Text    string      `xml:",chardata"`
	Target  []OMPtarget `xml:"target,omitempty"`
	// contains filtered or unexported fields
}

GetTargetsResponse .

func (*GetTargetsResponse) GetStatus

func (r *GetTargetsResponse) GetStatus() int

func (*GetTargetsResponse) GetStatusText

func (r *GetTargetsResponse) GetStatusText() string

type GetTasks

type GetTasks struct {
	XMLName xml.Name `xml:"get_tasks"`
	Text    string   `xml:",chardata"`
	TaskID  string   `xml:"task_id,attr,omitempty"`
	Details string   `xml:"details,attr,omitempty"`
	// contains filtered or unexported fields
}

GetTasks .

type GetTasksResponse

type GetTasksResponse struct {
	XMLName        xml.Name `xml:"get_tasks_response"`
	Text           string   `xml:",chardata"`
	ApplyOverrides string   `xml:"apply_overrides,omitempty"`
	Task           []Task   `xml:"task,omitempty"`
	Filters        *struct {
		Text string `xml:",chardata"`
		ID   string `xml:"id,attr,omitempty"`
		Term string `xml:"term,omitempty"`
	} `xml:"filters,omitempty"`
	Sort *struct {
		Text  string `xml:",chardata"`
		Field *struct {
			Text  string `xml:",chardata"`
			Order string `xml:"order,omitempty"`
		} `xml:"field,omitempty"`
	} `xml:"sort,omitempty"`
	TaskCount *struct {
		Text     string `xml:",chardata"`
		Filtered string `xml:"filtered,omitempty"`
		Page     string `xml:"page,omitempty"`
	} `xml:"task_count,omitempty"`
	// contains filtered or unexported fields
}

GetTasksResponse .

func (*GetTasksResponse) GetStatus

func (r *GetTasksResponse) GetStatus() int

func (*GetTasksResponse) GetStatusText

func (r *GetTasksResponse) GetStatusText() string

type ModifyTarget

type ModifyTarget struct {
	XMLName      xml.Name `xml:"modify_target"`
	ID           string   `xml:"target_id,attr,omitempty"`
	Name         string   `xml:"name,omitempty"`
	Hosts        string   `xml:"hosts,omitempty"`
	ExcludeHosts string   `xml:"exclude_hosts,omitempty"`
	// contains filtered or unexported fields
}

ModifyTarget .

type ModifyTask

type ModifyTask struct {
	XMLName xml.Name `xml:"modify_task"`
	Name    string   `xml:"name"`
	Scanner *Scanner `xml:"scanner,omitempty"`
	Text    string   `xml:",chardata"`
	TaskID  string   `xml:"task_id,attr,omitempty"`
	Comment string   `xml:"comment,omitempty"`
	// contains filtered or unexported fields
}

ModifyTask .

type ModifyTaskResponse

type ModifyTaskResponse struct {
	XMLName xml.Name `xml:"modify_task_response"`
	Text    string   `xml:",chardata"`
	// contains filtered or unexported fields
}

ModifyTaskResponse .

func (*ModifyTaskResponse) GetStatus

func (r *ModifyTaskResponse) GetStatus() int

func (*ModifyTaskResponse) GetStatusText

func (r *ModifyTaskResponse) GetStatusText() string

type MoveTask

type MoveTask struct {
	XMLName xml.Name `xml:"move_task"`
	Text    string   `xml:",chardata"`
	TaskID  string   `xml:"task_id,attr,omitempty"`
	SlaveID string   `xml:"slave_id,attr,omitempty"`
	// contains filtered or unexported fields
}

MoveTask .

func (*MoveTask) GetStatus

func (r *MoveTask) GetStatus() int

func (*MoveTask) GetStatusText

func (r *MoveTask) GetStatusText() string

type MoveTaskResponse

type MoveTaskResponse struct {
	XMLName xml.Name `xml:"move_task_response"`
	Text    string   `xml:",chardata"`
	// contains filtered or unexported fields
}

MoveTaskResponse .

func (*MoveTaskResponse) GetStatus

func (r *MoveTaskResponse) GetStatus() int

func (*MoveTaskResponse) GetStatusText

func (r *MoveTaskResponse) GetStatusText() string

type OMP

type OMP interface {
	// Target related
	CreateTarget(t *Target) (string, error)
	ModifyTarget(t *Target) error
	GetTargets() ([]OMPtarget, error)
	DeleteTarget(id string) error

	// configs
	CreateConfig(id string, name string) (string, error)
	GetConfigs() ([]Config, error)

	// tasks
	CreateTask(t *Task) (string, error)
	GetTasks(id string) ([]Task, error)
	DeleteTask(id string) error
	ModifyTask(t *Task) error
	StartTask(id string) (string, error)
	StopTask(t *Task) error

	// scanners
	CreateScanner(s *Scanner, credID string) (string, error)
	GetScanners() ([]Scanner, error)

	// credentials
	CreateCredential(cred Credential) (string, error)
	GetCredentials() ([]Credential, error)

	// result
	GetResults(r *Result, taskID string, filter ...string) ([]Result, error)
}

OMP .

func New

func New(addr, username, password string) (OMP, error)

New .

type OMPtarget

type OMPtarget struct {
	Text             string    `xml:",chardata"`
	ID               string    `xml:"id,attr,omitempty"`
	Name             string    `xml:"name,omitempty"`
	Comment          string    `xml:"comment,omitempty"`
	CreationTime     string    `xml:"creation_time,omitempty"`
	ModificationTime string    `xml:"modification_time,omitempty"`
	Writable         string    `xml:"writable,omitempty"`
	InUse            string    `xml:"in_use,omitempty"`
	UserTags         *UserTags `xml:"user_tags,omitempty"`
	Hosts            string    `xml:"hosts,omitempty"`
	MaxHosts         string    `xml:"max_hosts,omitempty"`
	SSHCredential    *struct {
		Text string `xml:",chardata"`
		ID   string `xml:"id,attr,omitempty"`
		Name string `xml:"name,omitempty"`
	} `xml:"ssh_credential,omitempty"`
	SmbCredential *struct {
		Text string `xml:",chardata"`
		ID   string `xml:"id,attr,omitempty"`
		Name string `xml:"name,omitempty"`
	} `xml:"smb_credential,omitempty"`
	EsxiCredential *struct {
		Text string `xml:",chardata"`
		ID   string `xml:"id,attr,omitempty"`
		Name string `xml:"name,omitempty"`
	} `xml:"esxi_credential,omitempty"`
}

OMPtarget .

type OMPv4

type OMPv4 struct {
}

OMPv4 .

type OMPv7

type OMPv7 struct {
	*Connector
}

OMPv7 .

type Result

type Result struct {
	Text  string `xml:",chardata"`
	ID    string `xml:"id,attr,omitempty"`
	Owner *struct {
		Text string `xml:",chardata"`
		Name string `xml:"name,omitempty"`
	} `xml:"owner,omitempty"`
	Comment          string    `xml:"comment,omitempty"`
	CreationTime     string    `xml:"creation_time,omitempty"`
	ModificationTime string    `xml:"modification_time,omitempty"`
	UserTags         *UserTags `xml:"user_tags,omitempty"`
	Host             string    `xml:"host,omitempty"`
	Port             string    `xml:"port,omitempty"`
	Nvt              *struct {
		Text     string `xml:",chardata"`
		Oid      string `xml:"oid,attr,omitempty"`
		Name     string `xml:"name,omitempty"`
		CvssBase string `xml:"cvss_base,omitempty"`
		Cve      string `xml:"cve,omitempty"`
		Bid      string `xml:"bid,omitempty"`
		Tags     string `xml:"tags,omitempty"`
		Cert     string `xml:"cert,omitempty"`
		Xref     string `xml:"xref,omitempty"`
	} `xml:"nvt,omitempty"`
	Threat         string `xml:"threat,omitempty"`
	Description    string `xml:"description,omitempty"`
	OriginalThreat string `xml:"original_threat,omitempty"`
	Notes          string `xml:"notes,omitempty"`
	Overrides      *struct {
		Text     string `xml:",chardata"`
		Override *struct {
			Chardata string `xml:",chardata"`
			ID       string `xml:"id,attr,omitempty"`
			Nvt      *struct {
				Text string `xml:",chardata"`
				Oid  string `xml:"oid,attr,omitempty"`
				Name string `xml:"name,omitempty"`
			} `xml:"nvt,omitempty"`
			Text *struct {
				Text    string `xml:",chardata"`
				Excerpt string `xml:"excerpt,attr,omitempty"`
			} `xml:"text,omitempty"`
			NewThreat string `xml:"new_threat,omitempty"`
			Orphan    string `xml:"orphan,omitempty"`
		} `xml:"override,omitempty"`
	} `xml:"overrides,omitempty"`
}

Result .

type ResumeTask

type ResumeTask struct {
	XMLName xml.Name `xml:"resume_task"`
	Text    string   `xml:",chardata"`
	TaskID  string   `xml:"task_id,attr,omitempty"`
}

ResumeTask .

type ResumeTaskResponse

type ResumeTaskResponse struct {
	XMLName  xml.Name `xml:"resume_task_response"`
	Text     string   `xml:",chardata"`
	ReportID string   `xml:"report_id,omitempty"`
	// contains filtered or unexported fields
}

ResumeTaskResponse .

func (*ResumeTaskResponse) GetStatus

func (r *ResumeTaskResponse) GetStatus() int

func (*ResumeTaskResponse) GetStatusText

func (r *ResumeTaskResponse) GetStatusText() string

type Scanner

type Scanner struct {
	Text             string    `xml:",chardata"`
	ID               string    `xml:"id,attr,omitempty"`
	Name             string    `xml:"name,omitempty"`
	Comment          string    `xml:"comment,omitempty"`
	CreationTime     string    `xml:"creation_time,omitempty"`
	ModificationTime string    `xml:"modification_time,omitempty"`
	Writable         string    `xml:"writable,omitempty"`
	InUse            string    `xml:"in_use,omitempty"`
	UserTags         *UserTags `xml:"user_tags,omitempty"`
	Host             string    `xml:"host,omitempty"`
	Port             string    `xml:"port,omitempty"`
	Type             string    `xml:"type,omitempty"`
	CaPub            string    `xml:"ca_pub,omitempty"`
	KeyPub           string    `xml:"key_pub,omitempty"`
	Tasks            *struct {
		Text string `xml:",chardata"`
		Task *struct {
			Text string `xml:",chardata"`
			ID   string `xml:"id,attr,omitempty"`
			Name string `xml:"name,omitempty"`
		} `xml:"task,omitempty"`
	} `xml:"tasks,omitempty"`
}

Scanner .

type StartTask

type StartTask struct {
	XMLName xml.Name `xml:"start_task"`
	Text    string   `xml:",chardata"`
	TaskID  string   `xml:"task_id,attr,omitempty"`
	// contains filtered or unexported fields
}

StartTask .

type StartTaskResponse

type StartTaskResponse struct {
	XMLName  xml.Name `xml:"start_task_response"`
	Text     string   `xml:",chardata"`
	ReportID string   `xml:"report_id,omitempty"`
	// contains filtered or unexported fields
}

StartTaskResponse .

func (*StartTaskResponse) GetStatus

func (r *StartTaskResponse) GetStatus() int

func (*StartTaskResponse) GetStatusText

func (r *StartTaskResponse) GetStatusText() string

type StopTask

type StopTask struct {
	XMLName xml.Name `xml:"stop_task"`
	Text    string   `xml:",chardata"`
	TaskID  string   `xml:"task_id,attr,omitempty"`
	// contains filtered or unexported fields
}

StopTask .

type StopTaskResponse

type StopTaskResponse struct {
	XMLName xml.Name `xml:"stop_task_response"`
	Text    string   `xml:",chardata"`
	// contains filtered or unexported fields
}

StopTaskResponse .

func (*StopTaskResponse) GetStatus

func (r *StopTaskResponse) GetStatus() int

func (*StopTaskResponse) GetStatusText

func (r *StopTaskResponse) GetStatusText() string

type Target

type Target struct {
	Text         string `xml:",chardata"`
	ID           string `xml:"id,attr,omitempty"`
	Name         string `xml:"name,omitempty"`
	Hosts        []string
	ExcludeHosts []string
}

Target .

type Task

type Task struct {
	Hosts            []string
	Text             string    `xml:",chardata"`
	ID               string    `xml:"id,attr,omitempty"`
	Name             string    `xml:"name,omitempty"`
	Comment          string    `xml:"comment,omitempty"`
	CreationTime     string    `xml:"creation_time,omitempty"`
	ModificationTime string    `xml:"modification_time,omitempty"`
	Writable         string    `xml:"writable,omitempty"`
	InUse            string    `xml:"in_use,omitempty"`
	UserTags         *UserTags `xml:"user_tags,omitempty"`
	Owner            *struct {
		Text string `xml:",chardata"`
		Name string `xml:"name,omitempty"`
	} `xml:"owner,omitempty"`
	Observers   string   `xml:"observers,omitempty"`
	Alterable   string   `xml:"alterable,omitempty"`
	Config      *Config  `xml:"config,omitempty"`
	Target      *Target  `xml:"target,omitempty"`
	Scanner     *Scanner `xml:"scanner,omitempty"`
	Status      string   `xml:"status,omitempty"`
	Progress    string   `xml:"progress,omitempty"`
	ReportCount *struct {
		Text     string `xml:",chardata"`
		Finished string `xml:"finished,omitempty"`
	} `xml:"report_count,omitempty"`
	Trend    string `xml:"trend,omitempty"`
	Schedule *struct {
		Text     string `xml:",chardata"`
		ID       string `xml:"id,attr,omitempty"`
		Name     string `xml:"name,omitempty"`
		NextTime string `xml:"next_time,omitempty"`
	} `xml:"schedule,omitempty"`
	FirstReport *struct {
		Text   string `xml:",chardata"`
		Report *struct {
			Text        string `xml:",chardata"`
			ID          string `xml:"id,attr,omitempty"`
			Timestamp   string `xml:"timestamp,omitempty"`
			ResultCount *struct {
				Text    string `xml:",chardata"`
				Debug   string `xml:"debug,omitempty"`
				Hole    string `xml:"hole,omitempty"`
				Info    string `xml:"info,omitempty"`
				Log     string `xml:"log,omitempty"`
				Warning string `xml:"warning,omitempty"`
			} `xml:"result_count,omitempty"`
			Severity string `xml:"severity,omitempty"`
		} `xml:"report,omitempty"`
	} `xml:"first_report,omitempty"`
	LastReport *struct {
		Text   string `xml:",chardata"`
		Report *struct {
			Text        string `xml:",chardata"`
			ID          string `xml:"id,attr,omitempty"`
			Timestamp   string `xml:"timestamp,omitempty"`
			ResultCount *struct {
				Text    string `xml:",chardata"`
				Debug   string `xml:"debug,omitempty"`
				Hole    string `xml:"hole,omitempty"`
				Info    string `xml:"info,omitempty"`
				Log     string `xml:"log,omitempty"`
				Warning string `xml:"warning,omitempty"`
			} `xml:"result_count,omitempty"`
			Severity string `xml:"severity,omitempty"`
		} `xml:"report,omitempty"`
	} `xml:"last_report,omitempty"`
	SecondLastReport *struct {
		Text   string `xml:",chardata"`
		Report *struct {
			Text        string `xml:",chardata"`
			ID          string `xml:"id,attr,omitempty"`
			Timestamp   string `xml:"timestamp,omitempty"`
			ResultCount *struct {
				Text    string `xml:",chardata"`
				Debug   string `xml:"debug,omitempty"`
				Hole    string `xml:"hole,omitempty"`
				Info    string `xml:"info,omitempty"`
				Log     string `xml:"log,omitempty"`
				Warning string `xml:"warning,omitempty"`
			} `xml:"result_count,omitempty"`
			Severity string `xml:"severity,omitempty"`
		} `xml:"report,omitempty"`
	} `xml:"second_last_report,omitempty"`
	Alert *struct {
		Text string `xml:",chardata"`
		ID   string `xml:"id,attr,omitempty"`
		Name string `xml:"name,omitempty"`
	} `xml:"alert,omitempty"`
	Reports *struct {
		Text   string `xml:",chardata"`
		Report []struct {
			Text          string `xml:",chardata"`
			ID            string `xml:"id,attr,omitempty"`
			Timestamp     string `xml:"timestamp,omitempty"`
			ScanRunStatus string `xml:"scan_run_status,omitempty"`
			ResultCount   *struct {
				Text    string `xml:",chardata"`
				Debug   string `xml:"debug,omitempty"`
				Hole    string `xml:"hole,omitempty"`
				Info    string `xml:"info,omitempty"`
				Log     string `xml:"log,omitempty"`
				Warning string `xml:"warning,omitempty"`
			} `xml:"result_count,omitempty"`
			Severity string `xml:"severity,omitempty"`
		} `xml:"report,omitempty"`
		Preferences *struct {
			Text       string `xml:",chardata"`
			Preference []struct {
				Text        string `xml:",chardata"`
				Name        string `xml:"name,omitempty"`
				ScannerName string `xml:"scanner_name,omitempty"`
				Value       string `xml:"value,omitempty"`
			} `xml:"preference,omitempty"`
		} `xml:"preferences,omitempty"`
	} `xml:"reports,omitempty"`
}

Task .

type UserTags

type UserTags struct {
	Text  string `xml:",chardata"`
	Count string `xml:"count,omitempty"`
}

UserTags .

type Version

type Version int

Version 版本类型

const (
	Version4 Version = 4
	Version7         = 7
)

Version .

Jump to

Keyboard shortcuts

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