client

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2021 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PasswordEncryptionTypes = []string{"PLAIN", "SHA", "LDAP_SHA", "MD4", "MD5"}
View Source
var WidgetCriteria = map[string]string{
	"Total":                "statistics$executions$total",
	"Passed":               "statistics$executions$passed",
	"Failed":               "statistics$executions$failed",
	"Skipped":              "statistics$executions$skipped",
	"Product Bug":          "statistics$defects$product_bug$pb001",
	"Automation Bug":       "statistics$defects$automation_bug$ab001",
	"System Issue":         "statistics$defects$system_issue$si001",
	"No Defect":            "statistics$defects$no_defect$nd001",
	"To Investigate":       "statistics$defects$to_investigate$ti001",
	"Product Bug Total":    "statistics$defects$product_bug$total",
	"Automation Bug Total": "statistics$defects$automation_bug$total",
	"System Issue Total":   "statistics$defects$system_issue$total",
	"No Defect Total":      "statistics$defects$no_defect$total",
	"To Investigate Total": "statistics$defects$to_investigate$total",
	"Start time":           "startTime",
	"End Time":             "endTime",
	"Name":                 "name",
	"Number":               "number",
	"Status":               "status",
}
View Source
var WidgetModes = map[string]string{
	"Launch":   "launch",
	"timeline": "day",
}
View Source
var WidgetTypes = map[string]string{

	"oldLineChart":                          "oldLineChart",
	"Launch statistics chart":               "statisticTrend",
	"Launch duration chart":                 "launchesDurationChart",
	"Failed cases trend chart":              "bugTrend",
	"Overall statistics":                    "overallStatistics",
	"Most failed test-cases table (TOP-20)": "topTestCases",
	"Flaky test cases table (TOP-20)":       "flakyTestCases",
}
View Source
var WidgetVisualizationOptions = map[string]string{
	"Area": "area-spline",
	"Bars": "bars",
}

Functions

This section is empty.

Types

type AddWidgetRequest

type AddWidgetRequest struct {
	AddWidget Widget `json:"addWidget"`
}

type Client

type Client struct {
	HostUrl    string
	HTTPClient HttpClient
	Token      string
}

func NewClient

func NewClient(config *ReportPortalClientConfig, httpClient HttpClient) (*Client, error)

func (*Client) AddWidgetIntoDashboard

func (c *Client) AddWidgetIntoDashboard(projectName string, dashboardId *int, widget *Widget) error

func (*Client) CreateAuthLdapSettings

func (c *Client) CreateAuthLdapSettings(config *LdapIntegrationParameters) (*LdapSettings, error)

func (*Client) CreateDashboard

func (c *Client) CreateDashboard(d CreateDashboardRequest) (*int, error)

func (*Client) CreateFilterByProject

func (c *Client) CreateFilterByProject(projectName string, filter *Filter) (*CreateFilterByProjectResponse, error)

func (*Client) CreateProject

func (c *Client) CreateProject(projectName *string) (*CreateProjectResponse, error)

func (*Client) CreateWidgetByProject

func (c *Client) CreateWidgetByProject(projectName *string, widgetParameters *WidgetInputPayload) (*WidgetCreationResponseModel, error)

func (*Client) DeleteDashboardById

func (c *Client) DeleteDashboardById(projectName *string, dashboardId *int) error

func (*Client) DeleteFilterByProjectAndId

func (c *Client) DeleteFilterByProjectAndId(projectName string, filterId int) error

func (*Client) DeleteIntegration

func (c *Client) DeleteIntegration(id *int) error

func (*Client) DeleteProject

func (c *Client) DeleteProject(projectId *int) error

func (*Client) GetAllProjects

func (c *Client) GetAllProjects() (*GetAllProjectsResponse, error)

func (*Client) GetDashboardById

func (c *Client) GetDashboardById(projectName string, dashboardId *int) (*GetDashboardByIdResponse, error)

func (*Client) GetFilterByProjectAndId

func (c *Client) GetFilterByProjectAndId(projectName string, filterId int) (*Filter, error)

func (*Client) GetFiltersByProject

func (c *Client) GetFiltersByProject(projectName string, filter *FilterQuery, pagination *PaginationQuery) (*GetFiltersByProjectResponse, error)

func (*Client) GetProjectByName

func (c *Client) GetProjectByName(projectName *string) (*GetProjectByNameResponse, error)

func (*Client) ReadFullWidgetDataByProjectName

func (c *Client) ReadFullWidgetDataByProjectName(projectName *string, widgetId *string) (*FullWidgetModel, error)

func (*Client) ReadLdapAuthSettings

func (c *Client) ReadLdapAuthSettings() (*LdapSettings, error)

func (*Client) UpdateAuthLdapSettings

func (c *Client) UpdateAuthLdapSettings(config *LdapIntegrationParameters) (*LdapSettings, error)

func (*Client) UpdateDashboard

func (c *Client) UpdateDashboard(updateDashboardRequest *UpdateDashboardRequest) error

func (*Client) UpdateFilterByProjectAndId

func (c *Client) UpdateFilterByProjectAndId(projectName string, filter Filter) error

func (*Client) UpdateWidgetByProject

func (c *Client) UpdateWidgetByProject(projectName *string, widgetId *string, widgetParameters *WidgetInputPayload) error

type Condition

type Condition struct {
	FilteringField string `json:"filteringField"`
	Condition      string `json:"condition"`
	Value          string `json:"value"`
}

type CreateDashboardRequest

type CreateDashboardRequest struct {
	ProjectName string `json:"-"`
	Description string `json:"description"`
	Name        string `json:"name"`
	Share       bool   `json:"share"`
}

type CreateDashboardResponse

type CreateDashboardResponse struct {
	Id int `json:"id"`
}

type CreateFilterByProjectResponse

type CreateFilterByProjectResponse struct {
	Id int `json:"id"`
}

type CreateProjectRequest

type CreateProjectRequest struct {
	EntryType   string `json:"entryType"`
	ProjectName string `json:"projectName"`
}

type CreateProjectResponse

type CreateProjectResponse struct {
	Id int `json:"id"`
}

type Filter

type Filter struct {
	Owner       string      `json:"owner,omitempty"`
	Share       bool        `json:"share"`
	Id          int         `json:"id,omitempty"`
	Name        string      `json:"name"`
	Conditions  []Condition `json:"conditions"`
	Orders      []Order     `json:"orders"`
	Type        string      `json:"type"`
	Description string      `json:"description,omitempty"`
}

type FilterQuery

type FilterQuery struct {
	Id        *int    `url:"filter.eq.id,omitempty"`
	Name      *string `url:"filter.eq.name,omitempty"`
	Owner     *string `url:"filter.eq.owner,omitempty"`
	ProjectId *int    `url:"filter.eq.projectId,omitempty"`
	Shared    *bool   `url:"filter.eq.shared,omitempty"`
}

type FullWidgetModel

type FullWidgetModel struct {
	AppliedFilters []Filter `json:"appliedFilters"`
	// TODO: Content may be never be used in TF, but could be useful for a generic RP client
	//Content           struct{}                `json:"content"`
	ContentParameters WidgetContentParameters `json:"contentParameters"`
	Description       string                  `json:"description"`
	Id                int                     `json:"id"`
	Name              string                  `json:"name"`
	Owner             string                  `json:"owner"`
	Share             bool                    `json:"share"`
	WidgetType        string                  `json:"widgetType"`
}

type GetAllProjectsResponse

type GetAllProjectsResponse struct {
	Content []Project `json:"content"`
}

type GetDashboardByIdResponse

type GetDashboardByIdResponse struct {
	Description string   `json:"description"`
	Name        string   `json:"name"`
	Owner       string   `json:"owner"`
	Share       bool     `json:"share"`
	Widgets     []Widget `json:"widgets"`
}

type GetFiltersByProjectResponse

type GetFiltersByProjectResponse struct {
	Content []Filter           `json:"content"`
	Page    PaginationResponse `json:"page"`
}

type GetProjectByNameResponse

type GetProjectByNameResponse struct {
	Project
	LaunchesPerUser  []LaunchPerUser `json:"launchesPerUser"`
	LaunchesPerWeek  string          `json:"launchesPerWeek"`
	LaunchesQuantity int             `json:"launchesQuantity"`
	Organization     string          `json:"organization"`
	UniqueTickets    int             `json:"uniqueTickets"`
	UsersQuantity    int             `json:"usersQuantity"`
}

type HttpClient

type HttpClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type LaunchPerUser

type LaunchPerUser struct {
	Count    int    `json:"count"`
	FullName string `json:"fullName"`
}

type LdapIntegrationParameters

type LdapIntegrationParameters struct {
	Enabled             bool   `json:"-"`
	PasswordEncoderType string `json:"passwordEncoderType"`
	Url                 string `json:"url"`
	BaseDn              string `json:"baseDn"`
	Email               string `json:"email"`
	UserDnPattern       string `json:"userDnPattern"`
	UserSearchFilter    string `json:"userSearchFilter"`
	GroupSearchBase     string `json:"groupSearchBase"`
	GroupSearchFilter   string `json:"groupSearchFilter"`
	PasswordAttribute   string `json:"passwordAttribute"`
	FullName            string `json:"fullName"`
	Photo               string `json:"photo"`
	ManagerDn           string `json:"managerDn"`
	ManagerPassword     string `json:"managerPassword"`
}

type LdapIntegrationPayload

type LdapIntegrationPayload struct {
	Enabled               bool                       `json:"enabled"`
	IntegrationParameters *LdapIntegrationParameters `json:"integrationParameters"`
	Name                  string                     `json:"name"`
}

type LdapSettings

type LdapSettings struct {
	Id             *int `json:"id"`
	LdapAttributes struct {
		Enabled                   *bool   `json:"enabled"`
		Url                       *string `json:"url"`
		BaseDn                    *string `json:"baseDn"`
		SynchronizationAttributes struct {
			Email    *string `json:"email"`
			FullName *string `json:"fullName"`
			Photo    *string `json:"photo"`
		} `json:"synchronizationAttributes"`
	} `json:"ldapAttributes"`
	UserDnPattern       *string `json:"userDnPattern"`
	UserSearchFilter    *string `json:"userSearchFilter"`
	GroupSearchBase     *string `json:"groupSearchBase"`
	GroupSearchFilter   *string `json:"groupSearchFilter"`
	PasswordEncoderType *string `json:"passwordEncoderType"`
	PasswordAttribute   *string `json:"passwordAttribute"`
	ManagerDn           *string `json:"managerDn"`
	ManagerPassword     *string `json:"managerPassword"`
}

func (*LdapSettings) String

func (l *LdapSettings) String()

type Order

type Order struct {
	SortingColumn string `json:"sortingColumn"`
	IsAsc         bool   `json:"isAsc"`
}

type PaginationQuery

type PaginationQuery struct {
	Page *int    `url:"page,omitempty"`
	Size *int    `url:"size,omitempty"`
	Sort *string `url:"sort,omitempty"`
}

type PaginationResponse

type PaginationResponse struct {
	Number        int `json:"number"`
	Size          int `json:"size"`
	TotalElements int `json:"totalElements"`
	TotalPages    int `json:"totalPages"`
}

type Project

type Project struct {
	Id               int    `json:"id"`
	ProjectName      string `json:"projectName"`
	UsersQuantity    int    `json:"usersQuantity"`
	LaunchesQuantity int    `json:"launchesQuantity"`
	LastRun          int    `json:"lastRun"`
	CreationDate     int    `json:"creationDate"`
	EntryType        string `json:"entryType"`
}

type ReportPortalClientConfig

type ReportPortalClientConfig struct {
	Username, Password, Host string
}

type UpdateDashboardRequest

type UpdateDashboardRequest struct {
	DashboardId   int      `json:"-"`
	UpdateWidgets []Widget `json:"updateWidgets"`
	CreateDashboardRequest
}

type Widget

type Widget struct {
	Share          bool   `json:"share"`
	WidgetId       int    `json:"widgetId"`
	WidgetName     string `json:"widgetName"`
	WidgetPosition struct {
		PositionX int `json:"positionX"`
		PositionY int `json:"positionY"`
	} `json:"widgetPosition"`
	WidgetSize struct {
		Height int `json:"height"`
		Width  int `json:"width"`
	} `json:"widgetSize"`
	WidgetType string `json:"widgetType"`
}

type WidgetContentParameters

type WidgetContentParameters struct {
	ContentFields []string               `json:"contentFields"`
	ItemsCount    int                    `json:"itemsCount"`
	WidgetOptions map[string]interface{} `json:"widgetOptions"`
}

type WidgetCreationResponseModel

type WidgetCreationResponseModel struct {
	Id int `json:"id"`
}

type WidgetInputPayload

type WidgetInputPayload struct {
	ContentParameters WidgetContentParameters `json:"contentParameters"`
	Description       string                  `json:"description"`
	FilterIds         []interface{}           `json:"filterIds"`
	Name              string                  `json:"name"`
	Share             bool                    `json:"share"`
	WidgetType        string                  `json:"widgetType"`
}

Jump to

Keyboard shortcuts

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