pulp_client

package
v0.0.0-...-8ebdd08 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	COMPLETED string = "completed"
	WAITING   string = "waiting"
	RUNNING   string = "running"
	SKIPPED   string = "skipped"
	CANCELED  string = "canceled"
	CANCELING string = "canceling"
	FAILED    string = "failed"
)
View Source
const COMPOSITE_GUARD_NAME = "composite_guard"
View Source
const DefaultDomain = "default"
View Source
const DownloadPolicyImmediate = "immediate"
View Source
const DownloadPolicyOnDemand = "on_demand"
View Source
const ORG_ID_GUARD_NAME = "org_id_guard"
View Source
const ORG_ID_JQ_FILTER = ".identity.org_id"
View Source
const TURNPIKE_GUARD_NAME = "turnpike_guard"
View Source
const TURNPIKE_JQ_FILTER = ".identity.x509.subject_dn"

Variables

This section is empty.

Functions

func S3StorageConfiguration

func S3StorageConfiguration() map[string]interface{}

func SelectCreatedVersionHref

func SelectCreatedVersionHref(task *zest.TaskResponse, regex string) *string

SelectCreatedVersionHref scans a tasks CreatedResources and looks for a match to a regular expression

func SelectPublicationHref

func SelectPublicationHref(task *zest.TaskResponse) *string

func SelectRpmDistributionHref

func SelectRpmDistributionHref(task *zest.TaskResponse) *string

func SelectVersionHref

func SelectVersionHref(task *zest.TaskResponse) *string

func SleepWithBackoff

func SleepWithBackoff(iteration int)

func TaskErrorString

func TaskErrorString(task zest.TaskResponse) string

Types

type MockPulpClient

type MockPulpClient struct {
	mock.Mock
}

MockPulpClient is an autogenerated mock type for the PulpClient type

func NewMockPulpClient

func NewMockPulpClient(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockPulpClient

NewMockPulpClient creates a new instance of MockPulpClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockPulpClient) CancelTask

func (_m *MockPulpClient) CancelTask(ctx context.Context, taskHref string) (zest.TaskResponse, error)

CancelTask provides a mock function with given fields: ctx, taskHref

func (*MockPulpClient) CreateOrUpdateGuardsForOrg

func (_m *MockPulpClient) CreateOrUpdateGuardsForOrg(ctx context.Context, orgId string) (string, error)

CreateOrUpdateGuardsForOrg provides a mock function with given fields: ctx, orgId

func (*MockPulpClient) CreateRpmDistribution

func (_m *MockPulpClient) CreateRpmDistribution(ctx context.Context, publicationHref string, name string, basePath string, contentGuardHref *string) (*string, error)

CreateRpmDistribution provides a mock function with given fields: ctx, publicationHref, name, basePath, contentGuardHref

func (*MockPulpClient) CreateRpmPublication

func (_m *MockPulpClient) CreateRpmPublication(ctx context.Context, versionHref string) (*string, error)

CreateRpmPublication provides a mock function with given fields: ctx, versionHref

func (*MockPulpClient) CreateRpmRemote

func (_m *MockPulpClient) CreateRpmRemote(ctx context.Context, name string, url string, clientCert *string, clientKey *string, caCert *string) (*zest.RpmRpmRemoteResponse, error)

CreateRpmRemote provides a mock function with given fields: ctx, name, url, clientCert, clientKey, caCert

func (*MockPulpClient) CreateRpmRepository

func (_m *MockPulpClient) CreateRpmRepository(ctx context.Context, uuid string, rpmRemotePulpRef *string) (*zest.RpmRpmRepositoryResponse, error)

CreateRpmRepository provides a mock function with given fields: ctx, uuid, rpmRemotePulpRef

func (*MockPulpClient) DeleteRpmDistribution

func (_m *MockPulpClient) DeleteRpmDistribution(ctx context.Context, rpmDistributionHref string) (string, error)

DeleteRpmDistribution provides a mock function with given fields: ctx, rpmDistributionHref

func (*MockPulpClient) DeleteRpmRemote

func (_m *MockPulpClient) DeleteRpmRemote(ctx context.Context, pulpHref string) (string, error)

DeleteRpmRemote provides a mock function with given fields: ctx, pulpHref

func (*MockPulpClient) DeleteRpmRepository

func (_m *MockPulpClient) DeleteRpmRepository(ctx context.Context, rpmRepositoryHref string) (string, error)

DeleteRpmRepository provides a mock function with given fields: ctx, rpmRepositoryHref

func (*MockPulpClient) DeleteRpmRepositoryVersion

func (_m *MockPulpClient) DeleteRpmRepositoryVersion(ctx context.Context, href string) (string, error)

DeleteRpmRepositoryVersion provides a mock function with given fields: ctx, href

func (*MockPulpClient) FindDistributionByPath

func (_m *MockPulpClient) FindDistributionByPath(ctx context.Context, path string) (*zest.RpmRpmDistributionResponse, error)

FindDistributionByPath provides a mock function with given fields: ctx, path

func (*MockPulpClient) FindRpmPublicationByVersion

func (_m *MockPulpClient) FindRpmPublicationByVersion(ctx context.Context, versionHref string) (*zest.RpmRpmPublicationResponse, error)

FindRpmPublicationByVersion provides a mock function with given fields: ctx, versionHref

func (*MockPulpClient) GetContentPath

func (_m *MockPulpClient) GetContentPath(ctx context.Context) (string, error)

GetContentPath provides a mock function with given fields: ctx

func (*MockPulpClient) GetRpmRemoteByName

func (_m *MockPulpClient) GetRpmRemoteByName(ctx context.Context, name string) (*zest.RpmRpmRemoteResponse, error)

GetRpmRemoteByName provides a mock function with given fields: ctx, name

func (*MockPulpClient) GetRpmRemoteList

func (_m *MockPulpClient) GetRpmRemoteList(ctx context.Context) ([]zest.RpmRpmRemoteResponse, error)

GetRpmRemoteList provides a mock function with given fields: ctx

func (*MockPulpClient) GetRpmRepositoryByName

func (_m *MockPulpClient) GetRpmRepositoryByName(ctx context.Context, name string) (*zest.RpmRpmRepositoryResponse, error)

GetRpmRepositoryByName provides a mock function with given fields: ctx, name

func (*MockPulpClient) GetRpmRepositoryByRemote

func (_m *MockPulpClient) GetRpmRepositoryByRemote(ctx context.Context, pulpHref string) (*zest.RpmRpmRepositoryResponse, error)

GetRpmRepositoryByRemote provides a mock function with given fields: ctx, pulpHref

func (*MockPulpClient) GetRpmRepositoryVersion

func (_m *MockPulpClient) GetRpmRepositoryVersion(ctx context.Context, href string) (*zest.RepositoryVersionResponse, error)

GetRpmRepositoryVersion provides a mock function with given fields: ctx, href

func (*MockPulpClient) GetTask

func (_m *MockPulpClient) GetTask(ctx context.Context, taskHref string) (zest.TaskResponse, error)

GetTask provides a mock function with given fields: ctx, taskHref

func (*MockPulpClient) LookupDomain

func (_m *MockPulpClient) LookupDomain(ctx context.Context, name string) (string, error)

LookupDomain provides a mock function with given fields: ctx, name

func (*MockPulpClient) LookupOrCreateDomain

func (_m *MockPulpClient) LookupOrCreateDomain(ctx context.Context, name string) (string, error)

LookupOrCreateDomain provides a mock function with given fields: ctx, name

func (*MockPulpClient) OrphanCleanup

func (_m *MockPulpClient) OrphanCleanup(ctx context.Context) (string, error)

OrphanCleanup provides a mock function with given fields: ctx

func (*MockPulpClient) PollTask

func (_m *MockPulpClient) PollTask(ctx context.Context, taskHref string) (*zest.TaskResponse, error)

PollTask provides a mock function with given fields: ctx, taskHref

func (*MockPulpClient) RepairRpmRepositoryVersion

func (_m *MockPulpClient) RepairRpmRepositoryVersion(ctx context.Context, href string) (string, error)

RepairRpmRepositoryVersion provides a mock function with given fields: ctx, href

func (*MockPulpClient) Status

func (_m *MockPulpClient) Status(ctx context.Context) (*zest.StatusResponse, error)

Status provides a mock function with given fields: ctx

func (*MockPulpClient) SyncRpmRepository

func (_m *MockPulpClient) SyncRpmRepository(ctx context.Context, rpmRpmRepositoryHref string, remoteHref *string) (string, error)

SyncRpmRepository provides a mock function with given fields: ctx, rpmRpmRepositoryHref, remoteHref

func (*MockPulpClient) UpdateDomainIfNeeded

func (_m *MockPulpClient) UpdateDomainIfNeeded(ctx context.Context, name string) error

UpdateDomainIfNeeded provides a mock function with given fields: ctx, name

func (*MockPulpClient) UpdateRpmDistribution

func (_m *MockPulpClient) UpdateRpmDistribution(ctx context.Context, rpmDistributionHref string, rpmPublicationHref string, distributionName string, basePath string) (string, error)

UpdateRpmDistribution provides a mock function with given fields: ctx, rpmDistributionHref, rpmPublicationHref, distributionName, basePath

func (*MockPulpClient) UpdateRpmRemote

func (_m *MockPulpClient) UpdateRpmRemote(ctx context.Context, pulpHref string, url string, clientCert *string, clientKey *string, caCert *string) (string, error)

UpdateRpmRemote provides a mock function with given fields: ctx, pulpHref, url, clientCert, clientKey, caCert

func (*MockPulpClient) WithDomain

func (_m *MockPulpClient) WithDomain(domainName string) PulpClient

WithDomain provides a mock function with given fields: domainName

func (*MockPulpClient) WithDomainMock

func (m *MockPulpClient) WithDomainMock() *MockPulpClient

type MockPulpGlobalClient

type MockPulpGlobalClient struct {
	mock.Mock
}

MockPulpGlobalClient is an autogenerated mock type for the PulpGlobalClient type

func NewMockPulpGlobalClient

func NewMockPulpGlobalClient(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockPulpGlobalClient

NewMockPulpGlobalClient creates a new instance of MockPulpGlobalClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockPulpGlobalClient) CancelTask

func (_m *MockPulpGlobalClient) CancelTask(ctx context.Context, taskHref string) (zest.TaskResponse, error)

CancelTask provides a mock function with given fields: ctx, taskHref

func (*MockPulpGlobalClient) GetContentPath

func (_m *MockPulpGlobalClient) GetContentPath(ctx context.Context) (string, error)

GetContentPath provides a mock function with given fields: ctx

func (*MockPulpGlobalClient) GetTask

func (_m *MockPulpGlobalClient) GetTask(ctx context.Context, taskHref string) (zest.TaskResponse, error)

GetTask provides a mock function with given fields: ctx, taskHref

func (*MockPulpGlobalClient) LookupDomain

func (_m *MockPulpGlobalClient) LookupDomain(ctx context.Context, name string) (string, error)

LookupDomain provides a mock function with given fields: ctx, name

func (*MockPulpGlobalClient) LookupOrCreateDomain

func (_m *MockPulpGlobalClient) LookupOrCreateDomain(ctx context.Context, name string) (string, error)

LookupOrCreateDomain provides a mock function with given fields: ctx, name

func (*MockPulpGlobalClient) PollTask

func (_m *MockPulpGlobalClient) PollTask(ctx context.Context, taskHref string) (*zest.TaskResponse, error)

PollTask provides a mock function with given fields: ctx, taskHref

func (*MockPulpGlobalClient) UpdateDomainIfNeeded

func (_m *MockPulpGlobalClient) UpdateDomainIfNeeded(ctx context.Context, name string) error

UpdateDomainIfNeeded provides a mock function with given fields: ctx, name

type PulpClient

type PulpClient interface {
	// Remotes
	CreateRpmRemote(ctx context.Context, name string, url string, clientCert *string, clientKey *string, caCert *string) (*zest.RpmRpmRemoteResponse, error)
	UpdateRpmRemote(ctx context.Context, pulpHref string, url string, clientCert *string, clientKey *string, caCert *string) (string, error)
	GetRpmRemoteByName(ctx context.Context, name string) (*zest.RpmRpmRemoteResponse, error)
	GetRpmRemoteList(ctx context.Context) ([]zest.RpmRpmRemoteResponse, error)
	DeleteRpmRemote(ctx context.Context, pulpHref string) (string, error)

	// Content Guards
	CreateOrUpdateGuardsForOrg(ctx context.Context, orgId string) (string, error)

	// Tasks
	GetTask(ctx context.Context, taskHref string) (zest.TaskResponse, error)
	PollTask(ctx context.Context, taskHref string) (*zest.TaskResponse, error)
	CancelTask(ctx context.Context, taskHref string) (zest.TaskResponse, error)
	GetContentPath(ctx context.Context) (string, error)

	// Rpm Repository
	CreateRpmRepository(ctx context.Context, uuid string, rpmRemotePulpRef *string) (*zest.RpmRpmRepositoryResponse, error)
	GetRpmRepositoryByName(ctx context.Context, name string) (*zest.RpmRpmRepositoryResponse, error)
	GetRpmRepositoryByRemote(ctx context.Context, pulpHref string) (*zest.RpmRpmRepositoryResponse, error)
	SyncRpmRepository(ctx context.Context, rpmRpmRepositoryHref string, remoteHref *string) (string, error)
	DeleteRpmRepository(ctx context.Context, rpmRepositoryHref string) (string, error)

	// Rpm Repository Version
	GetRpmRepositoryVersion(ctx context.Context, href string) (*zest.RepositoryVersionResponse, error)
	DeleteRpmRepositoryVersion(ctx context.Context, href string) (string, error)
	RepairRpmRepositoryVersion(ctx context.Context, href string) (string, error)

	// RpmPublication
	CreateRpmPublication(ctx context.Context, versionHref string) (*string, error)
	FindRpmPublicationByVersion(ctx context.Context, versionHref string) (*zest.RpmRpmPublicationResponse, error)

	// Distribution
	CreateRpmDistribution(ctx context.Context, publicationHref string, name string, basePath string, contentGuardHref *string) (*string, error)
	FindDistributionByPath(ctx context.Context, path string) (*zest.RpmRpmDistributionResponse, error)
	DeleteRpmDistribution(ctx context.Context, rpmDistributionHref string) (string, error)
	UpdateRpmDistribution(ctx context.Context, rpmDistributionHref string, rpmPublicationHref string, distributionName string, basePath string) (string, error)

	// Domains
	LookupOrCreateDomain(ctx context.Context, name string) (string, error)
	LookupDomain(ctx context.Context, name string) (string, error)
	UpdateDomainIfNeeded(ctx context.Context, name string) error

	// Status
	Status(ctx context.Context) (*zest.StatusResponse, error)

	// Orphans
	OrphanCleanup(ctx context.Context) (string, error)

	// Chainable
	WithDomain(domainName string) PulpClient
}

func GetPulpClientWithDomain

func GetPulpClientWithDomain(domainName string) PulpClient

type PulpGlobalClient

type PulpGlobalClient interface {
	// Domains
	LookupOrCreateDomain(ctx context.Context, name string) (string, error)
	LookupDomain(ctx context.Context, name string) (string, error)
	UpdateDomainIfNeeded(ctx context.Context, name string) error

	// Tasks
	GetTask(ctx context.Context, taskHref string) (zest.TaskResponse, error)
	PollTask(ctx context.Context, taskHref string) (*zest.TaskResponse, error)
	CancelTask(ctx context.Context, taskHref string) (zest.TaskResponse, error)
	GetContentPath(ctx context.Context) (string, error)
}

func GetGlobalPulpClient

func GetGlobalPulpClient() PulpGlobalClient

Jump to

Keyboard shortcuts

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