client

package
v2.36.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: Apache-2.0 Imports: 73 Imported by: 57

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAPIKey

func IsAPIKey(apiKey string) bool

func IsNil

func IsNil(i interface{}) bool

Types

type AccessToken added in v2.32.0

type AccessToken struct {
	Value string
	ICredential
}

func NewAccessToken added in v2.32.0

func NewAccessToken(accessToken string) (*AccessToken, error)

func (*AccessToken) GetHeaderValue added in v2.32.0

func (accessToken *AccessToken) GetHeaderValue() (string, string)

type ApiKey added in v2.32.0

type ApiKey struct {
	Value string
	ICredential
}

func NewApiKey added in v2.32.0

func NewApiKey(apiKey string) (*ApiKey, error)

func (*ApiKey) GetHeaderValue added in v2.32.0

func (apikey *ApiKey) GetHeaderValue() (string, string)

type Client

type Client struct {
	Accounts                       *accounts.AccountService
	ActionTemplates                *actiontemplates.ActionTemplateService
	APIKeys                        *users.ApiKeyService
	Artifacts                      *artifacts.ArtifactService
	Authentication                 *authentication.AuthenticationService
	AzureDevOpsConnectivityCheck   *devops.AzureDevOpsConnectivityCheckService
	AzureEnvironments              *azure.AzureEnvironmentService
	BuildInformation               *buildinformation.BuildInformationService
	CertificateConfiguration       *configuration.CertificateConfigurationService
	Certificates                   *certificates.CertificateService
	Channels                       *channels.ChannelService
	CloudTemplate                  *cloudtemplate.CloudTemplateService
	CommunityActionTemplates       *actions.CommunityActionTemplateService
	Configuration                  *configuration.ConfigurationService
	GitCredentials                 *credentials.Service
	DashboardConfigurations        *dashboard.DashboardConfigurationService
	Dashboards                     *dashboard.DashboardService
	DeploymentProcesses            *deployments.DeploymentProcessService
	Deployments                    *deployments.DeploymentService
	DynamicExtensions              *extensions.DynamicExtensionService
	Environments                   *environments.EnvironmentService
	Events                         *events.EventService
	ExternalSecurityGroupProviders *externalsecuritygroupproviders.ExternalSecurityGroupProviderService
	FeaturesConfiguration          *configuration.FeaturesConfigurationService
	Feeds                          *feeds.FeedService
	Interruptions                  *interruptions.InterruptionService
	Invitations                    *invitations.InvitationService
	IssueTrackers                  *issuetrackers.IssueTrackerService
	JiraIntegration                *jira.JiraIntegrationService
	LetsEncryptConfiguration       *configuration.LetsEncryptConfigurationService
	LibraryVariableSets            *variables.LibraryVariableSetService
	Licenses                       *licenses.LicenseService
	Lifecycles                     *lifecycles.LifecycleService
	MachinePolicies                *machines.MachinePolicyService
	MachineRoles                   *machines.MachineRoleService
	Machines                       *machines.MachineService
	MaintenanceConfiguration       *configuration.MaintenanceConfigurationService
	Migrations                     *migrations.MigrationService
	OctopusPackageMetadata         *packages.OctopusPackageMetadataService
	OctopusServerNodes             *octopusservernodes.OctopusServerNodeService
	Packages                       *packages.PackageService
	PackageMetadata                *packages.PackageMetadataService
	PerformanceConfiguration       *configuration.PerformanceConfigurationService
	Permissions                    *permissions.PermissionService
	ProjectGroups                  *projectgroups.ProjectGroupService
	Projects                       *projects.ProjectService
	ProjectBranches                *projectbranches.ProjectBranchesService
	ProjectVariables               *projectvariables.ProjectVariableService
	ProjectTriggers                *triggers.ProjectTriggerService
	Proxies                        *proxies.ProxyService
	Releases                       *releases.ReleaseService
	Reporting                      *reporting.ReportingService
	RunbookProcesses               *runbooks.RunbookProcessService
	RunbookRuns                    *runbooks.RunbookRunService
	Runbooks                       *runbooks.RunbookService
	RunbookSnapshots               *runbooks.RunbookSnapshotService
	Root                           *RootService
	ScheduledProjectTriggers       *triggers.ScheduledProjectTriggerService
	Scheduler                      *scheduler.SchedulerService
	ScopedUserRoles                *userroles.ScopedUserRoleService
	ScriptModules                  *variables.ScriptModuleService
	ServerConfiguration            *configuration.ServerConfigurationService
	ServerStatus                   *serverstatus.ServerStatusService
	SmtpConfiguration              *configuration.SmtpConfigurationService
	Spaces                         *spaces.SpaceService
	Subscriptions                  *subscriptions.SubscriptionService
	TagSets                        *tagsets.TagSetService
	Tasks                          *tasks.TaskService
	TeamMembership                 *teammembership.TeamMembershipService
	Teams                          *teams.TeamService
	Tenants                        *tenants.TenantService
	TenantVariables                *variables.TenantVariableService
	UpgradeConfiguration           *configuration.UpgradeConfigurationService
	UserOnboarding                 *useronboarding.UserOnboardingService
	UserRoles                      *userroles.UserRoleService
	Users                          *users.UserService
	Variables                      *variables.VariableService
	WorkerPools                    *workerpools.WorkerPoolService
	Workers                        *machines.WorkerService
	WorkerToolsLatestImages        *workertoolslatestimages.WorkerToolsLatestImageService
	// contains filtered or unexported fields
}

Client is an OctopusDeploy for making Octopus API requests.

func GetFakeOctopusClient

func GetFakeOctopusClient(t *testing.T, apiPath string, statusCode int, responseBody string) (*Client, error)

GetFakeOctopusClient -

func NewClient

func NewClient(httpClient *http.Client, apiURL *url.URL, apiKey string, spaceID string) (*Client, error)

NewClient returns a new Octopus API client. If a nil client is provided, a new http.Client will be used.

func NewClientForTool added in v2.17.0

func NewClientForTool(httpClient *http.Client, apiURL *url.URL, apiKey string, spaceID string, requestingTool string) (*Client, error)

NewClientForTool returns a new Octopus API client with a tool reference in the useragent string. If a nil client is provided, a new http.Client will be used.

func NewClientWithAccessToken added in v2.31.0

func NewClientWithAccessToken(httpClient *http.Client, apiURL *url.URL, accessToken string, spaceID string) (*Client, error)

NewClientWithAccessToken returns a new Octopus API client using an access token instead of an api key. If a nil client is provided, a new http.Client will be used.

func NewClientWithCredentials added in v2.31.0

func NewClientWithCredentials(httpClient *http.Client, apiURL *url.URL, apiCredentials ICredential, spaceID string, requestingTool string) (*Client, error)

NewClientWithCredentials returns a new Octopus API client with the specified credentials and a tool reference in the useragent string. If a nil client is provided, a new http.Client will be used.

func (*Client) GetSpaceID added in v2.33.0

func (n *Client) GetSpaceID() string

func (*Client) HttpSession added in v2.6.0

func (n *Client) HttpSession() *newclient.HttpSession

confirm to newclient.Client interface for compatibility

func (*Client) Sling added in v2.4.0

func (n *Client) Sling() *sling.Sling

func (*Client) URITemplateCache added in v2.4.0

func (n *Client) URITemplateCache() *uritemplates.URITemplateCache

type ICredential added in v2.32.0

type ICredential interface {
	GetHeaderValue() (string, string)
}

type RootResource

type RootResource struct {
	Application          string     `json:"Application" validate:"required"`
	Version              string     `json:"Version" validate:"required"`
	APIVersion           string     `json:"ApiVersion" validate:"required"`
	InstallationID       *uuid.UUID `json:"InstallationId" validate:"required"`
	IsEarlyAccessProgram bool       `json:"IsEarlyAccessProgram"`
	HasLongTermSupport   bool       `json:"HasLongTermSupport"`

	resources.Resource
}

func NewRootResource

func NewRootResource() *RootResource

func (*RootResource) GetLinkPath

func (r *RootResource) GetLinkPath(args ...interface{}) string

GetLinkPath returns correct Link Path

func (*RootResource) Validate

func (r *RootResource) Validate() error

Validate checks the state of the root resource and returns an error if invalid.

type RootService

type RootService struct {
	services.Service
}

func NewRootService

func NewRootService(sling *sling.Sling, uriTemplate string) *RootService

func (*RootService) Get

func (s *RootService) Get() (*RootResource, error)

Jump to

Keyboard shortcuts

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