services

package
v1.26.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2023 License: Apache-2.0 Imports: 17 Imported by: 3

Documentation

Index

Constants

View Source
const (
	ArtifactoryName = "artifactory"

	GithubName = "github"

	GithubEnterpriseName = "githubEnterprise"

	BitbucketName = "bitbucket"

	BitbucketServerName = "bitbucketServerBasic"

	GitlabName = "gitlab"
)
View Source
const (
	DefaultPipelinesFileFilter = "pipelines.yml"
	SourcesRestApi             = "api/v1/pipelinesources/"
)

Variables

This section is empty.

Functions

func GetPipelineResourceID added in v1.25.0

func GetPipelineResourceID(client *jfroghttpclient.JfrogHttpClient, apiURL, repoName string, httpDetails httputils.HttpClientDetails) (int, bool, error)

GetPipelineResourceID fetches resource ID for given full repository name

Types

type CommitData added in v1.25.0

type CommitData struct {
	CommitSha string `json:"commitSha,omitempty"`
	Committer string `json:"committer,omitempty"`
	CommitMsg string `json:"commitMsg,omitempty"`
	Source    string `json:"source,omitempty"`
}

type Integration

type Integration struct {
	Name                  string   `json:"name,omitempty"`
	MasterIntegrationId   int      `json:"masterIntegrationId,omitempty"`
	MasterIntegrationName string   `json:"masterIntegrationName,omitempty"`
	ProjectId             int      `json:"projectId,omitempty"`
	Environments          []string `json:"environments,omitempty"`
	// Following fields returned when fetching or creating integration:
	Id int `json:"id,omitempty"`
}

type IntegrationAlreadyExistsError

type IntegrationAlreadyExistsError struct {
	InnerError error
}

func (*IntegrationAlreadyExistsError) Error

type IntegrationCreation

type IntegrationCreation struct {
	Integration
	FormJSONValues []jsonValues `json:"formJSONValues,omitempty"`
}

Using this separate struct for creation because FormJSONValues may have values of any type.

type IntegrationUnauthorizedError

type IntegrationUnauthorizedError struct {
	InnerError error
}

func (*IntegrationUnauthorizedError) Error

type IntegrationsService

type IntegrationsService struct {
	auth.ServiceDetails
	// contains filtered or unexported fields
}

func NewIntegrationsService

func NewIntegrationsService(client *jfroghttpclient.JfrogHttpClient) *IntegrationsService

func (*IntegrationsService) CreateArtifactoryIntegration

func (is *IntegrationsService) CreateArtifactoryIntegration(integrationName, url, user, apikey string) (id int, err error)

func (*IntegrationsService) CreateBitbucketIntegration

func (is *IntegrationsService) CreateBitbucketIntegration(integrationName, username, token string) (id int, err error)

func (*IntegrationsService) CreateBitbucketServerIntegration

func (is *IntegrationsService) CreateBitbucketServerIntegration(integrationName, url, username, passwordOrToken string) (id int, err error)

func (*IntegrationsService) CreateGithubEnterpriseIntegration

func (is *IntegrationsService) CreateGithubEnterpriseIntegration(integrationName, url, token string) (id int, err error)

func (*IntegrationsService) CreateGithubIntegration

func (is *IntegrationsService) CreateGithubIntegration(integrationName, token string) (id int, err error)

func (*IntegrationsService) CreateGitlabIntegration

func (is *IntegrationsService) CreateGitlabIntegration(integrationName, url, token string) (id int, err error)

func (*IntegrationsService) DeleteIntegration

func (is *IntegrationsService) DeleteIntegration(integrationId int) error

func (*IntegrationsService) GetAllIntegrations

func (is *IntegrationsService) GetAllIntegrations() ([]Integration, error)

func (*IntegrationsService) GetIntegrationById

func (is *IntegrationsService) GetIntegrationById(integrationId int) (*Integration, error)

func (*IntegrationsService) GetIntegrationByName

func (is *IntegrationsService) GetIntegrationByName(name string) (*Integration, error)

type PipelineResources added in v1.25.0

type PipelineResources struct {
	ValuesYmlPropertyBag     interface{} `json:"valuesYmlPropertyBag,omitempty"`
	PipelinesYmlPropertyBag  interface{} `json:"pipelinesYmlPropertyBag,omitempty"`
	ID                       int         `json:"id,omitempty"`
	Name                     interface{} `json:"name,omitempty"`
	ProjectID                int         `json:"projectId,omitempty"`
	ProjectIntegrationID     int         `json:"projectIntegrationId,omitempty"`
	RepositoryFullName       string      `json:"repositoryFullName,omitempty"`
	ConfigFolder             string      `json:"configFolder,omitempty"`
	IsMultiBranch            *bool       `json:"isMultiBranch,omitempty"`
	IsInternal               interface{} `json:"isInternal,omitempty"`
	Branch                   interface{} `json:"branch,omitempty"`
	BranchExcludePattern     string      `json:"branchExcludePattern,omitempty"`
	BranchIncludePattern     string      `json:"branchIncludePattern,omitempty"`
	FileFilter               string      `json:"fileFilter,omitempty"`
	Environments             interface{} `json:"environments,omitempty"`
	IsSyncing                *bool       `json:"isSyncing,omitempty"`
	LastSyncStatusCode       int         `json:"lastSyncStatusCode,omitempty"`
	LastSyncStartedAt        time.Time   `json:"lastSyncStartedAt,omitempty"`
	LastSyncEndedAt          time.Time   `json:"lastSyncEndedAt,omitempty"`
	LastSyncLogs             string      `json:"lastSyncLogs,omitempty"`
	ResourceID               int         `json:"resourceId,omitempty"`
	CreatedBy                int         `json:"createdBy,omitempty"`
	UpdatedBy                int         `json:"updatedBy,omitempty"`
	TemplateID               interface{} `json:"templateId,omitempty"`
	AccessResourceNamePrefix string      `json:"accessResourceNamePrefix,omitempty"`
	CreatedAt                time.Time   `json:"createdAt,omitempty"`
	UpdatedAt                time.Time   `json:"updatedAt,omitempty"`
}

type PipelineRunStatusResponse added in v1.25.0

type PipelineRunStatusResponse struct {
	TotalCount int         `json:"totalCount,omitempty"`
	Pipelines  []Pipelines `json:"pipelines,omitempty"`
}

type PipelineSyncStatus added in v1.25.0

type PipelineSyncStatus struct {
	CommitData                   CommitData `json:"commitData,omitempty"`
	ID                           int        `json:"id,omitempty"`
	ProjectID                    int        `json:"projectId,omitempty"`
	PipelineSourceID             int        `json:"pipelineSourceId,omitempty"`
	PipelineSourceBranch         string     `json:"pipelineSourceBranch,omitempty"`
	IsSyncing                    *bool      `json:"isSyncing,omitempty"`
	LastSyncStatusCode           int        `json:"lastSyncStatusCode,omitempty"`
	LastSyncStartedAt            time.Time  `json:"lastSyncStartedAt,omitempty"`
	LastSyncEndedAt              time.Time  `json:"lastSyncEndedAt,omitempty"`
	LastSyncLogs                 string     `json:"lastSyncLogs,omitempty"`
	IsMissingConfig              *bool      `json:"isMissingConfig,omitempty"`
	TriggeredByResourceVersionID int        `json:"triggeredByResourceVersionId,omitempty"`
	CreatedAt                    time.Time  `json:"createdAt,omitempty"`
	UpdatedAt                    time.Time  `json:"updatedAt,omitempty"`
}

type Pipelines added in v1.25.0

type Pipelines struct {
	ID                   int    `json:"id,omitempty"`
	Name                 string `json:"name,omitempty"`
	LatestCompletedRunID int    `json:"latestCompletedRunId,omitempty"`
	PipelineSourceBranch string `json:"pipelineSourceBranch,omitempty"`
	ProjectID            int    `json:"projectId,omitempty"`
	LatestRunID          int    `json:"latestRunId,omitempty"`
	PipelineSourceID     int    `json:"pipelineSourceId,omitempty"`
	Run                  Run    `json:"run,omitempty"`
}

type PipelinesNotAvailableError added in v0.23.0

type PipelinesNotAvailableError struct {
	InnerError error
}

func (*PipelinesNotAvailableError) Error added in v0.23.0

type PipelinesSystemInfo

type PipelinesSystemInfo struct {
	ServiceId string `json:"serviceId,omitempty"`
	Version   string `json:"version,omitempty"`
}

type Run added in v1.25.0

type Run struct {
	ID                int               `json:"id,omitempty"`
	RunNumber         int               `json:"runNumber,omitempty"`
	CreatedAt         time.Time         `json:"createdAt,omitempty"`
	StartedAt         time.Time         `json:"startedAt,omitempty"`
	EndedAt           time.Time         `json:"endedAt,omitempty"`
	StatusCode        int               `json:"statusCode,omitempty"`
	StaticPropertyBag StaticPropertyBag `json:"staticPropertyBag,omitempty"`
	DurationSeconds   int               `json:"durationSeconds,omitempty"`
}

type RunService added in v1.25.0

type RunService struct {
	auth.ServiceDetails
	// contains filtered or unexported fields
}

func NewRunService added in v1.25.0

func NewRunService(client *jfroghttpclient.JfrogHttpClient) *RunService

func (*RunService) CancelRun added in v1.25.0

func (rs *RunService) CancelRun(runID int) error

func (*RunService) GetRunStatus added in v1.25.0

func (rs *RunService) GetRunStatus(branch, pipeName string, isMultiBranch bool) (*PipelineRunStatusResponse, error)

func (*RunService) TriggerPipelineRun added in v1.25.0

func (rs *RunService) TriggerPipelineRun(branch, pipeline string, isMultiBranch bool) error

type Source

type Source struct {
	ProjectId            int    `json:"projectId,omitempty"`
	ProjectIntegrationId int    `json:"projectIntegrationId,omitempty"`
	RepositoryFullName   string `json:"repositoryFullName,omitempty"`
	Branch               string `json:"branch,omitempty"`
	FileFilter           string `json:"fileFilter,omitempty"`
	// For multibranch pipelines only:
	IsMultiBranch        bool   `json:"isMultiBranch,omitempty"`
	BranchExcludePattern string `json:"branchExcludePattern,omitempty"`
	BranchIncludePattern string `json:"branchIncludePattern,omitempty"`

	Id int `json:"id,omitempty"`
}

type SourceAlreadyExistsError

type SourceAlreadyExistsError struct {
	InnerError error
}

func (*SourceAlreadyExistsError) Error

type SourcesService

type SourcesService struct {
	auth.ServiceDetails
	// contains filtered or unexported fields
}

func NewSourcesService

func NewSourcesService(client *jfroghttpclient.JfrogHttpClient) *SourcesService

func (*SourcesService) AddSource

func (ss *SourcesService) AddSource(projectIntegrationId int, repositoryFullName, branch, fileFilter string) (id int, err error)

func (*SourcesService) DeleteSource

func (ss *SourcesService) DeleteSource(sourceId int) error

func (*SourcesService) GetSource

func (ss *SourcesService) GetSource(sourceId int) (*Source, error)

type StaticPropertyBag added in v1.25.0

type StaticPropertyBag struct {
	TriggeredByUserName    string `json:"triggeredByUserName,omitempty"`
	SignedPipelinesEnabled *bool  `json:"signedPipelinesEnabled,omitempty"`
}

type SyncService added in v1.25.0

type SyncService struct {
	auth.ServiceDetails
	// contains filtered or unexported fields
}

func NewSyncService added in v1.25.0

func NewSyncService(client *jfroghttpclient.JfrogHttpClient) *SyncService

func (*SyncService) GetHTTPClient added in v1.25.0

func (ss *SyncService) GetHTTPClient() *jfroghttpclient.JfrogHttpClient

func (*SyncService) GetHttpDetails added in v1.25.0

func (ss *SyncService) GetHttpDetails() httputils.HttpClientDetails

func (*SyncService) GetServiceURL added in v1.25.0

func (ss *SyncService) GetServiceURL() string

func (*SyncService) SyncPipelineSource added in v1.25.0

func (ss *SyncService) SyncPipelineSource(branch string, repoName string) error

SyncPipelineSource trigger sync for pipeline resource

type SyncStatusService added in v1.25.0

type SyncStatusService struct {
	auth.ServiceDetails
	// contains filtered or unexported fields
}

func NewSyncStatusService added in v1.25.0

func NewSyncStatusService(client *jfroghttpclient.JfrogHttpClient) *SyncStatusService

func (*SyncStatusService) GetSyncPipelineResourceStatus added in v1.25.0

func (ss *SyncStatusService) GetSyncPipelineResourceStatus(repoName, branch string) ([]PipelineSyncStatus, error)

GetSyncPipelineResourceStatus fetches pipeline sync status

type SystemService

type SystemService struct {
	auth.ServiceDetails
	// contains filtered or unexported fields
}

func NewSystemService

func NewSystemService(client *jfroghttpclient.JfrogHttpClient) *SystemService

func (*SystemService) GetSystemInfo

func (ss *SystemService) GetSystemInfo() (*PipelinesSystemInfo, error)

Jump to

Keyboard shortcuts

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