qualys

package module
v0.0.0-...-27cd2e1 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(v bool) *bool

Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.

func CheckResponse

func CheckResponse(r *http.Response) error

CheckResponse checks the API response for errors, and returns them if present.

func Int

func Int(v int) *int

Int is a helper routine that allocates a new int32 value to store v and returns a pointer to it, but unlike Int32 its argument value is an int.

func String

func String(v string) *string

String is a helper routine that allocates a new string value to store v and returns a pointer to it.

func Time

func Time(v time.Time) *time.Time

Time is a helper routine that allocates a new time.Time value to store v and returns a pointer to it.

Types

type BoolValue

type BoolValue bool

BoolValue is a boolean value with advanced json unmarshaling features.

func (*BoolValue) UnmarshalJSON

func (t *BoolValue) UnmarshalJSON(b []byte) error

UnmarshalJSON allows 1 and 0 to be considered as boolean values

type Client

type Client struct {

	// User agent used when communicating with the API.
	UserAgent string

	// Services used for talking to different parts of the API.
	GCPConnector *GCPConnectorService
	// contains filtered or unexported fields
}

A Client manages communication with the Qualys API.

func NewClient

func NewClient(baseURL, username, password string) *Client

NewClient returns a new API client with basicAuth

func (*Client) BaseURL

func (c *Client) BaseURL() *url.URL

BaseURL return a copy of the baseURL.

func (*Client) Do

func (c *Client) Do(req *http.Request, v interface{}) (*Response, error)

Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it.

func (*Client) NewRequest

func (c *Client) NewRequest(method, path string, opt interface{}) (*http.Request, error)

NewRequest creates an API request. A relative URL path can be provided in urlStr, in which case it is resolved relative to the base URL of the Client. Relative URL paths should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included as the request body.

func (*Client) SetBaseURL

func (c *Client) SetBaseURL(urlStr string) error

SetBaseURL sets the base URL for API requests to a custom endpoint. urlStr should always be specified with a trailing slash.

type CreateGCPConnectorOptions

type CreateGCPConnectorOptions struct {
	Name        *string `url:"name" json:"name"`
	Description *string `url:"description,omitempty" json:"description,omitempty"`
	ConfigFile  *string `url:"configFile" json:"configFile"`
}

CreateGCPConnectorOptions are options for creating a gcp connector.

type ErrorResponse

type ErrorResponse struct {
	Body     []byte
	Response *http.Response
	Message  string
}

An ErrorResponse reports one or more errors caused by an API request.

func (*ErrorResponse) Error

func (e *ErrorResponse) Error() string

type GCPConnector

type GCPConnector struct {
	ConnectorID  string `json:"connectorId"`
	Project      string `json:"projectId"`
	Description  string `json:"description"`
	Name         string `json:"name"`
	Provider     string `json:"provider"`
	LastSyncedOn string `json:"lastSyncedOn"`
	State        string `json:"state"`
	TotalAssets  int    `json:"totalAssets"`
	Groups       []struct {
		Name string `json:"name"`
		UUID string `json:"uuid"`
	} `json:"groups"`
}

GCPConnector represents a qualys cloudview gcp connector

type GCPConnectorService

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

GCPConnectorService supports /cloudview-api/rest/v1/gcp/connectors

func (*GCPConnectorService) Create

Create creates a gcp connector.

func (*GCPConnectorService) Delete

func (s *GCPConnectorService) Delete(id string) (*Response, error)

Delete deletes a gcp connector.

func (*GCPConnectorService) Get

Get gets a connector.

func (*GCPConnectorService) List

func (s *GCPConnectorService) List() ([]*GCPConnector, *Response, error)

List list all gcp connectors.

func (*GCPConnectorService) Modify

Modify updates a gcp connector.

type ISOTime

type ISOTime time.Time

ISOTime represents an ISO 8601 formatted date

func (ISOTime) MarshalJSON

func (t ISOTime) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

type ListOptions

type ListOptions struct {
	// For paginated result sets, page of results to retrieve.
	Page int `url:"page,omitempty" json:"page,omitempty"`

	// For paginated result sets, the number of results to include per page.
	PerPage int `url:"per_page,omitempty" json:"per_page,omitempty"`
}

ListOptions specifies the optional parameters to various List methods that support pagination.

type ModifyGCPConnectorOptions

type ModifyGCPConnectorOptions struct {
	Name        *string `url:"name,omitempty" json:"name,omitempty"`
	Description *string `url:"description,omitempty" json:"description,omitempty"`
	ConfigFile  *string `url:"configFile,omitempty" json:"configFile,omitempty"`
}

ModifyGCPConnectorOptions are options for updating a gcp connector.

type Response

type Response struct {
	*http.Response

	// These fields provide the page values for paginating through a set of
	// results. Any or all of these may be set to the zero value for
	// responses that are not part of a paginated set, or for which there
	// are no additional pages.
	TotalItems   int
	TotalPages   int
	ItemsPerPage int
	CurrentPage  int
	NextPage     int
	PreviousPage int
}

Response is a GitLab API response. This wraps the standard http.Response returned from GitLab and provides convenient access to things like pagination links.

Jump to

Keyboard shortcuts

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